]> git.koha-community.org Git - koha.git/log
koha.git
3 months agoBug 28762: Confirm return of not_for_loan in boolean context matches is_notforloan
Martin Renvoize [Mon, 22 Jul 2024 15:09:30 +0000 (16:09 +0100)]
Bug 28762: Confirm return of not_for_loan in boolean context matches is_notforloan

This patch is simply here to prove that is_notforloan is just
not_for_loan but in a boolean context.. we'll remove it in the next
patch.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
3 months agoBug 28762: (follow-up) Remove warning in tests
Martin Renvoize [Mon, 22 Jul 2024 12:29:06 +0000 (13:29 +0100)]
Bug 28762: (follow-up) Remove warning in tests

Looks like a recent bug introduced a superflous warning, we just clean
that up here whilst we're in the code.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
3 months agoBug 28762: Unit tests for not_for_loan accessor
Martin Renvoize [Mon, 29 Jan 2024 10:46:07 +0000 (10:46 +0000)]
Bug 28762: Unit tests for not_for_loan accessor

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
3 months agoBug 28762: Add test for new 'instructors' accessor
Martin Renvoize [Mon, 29 Jan 2024 09:41:08 +0000 (09:41 +0000)]
Bug 28762: Add test for new 'instructors' accessor

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
3 months agoBug 28762: Move notforloan fallback into object
Martin Renvoize [Fri, 24 Sep 2021 09:25:53 +0000 (10:25 +0100)]
Bug 28762: Move notforloan fallback into object

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
3 months agoBug 28762: Update item-status include
Martin Renvoize [Fri, 24 Sep 2021 07:39:52 +0000 (08:39 +0100)]
Bug 28762: Update item-status include

This patch updates the item-status include so that it expects just an
item object making if simpler and more widely re-usable.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
3 months agoBug 28762: Use Koha::Course in course-details controller
Martin Renvoize [Thu, 23 Sep 2021 18:06:43 +0000 (19:06 +0100)]
Bug 28762: Use Koha::Course in course-details controller

This patch updates Koha::Course to include the 'instructors' relation
accessor and then update the course-details controller to use the
Koha::Course object and pass it to the template instead of building a
hash using GetCourse.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
3 months agoBug 28762: (follow-up) fix template logic with Available
Lucas Gass [Wed, 8 Sep 2021 17:01:03 +0000 (17:01 +0000)]
Bug 28762: (follow-up) fix template logic with Available

Signed-off-by: Hayley Pelham <hayleypelham@catalyst.net.nz>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
3 months agoBug 28762: handle notforloan better
Lucas Gass [Tue, 27 Jul 2021 21:45:12 +0000 (21:45 +0000)]
Bug 28762: handle notforloan better

Signed-off-by: Hayley Pelham <hayleypelham@catalyst.net.nz>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
3 months agoBug 28762: add staff item-status.inc and better handle statues on course-details.tt
Lucas Gass [Tue, 27 Jul 2021 21:17:48 +0000 (21:17 +0000)]
Bug 28762: add staff item-status.inc and better handle statues on course-details.tt

This patch adds an item-status.inc to the staff side much like what is already in place on the OPAC.

To test:
1. create a course in course reserves, add an item to it.
2. confirm your item shows Available for its status on course-details.pl
3. edit your item to be withdrawn, lost, damaged, notforloan, and restricted use
4. reload course-details.pl, confirm it still shows available
5. apply patch
6. repeat step 3 with each of the statuses and make sure it correctly shows on course-details.pl

Signed-off-by: Hayley Pelham <hayleypelham@catalyst.net.nz>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
3 months agoBug 37374: Fix functionality of 'Place hold' button for club holds
Sam Lau [Mon, 22 Jul 2024 15:48:01 +0000 (15:48 +0000)]
Bug 37374: Fix functionality of 'Place hold' button for club holds

To test:
1) create a club
2) put 1 patron in your club
3) find a bib
4) Click Holds, then Clubs
5) search for your club, confirm hold detail
6) click Place Hold
7) nothing happens
8) Apply patch
9) Refresh page and click 'Place hold' again
10) Hold is properly placed

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
3 months agoBug 26866: Sort items table on additem by cn_cort
Brendan Lawlor [Mon, 22 Jul 2024 18:11:11 +0000 (18:11 +0000)]
Bug 26866: Sort items table on additem by cn_cort

This patch changes the data-order attribute for the item callnumber column
to use the item's cn_sort instead of the callnumber value.

Test plan:
1. Create a bib
2. Add three items with source of classification LLC
    call numbers:
    JC43 .G6 1890
    JC330 .F74 2000
    JC480 .R63 2006
4. On additem.pl sor the items table by 'Full call number'
5. Confirm the items are now ordered correctly by cn_sort
6. Confirm the other columns still sort correctly

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
3 months agoBug 28924: (follow-up) Decimal points count as characters
Martin Renvoize [Tue, 23 Jul 2024 14:36:35 +0000 (15:36 +0100)]
Bug 28924: (follow-up) Decimal points count as characters

The restriction to 3 characters in the new patron category fields was
too strict.. the default for $Price on_editing is 0.00 (makes sense
right).. and that's 4 Characters so we were failing validation.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
3 months agoBug 13888: (follow-up) fix tests for Virtualshelves
PerplexedTheta [Tue, 23 Jul 2024 08:13:39 +0000 (09:13 +0100)]
Bug 13888: (follow-up) fix tests for Virtualshelves

This patch fixes failing tests resulting from oversight in the previous
attachments I supplied to this bug number.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
3 months agoBug 37333: (follow-up) Update existing tests
Martin Renvoize [Mon, 22 Jul 2024 14:53:48 +0000 (15:53 +0100)]
Bug 37333: (follow-up) Update existing tests

We add a level of bracket nesting. I checked with Nick that this
shouldn't cause any issues in the queries and we agreed it made sense so
I've gone ahead and updated the tests to reflect the change.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
3 months agoBug 36480: (follow-up) Add missing library_id parameter
Martin Renvoize [Mon, 22 Jul 2024 13:52:29 +0000 (14:52 +0100)]
Bug 36480: (follow-up) Add missing library_id parameter

The /libraries/{library_id}/desks endpoint was missing the
library_id parameter definition from the swagger specification.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
3 months agoBug 36481: (follow-up) Add missing library_id parameter
Martin Renvoize [Mon, 22 Jul 2024 13:49:31 +0000 (14:49 +0100)]
Bug 36481: (follow-up) Add missing library_id parameter

