koha.git
3 years agoBug 27828: (bug 24469 follow-up) Add missing import
Jonathan Druart [Tue, 2 Mar 2021 10:36:49 +0000 (11:36 +0100)]
Bug 27828: (bug 24469 follow-up) Add missing import

Caused by
  commit 03a9bdc851dcfe114c1676ac55def1e1c5d51970
  Bug 24469: Move the new queries to a dedicated ImportBatch subroutine

Undefined subroutine &CGI::Compile::ROOT::kohadevbox_koha_acqui_neworderempty_2epl::SetMatchedBiblionumber called at /kohadevbox/koha/acqui/neworderempty.pl line 183

Test plan:
Create a new order from a staged file, select "Add order" next to a
title

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 7b4be9486e6e37e724560863f36e4835b6a66f43)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 7d94c3cad7c8a8d028d94f4d2e0c81ca00452e89)

3 years agoBug 27808: (QA follow-up) Make sure the update catches the items we want
Tomas Cohen Arazi [Mon, 1 Mar 2021 14:56:23 +0000 (11:56 -0300)]
Bug 27808: (QA follow-up) Make sure the update catches the items we want

This query:

SELECT *
FROM items
LEFT JOIN issues
ON issues.itemnumber=items.itemnumber
WHERE items.onloan IS NULL;

returns 961 rows on the sample data, with 2 items checked out and onloan
set to NULL.

With this tweak, the query only matches the 2 checkout items with onloan
set to NULL:

SELECT *
FROM items
LEFT JOIN issues
ON issues.itemnumber=items.itemnumber
WHERE items.onloan IS NULL AND issues.issue_id IS NOT NULL;

This is the query that needs to be used on the atomic update for
filtering the items to be updated.

This patch does that.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 8df3e02885f94ef8a6f960f693c398b6646daf09)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 8a59b80e7e7cc812c2b1695e75c2020ba9bf3293)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoDBRev 20.05.09.002
Andrew Fuerste-Henry [Sun, 14 Mar 2021 18:53:39 +0000 (18:53 +0000)]
DBRev 20.05.09.002

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27808: DB changes - adjust items.onloan when needed
Jonathan Druart [Mon, 1 Mar 2021 12:34:56 +0000 (13:34 +0100)]
Bug 27808: DB changes - adjust items.onloan when needed

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit bb2758839e56c78b5f4d47f28d26053a29ae4d68)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 79ef9d3be86757c1c7caefc79a1d51e2c4ec4371)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27808: Refresh the item object when AddReturn is called
Tomas Cohen Arazi [Fri, 26 Feb 2021 19:55:59 +0000 (16:55 -0300)]
Bug 27808: Refresh the item object when AddReturn is called

This patch changes the original implementation so the item object is
refreshed altogether instead of explicitly pinpointing a specific field
we identified an edge case can leave out from ->store. I propose this
alterate implementation because what this bug highlights is the fact we
don't code thinking calls to things can have side-effects (like this
case, with AddReturn updating the onloan status (and maybe other
things?).

To test:
1. Make sure circ tests pass with and without this patch

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>
(cherry picked from commit 26b57ad5d20e385ff922cc8737afebfece17a3cf)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 52babece97c9376b2bc7258a88c753e8f28f33ab)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27808: Mark the onloan column as dirty in AddIssue
Kyle M Hall [Fri, 26 Feb 2021 14:56:07 +0000 (09:56 -0500)]
Bug 27808: Mark the onloan column as dirty in AddIssue

If any item is currently checked out to a patron, and the item is then checked out directly to another patron without manually checking the item in first, the items.onloan column will remain NULL.

This will only happen if the new checkout will be due the same day as the previous checked.

This is caused by the item being returned without updating the item object from storage afterward. Even though AddIssue will call AddReturn which sets the value of onloan to NULL in the database, we are not passing in the item object by reference, so it's onloan value remains set to a date. Then we set the onloan value to the same date. Because the value does not change in the object, the column does not get marked dirty.

We could update the object from storage first, but it seems more efficient to mark the column as dirty manually to avoid that otherwise unnecessary fetch.

Test Plan:
1) Apply these patches
2) prove t/db_dependent/Circulation.t

Signed-off-by: Lisette Scheer <lisettes@latahlibrary.org>
Signed-off-by: Marti Fuerst <mfuerst@hmcpl.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 44a54eb526eff58b860d699ee3c5fb11b3b25fab)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit d4f047c672d25ab5f2ec4dcb716117c7e4b9083f)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27808: Add unit tests
Kyle M Hall [Fri, 26 Feb 2021 14:44:30 +0000 (09:44 -0500)]
Bug 27808: Add unit tests

Signed-off-by: Lisette Scheer <lisettes@latahlibrary.org>
Signed-off-by: Marti Fuerst <mfuerst@hmcpl.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 36c49aa2a865a069592c5d7695127252a3007f44)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 1f8bc45f2d367ed5c7e97c047ddbbb8dafa8ebf5)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27794: Add link to biblio in lateorders page
Owen Leonard [Thu, 25 Feb 2021 14:03:43 +0000 (14:03 +0000)]
Bug 27794: Add link to biblio in lateorders page

This patch modifies the late orders page so that the late order title
uses the "biblio-title" include to display a standard title with a link
to the bibliographic detail page.

To test, apply the patch and go to Acquisitions -> Late orders.

In the table of late orders, confirm that the title display correctly
and links to the correct bibliographic record.

Signed-off-by: Severine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 12d50cb5d8529d993ef5abccd84535540c938bee)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit a557bde38ec57d8b3c2ed8cbee7190935aed2d38)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoDBRev 20.05.09.001
Andrew Fuerste-Henry [Mon, 8 Mar 2021 16:10:07 +0000 (16:10 +0000)]
DBRev 20.05.09.001

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoRevert "DBRev 20.05.09.001"
Andrew Fuerste-Henry [Mon, 8 Mar 2021 16:03:33 +0000 (16:03 +0000)]
Revert "DBRev 20.05.09.001"

This reverts commit fa3c0a4cda34a1d7b0d7a008077fd458e4c8e676.

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27754: Clear merge markers
Andrew Fuerste-Henry [Mon, 8 Mar 2021 15:52:20 +0000 (15:52 +0000)]
Bug 27754: Clear merge markers

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoDBRev 20.05.09.001
Andrew Fuerste-Henry [Mon, 8 Mar 2021 14:51:21 +0000 (14:51 +0000)]
DBRev 20.05.09.001

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 7806: [20.05] (follow-up) Update to use sanitize_zero_date
Martin Renvoize [Wed, 24 Feb 2021 15:07:38 +0000 (15:07 +0000)]
Bug 7806: [20.05] (follow-up) Update to use sanitize_zero_date

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 7806: [20.05] Fix remaining occurrences of 0000-00-00
Jonathan Druart [Fri, 18 Dec 2020 14:16:11 +0000 (15:16 +0100)]
Bug 7806: [20.05] Fix remaining occurrences of 0000-00-00

We should remove all SQL queries that contain 0000-00-00 and finally
assume we do not longer have such value in our DB (for date type)

We already dealt with such values in previous update DB entries.
The 2 added by this one haven't been replaced already.

The code will now assume that either a valid date exist, or NULL/undef.

Test plan:
QA review is needed and test of the different places where code is
modified.

