]> git.koha-community.org Git - koha.git/log
koha.git
4 years agoBug 25278: add clear_search_fields_cache method
Nick Clemens [Fri, 15 May 2020 11:46:07 +0000 (11:46 +0000)]
Bug 25278: add clear_search_fields_cache method

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25278: (follow-up) Fix other occurrences
Nick Clemens [Mon, 27 Apr 2020 14:05:46 +0000 (14:05 +0000)]
Bug 25278: (follow-up) Fix other occurrences

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25278: Retrieve correct search fields for authorities
Nick Clemens [Fri, 24 Apr 2020 15:52:50 +0000 (15:52 +0000)]
Bug 25278: Retrieve correct search fields for authorities

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25278: Unit tests
Nick Clemens [Fri, 24 Apr 2020 16:32:06 +0000 (16:32 +0000)]
Bug 25278: Unit tests

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25277: Unit test
Nick Clemens [Fri, 24 Apr 2020 16:08:44 +0000 (16:08 +0000)]
Bug 25277: Unit test

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25277: Don't specify a field in query if none passed
Nick Clemens [Fri, 24 Apr 2020 13:34:31 +0000 (13:34 +0000)]
Bug 25277: Don't specify a field in query if none passed

== test plan ==
To test:
0 - Have Koha running with ES 6 enabled
1 - Launch the z3950 responder:
    perl misc/z3950_responder.pl --config-dir /kohadevbox/koha/etc/z3950 --debug
2 - Connect using yaz-client:
    yaz-client localhost:2100
2.1 Alternative, if you add the responder as a Z39.50 server in Koha and
  do a catalogue Z39.50 search. Don't forget to search in the keywords
  field. Not the title field.
3 - base biblios
4 - find bruce
5 - No results
6 - Stop the responder
7 - Apply patch
8 - Repeat
9 - This time you get results

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25308: Escape querystring for Z39.50 popup from cataloging
Phil Ringnalda [Wed, 29 Apr 2020 00:16:51 +0000 (17:16 -0700)]
Bug 25308: Escape querystring for Z39.50 popup from cataloging

Test plan:

