Commit Graph

39660 Commits

Author SHA1 Message Date
Jonathan Druart d4a5f258b6 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 0a40b4bb50)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 9327130853)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2021-03-04 18:00:47 +00:00
Jonathan Druart 9a5927c322 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 0e0700a691)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit e6aeb00c10)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2021-03-04 18:00:34 +00:00
Jonathan Druart c720acc3c9 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 3c087bc216)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit da58f3e2c5)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2021-03-04 18:00:22 +00:00
Tomas Cohen Arazi fef046d851 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 fd27224415)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit fd75ab1808)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2021-03-04 17:26:56 +00:00
Tomas Cohen Arazi 5e4edb2b09 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 f259355895)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit cb09491e67)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2021-03-04 17:26:44 +00:00
Tomas Cohen Arazi 93f8d4c7c8 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 ea0696831f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 4f3d15c8d2)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2021-03-04 17:26:32 +00:00
Tomas Cohen Arazi 23df724996 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 2af262e1f2)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit f48b9b7611)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2021-03-04 17:26:20 +00:00
Tomas Cohen Arazi d0c32c7fa6 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 94d966ecec)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 465899c347)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2021-03-04 17:26:09 +00:00
Andrew Fuerste-Henry 3e5360ab26 Update release notes for 20.05.08 release
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2021-02-23 20:31:51 +00:00
Andrew Fuerste-Henry 38bdc733a3 Increment version for 21.05.09
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2021-02-23 20:19:43 +00:00
Andrew Fuerste-Henry b548f6ceff Traslation fixes for Koha 20.05.09
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2021-02-23 20:09:12 +00:00
Koha translators a17a13fc55 Translation updates for Koha 20.05.09
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2021-02-23 16:26:42 -03:00
Andrew Fuerste-Henry f51f0edd40 Bug 26602:[20.05.x] Remove stray merge marker
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2021-02-23 19:20:02 +00:00
Tomas Cohen Arazi 41cb970fee 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>
2021-02-23 18:36:32 +00:00
Jonathan Druart bf045e483a Bug 27604: Deal with empty pref
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 121b633cad)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 350fbb7da1)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2021-02-23 18:28:30 +00:00
Jonathan Druart 196d7311ea Bug 27604: Init to {}
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 4784b8ffe5)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit c4922f9c76)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2021-02-23 18:28:19 +00:00
Nick Clemens ec0cee795f 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 60a749ff5a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 1951169055)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2021-02-23 18:28:09 +00:00
Jonathan Druart cd8fd0bb45 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 376bf9b980)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 41aaad8098)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2021-02-23 18:27:55 +00:00
Marcel de Rooy 1bc7b45698 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 c8d14a8087)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2021-02-23 17:52:48 +00:00
Joonas Kylmälä 27f79ee1c0 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 9a03861c8f)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2021-02-23 17:52:36 +00:00
Jonathan Druart f1edf3359f 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 e741e6c83b)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2021-02-23 17:52:25 +00:00
Jonathan Druart 6484aff04f 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 0d1e5ea69b)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2021-02-23 17:52:15 +00:00
Jonathan Druart e25080ff8f 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 55d40c1618)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2021-02-23 17:52:03 +00:00
Jonathan Druart 629e9fc4d8 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 c22621e820)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2021-02-23 17:51:52 +00:00
Jonathan Druart f72664351c 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 f9c3cde499)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2021-02-23 17:51:41 +00:00
Jonathan Druart 6ced29d5bf 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 03a9bdc851)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit aba575daed)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2021-02-23 17:48:13 +00:00
Jonathan Druart f1a42bbe79 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 7bc460e005)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 3f636fdbb9)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2021-02-23 17:48:02 +00:00
Jonathan Druart 7094c56ca6 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 93bc3af5a9)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 5dfc3942f6)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2021-02-23 17:41:07 +00:00
Jonathan Druart f919eabb4c 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 f0f1d27dd2)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 0e825b548e)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2021-02-23 17:40:57 +00:00
Jonathan Druart df7b796cc9 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 ce92a756a8)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 31d1d65d44)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2021-02-23 17:40:46 +00:00
Jonathan Druart b8410536dc 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 ad5de74cbc)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 69ff54b194)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2021-02-23 17:40:35 +00:00
Jonathan Druart 658533a734 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 7c11f05626)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 63e674c960)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2021-02-23 17:40:24 +00:00
Jonathan Druart 38e0544d38 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 0c0b2c0917)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 9095f56590)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2021-02-23 17:40:11 +00:00
Jonathan Druart 959b76f779 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 dfd42a4eb2)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit eac9e84792)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2021-02-23 17:39:58 +00:00
Jonathan Druart e7d9ef4116 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 76c38d10d0)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit d641561125)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2021-02-23 17:09:08 +00:00
Owen Leonard 52fe978a09 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 a63748e241)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit d0f350314a)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2021-02-23 17:03:59 +00:00
Nick Clemens a1651a70a6 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 1acbe07f0b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit df66dc51ea)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2021-02-23 16:28:17 +00:00
Jonathan Druart c0881c8f91 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>
2021-02-23 16:13:28 +00:00
Jonathan Druart 52379cbdfb 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 35994c1da5)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 2b68016df7)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2021-02-23 13:04:37 +00:00
Jonathan Druart 75ffbc53d9 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 40ccb7f371)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 8f34251746)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2021-02-23 12:28:03 +00:00
Jonathan Druart b2c55f8440 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 20c97bca2d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 3d7812c07f)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2021-02-23 12:27:47 +00:00
Kyle M Hall 6e6095894c 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 fac4c54ead)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit d78d9386ee)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2021-02-23 12:27:24 +00:00
Kyle M Hall 07c91fba62 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 fba0bda9a9)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 99af6c24eb)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2021-02-23 12:25:57 +00:00
Kyle M Hall 6feb6d5493 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 9f71452b93)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit feb444c585)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2021-02-23 12:25:34 +00:00
Agustin Moyano 9526f4e3f6 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 e82091f40a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 6b5c5c00d4)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2021-02-23 12:25:09 +00:00
Owen Leonard 9f2714afc8 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 3cfa9b1e99)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 7421e4c3ca)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2021-02-22 22:59:47 +00:00
Petro Vashchuk 5fb93c86f3 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 f58c271b42)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit fa597b5209)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2021-02-22 22:53:49 +00:00
Jonathan Druart 1039d11869 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 4bb20fdb30)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 8113778f32)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2021-02-22 22:51:26 +00:00
Tomas Cohen Arazi c975904ea0 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 15fcd755a2)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 43dd10cd2a)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2021-02-22 22:48:44 +00:00
Tomas Cohen Arazi b496557b41 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 758732c052)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 86f4e0ab57)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2021-02-22 22:48:34 +00:00