]> git.koha-community.org Git - koha.git/log
koha.git
8 months agoBug 35518: Tidy the moved blocks
Martin Renvoize [Thu, 8 Feb 2024 15:55:43 +0000 (15:55 +0000)]
Bug 35518: Tidy the moved blocks

This patch just tidies the moved blocks to get us past the QA script
check.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
8 months agoBug 35518: Check authentication and set userenv before fetching userenv variables
Nick Clemens [Fri, 26 Jan 2024 14:10:01 +0000 (14:10 +0000)]
Bug 35518: Check authentication and set userenv before fetching userenv variables

Currently we get the userenv before we have set it correctly for the session

To test:
 1 - Sign in as a user with fast cataloging permission
 2 - Bring up a patron, type gibberish into barcode field to get a fast cataloging link
 3 - Check the link, it should have your current signed in barcode
 4 - Sign in to a different browser with a different user and at a different branch
 5 - Bring up a aptron in circulation and type gibberish into barcode field to get a fast cataloging link
 6 - It may have your branch, but it may also have the other user's branch from the other window
 7 - Keep entering gibberish to get a link until one user has the correct branch
 8 - Then switch to the other browser, and keep entering gibberish, watch the branchcode change
 9 - Apply patch, restart all
10 - Test switching between browsers. generating fast cataloging links
11 - Users should now consistently have the correct branch

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
8 months agoBug 35942: OPAC user can enroll several times to the same club [23.05.x]
Kyle M Hall [Tue, 30 Jan 2024 15:58:02 +0000 (10:58 -0500)]
Bug 35942: OPAC user can enroll several times to the same club [23.05.x]

Test Plan:

1) Create 3 clubs, 1 limited to library A, 1 limited to library B and one not limited
2) Use a patron with home library A.
3) Go to the opac-user page, "Clubs" tab show 0/2 (the one from library B is not listed)
4) Browse to /cgi-bin/koha/svc/club/enroll?id=1
5) Reload that page a couple times
6) Note the patron is now enrolled in the same club multiple times
7) Delete those enrollments
8) Apply this patch
9) Restart all the things!
10) Repeat steps 2-7, note the lack of duplicate enrollments!
11) Repeat steps 2-10 for the staff interface

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
8 months agoBug 29510: (Rmaint follow-up) fix number of tests
Lucas Gass [Wed, 21 Feb 2024 23:42:25 +0000 (23:42 +0000)]
Bug 29510: (Rmaint follow-up) fix number of tests

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
8 months agoBug 29510: (follow-up) Adapt GET /patrons/:patron_id
Tomas Cohen Arazi [Wed, 17 Nov 2021 21:09:02 +0000 (18:09 -0300)]
Bug 29510: (follow-up) Adapt GET /patrons/:patron_id

This patch makes GET /patrons/:patron_id rely on this new behavior from the
objects.find helper.

To test:
1. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/patrons.t
=> SUCCESS: Tests pass!
2. Apply this patch
3. Repeat 1
=> SUCCESS: Tests still pass!
4. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
8 months agoBug 29510: Make objects.find call search_limited if present
Tomas Cohen Arazi [Wed, 17 Nov 2021 21:03:00 +0000 (18:03 -0300)]
Bug 29510: Make objects.find call search_limited if present

This patch makes objects.find implicitly update the passed
*$result_set* to use search_limited. This way no object leaks could
happen without noticing.

To test:
1. Apply the regression tests patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/REST/Plugin/Objects.t
=> FAIL: Tests fail because search_limited is not used
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass! Results are correctly filtered based on userenv!
5. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
8 months agoBug 29510: Regression tests
Tomas Cohen Arazi [Wed, 17 Nov 2021 21:02:17 +0000 (18:02 -0300)]
Bug 29510: Regression tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
8 months agoBug 34623: Update jQuery-validate plugin to 1.20.0
Owen Leonard [Wed, 20 Dec 2023 16:12:55 +0000 (16:12 +0000)]
Bug 34623: Update jQuery-validate plugin to 1.20.0

This patch updates the jQuery validation plugin in both the staff
interface and the OPAC to the latest version, 1.20.0.

To test, apply the patch and clear your browser cache if necessary.

Test various pages in the staff client to confirm that form validation
works as expected:

 - Patron password change form:
   - Password must conform to minPasswordLength
   - Password must not contain leading/trailing spaces
   - Passwords must match

 - Administration -> Add or edit budget:
   - Description, start date, and end date are required
   - Start date must be before end date

 - Administration -> Add or edit Z39.50/SRU server:
   - Server name, hostname, port, and database are required
   - Port, rank, and timeout must be a number

Perform the same check of the "Change password" form in the OPAC.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
8 months agoBug 36072: opac-request-article should check syspref
Marcel de Rooy [Tue, 13 Feb 2024 12:36:44 +0000 (12:36 +0000)]
Bug 36072: opac-request-article should check syspref

Note: This is handled now just like opac-reserve.

Test plan:
Disable ArticleRequests and hit the page.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
8 months agoBug 35918: Fix auto library connect (AutoLocation)
Jonathan Druart [Fri, 26 Jan 2024 07:58:17 +0000 (08:58 +0100)]
Bug 35918: Fix auto library connect (AutoLocation)

This code is a bit weird, its purpose it to auto select the library depending on the IP.
A problem appears if the same IP is used, then the user's choice will
might be overwritten randomly by another library.

To recreate the problem:
Turn on AutoLocation
Use koha/koha @CPL for test
And the following config:
*************************** 1. row ***************************
branchcode: CPL
branchname: Centerville
  branchip: 172.18.0.1
*************************** 2. row ***************************
branchcode: FFL
branchname: Fairfield
  branchip: 172.18.0.1
*************************** 3. row ***************************
branchcode: FPL
branchname: Fairview
  branchip: 172.18.0.4

