Commit graph

7441 commits

Author SHA1 Message Date
3fbc212d63
Bug 24298: Record transfer triggers for returns
This patch adds handling to catch transfers that may have been triggered
on item return.

Test Plan:

1) Enable AutomaticItemReturn and accompanying system preference
2) Return an item to the wrong branch and note the transfer
3) Check the database for the new trigger value

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-03-18 18:57:45 +00:00
06f7cc332c
Bug 19279: performance of linked items in search
When catalog has fields 773 (461 in UNIMARC), those linked items are fetched for display in search results.
Looks like the code could be more performant by replacing item search by $9 with direct call with GetMarcItem().

Test plan :
1) Enable system preference EasyAnalyticalRecords
2) Get a record A with a lot of items, it will be the 'Host record'
3) Click on 'Analytics' on this record
4) On one of its items (say item A1) click on 'Create analytics' to
create record B
5) Enter the same title as record A and all mandatory fields
6) Edit field 773 (461 in UNIMARC)
6) Check that $0 contains the biblionumber of record A
7) Check that $9 contains the itemnumber of item A1
8) Perform a search on record A title, be sure you see record B with
other results
=> Compare execution times with and without patch

Signed-off-by: Hugo Agud <hagud@orex.es>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-03-18 17:51:25 +00:00
c1129d2286
Bug 10269: Use 'reply-to' address if passed to EnqueueLetter
This patch updates the EnqueueLetter method to allow passing a reply_to
address. This allows for passing in arbitrary addresses for the reply
address which will not override the from address. This improves the
chances of your email getting past spam filters.

Signed-off-by: Myka Kennedy Stephens <mkstephens@lancasterseminary.edu>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-03-18 14:03:42 +00:00
c8bf308e1b
Bug 23531: fix ILSDI non-implemented but documented parameters
test plan :
1/ Submit a hold through ILSDI with start_date and expiry_date parameters
2/ Verify in Koha those parameters are not applied to the newly created
reserve. Delete reserve.
3/ Apply patch and repeat 1.
4/ Verify the reserve created by same request as 1 now has both dates
applied and visible in Koha.

Signed-off-by: Christophe Croullebois <christophe.croullebois@biblibre.com>
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-03-18 08:42:31 +00:00
Andreas Roussos
8f9aedaf1d
Bug 24827: Specify UTF-8 as encoding in new_from_xml()
The MARC preview of staged records fails when a staged record contains
items with UTF-8 characters (see attached screenshots). That's because
in EmbedItemsInImportBiblio() the call to MARC::Record->new_from_xml()
does not explicitly specify 'UTF-8' as the optional encoding to use.

This patch fixes that.

Test plan (in a MARC21 instance):
0) Stage for import the test record attached to this bug report (make
   sure that 'Check for embedded item record data?' is set to 'Yes'),
   then go to Home > Tools > Manage staged MARC records and click on
   the filename you've just staged.
1) In the 'Citation' column, click on the hyperlink to launch the MARC
   preview -- notice how it fails to produce any output apart from the
   modal heading.
2) Apply the patch, and restart Plack if necessary.
3) Re-launch the MARC preview: this time the output should include the
   whole record, including the embedded item data in field 952.
4) Run the unit tests to ensure nothing was broken inadvertently:
   $ prove t
   $ prove xt

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-03-16 14:45:47 +00:00
Andreas Roussos
1d26fb3a9d
Bug 24827: Standardise on 'UTF-8' as the encoding name
This patch standardises the encoding name used in direct calls
to new_from_xml() to 'UTF-8' instead of 'utf8' or 'utf-8'.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-03-16 14:45:39 +00:00
Hayley Mapley
619d6362ce
Bug 22943: Renames the in_ipset function to in_iprange in C4::Auth
Bug 14407 introduced a new system preference to allow limiting the
online self checkout system to an IP or IP Range. The function that
handles this is called in_ipset, which is the name of a linux tool. To
stop confusion, this patch renames the function to 'in_iprange', and the
variable 'ipset' within it to 'iprange'.

To test, follow the test plans outlined in Bug 14407 and confirm that
everything works as expected.

