Commit graph

50734 commits

Author SHA1 Message Date
684b059b19 Bug 35890: Reject login if IP is not valid
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2024-02-21 20:57:20 +00:00
b3f2d2182e Bug 35890: Remove var loggedin
It is never used and add confusion

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2024-02-21 20:57:20 +00:00
2b785bb429 Bug 35904: (QA follow-up): tidy up code
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2024-02-21 20:55:50 +00:00
9da4e2a6c8 Bug 35904: Make C4::Auth::checkauth testable easily
This patch suggests to add a new flag do_not_print to
C4::Auth::checkauth to not print the headers and allow to test this
subroutine more easily.

We do no longer need to mock safe_exit and redirect STDOUT to test its
return values.

There are still 3 left:
1.
733         # checkauth will redirect and safe_exit if not authenticated and not authorized
=> Better to keep this one, not trivial to replace

2.
806         # This will fail on permissions
This should be replaced but testing $template->{VARS}->{nopermission}
fails, I dont' think the comment is better.

3.
828         # Patron does not have the borrowers permission
Same as 2.

2. and 3. should be investigated a bit more.

This patch also move duplicated code to set patron's password to a
subroutine set_weak_password.

Test plan:
Read the code and confirm that everything makes sense.
QA: Do you have a better way for this? Yes it's dirty!

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2024-02-21 20:55:50 +00:00
80822f7689 Bug 36034: Add test
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-02-20 18:01:14 +00:00
Andreas Jonsson
3280e5a99d Bug 36034: (bug 34893 follow-up) fix capture of return values from checkpw
Adapt code to the change of return value type of checkpw
introduced in bug 34893

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-02-20 18:01:14 +00:00
252ccbabc8 Bug 35507: Add verbose parameters in Koha::Plugins
Yet another approach ;)
Driemaal is scheepsrecht / Third time lucky..

Test plan:
Run prove $(git grep -l Koha::Plugin | grep -P "^t\/db")

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit d59bf322e9)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 4fb9fad791)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-02-14 16:29:01 +00:00
313f508544 Bug 35507: Plugins.t - Mock SessionStorage, remove KitchenSink
Removing the CGI::Session behavior to auto-commit by mocking
SessionStorage makes that the $plugin->test_template does no
longer commit.

Since KitchenSink includes a CREATE TABLE, removing that code
removes the second implicit commit. We might move that code
to its own script?

Adds a missing rollback too at the end.

Test plan:
Run prove t/db_dependent/Koha/Plugins/Plugins.t
Verify that no records got added to plugin_data/methods table.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit dc62d9bed5)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit bfb2a929e3)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-02-14 16:29:01 +00:00
Caroline Cyr La Rose
c81e5dc0ba Bug 35596: Error in writeoff_debts documentation
This patch corrects an error in the documentation of the
writeoff_debts.pl script. The --type parameter accepts debit type codes,
not credit type codes.

To test:
-  Run ./misc/cronjobs/writeoff_debts.pl
-  Make sure the sentence for --type makes sense, grammar and spelling
   are correct

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 633533049a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 97cc3285bd)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-02-14 15:16:15 +00:00
8f510d2ecd Bug 35962: (bug 35843 follow-up 2) Fix BackgroundJob.t on D10
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-02-13 15:37:21 +00:00
0f942e0b77 Bug 35962: (bug 35843 follow-up) Fix BackgroundJob.t on D10
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-02-13 15:37:21 +00:00
9ffbb7b324 Revert "Bug 34979: Add unit test for comparing YAMl files with sysprefs.sql"
This reverts commit 0aa7df0395.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-02-12 16:03:08 +00:00
Katrin Fischer
ae8335b2cd Bug 35373: Remove false FIXME comment from gather_print_notices.pl
Removes a FIXME line mentioning bug 8000 that implemented
SendAllEmailsTo. But the note was added to the "From" line
and the "To" address is taken from a command line parameter.

To test:
* Review change carefully

Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 898d96adb9)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 1baddec5be)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-02-09 20:46:17 +00:00
Katrin Fischer
098e2daab5 Bug 35354: Update description of EmailLibrarianWhenHoldisPlaced system preference
This includes more information about the email addresses
used in the system preference description.