Not sure about the change from reports/issues_avg_stats.pl

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27680: (QA follow-up) Update test for dbic_merge_sorting
Martin Renvoize [Tue, 2 Mar 2021 08:56:14 +0000 (08:56 +0000)]
Bug 27680: (QA follow-up) Update test for dbic_merge_sorting

The order_by handling will now always return an arrayref of ordering
hashrefs even when only one ordering hash is present. This is
interpreted by dbic as equivilent so I just update the test to pass
here.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 96aa6877ae39c987214e46d00c70c76591da0174)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit c4ce9c97007f66687097afc729f257e0836b5ca0)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27680: Add support for param[] syntax
Tomas Cohen Arazi [Fri, 26 Feb 2021 17:44:23 +0000 (14:44 -0300)]
Bug 27680: Add support for param[] syntax

While not that common nowadays, it is the syntax PHP uses, and
DataTables also generates such thing in 'traditional' mode. We should
support it as well.

This patch adds support for that. It does so by adding _order_by[] to
the reserved param names, and proper handling on the dbic_merge_sorting
helper.

To test:
1. Apply this patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/REST/Plugin/Objects.t
=> SUCCESS: Tests pass!
3- Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Bug 27680: (QA follow-up) Minor perlcritic issue

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 79064a88639ba725cc898cb940c85ff3fb1d4bee)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 95fda2115d9c0106072eca39ebf7cf6fe02c7edf)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27680: Allow traditional multi-params to work
Martin Renvoize [Fri, 12 Feb 2021 19:25:10 +0000 (19:25 +0000)]
Bug 27680: Allow traditional multi-params to work

This patch allows the preceeding test to pass. Strictly, we want a comma
delimited string for our _order_by parameter, but we cannot easily block
a traditional multi-passed parameter.  As such the 'nice' thing to do is
handle it when such a thing is passed as it will pass through validation
regardless.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit bc23981b46e67a6d9ee91a2065293ac472341bed)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 30f02bee8a6553cbb2828d607aaae9e7d2b6c9f3)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27680: Add tests for various ways of passing multi-params
Martin Renvoize [Fri, 12 Feb 2021 14:05:13 +0000 (14:05 +0000)]
Bug 27680: Add tests for various ways of passing multi-params

This patch adds unit test to increase the coverage of parameter that
accept multiple values.  There are a number of different ways end users
can send such parameters and we should test to ensure we are recieving
the correct option.

Options
`?param1=this&param1=that` - traditional multiple pass params
`?param1[]=this&param1[]=that` - php multiple pass params
`?param1=this,that` - comma delimited list param
`?param1=this|that` - pipe delimited list param

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit d2a43a77aabd9cf885d6dc9b72458a00bbc28ac9)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 5191ed911dbbe81c0a262646b58b9a6b6143acad)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27680: Add support for sorting fields with multiple data points
Martin Renvoize [Fri, 12 Feb 2021 13:14:16 +0000 (13:14 +0000)]
Bug 27680: Add support for sorting fields with multiple data points

This patch adds proper handling for sorting a single column that is
constructed of multiple data entities.. i.e `"data": "string1:string2"`

It does NOT add support for filtering on multiple columns yet.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit fa1671aba529e55f124eb759f3b09e237a7282fe)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 17eaec7a486800cfdc1f6b8fde8836738bed6406)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27680: Take first order column for ordering
Jonathan Druart [Fri, 12 Feb 2021 09:53:27 +0000 (10:53 +0100)]
Bug 27680: Take first order column for ordering

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit ba7f51f3d12fe2a66b8094d9a10a234a3f4e7c4d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 1a62dd04c5eeb3aa1792daa98eaea2fc0800f591)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27754: Correct eslint errors in basket.js
Owen Leonard [Mon, 22 Feb 2021 17:51:16 +0000 (17:51 +0000)]
Bug 27754: Correct eslint errors in basket.js

This patch makes minor changes to basket.js in the staff interface
templates in order to quiet warnings from ESLint. Besides whitespace,
most changes are to correct undeclared or unnecessarily declared
variables.

To test, apply the patch and verify that the cart still works
correctly.

 - Perform a catalog search in the staff interface.
 - Test adding single or multiple items to the cart from the search
   results page.
 - Testing adding and removing titles to the cart from the bibliographic
   detail page.
 - Open the cart and test the various controls in the toolbar to confirm
   that they still work correctly.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit ae62da0ff6a3fa5df3e01fce656fccc02ce6a55e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 7666b52cec8d6004b6824f78667d52de4088f887)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27578: Initialize searchid as blank when not populated
Nick Clemens [Fri, 29 Jan 2021 13:47:22 +0000 (13:47 +0000)]
Bug 27578: Initialize searchid as blank when not populated

This patch simply sets the searchid to a blank string if not passed in

To test:
1 - Add a new biblio and save it
2 - Check the logs: /var/log/koha/kohadev/plack-intranet-error.log (or similar)
3 - Note warn about uninitialized value
4 - Apply patch
5 - Add a new biblio
6 - No warn

Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 7f0b0e0556127c9ed191b1b741c4cf466b28e1d6)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit e64e3156d7a10e3d0418432b95e05363e984909c)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 25777: Disable misleading datatables table information display z3950
David Cook [Wed, 17 Jun 2020 04:34:02 +0000 (04:34 +0000)]
Bug 25777: Disable misleading datatables table information display z3950

This patch disables the table information display on z3950_search.pl,
since it only includes search result counts for that page, which is
misleading to end users.

To test:
1)  Do not apply the patch
2)  Do a Z39.50 search from cataloguing for "test" against Library of
    Congress.
3)  Note the bottom of the page says "Show 1 to 20 of 20" and
    "Showing page 1 of 501"
4)  Do a Z39.50 search from Acquisitions for "test" against Library of
    Congress (Acquisitions -> Vendor -> Basket -> Add to basket -> From
    external source).
5)  Apply the patch and restart Plack
6)  Repeat Step #2
7)  Note the bottom of the page now only says "Showing page 1 of 501"
8)  Note the search bar is gone
9)  Repeat step #4
10) Note the bottom of the page now only says "Showing page 1 of 501"
11) Note the search bar is gone

Squashed and mixed authorship added below
Co-authored-by: Owen Leonard <oleonard@myacpl.org>
Co-authored-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 2a2a04a641289f6043971dd98037e02fbb30f64f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 1e03555d4ca523bd9e4cb4e5ca265acf26e49800)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27798: Add warning to IndependentBranches system preference
Kyle M Hall [Thu, 25 Feb 2021 18:33:31 +0000 (13:33 -0500)]
Bug 27798: Add warning to IndependentBranches system preference

Test Plan:
1) Apply this patch
2) Search system preferences for IndependentBranches
3) Note the warning about changing the setting on a production system

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
JD Amended patch:
* Fix commit title
* Don't split the syspref's description, otherwise the sentence will be
split in the POs

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit fa8a60ddc8ac45404b6159fde5c758e4b0dad60b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 934e033496d3774edf2522aa1f8d140eb2f0af45)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 26457: [20.05.x] Throw exception if update of issues table fails
Nick Clemens [Fri, 4 Dec 2020 12:03:52 +0000 (12:03 +0000)]
Bug 26457: [20.05.x] Throw exception if update of issues table fails

While this won't prevent the deadlock, it should catch the case where
a deadlock causes the DB update to fail and provide feedback to the user
and rollback the transaction

I don't know how to trigger the deadlock, I can only confirm that we see it, and
that this should catch it.