1. For bonus fun, Administration -> MARC Frameworks -> New framework,
with the code A&B and description Ants & Bees
2. In the A&B Actions menu, choose MARC structure since Import won't
work
3. Accept the offer to copy in structure from default
4. Cataloging -> New record -> Ants & Bees
5. Type This & That in the 245$a (and for extra credit, in 020$a, and
create an author authority with an & in it so you can put it in the
100/110)
6. Click Z39.50/SRU search, make sure everything you typed is prefilled
including the parts after &
7. Search for anything that will retrieve a record (the ISBN This &
That probably won't), choose Import
8. Check that the record came back, and verify in the Settings menu that
it's still in the Ants & Bees framework.

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>
4 years agoBug 11446: Use encodeURIComponent on search terms in authority lookup plugin
Phil Ringnalda [Fri, 24 Apr 2020 18:34:29 +0000 (11:34 -0700)]
Bug 11446: Use encodeURIComponent on search terms in authority lookup plugin

While adding the data from the existing field to the auth_finder URI,
we're using encodeURI(), which is meant for an entire URI and thus
doesn't escape &. Things that are going into a querystring need
encodeURIComponent() instead.

Test plan:

1. Enable the system preference EnableAdvancedCatalogingEditor
2. Clear your browser cache, even a shift+reload won't get you a fresh
marc-editor.js for the advanced editor
3. Create a Topical Term authority with 150 $aThis & That$xStuff & Junk
4. In the Basic editor, use the authority plugin on the 650 field to
select that authority.
5. Click the authority plugin again, verify that the popup contains This
& That and Stuff & Junk rather than just This and Stuff
6. From the Cataloging home page choose Advanced editor
7. In a new line paste 650 _ _ ‡aThis & That‡xStuff & Junk
8. Type ctrl+shift+L and verify the popup shows both words in both
fields
9. When you remember the plugin exists there too, edit your
Stuff & Junk authority, and in a 550 tag type One & Two in
$a and Three & Four in $x and click the plugin link, verify that
the search window has your search terms not cut off.

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>
4 years agoBug 25527: Add logger to Koha::ExternalContent
Tomas Cohen Arazi [Mon, 18 May 2020 12:26:09 +0000 (09:26 -0300)]
Bug 25527: Add logger to Koha::ExternalContent

This patch makes Koha::Logger initialization happen in the ->new method
for the Koha::ExternalContent-derived classes. In the case of RecordedBooks,
it doesn't look like it is used at all.

In the case of OverDrive, it will now use the Koha::ExternalContent
exported logger accessor.

I added tests for this addition to Koha::ExternalContent to the
OverDrive tests.

I also removed references to Test::DBIx::Class as it is not used at all.

To test:
1. Apply this patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha_ExternalContent_OverDrive.t
=> SUCCESS: Tests pass!

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25527: Initialize the logger when required
Tomas Cohen Arazi [Mon, 18 May 2020 12:23:42 +0000 (09:23 -0300)]
Bug 25527: Initialize the logger when required

In an OO package, the logger initialization should happen in the
constructor. This is not an OO package and the initialization is
happening on loading it. This is a wrong behaviour and certainly breaks
in environments where initialization cannot happen (package building,
for example). There could be several options to solve this, as it is
used in a single sub on this package, I opted for initializing on that
sub.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 22970: Add sponsorship details
Martin Renvoize [Mon, 18 May 2020 14:21:09 +0000 (15:21 +0100)]
Bug 22970: Add sponsorship details

Sponsored-by: Université de Lyon 3
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24255: Add sponsorship details
Martin Renvoize [Mon, 18 May 2020 13:28:26 +0000 (14:28 +0100)]
Bug 24255: Add sponsorship details

Sponsored-by: PTFS Europe
Sponsored-by: Cheshire Libraries Shared Services
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24252: Add sponsorship details
Martin Renvoize [Mon, 18 May 2020 13:27:40 +0000 (14:27 +0100)]
Bug 24252: Add sponsorship details

Sponsored-by: PTFS Europe
Sponsored-by: Cheshire Libraries Shared Services
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23593: Add sponsorship details
Martin Renvoize [Mon, 18 May 2020 12:51:47 +0000 (13:51 +0100)]
Bug 23593: Add sponsorship details

Sponsored-by: BULAC - http://www.bulac.fr/
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23592: Add sponsorship details
Martin Renvoize [Mon, 18 May 2020 12:49:32 +0000 (13:49 +0100)]
Bug 23592: Add sponsorship details

Sponsored-by: BULAC - http://www.bulac.fr/
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24080: Add sponsorship details
Martin Renvoize [Mon, 18 May 2020 11:50:44 +0000 (12:50 +0100)]
Bug 24080: Add sponsorship details

Sponsored-by: PTFS Europe
Sponsored-by: Cheshire Libraries Shared Services
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23442: Add sponsorship details
Martin Renvoize [Mon, 18 May 2020 11:49:22 +0000 (12:49 +0100)]
Bug 23442: Add sponsorship details

Sponsored-by: PTFS Europe
Sponsored-by: Cheshire Libraries Shared Services
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 13881: DBRev 19.12.00.090
Martin Renvoize [Mon, 18 May 2020 10:43:55 +0000 (11:43 +0100)]
Bug 13881: DBRev 19.12.00.090

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 13881: (RM follow-up) Make 'Desks' feature optional
Martin Renvoize [Mon, 18 May 2020 10:40:14 +0000 (11:40 +0100)]
Bug 13881: (RM follow-up) Make 'Desks' feature optional

This patch adds a new 'UseIssueDesks' preference which defaults to
"Don't use" to enabled/disable the 'Desks' functionality added with this
bug.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25482: Explicitly set macros as not shard during tests
Nick Clemens [Thu, 14 May 2020 10:42:06 +0000 (10:42 +0000)]
Bug 25482: Explicitly set macros as not shard during tests

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25482: Fix tests
Tomas Cohen Arazi [Wed, 13 May 2020 22:34:30 +0000 (19:34 -0300)]
Bug 25482: Fix tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25482: Wrong permissions specification for adv editor macros
Tomas Cohen Arazi [Wed, 13 May 2020 22:07:17 +0000 (19:07 -0300)]
Bug 25482: Wrong permissions specification for adv editor macros

The current permissions are defined as a hash, with a duplicate key.
This is generally invalid, but Debian 9's Mojolicious::Plugin::OpenAPI
lets it go through, even though the results are, random?

This patch sets the required permissions right, and following the
haspermissions() syntax correctly.

Tests for searching macros are not passing. Still trying to figure.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24994: Correct DB Updates
Martin Renvoize [Thu, 26 Mar 2020 16:01:37 +0000 (16:01 +0000)]
Bug 24994: Correct DB Updates

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25468: Preserve line breaks in hold notes
Kyle M Hall [Tue, 12 May 2020 14:49:51 +0000 (10:49 -0400)]
Bug 25468: Preserve line breaks in hold notes

In a hold note, line breaks are not preserved when viewing the note. A
note like:
--
Test 1

Test 2
--

will be rendered as:
--
Test 1 Test 2
--

Test Plan:
1) Place a hold with a note, use line breaks in the note.
2) Note the lines all run together when viewing the hold.
3) Apply this patch.
4) Reload the page.
5) Notes should now display with the original line breaks!

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25480: Don't hide apache error and display incorrect error
Jonathan Druart [Wed, 13 May 2020 11:05:48 +0000 (13:05 +0200)]
Bug 25480: Don't hide apache error and display incorrect error

When searching if some apache mod are enable we are hiding the error (2> /dev/null) and display an error about the (guessed) missing module.

It can lead to wrong tracks, let display the original apache error if there is one.

This is linked with https://gitlab.com/koha-community/koha-testing-docker/-/merge_requests/119

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23403: Catch other cases of ->{patron}
Nick Clemens [Mon, 13 Apr 2020 15:51:36 +0000 (15:51 +0000)]
Bug 23403: Catch other cases of ->{patron}

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23403: List borrowernumber in the ILS::Patron fields
Jonathan Druart [Mon, 23 Mar 2020 14:57:14 +0000 (15:57 +0100)]
Bug 23403: List borrowernumber in the ILS::Patron fields

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23403: Fix whitespace
Kyle M Hall [Mon, 23 Mar 2020 12:52:58 +0000 (08:52 -0400)]
Bug 23403: Fix whitespace

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23403: Remove cardnumber from SIP
Jonathan Druart [Thu, 21 Nov 2019 17:39:15 +0000 (18:39 +0100)]
Bug 23403: Remove cardnumber from SIP