Connect and select CPL. Randomly FFL will be picked instead.

Signed-off-by: Magnus Enger <magnus@libriotech.no>
Tested this on top of 35890 and 35904 because git bz said they were required dependencies.
Figured out the IP Koha was seeing me as coming from in /var/log/koha/kohadev/plack.log.
Added that IP to the branchip for Centerville, Fairfield and Fairview. Set AutoLocation = Yes.
After this I could recreate the problem: If i left the "Library" field in the login screen
at "My Library" I got logged into a random library selected from the three i had set
branchip for. Applying the patches fixed this, as expected.
Tests pass, with AutoLocation off.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
8 months agoBug 35918: Add test
Jonathan Druart [Fri, 26 Jan 2024 07:57:03 +0000 (08:57 +0100)]
Bug 35918: Add test

Signed-off-by: Magnus Enger <magnus@libriotech.no>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
8 months agoBug 36092: Pass sessionID at the end of get_template_and_user
Jonathan Druart [Wed, 14 Feb 2024 08:45:45 +0000 (09:45 +0100)]
Bug 36092: Pass sessionID at the end of get_template_and_user

It seems safer to pass the logged in user and session info at the end of
the sub.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
8 months agoBug 36092: Pass the sessionID from checkauth if we hit auth
Jonathan Druart [Wed, 14 Feb 2024 09:33:11 +0000 (10:33 +0100)]
Bug 36092: Pass the sessionID from checkauth if we hit auth

If we hit the auth page we were not passing sessionID to the template

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
8 months agoBug 36092: Add test
Jonathan Druart [Wed, 14 Feb 2024 09:56:17 +0000 (10:56 +0100)]
Bug 36092: Add test

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
8 months agoBug 35890: Add tests for AutoLocation
Jonathan Druart [Thu, 25 Jan 2024 08:36:01 +0000 (09:36 +0100)]
Bug 35890: Add tests for AutoLocation

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 months agoBug 35890: Reject login if IP is not valid
Jonathan Druart [Wed, 24 Jan 2024 15:25:30 +0000 (16:25 +0100)]
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>
8 months agoBug 35890: Remove var loggedin
Jonathan Druart [Wed, 24 Jan 2024 15:24:51 +0000 (16:24 +0100)]
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>
8 months agoBug 35904: (QA follow-up): tidy up code
Victor Grousset/tuxayo [Thu, 15 Feb 2024 03:18:37 +0000 (04:18 +0100)]
Bug 35904: (QA follow-up): tidy up code

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
8 months agoBug 35904: Make C4::Auth::checkauth testable easily
Jonathan Druart [Thu, 25 Jan 2024 09:35:41 +0000 (10:35 +0100)]
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>
8 months agoBug 36034: Add test
Jonathan Druart [Wed, 14 Feb 2024 07:49:33 +0000 (08:49 +0100)]
Bug 36034: Add test

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
8 months agoBug 36034: (bug 34893 follow-up) fix capture of return values from checkpw
Andreas Jonsson [Thu, 8 Feb 2024 10:57:03 +0000 (11:57 +0100)]
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>
8 months agoBug 35507: Add verbose parameters in Koha::Plugins
Marcel de Rooy [Fri, 15 Dec 2023 08:31:33 +0000 (08:31 +0000)]
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 d59bf322e9eb41b38ea35bf0e1a1955177c31cb3)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 4fb9fad791f10469eeb43b8f54399c1e37c5c6a6)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
8 months agoBug 35507: Plugins.t - Mock SessionStorage, remove KitchenSink
Marcel de Rooy [Tue, 12 Dec 2023 14:07:49 +0000 (14:07 +0000)]
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 dc62d9bed5799b9583bbc1ed59ea37972d7fe472)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit bfb2a929e30e30e7bf490364fc216ca69c966e62)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
8 months agoBug 35596: Error in writeoff_debts documentation
Caroline Cyr La Rose [Mon, 18 Dec 2023 21:06:28 +0000 (16:06 -0500)]
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 633533049ad234f8705390e4b6c78987e90b2802)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 97cc3285bd0ce18541d0fbeef4e6996e33c395eb)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
8 months agoBug 35962: (bug 35843 follow-up 2) Fix BackgroundJob.t on D10
Jonathan Druart [Tue, 6 Feb 2024 07:32:31 +0000 (08:32 +0100)]
Bug 35962: (bug 35843 follow-up 2) Fix BackgroundJob.t on D10

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
8 months agoBug 35962: (bug 35843 follow-up) Fix BackgroundJob.t on D10
Jonathan Druart [Wed, 31 Jan 2024 15:44:47 +0000 (16:44 +0100)]
Bug 35962: (bug 35843 follow-up) Fix BackgroundJob.t on D10

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
8 months agoRevert "Bug 34979: Add unit test for comparing YAMl files with sysprefs.sql"
Lucas Gass [Mon, 12 Feb 2024 16:02:38 +0000 (16:02 +0000)]
Revert "Bug 34979: Add unit test for comparing YAMl files with sysprefs.sql"