The /libraries/{library_id}/cash_registers endpoint was missing the
library_id parameter definition from the swagger specification.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
3 months agoBug 37302: Add swagger-cli to devDependancies
Martin Renvoize [Wed, 10 Jul 2024 10:26:09 +0000 (11:26 +0100)]
Bug 37302: Add swagger-cli to devDependancies

This patch adds swagger-cli 4.0.4+ to the devDependancies section of
package.json. This should ensure it gets installed when appropriate

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
3 months agoBug 37302: Set test to failed if swagger-cli missing
Martin Renvoize [Wed, 10 Jul 2024 10:12:56 +0000 (11:12 +0100)]
Bug 37302: Set test to failed if swagger-cli missing

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
3 months agoBug 37400 - In returns.pl don't search for a patron unless needed
Kyle M Hall [Thu, 18 Jul 2024 11:27:47 +0000 (07:27 -0400)]
Bug 37400 - In returns.pl don't search for a patron unless needed

In returns.pl we find a patron, then use it in an if statement.

Test Plan:
Cancel a hold with other holds remaining on the record.
No change should be noted.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
3 months agoBug 36885: Fix Bootstrap tooltip on budget planning page
Owen Leonard [Thu, 16 May 2024 13:57:11 +0000 (13:57 +0000)]
Bug 36885: Fix Bootstrap tooltip on budget planning page

This patch finishes the process of adding a Bootstrap tooltip to the
listing of funds which are locked.

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

- Edit a budget and make it locked: Check the "Lock budget" checkbox and
  save.
- View the budget you locked.
- From the toolbar, click Planning -> Plan by months.
- In the table of funds, hover your mouse over a fund.
- You should see a Bootstrap-styled tooltip, "Fund locked."

Signed-off-by: David Nind <david@davidnind.com>
Bug 36885: (follow-up) Correct popup hint

Bug 36885: (follow-up) Remove tooltip from unlocked budgets (copy-paste error)

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
3 months agoBug 37324: Self registration complete login form won't login user
Jan Kissig [Mon, 15 Jul 2024 11:01:39 +0000 (13:01 +0200)]
Bug 37324: Self registration complete login form won't login user

This patch fixes the self registration complete login form which appears after a complete self registration process.

To test:
a) open http://localhost:8081/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=PatronSelfRegistrationDefaultCategory
b) set PatronSelfRegistration to allow
c) set PatronSelfRegistrationDefaultCategory to Self registration
d) logout or open a private tab
e) http://localhost:8080/cgi-bin/koha/opac-memberentry.pl and enter required fields
f) Registration complete! appears with a prefilled login form. Click Log in.
g) Check you are not logged in

apply patch and redo steps e-f and check that login worked.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
3 months agoBug 29509: DBRev 24.06.00.018
Martin Renvoize [Mon, 22 Jul 2024 09:36:40 +0000 (10:36 +0100)]
Bug 29509: DBRev 24.06.00.018

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
3 months agoBug 29509: (QA follow-up) Tidy atomic update
Kyle M Hall [Fri, 19 Jul 2024 13:54:44 +0000 (09:54 -0400)]
Bug 29509: (QA follow-up) Tidy atomic update

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
3 months agoBug 29509: (QA follow-up) Check top level permissions too
Martin Renvoize [Tue, 7 May 2024 13:18:04 +0000 (14:18 +0100)]
Bug 29509: (QA follow-up) Check top level permissions too

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
3 months agoBug 29509: Update swagger specification and add permissions to users
Martin Renvoize [Mon, 22 Jan 2024 16:49:56 +0000 (16:49 +0000)]
Bug 29509: Update swagger specification and add permissions to users

This patch removes the 'edit_borrowers', 'manage_bookings',
'lable_creator', 'routing' and 'order_manage' permissions from the list
of options in the patrons list endpoint.

We then assign the new 'list_borrowers' permission to any users who have
those removed permissions

Test plan
1) Apply patch and run the database update
2) Users with any of the permissions listed above should now also have
   the 'list_borrowers' permission too.
3) Check that patron searching continues to work from the various
   locations in the UI for the above affected users

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
[EDIT] Incorporated second patch and removed 1<<4. 16 reads much better :)

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
3 months agoBug 37399: Fix showing itemtype on holdings table
Emmi Takkinen [Thu, 18 Jul 2024 09:34:12 +0000 (12:34 +0300)]
Bug 37399: Fix showing itemtype on holdings table

If syspref "noItemTypeImages" is disabled, holdings table won't display
itemtype column. This patch fixes this.

To reproduce:
1. Enable syspref "noItemTypeImages".
2. Find biblio with items.
   => Note that itemtype column is displayed on holdings table.
3. Disable syspref "noItemTypeImages".
   => Itemtype column is no longer displayed on holdings table.
4. Apply this patch.
   => Now column should be displayed correctly.

Sponsored-by: Koha-Suomi Oy
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
3 months agoBug 13888: DBRev 24.06.00.017
Martin Renvoize [Mon, 22 Jul 2024 09:27:20 +0000 (10:27 +0100)]
Bug 13888: DBRev 24.06.00.017

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
3 months agoBug 13888: (follow-up) fix for create_public_lists
PerplexedTheta [Wed, 10 Jul 2024 08:02:42 +0000 (09:02 +0100)]
Bug 13888: (follow-up) fix for create_public_lists

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
3 months agoBug 13888: Tidy Koha/Virtualshelf.pm
Jake Deery [Tue, 2 Jul 2024 16:15:53 +0000 (17:15 +0100)]
Bug 13888: Tidy Koha/Virtualshelf.pm

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
3 months agoBug 13888: 'Lists' permission should allow/disallow using the lists module in staff
Jake Deery [Tue, 2 Jul 2024 14:11:36 +0000 (15:11 +0100)]
Bug 13888: 'Lists' permission should allow/disallow using the lists module in staff

This patch adds two new system preferences, use public lists, and create public
lists. Use public lists determines if a librarian is permitted to see public
lists, whilst create public lists determines if a librarian can create new public
lists.

It also fixes erroneously allowing staff to add items to existing lists, by
honouring the existing edit_public_list_contents

To test:
a)  notice the new my lists link on the account pulldown
    1)  ensure it goes to the lists module
b)  create new public list, add at least one item, make it editable by everyone
    1) note the name of the list