Sponsored-by: Catalyst IT
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-03-16 11:00:21 +00:00
218012812d
Bug 24839: Return hold info to transfer script and set borrowernumber
To test:
1 - Place a hold on an item
2 - Go to Circulation->Transfers
3 - Attempt to transfer item to a branch it is not expected at
4 - No warning
5 - Apply patches
6 - Repeate
7 - You get a notice that there is a hold and must deal with the hold (or ignore)

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-03-11 13:40:37 +00:00
faf1e7cd91
Bug 17374: Make use of fields from syspref 'DefaultPatronSearchFields' in patron search fields dropdown
This patch preserves the current dropdown choices for patron search and adds fields from
the DefaultPatronSearchFields system preference

To test:
1 - View the regular patron search and note fields in dropdown
2 - Apply patch, ensure dropdown has not changed
3 - Add fields to DefaultPatronSearchFields, note they are available in
dropdown
4 - Ensure existing and new fields search properly

Signed-off-by: Kelly <kelly@bywatersolutions.com>
Signed-off-by: Maxime Dufresne <maxime.dufresne@inlibro.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-03-10 15:18:29 +00:00
9b86077aae
Bug 17845: Remove unused code related to printers
There is some quite old and unused code in Koha related
to printer configuration and network printing. These code
hasn't been functional in a long time and should be removed.

This patch:

- Removes printcirculationslips system preference
- Removes table printers
- Removes branchprinter column from branches

Check that:
- Go to administration
- Open any age there, but change the last bit to: printers.pl
- Apply patch, run the database update
- Verify the hidden page no longer exists
- Verify that logging in and out still works correctly
- Verify that checkout and returns work correctly
- Switch to another branch using the "Set library" option

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-03-10 15:18:27 +00:00
3cd9d847f7
Bug 23112: (QA follow-up) Fix database update, add filters, remove tabs
Looks like the atomicupdate and sysprefs.sql changes were lost at some point.

Don't forget to run QA tools on your patches before submitting

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-03-10 10:59:49 +00:00
Andrew Isherwood
ae885b99f0
Bug 23112: Update request status on return
This patch updates a request's status to RET upon return

Sponsored-by: Loughborough University
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-03-10 10:59:15 +00:00
e925eb7a14
Bug 13897: Surround columns with backticks
We have some column's names that need to be surrounded by ` as they are
protected keywords ('rows' for instance)

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-03-09 13:50:36 +00:00
Bernardo Gonzalez Kriegel
131183b0bf
Bug 13897: Process description, multiline values and SQL statements in YAML files
This patch adds 3 features:
1) Display description of YAML files at install time
   for frameworks, and fixes it's encoding.
2) Enable use of multiline values, field required
3) Process SQL statements declared in YAML files

With this features we can process files with the
following generic YAML strucure:

  ---
  description:
    - "File description"

  tables:
    - table_name:
        translatable: [ title, content ]
        multiline: [ content ]
        rows:
          - title: "Example title"
            content:
              - "Content:"
              - ""
              - "This is the content."
            id: 1
            value: ~

  sql_statements:
    - "UPDATE table_name SET value ='empty' WHERE value IS NULL"
  ...

* file description is now inside the YAML, can have multiple
  lines.
  This attribute is expected in all YAML files.
* translatable attribute in table declare fields that can be
  translated
* multiline attribute in table declare fields that can have
  multiple lines of content, they are joined using '\r\n'
  before insert into database.
  This is useful to express fields like 'news' content, and
  to simplify it's translation.
  '\r\n' is used for correct display in Windows clients.
* sql_statements allows to add multiple SQL sentences, not
  insertions normally, that are executed in order.

This features are not needed for the example file of this patch,
but will be used in new bugs.

To test:
1) Use the same test plan of first patch.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-03-09 13:50:28 +00:00
fc861f1ed9
Bug 13897: Catch the error and warn it
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-03-09 13:50:19 +00:00
Bernardo Gonzalez Kriegel
3edee6db6f
Bug 13897: Use YAML files for installer data
This patch modifies C4/Installer.pm to add support
for loading YAML files into database.