This reverts commit 0aa7df0395a5d41a96efb72ddfbd4f51d3305461.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
8 months agoBug 35373: Remove false FIXME comment from gather_print_notices.pl
Katrin Fischer [Fri, 12 Jan 2024 23:23:57 +0000 (23:23 +0000)]
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 898d96adb99861a639c5985a0a739b02e6decabd)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 1baddec5bebc46760507798a9311acb3a5bed0ec)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
8 months agoBug 35354: Update description of EmailLibrarianWhenHoldisPlaced system preference
Katrin Fischer [Sat, 13 Jan 2024 00:08:04 +0000 (00:08 +0000)]
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 a2a284c7f56e23174fcc52655273bf5c07282d62)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 3d12b0aa698f78b20977945985eae72d0da78ed4)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
8 months agoBug 35701: (follow-up) Fix last instance of t variable
Owen Leonard [Tue, 9 Jan 2024 16:15:00 +0000 (16:15 +0000)]
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 976f5e7ce69723ddf82a8d3a28c82d7e60551050)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 63dec2431f5bd6b65fb2b1f65f0897371ef50445)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
8 months agoBug 35701: Do not use t
Jonathan Druart [Thu, 4 Jan 2024 15:24:26 +0000 (16:24 +0100)]
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 50904b219e203857f71985b729774b38121c8ee9)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 66bf6e5e0e296c64cb8668ab57fb0c52f3313d71)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
8 months agoBug 35835: Fix shebang in cataloguing/ysearch.pl
Marcel de Rooy [Thu, 18 Jan 2024 15:02:10 +0000 (15:02 +0000)]
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 f34a639c58534534efe25dd2b3e98e84e79550ee)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 473bc55a63408a1e446ff4825747df85b006ff49)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
8 months agoBug 33457: (follow-up) Simplify even further
Martin Renvoize [Thu, 25 Jan 2024 11:55:42 +0000 (11:55 +0000)]
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 cd18b2e6fcc1b10bbb521ce1699ca9caeae8fdd8)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 17c3b15c2ef7ff5aff47c7e477fe470355b026c4)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
8 months agoBug 33457: (QA follow-up) Use js-patron-format instead
Martin Renvoize [Tue, 23 Jan 2024 14:44:27 +0000 (14:44 +0000)]
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 4732d1080900b2437b1d30642e4ec6644ad6c900)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 26c27bd65d0a0082ae4f2ed8c13ed8c5a1b92590)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
8 months agoBug 33457: Improve display of fund users when the patron has no firstname
Owen Leonard [Tue, 16 Jan 2024 12:57:34 +0000 (12:57 +0000)]
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 00ed806d204f60acb419052f177001d5a76b1310)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit c5dc3cf3f49ec8e6ad1b7909ad1db939df8d2ad8)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
8 months agoBug 35865: Add missing hint about permissions when adding managers to a basket
Jonathan Druart [Mon, 22 Jan 2024 21:07:24 +0000 (22:07 +0100)]
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 8a478f912fcd0eb6018449c8264497e55f9ae77e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit a50ab3e6ddc524c2cf9d5100060080729e5aa11b)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
8 months agoBug 35817: Fix hint on patron's category when batch update patron
Jonathan Druart [Tue, 16 Jan 2024 12:41:59 +0000 (13:41 +0100)]
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 074684eaf4f7845e6ad3cb50bd5f941dc5783746)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 5809d746d4f148817812de2b685083664e8b6806)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
8 months agoBug 35695: Remove useless JS from cataloging_additem.js
Lucas Gass [Wed, 3 Jan 2024 22:57:32 +0000 (22:57 +0000)]
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 cbc97f5c685e4e97f2d5f5c834f489869d5e2e4c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 5ab508d792c84d884eb349df44c54eeea544a7de)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
8 months agoBug 35461: Fix function call parameters causing the HASH to show in the renew all...
Kyle M Hall [Tue, 2 Jan 2024 17:59:39 +0000 (12:59 -0500)]
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 bb7fc5025b6b76e06283d872fd50ac9a65ff25cf)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit a51094a715b60d75dd23c8e47f9f6b3ef41ce5f2)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
8 months agoBug 35461: Add unit tests
Kyle M Hall [Tue, 2 Jan 2024 18:01:57 +0000 (13:01 -0500)]
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 e70e1f8a17f1a7aa507cc0fc5982b423612b1c98)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 52d43922b86ac11c413a17a1a4c1aad66b9399a5)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
8 months agoBug 35360: Make HTML/buttons consistent on waitingreserves.tt
Lucas Gass [Tue, 12 Dec 2023 22:48:22 +0000 (22:48 +0000)]
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 fea69c86079fddcbd4f339c87a03356a9ab4551d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit e0d5c13cf1c897ce1b12488992f9f9166ee508ba)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
8 months agoBug 34979: Add unit test for comparing YAMl files with sysprefs.sql
Katrin Fischer [Sun, 7 Jan 2024 21:54:29 +0000 (21:54 +0000)]
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 06ba28556254e443d0cc678c0f3d6aabd20f6767)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit a1da7ef8f84db98b57fc443e6ea0603f1b014a72)

8 months agoBug 34647: (follow-up) Minor fixes
Owen Leonard [Wed, 24 Jan 2024 16:32:23 +0000 (16:32 +0000)]
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 f3a069ad7fa1604a5e9996546e6ef8828bd9dc05)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit b545b9424cec60d58924f11fc11965560c1334a9)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
8 months agoBug 34647: Delete unnecessary anchor tag
Matt Blenkinsop [Wed, 24 Jan 2024 15:11:40 +0000 (15:11 +0000)]
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 a317923bfd0c13e3a46b50f6195f2d2efd8513bc)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 68336a8d4b7560dae9dea465569dc805bd1fdba3)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
8 months agoBug 34647: Replace name attributes with ids
Matt Blenkinsop [Wed, 24 Jan 2024 15:08:56 +0000 (15:08 +0000)]
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 8a07455e3beeb58ec934665d301bc76e4ef562a4)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 7317b66b5a311f677107ba9333664bef3a55d317)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
8 months agoBug 35894: Remove duplicate link
Matt Blenkinsop [Wed, 24 Jan 2024 14:09:19 +0000 (14:09 +0000)]
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 f931a0ac8089dc92cec46e1a66d92a8a1bafada4)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit b2e5be2b13ecf20949d8a27fcb181caecc0ac614)

