koha.git
3 years agoBug 26528: Z39.50/SRU ignore invalid replies
Didier Gautheron [Thu, 24 Sep 2020 08:13:08 +0000 (10:13 +0200)]
Bug 26528: Z39.50/SRU ignore invalid replies

When searching for authorities if an authorities server reply has invalid records
none are displayed.

At least french BNF SRU server doesn't fully follow norm and can return an error
confusing Koha protocol handler which then returns an empty MARC record.

This patch silently removed bogus records.

To Test:
1- Add BNF SRU server
2- Go to authorities page
3- Add an authority
4- Search for keyword(any) droits de l'homme
5- No result (Internal Server Error)
6- Apply patch
7- restart starman
8- redo 4
9- Many records are displayed

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 15986: Add missing notice template for it-IT
Jonathan Druart [Fri, 16 Apr 2021 14:07:40 +0000 (16:07 +0200)]
Bug 15986: Add missing notice template for it-IT

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 18017: Use index_heading and index_match_heading in UNIMARC authorities zebra...
Fridolin Somers [Tue, 22 Dec 2020 10:07:03 +0000 (11:07 +0100)]
Bug 18017: Use index_heading and index_match_heading in UNIMARC authorities zebra configuration

For a good management of autorities linking to biblio records,
MARC21 uses index_heading and index_match_heading in authorities zebra configuration.
UNIMARC configuration must use the same.

This patch adds in UNIMARC authorities zebra configuration index_heading and index_match_heading to earch heading
in order to be maximum close to MARC21 authorities zebra configuration.
See changes made in MARC21 :
https://git.koha-community.org/Koha-community/Koha/commit/32cf2af700dfea15d9c4f99bee97e97c85643896

It fixes some indexes names : Personal-name-see => Personal-name-see-from

Removes useless Term-geographic index, a duplicate of Name-geographic.

Sometimes parallel 7xx form whas only on $a, it must contains same subfields
has the main heading.

Test plan :
===========
1.0) Use a UNIMARC install without patch
1.1) Set sysprefs
     BiblioAddsAuthorities = ON
     AutoCreateAuthorities = ON
     LinkerModule = First Match
1.2) Replace authorities zebra configuration files
     cp $KOHA_CLONE/etc/zebradb/marc_defs/unimarc/authorities/authority-koha-indexdefs.xml $KOHA_CONF_DIR/zebradb/marc_defs/unimarc/authorities/authority-koha-indexdefs.xml
     cp $KOHA_CLONE/etc/zebradb/marc_defs/unimarc/authorities/authority-zebra-indexdefs.xsl $KOHA_CONF_DIR/zebradb/marc_defs/unimarc/authorities/authority-zebra-indexdefs.xsl
1.3) Restart zebra server and indexer services
1.4) Reindex authorities
     ./misc/migration_tools/rebuild_zebra.pl -r -a -v
1.5) Search in Z3950 a record with complex heading (with subdivisions),
     for example ISBN 2877620115 "Facteurs culturels et sociaux de la santé en Afrique de l'Oues"
1.6) Import this record and save it : authorities are created
     go to staff:/cgi-bin/koha/cataloguing/addbooks.pl
1.7) Reimport the same record (when asked, say that it's not a duplicate)
1.8) The authority should have been duplicated :
     different url and different $9 value
2.0) Apply this patch
2.1) Replace again the authorities zebra configuration files
2.2) Restart zebra server and indexer services
2.3) Reindex authorities
2.4) Reimport the same record
2.5) The authority should have not been duplicated. Compare with both
       existing records to see which the 3rd has been matched against.
3.0) Play with authorities search to check every mode :
     Search main heading ($a only)
     Search main heading
     Search all headings
     Search entire record

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 18017: Add subdivisions to UNIMARC authorities zebra configuration
Fridolin Somers [Thu, 17 Dec 2020 14:47:48 +0000 (15:47 +0100)]
Bug 18017: Add subdivisions to UNIMARC authorities zebra configuration

Like for MARC21, UNIMARC authorities has subdivisions form, general,
chronological and geographic.

In C4::Heading::UNIMARC, use subdivisions in _get_search_heading like in C4::Heading::MARC21.

Adds subdivisions variables into UNIMARC authorities zebra configuration.

Note that unlike MARC21 geographic is subfield $y and chronological is subfield $z.
See https://www.ifla.org/publications/unimarc-formats-and-related-documentation

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 15986: DBRev 20.12.00.032
Jonathan Druart [Fri, 16 Apr 2021 12:16:47 +0000 (12:16 +0000)]
Bug 15986: DBRev 20.12.00.032

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 15986: move holds_reminder.pl to misc/cronjobs/holds/
Jonathan Druart [Fri, 16 Apr 2021 12:33:24 +0000 (14:33 +0200)]
Bug 15986: move holds_reminder.pl to misc/cronjobs/holds/

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 15986: (follow-up) Switch nomail to confirm
Nick Clemens [Thu, 15 Apr 2021 12:50:32 +0000 (12:50 +0000)]
Bug 15986: (follow-up) Switch nomail to confirm

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 15986: Fix typo following vs follwing
Jonathan Druart [Fri, 9 Apr 2021 14:32:12 +0000 (16:32 +0200)]
Bug 15986: Fix typo following vs follwing

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 15986: Use KohaDates filter to correctly format the waitingdate
Jonathan Druart [Fri, 9 Apr 2021 14:18:10 +0000 (16:18 +0200)]
Bug 15986: Use KohaDates filter to correctly format the waitingdate

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 15986: (follow-up) Add atomic update
Nick Clemens [Fri, 9 Apr 2021 14:15:09 +0000 (14:15 +0000)]
Bug 15986: (follow-up) Add atomic update

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 15986: Add sample notice to translated notices
Nick Clemens [Thu, 8 Apr 2021 14:55:27 +0000 (14:55 +0000)]
Bug 15986: Add sample notice to translated notices

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 15986: Add sample notice and use as default
Nick Clemens [Thu, 8 Apr 2021 14:43:10 +0000 (14:43 +0000)]
Bug 15986: Add sample notice and use as default

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 15986: (follow-up) Add all holds per patron
Nick Clemens [Thu, 8 Apr 2021 13:43:40 +0000 (13:43 +0000)]
Bug 15986: (follow-up) Add all holds per patron

This changes the code to loop through all the holds and group by patron,
we then send the holds to the letter using the 'loops' option

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 15986: (follow-up) Use inbound_email_address for library
Nick Clemens [Wed, 7 Apr 2021 15:01:29 +0000 (15:01 +0000)]
Bug 15986: (follow-up) Use inbound_email_address for library

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 15986: (follow-up) Fix usage statement
Nick Clemens [Wed, 7 Apr 2021 11:42:37 +0000 (11:42 +0000)]
Bug 15986: (follow-up) Fix usage statement

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 15986: (QA follow-up) Fix spelling mistake
Martin Renvoize [Wed, 24 Mar 2021 11:48:45 +0000 (11:48 +0000)]
Bug 15986: (QA follow-up) Fix spelling mistake

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 15986: (QA follow-up) Account for bugs 25333 and 25334
Martin Renvoize [Wed, 24 Mar 2021 11:40:09 +0000 (11:40 +0000)]
Bug 15986: (QA follow-up) Account for bugs 25333 and 25334