To test:
* Search for EmailLibrarianWhenHoldisPlaced in administration >
  system preferences
* Verify description
* Apply patch
* Verify improved description and that the links work as expected

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>
(cherry picked from commit a2a284c7f5)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 3d12b0aa69)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-02-09 20:44:19 +00:00
8428957247 Bug 35701: (follow-up) Fix last instance of t variable
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 976f5e7ce6)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 63dec2431f)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-02-09 20:41:41 +00:00
0959db5147 Bug 35701: Do not use t
To not interfer with the t from I18N

On bug 35329 we are using the I18N TT plugin that is providing the 't'
subroutine.

This loop is redefining the subroutine, therefore it is not longer
accessible.

Test plan:
Edit a patron and confirm the the "Title" dropdown still contain the
different values of syspref BorrowersTitles.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 50904b219e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 66bf6e5e0e)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-02-09 20:41:41 +00:00
98fcce052e Bug 35835: Fix shebang in cataloguing/ysearch.pl
Speaks for itself.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit f34a639c58)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 473bc55a63)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-02-09 20:36:20 +00:00
851a0d98a2 Bug 33457: (follow-up) Simplify even further
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit cd18b2e6fc)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 17c3b15c2e)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-02-09 20:29:36 +00:00
fc0105aa50 Bug 33457: (QA follow-up) Use js-patron-format instead
This patch updates the code to use the $patron_to_html js function
rather than replicating it locally.. this means if in the future we
introduce further fixes/improvements to the display they're affect here
too.

Test plan
1) As for the original implementation, confirm the fix is still fixed

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 4732d10809)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 26c27bd65d)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-02-09 20:29:35 +00:00
b0985ad3a4 Bug 33457: Improve display of fund users when the patron has no firstname
This patch updates the way the fund modification page handles patron
names so that a patron with only a first name or only a surname will
have their name appear correctly when selected as a manager or a user.

To test, apply the patch if necessary, create a patron with only a first
name and one with only a surname and give them acquisitions permissions.

- Go to Administration -> Funds.
- Edit a fund.
- Click 'Add users'.
- Select a user, only staff users will be searchable
- Select one of the patrons you created.
  - The patron name should appear correctly
  - Test with both your first name only patron and your last name only
    patron.
- Perform the same test with the 'Select owner' process.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 00ed806d20)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit c5dc3cf3f4)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-02-09 20:29:35 +00:00
26ae878737 Bug 35865: Add missing hint about permissions when adding managers to a basket
When searching for managers for an acquisition basket, the list of patrons is
limited to patrons with the baskets_managers permission. For other patron
searches there is a hint about the restriction but it does not appear here.

Test plan;
Edit a basket, click "Add user" to select a manager.
Notice the hint about the permission.

Signed-off-by: Loïc Vassaux--Artur <loic.vassaux-artur@outlook.fr>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 8a478f912f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit a50ab3e6dd)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-02-09 20:26:53 +00:00
49256cb484 Bug 35817: Fix hint on patron's category when batch update patron
When a patron's attribute is limited to a given patron's category, the
batch patron modification tool will display a hint "This attribute will
be only applied to the patron's category %s". But this is followed by
the description of the patron's attribute, not the patron's category.

Test plan:
Create a patron's attribute "Color of hair" and select a patron
category (Patron).
Batch edit batch and select "Color of hair"
A hint will be display.
=> Without this patch the hint is "This attribute will be only applied
   to the patron's category Color of hair"
=> With this patch it will be corrected to "This attribute will be only
   applied to the patron's category Patron"

Signed-off-by: Anneli Österman <anneli.osterman@koha-suomi.fi>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 074684eaf4)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 5809d746d4)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-02-09 20:22:31 +00:00
caa21f9fba Bug 35695: Remove useless JS from cataloging_additem.js
To test:
1. APPLY PATCH
2. Turn on EnableItemGroups
3. Go to a record with item groups, or create some.
4. Add an item, making sure items can be added to a group. ( Bug 33639 must be applied )

If I am wrong and this code should stay, tell me. I'll fix the jQuery instead of removing it. :)

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>
(cherry picked from commit cbc97f5c68)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 5ab508d792)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-02-09 20:18:46 +00:00
0c3e0b2f0e Bug 35461: Fix function call parameters causing the HASH to show in the renew all responses
"Renew All" -function aka. 65-66-messages work like this: 66-return messages has renewed items in BM-fields and non-renewables go into BN-fields.