== Test plan ==
1 - Have two patrons with userids and no cardnumber
2 - Note which of these has the higher borrower number
3 - Use the SIP cli emulator to connect and checkout a book to the patron with higher borrowernumber
      See example after
4 - Note the book may checkout to the wrong patron!
5 - Apply patch
6 - Checkout to both patrons via sip
7 - The patrons get the correct checkouts

=== SIP CLI emulator ===
./misc/sip_cli_emulator.pl -a 127.0.0.1 -p 6001 -su term1 -sp term1 \
-l CPL --patron 23529001000463 -m checkout --item 39999000001259

translation: via the koha user term1, checkout item 39999000001259 to
patron 23529001000463

Signed-off-by: Bouzid Fergani <bouzid.fergani@inlibro.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24458: Use the ViewPolicy filter on search results
Tomas Cohen Arazi [Mon, 11 May 2020 13:10:39 +0000 (10:10 -0300)]
Bug 24458: Use the ViewPolicy filter on search results

This patch implements the use of the ViewPolicy record processor filter
inside C4::Search::searchResults. The idea is that the $record_processor
is instantiated once and reused inside the loop. This leaves options for
further optimizations I will do on a follow-up bug.

The filter is applied to the MARC data before it is passed to the XSLT
processor.

To test:
1. Apply the regression tests patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/Search.t
=> FAIL: This is not implemented, tests fail
3. Apply this patch
4. Repeat 2
5. Feel the joy in your body from a long standing bug being solved
6. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24458: Regression tests
Tomas Cohen Arazi [Mon, 11 May 2020 13:08:36 +0000 (10:08 -0300)]
Bug 24458: Regression tests

This patch introduces tests for searchResults. The idea is to set a
subfield as hidden in OPAC and another on the staff interface, and see
if searchResults honours this on the XSLTResultsRecord contents.

To test:
1. Apply this patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/Search.t
=> FAIL: This is not really implemented

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25416: (follow-up) Remove useless use statement
Tomas Cohen Arazi [Tue, 12 May 2020 12:09:22 +0000 (09:09 -0300)]
Bug 25416: (follow-up) Remove useless use statement

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25416: Unit tests
Tomas Cohen Arazi [Mon, 11 May 2020 11:38:49 +0000 (08:38 -0300)]
Bug 25416: Unit tests

This patch adds tests for the new 'feature': i.e. searchResults passes
the added $xslt_variables to the XSLTParse4Display method.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25416: Let OPAC XSLTs know if the context is an anonymous session
Tomas Cohen Arazi [Thu, 7 May 2020 17:23:40 +0000 (14:23 -0300)]
Bug 25416: Let OPAC XSLTs know if the context is an anonymous session

This patch makes use of the 'variables' parameter in XSLTParse4Display
method in the different places that it is used in the OPAC. It does by
passing this parameter with

    anonymous_session => 1|0