To test:
1 - Apply patches
2 - Checkout several items to a patron
3 - Confirm that 'Renew all' feature continues to work as expected and all items are renewed

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Bug 26457: Unit test

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Bug 26457: (QA follow-up) Switch to PK index in UPDATE on issues

The deadlock reports tell us that multiple transactions are
waiting for a X lock on a record but using a secondary index
on borrowernumber and itemnumber. Since we have the issue_id
at hand already, we should use that and benefit from the clustered
index (on PK) instead of using a secondary index.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27821: Make sanitize_zero_date support datetime and timestamp
Jonathan Druart [Mon, 1 Mar 2021 10:14:32 +0000 (11:14 +0100)]
Bug 27821: Make sanitize_zero_date support datetime and timestamp

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 3e3803ee20dc3dfc3d21e5cafa7a76159c8d4aba)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 3652f652d260bafc8669205d59866db792e56f47)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27071: (follow-up) Get rid of loop
Tomas Cohen Arazi [Mon, 22 Feb 2021 12:27:12 +0000 (09:27 -0300)]
Bug 27071: (follow-up) Get rid of loop

This patch gets rid of a loop on the librarary's groups siblings, and
acknowledges ->get_hold_libraries returns a proper Koha::Libraries
iterator that can be chained with a new query on the passed branchcode.
This way we only fetch  a count from the DB and no loop needs to take
place on the code.

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

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
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>
(cherry picked from commit 3495a7e9af70706e3ebba60e3fac7aa3845d1d78)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 3525fc03c6d6bb7dbb3e0d49ac8e68444839e82b)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27071: (follow-up) Provide a more meaningful error message
Tomas Cohen Arazi [Tue, 9 Feb 2021 15:26:50 +0000 (12:26 -0300)]
Bug 27071: (follow-up) Provide a more meaningful error message

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
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>
(cherry picked from commit 3e8e15cc64a8b09fc9575af4b9fcbae437293715)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 17bcc1aeea0ad2a60f24a68fa4ba31bf64c15c59)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27071: Use GetReservesControlBranch to pick the branch
Tomas Cohen Arazi [Tue, 9 Feb 2021 15:14:19 +0000 (12:14 -0300)]
Bug 27071: Use GetReservesControlBranch to pick the branch

Pretty much like the opac-reserve.pl does, this patch makes the staff
request.pl script get the branch from the specialized routine from
C4::Reserves instead of falling back to userenv.

To test:
1. Follow the original test plan:
- Create two local hold groups containing distinct lists of libraries.
- In default rules for all libraries, set Hold Policy = "From local hold group" and Hold pickup library match to "Patron's hold group"
- Make sure AllowHoldPolicyOverride is set to Don't Allow

- Make sure you're logged in at a library in Group 1
- Find a bib with only 1 item from Group 1. Confirm you can place a hold on this title for a patron in Group 1 (correct), but not for a patron in Group 2 (correct).
- Find a bib with only 1 item from Group 2. Confirm you cannot place a hold for a patron from Group 1 (correct), BUT you also cannot place a hold for a patron from Group 2 (incorrect) -- Koha gives the erroneous message "pickupNotInHoldGroup"

- Change your library to a something in Group 2
- Find a bib with only 1 item from Group 1. Confirm you cannot place a hold on this title for a patron in Group 1 (incorrect), and not for a patron in Group 2 (correct).
- Find a bib with only 1 item from Group 2. Confirm you cannot place a hold for a patron from Group 1 (correct), but you can place a hold for a patron from Group 2 (correct)
=> FAIL: Things expected to fail on the plan, fail.
2. Apply this patches
3. Repeat 1
=> SUCCESS: It now works!

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
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>
(cherry picked from commit aa221e0c8bcf0fa0377d6c2154bad0ef61c97a2b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 2eb39998c6cd73c2bbc5f2654e862738d0140c15)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27071: More tests for Koha::Library->validate_hold_sibling
Tomas Cohen Arazi [Tue, 24 Nov 2020 14:55:14 +0000 (11:55 -0300)]
Bug 27071: More tests for Koha::Library->validate_hold_sibling

This patch adds tests for more than one non-same sibling libraries in
the hold group. Tests pass which means it is working as expected.

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

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
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>
(cherry picked from commit 1de7ec0697c75c3161d950b9f6f6c8d99640b607)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 5e1d0347f6452d7920f8d8762925f174a7e7995b)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27071: Code simplification
Jonathan Druart [Mon, 23 Nov 2020 14:52:56 +0000 (15:52 +0100)]
Bug 27071: Code simplification

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
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>
(cherry picked from commit c6606d4a6567a00f2defd72a32ff466c01a54e96)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 9104c191f3c3f5a77c7648e167cc5c344feea026)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27071: Fix Hold pickup library when using hold groups
Jonathan Druart [Mon, 23 Nov 2020 14:49:35 +0000 (15:49 +0100)]
Bug 27071: Fix Hold pickup library when using hold groups

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
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>
(cherry picked from commit 4b445425ebaffe4ec4aab3c45cb4ae4f2d4bf172)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit b08928b65bb7b4663f8022c4668fd720ad852aa6)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 26208: Perform batch checkin/renewals serially rather than asynchronously
Nick Clemens [Thu, 3 Dec 2020 19:13:15 +0000 (19:13 +0000)]
Bug 26208: Perform batch checkin/renewals serially rather than asynchronously

The issue here seems to be that when multiple requests hit at once they may not register that the renewal
performed by the request should lift restrictions on the account.

To mitigate this we can simply perform the renewals one after the other.

To test:
1 - have multiple overdue items on one patron
2 - run overdues.pl with triggers set to generate a restriction
3 - renew all overdues with the Renew All button
4 - restriction is not removed even though patron no longer has overdue items
5 - Apply patch
6 - Make all items overdue again
7 - Click Renew All
8 - Items are renewed and restriction removed
9 - Checkout items to patron again (overdue or not)
10 - Click 'Select all' in checkin column
11 - Click 'Renew/Checkin selected items'
12 - Confirm checkin succeeds as before patches

Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Bug 26208: (follow-up) Remove debugging statements

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit a825c729386e7f528846445937e00eda92f01f68)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit b150fdc79247b6fedda5054b374aafe8292ee3fa)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27593: Consistent behavior for club holds route
Tomas Cohen Arazi [Tue, 2 Feb 2021 14:22:50 +0000 (11:22 -0300)]
Bug 27593: Consistent behavior for club holds route

This patch:
- Fixes a malformed response when biblio_id is invalid
- Fixes the return status (400 => 404) when biblio_id is invalid
- Adapts the error strings to be consistent with the Cities.pm file

To test:
1. Apply the regression tests patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/clubs_holds.t
=> FAIL: Tests fail
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass!
5. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
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>
(cherry picked from commit 2387ac731c03ecfa6cd20e7e71037bbd3c3ac046)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit e1f35cf3474952a851e62a2366fd520f0b413228)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27593: Regression tests
Tomas Cohen Arazi [Tue, 2 Feb 2021 14:18:27 +0000 (11:18 -0300)]
Bug 27593: Regression tests

This patch introduces tests for the behaviour change (400 => 404) and
also adds tests for untested (error) behaviours. Notably, the 'Biblio
not found' problematic return value couldn't be triggered, because the
OpenAPI plugin returns a 500 because the response was malformed
(expected { error => 'message' } and it was returning a string).