If all items were renewable, then the reply message looks like:

Reply:
13.07.2022 10:06:17:530 OUTESTI1 6610005000020220713 100616AOOUPK|BM564N15977171|BM564N09203960|BM564N23261720|BM564N25161958|BM564N23455012|C4::SIP::SIPServer=HASHC4::SIP::SIPServer=HASHAY6AZCEFE

If items include renewables and non-renewables, the response includes the renewed  items first, then a HASH mixed into the first BN-field, then rest of the renewed ones like they should show in BN-fields and after that, anohter HASH:

13.07.2022 14:41:32:610 OUTESTI1 6610003000420220713 144130AOOUPK|BM564N23455012|BM564N23261720|BM564N25161958|C4::SIP::SIPServer=HASHBN564N09203960|BN564N04191259|BN564N15977171|BN564N13788332|C4::SIP::SIPServer=HASHAY8AZC7C5

If all loans were unrenewable (this test included just one item), you first get a HASH in a BN-field, and another at the end.

13.07.2022 14:49:00:037 OUTESTI1 6610000000120220713 144858AOOUPK|C4::SIP::SIPServer=HASHBN564N19874533|C4::SIP::SIPServer=HASHAY9AZDD3B

Our self checkout/checkin machine can handle/parse these reply messages correctly, but this might not be the case with all self checkout/checkin devices.

Test Plan:
1) Unit test patch
2) prove t/db_dependent/SIP/Message.t
3) Note failures
4) Apply this patch
5) prove t/db_dependent/SIP/Message.t
6) Tests pass!

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: lmstrand <lmstrand@gmail.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit bb7fc5025b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit a51094a715)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-02-09 20:12:35 +00:00
431942ce17 Bug 35461: Add unit tests
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit e70e1f8a17)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 52d43922b8)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-02-09 20:12:35 +00:00
7bc5eaa00c Bug 35360: Make HTML/buttons consistent on waitingreserves.tt
To test:
0. Turn on hold cancellation requests in Administration -> Circulation rules.
1. Have some holds that are waiting, waiting over expiration date, and cancelled waiting holds. In order to create holds waiting over expiration date, if you are in ktd, you can use SQL to update the expirationdate in reserves: UPDATE reserves SET expirationdate="2022-01-01" WHERE reserve_id=1; (make sure it's the correct reserve_id!)
1a. If you are not using ktd, you will need to set ReservesMaxPickUpDelay to 0 days, then return the reserved item and then wait one day before it will be marked as over expiration date.
1b. In order to create cancelled waiting holds, you will need to send a cancel request over the OPAC, that is, reserve something after logging in to the OPAC, return it in the staff interface, and then go to the OPAC -> Your Account -> Holds -> click Cancel on the waiting hold.
2. Notice the differences between the 3 tables and their related buttons:
-Holds waiting
-Holds waiting past their expiration date
-Holds with cancellation requests

-Holds waiting includes a 'Canceled selected' button at the top of the table. It is with in a #toolbar.

-Holds waiting past their expiration date includes a 'Cancel selected' and a 'Cancel all' button. None are within a #toolbar. The 'Cancel selected' here lacks a Bootstrap .btn class. The 'Cancel all' button does have a .btn class.

-Holds with cancellation requests has neither a 'Cancel selected' or a 'Cancel all' button.

3. APPLY PATCH
4. Look again and the tables/buttons should be more consistent.
5. The 'Holds with cancellation requests: X' tab should now include a 'Cancel selected (X)' button. Make sure is works.
6. Make sure TransferWhenCancelAllWaitingHolds is set to "Don't transfer" and make sure the hint displays well in the Holds over table.

Signed-off-by: Philip Orr <philip.orr@lmscloud.de>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit fea69c8607)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit e0d5c13cf1)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-02-09 20:04:49 +00:00
Katrin Fischer
0aa7df0395 Bug 34979: Add unit test for comparing YAMl files with sysprefs.sql
The unit tests will help to detect any discrepancies
and missing entries in the YAML and sysprefs.sql files.