Bug 25333 changed the existing 'phone' message transport type to 'itiva' and
bug 25334 added a new 'phone' message transport type.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 15986: Rename send_notice to queue_notice and update test count
Nick Clemens [Thu, 16 Jul 2020 16:46:22 +0000 (16:46 +0000)]
Bug 15986: Rename send_notice to queue_notice and update test count

Signed-off-by: Kim Gnerre <kgnerre@hotchkiss.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 15986: Update for bug 24159
Nick Clemens [Thu, 16 Jul 2020 16:34:26 +0000 (16:34 +0000)]
Bug 15986: Update for bug 24159

The job is concerned with holds waiting and takes days, I think using days_mode 'Calendar'
makes sense as we are not calculating due dates

Signed-off-by: Kim Gnerre <kgnerre@hotchkiss.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 15986: Add a script for sending hold waiting reminder notices
Nick Clemens [Tue, 12 Jul 2016 17:16:45 +0000 (13:16 -0400)]
Bug 15986: Add a script for sending hold waiting reminder notices

This patch adds a script for sending holds reminder notice to patrons.

We add a 'send_notice' routine to Koha::Patrons - this will either send using the patron's
email prefs, or allow forcing of a single method via the cron

To test:
 1 - Create an email hold reminder notice for a single library (Koha module: Holds, code HOLDREMINDER, branch: CPL)
 2 - Set some waiting holds today for patrons at CPL, ensure those patrons have 'email' as the transport for hold filled notices
 3 - perl misc/cronjobs/holds_reminder.pl -v -lettercode HOLDREMINDER -n -li CPL
 4 - You should see the patrons here would have received emails
 5 - perl misc/cronjobs/holds_reminder.pl -v -lettercode HOLDREMINDER -li CPL
 6 - You should see the emails that were sent
 7 - Check the patron notices tab to confirm
 8 - Note a ptron with two holds waiting receives only one notice
 9 - perl misc/cronjobs/holds_reminder.pl -v -lettercode HOLDREMINDER -li CPL -days 3
10 - No notices are sent
11 - Adjust the waiting date for the holds:
    UPDATE reserves SET waitingdate=DATE_SUB(CURDATE(), INTERVAL 3 DAY) WHERE waitingdate = CURDATE();
12 - perl misc/cronjobs/holds_reminder.pl -v -lettercode HOLDREMINDER -li CPL -days 3
13 - Confirm the holds are now reminded
14 - Set yesterday as a holiday for CPL
15 - perl misc/cronjobs/holds_reminder.pl -v -lettercode HOLDREMINDER -n -li CPL -holidays -days 3
16 - Notices should not be sent
17 - perl misc/cronjobs/holds_reminder.pl -v -lettercode HOLDREMINDER -n -li CPL -holidays -days 2
18 - Notices should be sent again
19 - perl misc/cronjobs/holds_reminder.pl -v -lettercode HOLDREMINDER -n -holidays -days 2
20 - Should get feedback that notice was not found for other libraries
21 - perl misc/cronjobs/holds_reminder.pl -v -lettercode HOLDREMINDER -n -holidays -days 2 -mtt sms
22 - Notice is not found
23 - Add the notice for sms
24 - perl misc/cronjobs/holds_reminder.pl -v -lettercode HOLDREMINDER -n -holidays -days 2 -mtt sms
25 - The notice should be sent
26 - Check patrons messaging tab to confirm
27 - prove -v t/db_dependent/Koha/Patrons.t

Sponsored by: The Hotchkiss School (http://www.hotchkiss.org/)

Signed-off-by: Kim Gnerre <kgnerre@hotchkiss.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27961: Ensure external URLs are filtered
Aleisha Amohia [Mon, 15 Mar 2021 21:41:53 +0000 (10:41 +1300)]
Bug 27961: Ensure external URLs are filtered

TT variables are used to build the link in items.uri . This is a problem
particularly when TrackClicks is enabled because the items.uri value
doesn't get escaped, resulting in a 404.

To test:
1) Enable the TrackClicks system preference (set to Track or Track
    anonymously)
2) Find a record with an item
3) Edit the item and put an external URL under the Uniform Resource
Identifier field
4) Go to that record in the OPAC
5) Click on Link to resource
6) Confirm you are not redirected to the URL and instead see a 404
7) Apply the patch and refresh the page
8) Click on Link to resource
9) Confirm you are redirected as expected
10) Go back to the staff client to edit your item. This time put two
URLs in the Uniform Resource Identifier field, separated by ' | '.
(Don't forget the spaces around the pipe, and don't forget to add a
 trailing slash to the URL).
11) Go back to the OPAC and refresh the page.
12) Confirm both URLs redirect as expected.

Sponsored-by: Parliamentary Library New Zealand
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 21325: Add tests
Jonathan Druart [Fri, 16 Apr 2021 12:13:45 +0000 (14:13 +0200)]
Bug 21325: Add tests

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 21325: Fix t/db_dependent/Auth.t test
David Cook [Thu, 24 Dec 2020 01:43:59 +0000 (01:43 +0000)]
Bug 21325: Fix t/db_dependent/Auth.t test

This patch fixes some warnings in t/db_dependent/Auth.t.

Note that it doesn't add any tests.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 21325: Prevent authentication when sending userid and password in querystring
David Cook [Thu, 24 Dec 2020 01:24:08 +0000 (01:24 +0000)]
Bug 21325: Prevent authentication when sending userid and password in querystring

This patch permits authentication via userid/password only when the
HTTP method is POST when using C4::Auth::checkauth().

The goal is to stop people from supplying userid and password in querystrings
in order to log into web pages.

Test plan:
0. Do not apply patch yet
1. Open a new browser (ie we don't want any existing CGISESSID cookies
available - opening a new tab/window isn't enough. It must be a
new instance or you can clear your cookies)
2. Go to http://localhost:8080/cgi-bin/koha/opac-reserve.pl?biblionumber=29&userid=koha&password=koha
3. Note the user has been logged in and is being asked to confirm hold.

4. Apply the patch

5. Go to http://localhost:8080/cgi-bin/koha/opac-reserve.pl?biblionumber=29&userid=koha&password=koha
6. Note the user is not logged in and the user is presented with a login screen

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27529: Choose patron's branch or item's homebranch if following group rules and...
Nick Clemens [Mon, 25 Jan 2021 15:34:31 +0000 (15:34 +0000)]
Bug 27529: Choose patron's branch or item's homebranch if following group rules and patron cannot choose branch

