koha.git
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>
3 years agoBug 23929: Invoice adjustments should filter inactive funds
Blou [Tue, 26 Jan 2021 20:36:31 +0000 (15:36 -0500)]
Bug 23929: Invoice adjustments should filter inactive funds

Looking at invoice details, this makes the Adjustments Fund dropdown act
exactly like the Shipping Fund dropdown above, with a Show inactive
checkbox to help filter (by default) the inactive funds out of the list.

Test plan:
0) requires a database with inactive (old) funds along with active ones.
1) Go to invoice details page
2) Click "Add adjustment"
3) Open the drop down beside the Fund label, you should see EVERY fund in database.
4) Compare with behavior of Shipping fund dropdown above.  Not every fund is listed there
5) Apply patch
6) Now behavior is the same, only active fund are listed by default.
7) click "Show inactive" checkbox and see all the funds in the dropdown.

Signed-off-by: Sonia BOUIS <sonia.bouis@univ-lyon3.fr>
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 bdfb78a69a1f78488b800bd38392c60812717cc7)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.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>
3 years agoBug 27534: Add missing ON UPDATE/DELETE clause to message_transport_type_fk
Jonathan Druart [Wed, 27 Jan 2021 08:43:02 +0000 (09:43 +0100)]
Bug 27534: Add missing ON UPDATE/DELETE clause to message_transport_type_fk

Bug 9016 (3.15.00.039) added message_transport_type_fk but the ON DELETE
CASCADE ON UPDATE CASCADE clause was missing from the updatedatabase
entry.
If we are upgrading from an old version, 20.06.00.058 will fail on
updating the message_transport_type, with
"Cannot delete or update a parent row: a foreign key constraint fails".

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 57a15eb474b5a8a6a199df1d324c30b7df0544d7)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.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>
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>
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>
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>
3 years agoBug 18506: DBRev 20.11.03.001
Jonathan Druart [Tue, 9 Feb 2021 08:44:00 +0000 (08:44 +0000)]
Bug 18506: DBRev 20.11.03.001

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 91ddddd8ebefaeb079b093ae71fb02bc5481fec7)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 18506: (QA follow-up) Indentation and more conditionals
Nick Clemens [Wed, 3 Feb 2021 15:48:29 +0000 (15:48 +0000)]
Bug 18506: (QA follow-up) Indentation and more conditionals

Indentation fixes for readability

Cleaned up a few places where the ability to login otherwise was leakign through

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
JD amended patch: Remove trailing spaces

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit a5e8a2d0adcfeecc2ee0b62fb53ae0c7e1488626)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 18506: (QA follow-up) opacShibOnly -> OPACShibOnly
Martin Renvoize [Wed, 3 Feb 2021 12:45:45 +0000 (12:45 +0000)]
Bug 18506: (QA follow-up) opacShibOnly -> OPACShibOnly

As requested

Signed-off-by: Nick Clemens <nick@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 b5ab335d1b312791b6353379ddd34cbd162a6529)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 18506: Add xShibOnly preference for Shibboleth authentication
Martin Renvoize [Wed, 26 Apr 2017 11:39:15 +0000 (12:39 +0100)]
Bug 18506: Add xShibOnly preference for Shibboleth authentication

This patch adds two system preferences to Koha, opacShibOnly and
staffShibOnly, allowing users to restrict authentication to just
one method, Shibboleth.

We do however, allow for local fallback for the SCO/SCI logins.

A system preference was chosen over a configuration file update to
allow for local override at the virtualhost level. In this way a
hosting provider can setup a 'backdoor opac' for example to allow
fallback to local logins for support operations.

Signed-off-by: Matthias Meusburger <matthias.meusburger@biblibre.com>
Signed-off-by: Nick Clemens <nick@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 1a81264ac1fff96d6a678ec7abe730e1ac2c9dbc)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.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>
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>
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>
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>
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>
3 years ago[RMaint] Add Bug 27604 security fix to 20.11.03 release notes
Fridolin Somers [Wed, 24 Feb 2021 07:19:59 +0000 (08:19 +0100)]
[RMaint] Add Bug 27604 security fix to 20.11.03 release notes

