Commit graph

54494 commits

Author SHA1 Message Date
e38e4bee94
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>
2024-07-22 09:57:11 +01:00
ed8aed912c
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>
2024-07-22 09:57:04 +01:00
Andreas Roussos
24e54b1fd4
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>
2024-07-22 09:56:14 +01:00
Eric Garcia
54575f3c30
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>
2024-07-22 07:37:24 +01:00
7f5e1fac86
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>
2024-07-22 07:36:38 +01:00
44d3762a69
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>
2024-07-22 07:36:32 +01:00
8c804c1749
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>
2024-07-22 07:36:23 +01:00
6a321c6ee4
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>
2024-07-22 07:35:31 +01:00
554efbe354
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>
2024-07-22 07:34:48 +01:00
58838fc263
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>
2024-07-22 07:34:12 +01:00
6c56d3d90b
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>
2024-07-22 07:34:02 +01:00
bae3203f70
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>
2024-07-22 07:33:23 +01:00
f723c33d48
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>
2024-07-22 07:33:18 +01:00
0f04c9a26a
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>
2024-07-22 07:33:13 +01:00
7e1de5b557
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>
2024-07-22 07:33:08 +01:00
1d6f3c4cbe
Bug 37270: (follow-up) Fix mixed quotes in preview modal JS
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2024-07-22 07:32:26 +01:00
44d0703b4a
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>
2024-07-22 07:32:21 +01:00
Brendan Lawlor
f80cc53470
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>
2024-07-22 07:26:42 +01:00
72d2b7e42b
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.
2024-07-19 14:02:28 +01:00
25c232e3b6
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>
2024-07-18 18:25:58 +02:00
e81f7e2ef2
Bug 28924: DBRev 24.06.00.016
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-07-18 18:25:58 +02:00
f070a48040
Bug 28924: (QA follow-up) Terminology fixes
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-07-18 18:25:57 +02:00
e147f7b60c
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>
2024-07-18 18:25:57 +02:00
132b22bbfa
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>
2024-07-18 18:25:56 +02:00
08328a5d3a
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>
2024-07-18 18:25:55 +02:00
b3b7f82fef
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>
2024-07-18 18:25:55 +02:00
c76dc7fb08
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>
2024-07-18 18:25:54 +02:00
f215fe5370
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>
2024-07-18 18:25:53 +02:00
ddaa75ecd4
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>
2024-07-18 18:25:53 +02:00
37057ade8b
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>
2024-07-18 18:25:52 +02:00
64783a6f10
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>
2024-07-18 18:25:52 +02:00
eed4bc2379
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>
2024-07-18 18:25:51 +02:00
77569e30fe
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>
2024-07-18 18:25:50 +02:00
0658dadc90
Bug 36641: Fix tests
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-07-18 18:25:50 +02:00
a0f7c4c33b
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>
2024-07-18 18:25:49 +02:00
0990a6d66b
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>
2024-07-18 18:25:49 +02:00
e9eabc0a66
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>
2024-07-18 18:25:48 +02:00
8754e100f4
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>
2024-07-18 18:25:47 +02:00
d34a6046a6
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>
2024-07-18 18:25:47 +02:00
6ea5bf73ee
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>
2024-07-18 18:25:46 +02:00
0db8f86fb3
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>
2024-07-18 18:25:46 +02:00
1fa16a527e
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>
2024-07-18 18:25:45 +02:00
0283b5a485
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>
2024-07-18 18:25:44 +02:00
41a06b7178
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>
2024-07-18 18:25:44 +02:00
529c483a24
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>
2024-07-18 18:25:43 +02:00
3853f0ea77
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>
2024-07-18 18:25:42 +02:00
dca5e04165
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>
2024-07-18 18:25:42 +02:00
Emily Lamancusa
baa6814753
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>
2024-07-18 17:53:18 +02:00
24ac009bbb
Bug 36453: DBRev 24.06.00.015
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-07-18 17:53:18 +02:00
b20d919e00
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>
2024-07-18 17:53:17 +02:00