This patch defaults the holds pickup location to the items homebranch or the patron's branch when a group option is selected
for the hold fulfillment policy and the patron is not allowed to choose the branch on the OPAC

To test:
1 - Set 'Default checkout, hold and return policy' -> 'Hold pickup library match' to item's hold group or patron's hold group
2 - Set  OPACAllowUserToChooseBranch to 'Don't allow'
3 - Try to place an item level hold on the opac
4 - Ka-boom, etiher:
    The method Koha::Item->patrongroup is not covered by tests!
    The method Koha::Item->itemgroup is not covered by tests!
5 - Apply patch
6 - Repeat
7 - Note the pickup location is set to either the patron's branch or the items homebranch
8 - Repeat plan with the other group setting

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28154: Fix encoding issues on Koha-installer.pot
Julian Maurice [Fri, 16 Apr 2021 07:41:44 +0000 (09:41 +0200)]
Bug 28154: Fix encoding issues on Koha-installer.pot

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28154: Fix encoding issues on Koha-pref.pot
Jonathan Druart [Thu, 15 Apr 2021 14:55:30 +0000 (16:55 +0200)]
Bug 28154: Fix encoding issues on Koha-pref.pot

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27979: Modify TrackClicks to verify URL exists in DB when multiple uri
Aleisha Amohia [Wed, 17 Mar 2021 20:38:06 +0000 (09:38 +1300)]
Bug 27979: Modify TrackClicks to verify URL exists in DB when multiple uri

To test:
1) Go to Admin -> system preferences and enable the TrackClicks syspref
(set to Track or Track anonymously)
2) Find a record in the staff client with an item. Edit the item and put
two external URLs in the Uniform Resource Identifier field, e.g.
"https://www.google.com/ | https://twitter.com/"
3) Search for that record in the OPAC. Notice the two links in the
holdings table.
4) Click a link and confirm that you are directed to a 404.
5) Apply the patch and refresh the page
6) Click a link and confirm that you are directed to the page as
expected
7) Go back to edit the record in the staff client and remove one of the
links from the URI field
8) Go back to the OPAC and confirm you can still access the link as
expected when there is only one URI

Sponsored-by: Catalyst IT
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28123: Fix expected value in unit test
David Cook [Tue, 13 Apr 2021 00:45:42 +0000 (00:45 +0000)]
Bug 28123: Fix expected value in unit test

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28123: Quote filename value in Content-Disposition header
David Cook [Tue, 13 Apr 2021 00:39:04 +0000 (00:39 +0000)]
Bug 28123: Quote filename value in Content-Disposition header

Chrome throws a ERR_RESPONSE_HEADERS_MULTIPLE_CONTENT_DISPOSITION
error if a Content-Disposition header includes an unquoted filename
that contains commas.

This patch adds quotes around the filename in the Content-Disposition
header, which fixes the problem.

Test plan:
0. Do not apply the patch yet
1. Obtain a PDF and rename it to include a comma in its name
2. Enable the upload.pl plugin in the 856$u of the Default framework
3. Add/edit a record in the Default Framework and upload a file
using the 856$u upload plugin.
4. Click on the resulting file URL in the saved file
5. Note the error ERR_RESPONSE_HEADERS_MULTIPLE_CONTENT_DISPOSITION
is returned instead of the file

6. Apply the patch and restart your Plack instance

7. Click on the resulting file URL in the saved file
8. Note that you now get the PDF file instead of the error

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28103: Fix barcode plugin on the order receive view
Jonathan Druart [Fri, 9 Apr 2021 09:58:34 +0000 (11:58 +0200)]
Bug 28103: Fix barcode plugin on the order receive view

Fix the following error:
Uncaught TypeError: Cannot read property 'field_value' of null

Test plan:
Set "AcqCreateItem" to "receiving an order"
Set "autoBarcode" to "generated in the form <branchcode>yymm0001"

Create an order and go to receive it at a path like
/cgi-bin/koha/acqui/orderreceive.pl?ordernumber=2&invoiceid=1

Click on the barcode input and confirm that it's prefilled
automatically

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28125: Display a warning on the about page for OPACHiddenItems is needed
Jonathan Druart [Tue, 13 Apr 2021 08:47:19 +0000 (10:47 +0200)]
Bug 28125: Display a warning on the about page for OPACHiddenItems is needed

If OPACHiddenItems is containing badly construct it will lead to
inconsistent behaviours. For instance the holds view will not display
any items, when the detail page will display all of them (because we are
not using the same code, we are in transition to merge it).

This patch suggests to add a warning to the about page in case the query
generated by Koha::Items->filter_by_visible_in_opac produces a warning

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Bug 28125: (QA follow-up) Fix missing filter

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28139: Simplify logic for handling found holds in returns.pl
Joonas Kylmälä [Tue, 13 Apr 2021 08:34:55 +0000 (11:34 +0300)]
Bug 28139: Simplify logic for handling found holds in returns.pl

We are handling in this if-else block 3 cases:
 - Hold found and waiting
 - Hold found but not waiting AND whether HoldsAutoFill is enabled
 - Hold found but not waiting AND whether HoldsAutoFill disabled

If we simply first handle hold found = Waiting case first then we
don't have to individually list all those other found cases and that
simplifies this code a lot.

To test:
 1. Apply patch
 2. Make sure HoldsAutoFill is disabled
 3. Make item-level hold on branch A
 4. Check-in the item at branch A and you should get pop-up confirming
    the hold, ignore it
 5. Set HoldsAutoFill is enabled
 4. Check-in the item again and you now the hold should have been
    automatically filled

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28139: Handle Processing status with HoldsAutoFill pref turned on
Joonas Kylmälä [Tue, 13 Apr 2021 08:22:16 +0000 (11:22 +0300)]
Bug 28139: Handle Processing status with HoldsAutoFill pref turned on

To test:
 1: Turn on HoldsAutoFill setting
 2: Place a item-level hold on item X at Branch A
 3: Make the hold to Processing state:
 $ koha-mysql kohadev
 > select * from reserves; # look up the reserve_id
 > UPDATE reserves SET found = 'P', priority = 0 WHERE reserve_id = XXX;
 4: Check in the item X at Branch A - A pop-up asking confirmation comes
 5: Apply patch & restart plack
 6: Check in the item X again at Branch A - now the hold is confirmed automatically

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28147: Pass itemnumber through to Account->pay
Nick Clemens [Wed, 14 Apr 2021 13:48:08 +0000 (13:48 +0000)]
Bug 28147: Pass itemnumber through to Account->pay

Currently the itemnumber is not passed through when paying a single fine,
we should do that