3 years ago[RMaint] fixes on PO files v20.11.03
Fridolin Somers [Tue, 23 Feb 2021 15:29:01 +0000 (16:29 +0100)]
[RMaint] fixes on PO files

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoMerge remote-tracking branch 'translate/20.11.03-translate-20210223' into 20.11.x
Fridolin Somers [Tue, 23 Feb 2021 14:06:32 +0000 (15:06 +0100)]
Merge remote-tracking branch 'translate/20.11.03-translate-20210223' into 20.11.x

3 years agoUpdate release notes for 20.11.03 release
Fridolin Somers [Tue, 23 Feb 2021 14:05:32 +0000 (15:05 +0100)]
Update release notes for 20.11.03 release

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoIncrement version for 20.11.03 release
Fridolin Somers [Tue, 23 Feb 2021 13:41:54 +0000 (14:41 +0100)]
Increment version for 20.11.03 release

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoTranslation updates for Koha 20.11.03
Koha translators [Tue, 23 Feb 2021 13:39:40 +0000 (10:39 -0300)]
Translation updates for Koha 20.11.03

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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
3 years agoBug 12966: Add edition field to Card view
Nick Clemens [Fri, 29 Jan 2021 12:39:21 +0000 (12:39 +0000)]
Bug 12966: Add edition field to Card view

To test:
1 - Search Z3950 to add a record
2 - Find a record with an edition statement
3 - It shows in the table of results
4 - Check the card view
5 - No edition
6 - Apply patch
7 - Repeat
8 - Edition shows in card view

Signed-off-by: Marjorie <marjorie.barry-vila@collecto.ca>
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 d9a97d4802716dab50ba90272d93d3dcf5ea98c8)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.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>
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>
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>
3 years agoBug 26406: Fix suggestions filter at the OPAC
Jonathan Druart [Tue, 8 Sep 2020 13:21:24 +0000 (15:21 +0200)]
Bug 26406: Fix suggestions filter at the OPAC

There is an input filter but it does nothing

Test plan:
You need 2 differents users, U1 and U2
Create several (at least one) suggestions for each of them
Test the following with and without OPACViewOthersSuggestions:
With U1 logged in, go to the suggestions tab and use the input to filter
the suggestions.
It should work correctly.
Also play with the "Suggested by" options

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 ee0384184630b6c1b4c74e7a250e1cbc71c3e17f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27669: Fix 'importing' and 'reverting' statuses when importing/reverting a batch
Jonathan Druart [Wed, 10 Feb 2021 10:30:45 +0000 (11:30 +0100)]
Bug 27669: Fix 'importing' and 'reverting' statuses when importing/reverting a batch

SetImportBatchStatus is not called with $batch_id

It has been caught by bug 25026, and www/search_utf8.t fails with
t/db_dependent/www/search_utf8.t .. 14/87 Error POSTing http://koha:8081/cgi-bin/koha/tools/manage-marc-import.pl: Internal Server Error at t/db_dependent/www/search_utf8.t line 240.

And, from logs:

manage-marc-import.pl: C4::ImportBatch::SetImportBatchStatus(): DBI Exception: DBD::mysql::st execute failed: Truncated incorrect DOUBLE value: 'importing' [for Statement "UPDATE import_batches SET import_status = ? WHERE import_batch_id = ?" with ParamValues: 0=undef, 1='importing'] at /kohadevbox/koh
a/C4/ImportBatch.pm line 579: /kohadevbox/koha/tools/manage-marc-import.pl, referer: http://koha:8081/cgi-bin/koha/tools/manage-marc-import.pl?import_batch_id=2

Test plan:
Read the changes and confirm it does make sense.
Import and revert a batch

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit a86242c2ea6ecdc2e9cf26dd7343c09926f68287)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
3 years agoBug 23767: Include child funds in total spent and ordered on acqui-home
Nick Clemens [Mon, 7 Oct 2019 17:19:27 +0000 (17:19 +0000)]
Bug 23767: Include child funds in total spent and ordered on acqui-home