As an example of the functionality, optional
auth_val.sql file is replaced by auth_val.yml

The rationale behind this feature is to enable the
translation of the data that is loaded into the
database. That will be addressed in another bug.

But taking into account that goal, translatable
values are declared in the YAML files, to ease
identification by translate script.

Also file description is moved into the yaml
file.

To test:
0) Do a clean install with all optional data,
   then dump authorised_values table, reserve.
1) Apply the patch
2) Do a clean install in English (marc21/unimarc)
3) On optional data check for description of auth_val
   "Some basic default authorised values for ..."
4) Select all optional data
5) Finish installation
6) Dump again authorised_values table and compare with that
   of point '0'.
   No differences should be found.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-03-09 13:49:57 +00:00
2ba1493e2e
Bug 23051: (QA follow-up) Missing curly and tabs and fix test
Some rebase issues, accounttype no longer exists, circ rules make
CanBookBeRenewed fail, so we mock that too

interface must be passed as a hashref

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-03-06 10:03:41 +00:00
Andrew Isherwood
a2449a81be
Bug 23051: (follow-up) Add renewal feedback and move code to subroutines and test
Rebasing was a nightmare, so I'm squashing the sign off follow-ups to
ease the pain with any future rebases

Includes:

Bug 23051: (follow-up) Refactor renewal code
As per Nick's first point in comment #20, the code that tests for
renewability and renews items has been refactored into it's own
function.

Bug 23051: (follow-up) Provide feedback
For renewals that fail when a fine is being paid off, this patch causes
any errors to be passed back to the template for display.
Addresses the second point in Nick's comment #20

Bug 23051: (follow-up) Fix unit tests
As raised by Nick in comment #35

Bug 23051: (follow-up) Fix/improve feedback
This follow up patch addresses the following parts of Nick's feedback in
comment #35:
- it would be nice to get feedback on what was successfully renewed as well
- In general I think I would prefer to see 'ok' and 'not_ok' returned as
a single 'renewal_results' array
- There is no listing of errors if I use the 'pay' button on an
individual fine

Bug 23051: (follow-up) Refactor methods
This follow up patch addresses the following parts of Nick's feedback in
comment #35:
- I don't really like that the functions are internal functions and then
exported
- I think the pref description should highlight that if 'RenewalPeriodBase'
is set to due date, there may be doubled charges

Bug 23051: (follow-up) Add SIP summary
This follow up patch addresses the following parts of Nick's feedback in
comment #35:
- Ideally SIP would get feedback in a screen message

Bug 23051: (follow-up) Renewing in OPAC
This follow up patch addresses the following parts of Nick's feedback in
comment #35:
- I am also not sure about the code path if a patron paid fines on the
opac (via paypal etc.) but renewals are not allowed on the opac.

We've introduced the syspref RenewAccruingItemInOpac (default is off)
which, when enabled, will cause items attached to fines that are paid
off in the OPAC (via payment plugins), to be automatically renewed.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-03-06 10:03:34 +00:00
Andrew Isherwood
d26a10c1fe
Bug 23051: Renew items when fines paid off
When the RenewAccruingItemWhenPaid syspref is enabled and all the fines
on an item that is accruing fines are paid, we automatically renew that
item to prevent it from starting to accrue fines again.

This patch adds an additional argument to C4::Circulation::AddRenewal
which allows us to skip the calculation of fines upon renewal, which we
don't want to do if the fines on that item have just been paid. Existing
calls to AddRenewal have not been amended because there seems to be a
convention of only passing undef when adding arguments that require
their positioning to be maintained. Since the new argument is the last
one, this is not the case with any existing call.

Sponsored-by: Loughborough University

Signed-off-by: Lucy Harrison <L.M.Harrison@lboro.ac.uk>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-03-06 10:01:31 +00:00
0fcbec7507
Bug 24719: Remove use of CGI object in C4::Context::set_remote_address()
This patch replaces the CGI "http" object method with its equivalent
class method, which doesn't require object instantiation and thus skips
global initialization and premature handling of the incoming HTTP request.