To test:
* Apply only this patch
* prove -v t/db_dependent/check_sysprefs.t
* It will fail.
* Apply other patches
* Run database update
* Re-run test. It should pass now.
* Recreate your database or reset_all with patches applied.
* System preferences should be installed correctly.
* Test should still pass.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 06ba285562)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit a1da7ef8f8)
2024-02-09 20:01:14 +00:00
0fe1d40ef4 Bug 34647: (follow-up) Minor fixes
This patch fixes the functionality of the <select> menu for jumping to a
particular vendor, "Choose a vendor in the list to jump directly to the
right place."

The patch also removes the empty anchor tag on the "Items with no
checkouts" report. It appears to be unused.

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit f3a069ad7f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit b545b9424c)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-02-08 20:21:02 +00:00
76f7389f7b Bug 34647: Delete unnecessary anchor tag
This patch removes an anchor tag from the form that does not seem to
serve any purpose. The form has an id attribute and it is this that
appears to be used for navigation to and displaying the form.

Test plan:
1) Navigate to Cataloging > marc modification templates
2) Add a new template or edit an existing one
3) The form to add a new action should be displayed when either the
   "New action" button is clicked or you select to edit an existing
   action

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit a317923bfd)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 68336a8d4b)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-02-08 20:21:02 +00:00
4fc799c765 Bug 34647: Replace name attributes with ids
This patch replaces name attributes on <a> tags as this is now obsolete
in HTML 5. The recommended practice is to substitute these for ids, as
has been done in this patch

Test plan:
1) Navigate to each page where the link has been amended
2) Check that the link still works as expected

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 8a07455e3b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 7317b66b5a)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-02-08 20:21:02 +00:00
8c19934323 Bug 35894: Remove duplicate link
This patch deletes a link that appears to be an unnecessary duplicate
in the template file. The link does not appear in the UI and serves no
obvious purpose

Test plan:
1) Navigate to Acquisitions and click Search next to the vendors field
2) Click on a vendor name and the navigation should still work as
   intended, taking you to the Vendor's details page.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit f931a0ac80)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit b2e5be2b13)
2024-02-08 18:57:31 +00:00
Andreas Jonsson
c5a941f44f Bug 30627: Verify --days parameter and use find command to select old backups for deletion
Test plan

* Create some old fake backups:

backuproot=/var/spool/koha
instance=kohadev

backupdir="$backuproot"/"$instance"

for i in 1 2 3 4 ; do
   for j in sql tar xxx ; do
      file="$backupdir"/"$instance"-$(date -I -d "- $i day").${j}.gz
      if ! test -e "$file" ; then
         touch -t "$(date +%Y%m%d%H%M -d "- $i day")" "$file"
      fi
   done
done

* Verify that --days parameter is validated

sudo koha-run-backups --days 0
sudo koha-run-backups --days foo

* Run backup

sudo koha-run-backups --days 3

* Verify that backups from 3 days have been preserved and older backups have been deleted
* Verify that filenames that do not match the pattern (the .xxx.gz files) are preserved

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit b2e5efbdae)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit cadf36dc5f)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-02-08 18:56:19 +00:00
Janik Hilser
ff3b281df9 Bug 29930: Cardnumber incorrectly set to userid on LDAP auth if cardnumber not mapped
In the sub the userId was given, but the cardnumber was expected, therefore at every login the cardnumber changed to the userId.

To test:
1. Login to the OPAC with an LDAP account that has a cardnumber which is different to the userId
2. Check the patron record's cardnumber.
3. The cardnumber should equal to the userId
4. Apply the patch.
5. Login to the OPAC with an LDAP account that has a cardnumber which is different to the userId
6. Check the patron record's cardnumber.
7. The cardnumber should be the same as before

Signed-off-by: Alexander Wagner <alexander.wagner@desy.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Extra test plan:
1. Apply the regression tests
2. Run:
   $ ktd --shell
  k$ prove t/db_dependent/Auth_with_ldap.t
=> FAIL: Tests fail! 'cardnumber' incorrectly overwritten
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests now pass!
5. Sign off :-D