For the above reason, running the regression tests will show a 500...
instead of the expected 400.

I covered the rest of the codepaths that trigger errors to have full
coverage.

To test:
1. Apply this patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/clubs_holds.t
=> FAIL: Tests fail loudly

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
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>
(cherry picked from commit 024a32ca807bb69b3d46136421dce871ba0bddbf)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit e950abb5352aa29d91de47a40f67067d237836fb)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27713: Duplicate search field IDs in MARC framework administration template
Owen Leonard [Tue, 16 Feb 2021 13:48:04 +0000 (13:48 +0000)]
Bug 27713: Duplicate search field IDs in MARC framework administration template

This patch makes a minor change to the MARC framework administration
template so that the ID of a form field on the page isn't a duplicate of
one in the header search form.

To test, apply the patch and go to Administration -> MARC bibliographic
framework -> MARC structure.

- Test the "Search for tag" form field to confirm that it works
  correctly.
- Validate the HTML of the page to confirm that there are no "Duplicate
  ID" errors.

Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit ebb70e4d16df961698e379c8208984809ad340be)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit f1c01793be031ada3de20cc9652c1c31e2f5e94d)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27332: Hide branchcode and note is RenewSerialAddsSuggestion if off
Jonathan Druart [Tue, 5 Jan 2021 08:54:54 +0000 (09:54 +0100)]
Bug 27332: Hide branchcode and note is RenewSerialAddsSuggestion if off

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit d0182ab805b436f346637cae196e851371005552)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 30a54ea3387692ff56b158ced08b325071857614)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27332: Use the branchcode from the subscription when renewing
Jonathan Druart [Tue, 5 Jan 2021 07:10:33 +0000 (08:10 +0100)]
Bug 27332: Use the branchcode from the subscription when renewing

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 6aa9f78258444a5db6ba9997491865f13ff96404)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit c1558803c7f359389d8e3ac2a339607cbf1906ba)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27729: Fix use of grep and split in CheckReserves
Marcel de Rooy [Fri, 19 Feb 2021 10:17:26 +0000 (10:17 +0000)]
Bug 27729: Fix use of grep and split in CheckReserves

A few lines of code were added to CheckReserves containing the wrong
use of two perl functions: grep and split on bug 25232.
A test was added even making these things pass.

Test plan:
Run t/db../Holds.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit c4c3d1e93c337d93679e50f2354c8b060e50bcd9)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit a29962440451cc7b3cd79370008eea94c83e9c8e)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27014: (QA follow-up) Add regression tests
Martin Renvoize [Tue, 12 Jan 2021 11:15:28 +0000 (11:15 +0000)]
Bug 27014: (QA follow-up) Add regression tests

This patch adds a regression test for the change introduced in the
patchset.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit d9c6365793de79730210429d1689300881181277)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 77b81733d7702cef02d4b19702effc1eb5c64ae0)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27014: Enable C4::SIP::ILS::Patron::new to accept a hash
Kyle M Hall [Fri, 13 Nov 2020 13:24:43 +0000 (08:24 -0500)]
Bug 27014: Enable C4::SIP::ILS::Patron::new to accept a hash

Caused by bug 23403 - when performing a checkin we lookup the SIP patron
using the borrowernumber, however, SIP only knows how to find a patron
via cardnumber or userid

The change on 23403 was to avoid using an 'id' that didn't always exist
(as some users don't have a userid or cardnumber

When checking in, however, we are not passed a user cardnumber or
borrowernumber, so we don't have those on hand to get the patron.

Test Plan:
1) Check in an item via SIP, note patron is not found
2) Apply this patch
3) Restart all the things!
4) Check in an item via SIP, patron should be found!

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 05e16389efa6e66476484ee12c3a5c5fdd48757b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit ea74c996834fd5124fe73c893785950b28d932d1)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27714: Prevent Koha::NewsItem->author to explode
Jonathan Druart [Wed, 17 Feb 2021 11:03:56 +0000 (12:03 +0100)]
Bug 27714: Prevent Koha::NewsItem->author to explode

If the author of a news has been removed, Koha::NewsItem->author must
not explode

DBIC result _type  isn't of the _type Borrower at t/db_dependent/Koha/News.t line 68.

Test plan:
 prove t/db_dependent/Koha/News.t
must return green, and changes must be consistent

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>
(cherry picked from commit 506b8f125b7c7dda1dc70b4963026ea975a8c655)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 2329f57f882fa493fb2943b3f242fbc6626ea61d)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 24398: (QA follow-up) Add POD
Nick Clemens [Mon, 21 Dec 2020 13:43:21 +0000 (13:43 +0000)]
Bug 24398: (QA follow-up) Add POD

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit dd36b9bb5b05e66f01ecd32d028247894820523c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit b14cf9f64b752c6bec8cb186102f6a213bcba5b5)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 24398: Fix 500 when viewing a single news item at the OPAC
Jonathan Druart [Thu, 10 Dec 2020 14:10:10 +0000 (15:10 +0100)]
Bug 24398: Fix 500 when viewing a single news item at the OPAC

Test plan:
0. Set the NewsAuthorDisplay preference to 'OPAC' or 'Both OPAC and staff client.'
1. Open the OPAC main page and click on an individual news item
Without this patch you get an ugly 500
    Template process failed: undef error - The method Koha::NewsItem->author_title is not covered by tests!
With this patch applied you see the news with the author's info

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit c596f450d96e04befe6d5335d8ad12679541d220)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 9266846b911f8f69b159ace559a6c119d366336f)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 23675: Add leader and default value for ACQ
Jonathan Druart [Mon, 8 Feb 2021 10:52:17 +0000 (11:52 +0100)]
Bug 23675: Add leader and default value for ACQ

When UseACQFrameworkForBiblioRecords is set, the ACQ framework will be
use when ordering.
But the leader is not defined for this framework and then we will face
encoding issues (I haven't go far investigating this as the suggested
solution worked correctly).

The idea is to define a 000 and default to '     nam a22     7a 4500'
(which is what returns the marc21_leader.pl plugin) for ACQ.

Test plan:
0. Apply this patch and reset_all
1. Create a new basket and place a new order
2. Note that the leader is now displayed on top of the other ACQ
subfields
3. Fill in 245 with "❤️", "ö" or other UTF-8 characters you like
4. Save
5. Notice that 245$a in biblio_metadata is correctly filled with the
title you entered

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit a6527b105897e4611dd702ffbe627ca579baff77)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit abe0f0360cce1535a52bc5981cd1ac02397b816a)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 26051: We should sort callnumber based on cn-sort
Nick Clemens [Fri, 8 Jan 2021 13:14:42 +0000 (13:14 +0000)]
Bug 26051: We should sort callnumber based on cn-sort

In zebra we sort by callnumber using 8007 cn-sort

We should do the same in elasticsearch