To test:
 1 - Have three funds, two parents and one child
 2 - Open a basket and add an order to each fund
 3 - View acqui-home.pl
 4 - Note that ordered values are only added from the two parent funds
 5 - Complete these orders (close basket, receive)
 6 - Note the spent only includes parent funds
 7 - Place three more orders, one from each fund
 8 - Now you can see both spent and ordered are incorrect
 9 - Apply patch
10 - Reload, all should add correctly

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
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 07150a0a850845e8ff16bee6f85fdc74d510ec5e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 26059: Add unit tests
Kyle M Hall [Wed, 19 Aug 2020 14:30:29 +0000 (10:30 -0400)]
Bug 26059: Add unit tests

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 8c242e98f9e1724902690ced4e913b589125ca59)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 26059: Create guarantor/guarantee links on patron import
Kyle M Hall [Fri, 24 Jul 2020 16:18:44 +0000 (12:18 -0400)]
Bug 26059: Create guarantor/guarantee links on patron import

The change to allow multiple guarantors was meant to maintain the
ability to import patrons with a Koha patron guarantor, but is not
working as intended.

A) Adding the guarantor simply doesn't work
B) We have two columns named 'relationship', one for the borrowers
table, and one for the guarantor relationships table. This clearly
doesn't work and will cause confusion. The one for the guarantor
relationships table should be renamed.
C) guarantor_firstname and guarantor_surname in the CSV file do nothing
and should be removed.

This patch also fixes a minor issue that causes warnings like:
CGI::param called in list context from
/kohadevbox/koha/tools/import_borrowers.pl line 124

Test Plan:
1) Create a CSV with contents like:
cardnumber,surname,firstname,branchcode,categorycode,guarantor_relationship,guarantor_id
bloop,gloop,froop,MPL,J,father,48
brim,flim,zim,MPL,J,father,48
2) Attempt to upload this file, ensure you have a borrowernumber 48 that
can have guarantors
3) Note the accounts are not linked
4) Apply this patch
5) Restart all the things!
6) Upload the file again
7) The patrons should now be linked!
8) Download the starter CSV file
9) Note the second relationship column is now guarantor_relationship
10) Note the columns guarantor_firstname and guarantor_surname are no longer present

Signed-off-by: Amit Gupta <amit.gupta@informaticsglobal.com>
Signed-off-by: Marti Fuerst <mfuerst@hmcpl.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 5cd08373b1eca33ba1b8bd867b6de5d40c0d7242)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27671: Use Koha.Preference for UniqueItemFields
Jonathan Druart [Thu, 11 Feb 2021 15:39:19 +0000 (16:39 +0100)]
Bug 27671: Use Koha.Preference for UniqueItemFields

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 00b012c82d78fed0658758514d393d093f2ece0e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27671: Restore missing include in orderreceive.tt
Tomas Cohen Arazi [Wed, 10 Feb 2021 14:04:42 +0000 (11:04 -0300)]
Bug 27671: Restore missing include in orderreceive.tt

Caused by
  commit 15e35f77fb29137a5421ff79a1186087508aa68f
  Bug 23376: Move AcqCreateItem logic to template

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.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 7166fabeeb03e2d4e803fab9a9e6f1181318a42d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.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>
3 years agoBug 27676: Correct finesMode ne off condition
Jonathan Druart [Thu, 11 Feb 2021 10:21:43 +0000 (11:21 +0100)]
Bug 27676: Correct finesMode ne off condition

finesMode is 'off' by default (sysprefs.sql), but if you modify its value from
the UI and set it to 'production' then back to 'off', the DB value becomes an
empty string '', because of $YAML::Syck::ImplicitTyping

This has been found when working on on removing YAML::Syck (bug 22824),
so it's not perfect but the situation will be cleared in the follow-up
bug report.