Signed-off-by: Alexander Wagner <alexander.wagner@desy.de>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 6341d520ac)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 884e3d5fe0)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-02-08 18:54:06 +00:00
fc2646a317 Bug 29930: Regression tests
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Alexander Wagner <alexander.wagner@desy.de>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit fe006e535d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 49c4b0fee0)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-02-08 18:54:06 +00:00
ce6ff07d83 Bug 35843: Correct invalid exception
Test plan:
Run background job tests. Especially the changed one.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Magnus Enger <magnus@libriotech.no>
All test pass when running this:
prove t/db_dependent/Koha/BackgroundJobs*
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 291268f318)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 73577f17ad)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-02-08 18:51:19 +00:00
28cd9e7dc0 Bug 35663: Reword default privacy option in opac-privacy.pl
This patch updates the description of the OPAC privacy page, replacing:

"Default: keep my history according to local laws. This is the default
option : the library will keep your history for the duration permitted
by local laws."

...with:

"Default: keep my history according to library policy. This is the
default option : the library will keep your history for the duration set
by library policy."

This correctly reflects the fact that privacy is managed according to a
Koha cron configuration.

To test, apply the patch and make sure the OPACPrivacy and related
preferences are enabled.

- Log in to the OPAC and click the "Privacy" tab in the left-hand
  sidebar.
- Confirm that the description of the default privacy option is correct.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 8e8d4aaef7)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 20ef488a84)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-02-08 18:44:27 +00:00
08392a14a4
Bug 34479: (RMaint follow-up) Correct selectors for 23.05.x
We renamed patron_search_selected to table_search_selections in
upstream, but missed that when backporting this bug.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2024-02-07 11:51:38 +00:00
38a49717dd
Bug 35474: (RMaint follow-up) Revert, depends on enhancement
This reverts commit c8c9d21c69.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2024-02-07 11:26:40 +00:00
aa906245c8
Bug 34893: (RMaint follow-up) Fix test plan
Looks like we missed the test plan increment here, simple fix.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2024-02-07 11:03:30 +00:00
32e73fd122 Bug 34479: Update syntax for translatable string
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 63ec521608)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 79944eb6ee)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-02-05 20:15:39 +00:00
87014b9786 Bug 34479: Fix string for translatability
When moved from .tt to .js we need to convert the single
underscore into a double underscore.

Also uses format() to better deal with the variable.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 066e349561)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 265826ea32)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-02-05 20:15:38 +00:00
b507f94108 Bug 34479: Move patron selection history to a re-useable file
This patch takes some of the functionality for maintaining patron selections and moves it to a new file that can be used in other template files. It also introduces a new method for determining whether to delete the history after an operation is complete, along with an .inc file containing the checkbox that manages this

Test plan:
1) Navigate to Patrons and run a search
2) Use the checkboxes to select some patrons and run the three different options in the menu bar: Add to patron list, Merge selected patrons, Batch patron modification.
3) For each operation, you should see a checkbox asking if you want to "Keep patrons selected for anew operation". N.B. For adding patrons to a list, you will only see this when selecting to add them to a new list
4) When you run the operations, if you select the checkbox to keep the patrons then when you return tho the patron search, those patrons should all be still selected.
5) If you don't check the box, when you return to the search, your patron selection history should be empty and no patrons should be selected
N.B. If you have run a merge operation and elected to keep the patron history, you will only keep the patron who was kept

Signed-off-by: Sharon Dugdale <sharon.dugdale@cumberland.gov.uk>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Michael Adamyk <madamyk@ckls.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 21e2ee11fb)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 8ea3e73edc)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-02-02 18:18:22 +00:00
d28e035f4d Bug 34479: Add new files to templates
This patch adds two newly created files to the templates to allow the patron selection history to be wiped or persisted as appropriate

Test plan as per previous commit

Signed-off-by: Sharon Dugdale <sharon.dugdale@cumberland.gov.uk>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 2de99d0b02)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 967294acfa)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-02-02 18:18:22 +00:00
c8c9d21c69 Bug 35474: Add icon for protected patrons
This patch adds a "protected" icon (fa-lock) to the patron information
in the sidebar of patron-related pages in the staff interface.

To test, apply the patch and perform a patron search in the staff
interface.