To test:
1 - Create a manual debit and provide a barcode so the debit is linked to an item
2 - Go to the 'Make a payment' tab. Click the 'Writeoff' button on the individual line
3 - View the 'Transactions tab' The writeoff has no item details
4 - Apply patch
5 - Repeat 1 & 2
6 - View the transactions tab. The writeoff shows item details
7 - Confirm 'Writeoff amount' and 'Writeoff selected' still work and do not link to item

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27739: Advanced editor should use DefaultCountryField008 preference
Phil Ringnalda [Thu, 1 Apr 2021 18:36:43 +0000 (11:36 -0700)]
Bug 27739: Advanced editor should use DefaultCountryField008 preference

Uses the system preference DefaultCountryField008, falling back to ||| (no
attempt to code) if it is not set, for 008/15-17 place of publication in
the advanced cataloging editor..

Test plan:
1) Apply patch and restart all the things, something's over-cached here
2) Administration - Toggle the preference  EnableAdvancedCatalogingEditor
   to "Enable", verify the preference DefaultCountryField008 is empty
3) Cataloging - Advanced editor
4) In field 008, verify that the three characters after the two sets of
   four blank spaces are |||
5) Administration - Set DefaultCountryField008 to fr
6) Cataloging - Advanced editor
7) In field 008, verify that the three characters after the two sets of
   four blank spaces are "fr " (including the space, so following
   characters haven't shifted left, and the last character is still d)

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28118: Default to current branch when placing hold
Tomas Cohen Arazi [Mon, 12 Apr 2021 19:01:03 +0000 (16:01 -0300)]
Bug 28118: Default to current branch when placing hold

During bug 27071 development, this line got inadvertedly changed. This
patch restores the original behaviour.

To test:
1. Search for a title
2. Go try place a hold
=> FAIL: Look at the HTML, there's no pickup location with
selected="selected"
3. Switch branch and repeat 2
=> FAIL: Still the same
4. Apply this patch
5. Repeat 2 and 3
=> SUCCESS: Branch is selected, chosen current branch is picked
6. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28001: (QA follow-up) Clarify messages and indicate test mode
Nick Clemens [Thu, 15 Apr 2021 15:43:23 +0000 (15:43 +0000)]
Bug 28001: (QA follow-up) Clarify messages and indicate test mode

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28001: (bug 27050 follow-up) Fix delete_patrons if no category passed
Jonathan Druart [Fri, 9 Apr 2021 09:00:37 +0000 (11:00 +0200)]
Bug 28001: (bug 27050 follow-up) Fix delete_patrons if no category passed

GetBorrowersToExpunge must not crash if called with an empty patron
category list

Test plan:
Call delete_patrons.pl with and without patron categories. The script
must work as expected

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28015: Fix inventory for timeformat=12h
Jonathan Druart [Fri, 9 Apr 2021 09:22:11 +0000 (11:22 +0200)]
Bug 28015: Fix inventory for timeformat=12h

Inventory explodes with the following stacktrace if timeformat is set to 12h

Invalid value passed, datelastseen=2021-04-09 12:00 AM expected type is date at /usr/share/perl5/Exception/Class/Base.pm line 88
        Exception::Class::Base::throw('Koha::Exceptions::Object::BadValue', 'type', 'date', 'value', '2021-04-09 12:00 AM', 'property', 'datelastseen') called at /kohadevbox/koha/Koha/Object.pm line 196
        Koha::Object::catch {...} ('DBIx::Class::Exception=HASH(0x557a052baeb0)') called at /usr/share/perl5/Try/Tiny.pm line 124
        Try::Tiny::try('CODE(0x557a051931d8)', 'Try::Tiny::Catch=REF(0x557a052bfc30)') called at /kohadevbox/koha/Koha/Object.pm line 206
        Koha::Object::store('Koha::Item=HASH(0x557a0521a048)') called at /kohadevbox/koha/Koha/Item.pm line 202
        Koha::Item::store('Koha::Item=HASH(0x557a0521a048)') called at /kohadevbox/koha/tools/inventory.pl line 220

Test plan:
Set TimeFormat to 12h
Use the inventory
=> Confirm that it's working with this patch applied

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27796: (QA follow-up) Missing filters
Nick Clemens [Thu, 15 Apr 2021 18:58:33 +0000 (18:58 +0000)]
Bug 27796: (QA follow-up) Missing filters

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27796: (QA follow-up) Fix for missing 'Account credit'
Martin Renvoize [Thu, 11 Mar 2021 15:03:18 +0000 (15:03 +0000)]
Bug 27796: (QA follow-up) Fix for missing 'Account credit'

Good catch Sally!  The data-member attribute was using an incorrect
parameter name to fetch the accountline borrowernumber data.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27796: Centralise payment/transaction type handling
Martin Renvoize [Thu, 25 Feb 2021 17:28:33 +0000 (17:28 +0000)]
Bug 27796: Centralise payment/transaction type handling

This patch centralises the payment/transaction type select options
handling so the SIP types are properly in all cases.

Test plan
1) Check that SIP payment types are properly hidden on the following
   modals.
1a) Refund modal on the borrower account page (The 'Account credit'
option should appear here)
1b) Payout modal on borrower account page
1c) Payment via paycollect
1d) Payment via point of sale
1e) Refund via point of sale, register details page (The 'Account
credit' option should only appear for debts associated to a patron and
not for payments accepted via point of sale)
2) Signoff

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27927: Prevent renewal on lost forgive
Martin Renvoize [Wed, 24 Mar 2021 17:13:57 +0000 (17:13 +0000)]
Bug 27927: Prevent renewal on lost forgive

The `RenewAccruingItemWhenPaid` preference should only renew upon
payment (and writeoff) and not upon automatic forgival triggered by
`WhenLostForgiveFine`.

Test plan
1/ Enable `WhenLostForgiveFine` and `RenewAccruingItemWhenPaid`
2/ Checkout an item and backdate it's due date
3/ Run longeroverdue.pl to mark the item as lost and create the fine
4/ Confirm that the item is not renewed as part of the process
5/ Signoff

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27927: Add Unit Tests
Martin Renvoize [Tue, 6 Apr 2021 10:19:04 +0000 (11:19 +0100)]
Bug 27927: Add Unit Tests

Add a unit test to check that 'FORGIVEN' credits do not prompt an
auto-renewal with `RenewAccruingItemWhenPaid` enabled.

Test plan
1/ Apply the test patch
2/ Run t/db_dependent/Koha/Account/Line.t and confirm it fails
3/ Apply subsequent patch
4/ Re-run the test and confirm it passes

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 25508: Add info about caller responsabilities
Jonathan Druart [Fri, 16 Apr 2021 10:07:49 +0000 (12:07 +0200)]
Bug 25508: Add info about caller responsabilities

We are removing the test on the existence of item and patron, callers
must call renewable before.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 25508: (QA follow-up) Add interface
Nick Clemens [Thu, 15 Apr 2021 15:28:58 +0000 (15:28 +0000)]
Bug 25508: (QA follow-up) Add interface