Test plan:
0. Don't apply the patch
1. reset_all
=> finesMode eq 'off' in DB
2. Set the pref's value to production
3. Switch it back to 'off'
4. Value is '' in DB
5. Check an item in that should generate overdue charges
=> Charges are not generated
6. Apply the patch
7. Check an item in that should generate overdue charges
=> Charges are generated

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 f831130525c62f799c831dd7eb1b36065b60c172)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27655: Add barcode "columnname" to "column_settings.yml"
Petro Vashchuk [Mon, 8 Feb 2021 14:11:04 +0000 (16:11 +0200)]
Bug 27655: Add barcode "columnname" to "column_settings.yml"

Preferences of the "Holds to pull" table missing the "Barcode" column.
This patch appends that column name to the "column_settings.yml"
in correct order. This also led to checked out columns in this settings
page that were not those which were hidden when the table displayed
(i.e. columns were shifted).

To reproduce:
    1) Head over to /cgi-bin/koha/admin/columns_settings.pl
    2) Open the collapsed "Circulation" list, go to the "Holds" page
and find preferences of the "Holds to pull" table there.
    3) Check that the "Barcodes" column is missing from it.
    4) Mark the last few columns for not to be
displayed (for example, three) and save the preferences.
Remember the column names you checked out.
    5) Open the circulations section, then open "Holds to pull" report
when you have there some elements displayed, you should notice that
hidden columns shifted by one, as well if you press "gear" icon to
quickly enable/disable the columns, you will see those unchecked in
list last three will be not those you marked out.
    6) Apply the patch.
    7) Reload the "table settings" page, check that the "Barcodes"
column is present.
    8) Check that on the "Circulation -> Holds to Pull" page all
columns hidden accordingly and properly (as explained in step 5.

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 175a1eddd1efdf70a60b5fb0fb8dc52a9211c65f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27422: YouTube videos are HTTPS only
Tomas Cohen Arazi [Wed, 3 Feb 2021 22:50:29 +0000 (19:50 -0300)]
Bug 27422: YouTube videos are HTTPS only

This patch hardcodes HTTPS as the protocol to use when generating
YouTube content embedding. It is the supported protocol and without this
patch it falls back to 'http', or it can be 'ftp' depending on the first
indicator of the 856 field. They are all not supported so hardcoding it.

To test:
1. Have a record with 856 $uhttps://youtu.be/sMNkDPFycNU
2. Enable the HTML5MediaYouTube and HTML5Media sysprefs
3. Open the OPAC detailed view of the record
4. Open the Multimedia tab
=> FAIL: There's no embedded video
5. Apply this patch
6. Restart all
7. Repeat 4
=> SUCCESS: There's a live performance of Heroes del Silencio!
8. Sign off :-D

Sponsored-by: Banco Central de la República Argentina
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Cook <dcook@prosentient.com.au>
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 ca5efc9aa45c3c7893a09cf0067718fdaab63507)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27582: Fix breadcrumb for POS > Library details page
Martin Renvoize [Mon, 1 Feb 2021 12:13:03 +0000 (12:13 +0000)]
Bug 27582: Fix breadcrumb for POS > Library details page

This patch adds a link back to the top level 'Point of sale' page in the
breadcrumb for the 'Library details' summary page.

Test plan
1/ Enable 'UseCashRegisters' and 'EnablePointOfSale'
2/ Navigate to 'Point of sale' > 'Library details'
3/ Note the breadcrumb now includes the unlinked' Library details' page
title and a linked 'Point of sale' in the list.
4/ Signoff

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 05bfbe629f9e34b75fac641a461cf93574c1964d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27606: Add link back to vendor in breadcrumbs for parcel.tt
Lucas Gass [Thu, 4 Feb 2021 20:56:11 +0000 (20:56 +0000)]
Bug 27606: Add link back to vendor in breadcrumbs for parcel.tt

To Test:
1. recieve an order:
When receiving, we get these breadcrumbs:
Home › Acquisitions › Receive orders from My Vendor

2. apply patch
Now we get these breadcrumbs:
Home › Acquisitions › My Vendor› Receive orders from My Vendor

3. Make sure the link sends you back to the correct vendor

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.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 670f00cbaf74653f84353285cea3dda5c3ed82ae)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 26943: Add notforloan statuses to catalog search
Lucas Gass [Tue, 10 Nov 2020 21:21:17 +0000 (21:21 +0000)]
Bug 26943: Add notforloan statuses to catalog search