The value will depend on the output from get_template_and_user (i.e. if
there's a returned borrowernumber).

A special case takes place in search results, as the call to
XSLTParse4Display happens in C4::Search::searchResults. So a new
parameter 'xslt_variables' is added to it.

To test:
1. Apply the [DO NOT PUSH] patch
2. Open the OPAC in your browser
3. Try detail pages, search results, tags and lists/shelves pages with
   or without an active session
=> FAIL: It always says (somewhere) 'Anonymous session: Yes'
4. Apply this patch, restart_all
5. Repeat 3
=> SUCCESS: It will tell the Yes/No correctly regarding anonymous
sessions!
6. Sign off :-D

Sponsored-by: Universidad ORT Uruguay
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23794: (RM follow-up) Remove warnings from updatedatabase
Martin Renvoize [Wed, 13 May 2020 15:52:47 +0000 (16:52 +0100)]
Bug 23794: (RM follow-up) Remove warnings from updatedatabase

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24161: (follow-up) Fix failing test (when running slow)
Jonathan Druart [Wed, 13 May 2020 14:10:34 +0000 (16:10 +0200)]
Bug 24161: (follow-up) Fix failing test (when running slow)

The previous assumption was wrong, we just need to return the last one.
The tests mean to have 2 different values in the claimed_on dates.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23794: (follow-up) Remove extra carriage return
Jonathan Druart [Wed, 13 May 2020 14:02:35 +0000 (16:02 +0200)]
Bug 23794: (follow-up) Remove extra carriage return

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25389: DBRev 19.12.00.089
Martin Renvoize [Wed, 13 May 2020 09:34:10 +0000 (10:34 +0100)]
Bug 25389: DBRev 19.12.00.089

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25389: Catch errant cases of LOST_RETURNED
Martin Renvoize [Mon, 11 May 2020 10:39:00 +0000 (11:39 +0100)]
Bug 25389: Catch errant cases of LOST_RETURNED

For upgrades taking place after the fix for the update in bug 24592 was
pushed, we need to catch any last remaining error cases and correct
them.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25389: Catch LOST_RETURNED in DB update 19.12.00.021
Martin Renvoize [Mon, 11 May 2020 10:33:32 +0000 (11:33 +0100)]
Bug 25389: Catch LOST_RETURNED in DB update 19.12.00.021

An errant update from bug 22563 could lead to cases of LOST_RETURNED as
aposed to LOST_RETURN as an account_credit_type. This patch adds code to
deal with those cases to the update for bug 24592

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25389: Correct stray cases of LOST_RETURNED
Martin Renvoize [Mon, 11 May 2020 10:30:35 +0000 (11:30 +0100)]
Bug 25389: Correct stray cases of LOST_RETURNED

The original DB update for bug 22563 incorrectly mapped CR to
LOST_RETURNED as aposed to LOST_RETURN.  This patch catches such cases
and updates them in the update for bug 23805

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25389: Correct original DB update for bug 22563
Martin Renvoize [Mon, 11 May 2020 10:27:16 +0000 (11:27 +0100)]
Bug 25389: Correct original DB update for bug 22563

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24368: Comprehensive tests for Koha::Template::Plugin::Branches::pickup_locations
Tomas Cohen Arazi [Fri, 8 May 2020 19:04:17 +0000 (16:04 -0300)]
Bug 24368: Comprehensive tests for Koha::Template::Plugin::Branches::pickup_locations

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24368: Remove Koha::Libraries->pickup_locations
Tomas Cohen Arazi [Fri, 8 May 2020 19:01:58 +0000 (16:01 -0300)]
Bug 24368: Remove Koha::Libraries->pickup_locations

This patch removes the unused method, and cleans the tests.
To test:
1. Verify Koha::Libraries->pickup_locations is not used in the code:
   $ git grep 'Koha::Libraries\->pickup_locations'
=> SUCCESS: no uses
2. Apply this patch
3. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Libraries.t
=> SUCCESS: Tests pass!
4. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24161: Fix failing test (when running slow)
Jonathan Druart [Wed, 13 May 2020 07:57:40 +0000 (09:57 +0200)]
Bug 24161: Fix failing test (when running slow)

We "mocked" the claim date to make sure we were not going to hit this
problem, but it's not done on the correct claim, it should be done on
the last one (so second).

from Koha::Acq::Order->claimed_date

294     my $last_claim = $self->claims->last;
295     return unless $last_claim;
296     return $last_claim->claimed_on;

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25417: (QA follow-up) Add integration test for AddReturn
Martin Renvoize [Tue, 12 May 2020 08:24:28 +0000 (09:24 +0100)]
Bug 25417: (QA follow-up) Add integration test for AddReturn

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>
4 years agoBug 25417: (QA follow-up) Restore 'fixing' of fines
Martin Renvoize [Mon, 11 May 2020 20:14:24 +0000 (21:14 +0100)]
Bug 25417: (QA follow-up) Restore 'fixing' of fines

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>
4 years agoBug 25417: (QA follow-up) Clarify _FixOverduesOnReturn test
Martin Renvoize [Mon, 11 May 2020 20:13:47 +0000 (21:13 +0100)]
Bug 25417: (QA follow-up) Clarify _FixOverduesOnReturn test

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>
4 years agoBug 25417: Prevent negative debit amount on backdating returns
Jonathan Druart [Fri, 8 May 2020 10:28:46 +0000 (12:28 +0200)]
Bug 25417: Prevent negative debit amount on backdating returns

Koha::Account->add_credit is expecting a positive amount.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Didier Gautheron <didier.gautheron@biblibre.com>
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>
4 years agoBug 25417: Add unit test
Kyle M Hall [Thu, 7 May 2020 18:21:59 +0000 (14:21 -0400)]
Bug 25417: Add unit test

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Didier Gautheron <didier.gautheron@biblibre.com>
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>
4 years agoBug 15253: Remove specific logging output
Jonathan Druart [Mon, 11 May 2020 10:10:24 +0000 (12:10 +0200)]
Bug 15253: Remove specific logging output

* We should not call Log::Log4perl directly
* Not sure it is correct as I get from (comment 77):
 % koha-sip --restart

 [2020/04/23 11:23:27] [ERROR] [undef]@[undef]: Argument "0.33_01" isn't
 numeric in numeric lt (<) at /usr/share/perl5/Net/Server/Log/Sys/Syslog.pm
 line 42.
  C4::SIP::Trapper::PRINT /kohadevbox/koha/C4/SIP/Trapper.pm (24)

 Why "ERROR" when it's a warning?
 The [undef]@[undef] seems wrong here.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 15253: Add POD to C4/SIP/Logger.pm and C4/SIP/Trapper.pm
Kyle M Hall [Wed, 29 Apr 2020 10:42:29 +0000 (06:42 -0400)]
Bug 15253: Add POD to C4/SIP/Logger.pm and C4/SIP/Trapper.pm

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 15253: Convert all tabs into 4 spaces in affected files
Kyle M Hall [Wed, 29 Apr 2020 10:27:10 +0000 (06:27 -0400)]
Bug 15253: Convert all tabs into 4 spaces in affected files

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 15253: Log trapped errors as log level 'warn' instead of 'error'
Kyle M Hall [Thu, 23 Apr 2020 13:25:33 +0000 (09:25 -0400)]
Bug 15253: Log trapped errors as log level 'warn' instead of 'error'

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 15253: Add log4perl conf updates for Debian packages
Kyle M Hall [Wed, 1 Apr 2020 12:14:48 +0000 (08:14 -0400)]
Bug 15253: Add log4perl conf updates for Debian packages

* Add log4perl conf updates for Debian packages
* Rename sip2.log to sip.log

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 15253: Rename syslog() to siplog()
Kyle M Hall [Wed, 22 Apr 2020 17:24:55 +0000 (13:24 -0400)]
Bug 15253: Rename syslog() to siplog()

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 15253: Move subs to a new module, allow unit tests to function
Kyle M Hall [Mon, 22 Apr 2019 15:02:42 +0000 (11:02 -0400)]
Bug 15253: Move subs to a new module, allow unit tests to function

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 15253: Add Koha::Logger based logging for SIP2
Kyle M Hall [Tue, 1 May 2018 11:47:12 +0000 (11:47 +0000)]
Bug 15253: Add Koha::Logger based logging for SIP2

Now that we have Koha::Logger, we should use it in our SIP server. This
has the potential to make debugging SIP issue much easier. We should add
the userid for the sipuser to the namespace so we can allow for separate
files per sip user if wanted.

Test Plan:
1) Apply this patch set
2) Update the modififed log4perl.conf to your system
3) Restart your sip server
4) Tail your sip2.log, run some queries
5) Note you still get the same output messages as before, with the
   addition of the ip address and username ( if available )
   prefixing the message.

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 13547: (QA follow-up) Add basic tests
Martin Renvoize [Wed, 6 May 2020 07:50:54 +0000 (08:50 +0100)]
Bug 13547: (QA follow-up) Add basic tests

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 13547: (follow-up) Improve POD for template plugin
Martin Renvoize [Wed, 6 May 2020 07:26:39 +0000 (08:26 +0100)]
Bug 13547: (follow-up) Improve POD for template plugin

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 13547: (follow-up) Item field 'Materials specified' would be useful to see in...
Nazlı Çetin [Fri, 27 Mar 2020 17:13:02 +0000 (17:13 +0000)]
Bug 13547: (follow-up) Item field 'Materials specified' would be useful to see in OPAC

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 13547: Add item field 3 (Materials specified) to the OPAC holdings table
Nazlı Çetin [Thu, 5 Mar 2020 15:02:37 +0000 (15:02 +0000)]
Bug 13547: Add item field 3 (Materials specified) to the OPAC holdings table