Test plan:
0. Disable Plack if it is enabled
1. Set koha_trusted_proxies in koha-conf.xml to 1.1.1.1
2. Clear Memcached
3. Try to upload MARCXML file to /cgi-bin/koha/tools/stage-marc-import.pl
4. Note that form below "Upload progress" never appears and errors show
in browser console
5. Apply the patch
6. Try to upload MARCXML file to /cgi-bin/koha/tools/stage-marc-import.pl
7. Note that form appears below "Upload progress"

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-03-06 09:53:08 +00:00
c951f8e06a
Bug 24369: Add CORS support to output_with_http_headers()
This patch adds CORS support to output_with_headers(). It will use the
AccessControlAllowOrigin syspref to pick the value and set the Access-Control-Allow-Origin header.

To test:
1. Apply this patch
2. Run:
   $ kshell
  k$ prove t/Output.t
SUCCESS: Tests pass!
3. Sign off :-D

Signed-off-by: Andrew Isherwood <andrew.isherwood@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-03-05 12:59:44 +00:00
52e95fff34
Bug 24735: Remove QueryParser-related code
At the last development meeting we have voted to remove the
QueryParser-related code
https://wiki.koha-community.org/wiki/Development_IRC_meeting_19_February_2020

Hea tells us that it has not been adopted, and the code/bug tracker that
it is not really usable as it. As nobody is willing to work on it, we
decided to remove it instead.

Test plan:
 % prove t/db_dependent/Search.t
must return green

See commits from bug 9239 and confirm that the code is removed in this
patch.

Also play with the search on the UI and confirm that you do not see
obvious regressions

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-03-02 11:13:03 +00:00
Maryse Simard
b5b8a7daeb
Bug 23488: Line wrapping doesn't always respect word order in Patron card creator
When wrapping long lines of text, the line is divided by removing each
word from the end of the line and putting it in a new one until the line
is the right width. When the word to be removed appears multiple time
in the line, it is not the last occurrence that is removed.

This patch changes the regular expression used to remove the part of
the text that is wrapped to a new line, making sure it removes it at
the end of the text.

Test plan:

1. Go to Tools > Patron card creator

2. Have a card template and a card batch
    -> If needs be, you can create them by using
       New > Card template or New > Card batch

3. Create a layout and use one text field containing a long text with
    at least one word which is repeated a minimum of 2 times
    (preferably towrdds the end of the text, since it has to be picked
    as one of the words to appear in the new line). You can use this:

        one two three one two three one two three one two three
        one two three one two three one two three one two three ...

4. Go to Manage > Card batches and export a batch

5. Choose the layout set up in 3.

6. Click the Export button and open the resulting pdf file

7. Notice all the repeated word have been grouped
    -> For this example : all of the ones appear first, followed by
       all the twos and only then the threes.

8. Apply patch

9. Repeat step 4 through 7
    => this time the order of the words has not changed!

Signed-off-by: Gabriel DeCarufel <gabriel@inlibro.com>
Signed-off-by: William Frazilien <william.frazilien@inlibro.com>
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-03-02 09:49:57 +00:00
64855886b8
Bug 24294: Add default value support for control fields in ACQ framework
When trying to add an order using the ACQ framework with a 008@ tag,
Koha explodes:

Control fields (generally, just tags below 010) do not have subfields,
use data() at /home/vagrant/kohaclone/C4/Acquisition.pm line 3272.

Test plan:
Set a default value for a control field in the ACQ framework
Turn on UseACQFrameworkForBiblioRecords
Create a new order from a new record
The default value should be displayed
Save
=> No crash

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-02-26 20:37:00 +00:00
7d8b96803f
Bug 24545: Fix license statements
Bug 9978 should have fixed them all, but some were missing.
We want all the license statements part of Koha to be identical, and
using the GPLv3 statement.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-02-24 13:31:26 +00:00
18f3b83b6e
Bug 22880: (QA follow-up) Remove opacheader from C4::Auth
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-02-24 13:24:55 +00:00
612887d46f
Bug 24629: SIP patron items contains an array of hashes
$patron->{items} contains the borrowers checkouts as an array of hashes
{ barcode => $item->barcode }