To test:
1 - Have Koha using Elasticsearch
2 - Perform a search
3 - Attempt to sort by callnumber
4 - Error in logs: No mapping found for [local-classification__sort]
5 - Apply patch
6 - Restart all
7 - Perform a search and sort by callnumber
8 - Success!

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
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>
(cherry picked from commit a52a0f80b890d70bb51c8629afbf4d81c2901491)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 726da171349310cdf5ef03a3d2876548b0b2f984)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 26051: Add sort=1 on cn-sort in mappings.yaml
Fridolin Somers [Fri, 22 Jan 2021 08:02:11 +0000 (09:02 +0100)]
Bug 26051: Add sort=1 on cn-sort in mappings.yaml

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>
(cherry picked from commit 8790fe908d0207f1923aaad87dc48eecb5747d40)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit ee4845c9f8247b54855458c28a167d8c9e00414f)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27626: Fix self registration if categorycode is hidden and PatronSelfRegistration...
Jonathan Druart [Thu, 4 Feb 2021 16:37:26 +0000 (17:37 +0100)]
Bug 27626: Fix self registration if categorycode is hidden and PatronSelfRegistrationVerifyByEmail

If categorycode is selected in
PatronSelfRegistrationBorrowerUnwantedField and
PatronSelfRegistrationVerifyByEmail is turned on, the patron self registration
fails with

   [You must provide a patron's category to validate password's strength
   and length] at /usr/share/perl5/Exception/Class/Base.pm line 88

Test plan:
0. Select categorycode in PatronSelfRegistrationBorrowerUnwantedField
   and turn on PatronSelfRegistrationVerifyByEmail
1. Self register a patron
2. Confirm that it works as expected with this patch applied.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 74ae74d5faec9a4ba4fbf573b4a81b1274402773)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 2b021df3e2630d98ed6a72f32d3e7d63c8159aa6)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 26997: (QA follow-up) Fix Typo
Martin Renvoize [Fri, 19 Feb 2021 12:14:55 +0000 (12:14 +0000)]
Bug 26997: (QA follow-up) Fix Typo

Feel free to squash this ;)

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 63e3311b109797a60bf6dcaf34e16abb8e3f9fda)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit faec602d3ecf6379519a9499dea94a642cc7940b)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 26997: CAST AS CHAR to prevent the error
Jonathan Druart [Fri, 19 Feb 2021 09:52:45 +0000 (10:52 +0100)]
Bug 26997: CAST AS CHAR to prevent the error

To prevent the DBMS to fail on 0000-00-00 we can cast it as a char and
compare.
This patch also moves to a subroutine, in case we need to adjust (or
reuse) it later.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 0a40b4bb509c306794930ef734513a982e418af5)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 9327130853613d5518326fddcabb1ef153daacbd)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 26997: Remove 0000-00-00 from aqorders.datecancellationprinted
Jonathan Druart [Fri, 13 Nov 2020 12:59:46 +0000 (13:59 +0100)]
Bug 26997: Remove 0000-00-00 from aqorders.datecancellationprinted

This patch remove the 0000-00-00 from the WHERE condition from
ordered.pl and spent.pl to prevent an error under MySQL 8

It also fixes the wrong values in DB (if possible, ie. under other DBMS
that MySQL 8)

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 0e0700a691621b2ef1de46fa0ea18ee771daadaf)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit e6aeb00c1059736c535a45d1a551eaa22c20b01f)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 26997: Fix upgrade process under MySQL 8
Jonathan Druart [Wed, 11 Nov 2020 13:22:50 +0000 (14:22 +0100)]
Bug 26997: Fix upgrade process under MySQL 8

If you are coming from an old version of Koha, you may face an upgrade
error for the SQL query using 0000-00-00.
The idea was to fix it, but actually the DBMS will raise an error (not
blocking the upgrade process however).

We can hide them to not cause confusion

Errors are like:
DBD::mysql::db do failed: Incorrect date value: '0000-00-00' for column 'suggesteddate' at row 1 [for Statement "UPDATE suggestions SET suggesteddate = '1970-01-01' WHERE suggesteddate = '0000-00-00';"] at /kohadevbox/koha/installer/data/mysql/updatedatabase.pl line 23312.

Test plan:
Checkout an old version of Koha (3.20, not older)
Insert a dump, install Koha
Checkout a recent version of Koha, apply the patch (or use master)
Execute the upgrade process
You should not see the errors

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 3c087bc216eeab8fe0d68a2d33407b554bc57074)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit da58f3e2c541bb617ba3ec5ef58d5cf1792caeb7)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27330: (QA follow-up) Return 409 instead
Tomas Cohen Arazi [Wed, 27 Jan 2021 10:37:05 +0000 (07:37 -0300)]
Bug 27330: (QA follow-up) Return 409 instead

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit fd272244157ad0dc5e83a0cfb6430bbf1d3b90c8)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit fd75ab1808940704f9a1445d14d43198e501040d)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27330: (follow-up) Cleanup missed on bug 23843
Tomas Cohen Arazi [Mon, 4 Jan 2021 14:29:38 +0000 (11:29 -0300)]
Bug 27330: (follow-up) Cleanup missed on bug 23843

This patch makes some cleanup missed on bug 23843. The catch condition
on the controller was copied and pasted from other controller and should
be avoided unless there's a known case that needs special handling.
Otherwise it will be catched by the $c->unhandled_exception call.

All the old mappings were inadvertedly kept in the controller as well as
the (unused) _to_api method.

The base class is also cleaned from unnecessary mappings. Only mapped
things need to be added.

To test:
1. Apply this patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/clubs_holds.t \
           t/db_dependent/Koha/Club/Hold.t
=> SUCCESS: Tests pass!
3. Sign off :-D

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit f2593558952909f6c8df5d2ed8c6fea60cf7dcb9)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit cb09491e672658bfa7d5c2b75d5faa74ba6e3418)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27330: Return 403 if club has no enrollments
Tomas Cohen Arazi [Mon, 4 Jan 2021 14:24:51 +0000 (11:24 -0300)]
Bug 27330: Return 403 if club has no enrollments

This patch makes the controller script return a 403 as it should [1]
instead of a plain 500.

To test:
1. Apply the regressions tests patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/clubs_holds.t
=> FAIL: Tests fail!
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass!
5. Sign off :-D

[1] https://www.restapitutorial.com/httpstatuscodes.html

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit ea0696831fadd4b633c90fc7ccd29144e9a6b87a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 4f3d15c8d2e470e7e1f1175879a95d0b9e53a5c7)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27330: Regression tests
Tomas Cohen Arazi [Mon, 4 Jan 2021 14:19:58 +0000 (11:19 -0300)]
Bug 27330: Regression tests

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 2af262e1f2fac89dada52e60c0653f0ad8ba987a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit f48b9b7611bba2ac6b76c7c1336cae72057bdbfb)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27330: Use Basic auth in tests
Tomas Cohen Arazi [Mon, 4 Jan 2021 12:59:26 +0000 (09:59 -0300)]
Bug 27330: Use Basic auth in tests

This patch puts the tests in line with the current codebase. Some bits
are passed through perltidy to aid readability...