8 months agoBug 30627: Verify --days parameter and use find command to select old backups for...
Andreas Jonsson [Mon, 6 Nov 2023 14:18:42 +0000 (15:18 +0100)]
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 b2e5efbdae0d607f6264235ca82d884b95c1a9ef)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit cadf36dc5fbf26640efc718f4e2a3f8dd4964753)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
8 months agoBug 29930: Cardnumber incorrectly set to userid on LDAP auth if cardnumber not mapped
Janik Hilser [Sun, 20 Feb 2022 17:14:31 +0000 (18:14 +0100)]
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 6341d520ac0a09baa5b005abb3d8d81273a6e310)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 884e3d5fe026c254ed1d2467f536e385ec2e7bf4)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
8 months agoBug 29930: Regression tests
Tomas Cohen Arazi [Tue, 16 Jan 2024 23:01:22 +0000 (20:01 -0300)]
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 fe006e535d5b95445905c0f9c48e04ec31de0476)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 49c4b0fee0a10d09b0ac35586c6d03fb4c9031df)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
8 months agoBug 35843: Correct invalid exception
Marcel de Rooy [Fri, 19 Jan 2024 09:36:23 +0000 (09:36 +0000)]
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 291268f3185cb48b6498a9d9121d9567bc0d3419)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 73577f17ad8f652e8364dc9e3f553faaf0b85b47)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
8 months agoBug 35663: Reword default privacy option in opac-privacy.pl
Owen Leonard [Tue, 2 Jan 2024 13:50:54 +0000 (13:50 +0000)]
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 8e8d4aaef71040a90b1052cc3970ff4ccb36a0ae)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 20ef488a8488f86126ca24a449b7ee92e53e22d8)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
8 months agoBug 34479: (RMaint follow-up) Correct selectors for 23.05.x
Martin Renvoize [Wed, 7 Feb 2024 11:50:22 +0000 (11:50 +0000)]
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>
8 months agoBug 35474: (RMaint follow-up) Revert, depends on enhancement
Martin Renvoize [Wed, 7 Feb 2024 11:24:51 +0000 (11:24 +0000)]
Bug 35474: (RMaint follow-up) Revert, depends on enhancement

This reverts commit c8c9d21c694375227d38c2af65c0fb04fc3bbb69.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
8 months agoBug 34893: (RMaint follow-up) Fix test plan
Martin Renvoize [Wed, 7 Feb 2024 11:02:51 +0000 (11:02 +0000)]
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>
8 months agoBug 34479: Update syntax for translatable string
Katrin Fischer [Tue, 16 Jan 2024 14:11:48 +0000 (14:11 +0000)]
Bug 34479: Update syntax for translatable string

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 63ec52160879b789e206d8bff533910d9b5abe91)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 79944eb6ee1014720aceb77b8feba6f9ec7c79ae)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
8 months agoBug 34479: Fix string for translatability
Katrin Fischer [Tue, 16 Jan 2024 11:00:30 +0000 (11:00 +0000)]
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 066e34956112c5e370ed804fbafd50fc29be0e34)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 265826ea32acecdaf0b7a70f918e6a29c3ae9fcf)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
8 months agoBug 34479: Move patron selection history to a re-useable file
Matt Blenkinsop [Mon, 27 Nov 2023 10:35:15 +0000 (10:35 +0000)]
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 21e2ee11fba6230b77e8b6376b0a903951170646)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 8ea3e73edc558db15befa4bc50350b65036e3c4a)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
8 months agoBug 34479: Add new files to templates
Matt Blenkinsop [Mon, 27 Nov 2023 10:42:09 +0000 (10:42 +0000)]
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 2de99d0b028fea2b78fed3a8cd9e44c207e92603)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 967294acfa8b37045513b017e7dc5b3e5c915e17)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
8 months agoBug 35474: Add icon for protected patrons
Owen Leonard [Mon, 4 Dec 2023 14:21:08 +0000 (14:21 +0000)]
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 272056791fdb10a6ca1b4fe1aad4933a385ead03)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit d7dc3c1b5b6c11aae86c63567db3482fd64f7b85)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
8 months agoBug 35341: Improve processing hard due date and auto renewal date
Marcel de Rooy [Fri, 17 Nov 2023 10:18:01 +0000 (10:18 +0000)]
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 963a3a47155cf313d25af6ba10781f4e7922f4dc)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 7f416ac227f6e8891e52a511d4ca40dfe80efb53)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
8 months agoBug 35322: (QA follow-up) Perltidy
Emily Lamancusa [Thu, 11 Jan 2024 20:43:49 +0000 (15:43 -0500)]
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 9e168686cc7de610275c51c161d02b3bc307a9bd)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit baebf8e42c60b1956040311e31c59fb4442228eb)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
8 months agoBug 35322: Add unit tests
Kyle M Hall [Wed, 29 Nov 2023 14:33:55 +0000 (09:33 -0500)]
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 77f045e9a5b9068a335a71bf2de9b4852783a446)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 85a77895b5c4af7e7b03a14a4c84cd405b079e92)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
8 months agoBug 35322: Fix the logic for checking for holds in CanBookBeIssued
Kyle M Hall [Mon, 13 Nov 2023 15:37:43 +0000 (10:37 -0500)]
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 9b10f69ee318c6fe3fa1ffb6de82c0f9888cac71)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit c279c31dafd92b83bdce86bbdce6012fed2a50be)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
8 months agoBug 34950: Add availability statuses for in transit and on hold items.
Laura Escamilla [Tue, 19 Dec 2023 18:31:54 +0000 (18:31 +0000)]
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 122f29cd8f4d1067e8ccaf64ecb0f13cc7b85d9a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 986ef9ac2295f9c280ddbc35919ac2bb7b1c0cc6)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
8 months agoBug 35510: Non-patron guarantor missing from CollapseFieldsPatronAddForm options
Owen Leonard [Wed, 6 Dec 2023 17:25:39 +0000 (17:25 +0000)]
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 e97dac3cbe43c7a8c2d5b340b29354bf112f3a36)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 036228a4e0781a116988a6666755aba2fbf1c177)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
8 months agoBug 35641: Reduce DB lookups when sending a list of barcodes to inventory
Nick Clemens [Fri, 22 Dec 2023 13:35:06 +0000 (13:35 +0000)]
Bug 35641: Reduce DB lookups when sending a list of barcodes to inventory