These patches are making the call for an amount match the call for a specific line,
we should also match the passing of interface to ensure the correct pref is checked

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 25508: Only return renewal outcomes to the controller
Martin Renvoize [Wed, 24 Mar 2021 16:38:32 +0000 (16:38 +0000)]
Bug 25508: Only return renewal outcomes to the controller

There are a few cases where the `renew_item` method in
Koha::Account::Line will return `undef`. For these cases, we should not
pass the error up the chain to the controllers as it leads to malformed
error messages in the UI.

Test plan
1 - Make sure FinesMode is on, RenewAccruingItemWhenPaid is off
2 - Checkout an item to a patron and make it overdue (can backdate the
    checkout)
3 - Make sure the itemtype has fines that will be charged
4 - Charge the fines:
    Set finesMode = production
    perl misc/cronjobs/fines.pl -v
5 - Check the fine appears on the patrons account
6 - Pay off the fine
7 - Receive alert after payment that reads: "The fines on
    the following items were paid off, renewal results are
    displayed below:
        No title ( ): Not renewed - Unknown error"
8 - Apply the patch
9 - Repeat steps 1 through 6 and note that you no longer trigger the
    error message.

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 25508: Add Unit Tests
Martin Renvoize [Tue, 6 Apr 2021 07:48:38 +0000 (08:48 +0100)]
Bug 25508: Add Unit Tests

Enhance the unit tests to check for the return values of
Koha::Account->pay.

Test plan
1/ Apply just this patch
2/ Run t/db_dependent/Koha/Account.t and watch it fail
3/ Apply the rest of the patch series
4/ Run t/db_dependent/Koha/Account.t and watch it pass
5/ Signoff

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26312: (follow-up) Fix passing of exception messages
Nick Clemens [Thu, 1 Apr 2021 13:49:19 +0000 (13:49 +0000)]
Bug 26312: (follow-up) Fix passing of exception messages

'error' has special meaning in exceptions so naming the fields:
type, details

Rather than only dealing with a single exception type, we generically
get the ES exception info and pass it up.

I could not recreate timeout still, however, I simply restarted the
ES docker during commit stage to cause NoNodes exceptions

Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26312: Catch ES Client errors, log, and continue indexing when error encountered
Nick Clemens [Thu, 27 Aug 2020 16:04:57 +0000 (16:04 +0000)]
Bug 26312: Catch ES Client errors, log, and continue indexing when error encountered

This catches a timeout response from the ES server, logs this, and continues the indexing