To test:
1. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/clubs_holds.t
=> SUCCESS: Tests pass
2. Apply this patch
3. Repeat 1
=> SUCCESS: Tests pass!
=> SUCCESS: Tests look more like the rest of the API tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 94d966ecec327c5dbde22abc5259d380a3610d24)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 465899c347d8910bb338e504ea4bd6b3e91301b3)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoUpdate release notes for 20.05.08 release v20.05.09
Andrew Fuerste-Henry [Tue, 23 Feb 2021 20:31:51 +0000 (20:31 +0000)]
Update release notes for 20.05.08 release

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoIncrement version for 21.05.09
Andrew Fuerste-Henry [Tue, 23 Feb 2021 20:19:43 +0000 (20:19 +0000)]
Increment version for 21.05.09

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoTraslation fixes for Koha 20.05.09
Andrew Fuerste-Henry [Tue, 23 Feb 2021 20:09:12 +0000 (20:09 +0000)]
Traslation fixes for Koha 20.05.09

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoTranslation updates for Koha 20.05.09
Koha translators [Tue, 23 Feb 2021 19:26:42 +0000 (16:26 -0300)]
Translation updates for Koha 20.05.09

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 26602:[20.05.x] Remove stray merge marker
Andrew Fuerste-Henry [Tue, 23 Feb 2021 19:20:02 +0000 (19:20 +0000)]
Bug 26602:[20.05.x] Remove stray merge marker

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27068: (follow-up) Remove local hold priority exclusion-related code for 20.05.x
Tomas Cohen Arazi [Tue, 23 Feb 2021 18:28:27 +0000 (15:28 -0300)]
Bug 27068: (follow-up) Remove local hold priority exclusion-related code for 20.05.x

The local hold priority exclusions feature is only present in 20.11, so
the use case handling shouldn't be included in the backport. This code
removes the couple lines in which this is handled (trivial) and tested
(trivial, as it is disabled by default on the tests, we just remove the
places in which the original patch set the non-existent attributes).

To test:
1. Run:
   $ kshell
  k$ prove t/db_dependent/HoldsQueue.t
=> FAIL: Tests fail!
2. Apply this patch
3. Repeat 1
=> SUCCESS: Tests pass!
4. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27604: Deal with empty pref
Jonathan Druart [Tue, 16 Feb 2021 08:30:20 +0000 (09:30 +0100)]
Bug 27604: Deal with empty pref

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 121b633cad109b2873ecc1b2ead3f9e3734bfb13)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 350fbb7da172c6af1f4bbb115b61d7c73d999e1a)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27604: Init to {}
Jonathan Druart [Mon, 8 Feb 2021 13:43:27 +0000 (14:43 +0100)]
Bug 27604: Init to {}

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 4784b8ffe52b78a1a0a7fe168b9ffc27657d0196)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit c4922f9c7673796e6d63fd27169a347285a594f7)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27604: (QA follow-up) Limit the libraries during the query
Nick Clemens [Fri, 5 Feb 2021 17:29:54 +0000 (17:29 +0000)]
Bug 27604: (QA follow-up) Limit the libraries during the query

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 60a749ff5a6ab1e7bbbcc28d7db69bdca51b2eed)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 19511690558dbd81095754d78c7eeb94937f2768)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27604: Make sure PatronSelfRegistrationLibraryList is used
Jonathan Druart [Wed, 3 Feb 2021 15:14:12 +0000 (16:14 +0100)]
Bug 27604: Make sure PatronSelfRegistrationLibraryList is used

The value of PatronSelfRegistrationLibraryList is used to display the dropdown
list of the libraries, but not after the form is submitted.

Test plan:
1. Empty PatronSelfRegistrationLibraryList
2. Self register a new patron
=> Confirm the dropdown list with the libraries contain all the
libraries
3. Fill in PatronSelfRegistrationLibraryList with branchcodes (eg. "CPL|MPL")
4. Self register a new patron
5. Edit the HTML form and replace the option's value with another
branchcode (FPL)
6. Save
=> Without this patch the branchcode FPL is used
=> With this patch applied an ugly 500 is returned

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 376bf9b980b877a38acc6680445ad5aa0078620c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 41aaad80980fa0ddd8cb7f3c9f9f7f41441832c7)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27715: (QA follow-up) Remove conditional declaration
Marcel de Rooy [Sat, 20 Feb 2021 09:57:20 +0000 (09:57 +0000)]
Bug 27715: (QA follow-up) Remove conditional declaration

Resolves:
FAIL critic # Variables::ProhibitConditionalDeclarations: Got 1 violation(s).

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit c8d14a8087a57d6859b283188e8e1b1a0343dfda)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27715: Use $dbh->quote_identifier to quote untrusted input
Joonas Kylmälä [Fri, 19 Feb 2021 12:18:15 +0000 (14:18 +0200)]
Bug 27715: Use $dbh->quote_identifier to quote untrusted input

The sanitization using regex and \w class of characters might be
enough but given the vast number of unicode characters in \w and
possibility of in the future the database engines interpreting some of
those characters with special meaning it is better to wrap the column
identifier to quotes using $dbh->quote_identifier so it is only
interpreted as identifier and nothing else.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 9a03861c8fc67f11c72dd78f17abcbe58cf1740e)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27715: Add a deprecation notice
Jonathan Druart [Thu, 18 Feb 2021 14:54:56 +0000 (15:54 +0100)]
Bug 27715: Add a deprecation notice

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit e741e6c83bf205252db7e4114951ca25ab5f6567)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27715: Sanitize order by DT params
Jonathan Druart [Thu, 18 Feb 2021 14:49:40 +0000 (15:49 +0100)]
Bug 27715: Sanitize order by DT params

We are not on the safe side when we build the ORDER BY clause from the
DataTables parameters.

I've started to limit the columns by using Koha::Objects->columns, but
for instance for the patron search we need (at least) the columns from
the branches, categories and members tables.
It seems easier, and still safe, to use a regex.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 0d1e5ea69b70292c89f827adaefc286fff8318a7)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27715: Add tests
Jonathan Druart [Thu, 18 Feb 2021 14:42:48 +0000 (15:42 +0100)]
Bug 27715: Add tests

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Amended: chmod 755.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 55d40c1618b5cba80ca0fcc72cbcec0a49a3513c)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27715: Remove unused dt_build_having
Jonathan Druart [Thu, 18 Feb 2021 13:49:02 +0000 (14:49 +0100)]
Bug 27715: Remove unused dt_build_having

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Amended: removed warn.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit c22621e820bff93c3346d26d5769f200f7924f26)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27715: Remove unused build_dt_query
Jonathan Druart [Thu, 18 Feb 2021 13:47:03 +0000 (14:47 +0100)]
Bug 27715: Remove unused build_dt_query

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit f9c3cde499335c8ae311e33f409efc7f2cec8f19)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 24469: Move the new queries to a dedicated ImportBatch subroutine
Jonathan Druart [Fri, 12 Feb 2021 09:27:43 +0000 (10:27 +0100)]
Bug 24469: Move the new queries to a dedicated ImportBatch subroutine

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Amended: POD line for $import_record_id.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 03a9bdc851dcfe114c1676ac55def1e1c5d51970)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit aba575daeda3f1cc545d80bea916148ffdd77910)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 24469: Record biblionumber in import_biblio when adding to basket via file
Jonathan Druart [Wed, 12 Feb 2020 15:22:02 +0000 (16:22 +0100)]
Bug 24469: Record biblionumber in import_biblio when adding to basket via file

The column import_biblios.matched_biblionumber was not populated when an
order is created from a staged file.

Test plan:
A/ Create a new order from a stage file.
Use the "Save" button at the bottom of the "Add orders from" page
Then note the matched_biblionumber value. It should be populated correctly

B/ Import again the same record, this time you will have to use the "Add
order" link in the list of order (ie. not the "Save" button)
Note the matched_biblionumber value. It should be populated correctly

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Sarah Daviau <sdaviau@arlingtonva.us>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 7bc460e00501a5161a5ac1700dc8d1ce7b76730c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 3f636fdbb9a057cea616aff9ef1cf004c621c3c7)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27569: Fix ODS export - take empty string into account
Jonathan Druart [Mon, 1 Feb 2021 14:57:24 +0000 (15:57 +0100)]
Bug 27569: Fix ODS export - take empty string into account