This patch does three things:
1 - Removes a specific query for withdrawn status of each item scanned - we can use the withdrawn field
2 - Removes a specific query for checkouts on each item scanned - we can use the onloan field
    a - additionally we don't need to fetch the checkout as we check it in to the homebranch,
    this is likely incorrect - we should use the current branch, but I preserve behavior for now
3 - Fetches the items ahead of time and builds a hash based on barcode, reduces DB lookups, may raise memory usage

To test:
1 - Checkout some items
2 - Withdraw some items
3 - Generate a lsit of barcodes including some checked out items and some withdrawn items
4 - Enter that list of barcodes into inventory tool
5 - Note your results
6 - Apply patch
7 - Issue the items again
8 - Repeat inventory
9 - Confirm results are the same as before patch

Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>
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 5ae5e4367b96cd5685c40197f391ca3c4063c407)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 41580a0a589b96f7edeb8ec24f7b2664508e16ae)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
8 months agoBug 25691: (follow-up) Update control file with wiki link
Katrin Fischer [Sat, 6 Jan 2024 19:29:06 +0000 (19:29 +0000)]
Bug 25691: (follow-up) Update control file with wiki link

This is in case it's needed anyway (see comment on previous patch)

Signed-off-by: David Nind <david@davidnind.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 328c5dcdfab66bc6833347796ab292b2c58e57f8)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit f7915af15f9a771ed9000fa8d4a5880e250e9ca5)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
8 months agoBug 25691: Replace link to non-existing README with wiki link
Katrin Fischer [Sat, 6 Jan 2024 19:24:33 +0000 (19:24 +0000)]
Bug 25691: Replace link to non-existing README with wiki link

This doesn't update the occurrence in the control file
as it says in control.in:

To test:
* Verify all occurrences of the README file have been updated. Exceptions:
  * control (see above)
  * changelog

Signed-off-by: David Nind <david@davidnind.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 0a49f71e8f0bad53dbdfd48bfc2beddbff89a6cc)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit e067575e0acdc3f8666c20b838cc9a1b3cf5111b)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
8 months agoBug 35438: Remove skip_intermediate_commit parameter
Kyle M Hall [Fri, 1 Dec 2023 11:53:21 +0000 (06:53 -0500)]
Bug 35438: Remove skip_intermediate_commit parameter

It no longer does anything.

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 067034f9e0585738df564a555194c76cb5b082be)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 8d58f0231c5830edaf84c0e25271c95288cc5099)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
8 months agoBug 35438: Transact each record import separately
Kyle M Hall [Thu, 30 Nov 2023 17:10:41 +0000 (12:10 -0500)]
Bug 35438: Transact each record import separately

When importing a staged file we commit every 50 records
For an authority import we are also merging, which can affect many more biblios, and these all end up in the transaction.
This can cause tables locks and issues across Koha

Test Plan:
1) Apply this patch
2) prove t/db_dependent/ImportBatch.t

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 74bbb89e9941aab7bf3f946d663d0d66b9df4021)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit cc4f879465d19e9ac761809497281f8b88145ac5)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
8 months agoBug 32477: Fix hiding all columns in item batch mod tools
Emmi Takkinen [Fri, 22 Dec 2023 11:05:37 +0000 (13:05 +0200)]
Bug 32477: Fix hiding all columns in item batch mod tools

If one hides all columns in batch item modification tool
and then reloads the page or launches tool again, "Holds"
column isn't displayed and "Itemtype" column is. Also
"Itemtype" columns checkbox remains checked. This happens
because "Itemtype" columns id is out of scope of list of column
numbers set in cookies. This patch adds 3 to number of columns
in variable "allColums" to take account all 3 columns we don't
want to hide.

To test:
1. Find items to modify and modify them with batch item
modification tool.
2. Use "Hide all columns" checkbox to hide all columns.
3. Confirm all columns expect checkbox, "Title" and "Holds"
columns are hidden correctly.
4. Reload the page.
=> Note that "Holds" column is now hidden and "Itemtype"
column is displayed. Also "Itemtype" checkbox is checked.
5. Apply this patch.
6. Repeat steps 1 to 4.
=> "Holds" column should now be displayed and "Itemtype"
hidden. None of the checkbox should be checked.

Sponsored-by: Koha-Suomi Oy
Signed-off-by: David Nind <david@davidnind.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 deed5233b785be05f6e30ec9077b252edd2c6d35)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 043fd7ffa4144467ec2af2672e11c675eda933e8)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
8 months agoBug 32477: Launch function hideColumns after changing datatables settings
Emmi Takkinen [Thu, 23 Nov 2023 11:15:57 +0000 (13:15 +0200)]
Bug 32477: Launch function hideColumns after changing datatables settings

Hiding columns in batch item modification breaks if page is
loaded again. If one hides e.g. column "Collection" and then loads
the page column "Holds" disappears. Also behaviour of checbox
changes for "Collection" column. This happens because we launch
function "hideColumns" before changing datatables settings and
"hidden" column with class "sorting_1" is still present.

To test:
1. Find items to modify and modify them with batch item
modification tool.
2. In modification page, hide column "Collection". Confirm
correct column is hidden.
3. Reload the page or modify items again.
=> Note that column "Holds" is now hidden and checking checkbox
for column "Collection" behaves incorrectly (unchecked checkbox
shows column, checked hides it)
4. Apply this patch.
5. Repeat steps 1, 2 and 3.
=> Confirm correct column is now hidden when page is loaded again
and checkbox works correctly.