To test:
1 - perl misc/search_tools/rebuild_elasticsearch.pl
2 - Make the ES server timeout (I don't have good instruction yet)
3 - Watch the job crash
4 - Apply patches
5 - perl misc/search_tools/rebuild_elasticsearch.pl
6 - Make the server timeout
7 - Note the job reports failed commit, and continues

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Bug 26312: (follow-up) Reset buffers even if commit fails

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Bug 26312: (follow-up) Fix whitespace and missing semicolon

Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28136: Handle Transferred status for ResFound
Nick Clemens [Mon, 12 Apr 2021 14:18:20 +0000 (14:18 +0000)]
Bug 28136: Handle Transferred status for ResFound

bug 25690 added a new 'Transferred' status to 'ResFound', this status
needs to be handled in circ/returns.pl

To test:
1 - Place a hold on an item at Branch B for pickup at Branch A
2 - Check in the item at Branch B - confirm hold and transfer
3 - Check in the item at Branch A - nothing happens?
4 - Apply patch
5 - Checkin in the item at Branch A - hold popup appears
6 - Clear the hold and place it again
7 - Set system preference 'HoldsAutoFill' to do
8 - Check in the item at Branch B - hold is found and confirmed
9 - Check in the item at Branch A - hold is found and confirmed

Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 21260: DBRev 20.12.00.031
Jonathan Druart [Wed, 14 Apr 2021 14:07:07 +0000 (14:07 +0000)]
Bug 21260: DBRev 20.12.00.031

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 21260: (follow-up) Consolidate preference
Marcel de Rooy [Wed, 14 Apr 2021 11:25:57 +0000 (11:25 +0000)]
Bug 21260: (follow-up) Consolidate preference

The bug added a local preference. This should now become a real one.
Renamed in the process to better reflect its use.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 21549: DBRev 20.12.00.030
Jonathan Druart [Wed, 14 Apr 2021 13:28:28 +0000 (13:28 +0000)]
Bug 21549: DBRev 20.12.00.030

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 21549: Make filter_by_last_update returns a Koha::Objects-based object
Jonathan Druart [Mon, 12 Apr 2021 14:22:55 +0000 (16:22 +0200)]
Bug 21549: Make filter_by_last_update returns a Koha::Objects-based object

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 21549: Rename filter_by_dateexpiry with filter_by_expiration_date
Jonathan Druart [Mon, 12 Apr 2021 14:12:50 +0000 (16:12 +0200)]
Bug 21549: Rename filter_by_dateexpiry with filter_by_expiration_date

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 21549: Use filter_by_last_update from filter_by_dateexpiry
Jonathan Druart [Mon, 12 Apr 2021 14:12:03 +0000 (16:12 +0200)]
Bug 21549: Use filter_by_last_update from filter_by_dateexpiry

To not reengineer the patch this patch does not remove the new
subroutine but make it use the logic from
Koha::Objects->filter_by_last_update

It also adds a new parameter "days_inclusive"

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 21549: (QA follow-up) Get pref at start of run and rename variable
Nick Clemens [Fri, 19 Mar 2021 12:03:15 +0000 (12:03 +0000)]
Bug 21549: (QA follow-up) Get pref at start of run and rename variable

This patch ensures the script will lock patrons if the pref is set but no other actions
specified

It also changes the variable name to be a bit more explicit

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 21549: (follow-up) Adjust preference description
Marcel de Rooy [Fri, 19 Mar 2021 08:15:10 +0000 (08:15 +0000)]
Bug 21549: (follow-up) Adjust preference description

See QA remarks.

Test plan:
Check the preference in staff client.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 21549: (follow-up) Switch to filter_by
Marcel de Rooy [Fri, 19 Mar 2021 08:11:27 +0000 (08:11 +0000)]
Bug 21549: (follow-up) Switch to filter_by

See QA remarks.

Test plan:
Run t/db_dependent/Koha/Patrons.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 21549: Database revision for new preference
Marcel de Rooy [Mon, 10 Aug 2020 13:37:42 +0000 (13:37 +0000)]
Bug 21549: Database revision for new preference

Introducing LockExpiredDelay.

Test plan:
Run upgrade. Check syspref.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 21549: Lock expired patron accounts
Marcel de Rooy [Thu, 11 Oct 2018 13:34:48 +0000 (15:34 +0200)]
Bug 21549: Lock expired patron accounts

Adding a search on locked patrons to the search_expired in cron script.
This prevents relocking.

Test plan:
Prove Koha/Patrons.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28014: Add table settings to batch patron modification
Owen Leonard [Mon, 22 Mar 2021 14:16:49 +0000 (14:16 +0000)]
Bug 28014: Add table settings to batch patron modification

This patch adds table settings to the tables shown before and after
a batch of patrons has been submitted for batch patron modification.

To test you must have ExtendedPatronAttributes enabled and at least one
configured.

- Go to Tools -> Batch patron modification
- Submit a set of patrons for modification
- In the table showing patron records which will be modified, confirm
  that all DataTables controls work correctly.
  - Confirm that the column visibility settings work correctly,
    including the controls for extended patron attribute columns.
- Submit a change to your patron batch.
- On the page showing the results, confirm that the DataTables controls
  continue to work as expected.
- Go to Administraion -> Table settings and confirm that making changes
  to the default configuration for this table (Tools ->
  batch_patron_modification -> borrowerst) results in the correct
  default columns being shown on the batch patron modification pages.

Signed-off-by: Amit Gupta <amitddng135@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28114: Fix error in MARC21slim2OPACResults - correctly select singleBranchMode
Lucas Gass [Thu, 8 Apr 2021 14:51:36 +0000 (14:51 +0000)]
Bug 28114: Fix error in MARC21slim2OPACResults - correctly select singleBranchMode

To test:
-Look at search results and see something like: Availability: Items available for loan: 1 , 1 , 2 .
-Apply patch
-See something like: Availability: Items available for loan: Midway (1), Centerville (1), Fairview (2)

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28110: Require YAML::XS 0.67
Julian Maurice [Wed, 7 Apr 2021 14:41:04 +0000 (16:41 +0200)]
Bug 28110: Require YAML::XS 0.67

$YAML::XS::Boolean, which is used in Koha::SearchEngine::Elasticsearch,
was introduced in 0.67

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27773: Compiled CSS
Jonathan Druart [Wed, 14 Apr 2021 13:28:09 +0000 (15:28 +0200)]
Bug 27773: Compiled CSS

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27695: (follow-up) Add specificity to CSS changes
Owen Leonard [Fri, 9 Apr 2021 18:07:48 +0000 (18:07 +0000)]
Bug 27695: (follow-up) Add specificity to CSS changes

This patch moves the definition of .alert and .error classes into the
block for .dialog in order to make sure they don't have an effect beyond
the desired scope.

The ".closebtn" section is redundant and has been removed.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27695: Fix style of messages on Elasticsearch configuration page
Owen Leonard [Fri, 12 Feb 2021 17:08:25 +0000 (17:08 +0000)]
Bug 27695: Fix style of messages on Elasticsearch configuration page

This patch makes minor modifications to SCSS and HTML to make messages
on the Elasticsearch configuration page more consistent with other
interfaces.

To test you should have Elasticsearch selected as your search engine.

- Apply the patch and rebuild the staff interface CSS
  (https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client)
- Go to Administration -> Search engine configuration (Elasticsearch)
- You should see a full-width "note" style message under the page
  heading, "Warning: Any changes..."
- Click the "Reset mappings" button at the bottom of the page. The
  confirmation alert you see should appear above the note-style message.
- I'm not sure how to trigger an "error" type message on this page, but
  you can test the updated style by going to Administration ->
  Currencies and submit a new currency with the same name and symbol as
  one which already exists.

Signed-off-by: Michal Denar <black23@gmail.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: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27773: Hide unique holidays and exceptions which have passed
Owen Leonard [Wed, 24 Feb 2021 01:09:33 +0000 (01:09 +0000)]
Bug 27773: Hide unique holidays and exceptions which have passed

This patch modifies the display of unique holidays and holiday
exceptions so that dates in the past are hidden by default. A
corresponding "Show past entries" checkbox can be checked to show the
hidden entries.

To test you should have some unique holidays and holiday exceptions in
your system from the past and in the future.

 - Apply the patch and go to Tools -> Calendar
 - In the tables of existing holidays, check that no dates in the past
   appear in the "Exceptions" or "Unique holidays" tables.
 - Checking the checkbox at the top of each of these tables should
   trigger the display of the hidden rows.

Signed-off-by: Pascale Nalon <pascale.nalon@ensmp.fr>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27746: prevent regexp undefined warning when checking subfield contents ($oclc)
Petro Vashchuk [Mon, 22 Feb 2021 11:46:44 +0000 (13:46 +0200)]
Bug 27746: prevent regexp undefined warning when checking subfield contents ($oclc)

Some of the books have subfield "a" of field "035" absent
and it's possible to have such
(it doesn't says "Require" in the interface),
which causes "Use of uninitialized value $oclc in pattern match (m//)"
error.

Solved by screening regex with check for empty variables before the
match.

To reproduce:
    1) Edit existing book or create a new one with empty marc
subfield "a" of field "035"
    2) Use the search feature that will find it along with some other
books.
    3) Check /var/log/koha/kohadev/plack-intranet-error.log to find
"Use of uninitialized value $oclc in pattern match (m//)" error.
    4) Apply the patch.
    5) Repeat the search and check the logs again to ensure
that error didn't appear again.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28132: (follow-up) Update basket group page
Owen Leonard [Wed, 14 Apr 2021 10:31:35 +0000 (10:31 +0000)]
Bug 28132: (follow-up) Update basket group page

This patch makes the same change to the basket group page:

Reopen this basket -> Reopen basket
Export this basket -> Export basket
Print this basket -> Print basket

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28132: Remove "this" from button descriptions on basket summary page
Owen Leonard [Mon, 12 Apr 2021 11:44:58 +0000 (11:44 +0000)]
Bug 28132: Remove "this" from button descriptions on basket summary page

This patch modifies button text on the Acquisitions basket page to
remove the word "this."

To test, apply the patch, go to Acquisitions, and locate a vendor with
baskets.

 - View an open basket.
 - You should see in the button toolbar, "Delete basket," and "Close
   basket."
 - View a closed basket.
 - You should see a "Reopen basket" button.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28081: Make card number a label in patron search results
Owen Leonard [Fri, 2 Apr 2021 19:54:30 +0000 (19:54 +0000)]
Bug 28081: Make card number a label in patron search results

This patch modifies the output of the AJAX patron search results so that
the number in the card number column is wrapped in a <label> tag which
triggers the corresponding checkbox.

To test, apply the patch and go to the Patrons module.

 - Perform a patron search which will return more than one result or
   click on a letter to browse.
 - In the search results, confirm that clicking any card number triggers
   the corresponding checkbox.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28112: Z39.50 does not populate form with all passed criteria
Owen Leonard [Wed, 7 Apr 2021 16:27:31 +0000 (16:27 +0000)]
Bug 28112: Z39.50 does not populate form with all passed criteria

This patch adds output of some already-existing template variables in
the Z39.50 search form so that all parameters can be used to prepopulate
the form.