When printing to log we assumed these were only barcodes

This patch pushes the current checkout as a hash and maps the values retrieved to a string

To test:
1 - Enable SIP debug mode
2 - Perform multiple checkouts for a patron
3 - Note the messages like:
    koha koha_sip_koha[13575]: ILS::Checkout: patron 123 has checked out HASH(0x55a5b187f858), HASH(0x55a5b1896ad0), HASH(0x55a5b18a6cf0), 7826832
4 - Apply patch
5 - Restart all the things
6 - Do some checkouts via SIP
6 - Messages should now have barcodes

Signed-off-by: Magnus Enger <magnus@libriotech.no>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-02-24 13:18:36 +00:00
721c8bcd18
Bug 24629: SIP log - Display barcode instead of hash
Signed-off-by: Magnus Enger <magnus@libriotech.no>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-02-24 13:18:36 +00:00
8a6dd41d3a
Bug 24705: Holds placed via SIP will be given first priority
The SIP server does not calculate and pass a priority to AddReserve, which causes the hold to be given priority 1.

Test Plan:
1) Place a hold via SIP for a record with existing holds
2) Note the new hold is top priority
3) Apply this patch
4) Restart SIP
5) Repeat step 1
6) New hold should be last priority

Signed-off-by: Christofer Zorn <Christofer.Zorn@ajaxlibrary.ca>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-02-24 09:57:07 +00:00
Charles Farmer
bd141a442e
Bug 11297: Add support for custom PQF attributes for Z39.50 server searches.
Adds the "Attributes" field to z3950 servers.

The feature here is not quite de same.

In the old patches, the attributes were applied to individual query parts if the part already contains "@attr" and the additionnal attribute is not already in the query part.

Here, the content of the new field is prepended to all PQF queries sent to the server.

This new way of doing is simpler and works for the sponsor.

Test plan:
 I) Apply the patch
II) Run updatedatabase.pl

1) Add a new z3950 server with the following parameters:
Hostname : catalogue.banq.qc.ca
Port     : 210
Database : IRIS
Syntax   : Marc21

2) Perform a z3950 search on that server.
    Keyword (Any) : egypt
2.1) Nothing Found.

3) Add attributes on the server administration page
    @attr 4=1