If a cell contains an empty string it was not taken into account.

Test plan:
Same as CSV but with ODS

Signed-off-by: Ron Houk <rhouk@ottumwapubliclibrary.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 93bc3af5a9b72d5d15a76648e9b9cd7a963bd05f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 5dfc3942f6eb42f8201b8e4826c50fdc81fee3aa)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27569: Change av for 100$2
Jonathan Druart [Mon, 1 Feb 2021 14:56:08 +0000 (15:56 +0100)]
Bug 27569: Change av for 100$2

Switch from "#" to ""

Signed-off-by: Ron Houk <rhouk@ottumwapubliclibrary.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit f0f1d27dd2160a39bb76fd27ecd8b2b9c6056db5)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 0e825b548e92b27da3d25809d857f117efaaa4e7)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27569: Add tests for ODS export
Jonathan Druart [Mon, 1 Feb 2021 14:27:53 +0000 (15:27 +0100)]
Bug 27569: Add tests for ODS export

Looks ok so far

Signed-off-by: Ron Houk <rhouk@ottumwapubliclibrary.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit ce92a756a8e4058b29cf32ea016bac75f6228b9b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 31d1d65d44418ace657f5915c97e4b9b773f89d5)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27569: Fix CSV export for biblio frameworks
Jonathan Druart [Mon, 1 Feb 2021 13:50:52 +0000 (14:50 +0100)]
Bug 27569: Fix CSV export for biblio frameworks

The CSV import of the biblio frameworks is broken.
A change in LibreOffice resulted in CSV not formatted how the
C4::ImportExportFramework code is expected.
This code is quite broken, it expects all the CSV cells to be quoted.

The "add tests" patch shows the different between what we expected
before this patch, and what is the new version generated by LibreOffice.

Test plan:
Export a biblio framework in CSV
Open it with LibreOffice and save it undef a different name
Create a new biblio framework and use the new file to construct it
Compare the 2 frameworks and make sure they are identical

Signed-off-by: Ron Houk <rhouk@ottumwapubliclibrary.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit ad5de74cbc43e500c34ae6fa50958c6848d1586f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 69ff54b1945142da58f73a80bb3d2890339013b6)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27569: Add tests
Jonathan Druart [Mon, 1 Feb 2021 13:54:15 +0000 (14:54 +0100)]
Bug 27569: Add tests

Signed-off-by: Ron Houk <rhouk@ottumwapubliclibrary.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 7c11f056268195bac6c660182db97d4f2684b50a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 63e674c960464374bf3371d6802a0674665eb524)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27569: Don't hide errors!
Jonathan Druart [Mon, 1 Feb 2021 14:27:19 +0000 (15:27 +0100)]
Bug 27569: Don't hide errors!

Signed-off-by: Ron Houk <rhouk@ottumwapubliclibrary.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 0c0b2c09173ddf7a576b4373e831937e8370b159)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 9095f56590ed1199c0084a6bf5dfb4003d6fbad9)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27569: Remove non mysql code
Jonathan Druart [Mon, 1 Feb 2021 14:59:37 +0000 (15:59 +0100)]
Bug 27569: Remove non mysql code

Remove a bit of the confusion by removing unless code (not related to
mysql)

Signed-off-by: Ron Houk <rhouk@ottumwapubliclibrary.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit dfd42a4eb26a2ac00fe116f22409779047edd02b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit eac9e84792316872734133e23e2386f704feecff)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27707: (bug 26639 follow-up) Fix renewals when RenewalSendNotice is set
Jonathan Druart [Tue, 16 Feb 2021 08:06:03 +0000 (09:06 +0100)]
Bug 27707: (bug 26639 follow-up) Fix renewals when RenewalSendNotice is set

Since bug 26639 we have auto savepoint enabled and the LOCK TABLE query
in C4::Circulation::SendCirculationAlert is not correctly handled.
From the MySQL doc that is copied few lines before, "LOCK TABLE will
commit any transactions", but here we don't have a savepoint and the
release for a non-existent savepoint will throw a DBI exception.

This patch removes the unecessary transaction and prevent the following
error when a renewal is done:
> DBIx::Class::Storage::DBI::mysql::_exec_svp_release(): DBI Exception: DBD::mysql::db do failed: SAVEPOINT savepoint_0 does not exist [for Statement "RELEASE SAVEPOINT savepoint_0"] at /usr/share/koha/lib/C4/Circulation.pm line 3590

Test plan:
1. Enable RenewalSendNotice
2. Add some email address to patron and select the email box from the message preference "Item checkout and renewal" in order to receive renewal emails.
3. Check 1 item out to a patron
4. Renew it

Signed-off-by: Andrew Nugged <nugged@gmail.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 76c38d10d06dfcc377ab82cd312b12b8457a2dc8)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit d641561125d861236157d8b6f7edc6870a96a866)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27653: Use div instead of caption for controls
Owen Leonard [Tue, 9 Feb 2021 19:31:33 +0000 (19:31 +0000)]
Bug 27653: Use div instead of caption for controls

The funds and acquisitions home page tables use captions for additional
table controls. These are more appropriate as "toolbar" divs.

This patch converts the <caption> to <div class="toolbar btn-toolbar">
and moves it just above <table> in the markup to keep it valid.

To test:
1 - View the tables on acquisitions home and budgets views
2 - Note the 'Expand all...' control row
3 - Apply patch
4 - The row remains, but is below the table controls
5 - The row is not included when printing or copying the table

Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit a63748e241ccfc2ae4dc4487c5c6cb87b1b54b84)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit d0f350314a7ad43f44f67a10b8c023b7671b517c)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27646: Allow export of Acquisition home and Funds tables
Nick Clemens [Fri, 5 Feb 2021 19:38:03 +0000 (19:38 +0000)]
Bug 27646: Allow export of Acquisition home and Funds tables

This patch swtiches these tables ot use KohaTables with exporting enabled

To test:
1 - Apply patch
2 - Confirm acquisitions home and funds tables display correctly
3 - Confirm you can export the tables

Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 1acbe07f0b0b8b3fa8af604054027c7dfe7cf64a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit df66dc51eae3b799a8cd1378f5254c2cb93adf99)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 26602: [20.05.x] Don't export "actions" column
Jonathan Druart [Mon, 18 Jan 2021 10:26:22 +0000 (11:26 +0100)]
Bug 26602: [20.05.x] Don't export "actions" column

This patch add the noExport class to all "Actions" columns in the
codebase.
It's a stupid search and replace, maybe the class is added to table
where there is no export button.

Test plan:
Search tables where the export button is available. Confirm that the
"Actions" columns is not exported.
Example: /admin/branches.pl, /admin/cities.pl

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Bug 26602: (QA follow-up) Cleanup datatables settings

On letter.tt we had nosort and set things via settings that are default in KohaTable so removed
those from letter.js. Also made the last updated column exportable

On upload.tt the noExport didn't do anything, because we couldn't export, so moved to used KohaTable

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Bug 26602: Rebase fixes

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 8287: Improve "show checked out items" filter on the overdues report
Jonathan Druart [Wed, 16 Dec 2020 14:28:50 +0000 (15:28 +0100)]
Bug 8287: Improve "show checked out items" filter on the overdues report