To test, apply the patch and go to Cataloging.

- Click the "New from Z39.50/SRU" button
  - A window should pop up and the form should be empty.
  - Confirm that searching works correctly.
- Perform the same test from a bibliographic detail page using the Edit
  menu -> Replace record via Z39.50/SRU.
  - Some fields in the search form should be prepopulated, e.g. ISBN,
    title, author.
- Paste this link into your browser:
  http://path.to.your.koha/cgi-bin/koha/cataloguing/z3950_search.pl?frameworkcode=&isbn=isbn&issn=issn&title=title&author=author&dewey=dewey&subject=subject&lccall=lccall&controlnumber=controlnumber&stdid=stdid&srchany=srchany&publicationyear=publicationyear
  - The search form should appear with all fields prepopulated.

- Perform the same tests in Acquisitions with the option for adding to a
  basket via an external search.
  - The link for testing all parameters:
    http://path.to.your.koha/cgi-bin/koha/acqui/z3950_search.pl?booksellerid=4&basketno=3&isbn=isbn&issn=issn&title=title&author=author&dewey=dewey&subject=subject&lccall=lccall&controlnumber=controlnumber&stdid=stdid&srchany=srchany&publicationyear=publicationyear

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoRevert "Bug 26734: Ratify account slip printing"
Jonathan Druart [Wed, 14 Apr 2021 13:22:29 +0000 (15:22 +0200)]
Revert "Bug 26734: Ratify account slip printing"

This reverts commit 58ec862da2243d9210a419c210e7b469ac2f6872.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28055: (follow-up) Revert changes to aoColumnDefs option name
Owen Leonard [Mon, 12 Apr 2021 17:29:09 +0000 (17:29 +0000)]
Bug 28055: (follow-up) Revert changes to aoColumnDefs option name

This patch undoes changes to two lines in columns_settings.inc which
were triggering unwanted side-effects. There are several templates and
JavaScript files which use "aoColumnDefs" to pass options to columns
settings, and if we change this file without changing those at the same
time things will break.

When these lines are updated it must be done so at the same time as we
modify the templates which pass that same option.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 14233: Set default for NoticesLog to 0
Jonathan Druart [Tue, 13 Apr 2021 08:45:58 +0000 (10:45 +0200)]
Bug 14233: Set default for NoticesLog to 0

To prevent a warning on the about page:
 System preference 'NoticesLog' must be '0' or '1', but is ''.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27069: (follow-up) Only display rules if one is set
Nick Clemens [Mon, 12 Apr 2021 13:22:50 +0000 (13:22 +0000)]
Bug 27069: (follow-up) Only display rules if one is set

Testing that the rule is != 'hold_allowed' is true for each itemtype where
the rule is not set. This means it appears that no holds are allowed
for any item type if no rules are set

To test:
1 - With a fresh testing DB or no holdallowed rule set, you can use SQl below to clear:
    DELETE from circuation_rules WHERE rule_name='holdallowed';
2 - Load smart-rules.pl (Administration->Circulation and fines rules)
3 - Scroll to "Default holds policy by item type"
4 - Note all item types appear as 'No holds allowed'
5 - Apply patch
6 - Reload
7 - All clear
8 - Confirm adding rules displays correctly

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27839: (follow-up) Update docs for koha-worker
Tomas Cohen Arazi [Tue, 2 Mar 2021 19:33:29 +0000 (16:33 -0300)]
Bug 27839: (follow-up) Update docs for koha-worker

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27839: Add tab-completion in bash for koha-worker
Tomas Cohen Arazi [Tue, 2 Mar 2021 18:20:41 +0000 (15:20 -0300)]
Bug 27839: Add tab-completion in bash for koha-worker

This patch simply adds tab-completion for this script.

To test:
1. Apply this patch
2. Run:
   $ cp debian/koha-common.bash-completion  /etc/bash_completion.d/koha-common
3. Open a new bash instance
4. Type 'koha-worker <tab>'
=> SUCCESS: All options are there
5. Play with Koha instances
=> SUCCESS: they show up, once chosen they are not offered anymore
6. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 24695: (QA follow-up) Fix POD
Kyle M Hall [Fri, 9 Apr 2021 16:41:04 +0000 (12:41 -0400)]
Bug 24695: (QA follow-up) Fix POD

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 24695: Move to Koha::Report->is_sql_valid
Jonathan Druart [Thu, 27 Feb 2020 09:31:13 +0000 (10:31 +0100)]
Bug 24695: Move to Koha::Report->is_sql_valid

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 24695: Improve SQL report validation
Pasi Kallinen [Thu, 20 Feb 2020 09:31:08 +0000 (11:31 +0200)]
Bug 24695: Improve SQL report validation

The saved SQL report code validates the SQL in multiple places:
when saving, when updating, and when executing the query.
Move the validation code into Koha::Reports, and write tests for it.

Test plan:
1) Apply patch
2) Create a new valid SQL report, save it (success)
3) Create a new illegal SQL report, try to save (fails)
4) Update already saved SQL report by adding one of
   the forbidden words, eg. delete or drop (saving will fail)
5) Edit a save_sql in the database, changing it to eg.
   "drop borrowers", and try to execute it (fails)
6) Prove t/db_dependent/Koha/Reports.t

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Work as described, no qa errors.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Bug 24695: (QA follow-up) Fix number of tests

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27049: (QA follow-up) Add short params, replace warn with say
Kyle M Hall [Fri, 9 Apr 2021 15:45:03 +0000 (11:45 -0400)]
Bug 27049: (QA follow-up) Add short params, replace warn with say

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27049: Add /misc/cronjobs/writeoff_debts.pl
Martin Renvoize [Wed, 18 Nov 2020 13:21:05 +0000 (13:21 +0000)]
Bug 27049: Add /misc/cronjobs/writeoff_debts.pl

This patch adds a new misc/cronjobs/writeoff_debts.pl script to allow the bulk
waiver of debts from the system. The script accepts some filter parameters,
including the option to pass a line delimited file of accountline_ids, and will
apply a WRITEOFF account against them for the amount of the outstanding debt.

Examples:
./writeoff_debts.pl --added_before $(date -d '-18 month' --iso-8601) --confirm
./writeoff_debts.pl --type COPY --verbose --confirm
./writeoff_debts.pl --file path/to/file --verbose

Test plan
1/ Add some debts to the system for various users.
2/ Output a line delimited report for accountlines for those debts.
3/ Run the script with the --file parameter and confirm those debts were
written off.
4/ Repeat steps 1-3 above but add in a step to partially pay some debts
prior to running the script.
5/ Repeat steps 1-3 above but pay of some of the debts prior to running
the script.
6/ Repeat steps 1-2 above, but instead of passing --file use a
combination of the other parameters to limit your list of debts to
writeoff.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26734: Ratify account slip printing
Martin Renvoize [Thu, 16 Jul 2020 08:42:20 +0000 (09:42 +0100)]
Bug 26734: Ratify account slip printing