4) Perform the same z3950 search
4.1) A lot of results

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-02-19 16:07:59 +00:00
d4783f244b
Bug 24269: Adjust C4::Heading to generate headings from auth tags
To test:
1 - Be using Elasticsearch
2 - Check that field 150 is mapped to 'Match-heading' or add it (the subfields don't matter)
3 - Add a topic term authority record like "150 $aCats$vFiction"
4 - Add a 650 with $aCats and $vFiction and  $e depicted to a bibliographic record
5 - Run the linker for the bib
    perl misc/link_bibs_to_authorities.pl --bib-limit "biblionumber=89" -v
6 - Confirm the record is not correctly linked to the record
7 - Apply patch
8 - Reindex authorities for ES
    perl misc/search_tools/rebuild_elasticsearch.pl -v -d -a
9 - Run the linker and confirm record is correctly linked
    perl misc/link_bibs_to_authorities.pl --bib-limit "biblionumber=89" -v

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Bouzid Fergani <bouzid.fergani@inlibro.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-02-19 13:33:32 +00:00
9079146242
Bug 24367: (RM follow-up) Syntax error correction
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-02-19 12:03:40 +00:00
2cf4496dd6
Bug 24094: Strip trailing spaces and punctuation from authority headings
Both when searching for and creating new authorities we need to remove
punctuation that exists in the bibliographic record but does not belong in
the authority record.

For example, a series with a volume contains a semicolon in the bib record,
however, this should not be passed to the authority as the volume is not
included in the authority record.

To test:
 1 - Set AutoCreateAuthorities to 'generate'
 2 - Set BiblioAddsAuthorities to 'true'
 3 - Set CatalogModuleRelink to 'Do'
 4 - Find or create a record with:
    a 100 field with a subfield e preceded by a comma: 100 $aBoring, M. Eugene M ,$e author
    an 830 field with a volume preceded by a semicolon: 650$aLord of the rings ;$v 3.
 5 - Save the records and check the links
 6 - Note punctuation is passed through
 7 - Save again, auth records are created again
 8 - Apply patch
 9 - Save again, new auth records are created again
10 - Check the records, punctuation has been removed
11 - Save again, no more records created.

Signed-off-by: Myka Kennedy Stephens <mkstephens@lancasterseminary.edu>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-02-19 11:31:28 +00:00
515df43af8
Bug 21944: Improve efficiency of code
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-02-19 11:24:48 +00:00
Christopher Brannon
07ad62380e
Bug 21944: Reroute waiting hold from wrong branch
To Test:
1) Place a hold on an item.
2) Check in the item to trigger the hold.  Item is now listed as
waiting.
3) Set branch to a different library.
4) Check in the item to trigger the hold.  Notice that nothing but a
local use is recorded.
5) Apply the patch.
6) Repeat steps 1-4.  Notice that the hold is triggered around routed to
its original pickup location.  A transfer is set and the hold status
is changed from waiting to correctly showing the item as in transit.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-02-19 11:24:43 +00:00
5ecabb315a
Bug 24367: May fix another warning
May fix the following warning:
Use of uninitialized value in concatenation (.) or string at
/kohadevbox/koha/C4/Search.pm line 1818.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-02-19 11:22:30 +00:00
0fdc9377d7
Bug 24367: Resolve other uninitialized warns in Search.pm
Use of uninitialized value in hash element at /usr/share/koha/C4/Search.pm line 2074.
Use of uninitialized value in hash element at /usr/share/koha/C4/Search.pm line 2137.
Use of uninitialized value in concatenation (.) or string at /usr/share/koha/C4/Search.pm line 2189.
Use of uninitialized value in hash element at /usr/share/koha/C4/Search.pm line 2213.
Use of uninitialized value in hash element at /usr/share/koha/C4/Search.pm line 2215.
Use of uninitialized value in hash element at /usr/share/koha/C4/Search.pm line 2225.
Use of uninitialized value in hash element at /usr/share/koha/C4/Search.pm line 2226.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-02-19 11:22:26 +00:00
e3c8ba65cf
Bug 24367: Resolve warn Use of uninitialized value within [arrays]
Use of uninitialized value within @operators in string eq at /usr/share/koha/C4/Search.pm line 1362.
Use of uninitialized value within @indexes in pattern match (m//) at /usr/share/koha/C4/Search.pm line 1367.

Trivial tests added.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-02-19 11:22:23 +00:00
c801ea3c69
Bug 24367: Resolve warn Argument available is not numeric in delete
Argument "available" isn't numeric in delete at /usr/share/koha/C4/Search.pm line 1480.
The construction delete array[string] simply does not work.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-02-19 11:22:14 +00:00
76a4753dfe
Bug 24367: Remove warnings from Search.t
* Set defaults for index to 'kw'
* Check that priority is defined before using it.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-02-19 11:20:15 +00:00
799ec12063
Bug 24002: (follow-up) Incorrect DATE value: '00-00-0000' in C4/Serials.pm
Oops, wrong copy/paste here! The column order changes was not expected.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-02-18 13:53:31 +00:00
68a92c02df
Bug 21921: Add date publication year to biblio Z39.50 search form
Test plan:

1) Apply the patch
2) Have a Z39.50 endpoint with attr 31 defined - Library of Congress
supports this
3) Try to find some biblio records through Z39.50 using the new field
"Publication year"

Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-02-17 13:44:23 +00:00
1f1ff392fb
Bug 7611: (follow-up) separate positive and negative statuses as in the past
This patch preserves someting closer to previous functionality.

Negative not for loan are in the 'unavailable' section in red, positive ones are in the 'reference' section in green. Itemtype level will also be in green in reference

Item specific status will override an itemtype level.

The line break between 'reference' and 'unavailable' existed before and is preserved - negative not for loan and checked out items appear here

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-02-17 11:21:38 +00:00
2513b4f596
Bug 7611: (follow-up) Fix display of undefined statuses and add a class
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-02-17 11:21:32 +00:00
86f203ebe5
Bug 7611: Change negative notforloan as well
This makes the changes apply to both positive and negative notforloan values