c)  create a new patron with full access to the staff client minus lists permissions
d)  log in as the newly created patron
e)  notice the lists button is missing from the staff client mainpage
f)  set any of the lists permissions except create public lists, use public lists, edit public list contents
g)  notice how the lists button is no longer missing from the staff client mainpage
h)  go to the lists module
    1) notice that public lists are now missing from the datatable
i)  click add list
    1)  notice that the public drop-down is now a fixed label set to private
j)  create list and confirm it is not public
k)  turn use public lists permission on
l)  return to the lists module
    1)  notice that the datatable now shows private and public lists tabs
m)  turn create public lists permission on
n)  repeat steps h-i
    1)  notice that the public drop-down is now visible again
o)  create list and confirm it is public
p)  go to the list you created in step b
q)  notice that add items button, and remove selected button, is missing
r)  turn edit public list contents permission on
s)  repeat steps p-q
    1) notice that add items button is now visible
t)  click add items
u)  enter an item barcode or biblio number, click save
    1) notice that the items are now added to the list

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
3 months agoBug 37226: append a random number to the `id` attribute of each <li>
Andreas Roussos [Mon, 1 Jul 2024 14:27:42 +0000 (14:27 +0000)]
Bug 37226: append a random number to the `id` attribute of each <li>

When you view the authority details page for a term that contains more
than one terms with broader relationship, clicking on the expand/collapse
arrows next to the top-level terms in the hierarchy tree will not work
properly, i.e. *only one* broader term will show the narrower term under
it at any given time.

This is affecting both the OPAC and the Staff interface.

This is happening because in the HTML source of the page the individual
<li> elements associated with each node do not have unique `id` values,
which confuses the JavaScript library (jsTree) responsible for rendering
the hierarchy tree.

This patch fixes that by appending a random number to each `id` attribute.

Test plan:

0) Enable the AuthDisplayHierarchy System Preference (set to 'Show').

1) Copy the provided MARC21 Authority sample data (sample-data.mrc)
   to your KTD Koha container (it must have MARC21 marc flavour):

   docker cp sample-data.mrc koha-koha-1:/kohadevbox/

2) Import the provided authorities (the sample file contains three
   Geographic Name records):

   WARNING! the --delete switch is passed to bulkmarcimport.pl
   WARNING! this will erase any authority data you have in your instance!
   (this is done to retain the broader/narrower authid associations)

   misc/migration_tools/bulkmarcimport.pl --authorities --file=/kohadevbox/sample-data.mrc --verbose -c=MARC21 --delete -m=ISO2709

3) Visit the authority details page for 'Athens' in OPAC/Staff:

   http://localhost:8080/cgi-bin/koha/opac-authoritiesdetail.pl?authid=3
   http://localhost:8081/cgi-bin/koha/authorities/detail.pl?authid=3

   In the authority hierarchy tree, click the arrows next to 'Europe'
   and 'Greece' to expand and show the narrower term: notice how only
   one item works at any given time.

4) Apply the patch.

5) Repeat step 3) (refresh the pages) -- this time you should be able
   to view 'Athens' as a narrower term of both 'Europe' and 'Greece'
   at the same time.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
3 months agoBug 37343: Fixed search for vendors when transferring an item in acquistions
Eric Garcia [Tue, 16 Jul 2024 17:00:43 +0000 (17:00 +0000)]
Bug 37343: Fixed search for vendors when transferring an item in acquistions

To test:
1. Have several vendors in acquistions
2. Add a basket and click "+Add to basket"
3. I used an mrc file to add an order from a new file
4. Stage for import -> add staged files to basket
5. Select the items and choose an item type
6. In the Orders table click 'Transfer' under the 'Modify' column
7. Try searching for vendors, nothing happens.
8. Apply patch restart_all
9. Click 'Transfer' again and try searching for vendors.
10. Notice vendors appear

NOTE:
Vendor search is a GET operation not POST. Use 'do_search' instead of 'cud-do_search'.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
3 months agoBug 29087: (QA follow-up): Fix QA tests
Matt Blenkinsop [Fri, 28 Jun 2024 13:53:10 +0000 (13:53 +0000)]
Bug 29087: (QA follow-up): Fix QA tests

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
[EDIT] Conform BZ comment31
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
3 months agoBug 29087: Add unit tests
Matt Blenkinsop [Tue, 16 Apr 2024 12:47:16 +0000 (12:47 +0000)]
Bug 29087: Add unit tests

prove t/db_dependent/Koha/Items.t

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
3 months agoBug 29087: Prevent filter_by_for_hold to crash if default holdallowed is not_allowed
Jonathan Druart [Fri, 19 Nov 2021 12:27:44 +0000 (13:27 +0100)]
Bug 29087: Prevent filter_by_for_hold to crash if default holdallowed is not_allowed

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
3 months agoBug 37260: Check message broker for both 'about' and 'sysinfo' tabs
Pedro Amorim [Fri, 5 Jul 2024 13:28:24 +0000 (13:28 +0000)]
Bug 37260: Check message broker for both 'about' and 'sysinfo' tabs

Test plan:
1) Apply test patch only
2) Visit <staff_url>/cgi-bin/koha/about.pl
3) Notice it shows 'Using RabbitMQ' (it should show 'Using SQL polling')
4) Apply this patch, repeat 3)
5) Notice it now shows 'Using SQL polling'
6) Remove test patch. Notice it shows 'Using RabbitMQ' again.
7) Repeat test plan but for /cgi-bin/koha/about.pl?tab=sysinfo tab

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
3 months agoBug 37385: Fix Transfer not triggering automatically when cancelling a hold by checki...
Kyle M Hall [Thu, 18 Jul 2024 12:54:30 +0000 (12:54 +0000)]
Bug 37385: Fix Transfer not triggering automatically when cancelling a hold by checking in an item

Upadates for CSRF are inadvertently stopping AddReturn from being trigger
when a hold is canceled. This is necessary to generate the transfer
back to the originating library.

Test Plan:
1) Find item with a waiting hold, and check it in
2) In the popup notifying me of the waiting hold, select 'Cancel hold'
3) Note no second popup appears notifying you of the need to transfer the item to its home library
4) Apply this patch
5) Restart all the things!
6) Repeat steps 1-2
7) Second popup appears!

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
3 months agoBug 37111: Fix renew link on opac-user.tt
Lucas Gass [Tue, 18 Jun 2024 19:34:52 +0000 (19:34 +0000)]
Bug 37111: Fix renew link on opac-user.tt