- create a positive value and a description of "Positive"
- set an item to your "Positive" value
- pull up the related bib in a cataloging search
- confirm it shows "Not for loan" in the Location column
- create a negative value and a description of "Negative"
- set an item to your "Negative" value
- pull up the related bib in a cataloging search
- confirm it shows "On order" in the Location column
- Apply patch
- re-do the cataloing search, instead of 'Not for loan' or 'On order' you should instead see the actual nfl description

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Telishia Mickens <tmickens@gc.edu>
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 6932e05569aa6be0ed165a28ddc2a4213a3a263e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 12260: Compiled CSS
Fridolin Somers [Fri, 12 Feb 2021 13:50:39 +0000 (14:50 +0100)]
Bug 12260: Compiled CSS

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 12260: Hide unnecessary links when printing
ava li [Tue, 19 Jan 2021 02:21:01 +0000 (02:21 +0000)]
Bug 12260: Hide unnecessary links when printing

TEST PLAN:
try printing every page in the opac and confirm these sections don't
show

  #cartmenulink { display: none; }
  #listsmenu { display: none; }
  #koha_url { display:none; }
  .breadcrumb { display:none; }
  a[href]:after { display:none; }
  #social_networks { display:none; }
  a.tag_add { display:none; }
  .results_summary.online_resources { display:none; }
  a#Normalview,
  a#MARCview,
  a#ISBDview { display:none; }
  .ui-tabs-panel { border:none !important; }
  #addcomment { display:none; }
  #ulactioncontainer { display:none; }
  #usermenu { display:none; }
  #didyoumean { display:none; }
  #top-pages, #bottom-pages { display:none; }
  #selections-toolbar { display: none; }
  .actions-menu { display: none; }
  #numresults a { display:none; }
  #numresults { float:left; }

Signed-off-by: Stina Hallin <stina.hallin@ub.lu.se>
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 8205f0d859bf190b10a52c29a59f253c6bf761c1)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27454: Pass the arrayref
Jonathan Druart [Wed, 3 Feb 2021 12:54:27 +0000 (13:54 +0100)]
Bug 27454: Pass the arrayref

Otherwise you mess with the following hash elements :)

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 e9195d166e8175044f6f76ff24ecc9399cf0abbe)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27454: Add sorting of patron attributes
Martin Renvoize [Mon, 18 Jan 2021 10:21:28 +0000 (10:21 +0000)]
Bug 27454: Add sorting of patron attributes

This patch adds sorting on class code for the patrons attributes forms
on the memberentry page.

Test plan
1) Create a couple of different patron attributes
2) Go to the patron add page
3) Note the order in which the patron attributes load at the bottom of
   the page.
4) Reload the page and note the order of those attribues may change (if
   it doesn't, try reloading again.. it's random)
5) Apply the patch
6) Reload the page a few times and confirm the attributes are now
   ordered.
7) Signoff

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 0821a5890d98d17b58ffecaebbb02d673a864714)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27398: Made values in number patterns subscription length translatable
ava li [Wed, 20 Jan 2021 22:37:36 +0000 (22:37 +0000)]
Bug 27398: Made values in number patterns subscription length translatable

TEST PLAN:
Check that the subscription length options when editing or adding a
numbering pattern in the serials module are translatable. check that
the hard coded values are gone.

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 a9df4daab1f780f14fed1fba9f4afad8c4c73d30)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 25632: Update MARC21 frameworks to update Nr. 30 (May 2020)
Bernardo Gonzalez Kriegel [Sun, 31 May 2020 23:43:38 +0000 (20:43 -0300)]
Bug 25632: Update MARC21 frameworks to update Nr. 30 (May 2020)

New
subfields 0 1 2 in 310 and 321

Changes
310 change to repeatable
883 renamed
883 a d q renamed