Sponsored-by: Koha-Suomi Oy
Signed-off-by: David Nind <david@davidnind.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 71a7aa1cdce3a3d52dbb421c3ca5d3cf58fcd9c0)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit ff3209520563b867365ee7f8c8f8e0dba3913d84)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
8 months agoBug 35702: Fetch biblios at once and loop
Nick Clemens [Thu, 4 Jan 2024 14:07:11 +0000 (14:07 +0000)]
Bug 35702: Fetch biblios at once and loop

Test plan:
prove -v t/db_dependent/Authority/Merge.t

Signed-off-by: David Nind <david@davidnind.com>
Amended-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Replace $biblio->id with $biblio->biblionumber

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 1847e2ab565243a9e8fcaf8ddbfe48136041e61b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit fa443bcef12999a4114d93816db9ef2c01df4cbb)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
8 months agoBug 35702: Use framework code from biblio object
Nick Clemens [Thu, 4 Jan 2024 14:03:45 +0000 (14:03 +0000)]
Bug 35702: Use framework code from biblio object

Signed-off-by: David Nind <david@davidnind.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 c703bb2c1cdefa85843a1c04ff659f49cbe30497)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit f8ab19a3eb0557cccb4b54de7edd34424775122c)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
8 months agoBug 35086: (follow-up) Use 5000 as example in conf file
Nick Clemens [Fri, 5 Jan 2024 13:03:36 +0000 (13:03 +0000)]
Bug 35086: (follow-up) Use 5000 as example in conf file

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 ed23bc1364ef0d80cfcd9df4e9dd38b009d52827)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit a14f44ea8ab104b0034795fce818c23accbb1a74)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
8 months agoBug 35086: Tidy tests
Nick Clemens [Thu, 4 Jan 2024 12:55:03 +0000 (12:55 +0000)]
Bug 35086: Tidy tests

Signed-off-by: David Nind <david@davidnind.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 ddbd00de72ac11f7a0cf8fccd9d720e84d85f4ea)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit e1157dcdcda885fc79546d053c1006577e16b9a9)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
8 months agoBug 35086: Also split chunks when indexing from background job
Nick Clemens [Wed, 3 Jan 2024 18:54:25 +0000 (18:54 +0000)]
Bug 35086: Also split chunks when indexing from background job

The es background indexer is designed to combine background jobs when started based on the 'batch_size' option.

While this is helpful for combining individual updates, it can be problematic when there are several large batch modifications, or when worker has stopped and is restarted.

This patch uses the same logic as in the indexer to split the chunks that are sent directly for indexing.

To test:
1 - Follow test plan on previous patch
2 - Confirm items are correctly indexed and jobs marked

Signed-off-by: David Nind <david@davidnind.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 7496a603cda7832bcf1bdb606843bd88f18af4f3)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 2f8ae2ec212e67cbe004e15484cf561a77bc40a5)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
8 months agoBug 35086: Add chunk_size option to elasticsearch configuration
Nick Clemens [Fri, 22 Dec 2023 20:11:34 +0000 (20:11 +0000)]
Bug 35086: Add chunk_size option to elasticsearch configuration

Whne performing batch operations we can send a large numebr of records for reindexing at once.
Currently this can create requetss that are too large for Elasticsearch to process. We need
to break these requests into chunks/

This patch adds a chunk_size configuration to the elasticsearch stanza in koha-conf.xml

If blank we default to 5000.

To test:
0 - Have Koha using Elasticsearch
1 - Create and download a report of all barcodes:
    SELECT barcode FROM items
2 - Batch modify these items
3 - Note a single ESindexing job is created
4 - Create and download a report of all authority ids:
    SELECT auth_header.authid FROM auth_header
5 - Setup a marc modification template, and batch modify all the authorities
6 - Again note a single ES backgorund job is created
7 - Apply patch
8 - Repeat the modifications above - you still get a single job
9 - Edit koha-conf.xml and add <chunk_size>250</chunk_size> to elasticsearch stanza
10 - Repeat modifications - you now get several background ES jobs
11 - prove -v t/db_dependent/Koha/SearchEngine/Elasticsearch/Indexer.t

Signed-off-by: David Nind <david@davidnind.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 9951e230e43d08dc6a2fb635877d0db5c1e245ff)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 636920558caa114afef1c50256a5031f4be7b0da)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
8 months agoBug 34999: Add unit test
Marcel de Rooy [Thu, 11 Jan 2024 10:09:57 +0000 (10:09 +0000)]
Bug 34999: Add unit test

Test plan:
Run t/db_dependent/api/v1/auth.t
[Bonus] Run prove t/db_dependent/api/v1

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit b8d9cce6645b913c57410a855986b76c84d2346b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit ce924fa1db7c39f68ca4da4314c27b981bbfdb4e)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
8 months agoBug 34999: Throw exception for public routes if OPACMaintenance is enabled
Marcel de Rooy [Fri, 24 Nov 2023 10:50:54 +0000 (10:50 +0000)]
Bug 34999: Throw exception for public routes if OPACMaintenance is enabled

Test plan:
[1] Try public endpoint like /api/v1/public/biblios/X/items.
    * Replace X by an existing biblionumber.
    You should receive a 200.
[2] Enable OPACMaintenance. Set to Show.
[3] Try same endpoint. You should get a 503 with a json error.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 1fc82dd827ad298bead46583ada08c549afe8d8e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 24b14de39810261a8084ca74e2ea89feb5042faa)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
8 months agoBug 35756: Correctly serialize patron's data in patron search popup/modal
Jonathan Druart [Wed, 10 Jan 2024 08:36:43 +0000 (09:36 +0100)]
Bug 35756: Correctly serialize patron's data in patron search popup/modal

We are incorrectly using encodeURIComponent in patron-search.inc.
When a new patron is selected, the info message is showing "Patron %s is already in the list"
or "Patron %s added". If the patron has space in their name, they will be substituted with %20.