Test plan:

1- View a record with Materials specified (field 3) data in the opac
2- Apply patch
3- Log in to staff client
4- Home->Administration->Column Settings->OPAC->holdingst
5- Set item_materials visibility
6- Refresh OPAC page
7- Confirm that the materials specified column has been added after the
   Call number column.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24823: (QA follow-up) Fix deletion and POD
Nick Clemens [Thu, 7 May 2020 12:06:10 +0000 (12:06 +0000)]
Bug 24823: (QA follow-up) Fix deletion and POD

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24823: Remove unused parameters
David Gustafsson [Thu, 12 Mar 2020 10:52:18 +0000 (11:52 +0100)]
Bug 24823: Remove unused parameters

Remove unused Elasticsearch parameters 'key_prefix' and 'request_timeout'.
Refactor so that get_elasticsearch_params only returns parameters used
by Search::Elasticsearch, add class accessor for index_name.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24823: Fix spelling error and remove last of Catmandu
David Gustafsson [Mon, 9 Mar 2020 10:48:13 +0000 (11:48 +0100)]
Bug 24823: Fix spelling error and remove last of Catmandu

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24823: Drop Catmandu dependency
David Gustafsson [Thu, 5 Mar 2020 17:05:10 +0000 (18:05 +0100)]
Bug 24823: Drop Catmandu dependency

Replace remaining Catmandu dependant code with the Search::Elasticsearch
equivalent.