To test:
1. Check some items out to a patron
2. Set the username and apssword for the patron so that you can log in as that patron.
3. Log in to the OAPC as that patron.
4. Go to Your account > Summary (the default landing page after you log in).
5. Click "Renew" for one of the items.
6. You get the error as above.
7. APPLY PATCH
8. Try steps 1 -5 again, you should not get an error.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Alexander Wagner <alexander.wagner@desy.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
3 months agoBug 37111: Add submit-form asset to OPAC assets
Lucas Gass [Tue, 18 Jun 2024 19:34:24 +0000 (19:34 +0000)]
Bug 37111: Add submit-form asset to OPAC assets

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Alexander Wagner <alexander.wagner@desy.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
3 months agoBug 37371: Move Maskito instantiation to onReady ( OPAC )
Lucas Gass [Wed, 17 Jul 2024 15:10:24 +0000 (15:10 +0000)]
Bug 37371: Move Maskito instantiation to onReady ( OPAC )

To test:
1. Find a any date picker in Koha, like DOB in the patron record.
2. Add a date, either manually or using the date picker.
3. Once there is a date like 07/15/2024 try to edit only part of the
   date, or the '15'.
4. The date easily becomes malformed.
5. APPLY PATCHSET, maybe clear your browser cache too
6. Try directly inputing dates. I would suggest the following places:

-Patron record DOB
-Specify due date on circ/circulation.pl as this includes time
-Add item screen, this is the dateaccessioned plugin
-OPAC self reg/self modify

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
3 months agoBug 37371: Move Maskito init to onReady in dateaccessioned.pl
Lucas Gass [Wed, 17 Jul 2024 14:58:14 +0000 (14:58 +0000)]
Bug 37371: Move Maskito init to onReady in dateaccessioned.pl

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
3 months agoBug 37371: Set overwrite mode to replace
Lucas Gass [Wed, 17 Jul 2024 14:50:42 +0000 (14:50 +0000)]
Bug 37371: Set overwrite mode to replace

In our case I think overwriteMode needs to be set to replace:

https://maskito.dev/core-concepts/overwrite-mode
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
3 months agoBug 37371: Move Maskito instantiation to onReady
Martin Renvoize [Wed, 17 Jul 2024 14:08:58 +0000 (15:08 +0100)]
Bug 37371: Move Maskito instantiation to onReady

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
3 months agoBug 37270: (follow-up) Fix mixed quotes in preview modal JS
Owen Leonard [Thu, 18 Jul 2024 14:58:29 +0000 (14:58 +0000)]
Bug 37270: (follow-up) Fix mixed quotes in preview modal JS

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
3 months agoBug 37270: Fix deletion of saved reports
Owen Leonard [Tue, 9 Jul 2024 13:13:34 +0000 (13:13 +0000)]
Bug 37270: Fix deletion of saved reports

This patch fixes deletion of saved reports in two instances which
were broken by the CSRF changes: From the dropdown menu in the table of
saved reports, and in the modal window which appears if you click the
"Preview" dropdown menu in the table of saved reports.

The patch also makes a minor change to form-submit.js so that the event
handler will attach to dynamically-generated elements (as is the case
with the preview modal).

To test, apply the patch and go to Reports -> Use saved.

- Add one or more reports if necessary.
- In the table of reports, click the secondary dropdown link in the
  "Run" button.
- Click "Delete." You should be asked to confirm, and confirming should
  correctly delete the report.
- Now test the "Preview SQL" link in the menu.
- A modal window should appear showing you the SQL of the report.
- In the footer of the modal, test the "Delete" button.

Sponsored-by: Athens County Public Libraries
Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
3 months agoBug 37377: Fix orders search do_search param
Brendan Lawlor [Thu, 18 Jul 2024 18:33:53 +0000 (18:33 +0000)]
Bug 37377: Fix orders search do_search param

This patch fixes the orders search in Acquisitions.

The form method is GET no need to prepend with cud-

Test plan:
1. Create an order that you can search for
2. Try order search, nothing happens
3. Apply patch restart all, refresh browser
4. Try order seach again and get results

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
3 months agoBug 28924: (follow-up) Add new fields to categories api
Martin Renvoize [Fri, 19 Jul 2024 13:02:28 +0000 (14:02 +0100)]
Bug 28924: (follow-up) Add new fields to categories api

The patron categories API is failing due to the new fields added in this
bug not being properly handled yet.. This fixes that.

3 months agoBug 37274: Use the Toolbar component in all Vue components
Jonathan Druart [Tue, 9 Jul 2024 12:34:29 +0000 (14:34 +0200)]
Bug 37274: Use the Toolbar component in all Vue components

We have a Toolbar component that must be used everywhere for
consistency.
This patch adds it when missing:
* ERM/AgreementsShow
Show an agreement

* ERM/EHoldingsLocalPackagesShow
Show a local package
* ERM/EHoldingsLocalTitlesShow
Show a local title

* ERM/LicensesShow
Show a license

* ERM/UsageStatisticsDataProvidersShow
Show a data provider

* Preservation/SettingsProcessingsShow
Show the the settings of a processing (Preservation module)

Confirm that the "Edit" and "Delete" icons are now replaced with buttons
(in a toolbar) on those views.

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 28924: DBRev 24.06.00.016
Katrin Fischer [Thu, 18 Jul 2024 16:07:48 +0000 (16:07 +0000)]
Bug 28924: DBRev 24.06.00.016

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 28924: (QA follow-up) Terminology fixes
Matt Blenkinsop [Mon, 15 Jul 2024 14:09:10 +0000 (14:09 +0000)]
Bug 28924: (QA follow-up) Terminology fixes

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 28924: (QA follow-up): Fix unit tests
Matt Blenkinsop [Fri, 14 Jun 2024 14:47:57 +0000 (14:47 +0000)]
Bug 28924: (QA follow-up): Fix unit tests

Sponsored-by: Cuyahoga County Public Library <https://cuyahogalibrary.org/>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 28924: (QA follow-up): Remove unnecessary template method
Matt Blenkinsop [Fri, 14 Jun 2024 14:47:07 +0000 (14:47 +0000)]
Bug 28924: (QA follow-up): Remove unnecessary template method