To test:
1) Remove bibliographic frameworks
2) Check mandatory bibliographic fw load without problem
misc/load_yaml.pl --load --file=installer/data/mysql/en/marcflavour/marc21/mandatory/marc21_framework_DEFAULT.yml
3) Check new/renamed fields/subfields

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 f259298fd4f7b20ccd458af923e6d57a87df32dd)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27608: Corrects 'accepted by' inconsistency in suggestion.tt
Blou [Wed, 3 Feb 2021 16:46:33 +0000 (11:46 -0500)]
Bug 27608: Corrects 'accepted by' inconsistency in suggestion.tt

When looking at an accepted suggestion in suggestion.pl, under 'Suggestion management', the displayed cardnumber in parenthesis is the wrong one.  It displays the "suggestedby"'s cardnumber instead of the acceptedby.

Test:
- create a suggestion in OPAC or staff client with user A.
- In staff client, go to accept it with User B.
- Click Edit
- Under section "Suggestion management", you have a "Accepted on".
- In the By column, the cardnumber in parenthsis is not the B one.
- Apply patch, refresh.

Looking at the code patch is self-explanatory.

Sponsored-by: Collecto
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
JD Amended patch: Add sponsor line

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit bb692e83ea97a32eb16eb1b1336a67f41c66d0de)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27628: Compiled CSS
Fridolin Somers [Fri, 12 Feb 2021 13:23:18 +0000 (14:23 +0100)]
Bug 27628: Compiled CSS

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27628: Fix minor HTML markup errors in OPAC search results templates
Owen Leonard [Thu, 4 Feb 2021 17:40:24 +0000 (17:40 +0000)]
Bug 27628: Fix minor HTML markup errors in OPAC search results templates

This patch makes a couple of minor corrections to templates related to
OPAC search results: An errant quote, and invalidly repeating ids.

The #login4tags id is changed to a class, and CSS related to this id
(which was not used) is removed. For consistency, the id is changed to a
class on the detail page as well.

To test, apply the patch and rebuild the OPAC CSS
(https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client).

 - Perform a search in the OPAC. Confirm that the "Log in to add tags"
   link still looks correct at various browser widths.
 - Confirm that it works to trigger the login modal.
 - Validate the source of the page. There should be no errors.

 - View the detail page for a bibliographic record.
 - The "Log in to add tags" link should look correct and work correctly.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.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 15c3be55afbcff1d5f149f53273bfb25009582a7)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27290: Clean up validation
Martin Renvoize [Mon, 21 Dec 2020 16:25:47 +0000 (16:25 +0000)]
Bug 27290: Clean up validation

It seems we had the validator instantiated twice and we used a mix of
validation of required at form element level and in JS instantiator.

This patch moves the rules to consistently apply at the instantiation
and removes the duplicate lines.

To test:
1 - Enable 'useCashRegisters' and 'EnablePointofSale'
2 - Add a cash register
3 - Add a debit type that can be sold
4 - Go to point of sale and sell the item multiple times
5 - Enter 'Amount tendered' less than amount being paid
6 - Click confirm
7 - Transaction is processed as if full funds received
8 - Try with a negative number - goes through again

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
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 01fc41ca593ee030a77c2462acda0dc59dfe7ec0)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27289: (follow-up) Update payment type too.
Martin Renvoize [Fri, 5 Feb 2021 11:06:25 +0000 (11:06 +0000)]
Bug 27289: (follow-up) Update payment type too.

The payment type field is also required when using cash registers, this
patch updates the formatting to work as expected in that case too.

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 4904abf1c323c6d1c4d41108e3e2eb283f008676)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27289: Template tweaks for point of sale page
Owen Leonard [Mon, 21 Dec 2020 13:22:15 +0000 (13:22 +0000)]
Bug 27289: Template tweaks for point of sale page

This patch makes a couple of minor changes to the point of sale page in
order to make it consistent with other pages in the staff interface:

- Buttons inside table cells should have the "btn-xs" class.
- Required fields should have a "required" class and should have a
  "Required" label.

Also changed: Replaced <input type="number"> according to coding
guidelines.

To test, apply the patch and enable the EnablePointOfSale and
UseCashRegisters system preferences if necessary.

