Commit graph

41272 commits

Author SHA1 Message Date
5b3befe58b Bug 24446: Add datecancelled handling to GetTransfers
Signed-off-by: Kathleen Milne <kathleen.milne@cne-siar.gov.uk>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-03-03 15:36:13 +01:00
e1ef7571c0 Bug 24446: Prioritize RotatingCollection transfer over StockRotationAdvance
This patch prioritizes the RotatingCollection transfer type over the
StockRotationAdvance transfers allowing us to queue up a our transfer
behind it.

Signed-off-by: Kathleen Milne <kathleen.milne@cne-siar.gov.uk>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-03-03 15:36:13 +01:00
2ac337b4e7 Bug 24446: (follow-up) Handle cases of pre-existing transfers
This is a long standing bug in stockrotation (and transfers in general)
where by if a transfer is in progress and another transfer is requested
then the original transfer is inexplicitly cancelled. This patch updates
the stockrotation code to handle queued transfers, either adding a
StockrotationAdvance transfer to the queue when an in progress transfer
was triggered to fulfil a Reserve, or otherwise cancelling the transfer
as stockrotation should take precidence.

To test
1/ Run t/db_dependent/StockRotationsItems.t.
2/ Signoff

Signed-off-by: Kathleen Milne <kathleen.milne@cne-siar.gov.uk>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-03-03 15:36:13 +01:00
cfe6ebc667 Bug 24446: Update GetTransfers Unit Test
We updated the return signature for GetTransfers and as such need to
update the corresponding unit test

Test plan
1/ Run t/db_dependent/Circulation/transfers.t
2/ Confirm it passes
3/ Signoff

Signed-off-by: Kathleen Milne <kathleen.milne@cne-siar.gov.uk>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-03-03 15:36:13 +01:00
d25c667d06 Bug 24446: Update transferbook Unit Test
We updated C4::Circulation::transferbook to return the to_branch branchcode as
the data entity for 'WasTransfered'. This patch updates the corresponding unit
test.

To test:
1/ Run t/db_dependent/Circulation/transferbook.t
2/ Signoff if it passes

Signed-off-by: Kathleen Milne <kathleen.milne@cne-siar.gov.uk>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-03-03 15:36:13 +01:00
7e919d12d8 Bug 24446: Catch daterequested in circ returns
Update C4::Circulation::AddReturn to use Koha::Item->get_transfer to
find requested transfers and use Koha::Item::Transfer->receipt to complete
transfer requests if they have arrived at their destination or return the
relevant 'WrongTransfer', 'WasTransfered' and 'TransferTrigger' messages
to the end user.

Signed-off-by: Kathleen Milne <kathleen.milne@cne-siar.gov.uk>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-03-03 15:36:13 +01:00
aca8b71364 Bug 24446: Update StockRotationItem to use daterequested
This patch updates the stockrotation functionality to utilise the new
branchtransfers.daterequested field to more accurately track the state
of stockrotation transfers.

We also opt to start using the new Koha::Item and Koha::Item::Transfer
methods to achieve this goal.

Test plan
0/ Setup stockrotation and configure some rotas and assign items to
them.
1/ Run the stockrotation cronscript
2/ Check the database for branchtransfers initiated by stockrotation and
confirm that that now populate the daterequested field and not the
datesent.
3/ Run the stockrotation tests and verify they pass
4/ Signoff

Signed-off-by: Kathleen Milne <kathleen.milne@cne-siar.gov.uk>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-03-03 15:36:13 +01:00
cf8ce2aa13 Bug 24446: Improve StockRotationItem->advance tests
This patch adds additional checks in the tests for item homebranch
updates and cyclical transfers caused by the StockRotationItem->advance
method.

It highlights a bug in the original logic whereby a cyclical rotation
would always result in a completed transfer but the physical item would
not have actually been moved between branches.

Signed-off-by: Kathleen Milne <kathleen.milne@cne-siar.gov.uk>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-03-03 15:36:13 +01:00
99e3bb18b0 Bug 24446: Update branchtransfers.daterequested for stockrotation
This database update catches existing stockrotation triggered
branchtransfers and moves the datesent value into daterequested