Sponsored-by: Cuyahoga County Public Library <https://cuyahogalibrary.org/>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 28924: (QA follow-up): Don't define charge values as 0
Matt Blenkinsop [Fri, 14 Jun 2024 14:46:09 +0000 (14:46 +0000)]
Bug 28924: (QA follow-up): Don't define charge values as 0

Sponsored-by: Cuyahoga County Public Library <https://cuyahogalibrary.org/>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 28924: (QA follow-up) Use $self instead of $patron
Matt Blenkinsop [Fri, 14 Jun 2024 14:45:18 +0000 (14:45 +0000)]
Bug 28924: (QA follow-up) Use $self instead of $patron

Sponsored-by: Cuyahoga County Public Library <https://cuyahogalibrary.org/>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 28924: Add unit tests for new methods and update existing tests
Matt Blenkinsop [Tue, 23 Jan 2024 14:29:35 +0000 (14:29 +0000)]
Bug 28924: Add unit tests for new methods and update existing tests

This commit adds unit tests for the two new methods introduced and also updates all unit tests that use the noissuecharge sysprefs

Test plan:
1. Choose a patron and note their patron category
2. Create a manual invoice on that patron for 6.00
3. Try to check an item out to the patron and it will show a message saying that checkout is blocked because the fine balance is over the limit.
4. This is because the default global value for the â€˜noissuescharge’ is 5.00 and we are now over that limit
5. Navigate to Administration > Patron categories and click to edit the category relevant to your patron
6. At the bottom of the form will be fields called No Issues Charge, No Issues Charge Guarantees and No Issues Charge Guarantors With Guarantees. Set those fields to 7
7. Now try and checkout again - this time you will be allowed to checkout as the category level limit is higher than the fine we set.
8. Choose a different patron (patron 2) with a category that is different to the first patron (patron 1).
9. Repeat steps 2 and 3. This time checkout will be blocked again because the limit for this patron category is still the global value of 5.00
10. Choose a third patron with a category of child or similar (patron 3)
11. Make patron 1 a guarantor for patron 3
12. Edit patron 3’s patron category and set the limit for No Issues Charge, No Issues Charge Guarantees and No Issues Charge Guarantors With Guarantees to 5.
13. Try to check out to patron 3 and it will be blocked due to the fines on patron 1’s account
14. Try to checkout to patron 1 - it should still be possible
15. Add a fine to patron 3’s account for 2.00
16. Try to check out to patron 1 - the checkout will be blocked due to the total of 8 now owed by the patron and its guarantees

Test plan:
prove t/db_dependent/SIP/Transaction.t
prove t/db_dependent/SIP/Patron.t
prove t/db_dependent/Circulation/NoIssuesChargeGuarantees.t
prove t/db_dependent/Koha/Patron.t

Sponsored-by: Cuyahoga County Public Library <https://cuyahogalibrary.org/>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 28924: Add a template method and update template usages
Matt Blenkinsop [Mon, 22 Jan 2024 15:55:57 +0000 (15:55 +0000)]
Bug 28924: Add a template method and update template usages

This patch adds a method to be used in the template where currently the Koha.Preference('noissuescharge') method is used. This currently does not take into account the new patron category level limits and so needs to be updated to its own method to handle these.

Sponsored-by: Cuyahoga County Public Library <https://cuyahogalibrary.org/>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 28924: Update all usages of the current sysprefs
Matt Blenkinsop [Mon, 22 Jan 2024 15:55:19 +0000 (15:55 +0000)]
Bug 28924: Update all usages of the current sysprefs

This patch updates all instances where the current noissuescharge sysprefs are used. They will now use the is_patron_inside_charge_limits method to handle the patron category level limits

Sponsored-by: Cuyahoga County Public Library <https://cuyahogalibrary.org/>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 28924: Add can_borrow and is_patron_inside_charge_limits methods
Matt Blenkinsop [Mon, 22 Jan 2024 15:54:41 +0000 (15:54 +0000)]
Bug 28924: Add can_borrow and is_patron_inside_charge_limits methods

This patch adds two new methods. can_borrow is a top-level method for determining whether a patron is able to borrow. Currently this logic is repeataed in multiple methods and shuld be more DRY. This bug is specific to patron charge limits so that is the focus but the method can be developed in follow-up bugs to cover all areas.
The is_patron_inside_charge_limits method is now to be used where any of the three noissuescharge sysprefs are used. It will look at the patron category based on either a borrowernumber or patron object and return a hash detailing the charges, the charge limit and whether the patron is over the limit

Test plan:
1. Choose a patron and note their patron category
2. Create a manual invoice on that patron for 6.00
3. Try to check an item out to the patron and it will show a message saying that checkout is blocked because the fine balance is over the limit.
4. This is because the default global value for the â€˜noissuescharge’ is 5.00 and we are now over that limit
5. Navigate to Administration > Patron categories and click to edit the category relevant to your patron
6. At the bottom of the form will be fields called No Issues Charge, No Issues Charge Guarantees and No Issues Charge Guarantors With Guarantees. Set those fields to 7
7. Now try and checkout again - this time you will be allowed to checkout as the category level limit is higher than the fine we set.
8. Choose a different patron (patron 2) with a category that is different to the first patron (patron 1).
9. Repeat steps 2 and 3. This time checkout will be blocked again because the limit for this patron category is still the global value of 5.00
10. Choose a third patron with a category of child or similar (patron 3)
11. Make patron 1 a guarantor for patron 3
12. Edit patron 3’s patron category and set the limit for No Issues Charge, No Issues Charge Guarantees and No Issues Charge Guarantors With Guarantees to 5.
13. Try to check out to patron 3 and it will be blocked due to the fines on patron 1’s account
14. Try to checkout to patron 1 - it should still be possible
15. Add a fine to patron 3’s account for 2.00
16. Try to check out to patron 1 - the checkout will be blocked due to the total of 8 now owed by the patron and its guarantees

Sponsored-by: Cuyahoga County Public Library <https://cuyahogalibrary.org/>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 28924: Add new columns to UI and controller
Matt Blenkinsop [Mon, 15 Jul 2024 14:17:40 +0000 (14:17 +0000)]
Bug 28924: Add new columns to UI and controller

This patch adds the columns in the table and also updates the controller to allow these fields to be updated in the database from the UI form

Sponsored-by: Cuyahoga County Public Library <https://cuyahogalibrary.org/>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 28924: Add DBIC file
Matt Blenkinsop [Mon, 22 Jan 2024 12:14:19 +0000 (12:14 +0000)]
Bug 28924: Add DBIC file