- On the Point of Sale page, add some items to purchase. Confirm that
  the "Add" buttons in the "Items for purchase" table and the "Remove"
  buttons in the "This sale" table are correctly sized.

- In the "Collect payment" form, confirm that "Amount tendered" and
  "Cash register" fields are styled red with "Required" text after them.
- Confirm that the "Amount tendered" field will only accept numeric
  input.

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 f27e91f1ad4a0048e360e67e6bd0c6723a981577)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27633: (bug 15436 follow-up) Fix duplicate of 440$v at the OPAC
Jonathan Druart [Fri, 5 Feb 2021 14:41:34 +0000 (15:41 +0100)]
Bug 27633: (bug 15436 follow-up) Fix duplicate of 440$v at the OPAC

Only display a in link, not v that is displayed later.

It has been fixed in different other places by
  commit 81f71d45fe4fee92596ea8d8edb57c602490e9b1
  Bug 15436: Use semicolon between series name and volume

but missed one occurrence.

Test plan:
Add a 440$a and $v and confirm that the display at the OPAC is now the
same as the staff interface.

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 b3c58aafcf249efdfe91b00d4da9c66472c4a141)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27154: Fix test if the cache is populated already
Jonathan Druart [Tue, 9 Feb 2021 08:20:40 +0000 (09:20 +0100)]
Bug 27154: Fix test if the cache is populated already

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 05a3d926f00d8b8f8b0d14bb91f23290e8684c18)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27154: Remove Koha::Util::SystemPreferences
Jonathan Druart [Fri, 5 Feb 2021 11:01:38 +0000 (12:01 +0100)]
Bug 27154: Remove Koha::Util::SystemPreferences

On bug 15494, the same method "get_yaml_pref_hash" has been added to two modules,
Koha/Config/SysPref.pm and Koha/Util/SystemPreferences.pm

We only need the one from Koha::Config::SysPref and remove the whole
Koha::Util::SystemPreferences module.

Test plan:
 prove t/db_dependent/Circulation/issue.t
must return green

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.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 ac11405321ae3e5fdd72701ddb41b62675e42c97)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 26602: (QA follow-up) Cleanup datatables settings
Nick Clemens [Fri, 5 Feb 2021 17:45:34 +0000 (17:45 +0000)]
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>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 6118d24904297c3b4bc44bf13e5e354b60feb33d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 26602: Don't export "actions" column
Jonathan Druart [Mon, 18 Jan 2021 10:26:22 +0000 (11:26 +0100)]
Bug 26602: 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>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 655f11fd60ddf2a7ae690de340ed9945070ef3e2)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27589: Access item fields as hash
Nick Clemens [Thu, 4 Feb 2021 12:00:10 +0000 (12:00 +0000)]
Bug 27589: Access item fields as hash

SIP item stores the item unblessed so field must be accessed as a hashref

This patch changes the code in handle_item_information to match the code in
handle_checkin

To test:
1 - In sip config set the cr_item_field='itype' for a sip account
2 - Restart SIP
3 - Attempt an item information requests using the sip_cli_emulator
     perl misc/sip_cli_emulator.pl -a localhost -p 6001 -su term1 -sp term1 -l CPL -m item_information --item 39999000011791
4 - It fails!
5 - Apply patch and restart
6 - It succeeds!

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 18368d6a0c6b35d91ad80a832435e57144d32b6d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27589: Unit test
Nick Clemens [Thu, 4 Feb 2021 11:59:11 +0000 (11:59 +0000)]
Bug 27589: Unit test

Previous tests only covered CHECKIN, this adds a test for ITEM_INFORMATION

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 48e306f5d2bc4c49329e082823cbf85c67089a0d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27586: Rollback should be before return statement
Kyle M Hall [Fri, 5 Feb 2021 11:15:06 +0000 (06:15 -0500)]
Bug 27586: Rollback should be before return statement

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 48e56b320a0dc2d096b19bc0bab62d3bad92d25c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27586: Import patrons script has a confirm switch that doesn't nothing!
Kyle M Hall [Mon, 1 Feb 2021 18:22:58 +0000 (13:22 -0500)]
Bug 27586: Import patrons script has a confirm switch that doesn't nothing!