- Edit a patron and go to the "Library management" section.
- Set "Protected" to "Yes."
- Save the record and view the information in the sidebar. You should
  see the lock icon by the patron's name.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 272056791f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit d7dc3c1b5b)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-02-02 18:02:36 +00:00
b71d875d5e Bug 35341: Improve processing hard due date and auto renewal date
After quite a struggle, came up with this approach using
flatpickr's parseDate and setDate. Seems to be the best.
The dateformat variable is set in calendar.inc.

Test plan:
Test edit, save, clear rules, focus on both dates.
Toggle all I18N preference date formats.

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

Bug 35341: Do not reinstantiate flatpickr

We do not need to reinstantiate flatpickr, we need to retrieve the
existing instance.

Test plan:
See previous patch.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
12-01-2024 Squashed both patches. Removed the unused hidden inputs for
hardduedatecompare and added a data attribute for the duedate.
The check with is_valid_date seems no longer needed here. Normally
date is empty or valid. A js warning from parseDate should be
exceptional. Made code for both dates a bit more consistent.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 963a3a4715)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 7f416ac227)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-02-02 18:01:06 +00:00
Emily Lamancusa
1129a79d38 Bug 35322: (QA follow-up) Perltidy
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 9e168686cc)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit baebf8e42c)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-02-02 17:59:46 +00:00
d29550e988 Bug 35322: Add unit tests
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 77f045e9a5)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 85a77895b5)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-02-02 17:56:31 +00:00
b59f8701af Bug 35322: Fix the logic for checking for holds in CanBookBeIssued
We are having reports that AllowItemsOnHoldCheckoutSCO and AllowItemsOnHoldCheckoutSIP no longer work. It appreas that in CanBookBeIssued, the ignore reserves check was changed from "check reserves unless the ignore reserves flag was passed" to "check reserves unless the ignore reserves flag was passed *and* we have a recall". I think this was a logic mistake and we want to check reserves unless we have an ignore flag *or* there is a recall.

Test Plan:
1) Enable AllowItemsOnHoldCheckoutSCO
2) Place a hold on an item
3) Attempt to check that item out to another patron
4) Note the checkout is blocked
5) Apply this patch
6) Restart all the things!
7) Attempt the checkout again
8) The checkout now succeeds!

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 9b10f69ee3)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit c279c31daf)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-02-02 17:56:31 +00:00
Laura Escamilla
dbc487fddd Bug 34950: Add availability statuses for in transit and on hold items.
To test:
1. Enable the ILS-DI system preference.
2. Place a hold for a patron and put it in transit.
   Place another hold for a patron that is available for pickup at the local branch.
   And then select an item that is available for checkout but don’t change the status for it.
3. Go to your testing OPAC and make an ILS-DI “Get Availability” call using
   the item ids of the three items you worked with in step 2.
   (i.e. http://localhost:8080/cgi-bin/koha/ilsdi.pl?service=GetAvailability&id=321+323+214&id_type=item)
4. Notice that the availability status for all three items is showing as available.
   The item in transit and the item with a local hold should have a status
   of not available and a message of why they are not available.
5. Apply the patch
6. Use restart_all.
7. Refresh the page and notice that the statuses are now correct.
   The item in transit has a status of not available and an availability
   message of “In transit”.
   The item with the local hold has an availability status of not
   available with an availability message of “On hold”.
   Finally the available item is correctly showing up as available.
8. Sign off and have a wonderful day. :)

Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 122f29cd8f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 986ef9ac22)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-02-02 17:54:40 +00:00
83933dafe5 Bug 35510: Non-patron guarantor missing from CollapseFieldsPatronAddForm options
This patch adds a missing option to the CollapseFieldsPatronAddForm
system preference so that the "Non-patron guarantor" section can be
collapsed by default.

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

- Search for CollapseFieldsPatronAddForm.
- In the dropdown of options you should see an entry for "Non-patron
  guarantor."
- Click "Select all" and save your changes.
- Go to Patrons -> New patron and choose a patron category which can
  have a guarantor (for example J - Juvenile)
- The patron entry page should load with all sections collapsed,
  including the Non-patron guarantor section.
- Uncheck  all options in the CollapseFieldsPatronAddForm
  preference and return to the patron entry form. All sections should
  now appear.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit e97dac3cbe)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 036228a4e0)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-02-02 17:53:02 +00:00