Sponsored-by: Cuyahoga County Public Library <https://cuyahogalibrary.org/>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 28924: Add 3 new columns to categories table
Matt Blenkinsop [Mon, 22 Jan 2024 12:14:02 +0000 (12:14 +0000)]
Bug 28924: Add 3 new columns to categories table

This patch adds three new columns to the patron categories table:
noissuescharge
noissueschargegurantees
noissueschargeguarantorswithguarantees

These values will allow charge limits to be set at category level rather than globally for all patrons. If the values are not set at category level then the system will use the global level values

Sponsored-by: Cuyahoga County Public Library <https://cuyahogalibrary.org/>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 36641: Fix tests
Tomas Cohen Arazi [Mon, 15 Jul 2024 18:38:47 +0000 (15:38 -0300)]
Bug 36641: Fix tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 36641: (follow-up) Ensure limited return works
Martin Renvoize [Sat, 13 Jul 2024 12:12:09 +0000 (13:12 +0100)]
Bug 36641: (follow-up) Ensure limited return works

We have a ?rules=a,b parameter available for specifying a subset of
rules in the set to return. This patch adds a test to confirm that works
(and fixes the controller and specification as the test proved it wasn't
working)

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 36641: Unit tests for effective=0
Martin Renvoize [Fri, 12 Jul 2024 09:16:08 +0000 (10:16 +0100)]
Bug 36641: Unit tests for effective=0

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 36641: Ensure we return all keys
Martin Renvoize [Fri, 12 Jul 2024 14:14:01 +0000 (15:14 +0100)]
Bug 36641: Ensure we return all keys

When using the effective route, we were missing some rule kinds if a
rule hadn't yet been defined for them. We should instead return the rule
as undefined.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 36641: Return '*' for 'default rule'
Martin Renvoize [Fri, 12 Jul 2024 09:15:44 +0000 (10:15 +0100)]
Bug 36641: Return '*' for 'default rule'

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 36641: Optionally filter to default rules using *
Martin Renvoize [Thu, 11 Jul 2024 17:01:50 +0000 (18:01 +0100)]
Bug 36641: Optionally filter to default rules using *

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 36641: (follow-up) Update to allow returning non-effective rules
Martin Renvoize [Mon, 8 Jul 2024 15:54:00 +0000 (16:54 +0100)]
Bug 36641: (follow-up) Update to allow returning non-effective rules

This patch updates the existing /circulation_rules endpoint introduced
in this patchset to allow return of all rule sets rather than only the
effective set.

We continue to default to the effective set for the parameters passed
which will mean by default you will get an arrayref containing one
hashref entry with each rule kind as a key in that hashref.

However, if you add 'effective=false' as a query parameter, you will now
have an arrayref of all rule sets that match your passed criteria
including rules that may have fallen back to defaults in the effective
case.

WIP: Need to add support for * in branch, itemtype, patron category
query parameters to allow explicit return of default rules vs no filter
passed. (i.e. for the effective=false case where all rules for should be
returned when no filters are passed vs * passed to filter to just default
rules vs specifics passed for branch/item/patron filtering.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 36641: (QA follow-up) Fix variable name
Kyle M Hall [Tue, 2 Jul 2024 17:47:03 +0000 (13:47 -0400)]
Bug 36641: (QA follow-up) Fix variable name

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 36641: (follow-up) Wrap in a try/catch block
Martin Renvoize [Tue, 2 Jul 2024 15:19:19 +0000 (16:19 +0100)]
Bug 36641: (follow-up) Wrap in a try/catch block

This patch adds the missing try/catch and unhandled exception error
handler to the new list_effective_rules endpoint.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 36641: Make tests cover all code paths
Tomas Cohen Arazi [Tue, 2 Jul 2024 13:12:35 +0000 (10:12 -0300)]
Bug 36641: Make tests cover all code paths

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 36641: Harmonize parameter names
Tomas Cohen Arazi [Tue, 2 Jul 2024 12:50:15 +0000 (09:50 -0300)]
Bug 36641: Harmonize parameter names

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 36641: Add endpoint for fetching circulation rules
Martin Renvoize [Thu, 18 Apr 2024 12:45:55 +0000 (13:45 +0100)]
Bug 36641: Add endpoint for fetching circulation rules

This patch adds an endpoint for fetching ciruclations rules given the
constraints of the passed parameters.

We optionally expect item_type, library and patron_category as query
parameters and we return a list of relevant circulation rules pertaining
to that combination of requirements.

You can also add a list of `rules` as a query parameter to limit the
response to only the rules you are interested in for this combination.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 36641: Add unit tests for /circulation_rules
Martin Renvoize [Mon, 24 Jun 2024 15:29:44 +0000 (16:29 +0100)]
Bug 36641: Add unit tests for /circulation_rules

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 36641: Introduce render_invalid_parameter_value helper
Martin Renvoize [Mon, 24 Jun 2024 15:04:01 +0000 (16:04 +0100)]
Bug 36641: Introduce render_invalid_parameter_value helper

This patch introduces a new 'render_invalid_parameter_value' helper
method that accepts 'path' and 'values' parameters to denote which field
has failed validation and where the end user can get valid options.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 37332: Fix unseen and customer renewal date parameters in svc
Emily Lamancusa [Tue, 16 Jul 2024 14:36:23 +0000 (10:36 -0400)]
Bug 37332: Fix unseen and customer renewal date parameters in svc

To test:
0. Enable unseen renewals
    i. Set the system preference UnseenRenewals to Allowed
    ii. Edit the circulation rules to specify the maximum number of
        unseen renewals allowed
1. Check out an item to a patron
2. In the checkouts table on that patron's account, check the "Renew"
   checkbox for that item
3. Select a custom renewal date using the Renewal due date flatpicker
4. Check the checkbox labeled "Renew as unseen if appropriate"
4. Click Renew selected items
--> The item renews, but its new due date follows the renewal period
    specified in the circulation rules, regardless of what date was
    entered in the Renewal due date field
--> The checkout still has all of its unseen renewals remaining,
    indicating that the renewal was not processed as an unseen renewal
5. Enter another custom renewal date and renew checkout with the Renew
   all button
--> Same result
6. Apply patch and restart_all
7. Repeat test plan
--> Custom renewal date is now respected
--> Number of unseen renewals remaining decreases when "Renew as unseen"
    checkbox is checked
8. Renew the item with the "Renew as unseen" checkbox unchecked
--> Confirm that number of unseen renewals is reset (i.e. the checkout
    once again has all of its unseen renewals remaining), indicating
    that the renewal was processed as a "seen" renewal

Signed-off-by: CJ Lynce <cj.lynce@westlakelibrary.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 36453: DBRev 24.06.00.015
Katrin Fischer [Thu, 18 Jul 2024 15:37:08 +0000 (15:37 +0000)]
Bug 36453: DBRev 24.06.00.015

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 36453: (QA follow-up) Use varchar instead of mediumtext
Pedro Amorim [Wed, 3 Jul 2024 09:59:54 +0000 (09:59 +0000)]
Bug 36453: (QA follow-up) Use varchar instead of mediumtext

Test plan:
1) ktd down
2) DB_IMAGE=mysql:8.0 ktd up
3) Should now work with no issues

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 36453: (QA follow-up) Address upgraded instances
Pedro Amorim [Wed, 3 Jul 2024 10:36:56 +0000 (10:36 +0000)]
Bug 36453: (QA follow-up) Address upgraded instances