If the script misc/import_patrons.pl is run without "--confirm" it reports
that it is "running in dry-run mode" but it is not!

Test Plan:
1) Import a CSV of patrons using import_patrons.pm *without* the --confirm parameter
2) Note that it does actually import the patrons
3) Apply this patch
4) Note that this time the patrons are not actually imported
5) Import again with --confirm
6) Note that the patrons were actually imported this time!

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 d3005a2a4c493c624ffd6204f6fccc83ea350361)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27466: Don't use set_preference from updatedatabase.pl
Jonathan Druart [Wed, 20 Jan 2021 10:16:48 +0000 (11:16 +0100)]
Bug 27466: Don't use set_preference from updatedatabase.pl

We must never use subroutines or methods from updatedatabase.pl!

Having it using C4::Context->set_preference will call
Koha::Config::Syspref->store then C4::Log::logaction and finally
Koha::Logger->get which will need the log4perl configured correctly
(which is not necessary the case when you upgrade).

Test plan:
git checkout ed3e4540d73c1c3009375ad339e09a2e676fa1bd (20.06.00.022)
reset_all
Set the value of QuoteOfTheDay to 0
git checkout bug_27466 (master + this patch)
updatedatabase
=> QuoteOfTheDay is an empty string
git checkout ed3e4540d73c1c3009375ad339e09a2e676fa1bd (20.06.00.022)
reset_all
Set the value of QuoteOfTheDay to 1
git checkout bug_27466 (master + this patch)
updatedatabase
=> QuoteOfTheDay is set to "opac"

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 bab6a08ac98c1e6a72b346d554f020c0943e243d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27395: Add a warning to PatronSelfRegistrationDefaultCategory
Eden Bacani [Tue, 19 Jan 2021 21:21:51 +0000 (21:21 +0000)]
Bug 27395: Add a warning to PatronSelfRegistrationDefaultCategory

This patch adds a warning to the PatronSelfRegistrationDefaultCategory system
preference to not use a regular patron category for self registration.

If a regular patron category code is used and the cleanup_database cronjob is setup
to delete unverified and unfinished OPAC self registrations, it permanently and
and unrecoverably deletes all patrons that have registered more than
PatronSelfRegistrationExpireTemporaryAccountsDelay days ago.

It also removes unnecessary apostrophes at the end of two self registration
and modification system preference descriptions.

Test plan:
1. Apply the patch.
2. Check that the warning message for the PatronSelfRegistrationDefaultCategory
   system preference is clear and makes sense.
3. Sign off!

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 065c955cc67b6f113c9fb5d5ed918ba1400b5af9)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 25552: DBRev 20.11.02.001
Jonathan Druart [Mon, 1 Feb 2021 16:18:57 +0000 (16:18 +0000)]
Bug 25552: DBRev 20.11.02.001

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 940c0e319a1df9fb2d218d816079b5f5034972f0)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 25552: Simplify tests using build_sample_item
Jonathan Druart [Mon, 1 Feb 2021 16:24:37 +0000 (17:24 +0100)]
Bug 25552: Simplify tests using build_sample_item

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 527c8cd28842429a4715f8e64aaada92de6ca9c2)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 25552: (QA follow-up) Fix spelling mistake
Martin Renvoize [Fri, 22 Jan 2021 13:00:59 +0000 (13:00 +0000)]
Bug 25552: (QA follow-up) Fix spelling mistake

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 7c6cbabaedab05c1b36d6ac3303e51a354dbfe1a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 25552: (QA follow-up) Improve claim_returned POD
Martin Renvoize [Fri, 22 Jan 2021 12:56:02 +0000 (12:56 +0000)]
Bug 25552: (QA follow-up) Improve claim_returned POD

The POD for the Koha::Checkout->claim_returned method was somewhat
lacking; This patch attempts to explain what the code appears to
achieve.

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 8c09123197bc4bf8997ba4cd1b727c80eef9077e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>