The "Show any items currently checked out" was confusing, especially if
the "From" and "To" due date filters were passed.

This patch moves the checkbox close to the 2 other filters and show/hide
the due date filters when needed.

Test plan:
0. Have some overdue
1. Search for overdues
2. Confirm that the filters are shown/hidden depending on the status of
the checkbox
3. Fill "To" with a date, tick the checkbox, submit the form
=> Confirm that the date was not taken into account

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 35994c1da5f5a7d29a192310822bf41a978d0a1f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 2b68016df7320060f4d2f98cb87b5727942fb26e)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27068: Perltidy _checkHoldPolicy
Jonathan Druart [Fri, 12 Feb 2021 11:11:54 +0000 (12:11 +0100)]
Bug 27068: Perltidy _checkHoldPolicy

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 40ccb7f37138e0bf31345608459eb7a9ba666027)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 8f342517462de1a9718000dcb8cc2e10d9b16abf)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27068: Don't 'cache' Koha::Libraries
Jonathan Druart [Fri, 12 Feb 2021 11:10:31 +0000 (12:10 +0100)]
Bug 27068: Don't 'cache' Koha::Libraries

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 20c97bca2dc1b742dff5d8828cf83a5543571e91)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 3d7812c07fe0b71e05da5917e03c1a31626b2cee)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27068: Add unit tests
Kyle M Hall [Fri, 29 Jan 2021 12:48:21 +0000 (07:48 -0500)]
Bug 27068: Add unit tests

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit fac4c54eadf7794ef3fae04131cb3e132cdd7d39)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit d78d9386eefaaa0dafdeb486ad53f479e08b120a)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27068: Fetch libraries once for speed
Kyle M Hall [Thu, 3 Dec 2020 11:48:13 +0000 (06:48 -0500)]
Bug 27068: Fetch libraries once for speed

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit fba0bda9a9899dd7efa157ea11ee68ef836a5159)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 99af6c24eb385f96167bd3ae49442d9aa0e66500)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27068: Fix errors in _checkHoldPolicy
Kyle M Hall [Thu, 3 Dec 2020 11:34:33 +0000 (06:34 -0500)]
Bug 27068: Fix errors in _checkHoldPolicy

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 9f71452b934ef83c57ac2f74c0c7b0ea2b39e2cd)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit feb444c5851d8c834b0a50a6ead110eb6a5426e6)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27068: Control hold group logic in HoldsQueue
Agustin Moyano [Wed, 2 Dec 2020 23:04:51 +0000 (20:04 -0300)]
Bug 27068: Control hold group logic in HoldsQueue

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit e82091f40a5193ff3fb47073ddb9b11f94645276)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 6b5c5c00d4fe583d0103dde1da5a6e0e3d6084b9)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 26958: Move Elasticsearch mapping template JS to the footer
Owen Leonard [Fri, 6 Nov 2020 16:18:07 +0000 (16:18 +0000)]
Bug 26958: Move Elasticsearch mapping template JS to the footer

This patch moves inclusion of JavaScript to the footer of the
Elasticsearch mapping template. It also moves the JS into a separate
file.

To test you should have SearchEngine system preference set to
"Elasticsearch."

 - Apply the patch and go to Administration -> Search engine
   configuration (Elasticsearch).
 - Confirm that JavaScript dependent interactions work correctly:
   - Tabs
   - Under the bibliographic records and authorities tabs, table row
     drag-and-drop
   - Under the bibliographic records and authorities tabs, test the
     "Add" line at the bottom of the table.
   - Under the bibliographic records and authorities tabs, test the
     "Delete" button.

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 3cfa9b1e993481defd6e7ec796031ec31279bf71)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 7421e4c3caf97e7cc0cd02e0d644aa7045eb06ea)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27654: Sort module.keys hash when render columns_settings.tt
Petro Vashchuk [Mon, 8 Feb 2021 14:04:48 +0000 (16:04 +0200)]
Bug 27654: Sort module.keys hash when render columns_settings.tt

On the "Administration -> Table settings" page, the order of
"tables related to pages" sections is different with each page refresh.
Cause of that is that Perl gives random order for hash keys where
those elements are stored on template render. To avoid that we
add a "sort" method where getting keys similarly how it was done
previously to display tables always in the same order.

To reproduce:
    1) Head over to /cgi-bin/koha/admin/columns_settings.pl
    2) Open any collapsed module settings, for example
"Acquisition tables". Check the order of pages.
    3) Reload the page. Check the order of the same elements again.
They always come in random order, it's easily distinguishable.
    4) Apply the patch.
    5) Repeat steps 1-3 again and ensure that the order of pages
stays the same no matter how many times you reload the page.

Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit f58c271b4255e85b3b6ddf90a9e802249954cc13)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit fa597b5209a1d756c3a053fa2c93737172809c4a)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27645: Prevent "is on hold" warning to be displayed twice
Jonathan Druart [Tue, 9 Feb 2021 15:01:59 +0000 (16:01 +0100)]
Bug 27645: Prevent "is on hold" warning to be displayed twice

During a batch checkout we display the "item is on hold" message
depending on different conditions.
However it can happen the message is displayed twice.

If the checkout is not impossible then we see:
This item is on hold for another patron.
This item is on hold for another patron. The hold will be overridden, but not cancelled.

We should only display the second one.

Test plan:
With a default ktd setup you can simply place an item on hold and use the
batch checkout tool to check it out

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>
(cherry picked from commit 4bb20fdb30202018f1519c6bd336e33fa6732d9e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 8113778f326570e7953b6485dc7298d829e3bc10)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 26181: Disable override by default in /holds
Tomas Cohen Arazi [Mon, 10 Aug 2020 20:30:25 +0000 (17:30 -0300)]
Bug 26181: Disable override by default in /holds

This patch disables AllowHoldPolicyOverride by default in /holds. It
also adds a header that can be used to request the override explicitly.

Tests are added for this behaviour

To test:
1. Apply the regression tests patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/holds.t
=> FAIL: Tests fail because the behaviour is not implemented
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass!
5. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
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>
(cherry picked from commit 15fcd755a24b07fc959210d2cb812d571bea3faf)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 43dd10cd2a328659089e0067b5cbd1fced601017)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 26181: Regression tests
Tomas Cohen Arazi [Mon, 10 Aug 2020 20:30:13 +0000 (17:30 -0300)]
Bug 26181: Regression tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
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>
(cherry picked from commit 758732c052bc56f0f24213d95febfe5736baa1f0)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 86f4e0ab57e731e7e0dc9a9477b5424315d0bfdc)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 23767: Total children only if parents not visible
Nick Clemens [Wed, 3 Feb 2021 14:48:37 +0000 (14:48 +0000)]
Bug 23767: Total children only if parents not visible

This patch changes the way to calculate the footer. It adds the budget and parent ids to the cell
as custom data elements. When totaling we grab a list of all the rows we are showing - if a
row has a parent and the parent is showing then we skip adding its value to the total.

As the function is used on both acqui-home and aqbudgets I adjusted both templates

To test:
1 - Follow the test plan on previous patch
2 - Try filtering the table so you see only the child funds
3 - Confirm the totals show the child alone when it is visible
4 - Confirm the child total is excluded when the parent is visible

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 1f3152d453c8b5f2a366b916b50d3265d3ef135b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit fe191f17b8fa142e4430dfe05833b846658f148d)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>