To test:
1) Apply patch
2) Run tests in t/Koha/SearchEngine/Elasticsearch.t, t/Koha/SearchEngine/ElasticSearch/*
and t/db_dependent/Koha/SearchEngine/*
3) All tests should pass

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 22970: Allow to change homebranch in batch add course reserves
Julian Maurice [Fri, 24 May 2019 06:51:58 +0000 (08:51 +0200)]
Bug 22970: Allow to change homebranch in batch add course reserves

Test plan:
1. Create a course (disabled)
2. Add multiple reserves to this course using 'batch add' and set
   a homebranch different from the items homebranch
3. Enable the course
4. Verify that the items homebranch have changed
5. Disable the course
6. Verify that the items homebranch were reset to their initial value

Depends on bug 22630

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25279: (QA follow-up) Use .escapeHtml
Tomas Cohen Arazi [Thu, 7 May 2020 13:10:18 +0000 (10:10 -0300)]
Bug 25279: (QA follow-up) Use .escapeHtml

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25279: Replace encodeURI with encodeURIComponent
Jonathan Druart [Wed, 6 May 2020 14:09:32 +0000 (16:09 +0200)]
Bug 25279: Replace encodeURI with encodeURIComponent

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25279: URI-escape city_id in links
Tomas Cohen Arazi [Wed, 6 May 2020 13:34:09 +0000 (10:34 -0300)]
Bug 25279: URI-escape city_id in links

This patch escapes city_id uses in URLs, and also removes redundant dom
entry as this is inherited from the global datatables configuration
anyway.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25279: Use another var name for the filter
Jonathan Druart [Wed, 6 May 2020 12:59:47 +0000 (14:59 +0200)]
Bug 25279: Use another var name for the filter

It prevents:
* The screen to display "no city, create one" if we are
searching for a string that does not return any results.
* The list to display only the city we have just created

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25279: HTML escape cells
Tomas Cohen Arazi [Tue, 5 May 2020 23:28:10 +0000 (20:28 -0300)]
Bug 25279: HTML escape cells

This patch makes HTML entities be escaped. It is done in a simple way.
We need to explore ways to do it at datatables.js level but it deserves
its own bug.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25279: (QA follow-up) Original behaviour
Tomas Cohen Arazi [Tue, 5 May 2020 21:55:49 +0000 (18:55 -0300)]
Bug 25279: (QA follow-up) Original behaviour

This patch does the following things:
- Uses a call to Koha::Cities->search(*)->count to display the same
  message we displayed before when no city was found/defined (datatable
  not rendered at all).
- Restores the main search box functionality, the passed param is used
  to query on the city name with wildcards on both sides, for (a)
  counting results and for (b) apending to the API call with the same
  behaviour.

The only missing bit from QA is HTML/URI escaping values from cells, but
this is going to happen at DT level most sure.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25279: (QA follow-up) Make button texts translatable
Tomas Cohen Arazi [Fri, 1 May 2020 05:26:27 +0000 (02:26 -0300)]
Bug 25279: (QA follow-up) Make button texts translatable

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25279: Fix edit and delete links
Kyle M Hall [Mon, 27 Apr 2020 19:35:18 +0000 (15:35 -0400)]
Bug 25279: Fix edit and delete links

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25279: Use the API to list cities
Tomas Cohen Arazi [Fri, 24 Apr 2020 14:50:04 +0000 (11:50 -0300)]
Bug 25279: Use the API to list cities

This patch makes the general cities datatable use the API for rendering.
To test:
1. Test the datatable behaviour
2. Apply this patch
3. Repeat your tests
=> SUCCESS: Things work! Filtering and sorting specially

Bonus: Use the browser inspector to notice each interaction with the
datatable triggers an API call with the right query parameters

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25279: Add general query parameters to the /cities route
Tomas Cohen Arazi [Fri, 24 Apr 2020 14:48:58 +0000 (11:48 -0300)]
Bug 25279: Add general query parameters to the /cities route

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24561: (follow-up) Use full_numbers for pagingType
Tomas Cohen Arazi [Tue, 5 May 2020 21:26:48 +0000 (18:26 -0300)]
Bug 24561: (follow-up) Use full_numbers for pagingType

We are trying to keep the current datatables behaviour so this is a
trivial yet sensible change.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24561: (follow-up) Set default matching criteria to 'contains' and add configurat...
Agustin Moyano [Thu, 30 Apr 2020 14:20:05 +0000 (11:20 -0300)]
Bug 24561: (follow-up) Set default matching criteria to 'contains' and add configuration option

This patch adds option.criteria as an option. Possible values are
'contains', 'starts_with', 'ends_with' and 'exact'. 'contains' is the
default value.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24561: Add a Datatables api wrapper that implements filter and order embedded...
Agustin Moyano [Wed, 19 Feb 2020 14:33:14 +0000 (11:33 -0300)]
Bug 24561: Add a Datatables api wrapper that implements filter and order embedded columns

This patch adds the ability to filter and order by embedded columns.

To use it you must in JS:

$('datatable_selector').api({datatables_options})

where datatables_options are all datatables options plus:

1. embed: [list of embeddable tables]
   This option adds x-koha-embed header to request.

2. header_filter: true|false
   This option if true sets x-koha-query header with stringyfied json of filters

Oderable and searchable columns must define data option as string, otherwise filter and order won't be possible.
If you must custom the output, use the render function.

For example:

* Don't

> $('.table_selector').api({
>   columns: [
>     {
>       data: function(row, type, val, meta) {
>         return '<a href="'+row.link+'">'+row.holds.patron.firstname+'</a>';
>       },
>       orderable: true,
>       searchable: true
>     }
>   ]
> });

* Do

> $('.table_selector').api({
>   columns: [
>     {
>       data: 'holds.patron.firstname',
>       render: function(row, type, val, meta) {
>         return '<a href="'+row.link+'">'+row.holds.patron.firstname+'</a>';
>       },
>       orderable: true,
>       searchable: true
>     }
>   ]
> });

To test you must implement and test bug 20936, where it will be used.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25188: Make circulation notes more prominent on the patron details tab
David Roberts [Mon, 4 May 2020 16:00:26 +0000 (16:00 +0000)]
Bug 25188: Make circulation notes more prominent on the patron details tab

This patch adds a more prominent circulation note to the moremember.pl
details screen.

To test:

1) Add a circulation note to a patron record.
2) Note that it displays prominently on the checkout tab, but only under
the Library Use block on the details tab.
3) Apply the patch.
4) Check that the note is now displayed prominently at the top of the
details (moremember.pl) screen.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24185: Add mentorship
Martin Renvoize [Tue, 12 May 2020 10:20:33 +0000 (11:20 +0100)]
Bug 24185: Add mentorship

Mentored-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24027: Add Mentorship lines
Martin Renvoize [Tue, 12 May 2020 10:18:43 +0000 (11:18 +0100)]
Bug 24027: Add Mentorship lines

Mentored-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25409: Add missing "Required" text and "required" classes
Slava Shishkin [Sun, 10 May 2020 15:15:09 +0000 (18:15 +0300)]
Bug 25409: Add missing "Required" text and "required" classes

Highlight text with red by adding “required” class to the label and added red
“Required” text next to select field in "onboardingstep5.tt" template.

To test:
    1) Start new installation. During onboarding tool phase you will be
       requested to create a new circulation rule.
    2) Observe that "Units" label has no "required" class and that
       there’s no “Required” text next to a select field.
    3) Apply patch.
    4) Repeat step 2 (you can reload circulation rule creation page).
    5) Observe the error is gone.

Mentored-by: Peter Vashchuk <stalkernoid@gmail.com>
Mentored-by: Andrew Nugged <nugged@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25409: Add missing "required" class to template
Slava Shishkin [Thu, 7 May 2020 11:24:31 +0000 (14:24 +0300)]
Bug 25409: Add missing "required" class to template

Added "required" class to "itemtype" label in "onboardingstep5.tt"
template.

To test:
    1) Start new instalation. During onboarding tool phase you will be
       requested to create a new circulation rule.
    2) Observe that "itemtype" label has no "required" class.
    3) Apply patch.
    4) Repeat step 2 (you can reload circulation rule creation page).
    5) Observe the error is gone.

Mentored-by: Peter Vashchuk <stalkernoid@gmail.com>
Mentored-by: Andrew Nugged <nugged@gmail.com>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25184: (RM follow-up) Make DB update idempotent
Martin Renvoize [Tue, 12 May 2020 10:13:49 +0000 (11:13 +0100)]
Bug 25184: (RM follow-up) Make DB update idempotent

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25418: (QA follow-up) Raise size of input box
Nick Clemens [Mon, 11 May 2020 17:08:35 +0000 (17:08 +0000)]
Bug 25418: (QA follow-up) Raise size of input box

In twelve hour format the length of the string is 20 characters
we need the box to fit all of them

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25418: (bug 25133 follow-up) Display due date with hours
Jonathan Druart [Thu, 7 May 2020 15:18:35 +0000 (17:18 +0200)]
Bug 25418: (bug 25133 follow-up) Display due date with hours

And not as due date, it's not a display-only info, but an input.

This patch is a follow-up of Bug 25133: Fix time part of due date for 12hr

== Test plan ==
1. create checkouts with the following params and results
2. tomorrow 11:59 PM timeformat syspref: 12h
   - item is due without a specific time, only date (after-checkout green box)
3. backdate 11:59 PM timeformat syspref: 12h
   - note the yellow confirm box has only the date
   - item is due at 12:00 PM (after-checkout green box)
4. tomorrow 11:23 AM timeformat syspref: 12h
   - item is due at 11:23 AM (after-checkout green box)
5. backdate 11:23 AM timeformat syspref: 12h
   - note the yellow confirm box has the date and time
   - item is due 11:23 AM (after-checkout green box)
6. tomorrow 23:59 timeformat syspref: 24h
   - item is due without a specific time, only date (after-checkout green box)
7. backdate 23:59 timeformat syspref: 24h
   - note the yellow confirm box has only the date
   - item is due at 00:00 (after-checkout green box)
8. tomorrow 11:23 timeformat syspref: 24h
   - item is due at 11:23 (after-checkout green box)
9. backdate 11:23 timeformat syspref: 24h
   - note the yellow confirm box has the date and time
   - item is due 11:23 (after-checkout green box)
10. apply patch
11. create checkouts with the following params and results
12. tomorrow 11:59 PM timeformat syspref: 12h
    - item is due without a specific time, only date (after-checkout green box)
13. backdate 11:59 PM timeformat syspref: 12h
    - note the yellow confirm box has the date and time
      - CHANGE COMPARED TO BEFORE THE PATCH
    - item is due without a specific time, only date (after-checkout green box)
      - CHANGE COMPARED TO BEFORE THE PATCH
14. tomorrow 11:23 AM timeformat syspref: 12h
    - item is due 11:23 AM (after-checkout green box)
15. backdate 11:23 AM timeformat syspref: 12h
    - note the yellow confirm box has the date and time
    - item is due 11:23 AM (after-checkout green box)
16. tomorrow 23:59 timeformat syspref: 24h
    - item is due without a specific time, only date (after-checkout green box)
17. backdate 23:59 timeformat syspref: 24h
    - note the yellow confirm box has the date and time
      - CHANGE COMPARED TO BEFORE THE PATCH
    - item is due without a specific time, only date (after-checkout green box)
      - CHANGE COMPARED TO BEFORE THE PATCH
18. tomorrow 11:23 timeformat syspref: 24h
    - item is due at 11:23 (after-checkout green box)
19. backdate 11:23 timeformat syspref: 24h
    - note the yellow confirm box has the date and time
    - item is due 11:23 (after-checkout green box)

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24378: DBRev 19.12.00.088
Martin Renvoize [Tue, 12 May 2020 10:11:38 +0000 (11:11 +0100)]
Bug 24378: DBRev 19.12.00.088

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24378: (QA follow-up) fix minor issues
Jonathan Druart [Mon, 11 May 2020 13:44:32 +0000 (15:44 +0200)]
Bug 24378: (QA follow-up) fix minor issues

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24378: (follow-up) Format due date as due date
Katrin Fischer [Sun, 10 May 2020 17:06:17 +0000 (17:06 +0000)]
Bug 24378: (follow-up) Format due date as due date

Changes the due date formatting as was already done
for the new sample files on bug 23787.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24378: Database update to rewrite notice if left unchanged
Katrin Fischer [Sat, 11 Apr 2020 17:52:30 +0000 (17:52 +0000)]
Bug 24378: Database update to rewrite notice if left unchanged

The database update makes the same changes as done by
Andrew on the old database entry. We check for full sentences
left unchanged to minimize issues with changes made by the library.

Test plan of first patch applies.

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24378: Change wording of auto_renewals notice in updatedatabase
Andrew Fuerste-Henry [Wed, 11 Mar 2020 00:15:58 +0000 (00:15 +0000)]
Bug 24378: Change wording of auto_renewals notice in updatedatabase

On the template of AUTO-RENEWALS the wording is grammatically incorrect:

[% IF checkout.auto_renew_error == 'too_many' %]
You have reach the maximum of checkouts possible.

This should say
[% IF checkout.auto_renew_error == 'too_many' %]
You have reached the maximum of checkouts possible.

Test plan:
- Make sure you have the AUTO_RENEWALS notice with the problematic
  spelling
- install patch
- update database
- confirm changes to notice name and wording

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Kept Andrew's change on the original updatedatabase entry,
but removed the database update to be done a little differently
in a follow-up patch.

Amended test plan.

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 22437: (follow-up) Move deletion of merge requests to DelAuthority
Marcel de Rooy [Fri, 8 May 2020 06:46:59 +0000 (06:46 +0000)]
Bug 22437: (follow-up) Move deletion of merge requests to DelAuthority

Lines can be moved. Deletion can be done too if skip_merge is not set.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 22437: Delete older merge requests at new merge time
Marcel de Rooy [Fri, 3 Apr 2020 08:55:45 +0000 (08:55 +0000)]
Bug 22437: Delete older merge requests at new merge time

If you merge A to B, we should remove older AA merges (regular
merge to itself) in the queue before deleting A.

Test plan:
[1] Set merge limit in prefs to say X.
[2] Find three authorities A, B, C with linkcount >X, >X, <X.
[3] Merge C to B. This creates a 'BB merge' in the queue.
    Auth C is deleted.
[4] Merge B to A. Creating AA and BA in the queue.
    Auth B is deleted.
    Optionally verify that BB is no longer in the queue.
[5] Run the merge_authorities.pl cron job.
    Verify that the linkcount to A is the former total of ABC.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Phil Ringnalda <philringnalda@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 22437: Add test case to Merge.t
Marcel de Rooy [Mon, 6 Apr 2020 13:44:46 +0000 (13:44 +0000)]
Bug 22437: Add test case to Merge.t

Test proves now that a 'destructive merge' is removed by
DelAuthority.

Test plan:
Run t/db_dependent/Authority/Merge.t. Should fail when you
do not apply the other two patches and pass with them.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25421: Update POD
Jonathan Druart [Mon, 11 May 2020 12:51:58 +0000 (14:51 +0200)]
Bug 25421: Update POD

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25421: Remove use of Koha::Libraries->pickup_locations
Tomas Cohen Arazi [Fri, 8 May 2020 13:04:30 +0000 (10:04 -0300)]
Bug 25421: Remove use of Koha::Libraries->pickup_locations

The current implementation uses Koha::Libraries->pickup_locations which
is problematic and due to be removed by bug 24368. This patch makes the
trivial change of just searching for libraries that are marked with
pickup_location => 1.

Calls to Koha::Item->pickup_locations and Koha::Biblio->pickup_locations
are as well adapted to the new arrayref return value.

To test:
1. Pick a record with only one item
2. Place a biblio-level hold on it
3. Edit the items: remove the item
4. Go to the Holds tab
=> FAIL: It explodes
5. Apply this patch and restart:
   $ sudo koha-plack --restart kohadev
6. Go back and go to the holds tab again
=> SUCCESS: No failure!
7. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Didier Gautheron <didier.gautheron@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25421: Make ->pickup_locations only return an arrayref
Tomas Cohen Arazi [Fri, 8 May 2020 14:40:15 +0000 (11:40 -0300)]
Bug 25421: Make ->pickup_locations only return an arrayref

This patch makes Koha::Item->pickup_locations and
Koha::Biblio->pickup_locations always return an arrayref.

Test are adjusted to reflect this:

1. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Biblio.t t/db_dependent/Koha/Item.t
=> SUCCESS: Tests pass!
2. Apply this patch and repeat 1
=> SUCCESS: Tests pass!
3. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Didier Gautheron <didier.gautheron@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25342: Unit test
Nick Clemens [Thu, 7 May 2020 13:08:14 +0000 (13:08 +0000)]
Bug 25342: Unit test

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>