Joonas Kylmälä [Thu, 18 Feb 2021 15:37:36 +0000 (17:37 +0200)]
Bug 25690: Add SIP2 tests for checking out with holds
This should cover whether checking out is allowed for all different
hold states:
Attached:
- Waiting
- In processing
- Transfer
Unattached:
- Reserved
To test:
1) prove t/db_dependent/SIP/Transaction.t => passes
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Joonas Kylmälä [Wed, 17 Feb 2021 14:20:28 +0000 (16:20 +0200)]
Bug 25690: Make CanBookBeIssued return In Processing state as needing confirmation
This prevents checking out to a patron an item with hold to someone
else in the In Processing state via staff interface.
Also the checkout error message via SIP is now a more clearer one: "Item is
on hold for another patron." Before it was "Item cannot be issued:
$confirmation".
Also the branch transfer and batch checkout pages are adapted to this new
confirmation message as well.
To test:
1) Create bib level hold to an item for patron A
2) Check-in that item via SIP2, now the hold state should be "In processing"
3) Apply patch
4) Try to checkout the item to patron B via staff interface and
notice we get now confirmation prompt do we really want to do it
because it is in processing.
In order to not have to setup SIP2 server, alternatively steps 1) and
2) can be done so that you check-in the item in staff interface and
make it Waiting, and then with SQL change it to "In processing":
UPDATE reserves SET found = "P" WHERE reserve_id = XXX;
UPDATE reserves SET waitingdate = NULL WHERE reserve_id = XX
UPDATE reserves SET expirationdate = NULL WHERE reserve_id = XXX;
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Joonas Kylmälä [Wed, 17 Feb 2021 12:17:36 +0000 (14:17 +0200)]
Bug 25690: Remove duplicated logic in SIP2 checkouts
Because AllowItemsOnHoldCheckoutSIP only affects the checkoutability
of non-attached, i.e. RESERVED holds in SIP2 we can therefore use the
common code from CanBookBeIssued and ignore only the RESERVED confirmation
message case in SIP2 checkout code.
This slightly changes the checkout error message given for "In
processing" holds that someone other than the holdee tries to
checkout. Otherwise there is no logic changes. The message that this
changes is "Item is on hold for another patron." vs. now "Item cannot
be issued: $confirmation". It is easier to create follow-up patch to
properly add INPROCESSING confirmation to CanBookBeIssued and then
show correct message based on the CanBookBeIssued return value.
To test:
1) Apply all patches from bug 25690 to get latest Transaction.t version
2) prove t/db_dependent/SIP/Transaction.t => passes
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Joonas Kylmälä [Wed, 17 Feb 2021 12:28:03 +0000 (14:28 +0200)]
Bug 25690: SIP2: Don't allow checking out attached hold that is being transferred
Items that are attached to a hold and being transferred (found = T) is
final decision and you cannot checkout those to other patrons.
To test (if you have applied all patches from bug 25690):
1) prove t/db_dependent/SIP/Transaction.t => passes
To test (if you don't have all patches):
1) Create hold and set pickup library to something else where the
item is at
2) Return the item and it should confirm the hold and start transfer
3) Apply this patch
4) Try to checkout this item now to some other patron via SIP2 and
notice it doesn't allow it
5) Revert this patch
6) Notice you can now checkout somebody else's hold that is being transferred!
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Joonas Kylmälä [Wed, 17 Feb 2021 12:04:47 +0000 (14:04 +0200)]
Bug 25690: Remove double usage of 'Reserved' return value
The patch "Bug 19116: Hold not set to waiting after transfer" added a
new meaning to 'Reserved' return value of C4::Reserves::CheckReserves
function. Let's remove double usage and have separate Transferred
return value so we can differentiate between attached and non-attached
holds. This will come useful in future refactorings.
This patch does no changes to the logic except in the
/cgi-bin/koha/circ/branchtransfers.pl and circulation.pl we now give
similarly to waiting state notice about hold being transferred.
To test:
1) Apply this patch
2) Create a new item level hold so that pickup library is different
than where the item is currently. Then return the item so that hold
is being attached and transferred.
3) Go to branchtransfers.pl and try to create a new transfer: it
should prompt you with message "Item is attached to a hold and
being transferred for XXX" and provide you with option to cancel
the hold or to ignore the transfer.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
With the introduction of datecancellation we now have two fields to
check to varify if a transfer is 'complete' or not. I forgot to update
these tests at the time to ensure the datecancellation field was not set
when adding the mock transfer.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Owen Leonard [Wed, 3 Mar 2021 17:26:39 +0000 (17:26 +0000)]
Bug 25846: (follow-up) Show "No cover image available" message
This patch restores the use of a "No cover image available" message in
staff interface search results when no cover image was found by any
image service.
The patch also corrects markup in the search results template which was
preventing the "Adlibris cover image" text from being correctly hidden.
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Owen Leonard [Mon, 1 Mar 2021 13:05:22 +0000 (13:05 +0000)]
Bug 27473: (follow-up) Remove the redirect message
I don't think it's necessary to remove the redirect because I don't
think it does any harm, but why include a message about it? I think we
should treat this step like all the others and provide a button to take
the user to the next page.
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Eden Bacani [Wed, 20 Jan 2021 02:12:11 +0000 (02:12 +0000)]
Bug 27473: Improved link text in installer
Test Plan
1. run reset_all to run koha installer
2. Check that after importing sample data step that link says 'Continue
to the next stage'
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Martin Renvoize [Mon, 22 Feb 2021 12:15:44 +0000 (12:15 +0000)]
Bug 26618: (QA follow-up) Fix unit test for TranferCollection change
We update TransferCollection to use the settled upon standard for
passing error messages back from a method. This patch updates the
corresponding unit test.
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Martin Renvoize [Thu, 18 Feb 2021 15:25:42 +0000 (15:25 +0000)]
Bug 26618: (QA follow-up) Update messages syntax
As highlighted, we were not using the standard form of message passing
here. This patch updates the template and controller to adopt the more
usual syntax.
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Martin Renvoize [Fri, 18 Dec 2020 16:37:29 +0000 (16:37 +0000)]
Bug 26618: Remove use of transferbook in RotatingCollections
This patch replaces the use of C4::Circulation::transferbook in
C4::RotatingCollections with calls to Koha::Item->request_transfer and
adds handling for the various failure cases which that can throw.
We also introduce additional feedback for the end user where it did not
exist before. Now we notify the user if some of the collection could not
be transfers or if transfers were queued rather than set to request
immediately.
Test plan
1/ Set up a rotating collection
2/ Transfer the collection
3/ Confirm the action succeeds
4/ Set up some branch transfer limits that will affect items in your
collection
5/ Transfer the collection
6/ Note that the transfer succeeds but some items are returned as
failures
Martin Renvoize [Thu, 18 Feb 2021 14:45:38 +0000 (14:45 +0000)]
Bug 24446: (QA follow-up) Use 'receive' method in ModReserveAffect
ModeReserveAffect was setting all transfers in the queue to received by
looping through a resultset. This patch updates the logic to try and
catch the in_transit transfer and receive just that one instead.
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Martin Renvoize [Thu, 18 Feb 2021 10:54:34 +0000 (10:54 +0000)]
Bug 24446: (QA follow-up) Remove superflous store calls
The original code here called store after setting each field. Instead,
we set all the fields and call store at the end and save ourselves a few
database hits.
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Martin Renvoize [Thu, 18 Feb 2021 08:43:25 +0000 (08:43 +0000)]
Bug 24446: (QA follow-up) SIP test fix for bug 27166
A new test was introduced in bug 27166 since this code was written, this
patch simply updates the test for the additional 'TransferTrigger'
message that is returned by this patchset.
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Martin Renvoize [Thu, 18 Feb 2021 08:42:48 +0000 (08:42 +0000)]
Bug 24446: (QA follow-up) Set TransferTrigger to 'Reserve' for bug 24298
The SIP initiated transfer was set to use the 'TransferTrigger' passed
back from AddReturn; However, TransferTrigger is not set for reserves in
AddReturn (It's is set controller side by circ/returns.pl). We thus need
to also hard code the trigger type in the SIP transaction for reserves.
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Martin Renvoize [Fri, 22 Jan 2021 11:11:53 +0000 (11:11 +0000)]
Bug 24446: (QA follow-up) Correction to datecancelled for ModItemTransfer
ModItemTransfer always replaces any existing transfers, including those
in transit.. so we needed to add a 'force' option to
Koha::Item::Transfer->cancel();
Martin Renvoize [Fri, 18 Dec 2020 16:29:32 +0000 (16:29 +0000)]
Bug 24446: Update ModItemTransfer for daterequested/datecancelled
C4::Items::ModItemTransfer is used throughout the codebase and currently
it will never set the daterequested or datecancelled fields. With the
modifications to how circulation deals with transfers we need to update
this function to set those fields appropriately. Functionality has been
retained, ModItemTransfer will continue to add a transfer regardless of
limits or current transits existing.
Martin Renvoize [Wed, 7 Oct 2020 07:21:16 +0000 (08:21 +0100)]
Bug 24446: Add datesent/datecancelled handling to GetTransfersFromTo
With the first uses of Koha::Item->request_transfer and
Koha::Item::Transfer->cancel having been added, we need to update
GetTransferFromTo to respect transfers that have been requested but
not yet sent and not cancelled.
Test plan
1/ Run the included unit test
2/ Confirm the "Transfers to recieve" page loads
3/ Signoff
Martin Renvoize [Fri, 18 Dec 2020 16:36:51 +0000 (16:36 +0000)]
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
Martin Renvoize [Thu, 8 Oct 2020 08:02:50 +0000 (09:02 +0100)]
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
Martin Renvoize [Fri, 17 Jan 2020 13:58:12 +0000 (13:58 +0000)]
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.
Martin Renvoize [Tue, 24 Mar 2020 07:46:10 +0000 (07:46 +0000)]
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
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.
Martin Renvoize [Fri, 18 Dec 2020 16:36:07 +0000 (16:36 +0000)]
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
Martin Renvoize [Fri, 18 Sep 2020 13:56:23 +0000 (14:56 +0100)]
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>
Martin Renvoize [Fri, 18 Sep 2020 11:14:25 +0000 (12:14 +0100)]
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>
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>
Owen Leonard [Tue, 16 Feb 2021 13:27:34 +0000 (13:27 +0000)]
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>
Nick Clemens [Fri, 26 Feb 2021 14:28:42 +0000 (14:28 +0000)]
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>
Nick Clemens [Fri, 26 Feb 2021 14:28:16 +0000 (14:28 +0000)]
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>
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>
Jonathan Druart [Tue, 2 Mar 2021 15:08:51 +0000 (16:08 +0100)]
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>
Aleisha Amohia [Tue, 2 Mar 2021 01:40:49 +0000 (14:40 +1300)]
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>
Martin Renvoize [Tue, 2 Mar 2021 08:56:14 +0000 (08:56 +0000)]
Bug 27680: (QA follow-up) Update test for dbic_merge_sorting
The order_by handling will now always return an arrayref of ordering
hashrefs even when only one ordering hash is present. This is
interpreted by dbic as equivilent so I just update the test to pass
here.
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
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>
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>
Kyle M Hall [Fri, 26 Feb 2021 14:56:07 +0000 (09:56 -0500)]
Bug 27808: Mark the onloan column as dirty in AddIssue
If any item is currently checked out to a patron, and the item is then checked out directly to another patron without manually checking the item in first, the items.onloan column will remain NULL.
This will only happen if the new checkout will be due the same day as the previous checked.
This is caused by the item being returned without updating the item object from storage afterward. Even though AddIssue will call AddReturn which sets the value of onloan to NULL in the database, we are not passing in the item object by reference, so it's onloan value remains set to a date. Then we set the onloan value to the same date. Because the value does not change in the object, the column does not get marked dirty.
We could update the object from storage first, but it seems more efficient to mark the column as dirty manually to avoid that otherwise unnecessary fetch.
Test Plan:
1) Apply these patches
2) prove t/db_dependent/Circulation.t
Signed-off-by: Lisette Scheer <lisettes@latahlibrary.org> Signed-off-by: Marti Fuerst <mfuerst@hmcpl.org> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Owen Leonard [Thu, 25 Feb 2021 14:03:43 +0000 (14:03 +0000)]
Bug 27794: Add link to biblio in lateorders page
This patch modifies the late orders page so that the late order title
uses the "biblio-title" include to display a standard title with a link
to the bibliographic detail page.
To test, apply the patch and go to Acquisitions -> Late orders.
In the table of late orders, confirm that the title display correctly
and links to the correct bibliographic record.
Signed-off-by: Severine QUEUNE <severine.queune@bulac.fr> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Martin Renvoize [Thu, 25 Feb 2021 13:55:15 +0000 (13:55 +0000)]
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>
Owen Leonard [Thu, 25 Feb 2021 12:15:02 +0000 (12:15 +0000)]
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>
Owen Leonard [Tue, 2 Feb 2021 12:54:39 +0000 (12:54 +0000)]
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>
Owen Leonard [Fri, 19 Jun 2020 11:24:00 +0000 (11:24 +0000)]
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>
Bug 26591: SIP option prevcheckout_block_checkout to block checkout of previously checked-out documents
This patchs adds a new SIP option to block checkout of previously
checked-out documents: prevcheckout_block_checkout
See the CheckPrevCheckout system preference to enable previously
checked-out verification in Koha.
Test plan:
1) Apply this patch
2) Enable the CheckPrevCheckout syspref (on "Do" for instance)
3) Enable prevcheckout_block_checkout in the SIP server config file
4) Checkout and checkin an item for a user
5) Checkout the item again with the SIP CLI tool
6) Check that the SIP message is "This item was previously checked out by you"
and that the item was not checked out
7) Disable prevcheckout_block_checkout in the SIP server config file
8) Checkout the item again with the SIP CLI tool
9) Check that the SIP message is "This item was previously checked out by you"
and that the item was checked out.
10) Prove t/db_dependent/SIP/Message.t
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>
Jonathan Druart [Thu, 10 Dec 2020 09:51:02 +0000 (10:51 +0100)]
Bug 8976: DBIC schema changes
Sponsored-by: Orex Digital Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Wed, 9 Dec 2020 17:51:56 +0000 (18:51 +0100)]
Bug 8976: Code cleaning
It was tricky to write the previous patch so I decided to clean the
ground (a bit) for later, taking advantage of having people who are
going to test the whole area.
We can move it to its own bug report if QA wants to.
Sponsored-by: Orex Digital Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Wed, 9 Dec 2020 17:56:06 +0000 (18:56 +0100)]
Bug 8976: Add Koha::AuthSubfieldStructure[s]
Sponsored-by: Orex Digital Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Wed, 9 Dec 2020 17:06:18 +0000 (18:06 +0100)]
Bug 8976: Change for the item forms
Sponsored-by: Orex Digital Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Wed, 9 Dec 2020 16:07:36 +0000 (17:07 +0100)]
Bug 8976: Sort subfields for authority records
Same patch for the authority frameworks/records
Sponsored-by: Orex Digital Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Tue, 1 Dec 2020 17:08:20 +0000 (18:08 +0100)]
Bug 8976: Add the ability to sort subfields for the MARC frameworks
This new enhancement adds the ability to change the default order the subfields.
Both bibliographic and authority MARC subfield structure are taken into
account. And so the item edition as well (in the different screens when
item can be added/edited).
This will answer the following needs that have been listed in the
comments of the bug report:
- $i in 7xx fields should be the first subfield in the sequence
- 300 fields are sorted number first when cataloguers enter the letter fields first
- 100 field, it's commonly $a, $q, $d.
Test plan:
1. Edit a MARC frameworks, field 300
2. Resort the subfield (drag and drop the tab of the subfield) as you
like
3. Save
=> Notice that the list of fields are displayed following the order you
chose
4. Edit it again
=> The order is correctly kept!
5. Create a new bibliographic record
6. Notice that the subfields are order in the same sequence
7. Fill different subfields, not all
8. Save, edit again
9. Note that the subfields that have been filled are listed first, then
the empty ones. But the sequence defined at the framework level is kept.
10. Do the same for an authority framework and create/edit an authority
record
11. Modify item (952) subfields order
12. Create an item and confirm that the order is correct
13. Modify the ACQ framework, 952, modify the order of the subfield
14. Create a new order and confirm that the item form has the subfield
ordered following the sequence defined at the framework level
QA: Note that this patch is about bibliographic records only, next
patches deal with authotiries and items.
Sponsored-by: Orex Digital Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Sponsored-by: Orex Digital Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Nick Clemens [Thu, 7 Jan 2021 20:14:33 +0000 (20:14 +0000)]
Bug 27316: Convert 'undef' for sort to Yes and use Yes/No instead of 0/1
This patch changes the interface to remove the undef option
We also update existing mappings and set default of 1
Comment previously indicated undef was treated differently, but in the code we treat undef as 1
That code is untoched to avoid creating problems for older mappings that may be reloaded
To test:
1 - View the ES mappings, note you can set columns to Undef, 0, 1
2 - Set some to undef
3 - Apply patches
4 - Update database
5 - Undef now show as 'Yes'
6 - Confirm you can set columns as Yes/no
7 - Confirm that mandatory columns display correct value when readonly (see issues field)
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>
While not that common nowadays, it is the syntax PHP uses, and
DataTables also generates such thing in 'traditional' mode. We should
support it as well.
This patch adds support for that. It does so by adding _order_by[] to
the reserved param names, and proper handling on the dbic_merge_sorting
helper.
To test:
1. Apply this patch
2. Run:
$ kshell
k$ prove t/db_dependent/Koha/REST/Plugin/Objects.t
=> SUCCESS: Tests pass!
3- Sign off :-D
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Bug 27680: (QA follow-up) Minor perlcritic issue
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Martin Renvoize [Fri, 12 Feb 2021 19:25:10 +0000 (19:25 +0000)]
Bug 27680: Allow traditional multi-params to work
This patch allows the preceeding test to pass. Strictly, we want a comma
delimited string for our _order_by parameter, but we cannot easily block
a traditional multi-passed parameter. As such the 'nice' thing to do is
handle it when such a thing is passed as it will pass through validation
regardless.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Martin Renvoize [Fri, 12 Feb 2021 14:05:13 +0000 (14:05 +0000)]
Bug 27680: Add tests for various ways of passing multi-params
This patch adds unit test to increase the coverage of parameter that
accept multiple values. There are a number of different ways end users
can send such parameters and we should test to ensure we are recieving
the correct option.
Options
`?param1=this¶m1=that` - traditional multiple pass params
`?param1[]=this¶m1[]=that` - php multiple pass params
`?param1=this,that` - comma delimited list param
`?param1=this|that` - pipe delimited list param
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Martin Renvoize [Fri, 12 Feb 2021 13:14:16 +0000 (13:14 +0000)]
Bug 27680: Add support for sorting fields with multiple data points
This patch adds proper handling for sorting a single column that is
constructed of multiple data entities.. i.e `"data": "string1:string2"`
It does NOT add support for filtering on multiple columns yet.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Fri, 12 Feb 2021 09:53:27 +0000 (10:53 +0100)]
Bug 27680: Take first order column for ordering
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Owen Leonard [Mon, 22 Feb 2021 17:51:16 +0000 (17:51 +0000)]
Bug 27754: Correct eslint errors in basket.js
This patch makes minor changes to basket.js in the staff interface
templates in order to quiet warnings from ESLint. Besides whitespace,
most changes are to correct undeclared or unnecessarily declared
variables.
To test, apply the patch and verify that the cart still works
correctly.
- Perform a catalog search in the staff interface.
- Test adding single or multiple items to the cart from the search
results page.
- Testing adding and removing titles to the cart from the bibliographic
detail page.
- Open the cart and test the various controls in the toolbar to confirm
that they still work correctly.
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Nick Clemens [Fri, 29 Jan 2021 13:47:22 +0000 (13:47 +0000)]
Bug 27578: Initialize searchid as blank when not populated
This patch simply sets the searchid to a blank string if not passed in
To test:
1 - Add a new biblio and save it
2 - Check the logs: /var/log/koha/kohadev/plack-intranet-error.log (or similar)
3 - Note warn about uninitialized value
4 - Apply patch
5 - Add a new biblio
6 - No warn
Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
David Cook [Wed, 17 Jun 2020 04:34:02 +0000 (04:34 +0000)]
Bug 25777: Disable misleading datatables table information display z3950
This patch disables the table information display on z3950_search.pl,
since it only includes search result counts for that page, which is
misleading to end users.
To test:
1) Do not apply the patch
2) Do a Z39.50 search from cataloguing for "test" against Library of
Congress.
3) Note the bottom of the page says "Show 1 to 20 of 20" and
"Showing page 1 of 501"
4) Do a Z39.50 search from Acquisitions for "test" against Library of
Congress (Acquisitions -> Vendor -> Basket -> Add to basket -> From
external source).
5) Apply the patch and restart Plack
6) Repeat Step #2
7) Note the bottom of the page now only says "Showing page 1 of 501"
8) Note the search bar is gone
9) Repeat step #4
10) Note the bottom of the page now only says "Showing page 1 of 501"
11) Note the search bar is gone
Squashed and mixed authorship added below Co-authored-by: Owen Leonard <oleonard@myacpl.org> Co-authored-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: David Cook <dcook@prosentient.com.au> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>