This patch simplifies the members/print*.pl controller scripts to only
pass around the minimum required data for the templates.

Test plan
Slips should continue to print as they did prior to the patch
1/ Add a manual invoice and manual debit to a patrons account
2/ Print a slip for the manual invoice, compare to a printed slip prior
to the patch.
3/ Print a slip for the manual debit, compare to a printed slip prior to
the patch.
4/ Signoff.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28121: Correct the place of the question mark
Séverine QUEUNE [Fri, 9 Apr 2021 13:25:16 +0000 (15:25 +0200)]
Bug 28121: Correct the place of the question mark

Question mark is wonrgly placed when you want to delete a desk.
Test plan :
- Enable 'UseCirculationDesks'
- On Administration > Desks menu, create a new desk
- Try to delete it : note the question mark in inside the quotation
marks
- Apply patch and refresh page
- Question mark should now be after the last quotation mark

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27726: DBIC schema changes
Jonathan Druart [Mon, 12 Apr 2021 13:27:36 +0000 (15:27 +0200)]
Bug 27726: DBIC schema changes

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27726: DBRev 20.12.00.029
Jonathan Druart [Mon, 12 Apr 2021 13:25:56 +0000 (13:25 +0000)]
Bug 27726: DBRev 20.12.00.029

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27726: Increase 'content' field size
Martin Renvoize [Thu, 25 Mar 2021 14:29:06 +0000 (14:29 +0000)]
Bug 27726: Increase 'content' field size

This alternate patch increases the field size from a 255 character
varchar to a 65535 character text field. This allows for more detailed
problem reports to be submitted.

Signed-off-by: Amit Gupta <amitddng135@gmail.com>
Signed-off-by: Petro Vashchuk <stalkernoid@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27857: Fix Pseudonymization.t
Jonathan Druart [Mon, 12 Apr 2021 09:08:01 +0000 (11:08 +0200)]
Bug 27857: Fix Pseudonymization.t

t/db_dependent/Koha/Pseudonymization.t .. 2/3
    #   Failed test 'Attribute 1 should be retrieved correctly'
    #   at t/db_dependent/Koha/Pseudonymization.t line 198.
    #     Structures begin differing at:
    #          $got->{borrowernumber} = Does not exist
    #     $expected->{borrowernumber} = '58'

    #   Failed test 'Attribute 2 should be retrieved correctly'
    #   at t/db_dependent/Koha/Pseudonymization.t line 204.
    #     Structures begin differing at:
    #          $got->{borrowernumber} = Does not exist
    #     $expected->{borrowernumber} = '58'
    # Looks like you failed 2 tests of 3.
t/db_dependent/Koha/Pseudonymization.t .. 3/3

Highlighted by
  commit 7b40ee22035210e3fbdfe75785d68ca314285409
  Bug 27857: Make Koha::Patron->extended_attributes validate data

Koha::Patron->add_extended_attributes should not modify the $attribute
hashref parameter we passed.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 25476: Add ability to browse file uploads by category
David Cook [Thu, 14 May 2020 04:00:32 +0000 (04:00 +0000)]
Bug 25476: Add ability to browse file uploads by category

This patch adds the ability to search/browse files by category.
(Note it doesn't include temporary uploads since they don't have
 a "category" per se.)

Test Plan:
0) Apply patch
1) Go to /cgi-bin/koha/admin/authorised_values.pl
2) Create "UPLOAD" authorized value category
3) Create "test" authorized value in "UPLOAD" category
4) Go to /cgi-bin/koha/tools/upload.pl
5) Note "Search uploads by category" fieldset
6) Upload new file to "test" category
7) Click "Back"
8) Choose "test" category in "Search uploads by category"
9) Click "Search"
10) Note that your file upload is displayed in result list

Signed-off-by: Mazen Khallaf <mazen.i.khallaf@gamil.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 14233: DBRev 20.12.00.028
Jonathan Druart [Fri, 9 Apr 2021 14:04:23 +0000 (14:04 +0000)]
Bug 14233: DBRev 20.12.00.028

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 14233: Select the correct tab
Jonathan Druart [Wed, 7 Apr 2021 13:05:15 +0000 (15:05 +0200)]
Bug 14233: Select the correct tab

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 14233: Add logging support to notices and slips management
Martin Renvoize [Wed, 7 Apr 2021 13:02:17 +0000 (15:02 +0200)]
Bug 14233: Add logging support to notices and slips management

This enhancements adds support for logging changes to notices and slips.
Features include:
- a system preference (NoticesLog) which allows you to enable logging changes for notices and slips
- logging new notices, changes to notices, and deletion of notices
- filtering in the log viewer so you can show all changes for a specific notice
- a comparison feature, so you can see what changes were made to a notice.

Test plan:
1/ Add some 'Notice' action logs by adding a new notice or updateing an
existing notice
2/ Go to the 'Log viewer' under 'Tools'
3/ Note you can filter by 'Notices'
4/ Confirm the changes you made appear in the logs and that the 'Object'
field links back to the updated notice ready for editing.

1/ Make some changes to at least two different notices to trigger logs
2/ Go to the 'Log viewer' from 'Tools' and filter on 'Notices'
3/ Note, you can now see the 'Compare' checkbox option for these logs
4/ Select the checkbox on one of the notices and note that the results
are now filtered by that specific notice.
5/ Select a second checkbox to expose the option to 'View comparison'
6/ Click 'View comparison' to see the 'Diff view' of the two notices.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 14233: DB changes - NoticesLog pref + letter.id PK
Martin Renvoize [Wed, 7 Apr 2021 13:02:09 +0000 (15:02 +0200)]
Bug 14233: DB changes - NoticesLog pref + letter.id PK

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 14233: DBIC schema changes
Martin Renvoize [Wed, 7 Apr 2021 12:56:12 +0000 (14:56 +0200)]
Bug 14233: DBIC schema changes

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28094: Deal with encoding for overriden sysprefs
Jonathan Druart [Tue, 6 Apr 2021 14:26:23 +0000 (16:26 +0200)]
Bug 28094: Deal with encoding for overriden sysprefs

The string we retrieved is UTF-8 encoded, to prevent encoding issue we
must decode it first.

Test plan:
Easily testable with LibraryName:
1. edit /etc/apache2/sites-available/kohadev.conf
2. Add
  RequestHeader add X-Koha-SetEnv "OVERRIDE_SYSPREF_LibraryName Library of ❤️"
3. restart_all
4. Hit the mainpage and look at the source (or title) and confirm that
the string is displayed correcty

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28031: Add missing txn_begin in Attribute.t
Jonathan Druart [Fri, 9 Apr 2021 13:37:36 +0000 (15:37 +0200)]
Bug 28031: Add missing txn_begin in Attribute.t

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>