Owen Leonard [Mon, 15 Mar 2021 17:06:16 +0000 (17:06 +0000)]
Bug 27816: "Click to edit" in Point of sale is untranslatable
This patch adds an option to the Point of sale jEditable configuration
to explicitly set the title attribute to "Click to edit." This will
allow the string to be picked up for translation.
To test, apply the patch and test that the correct string is
translated. In this example I'm testing fr-FR:
- Update a translation:
> cd misc/translator
> perl translate update fr-FR
The "Click to edit" string should already have been translated, so
it's not necessary to update the .po file.
- Install the updated translation:
> perl translate install fr-FR
In the staff interface, switch to the language you're testing and open
the point of sale page. Add some items for purchase. They should appear
in the "This sale" table. Hover your mouse over the values in the "Coût"
and "Quantité" columns. You should see the translated string, "Cliquer
pour modifier."
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Martin Renvoize [Tue, 16 Mar 2021 16:39:13 +0000 (16:39 +0000)]
Bug 27967: Add min attribute to borraccount modals
This patch adds a min attribute to the form fields of the borrower
account page modals to prevent negative values being entered
inappropriately.
Test plan
1/ Trigger the refund modal from the borrower account page.
2/ Attempt to enter a negative value for the amount to refund and note
with the patch applied you face a validation error (without the patch,
upon submission of a negative value you will be faced with a server side
error)
3/ Trigger the discount modal from the borrower account page.
4/ Attempt to enter a negative value for the amount to discount and note
with the patch applied you face a validation error (without the patch,
upon submission of a negative value you will be faced with a server side
error)
5/ Signoff
Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Jonathan Druart [Wed, 17 Mar 2021 09:14:43 +0000 (10:14 +0100)]
Bug 27933: Fix patron search result ordering
On bug 27715 we restrict the order by dt params for security reasons.
However in some cases the param passed is "columnname" instead of
"table.columnname".
We should make sure the table is part of the sort fieldname.
Test plan:
Do a "normal" patron search (from the patrons home page) and another
patron search (guarantor for instance).
Sort by cardnumber, date of birth, expiration date, asc, desc and
confirm it works as expected.
Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This patch:
- Updates lanugage to be clearer 'ChargeFinesOnClosedDays' vs 'ChargeFinesOnCloseDay'
- Removes a stary warn
- Add an 'updated' counter and provides feedback in fines.pl
Test plan:
0 - Apply patches, updatedatabase
1 - set finesCalendar to 'ignore', ChargeFinesOnClosedDays to "Don't charge"
2 - Checkout an item due yesterday
3 - Ensure circ rules have a fine amount and interval set
4 - Make today a holiday
5 - perl misc/cronjobs/fines.pl -v
6 - 0 updated
7 - ChargeFinesOnClosedDays to "Charge"
8 - perl misc/cronjobs/fines.pl -v
9 - 1 updated
10 - set fines calendar to 'use'
11 - perl misc/cronjobs/fines.pl -v
12 - 1 updated (NOTE: This is wrong maybe, but handle on another bug)
13 - set ChargeFinesOnClosedDays to "Don't charge"
14 - perl misc/cronjobs/fines.pl -v
12 - 0 updated
Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
To test:
1- go to /cgi-bin/koha/circ/returns.pl, click Checkin settings to show options
2- it says "Remember due date ..."
3- apply patch, reload
4- it says "Remember return date ..."
Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
When the ILL notices were added, a bad rebase got rid of the notice
description in both messaging-preference-form.inc and opac-messaging.tt
This patch restores that line:
1. Set AutoRenewalNotices to 'according to patron...'
2. Edit a patron category
=> FAIL: There's an 'Unknown' label for 'Auto renewal'
3. Look at a patron's messaging preferences
=> FAIL: There's an 'Unknown' label for 'Auto renewal'
4. Look at a patron's messaging preferences in OPAC
=> FAIL: There's an 'Unknown' label for 'Auto renewal'
5. Apply this patch
6. Repeat 2, 3, 4
=> SUCCESS: 'Auto renewal' is displayed as expected
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Agustin Moyano [Thu, 10 Dec 2020 19:27:45 +0000 (16:27 -0300)]
Bug 18532: (follow-up) Fix notice message, add notice to all installer languages and fix preference message
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Nick Clemens [Thu, 14 May 2020 13:21:22 +0000 (13:21 +0000)]
Bug 18532: Add individual issues to digest notice and hide auto_renewals messaging preference when not needed
This patch enhances auto_renewals message, removes auto_renewals messaging preference when AutoRenewalNotices is not set to ‘preferences’ and uses that preference to send notices in automatic_renewals.pl script.
To test:
1. Apply patches
2. updatedatabase
3. make sure automatic renewals are allowed in circ rules, have a positive number of allowed renewals and a positive number for renewal period
4. Check AutoRenewalNotices preference
SUCCESS => AutoRenewalNotices has the value ‘cron’ (means that It keeps the usual behaviour)
5. Checkout two items for a patron, and set them as automatic renewal and set due date as your current yesterday
6. perl misc/cronjobs/automatic_renewals.pl -c -v
SUCCESS => items were renewed, but there is no message in message_queue table in mysql
7. Repeat step 5
8. perl misc/cronjobs/automatic_renewals.pl -c -s -v
SUCCESS => items were renewed, and there is one message per item in message_queue table in mysql
9. Change AutoRenewalNotices to ‘never’
10. Repeat step 5
11. perl misc/cronjobs/automatic_renewals.pl -c -s -v
SUCCESS => items were renewed, but there is no message in message_queue table in mysql, even with the -s switch
12. Check any patron’s category, and any detail page in staff or OPAC interface, and in any of them you should find Auto Renewals messaging preference
13. Change AutoRenewalNotices to ‘preferences’
14. Repeat step 12, but this time all of them shows the Auto Renewals messaging preference.
15. Repeat step 5 with a patron that has no messaging preference setted
16. perl misc/cronjobs/automatic_renewals.pl -c -s -v
SUCCESS => items were renewed, but there is no message in message_queue table in mysql, because patron didn’t choose to receive messages
17. Grab a category and modify auto renewals messaging preferences, and save
18. Create a new patron from that category.
SUCCESS => created patron has the same messaging preference for auto renewals
19. Grab that patron and change auto renewals messaging preference to email but not digest
20. Repeat step 5 for that last patron.
21. perl misc/cronjobs/automatic_renewals.pl -c -v
SUCCESS => Items were renewed, and there is a message for each item in message_queue table in mysql.
22. Change auto renewals messaging preference from the same patron and set to email and digest.
23. Repeat step 5.
24. perl misc/cronjobs/automatic_renewals.pl -c -v
SUCCESS => items where renewed, and now there is only one message in message_queue table with the details of both renewed items.
25. Check that any changes to a patron’s auto renewals messaging preference in staff is reflected in OPAC, and the other way arround too.
26. Sign off
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Nick Clemens [Thu, 14 May 2020 12:53:30 +0000 (12:53 +0000)]
Bug 18532: (follow-up) Remove digest switch and add preference
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Agustin Moyano [Tue, 29 Oct 2019 18:27:38 +0000 (15:27 -0300)]
Bug 18532: set auto_renewals as patron messaging preference
This patch adds the "Auto renewals" messaging preference on intranet and OPAC, and adds digest feature to misc/cronjobs/automatic_renewals.pl script.
(Deprecated test plan. Please check the last patch)
To test:
1. apply patches
2. perl installer/data/mysql/updatedatabase.pl
3. make sure automatic renewals are allowed in circ rules, have a positive number of allowed renewals and a positive number for renewal period
4. go to patron categories in administration of staff interface and choose a category.
CHECK => in "Default messaging preferences for this patron category" has a "Auto renewals" row and has email and digest options checked
5. grab a patron and go to details page
CHECK => patron's messaging preferences has a "Auto renewals" row with email and digest options checked
6. some settings and save
7. go to opac with that same patron to "your messaging" option
CHECK => patron's messaging preferences has a "Auto renewals" row, and displays changes made in staff interface.
8. uncheck email and digest from "Auto renewals" row and save
9. check out an item for that patron, and set it as automatic renewal and set due date as your current yesterday
10. perl misc/cronjobs/automatic_renewals.pl -c --send-notices -v
SUCCESS => item was renewed, and in message_queue table there is no new message for the patron
11. update patrons messaging preferences and set email option of "Auto renewals" row as checked
12. repeat steps 9 and 10
SUCCESS => item was renewed, but in message_queue table there is a new message of type AUTO_RENEWALS
13. update patrons messaging preferences and set email and digest options of "Auto renewals" row as checked
14. repeat steps 9 and 10
CHECK => item was not renewed
15. run step 10 again, but add -d flag, like this:
perl misc/cronjobs/automatic_renewals.pl -c --send-notices -v -d
SUCCESS => item was renewed, and in message_queue table there is a new message of type AUTO_RENEWALS_DGST
16. Sign off
Signed-off-by: tgoat <tgoatley@gmail.com> Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com> Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com> Signed-off-by: Marti Fuerst <mfuerst@hmcpl.org> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Add a patron holds controller for the REST api and impliment the #list
methods.
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Addd unit tests for the new patrons/{patron_id}/holds api route.
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Add /api/v1/patrons/{patron_id}/holds route and holds object description
to the OpenAPI specification.
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Martin Renvoize [Thu, 28 Jan 2021 09:08:24 +0000 (09:08 +0000)]
Bug 26272: Add ajax driven cashup modal to library page
This patch adds an ajax driven cashup summary modal to the library
registers summary page.
Test plan
1/ Enable UseCashRegisters in the system preferences
2/ Add at least one cash register to your library
3/ Make some payments of various types (Cash, Card) against the cash
register
4/ View the register transactions details page
5/ Make a refund against a payment
6/ Cashup
7/ View the cashup summary by clicking on the 'Summary' link on the
register page.
8/ Navigate to the 'libraries' summary page
9/ View the cashup summary by clicking on the 'Summary' link in the
registers table.
10/ Signoff
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>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Bug 26633: (QA follow-up) Tests on error condition
This patch highlights a problem with the try/catch conditions in the
ad() controlled method. Tests are added, and the controller is fixed to
reflect the right behaviour.
To test:
1. Apply this patch
2. Run:
$ kshell
k$ prove t/db_dependent/api/v1/transfer_limits.t
=> SUCCESS: Tests pass! 409 is returned as appropriate!
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Kyle M Hall [Tue, 27 Oct 2020 18:01:47 +0000 (14:01 -0400)]
Bug 26633: (QA follow-up) Action buttons should not remain grayed out if the same action is used multiple times in a row
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Katrin Fischer [Fri, 23 Oct 2020 00:51:34 +0000 (00:51 +0000)]
Bug 26633: (QA follow-up) Change label to "collection" as we display the description
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Katrin Fischer [Sun, 25 Oct 2020 00:54:54 +0000 (02:54 +0200)]
Bug 26633: Fix indirect object notation
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Kyle M Hall [Thu, 8 Oct 2020 15:15:44 +0000 (11:15 -0400)]
Bug 26633: Add advanced editor for transfer limits
The current transfer limits editor works great for Koha instances with
small numbers of branches. However, for consortiums with dozens or even
hundreds of libraries, the editor does not work well or effectively.
We should provide an "advanced" editor displays all to/from library
combinations in a grid and allows them to be edited in a manner somewhat
similar to the transport cost matrix editor.
Test Plan:
1) Apply this patch
2) Browse to the transfer limits editor
3) Click the new "Switch to advanced editor" link
4) Select a collection code/item type to edit limits for
5) Test the "Check all" function
6) Test the "Uncheck all" function
7) Test the "Check" column function
8) Test the "Uncheck" column function
9) Test the "Check" row function
10) Test the "Uncheck" row function
11) Test individual checkboxes/table cells
Signed-off-by: Lisette Scheer <lisettes@latahlibrary.org> Signed-off-by: Lisette Scheer <lisettes@latahlibrary.org> Signed-off-by: Lisette Scheer <lisettes@latahlibrary.org> Signed-off-by: Lisette Scheer <lisettes@latahlibrary.org> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Martin Renvoize [Fri, 19 Feb 2021 10:12:32 +0000 (10:12 +0000)]
Bug 27716: Update permissions for patroncards creator
The various subpages of the label creator tool we're under the
'catalogue' permission. There is however a 'label_creator' subpermission
of tools which is more appropriate.
Test plan
1/ Setup a user with just the 'catelogue' permission (to enable logging
into the staff interface)
2/ With the patch applied you should not be able to access the following
pages (either via navigation in the UI or by typing them into the
browser address bar directly)
- /patroncards/add_user_search.pl
- /patroncards/edit-batch.pl
- /patroncards/edit-layout.pl
- /patroncards/edit-profile.pl
- /patroncards/edit-template.pl
- /patroncards/home.pl
- /patroncards/image-manage.pl
- /patroncards/manage.pl
- /patroncards/print.pl
3/ Signoff
Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Fri, 5 Mar 2021 09:14:08 +0000 (10:14 +0100)]
Bug 27860: Fix password recovery
Same as the previous patch but for the password recovery feature.
Test plan:
1. Do not apply the patches
2. Set KohaAdminEmailAddress to an invalid email (root@localhost for
instance)
3. Use the password recovery feature
5. Boom (that must be fixed on a separate bug report)
6. Set KohaAdminEmailAddress to a valid email (root@example.org)
7. Use again the password recovery for a different user
8. Still Boom! (because it's processing the first invalid email)
9. Apply the patches, restart_all
10. Try again the password recovery
=> The email is sent!
Notice the change in DB, the first email is still there with status
"pending" and second email is sent!
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Fri, 5 Mar 2021 09:04:14 +0000 (10:04 +0100)]
Bug 27860: Fix self-registration if messages with incorrect email are inqueued
If the pref KohaAdminEmailAddress was not set correctly (invalid email)
and has been used to generate message, the message_queue table can contain
some messages that are not sent (pending) and will be processed each
time a new self-reg is done.
The PatronSelfRegistrationVerifyByEmail feature must send only the
notice we just generated, not the whole pending queue.
Test plan:
1. Do not apply the patches
2. Set KohaAdminEmailAddress to an invalid email (root@localhost for
instance)
3. Turn on PatronSelfRegistrationVerifyByEmail
4. Self-reg a patron
5. Boom (that must be fixed on a separate bug report)
6. Set KohaAdminEmailAddress to a valid email (root@example.org)
7. Self-reg a patron
8. Still Boom! (because it's processing the first invalid email)
9. Apply the patches, restart_all
10. Self-reg a patron
=> The email is sent!
Notice the change in DB, the first email is still there with status
"pending" and second email is sent!
QA: at step 10. TODO first email must be 'failed' (highlight in tests) Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Fri, 5 Mar 2021 09:01:30 +0000 (10:01 +0100)]
Bug 27860: Add message_id param to SendQueuedMessages
We could use C4::Letter::GetMessage, but the query in
_get_unsent_messages join on borrowers and return the branchcode.
To prevent any regressions it's preferable to not modify
SendQueuedMessages.
Ideally we obviously need a Koha methods to have better and clean code..
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Wed, 3 Feb 2021 09:33:35 +0000 (10:33 +0100)]
Bug 27597: Remove leading colon in ES query
If we are searching on kw there is a leading colon at the beginning of
the generated query:
kw:foo becomes :foo
Note that it only happens when there is no other terms before.
Test plan:
0. Don't apply the patch
1. Search for kw:foo
2. Notice the error
Error: Unable to perform your search. Please try again.
and the logs say
Failed to parse query [(:foo*)]
3. Apply the patch
4. Repeat the search and notice that you know get:
"12 result(s) found for 'kw:foo'."
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>
Phil Ringnalda [Tue, 9 Mar 2021 03:33:06 +0000 (19:33 -0800)]
Bug 27737: (follow-up) Minimal CSS changes to avoid regressions
To keep the specificity of the rules we want to have apply to both the
biblio editor and also the authorities editor, we need to add the ID for
the authorities editor, rather than remove the ID for the biblio editor.
Also, the removal of the selectors for #authoritiestabs descendents was
regressing the display of authority record details, which is where that
plural authoritiestabs element lives.
Test plan:
1. With neither patch from this bug applied, Cataloging - New record -
Default framework.
2. Shrink and widen your browser window, noticing how the input fields
flex to remain the full width, keeping the controls to duplicate and
delete a subfield out directly to the right of the input.
3. Authorities - search for Perl (or any term that will match a record),
click the linked authority term to open the Authority detail display
4. Note how the field number, field description, and subfield descriptions
are all different colors, and subfield codes are on the same line as
the subfield contents.
5. Apply both patches from this bug.
6. Cataloging - New record - Default framework
7. Verify that the input fields still behave the same as you widen and
shrink your browser window
8. Authorities - New authority - Chronological Term
9. Verify that the input fields now behave like the ones in the biblio
editor, shrinking and widening to fill the width of the page, keeping
the controls to duplicate and delete subfields immediately to the
right of the field
10. Authorities - search for Perl, click the linked authority term to open
the Authority detail display
11. Verify that the tag number, field description and subfield descriptions
are still properly colored and subfield codes are still on the same
line as the subfield contents.
Signed-off-by: David Nind <david@davidnind.com>
Trivial fixup for a copy-paste failure, missed the y on
subfield_loop_mandator
Signed-off-by: Petro Vashchuk <stalkernoid@gmail.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Owen Leonard [Tue, 2 Mar 2021 17:44:35 +0000 (17:44 +0000)]
Bug 27737: Tag editor for authority lookup broken in authority editor
This patch changes the markup structure for the authorities
editor so that it better matches that of the basic bibliographic
record editor. This allows the authority-linking JavaScript to
correctly target fields on both pages.
To test, apply the patch and go to Authorities in the staff client.
- Create or edit an authority record.
- Switch to tab 5 and if necessary click one of the tag names (e.g.
"SEE ALSO FROM TRACING--PERSONAL NAME") to expand the subfields.
- Click the "..." plugin link next to subfield a ("Personal name" in
this example).
- In the popup window, search for an authority record.
- Click "Choose" next to one of the results.
- The popup window should close and the authority editor should contain
data from the record you chose, including a value in $9 and $a.
- Test with various records to confirm that data in other fields is
copied correctly, for instanct $d, dates associated with a name, $t
title of a work.
- Test other JavaScript-driven interactions in the editor:
- Duplicate repeatable tag
- Remove repeatable tag
- Empty tag
- Reorder sortable tags (e.g. multiple 500 tags)
- Reorder sortable subfields
- Duplicate repeatable subfield
- Remove repeatable subfield
- Empty repeatable subfield
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
https://bugs.koha-community.org/show_bug.cgi?id=22737
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Fridolin Somers [Mon, 1 Mar 2021 10:40:56 +0000 (11:40 +0100)]
Bug 27820: add all missing use in misc/cronjobs/plugins_nightly.pl
Koha::Plugins and C4::Context where missing.
Try::Tiny was missing for try/catch.
Test plan :
1) Use a plugin using hook 'cronjob_nightly'
2) Run script : misc/cronjobs/plugins_nightly.pl
Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Samir Shah [Mon, 1 Mar 2021 07:49:03 +0000 (10:49 +0300)]
Bug 27820: fix missing import in plugins_nightly.pl
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Martin Renvoize [Thu, 11 Feb 2021 10:19:57 +0000 (10:19 +0000)]
Bug 26273: (follow-up) Add 'Cashier' to the cashups table
This patch adds the 'Cashier' field as discussed on the bug report.
Test plan
1/ Apply patch and reload the register page to refresh the table
2/ Note that a 'Cashier' field now appears in the table
3/ Sorting and searching on 'Cashier' should work as expected
4/ Default sorting should remain as 'Date' order.
5/ Signoff
Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Bug 26273: (QA follow-up) Check for null firstname
This patch adds a test for firstname being defined before constructing
fullname from it.
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Martin Renvoize [Wed, 10 Feb 2021 17:31:56 +0000 (17:31 +0000)]
Bug 26273: (follow-up) Format dates and money correctly.
This patch adds the missing formatting for the Datetime and Amount
fields.
Test plan
1/ Apply patch and reload register page to re-display the cashups table
2/ Note that the 'Date' field now displays a nicely formatted date
without an offset.
3/ Note that the 'Amount' field now displays the number according to
your money formatting preferences (with 2 decimal places in most cases)
4/ Signoff
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>
Martin Renvoize [Mon, 1 Feb 2021 14:50:02 +0000 (14:50 +0000)]
Bug 26273: Add historic cashups table to register page
This patch adds a historic cashups table to the bottom of the register
transaction details page. It will only display if one or more cashups
have taken place and contains links to allow display of the summary
detail modal for each cashup.
Test plan
1/ Enable UseCashRegisters
2/ Undertake a few transactions and cashups
3/ View the 'Register details' page
4/ Note the appearance of a 'Cashup history' section at the bottom of
the page
5/ Note that 'Summary' button displays the relevant modal
6/ Signoff
Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk> Signed-off-by: Daniel Jones <daniel.jones@cheshiresharedservices.gov.uk> Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Bug 26273: (QA follow-up) Remove unrequired table_controls div
Looks like a copy/paste issue.. I don't believe we need this div at all
for the table to function as expected and adding it just creates uneeded
whitespace.
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Bug 26273: (QA follow-up) Add horizontal rule to distinguish tables
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Martin Renvoize [Fri, 18 Dec 2020 16:37:44 +0000 (16:37 +0000)]
Bug 22569: Add a 'Transfers to send' report
This patch adds a 'Transfers to send' report to the circulation page
which displays items which have been triggered for transfer but not
marked as sent.
Test plan
1) Setup a rotation plan and add some items to it as per the
manual
2) Run the stockrotation cronjob with the --execute flag
3) Check that the expected items appear in the new 'Transfers to send'
page.
4) Confirm that items marked with 'StockRotationAdvance' provide the
option to mark the item as 'In demand' (Which will cancel the
transfer and mark the item as in demand such that it will wait at the
current branch for an additional stage period before being
automatically picke for transfer again)
5) Setup a rotating collection
6) Trigger a collection transfer for the above collection
7) Check that the expected items appear in the new 'Transfers to send'
page'.
Kyle M Hall [Thu, 12 Jul 2012 11:07:07 +0000 (07:07 -0400)]
Bug 8426: Diacritics not being mapped for searching
Add mappings for ︡a to a, and for t︠ to t.
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>
Jonathan Druart [Tue, 2 Mar 2021 11:22:27 +0000 (12:22 +0100)]
Bug 27813: Restore default order on suggestion list view
Prior to 20.05, suggestions on /cgi-bin/koha/suggestion/suggestion.pl sorted by
suggesteddate by default. On 20.05 and later, they're sorting by title instead.
We should go back to the previous behavior.
Test plan:
Create some suggestions
Edit the suggestions.suggesteddate in the DB
List the suggestions and confirm that there are sorted by oldest first
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Owen Leonard [Mon, 1 Mar 2021 12:24:41 +0000 (12:24 +0000)]
Bug 27815: "Remove" in point of sale untranslatable
This patch modifies the Point of Sale template so that the "Remove"
button can be translated. The string in the JavaScript block wasn't
wrapped in the correct function.
To test, apply the patch and test that the correct strings are
translatable. In this example I'm testing fr-FR:
- Update a translation:
> cd misc/translator
> perl translate update fr-FR
- Open the corresponding .po file for the strings pulled from
the template: e.g. misc/translator/po/fr-FR-staff-prog.po
- Locate strings pulled from pos/pay.tt for translation to confirm the
update, e.g.:
- In the staff client, go to Point of Sale.
- Switch to the French translation and click the "Ajouter" button next
to one of the items for purchase.
- In the "This sale" table, the item you added should have a
corresponding "Enlever" button.
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>
Aleisha Amohia [Fri, 18 Dec 2020 01:55:48 +0000 (14:55 +1300)]
Bug 27268: Move GetMarcNotes to Koha namespace
This patch moves C4::Biblio::GetMarcNotes to
Koha::Biblio->get_marc_notes. This is so get_marc_notes can be
used in templates and notices.
To test:
1. Find a record that has a note (3xx for UNIMARC, 5xx for MARC21).
Confirm the notes still show as normal under the Descriptions tab.
2. Add the record to the cart.
3. View your cart and click 'more details'. Confirm notes show as
normal.
4. Log in to the OPAC. Find the record and add it to the cart
5. View the cart and click 'more details'. Confirm notes show as
normal.
6. View the record detail page and confirm the notes show as normal
under the Title Notes tab.
7. Confirm tests pass:
- t/Biblio.t
- t/db_dependent/Koha/Biblio.t
Sponsored-by: Bibliotheksservice-Zentrum Baden-Württemberg (BSZ) Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
David Nind [Sat, 20 Feb 2021 23:06:01 +0000 (23:06 +0000)]
Bug 27405: (follow up) Updates to accommodate currency entry
This patch makes two modifications to allow the entry of
currency strings (for example, 1.25) so that it is consistent with other
payment entry forms.
- Inputmode changed to "decimal"
- Regex pattern changed to "^\d+(\.\d{2})?$" as found in
admin/debit_types.tt
Signed-off-by: David Nind <david@davidnind.com> 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>
Catherine Ma [Wed, 20 Jan 2021 00:56:59 +0000 (00:56 +0000)]
Bug 27405: Update koha-tmpl/intranet-tmpl/prog/en/modules/pos/register.tt for ACC2
This replaces the number type input in
intranet-tmpl/prog/en/modules/pos/register.tt so that it is
consistent with ACC2 guidelines.
Test plan:
1. Enable the EnablePointOfSale (set to Enable) and UseCashRegisters
(set to Use) system preferences.
2. Add a new cash register for a library (Home > Point of sale > Create
a new cash register)
3. Add some sample items for sale (Home > Point of sale > Configure
items for purchase)
4. Add some sales (Home > Point of sale > Add some items, enter a
payment and sleect Confirm)
5. Issue a refund (Home > Point of sale > Register details > select
Issue refund for an item)
6. Try to enter text, numbers with several decimal places, and , or
multiple .
7. Apply the patch.
8. Repeat steps 4-6 - should continue to function as expected, with
appropriate warning messages for invalid entries.
9. Search koha-tmpl/intranet-tmpl/prog/en/modules/pos/register.tt for
input type="number" - there should be no occurences.
10. Sign off!
Sponsored by Catalyst IT
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>
David Cook [Thu, 17 Dec 2020 04:05:39 +0000 (04:05 +0000)]
Bug 26199: Include LDR for match check/match point
This patch adds the ability to specify the LDR instead of a numeric tag
when defining match checks in record matching rules. This is particularly
useful for checking LDR6 "Type of record" when importing records.
Test plan:
0. prove t/Matcher.t
1. Go to http://localhost:8081/cgi-bin/koha/catalogue/detail.pl?biblionumber=1
2. Click "Save" and choose "MARCXML"
3. Copy bib-1.marcxml to bib-1-mod.marcxml
4. Change "01344cam a22003014i 4500" to "01344cmm a22003014i 4500"
5. Go to http://localhost:8081/cgi-bin/koha/admin/matching-rules.pl?op=edit_matching_rule&matcher_id=3
6. Click "Add match check"
7. Fill out the match checks:
Source:
Tag: LDR
Offset: 6
Length: 1
Target:
Tag: LDR
Offset: 6
Length: 1
8. Go to http://localhost:8081/cgi-bin/koha/tools/stage-marc-import.pl
9. Choose "bib-1-mod.marcxml" and click "Upload file"
10. Choose "KohaBiblio (999$c)" for "Record matching rule"
11. Click "Stage for import"
12. Click "Manage staged records" on resulting page
13. Note the "Match type" says "No match"
14. Go to http://localhost:8081/cgi-bin/koha/tools/stage-marc-import.pl
15. Choose "bib-1.marcxml" and click "Upload file"
16. Choose "KohaBiblio (999$c)" for "Record matching rule"
17. Click "Stage for import"
18. Click "Manage staged records" on resulting page
19. Note the Match type says "Match found"
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Mon, 25 Jan 2021 14:15:00 +0000 (15:15 +0100)]
Bug 27545: Keep the location if passed
Change in behaviour here, but expect. We must keep the location value if
passed to store.
Same for the permanent_location
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Mon, 25 Jan 2021 13:04:31 +0000 (14:04 +0100)]
Bug 27545: Use NewItemsDefaultLocation from places where an item is created
The syspref NewItemsDefaultLocation is used to set a default value for item's location.
But it seems that there are some weirdness in the behaviour:
1. It's only used from additem. It seems that it should be used from acq and serial modules as well. And maybe for the items import too.
2. It set the location even if another one has been picked from the UI
=> We UI must preselect the syspref's value, but the controller must pick what has been selected on the UI
This patch is adding the default to the UI and extend the use of the
pref to other areas.
Test plan:
Set a value to NewItemsDefaultLocation
Catalogue a new item and confirm that the syspref's value is picked to
selected the default value on the add item form
Same behaviour should apply to the acquisition and serial modules
When importing items, the default location must be used if the imported
items did not have a location defined.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
UPDATE systempreferences
SET value=REPLACE(value, '|', ',')
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>
Jonathan Druart [Tue, 9 Feb 2021 16:19:59 +0000 (17:19 +0100)]
Bug 27652: Display patron's categories for sysprefs expecting them
This patch adds a new type of system preference entry option: patron
category. A preference with this type will show either a <select> with
patron categories to choose from or a multiple-select menu for choosing
one or more.
This prevents possible errors from incorrect category codes being
entered manually.
To test, apply the patch and run the database update.
- Go to Administration -> System preferences.
- Test each of the updated preferences to confirm that the available
options are correct and that your selections are correctly saved.
- Single category selections, PatronSelfRegistrationDefaultCategory
and GoogleOpenIDConnectDefaultCategory. With each of these you
should see a dropdown where you can select of all the existing
patron categories.
- Multiple selections, OPACHoldsIfAvailableAtPickup and
BatchCheckouts: These preferences should have an option for
selecting one or more system preferences at once.
- Test the pages affected by the updated system preferences:
- With BatchCheckouts enabled, confirm that the batch checkout page is
correctly limited by patron category.
- Set the OPACHoldsIfAvailableAtPickup preference to "Don't allow" and
select at least one patron category in the
OPACHoldsIfAvailableAtPickupExceptions preference.
- Log in to the OPAC as a patron whose category was not selected in
the OPACHoldsIfAvailableAtPickupExceptions preference.
- Try to place a hold on an item which is available at a library.
- When confirming the hold, the libraries where the item is available
should be disabled in the "Pick up location" dropdown.
- Repeat the process as a patron whose category was selected in
OPACHoldsIfAvailableAtPickupExceptions. There should be no disabled
pickup locations.
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 [Tue, 23 Feb 2021 17:25:47 +0000 (17:25 +0000)]
Bug 27766: Hide expired news items by default
This patch modifies the news page in the staff interface so that expired
news items are hidden by default. A checkbox in the sidebar can be
checked to show the hidden rows.
To test you should have multiple news items, some expired and some
unexpired.
- Apply the patch and go to Tools -> News
- The table of news items as it initially appears should not include
any expired news items.
- In the sidebar, check the "Show expired" checkbox.
- The expired news items should now appear.
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>
Owen Leonard [Mon, 22 Feb 2021 16:49:12 +0000 (16:49 +0000)]
Bug 27751: Phase out jquery.cookie.js: Batch item modifications
To test, apply the patch and go to Tools -> Batch item modification.
- Submit a batch of barcodes for modification.
- Uncheck some checkboxes to hide columns in the table showing your
submitted items.
- Return to the batch item modification page and submit your batch
again.
- The columns you selected should still be hidden.
- Submit a batch of items for deletion.
- The same columns should be hidden here too.
- Also test that the "Show all columns" and "Hide all columns" buttons
work and that the changes persist across batches.
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, 12 Feb 2021 19:34:05 +0000 (19:34 +0000)]
Bug 27699: Add register information to responsive staff interface header menu
This patch adds register information to the version of the header menu
shown when the browser width is narrower.
To test, apply the patch and enable the UseCashRegisters system
preference.
- If necessary, create at least one cash register for your library under
Administration -> Cash registers.
- From any page in the staff interface you should see a menu in the
header showing your username and logged-in branch.
- Expand the menu and choose "Set library, desk and register."
- Select a cash register and save.
- The cash register information should now appear in the header menu.
- Narrow the width of the browser until the menu collapses and shows
only a user icon.
- When you expand this version of the menu you should see the
currently-suggested register.
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 [Thu, 4 Mar 2021 18:39:15 +0000 (18:39 +0000)]
Bug 27682: (follow-up) Make sure table is drawn with correct width
The DataTables plugin calculates the width of the fixed header based on
the initial width of the corresponding table. Since these tables are
inside jQueryUI tabs, the width changes when the tabs are initialized
and jQueryUI adds its classes to the table's container.
This patch "manually" adds the relevant classes to the markup so that
the table's container is drawn with the right padding from the start.
Also fixed: Don't try to destroy "oldTableId" if the tableInit function
didn't pass an oldtabid.
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Owen Leonard [Fri, 12 Feb 2021 12:57:56 +0000 (12:57 +0000)]
Bug 27682: Add a floating table header for Search engine configuration
This patch adds DataTables options to the tables on the search engine
configuration pages. The table on the "Search fields" tab will be
sortable, all tables will be searchable, and all tables will have
floating headers.
To test you should have the SearchEngine preference set to
"Elasticsearch."
- Apply the patch and go to Administration -> Search engine
configuration (Elasticsearch)
- Test the tables under each tab, "Search fields," "Bibliographic
records," and "Authorities," the table has a search filter and the
header row "sticks" to the top of the browser window as you scroll
down.
- The "Search fields" table should be sortable, but the other two should
not--they have drag-and-drop row reordering.
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 [Thu, 11 Feb 2021 13:08:35 +0000 (13:08 +0000)]
Bug 27681: Style OPAC self-registration CAPTCHA as uppercase
This patch adds an inline "text-transform:uppercase" style attribute to
the OPAC self-registration CAPTCHA field so that the user doesn't have
to match the case of the CAPTCHA they're shown.
To test, apply the patch and start the process of self-registration in
the OPAC.
- At the end of the form, under verification, confirm that any text you
type in the verification field is uppercase by default.
- Confirm that the CAPTCHA is accepted when you submit the form.
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>
Owen Leonard [Fri, 19 Feb 2021 12:40:01 +0000 (12:40 +0000)]
Bug 27728: Add a search box on OPAC Search history
This patch makes changes to the OPAC search history DataTables
configuration so that table controls appear, including search, copy,
CSV, and print.
The patch also makes some improvements to the checkbox interactions: The
date column is now a label for the checkbox, and the "Remove selected
searched" button is now disabled until a checkbox has been checked.
To test, apply the patch and log into the OPAC as a user with a search
history. If possible, past and current searches of both bibliographic
and authority records.
- On the search history page, confirm that the DataTables controls
appear above each table: "Current" and "Previous" under both the
"Catalog" and "Authority" tabs.
- All controls should work correctly and affect only the corresponding
table: Search, Clear filter, Copy, CSV, and Print.
- Confirm that clicking a date in the date column checks the correct
checkbox.
- Confirm that toggling a checkbox correctly enables and disables the
"Remove selected searches" button as well as the "Select searches to:"
menu at the top of the table.
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>
Martin Renvoize [Thu, 4 Mar 2021 11:59:37 +0000 (11:59 +0000)]
Bug 27855: (QA follow-up) Rename extended_attribute to patron_extended_attribute
This path renames the extended_attribute definition to
patron_extended_attribute to clarify that these attributes are always
attached to a patron and not a more generic class of attributes.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Bug 27855: Add 'extended_attributes' embedding to the spec
This patch just adds:
- The optional 'extended_attribute' attribute to the patron object
OpenAPI definition. It consists of an array of extended_attribute
objects.
- Add the x-koha-embed: [ 'extended_attributes' ] definition on the GET
routes for patrons, allowing immedite availability of the
'extended_attributes' embedding feature.
To test:
1. Apply this patchset
2. Restart Plack
3. Have some known patron_id/borrowernumber that has some extended
attributes ('Patron attributes' on the UI).
4. Enable Basic authentication
5. Assuming the known patron_id is 1, point your favourite REST tool to http://kohadev-intra.myDNSname.org:8081/api/v1/patrons/1
e.g.: if your user/pass is koha/koha
curl --location --request GET 'http://kohadev-intra.myDNSname.org:8081/api/v1/patrons/1' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic a29oYTprb2hh'
=> SUCCESS: You get the patron object correctly, no extended_attributes
6. Repeat 5, adding the x-koha-embed header like this:
curl --location --request GET 'http://kohadev-intra.myDNSname.org:8081/api/v1/patrons/1' \
--header 'Content-Type: application/json' \
--header 'x-koha-embed: extended_attributes' \
--header 'Authorization: Basic a29oYTprb2hh'
=> SUCCESS: You get the patron, with the extended attributes inside!
7. Sign off :-D
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>
Bug 27855: Make GET /patrons/:patron_id use objects.find
This patch makes the route for fetching a patron use the objects.find
helper instead of a plain Koha::Patrons->find. This gives the controller
embedding superpowers.
To test, we just need to check nothing broke:
1. Apply this patch
2. Run:
$ kshell
k$ prove t/db_dependent/api/v1/patrons.t
=> SUCCESS: Tests pass!
3. Sign off :-D
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>
This patch introduces a mapping to render extended attributes on the
API. As they have an ID, and they will generally be used on the
/patrons umbrella, I removed the borrowernumber on the mapping.
Another option would be to add the field, but make it optional. It
really feels redundant, so I take it out for now.
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>
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>
The controller method was written a lot of time before the enhancements
we added to the objects.search helper, and it is now much easier to
handle the 'restricted' param use case.
No need to do it like that anymore.
This patch fetches the 'restricted' param from the query parameters and
cleans it from the validated data, so we can just pass the resultset to
$c->objects->search as in all other controllers.
And we had tests for the expected behavior, so testing this is as easy
as:
1. Run:
$ kshell
k$ prove t/db_dependent/api/v1/patrons.t
=> SUCCESS: Tests pass!
2. Apply this patch
3. Repeat 1
=> SUCCESS: Tests still pass! Of course!
4. Sign off :-D
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Bug 26636: (QA follow-up) Handle no results correctly
Sponsored-by: Virginia Polytechnic Institute and State University Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This patch adds tests for the case in which there's no object identified
by the supplied $id. It should return undef.
Sponsored-by: Virginia Polytechnic Institute and State University Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Sponsored-by: Virginia Polytechnic Institute and State University Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Agustin Moyano [Fri, 9 Oct 2020 13:20:33 +0000 (10:20 -0300)]
Bug 26636: Add objects.find helper
This patch adds the objects.find helper. Much like objects.search, it
returns the to_api method with embedded.
Sponsored-by: Virginia Polytechnic Institute and State University Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Agustin Moyano [Fri, 9 Oct 2020 14:53:43 +0000 (11:53 -0300)]
Bug 26636: Add tests
This patch adds tests for the new objects.find helper.
Sponsored-by: Virginia Polytechnic Institute and State University Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This patch fixes a rebase issue, and also makes sure the tests do not
rely on any prior data. The query on tmp_holdsqueue is done against the
actual reserve_id so no need to delete all the data from the
tmp_holdsqueue and hold_fill_targets table.
I also noticed the previous subtest wasn't run inside a transaction even
if the code was designed to not depend on prior data as well.
To test:
1. Apply this patch
2. Run:
$ kshell
k$ prove t/db_dependent/HoldsQueue.t
=> SUCCESS: Tests pass!
3. Sign off :-D
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>
Agustin Moyano [Wed, 28 Oct 2020 13:48:18 +0000 (10:48 -0300)]
Bug 24359: Remove hold from holds queue when captured
This patch removes a hold from holds queue when captured by check in.
To test:
1. check out an item from a book with multiple items for patron_1
2. place a biblio level hold for patron_2
3. perl misc/cronjobs/holds/build_holds_queue.pl
CHECK => holds queue shows the placed hold
4. check in the item from step 1 and confirm hold for patron_2
SUCCESS => hold for patron_2 is no longer in holds queue
5. prove t/db_dependent/HoldsQueue.t
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> 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>
Agustin Moyano [Wed, 28 Oct 2020 13:48:09 +0000 (10:48 -0300)]
Bug 24359: Add test
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> 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>
Bug 27863: Use the /libraries route when AllowHoldsPolicyOverride is set
This patch makes the dropdown for changing the pickup location for
existing holds use the GET /libraries route instead of GET
/holds/:hold_id/pikcup_locations if the configuration allows the
override.
Terminology:
- Pickup location, means a library that is marked as valid pickup
location on its configuration.
To test:
1. Have the circ rules set so 'Hold pickup library match' is set to
'Item's home library' or 'Any'. The goal is to be able to
differentiate when all libraries are returned, from the case only
'valid pickup locations' are returned. The easiest one is 'Item's
home library'.
2. Set AllowHoldsPolicyOverride
3. Pick a patron from a library that is not a valid pickup location and
an item that belongs to a library that doesn't match any of the valid
ones.
=> SUCCESS: Notice Koha allows you to choose any library (because of the
syspref)
4. Place the hold.
5. Now check on the holds list for the bib, if you can use the dropdown
to change the pickup location for the hold
=> SUCCESS: You can, sort of
=> FAIL: It doesn't show/search all pickup locations. It only shows the
valid ones, even though we should be able to override it.
6. Apply this patch
7. Restart all just in case, and reload the holds page for the bib
8. Repeat 5
=> SUCCESS: You are presented all pickup locations!
9. Sign off :-D
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Phil Ringnalda [Fri, 26 Feb 2021 21:39:37 +0000 (13:39 -0800)]
Bug 26964: Newly created macros should be selected in the Advanced editor
The problem is that the newly created macro isn't selected, because the
return values from the call to create it are accidentally thrown away. There
isn't actually any option to save, just a timeout that automatically saves,
but you can tell you are in this broken state because the Delete macro
button is disabled.
Test plan:
1. Prior to applying the patch, Administration - set the preference
EnableAdvancedCatalogingEditor to Enable
2. Cataloging - Advanced editor - Macros... - New macro...
3. Give it a name, click OK, notice that the Delete macro button is disabled
4. Apply patch, shift+reload
5. Macros... - New macro...
6. Give it a name, click OK, notice that the Delete macro button is enabled
7. Type something in the editor, delete 999 will do nicely, wait half a
second to see Saved appear at the far right, close the macro popup
8. Macros..., click the name of your macro, verify it really was saved
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Joonas Kylmälä [Fri, 5 Mar 2021 15:26:02 +0000 (17:26 +0200)]
Bug 27058: (follow-up) Clarify notforloan checks with a comment
In IsAvailableForItemLevelRequest the check is for holdability and in
ItemsAnyAvailableAndNotRestricted the check is for
checkoutability. These comments should make it more clear because the
notforloan value is used for these two different purposes and is a bit
confusing (we might want to add a new field "notforhold" in future to
make the code self documenting)
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Joonas Kylmälä [Fri, 19 Feb 2021 07:49:51 +0000 (09:49 +0200)]
Bug 27058: Remove confusing and unnecessary $biblionumber1 variable
The code is much more understandable now because with $biblio2 and
$biblionumber1 variables use to point to the same biblio one might
have thought $biblionumber1 points to $biblio1 which in this case is
not true. Let's just drop the extra variable because the object
notation of accessing is just as simple.
To test:
1) prove t/db_dependent/Holds/DisallowHoldIfItemsAvailable.t => passes
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Joonas Kylmälä [Thu, 19 Nov 2020 14:55:18 +0000 (16:55 +0200)]
Bug 27058: Make checkout availability use all notforloan reasons
The ItemsAnyAvailableAndNotRestricted function is checking whether an
item can be checked out and it incorrectly only checks the positive
notforloan values when there can be also negative notforloan
values. If notforloan value is not 0 then it means the item cannot be
checked out. In the case of ordered items the value is negative (-1)
and thus before this change the checkout availability was reported
incorrectly.
To test:
1) Run prove t/db_dependent/Holds/DisallowHoldIfItemsAvailable.t
Notice it fails
2) Apply this patch
3) Run prove t/db_dependent/Holds/DisallowHoldIfItemsAvailable.t
Notice it passes now.
To test via Koha sandbox (Alternatively):
1) Create circ rule with If all unavailable
2) Create new biblio
3) Order a new item to the biblio via acquisitions and set the not
for loan value to Ordered / -1
4) Notice you cannot place a hold to the biblio
5) Apply patch
6) Notice you can now place a hold to the biblio
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>
Joonas Kylmälä [Thu, 19 Nov 2020 15:13:25 +0000 (17:13 +0200)]
Bug 27058: Add test to show ordered items cannot be checked out
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>
Jonathan Druart [Wed, 10 Feb 2021 06:26:15 +0000 (07:26 +0100)]
Bug 27650: Fix variable passed to the template in opac-main
$template->param(
+ koha_news => @all_koha_news,
We must not pass an array, the number of elements of the hash passed to the template may be inconsistent.
It's working because of an error earlier in the script:
+ @all_koha_news = &GetNewsToDisplay($news_lang,$homebranch);
GetNewsToDisplay returns an arrayref
Test plan:
Define at least 2 news to display on the OPAC main page
Hit opac-main.pl
=> All news are displayed
Click one
=> You see the single news you selected
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Nick Clemens [Sat, 6 Mar 2021 16:02:34 +0000 (16:02 +0000)]
Bug 27886: Move non-rancor code into correct section
The template was including code that was not compatible with Rancor, moving
the end of the conditional seems to fix the error
To test:
1 - Open a record in the advanced catalog editor
2 - Create or edit a 100 field with some content, I used 'bruce'
3 - Press Ctrl+shift+l to launch authority search
4 - Perform a search and select an authority
5 - Note the field copies but the pop-ups don't close
6 - Apply patch
7 - Reload the page
8 - Repeat 1-4
9 - The field copies and the windows close
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>
Jonathan Druart [Fri, 5 Mar 2021 10:45:12 +0000 (11:45 +0100)]
Bug 27851: Use filter_by_todays_checkins in members/readingrec.pl
Test plan:
Do some checkouts
Checkin with different return dates (several today however)
Check the circulation history and confirm that the checkout list is correct
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Fri, 5 Mar 2021 10:44:42 +0000 (11:44 +0100)]
Bug 27851: Use filter_by_todays_checkins in printslip.pl
Test plan:
No regression from bug 12224 test plan
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>