To test:
1) Apply only this patch, skipping the next one (patch 'Use varchar instead of mediumtext')
2) Run ktd up with default DBMS mariadb:10.5: ktd up
3) Confirm the database state is wrong:
  DESC categories BlockExpiredPatronOpacActions;
  ^ This should return type = mediumtext
4) Run updatedatabase, make sure green success message shows
  Running the above query again will show type = varchar(128)
5) Run updatedatabase again, notice blue info message notifies its already varchar

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 37368: Add 'library' to patron search embed
Martin Renvoize [Wed, 17 Jul 2024 15:43:17 +0000 (16:43 +0100)]
Bug 37368: Add 'library' to patron search embed

This patch adds the missing library embed from the patron search forms.
This embed is required for the case where a patron is missing both first
and last name or is from a different library group and thus falls into
the 'Patron from library X' block.

I also update the 'Patron from library X' to 'Patron from X' as I feel
it reads more clearly.

Finally, we need to sync the available embeds to ensure 'library' is
embeddable from the different endpoints this search can be triggered on.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 37342: Use get for launching authority popup
Nick Clemens [Fri, 12 Jul 2024 12:40:08 +0000 (12:40 +0000)]
Bug 37342: Use get for launching authority popup

This patch simply switches to a GET as the operation is not cud

To test:
 1 - Go to cataloging -> new record
 2 - If not in basic editor, switch
 3 - Go to tab 100
 4 - Enter a name that has no authority in your system: McNotExist, Falsy
 5 - Click 'Link authorities automatically'
 6 - subfield 9 should turn red, and have an X and a + button
 7 - Click the green +
 8 - Boom
 9 - Apply patch
10 - Reload page and repeat (clear cache so js reloads)
11 - Success! Authority window launches

Signed-off-by: Jake Deery <jake.deery@ptfs-europe.com>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 37404: Typo in intranetreadinghistory description
Caroline Cyr La Rose [Thu, 18 Jul 2024 14:58:32 +0000 (10:58 -0400)]
Bug 37404: Typo in intranetreadinghistory description

This patch corrects an error in the description of the
intranetreadinghistory system preference description.

To test:
1. Apply patch
2. Go to Administration > System preferences > Patrons
3. Look at the description of intranetreadinghistory
   --> It should say "... access a patron's checkout history..."
4. Make sure the description's spelling and grammar is correct

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 37294: Add modal to generate next
Lucas Gass [Tue, 9 Jul 2024 20:19:05 +0000 (20:19 +0000)]
Bug 37294: Add modal to generate next

To test:
1. Serials -> Create or find a subscription
2. Receive the subscription
3. Save
4. Click 'Generate next'
5. Nothing happens
6. APPLY PATCH
7. Try again, now the "Generate next" button should work as expected.

Signed-off-by: Kelly <kelly@bywatersoutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 37275: (QA follow-up): Add &nbsp; to add spacing between selected user and button
Pedro Amorim [Thu, 11 Jul 2024 16:50:43 +0000 (16:50 +0000)]
Bug 37275: (QA follow-up): Add &nbsp; to add spacing between selected user and button

Follow original test plan and apply first patch.
Select a user and notice the patron's name and the button have no spacing.
Apply this patch.
Notice there is now spacing.

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 37275: Removed parenthesis from Select user button in ERM
Eric Garcia [Thu, 11 Jul 2024 15:45:27 +0000 (15:45 +0000)]
Bug 37275: Removed parenthesis from Select user button in ERM

To test:
1. Apply patch and yarn build
2. In system preferences search and enable ERMModule
3. E-resource management -> Agreements -> New agreement
4. Click Add new user and notice the parenthesis around the +Select user button are removed

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 32530: When duplicating child card, guarantor is not saved
Baptiste Wojtkowski [Thu, 11 Jul 2024 14:54:59 +0000 (16:54 +0200)]
Bug 32530: When duplicating child card, guarantor is not saved

When duplicating a child card with a guarantor, the guarantor information
appears during the card creation process, but disappears as soon as saving
the card. To recreate:

1. Find a card with a guarantor, either patron or non-patron guarantor.
2. Duplicate the card. Note that it appears to be working on the card
   creation screen.
3. Save the patron after completing the form. The guarantor is now gone.

New test plan:
1. Find a card with a guarantor, either patron or non-patron guarantor.
2. Duplicate the card. Note that it appears to be working on the card
   creation screen.
3. Save the patron after completing the form. The guarantor is now gone.
Apply patch and repeat, the guarantor should stay after 3.

Note, I may not have understood the code but it looks like nothing is
searching for the content of the displayed information. Therefore I add
hidden fields that are copies of those provided in guarantor_template
class

Signed-off-by: Emmi Takkinen <emmi.takkinen@koha-suomi.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 37337: Pass the save $op when biblio_exists
Lucas Gass [Thu, 11 Jul 2024 22:11:35 +0000 (22:11 +0000)]
Bug 37337: Pass the save $op when biblio_exists

To test:
1. Go to suggestions in the staff interface and enter a new suggestion.
2. Enter a title that matches something already in the catalog. In k-t-d I used "Lanark".
3. Submit the suggestion.
4. Get a blank page.
5. APPLY PATCH and restart_all
6. Now after step 3 you should get a page that shows the 'Click on "Confirm your suggestion" to ignore this message." warning, the form, and a Confirm your suggestion button.