Signed-off-by: Kathleen Milne <kathleen.milne@cne-siar.gov.uk>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-03-03 15:36:13 +01:00
84c0339acc Bug 26057: DBIC schema changes
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-03-03 15:36:13 +01:00
c004a9128a Bug 26057: DBRev 20.12.00.019
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-03-03 15:36:13 +01:00
f10c7b5c74 Bug 26057: (QA follow-up) Fix Indexer tests
The addition of cancellationdate meant that our test objects in the
Indexer tests now longer matched expectations and as such the tests
failed.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-03-03 15:36:13 +01:00
26b6f2f1d0 Bug 26057: (QA follow-up) Drop test for 'reason'
We decided this test was superflous to requirements and as such I've
removed it as requested.

Signed-off-by: Kathleen Milne <kathleen.milne@cne-siar.gov.uk>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-03-03 15:36:13 +01:00
9378fb03a7 Bug 26057: Add 'cancel' method to Koha::Item::Transfer
This patch adds the 'cancel' method to Koha::Item::Transfer which sets
the transfer as cancelled by updating the datecancelled field. We also
update Koha::Item->get_transfer here to accomodate for the new
resolution available for a transfer.

Test plan:
1/ Run the included unit tests additions (t/db_dependent/Koha/Items.t,
t/db_dependent/Koha/Item/Transfer.t

Signed-off-by: Kathleen Milne <kathleen.milne@cne-siar.gov.uk>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-03-03 15:36:13 +01:00
3d0006f772 Bug 26057: Add datecancelled, cancellation_reason fields
This patch adds the datecancelled and cancellation_reason fields to the
branchtransfers table to record when and why transfers have been
cancelled.

To test
1/ Run the database update
2/ Check the database for the 'datecancelled' and 'cancellation_reason'
fields
3/ Signoff

Signed-off-by: Kathleen Milne <kathleen.milne@cne-siar.gov.uk>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-03-03 15:36:13 +01:00
6becadc96e Bug 26481: Add Koha::Item::Transfer->in_transit method
This method returns a boolean representing the in_transit state of the
transfer.

Test plan
1/ Run the included tests

Signed-off-by: Kathleen Milne <kathleen.milne@cne-siar.gov.uk>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-03-03 15:36:13 +01:00
ca9ce62ee8 Bug 25767: Add Koha::Item::Transfer->receive method
Was Bug 25767: Add Koha::Item::Transfer->receipt method

Signed-off-by: Kathleen Milne <kathleen.milne@cne-siar.gov.uk>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>

Bug 25767: Add unit tests for Koha::Item::Transfer->receipt

Signed-off-by: Kathleen Milne <kathleen.milne@cne-siar.gov.uk>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>

Bug 25767: (QA follow-up) receipt -> receive

Signed-off-by: Kathleen Milne <kathleen.milne@cne-siar.gov.uk>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-03-03 15:36:13 +01:00
62e16bbbe4 Bug 25757: Add unit tests for item relation
Test plan
1/ Run the unit test

Signed-off-by: Kathleen Milne <kathleen.milne@cne-siar.gov.uk>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-03-03 15:36:12 +01:00
74bcdd3765 Bug 25757: Add Koha::Item::Transfer->transit method
Test plan
1/ Run the included unit tests

Signed-off-by: Kathleen Milne <kathleen.milne@cne-siar.gov.uk>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-03-03 15:36:12 +01:00
94056d8df2 Bug 25757: Add item relation to Koha::Item::Transfer
Signed-off-by: Kathleen Milne <kathleen.milne@cne-siar.gov.uk>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-03-03 15:36:12 +01:00
165cb84dd8 Bug 25755: (QA follow-up) Further POD clarifications
This patch attempts to further clarify the queueing nature of transfer
requests in the get_transfer method POD.

Signed-off-by: Kathleen Milne <kathleen.milne@cne-siar.gov.uk>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-03-03 15:36:12 +01:00
edbde02775 Bug 25755: (follow-up) Fix unit test
Signed-off-by: Kathleen Milne <kathleen.milne@cne-siar.gov.uk>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-03-03 15:36:12 +01:00
Katrin Fischer
a3fb0ce392 Bug 25755: Fix typo in POD
Signed-off-by: Kathleen Milne <kathleen.milne@cne-siar.gov.uk>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-03-03 15:36:12 +01:00
f81ecbb19d Bug 25755: Add Unit tests for update to get_transfer
We updated Koha::Item->get_transfer here to account for the new
daterequested field availability. It is now possible to set requested
without setting datesent simultaneiously.. as such we need to update
get_transfer to ensure we always return the right transfer (either the
one 'in transit' or the oldest request first.

This patch update the unit tests to test for this.

Signed-off-by: Kathleen Milne <kathleen.milne@cne-siar.gov.uk>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-03-03 15:36:12 +01:00
17007f0345 Bug 25755: (QA follow-up) Clarify POD and parameters
This patch removes a FIXME that signified possible future work and also
updates the POD and optional parameters to more clearly specify their
function.

Signed-off-by: Kathleen Milne <kathleen.milne@cne-siar.gov.uk>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-03-03 15:36:12 +01:00
33e1ec0ed0 Bug 25755: Add Koha::Item->request_transfer method
This patch adds the request_transfer method to the Koha::Item object.
The new method requires `to` and `reason` parameters and will throw an
exception if an active transfer request is found on the item.

Test plan
1/ Run the included updated tests in t/db_dependent/Koha/Item.t
2/ Verify the tests pass
3/ Signoff

Signed-off-by: Kathleen Milne <kathleen.milne@cne-siar.gov.uk>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-03-03 15:36:12 +01:00
f1845ff19b Bug 25846: Compiled CSS
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-03-03 15:36:12 +01:00
fa349d4cf1 Bug 27703: Make ID of category select field unique
Duplicate element IDs on the authorized values page are invalid and
cause a problem with the JavaScript intended to submit the form when the
category select field changes.

This patch changes the ID of the label and the field and makes the
corresponding change to the JavaScript.

To test, apply the patch and go to Administration -> Authorized values.

 - Click an authorized value category to view its contents.
 - Using mouse or keyboard, make a selection from the "Show category"
   dropdown menu.
 - The form should submit automatically and direct you to the
   corresponding category.
 - Validate the HTML of the page and confirm that there are no errors.

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>
2021-03-03 11:59:01 +01:00
d67fc5e010 Bug 27784: Don't parse subdivision authorities as headings
Subdivision authorities are not used for linking, however, they are recognized by
C4::AuthoritiesMarc

While these records are not used for linking, they could provide reference and
should be allowed to exist in the catalog without breaking ES indexing

THis patch simply skips the step of parsing the authorities into the linking form
if the type contains '_SUBD'

To test:
1 - Import a subdivision authority record via Z39 or use the one attached to this bug
2 - perl misc/search_tools/rebuild_elasticsearch.pl -v -d
3 - Authority indexing dies:
   Use of uninitialized value $tag in hash element at /usr/share/perl5/MARC/Record.pm line 202.
   Use of uninitialized value $tag in regexp compilation at /usr/share/perl5/MARC/Record.pm line 206.
   Use of uninitialized value $tag in hash element at /usr/share/perl5/MARC/Record.pm line 207.
   Can't call method "tag" on an undefined value at /kohadevbox/koha/C4/Heading.pm line 71.
4 - Apply patches
5 - reindex
6 - Success!

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>
2021-03-03 11:57:51 +01:00
5e0dbf0adb Bug 27784: Unit tests
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>
2021-03-03 11:57:51 +01:00
7b4be9486e Bug 27828: (bug 24469 follow-up) Add missing import
Caused by
  commit 03a9bdc851
  Bug 24469: Move the new queries to a dedicated ImportBatch subroutine

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

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

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-03-03 11:57:51 +01:00
2542687f68 Bug 27822: Fix default value for AddressFormat (es-ES)
It must be "us" not "US" otherwise you get
Template process failed: file error - member-main-address-style-US: not found at /usr/share/koha/lib/C4/Templates.pm line 122" because the system expects "us", not "US".

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-03-03 11:57:51 +01:00
Aleisha Amohia
3c75c48249 Bug 27803: Ensure publicationyear or copyrightdate shows in Holds to Pull
If marcflavour is set to MARC21, use biblio.copyrightdate. If
marcflavour is set to something other than MARC21, use
biblioitem.publicationyear. This is to match previous behaviour of this
feature.

To test:
1) Set your marcflavour system preferenece to MARC21.
2) Go to Administration -> Koha to MARC mapping to confirm what MARC tag
maps to biblio.copyrightdate.
3) In your terminal, run misc/batchRebuildBiblioTables.pl from the shell
to confirm the mapping is locked.
4) Edit a biblio, fill in whichever field is mapped to biblio.copyrightdate
and Save.
5) Place a hold on this biblio. (It must have an available item to allow
placing holds.)
6) Go to Circulation -> Holds to Pull.
7) Confirm your hold shows in the table with the copyrightdate.
8) Set your marcflavour system preference to something other thatn
MARC21.
9) Go to Administration -> Koha to MARC mapping to confirm what MARC tag
maps to biblioitem.publicationyear.
10) In your terminal, run misc/batchRebuildBiblioTables.pl from the shell
to confirm the mapping is locked.
11) Edit a biblio, fill in whichever field is mapped to biblioitem.publicationyear
and Save.
12) Place a hold on this biblio. (It must have an available item to allow
placing holds.)
13) Go to Circulation -> Holds to Pull.
14) Confirm your hold shows in the table with the publicationyear.