The extra line generated before is removed

Some spans are added and cleaned up and labels moved to CSS to allow for easier altering where needed

Itemtypes marked notforloan remain as reference, the label can be changed via css

To test:
 1 - Have a record with items in various statuses, ideally
   - 3 available, with 2 in one branch, 1 in another
   - 3 with itemtype not for loan, 2 in one branch, 1 in another
   - 3 in a positive not for loan status, 2 and 1 as above
   - 3 in a negative not for loan status, 2 and 1 as above
   - 1 in a different positive loan status, but with the same opac description as the negative above
 2 - Search the opac to include this record, take a screenshot
 3 - Apply patch
 4 - Restart all and refresh
 5 - Compare to screen shot
 6 - Differences include:
   - Positive statuses are now on separate line with opac description showing
   - Unavailable (not for loan items) now include callnumber and branch in display
   - Positive and negative notforloan with same description are combined where branches match
   - Inspect the elements, note new spans around 'Items available for
loan/reference'
 7 - Add to OPACUserCSS:
  .ItemSummary .ItemBranch{
    display:none;
  }
  .unavailable .ItemSummary .CallNumber,.unavailable .ItemSummary .LabelCallNumber{
    display:none;
  }
 8 - Note the branches are hidden, and callnumbe rhidden for unavailable
items

Signed-off-by: Jessica Zairo <jzairo@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-02-17 11:21:20 +00:00
Mehdi Hamidi
d8159b61f5
Bug 7611: Show the NOT_LOAN authorised values for item status in XSLT OPAC search results
Added : Call number for all not for loan status

XSLT Results template improvement : Use the NOT_LOAN authorised values

Improvement : Use the NOT_LOAN authorised values when showing items status in the OPAC search results.
Before this patch, these items were only considered as "unavailable".

Note : This patch only affects the OPAC XSLT search results template for MARC21 records. This patch was not tested on UNIMARC or NORMARC records. I won't be able to support these formats, so I'm hoping someone could do the same for these other record formats.

Sponsored-by: CCSR ( http://www.ccsr.qc.ca )
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-02-17 11:20:52 +00:00
82716a0172
Bug 23084: Replace grep {^$var$} with grep {$_ eq $var}
We certainly faced 3 similar bugs due to this syntax: bug 23006, bug
22941 and bug 17526.

To prevent other issues related to this syntax this patch suggests to
replace them all in one go.

Test plan:
Confirm that the 2 syntaxes are similar
Eyeball the patch and confirm that there is no typo!

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-02-17 10:44:45 +00:00
Magnus Enger
d1a0921fd1
Bug 24531: Fix OAI-PMH sets for records with repeated fields
Currently, an OAI-PMH set mapping will only match if the value it
is looking for occurs in the first instance of a repeated field.

To test:
- Apply the first patch with two new tests
- Run something like this:
  sudo koha-shell -c "prove -v t/db_dependent/OAI/Sets.t" kohadev
- Verify that the last test fails
- Apply this secind patch
- Rerun the test file above
- Verify that all tests now pass

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-02-14 12:00:35 +00:00
b9ecf361a8
Bug 24592: Reword LOST_RETURN to LOST_FOUND
This patch updates the wording in the 'lost and found' process to more
closely reflect what the process is achieving by replacing 'RETURNED'
with 'FOUND'

Test plan:
1) Grep codebase for _FixAccountForLostAndReturned and note there are no
   longer any instanced of it.
2) Run t/db_dependent/Circulation.t and note it passes
3) Test returning/renewing an item that has been marked as lost and note
   the updated values in the accountlines now use LOST_FOUND as
   credit_type_code and 'FOUND' as the status for the 'LOST' fee
   (debit_type_code 'LOST')

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-02-13 15:58:49 +00:00
f2b1086387
Bug 24361: Silent Items/GetItemsForInventory.t
It was displaying hundreds of:
Use of uninitialized value in concatenation (.) or string at
/kohadevbox/koha/C4/Items.pm line 862.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-02-13 09:33:21 +00:00