We are using JSON for select, we can reuse it for add.

Test plan:
Have a patron with spaces in their name
Add users to a fund
Notice that the name is correctly displayed.

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>
(cherry picked from commit 6779e64d955f6e90e05eba19fd4d7d3606ae15ec)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 65460128f13334ce73652682b740d8312f3bc833)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
8 months agoBug 35504: Distinguish different RMaint and Topic Expert roles
Martin Renvoize [Wed, 10 Jan 2024 13:46:58 +0000 (13:46 +0000)]
Bug 35504: Distinguish different RMaint and Topic Expert roles

This patch further splits up release maintanence and topic expert roles
so that they display with further, more accurate, detail in the
development team section.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 2ce83fc784ad8bc716bd65f14845141097c72b69)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 6f09a31a153fb0d495d84ea37d63fcdd8c887674)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
8 months agoBug 35504: Add full maintainers list into development branch
Martin Renvoize [Wed, 10 Jan 2024 11:39:15 +0000 (11:39 +0000)]
Bug 35504: Add full maintainers list into development branch

On a stable branch the current maintainer of your running version is
listed at the top of the current maintanence team.. however when you're
on a development branch the RM is responsible for your branch and the
maintainers were missing from display.

This patch adds the maintainers list back to the bottom of the current
maintanence team section, just for the development branch.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 7fd998c1e7355aeb5635a94d25382125d192cd10)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 74300e9908f45d7e26ff9d17c0cc23071bf7f20f)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
8 months agoBug 35504: Change 'Jenkins' to 'Continuous integration'
Martin Renvoize [Wed, 10 Jan 2024 11:38:14 +0000 (11:38 +0000)]
Bug 35504: Change 'Jenkins' to 'Continuous integration'

We were naming these roles differently between the 'current team' and
'past roles' display.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit a26d4bdf9521ca4fad85741b9fddbb540823d4e0)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 149cc638188894e4caf08256bdc8a4999775eb33)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
8 months agoBug 35504: Corrections to wiki team
Martin Renvoize [Wed, 10 Jan 2024 11:37:51 +0000 (11:37 +0000)]
Bug 35504: Corrections to wiki team

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit a4061c3f146a41e2fdb41f4be15239a61a04b46d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit f302c50af30ef5f554437b259b0750f3958831af)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
8 months agoBug 35504: Add ktd maintainer
Martin Renvoize [Tue, 12 Dec 2023 12:04:56 +0000 (12:04 +0000)]
Bug 35504: Add ktd maintainer

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 29c1225bf8ee789a6f03d35e8af93a953b8733fa)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 3c3670142fa6263bc3add60053e26b47c00e72af)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
8 months agoBug 35504: Corrections to team
Martin Renvoize [Tue, 12 Dec 2023 11:48:47 +0000 (11:48 +0000)]
Bug 35504: Corrections to team

Correction of 'advocate' to 'advocates' to ensure they appear in the
team.

Addition of 'website' and 'wiki' handling to ensure they also appear
in the team.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 8190fdb5bda236d762eb6f9e42e8c733c2408a14)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit b301f79526f1dad9b454b2e44045eb5457d18ecf)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
8 months agoBug 35504: Typo fix
Pedro Amorim [Tue, 12 Dec 2023 11:10:47 +0000 (11:10 +0000)]
Bug 35504: Typo fix

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit b9da22b490e676b3781cb7f1439a4cbf420f52ab)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit ace0ac8f6b08186f5409cdba3ba42728f387c365)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
8 months agoBug 35504: New cycle, new team :)
Martin Renvoize [Wed, 6 Dec 2023 16:03:55 +0000 (16:03 +0000)]
Bug 35504: New cycle, new team :)

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit b6cfef878bfdaa48b36c37c6415293d23042c774)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit f5d5ffef0e85935a7fcbf08a5f272491c6722b6e)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
8 months agoBug 35774: Use itemnumber instead of biblioitemnumber
Lucas Gass [Fri, 12 Jan 2024 18:05:22 +0000 (18:05 +0000)]
Bug 35774: Use itemnumber instead of biblioitemnumber

With Bug 33639 already pushed to master there should be NO change in behavior.

To test:
1. APPLY PATCH
2. Create one or more item groups for a bib if needed
3. Create a new item, and at the bottom of the 'Add item' screen, select the item group to which you want this item added. Save.
4. The item should succesffuly be added to the item group.
5. Add a new item and to the same record and this time try the 'Create a new item group' from the dropdown.
6. Name the new item group.
7. Make sure it is correctly added to the item group.

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 95e19e758a03b5554e63014a0264a63477b8bbb0)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 71247b9a0722287c79ecb3198bc96a77ab3ffaa5)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
8 months agoBug 33639: Make add item to item group work from additem.pl
Lucas Gass [Tue, 2 Jan 2024 17:49:45 +0000 (17:49 +0000)]
Bug 33639: Make add item to item group work from additem.pl

To test:

1, Create one or more item groups for a bib if needed
2. Create a new item, and at the bottom of the 'Add item' screen, select the item group to which you want this item added. Save.
3. On the Normal tab, see that the item has not been added to the item group you selected.
4. APPLY PATCH, restart_all
5. Try 1-3 again but this time the item should succesffuly be added to the item group.
6. Add a new item and to the same record and this time try the 'Create a new item group' from the dropdown.
7. Name the new item group.
8. Make sure it is correctly added to the item group.

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 5b14f8b11a57a83b5863e32121243c7b133d5c90)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 1448ac0c26c56f45d4df157a3004a0709f435593)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
9 months agoUpdate release notes for the 23.05.08 release v23.05.08
Lucas Gass [Wed, 24 Jan 2024 18:05:57 +0000 (18:05 +0000)]
Update release notes for the 23.05.08 release

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
9 months agoIncrement version for 23.05.08 release
Lucas Gass [Wed, 24 Jan 2024 17:41:28 +0000 (17:41 +0000)]
Increment version for 23.05.08 release

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
9 months agoBug 34893: Unit tests for C4::Auth::checkpw
Tomas Cohen Arazi [Fri, 15 Dec 2023 13:54:11 +0000 (10:54 -0300)]
Bug 34893: Unit tests for C4::Auth::checkpw