Sponsored-by: Catalyst IT
Signed-off-by: Petro Vashchuk <stalkernoid@gmail.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-03-03 11:57:51 +01:00
bfaae61487 Bug 8976: (follow-up) Code cleaning
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-03-03 11:57:51 +01:00
ab19068a4b Bug 8976: Use existing Koha::Authority::Subfield[s]
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-03-03 11:57:51 +01:00
96aa6877ae Bug 27680: (QA follow-up) Update test for dbic_merge_sorting
The order_by handling will now always return an arrayref of ordering
hashrefs even when only one ordering hash is present. This is
interpreted by dbic as equivilent so I just update the test to pass
here.

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-03-02 10:00:34 +01:00
8df3e02885 Bug 27808: (QA follow-up) Make sure the update catches the items we want
This query:

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

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

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

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

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

This patch does that.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-03-02 09:03:36 +01:00
aa41987dbf Bug 27808: DBRev 20.12.00.018
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-03-01 15:14:23 +01:00
bb2758839e Bug 27808: DB changes - adjust items.onloan when needed
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-03-01 15:14:23 +01:00
26b57ad5d2 Bug 27808: Refresh the item object when AddReturn is called
This patch changes the original implementation so the item object is
refreshed altogether instead of explicitly pinpointing a specific field
we identified an edge case can leave out from ->store. I propose this
alterate implementation because what this bug highlights is the fact we
don't code thinking calls to things can have side-effects (like this
case, with AddReturn updating the onloan status (and maybe other
things?).

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

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-03-01 15:14:23 +01:00
44a54eb526 Bug 27808: Mark the onloan column as dirty in AddIssue
If any item is currently checked out to a patron, and the item is then checked out directly to another patron without manually checking the item in first, the items.onloan column will remain NULL.

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

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

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

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