Signed-off-by: Jake Deery <jake.deery@ptfs-europe.com>
Signed-off-by: Jan Kissig <jkissig@th-wildau.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 37333: Group search terms in a saved filter
Nick Clemens [Thu, 11 Jul 2024 19:38:16 +0000 (19:38 +0000)]
Bug 37333: Group search terms in a saved filter

This patch surrounds the expanded query of a search filter in parnetheses to correctly
group the terms when searching

To test:
 1 - Enable system preference SavedSearchFilters
 2 - In staff client, perform an advanced search for:
     subject:internet OR subject:programming
 3 - Note results
 4 - Save search as filter, enabled in staff client and opac
 5 - Search for 'a'
 6 - Apply filter from top of facets on left hand side
 7 - Note results didn't change
 8 - Apply patch, restart all
 9 - Reload search, it now limits correctly
10 - Test on OPAC
11 - Test on both Zebra and Elastic
12 - Sign off :-)

Signed-off-by: Jake Deery <jake.deery@ptfs-europe.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 37339: Set messaging preferences from default on self registration
Nick Clemens [Fri, 12 Jul 2024 14:00:49 +0000 (14:00 +0000)]
Bug 37339: Set messaging preferences from default on self registration

The change on bug 30318 prevented setting the default messaging preferences when none were passed.
Self registration relied on this for setting borrower preferences from the defaults.

This patch removes the call to handle_form_action and replaces it with a call to:
SetMessagingPreferencesFromDefault

To test:
 1 - Ensure self registration is enabled
 2 - Set default messaging preferences for the self registration category
 3 - Self register a patron from the OPAC, confirm defaults not set
 4 - Apply patch, restart all
 5 - Self register a patron
 6 - Confirm defaults have been set
 7 - Enable  PatronSelfRegistrationVerifyByEmail
 8 - Self register a patron on OPAC with an email
 9 - Find the email and grab the verification link (unless you have emails enabled)
     SELECT * FROM message_queue;
10 - Visit the link and confirm registration
11 - Confirm messaging defaults are set

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 37345: Only toggle_onsite_checkout() if OnSiteCheckoutAutoCheck is enabled
Lucas Gass [Mon, 15 Jul 2024 16:20:15 +0000 (16:20 +0000)]
Bug 37345: Only toggle_onsite_checkout() if OnSiteCheckoutAutoCheck is enabled

To test:
1. Find an item to checkout and a patron to check out to.
2. Set a due manually: "Specify due date (MM/DD/YYYY):"
3. Before checking out click the "Remember for session:" checkbox.
4. Check the item out.
5. The specific due date is not retained.
6. APPLY PATCH
7. Try 1 -4 again, now the date should be sticking.
8. Turn on the OnSiteCheckouts system pref and make sure it still works
9. Turn on the  OnSiteCheckoutAutoCheck system pref and make sure the on-site checkbox is still checked after doing an on-site checkout.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 37357: Map @ to 00 for control field select lists
David Cook [Mon, 15 Jul 2024 03:59:23 +0000 (03:59 +0000)]
Bug 37357: Map @ to 00 for control field select lists

This change adds the existing @ to 00 mapping for control fields
to work for authorized value select lists as well.

Test plan:
0. Apply the patch
1. koha-plack --reload kohadev
2. Make 001 subfield @ mandatory and give
it an authorised value of branches for Default framework
3. Go to the New record editor for a Default record
4. Click "Save"
5. Note that the editor prompts you to fill in the 001 field
6. Fill in required fields and click "Save"
7. Note that all data is captured correctly
8. prove t/db_dependent/Koha/UI/Form/Builder/Biblio.t

To prove that this wouldn't work without the patch, try the test
plan on a different branch without this patch. You won't be prompted
to fill in mandatory fields and the record will just save (or if a
possible duplicate is detected it will just redirect you back to an empty
editor)

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 37192: Adjust template for additem.tt
Lucas Gass [Thu, 11 Jul 2024 16:12:29 +0000 (16:12 +0000)]
Bug 37192: Adjust template for additem.tt

Test plan:
1. Search the catalog for something that will return results, like Perl
2. On any bib that has at least one item, click Edit items
3. In the Actions menu to the left of any item, choose Print label
4. That opened a popup with a 500 error rather than a label batch editor
5. Apply patch, restart_all
6. Repeat step 3, but this time you'll get a label batch editor with your
   item in it.

Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 37192: Add ability to pass data-new_tab to form-submit.js and open in new tab
Lucas Gass [Thu, 11 Jul 2024 16:11:43 +0000 (16:11 +0000)]
Bug 37192: Add ability to pass data-new_tab to form-submit.js and open in new tab

Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 37290: Fix data-branch param
Janusz Kaczmarek [Tue, 9 Jul 2024 13:37:50 +0000 (13:37 +0000)]
Bug 37290: Fix data-branch param

1) Add circulation rules for a specific library
2) Attempt to remove one of those library specific rules -> get redirected to 'All'
3) Notice the rule for that specific branch is still there

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Emmi Takkinen <emmi.takkinen@koha-suomi.fi>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 29560: (follow-up) Add id to checkbox
Katrin Fischer [Mon, 15 Jul 2024 11:53:36 +0000 (11:53 +0000)]
Bug 29560: (follow-up) Add id to checkbox

This will allow to hide the checkbox if changing the MARC
record is not wanted.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 29560: (follow-up) Clean up trailing comma
Martin Renvoize [Mon, 15 Jul 2024 10:24:13 +0000 (11:24 +0100)]
Bug 29560: (follow-up) Clean up trailing comma

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 29560: Unit tests: API
Martin Renvoize [Thu, 11 Jul 2024 13:11:43 +0000 (14:11 +0100)]
Bug 29560: Unit tests: API

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 29560: Unit tests
Martin Renvoize [Wed, 10 Jul 2024 12:40:16 +0000 (13:40 +0100)]
Bug 29560: Unit tests

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 29560: (follow-up) Split prepare and store logic
Martin Renvoize [Wed, 10 Jul 2024 11:22:06 +0000 (12:22 +0100)]
Bug 29560: (follow-up) Split prepare and store logic

This allows for future removal of C4::Biblio::prepare_marc_host by
splitting the logic for generating the host field and storing the link
in the child record.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>