This patch introduces some tests on the current (and new) behavior for
the `checkpw` function.

I needed it to better understand if an edge case was actually possible
(it wasn't).

Found a really minor annoyance for the internal check with expired
password not returning the $patron object for consistency with the other
use cases.

I think this method deserves (at least) changing the return value to a
sane data structure. But that's not target for backporting to stable
releases. So a separate bug.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
9 months agoBug 34893: (QA follow-up) Tidy code for qa script
Kyle M Hall [Fri, 1 Dec 2023 11:29:19 +0000 (06:29 -0500)]
Bug 34893: (QA follow-up) Tidy code for qa script

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
9 months agoBug 34893: Add checkpw change to REST API
David Cook [Tue, 28 Nov 2023 22:57:39 +0000 (22:57 +0000)]
Bug 34893: Add checkpw change to REST API

This patch adds the checkpw return value change to the REST API
route for validating user identifiers and password.

Test plan:
0. Apply patch
1. prove t/db_dependent/api/v1/password_validation.t

Bonus points:
1. koha-plack --reload kohadev
2. Enable syspref RESTBasicAuth
3. curl -XPOST -H "Content-Type: application/json" \
-u <staff_userid>:<staff_password> \
-d '{"identifier":"<cardnumber>","password":"<password>"}' \
http://localhost:8081/api/v1/auth/password/validation
4. Validation doesn't fail. It gives you cardnumber, patron_id, userid

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
9 months agoBug 34893: ILS-DI can return the wrong patron for AuthenticatePatron
Kyle M Hall [Fri, 22 Sep 2023 18:20:59 +0000 (14:20 -0400)]
Bug 34893: ILS-DI can return the wrong patron for AuthenticatePatron

Imagine we have a set of users. Some of those users have a NULL userid. We then call AuthenticatePatron from ILS-DI for a patron with a NULL userid, but a valid cardnumber. We call checkpw, which returns the cardnumber and userid. We then call Koha::Patrons->find on the userid *which is null*, meaning the borrowernumber returned is not the correct one, but instead the earliest patron inserted into the database that has a NULL userid.

Test Plan:
1) Give three patrons a userid and a password
2) From the database cli, set all patrons's userid to null
   Run this query: update borrowers set userid = null;
3) Call AuthenticatePatron with username being the 1st patron cardnumber,
   and password being the password you set for that patron
   http://localhost:8080/cgi-bin/koha/ilsdi.pl?service=AuthenticatePatron&username=kohacard&password=koha
4) Note you get back a borrowernumber for a different patron. Refresh the page and the number is correct.
5) Do the same with the 2nd patron. Same issue at 1st and correct number after.
6) Apply this patch
7) Restart all the things!
8) Do the same with the 3rd patron.
9) Note you get the correct borrowernumber! :D
10) prove t/Auth.t t/db_dependent/Auth_with_ldap.t t/Auth_with_shibboleth.t t/db_dependent/Auth_with_cas.t

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
9 months agoBug 34893: Add unit tests
Kyle M Hall [Wed, 29 Nov 2023 17:18:32 +0000 (17:18 +0000)]
Bug 34893: Add unit tests

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
9 months agoBug 25835: Include overdues with fines in overdues_report permission
Andrew Fuerste Henry [Wed, 29 Nov 2023 18:02:52 +0000 (18:02 +0000)]
Bug 25835: Include overdues with fines in overdues_report permission

To test:
1 - have a user with circulate_remaining_permissions but not
    overdues_report
2 - confirm user can see and run Overdues with Fines
3 - apply patch
4 - confirm user can no longer see links to Overdues with Fines or load
    the page directly by entering the url
5 - confirm a user with overdues_report or greate permission can see and
    use the tool

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 23de67a7e4d3701f9a665ec0fee38e22128c5fa3)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 9825c7ea36ef823034b82acc168b6e38730cd9b0)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
9 months agoBug 32551: HTTP_ACCEPT_LANGUAGE legacy CGI variable not set in Mojolicious
Tomas Cohen Arazi [Thu, 28 Dec 2023 14:41:39 +0000 (14:41 +0000)]
Bug 32551: HTTP_ACCEPT_LANGUAGE legacy CGI variable not set in Mojolicious

This patch addresses the fact some of our code still relies on those CGI-era ENV variables.
In particular, C4::Laguages::getlanguage expects it to calculate the most suitable language.

As this is reported as required, I provide a fix.

I did a `git grep HTTP_` on the codebase, and the only other occurences are:

* C4::Output (HTTP_X_REQUESTED_WITH)
* C4::Context (HTTP_USER_AGENT, HTTP_X_FORWARDED_FOR)
* C4::Auth_with_shibboleth (using HTTP_ variables for matchpoints)
* Some handling on the 'Koha as a Mojo app' code
* Some .pl script not relevant to this report

I decided to limit this patch to the requested header which seems harmless. I leave the
other cases.

To test:
1. Apply the regression tests patch
2. Run:
   $ ktd --shell
  k$ qa -c 1
=> FAIL: Tests fail!
3. Apply this patch
4. Run:
  k$ qa -c 2
=> SUCCESS: Tests pass! All green!
5. Sign off :-D

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>
(cherry picked from commit d6e072fb5f2a0cd47661e759142e59e887724cc6)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit c1ba60ce4dc5be6b2f808cd4b8ce57e8e583cc71)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>