Signed-off-by: Lisette Scheer <lisettes@latahlibrary.org>

Signed-off-by: Marti Fuerst <mfuerst@hmcpl.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-03-01 15:14:23 +01:00
36c49aa2a8 Bug 27808: Add unit tests
Signed-off-by: Lisette Scheer <lisettes@latahlibrary.org>

Signed-off-by: Marti Fuerst <mfuerst@hmcpl.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-03-01 15:14:23 +01:00
12d50cb5d8 Bug 27794: Add link to biblio in lateorders page
This patch modifies the late orders page so that the late order title
uses the "biblio-title" include to display a standard title with a link
to the bibliographic detail page.

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

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

Signed-off-by: Severine QUEUNE <severine.queune@bulac.fr>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-03-01 15:14:23 +01:00
f8a92cb8e8 Bug 27792: (follow-up) Double escape the escape
The JSON patturn wasn't getting interpreted correctly for me.. the `\`
characters needed escaping with a second `\`.

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>
2021-03-01 15:14:23 +01:00
50c4efb18d Bug 27792: Improve jEditable configuration for point of sale fields
This patch alters the configuration of the "cost" and "quantity"
editable fields in the "This sale" table on the Point of Sale page:

 - Reduce field with to reduce jumpy table re-draws.
 - Replace "numeric" input type with "text"
 - Add pattern attribute for enforcing currency/number entry

To test you must have EnablePointOfSale and UseCashRegisters enabled and
configured.

 - Apply the patch and go to the Point of Sale page.
 - Add some items for purchase.
 - In the "This sale" table, click the values in the "cost" and
   "quantity" columns and try editing their values.
 - The form field which appears should not fill the width of the table
   column.
 - The fields should enforce the correct input: Currency for the "cost"
   column, digits for the "quantity" column.
 - The fields should update when you click out of them and the correct
   values should appear in the "Collect payment" area.

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>
2021-03-01 15:14:23 +01:00
c4f17c10ff Bug 27592: Link audio alerts to corresponding preference and back
This patch adds links from the audio alerts page to system preferences
and back.

To test, apply the patch and disable the "AudioAlerts" system
preference.

- Log in to the staff interface as a user with permission to access
  audio alerts and system preferences.
- Go to Administration -> Audio alerts.
- You should see an alert, "Audio alerts are disabled."
  - Test the link to system preferences. It should take you a
    preferences search which returns only "AudioAlerts."
- On the system preference page, test that the link to audio alerts
  works correctly.

- Disable audio alerts again.
- Log in to the staf interface as a user with permission to access audio
  alerts but WITHOUT permission to access system preferences.
- Go to Administration -> Audio alerts.
- You should see an alert, "Audio alerts are disabled."
- There should be no link to system preferences.

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>
2021-03-01 15:14:23 +01:00
927a62ba6f Bug 25846: Improve handling of multiple covers on catalog search results in the staff client
This patch modifies the template, JS, and CSS for the staff
interface catalog search results in order to gracefully handle multiple
cover images.

The changed version loops through any cover images which might be
embedded and checks that they are successfully loaded. Only
successfully-loaded images are shown. Only the first image is shown, and
the others can be "paged through" using generated navigation controls.

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

Enable multiple cover image services. The patch was developed with these
services available:

 - Amazon
 - Local cover images (including multiple local cover images)
 - Coce (serving up Amazon, Google, and OpenLibrary images)
 - Images from the CustomCoverImages preference

Perform a variet of searches and confirm that cover images are
displaying correctly, whether there be 0, 1, 2, or more covers
available for each.

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>
2021-03-01 15:14:23 +01:00
cb9cd28bac Bug 26937: DBRev 20.12.00.017
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-03-01 15:14:23 +01:00
Katrin Fischer
d55746004b Bug 26937: (QA follow-up) Rephrase and link CheckPrevCheckoutDelay description
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-03-01 15:14:22 +01:00
Matthias Meusburger
5a31f88d52 Bug 26937: Add an optional delay to the CheckPrevCheckout syspref.
The CheckPrevCheckout allows to check a borrower's checkout history to see if
the current item has been checked out before.

This patch adds an optional syspref: CheckPrevCheckoutDelay

It allows to specify the maximum number of days since the last checkin
that will trigger CheckPrevCheckout's warning.

Test plan:

 - Apply the patch.

 - Set CheckPrevCheckout to "Do" and CheckPrevCheckoutDelay to n.

 - Checkout and check-in an item for a patron.

 - Try to checkout the same item.

 - Check that you have a warning:
   "Patron has previously checked out this title: Check out anyway?"

 - Update the returndate column from the old_issues table to have a returndate
   older than n days ago.

 - Try to checkout the same item.

 - Check that you don't have the warning.

 - Prove t/db_dependent/Patron/Borrower_PrevCheckout.t

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-03-01 15:14:22 +01:00