koha.git
2 months agoBug 35942: OPAC user can enroll several times to the same club [23.05.x] v22.11.15-1
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>
(cherry picked from commit 9bdab108e22768b018b017ed7c0e0016270f2570)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
2 months agoUpdate release notes for 22.11.15 release v22.11.15
Frédéric Demians [Tue, 27 Feb 2024 07:02:23 +0000 (08:02 +0100)]
Update release notes for 22.11.15 release

Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
2 months agoIncrement version for 22.11.15 release
Frédéric Demians [Tue, 27 Feb 2024 06:52:25 +0000 (07:52 +0100)]
Increment version for 22.11.15 release

Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
2 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>
(cherry picked from commit b577b6567045184adcb5bb55b7e5c70428e124ee)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 1f182d45aba607dbfaf63c98f97b8615e5eea09d)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
2 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>
(cherry picked from commit 90b6f68616e2ba5ca3fcbbd9698c97ef41a45593)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 26722f2a08af99b9e3cb4eb50398df896085f527)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
2 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>
(cherry picked from commit 3280e5a99de92a3e8d33ccef71d3013bac4add68)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
2 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>
(cherry picked from commit 80822f768978853fd661a53cd721c512aa74add2)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
2 months agoBug 35941: Limit club list to those from the logged in user
Jonathan Druart [Tue, 30 Jan 2024 13:53:03 +0000 (14:53 +0100)]
Bug 35941: Limit club list to those from the logged in user

clubs-tab get the patron's id from the parameter. At the OPAC we must
use the one from the logged in user, to prevent leak to other users

Test plan:
Have 2 clubs: A, B
Enroll to A with patron borrowernumber=1
Enroll to B with patron borrowernumber=2
Log in with patron 1 and hit:
  http://localhost:8080/cgi-bin/koha/clubs/clubs-tab.pl?borrowernumber=1
=> OK
Now hit
  http://localhost:8080/cgi-bin/koha/clubs/clubs-tab.pl?borrowernumber=2
=> oops

Apply this patch, try again.
The "borrowernumber" parameter is no longer used to fetch the club list.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit e51ef7ef76a4ee523b302d724d80118185030e60)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 months agoBug 29510: RMaint fix test count
Frédéric Demians [Thu, 22 Feb 2024 10:44:46 +0000 (10:44 +0000)]
Bug 29510: RMaint fix test count

Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
2 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>
(cherry picked from commit 1f1f0837cd2058ff8e953e6ae719c7513ad35927)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 36a1b9e4dff208b6b55ea50008984c7ca0fb298f)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
2 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>
(cherry picked from commit fe5dc0bdda78424437331cf83624c7606a3a54b4)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit eae197962ed7355df520b87870dc56edebe5392b)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
2 months agoBug 34623: RMaint follow-up
Frédéric Demians [Thu, 22 Feb 2024 10:14:10 +0000 (10:14 +0000)]
Bug 34623: RMaint follow-up

Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
2 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>
(cherry picked from commit 8deffec3155f54b7209f1465942fd8fbea23da5e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 8c18a734930aa08823c344107db167c1937dc974)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
2 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>
(cherry picked from commit 8afcbe0bbb556cb19ff2e33e56cf3bcb8dd13d11)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit c4d348651192eaed83d13df4f7d166b977690e6d)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
2 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>
(cherry picked from commit 4efe74fe12075298680965db3605f717f1da10d0)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
2 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>
(cherry picked from commit e00cfb3c7b3954e545ad4b363bff48a8f4345d0a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 7073d114577105537d448c49430eb546c0b435a2)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
2 months agoBug 35890: RMaint quick fix to make tests work
Frédéric Demians [Thu, 22 Feb 2024 09:49:37 +0000 (09:49 +0000)]
Bug 35890: RMaint quick fix to make tests work

2 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>
(cherry picked from commit 0ce8cc4c05bc96503172018775ba574e41b40ecb)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 16a7ac0fe71e74e28051cb5374923879c8c5213d)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
2 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>
(cherry picked from commit 94e570d6af38c0061aeaad2ea25ab26bed2186f5)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit bfbe854b6c8943b2afdec9a690a20d9615949962)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
2 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>
(cherry picked from commit 85717a99c7ba20d3bef8e9ba15df6d0a86f368c6)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 6e4711d925ae705ecba6dcf78e030dc149c80017)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
2 months agoBug 34893: (RMaint follow-up) Test plan correction
Martin Renvoize [Thu, 8 Feb 2024 08:13:45 +0000 (08:13 +0000)]
Bug 34893: (RMaint follow-up) Test plan correction

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2 months agoBug 34893: [22.05] Add a Koha::Patron->update_lastseen method
Aleisha Amohia [Wed, 24 Jan 2024 09:59:43 +0000 (09:59 +0000)]
Bug 34893: [22.05] Add a Koha::Patron->update_lastseen method

Without this patch, we get an error trace whe calling AuthenticatePatron

The method Koha::Patron->update_lastseen is not covered by tests!

(cherry picked from commit 3417a7052a549bde30f0c5c400c9f228f107308f)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2 months agoBug 34893: (RMaint follow-up) Fix test plan
Martin Renvoize [Thu, 8 Feb 2024 08:03:06 +0000 (08:03 +0000)]
Bug 34893: (RMaint follow-up) Fix test plan

Merge mistake, just a simple correction to the test plan count was
needed.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2 months ago[RMaint follow-up] Fix executable permission on 22.11.12
Martin Renvoize [Thu, 8 Feb 2024 07:57:50 +0000 (07:57 +0000)]
[RMaint follow-up] Fix executable permission on 22.11.12

The database updates should be executable.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
3 months agoUpdate release notes for 22.11.14 release v22.11.14
Frédéric Demians [Mon, 29 Jan 2024 08:14:07 +0000 (09:14 +0100)]
Update release notes for 22.11.14 release

Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
3 months agoIncrement version for 22.11.14
Frédéric Demians [Mon, 29 Jan 2024 08:06:25 +0000 (09:06 +0100)]
Increment version for 22.11.14

Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
3 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>
(cherry picked from commit 5476b18e7ea34e08d9dd163e2c446d5b223cf032)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 76bda46ad5a4916aa907f2eb11f81eaaedf19f37)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
3 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>
(cherry picked from commit a19a1d2079e562d62d766aa9f996a7586d73882d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit ce00f161ab1c4145260159e5c779386c1f850a0b)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
3 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>
(cherry picked from commit fc1ea85ed024a9789827a1c17376bfc18f19cef0)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 1cb97e995b8386c6f0684c11713ff1ecad12db62)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
3 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>
(cherry picked from commit 9ba199c2acc33873154c167e73e86a5e786084cb)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit f6c2bdf2163239eddef379ff34e769dfdaeac9ca)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
3 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>
(cherry picked from commit 29782174570a331c1b9f1ac8196ce06364f8f691)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 months agoBug 35204: Prevent an expired password from throwing a 500 error
Matt Blenkinsop [Wed, 6 Dec 2023 10:03:45 +0000 (10:03 +0000)]
Bug 35204: Prevent an expired password from throwing a 500 error

Currently when a patron with an expired password is authenticated via the API a 500 error is returned rather than a 400 "Validation failed" error. This patch catches the return value for an expired password and returns the validation failure before the patron search is attempted.

Test plan:
1) Choose a patron and set their password expiry date to a date in the past
2) Send a request to auth/password/validation as an authenticated user with that patron's details
3) The response should be a 500 error
4) Apply patch
5) Repeat steps 1-3 and this time the response should be a 400 code with an error message of  "Password expired"

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit f3bb88505245228d97a4e39612b17a688df64a79)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit df9d4b0f55fa6b4c430a77686d8e00804eed88de)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 24f067b0cf220c035ba5773956d19e0a80a75044)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
3 months agoBug 35204: Add unit tests
Matt Blenkinsop [Mon, 18 Dec 2023 11:00:06 +0000 (11:00 +0000)]
Bug 35204: Add unit tests

prove t/db_dependent/api/v1/password_validation.t

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 711f9a041a706ed3f025afd6da0259879396ea58)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 86be92a6084d4475b004f6ffce2e14fb21917f50)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 1fc5a820bbe99a1be084349ba4c166cca2ccf204)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
4 months agoHTML release notes version
Frédéric Demians [Tue, 2 Jan 2024 08:33:55 +0000 (09:33 +0100)]
HTML release notes version

Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
4 months agoUltra minor fix on release notes v22.11.13
Frédéric Demians [Sun, 31 Dec 2023 09:30:24 +0000 (10:30 +0100)]
Ultra minor fix on release notes

4 months agoRelease notes for 22.11.13 (dec 2023)
Frédéric Demians [Sat, 30 Dec 2023 08:45:53 +0000 (09:45 +0100)]
Release notes for 22.11.13 (dec 2023)

Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
4 months agoVersion 22.11.13 (dec 2023)
Frédéric Demians [Thu, 28 Dec 2023 11:38:19 +0000 (12:38 +0100)]
Version 22.11.13 (dec 2023)

4 months agoBug 35307: Add a hidden input for expired holds
Nick Clemens [Mon, 13 Nov 2023 16:02:46 +0000 (16:02 +0000)]
Bug 35307: Add a hidden input for expired holds

To test:
 1 - Place 3 holds on a bib, each for a different patron
 2 - IN the db, set the first hold to be expired:
    UPDATE reserves SET expirationdate='2023-01-01' WHERE reserve_id=1;
 3 - Refresh the holds page for the biblio
 4 - Note the first hold now says 'Expired' in the expiration date column
 5 - Set an expiration date for the last hold
 6 - Click 'Update holds'
 7 - Note the date is applied to the second hold
 8 - Delete the holds
 9 - Apply patch
10 - Repeat 1-6
11 - Confirm only the correct hold is updated

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
(cherry picked from commit ca5378cd946fd3c5496dab155ff112f0c245f71b)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
4 months agoBug 35254: [22.11.x] Add import_record_id to order inputs
Nick Clemens [Fri, 3 Nov 2023 20:10:01 +0000 (20:10 +0000)]
Bug 35254: [22.11.x] Add import_record_id to order inputs

This patch follows the logic of bug 32166 and adds specific inputs for each order to avoid any misalignment when some records are not imported

To test:
1 - Find a vendor in acquisitions
2 - Create or find an open basket
3 - Add to basket form a new file
4 - Stage file and add to basket
5 - Select the second record in the list
6 - Enter price info
7 - Save (don't forget, you need to set item type in the second tab)
8 - The order has no price info!
9 - Apply patch
10 - Repeat 3-7 above, staging file fresh
11 - Confirm order has correct prices
12 - Test with a file with many records
13 - Confirm any combination of choosing/skipping records works as expected

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
5 months agoUpdate release notes for 22.11.12 release v22.11.12
Pedro Amorim [Tue, 28 Nov 2023 14:45:52 +0000 (13:45 -0100)]
Update release notes for 22.11.12 release

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
5 months agoIncrement version for 22.11.12 release
Pedro Amorim [Tue, 28 Nov 2023 14:39:42 +0000 (14:39 +0000)]
Increment version for 22.11.12 release

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
5 months agoRMaint fix: Fix Koha version
Pedro Amorim [Tue, 28 Nov 2023 14:33:23 +0000 (14:33 +0000)]
RMaint fix: Fix Koha version

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
5 months agoBug 35291: (QA follow-up) Tidying script for QA test tools
Aleisha Amohia [Thu, 23 Nov 2023 21:08:09 +0000 (21:08 +0000)]
Bug 35291: (QA follow-up) Tidying script for QA test tools

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
5 months agoBug 35291: Validate filepaths in linking files
David Cook [Thu, 9 Nov 2023 00:49:54 +0000 (00:49 +0000)]
Bug 35291: Validate filepaths in linking files

Validate that the files in linking files are contained within the ZIP.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
5 months agoBug 35291: Don't allow symlinks for link files in cover image ZIP
David Cook [Thu, 9 Nov 2023 00:23:45 +0000 (00:23 +0000)]
Bug 35291: Don't allow symlinks for link files in cover image ZIP

There's no reason to allow symlinks for link files in cover image
ZIP files. Preventing their use prevents someone from uploading
a symlink pointing to an existing file on the Koha server.

Test plan:
0. Apply patch and restart/reload Koha
1. Create a PNG cover image
2. Create a datalink.txt file that contains something like the
following:
29,Untitled.PNG
3. Turn on "LocalCoverImages" system preference
4. Upload via http://localhost:8081/cgi-bin/koha/tools/upload-cover-image.pl
5. Go to http://localhost:8081/cgi-bin/koha/catalogue/detail.pl?biblionumber=29
6. Note the cover image has been uploaded

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
5 months agoBug 35291: Prevent leaks from FS
Jonathan Druart [Wed, 8 Nov 2023 16:14:55 +0000 (17:14 +0100)]
Bug 35291: Prevent leaks from FS

Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
5 months agoBug 35290: (follow-up) Perltidy formatting corrections
Owen Leonard [Thu, 9 Nov 2023 19:46:35 +0000 (19:46 +0000)]
Bug 35290: (follow-up) Perltidy formatting corrections

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
5 months agoBug 35290: Sanitize field input on cataloguing/ysearch.pl
David Cook [Wed, 8 Nov 2023 23:39:45 +0000 (23:39 +0000)]
Bug 35290: Sanitize field input on cataloguing/ysearch.pl

This change sanitizies the field input on cataloguing/ysearch.pl

Test plan:
0. Apply the patch and restart/reload Koha
1a. "Add marc21_field_260b.pl plugin to 260$b in the Default framework"
1b. Go to http://localhost:8081/cgi-bin/koha/admin/marc_subfields_structure.pl?
op=add_form&tagfield=260&frameworkcode=#subbfield
1c. Choose "marc21_field_260b.pl" from the dropdown next to "Plugin"
1d. Click "Save changes"
2a. "Add new record"
2b. Go to http://localhost:8081/cgi-bin/koha/cataloguing/addbiblio.pl?frameworkcode=
3. Click on tab "2" and scroll down to 260 "b"
4. Type in "Ori" into 260 subfield b
5. Some autocomplete suggestions should appear

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
5 months agoBug 35174: update control files for koha-l10n dependency package
Mason James [Thu, 16 Nov 2023 10:06:27 +0000 (23:06 +1300)]
Bug 35174: update control files for koha-l10n dependency package

 to test...

 - apply patch
 - build koha-common package
 - install koha-common package, and confirm koha-l10n package is installed

5 months agoBug 35174: Don't run gulp po commands if po dir is missing
Jonathan Druart [Thu, 16 Nov 2023 07:45:15 +0000 (08:45 +0100)]
Bug 35174: Don't run gulp po commands if po dir is missing

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
5 months agoBug 35174: Add misc/translator/po to .gitignore
Jonathan Druart [Thu, 16 Nov 2023 07:44:56 +0000 (08:44 +0100)]
Bug 35174: Add misc/translator/po to .gitignore

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
5 months agoBug 35174: Add a warning to the about page
Jonathan Druart [Thu, 16 Nov 2023 07:43:43 +0000 (08:43 +0100)]
Bug 35174: Add a warning to the about page

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
5 months agoBug 35174: Do not explode if po dir does not exist
Jonathan Druart [Thu, 16 Nov 2023 07:27:10 +0000 (08:27 +0100)]
Bug 35174: Do not explode if po dir does not exist

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
5 months agoBug 35174: Remove .po files from Koha
Koha translators [Wed, 22 Nov 2023 08:36:09 +0000 (09:36 +0100)]
Bug 35174: Remove .po files from Koha

5 months agoBug 35012: Apply change to all events
Marcel de Rooy [Thu, 9 Nov 2023 13:16:05 +0000 (13:16 +0000)]
Bug 35012: Apply change to all events

We should not just look at Click.

Test plan:
[1] Apply the example patch for a Blur action in barcode.pl.
[2] Check that barcode.pl is active in your framework and that
    autoBarcode is not disabled.
[3] Open the browser dev console.
[4] Tab a few times through barcode in the neworderempty form of
    Acquisition. If you leave the field, the Blur event fires.
    => Without this patch you will see two console lines (FF may
    show a little '2' icon at the right side) added. With this
    patch just one.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jan Kissig <jkissig@th-wildau.de>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit e9326f0e86881f95fd79b2dd7a2e9578ab517116)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit c8685d088aa03b0e64b073b2db001a2df5335819)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
5 months agoBug 35012: Prevent Click handler firing twice
Jan Kissig [Tue, 10 Oct 2023 11:36:04 +0000 (13:36 +0200)]
Bug 35012: Prevent Click handler firing twice

test plan:
a) build a new basket + order line using "item create on placing an order"
b) in the item creation dialog (neworderempty.pl) please use the webbrowsers dev tools to analyze the [...] button next to subfield d (Date acquired) and inspect the events that get fired by clicking
c) notice the Clicktag_952_subfield_d_* event gets fired twice.
d) apply patch and reload page
e) there should be only 1 click handler left (besides the jquery one), which points to the Clicktag_952_subfield_* function

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
See also bug 35298. You may have seen that the Focus event of dateaccessioned
did not fire. But that is related to use of Flatpickr in this plugin.
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit ec3fe5d41e03d969b876f0948e81389b0a20df4c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit f846ee85ecbe7f75e9ba842a7cae905813c909d4)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
5 months agoBug 35276: Remove authentication params from suggestion hash
Marcel de Rooy [Tue, 7 Nov 2023 12:57:42 +0000 (13:57 +0100)]
Bug 35276: Remove authentication params from suggestion hash

These would be forwarded to Koha::Objects->as_list and crash on
unknown column.

Test plan:
Logout from staff.
Enter URL /suggestion/suggestion.pl
Without this patch, it crashes. Now it does not.

Note: The crash may show auth_forwarded_hash but I also saw
koha_login_context passing by. Same issue.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit e2821c7962ca7594f029f4c7fdb0c2f70028eb9b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 898e0d79793e8ff9450242e8e6b2f1f97e2873f8)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
5 months agoBug 35298: Remove focus handler from dateaccessioned plugin.
Marcel de Rooy [Thu, 9 Nov 2023 08:05:34 +0000 (08:05 +0000)]
Bug 35298: Remove focus handler from dateaccessioned plugin.

Test plan:
Verify that setting focus to date acquired field in items editor
fills date of today when field is empty but does not replace existing
date.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 0583deac95b35f1ad96493262e922d7ac3eef102)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 5ca56bf8b380644ddc35d5f72c8f14707489efdc)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
5 months agoBug 35343: Add record accessor method to Koha::Authority
Martin Renvoize [Tue, 6 Dec 2022 20:07:02 +0000 (17:07 -0300)]
Bug 35343: Add record accessor method to Koha::Authority

Code lifted from bug 31794 to fix already backported bug 26611.

Unit tests included.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 40115a2c8cba3e081ffd0710899ef4556a3bbb54)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
5 months agoRmaint fix: Revert bug 35148 as it needs 31453 not in 22.11.x
Pedro Amorim [Wed, 15 Nov 2023 13:41:10 +0000 (12:41 -0100)]
Rmaint fix: Revert bug 35148 as it needs 31453 not in 22.11.x

5 months agoRmaint fix: Same as 7e9866a
Pedro Amorim [Wed, 15 Nov 2023 09:31:24 +0000 (09:31 +0000)]
Rmaint fix: Same as 7e9866a

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
5 months agoBug 35284: Fix tests
Jonathan Druart [Thu, 9 Nov 2023 09:45:32 +0000 (10:45 +0100)]
Bug 35284: Fix tests

This fix patrons_search.t but other selenium tests certainly need
adjustements

Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
5 months agoRmaint fix: Remove Koha::Tickets import from 35019 rebase
Pedro Amorim [Tue, 14 Nov 2023 16:11:36 +0000 (16:11 +0000)]
Rmaint fix: Remove Koha::Tickets import from 35019 rebase

5 months agoBug 35284: Add throttling to column filters
Jonathan Druart [Thu, 9 Nov 2023 07:58:41 +0000 (08:58 +0100)]
Bug 35284: Add throttling to column filters

Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
5 months agoBug 35284: Fix Vue tables
Jonathan Druart [Thu, 9 Nov 2023 07:58:11 +0000 (08:58 +0100)]
Bug 35284: Fix Vue tables

Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
5 months agoBug 35284: Add DT delay to kohaTable
Jonathan Druart [Wed, 8 Nov 2023 21:23:20 +0000 (22:23 +0100)]
Bug 35284: Add DT delay to kohaTable

To test:
* When a specific initComplete exists (general patron search)
* When no specific initComplete exists (cities)

=> KO
* ERM tables display twice the "show X entries" dropdown list
* Column filters are not affected

Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
5 months agoBug 35187: [23.05] (follow-up) Fix missing line breaks in WELCOME notice
Jonathan Druart [Sat, 11 Nov 2023 10:04:06 +0000 (11:04 +0100)]
Bug 35187: [23.05] (follow-up) Fix missing line breaks in WELCOME notice

yaml was broken because of extra space

(cherry picked from commit e867c7207bd16fb018052945cb83a146fa3192a1)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
5 months agoBug 35144: Update style of 'Required' label for OPAC patron attributes
Owen Leonard [Tue, 7 Nov 2023 19:06:13 +0000 (19:06 +0000)]
Bug 35144: Update style of 'Required' label for OPAC patron attributes

This patch makes some changes to style and markup of the part of the
OPAC patron entry form which displays patron attribute entry fields.

To test, apply the patch and rebuild the OPAC CSS.

- Create at least two patron attributes which have both "Display in
  OPAC" and "Editable in OPAC" checked: One which is linked to an
  authorized value, one which isn't. At least one attribute should be
  mandatory. At least one attribute should be repeatable.
- Test the form using either patron self-registration or by logging in
  to the OPAC and clicking the "Personal details" link in the sidebar.
- Check the appearance of required fields in the form, including the
  mandatory patron attributes.
- Confirm that the "Clear" and "New" controls look good and work
  correctly, including fields cloned with the "New" button.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit dd70e43b66fc2a887c5a5d6afc165ebf20469354)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit e1dc14bb68d1a27447f6c09979dd75b184ff467a)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
5 months agoBug 35283: Add missing subfield h to action note 583 in OPAC detail page
Katrin Fischer [Thu, 9 Nov 2023 21:33:10 +0000 (21:33 +0000)]
Bug 35283: Add missing subfield h to action note 583 in OPAC detail page

$x is nonpublic note, so it makes sense to only display it in staff, but
$h is Jurisdiction and we should show it in OPAC and staff alike.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 653dc1b2214d0ebb291766406354c69cfa57c7e1)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 916f7d9127e4bd1f679b1f1a0c54802a1869f1e7)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
5 months agoBug 35283: Add missing subfields h and x to field 583 for staff XSLT
David Cook [Wed, 8 Nov 2023 02:24:01 +0000 (02:24 +0000)]
Bug 35283: Add missing subfields h and x to field 583 for staff XSLT

This change adds the missing subfields h and x to field 583 for
the detail XSLT in the staff interface.

Test plan:
0. Apply the patch and koha-plack --reload kohadev
1. Go to http://localhost:8081/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=29
2. Click on tab "5"
3. Scroll down to 583 and click on "ACTION NOTE" to expand subfields
4. Fill in using the following example:
   583 0#$adowngraded$c19910110$hJoe Smith$otitle$xfrom secret FRD to confidential NSI
5. Click "Save"
6. Note that the "Action note" now shows "Joe Smith" and "from secret
   FRD to confidentail NSI"

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit d74a89e2dabe355f05c4c45b6b39e581509e1c16)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit ba9a11341041bc6fed3fb8c0ef7bf1f54d51c954)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
5 months agoBug 33164: Do not prevent processing of all error messages
Aleisha Amohia [Mon, 23 Oct 2023 22:28:55 +0000 (22:28 +0000)]
Bug 33164: Do not prevent processing of all error messages

This follow-up patch removes the use of $exit_required_p completely. The sysprefs BlockReturnOfLostItems and BlockReturnOfWithdrawnItems are handled in other scripts, and should not prevent the processing of all returns error messages when enabled.

Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 64460e4f4e01d8cb84a8037f444e5f7739a6bd40)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 53370581fdfedd8232bd7bd3f4f9c81f7c56ad34)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
5 months agoBug 33164: Ensure return claim message shows if lost item return blocked
Aleisha Amohia [Tue, 7 Mar 2023 22:07:04 +0000 (11:07 +1300)]
Bug 33164: Ensure return claim message shows if lost item return blocked

This fix ensures that a return claim confirmation always shows, even if
the return of lost items has been blocked by BlockReturnOfLostItems
being enabled.

To test:

1. Set BlockReturnOfLostItems system preference to Block
2. Check out an item to a patron
3. Go to the patrons page and claim a return on the item
4. Check in the item and keep checking in the item. Notice the message
"Item is lost, cannot be checked in." shows every time, but the return
claim message only shows sometimes.

5. Apply the patch and restart services

6. Check in the item and keep checking in the item. Confirm both the
lost message shows and the return claim message shows every time.
7. Confirm the return of the item is still blocked.

Sponsored-by: Pymble Ladies' College
Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 1f56880812323a003d3d9d043c10c3142d397ac4)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 93276f59f14a293fdd639a6185577287693cd50c)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
5 months agoBug 35278: Fix warn from column_settings.pl
Marcel de Rooy [Mon, 6 Nov 2023 14:00:49 +0000 (14:00 +0000)]
Bug 35278: Fix warn from column_settings.pl

We need to add scalar to the calls. These parameters are not meant
to be used as multi_param.

Test plan:
Try With and without this patch on staff:

Try: /cgi-bin/koha/admin/columns_settings.pl
=> WITHOUT: No warnings
=> WITH: Same. No change.
Try: /cgi-bin/koha/admin/columns_settings.pl?module=acqui&page=basket
=> WITHOUT: Opens module, scrolls down. CGI::param called in list context in logfile
=> WITH: Opens module, scrolls down.
Try: /cgi-bin/koha/admin/columns_settings.pl?module=acqui&page=basket&table=orders
=> WITHOUT: Opens module, scrolls down. CGI::param called in list context in logfile
=> WITH: Opens module, scrolls down.

Try: /cgi-bin/koha/admin/columns_settings.pl?module=acqui&module=admin
* Hash like: panel => acqui, admin => page, undef  => table, undef => modules, $modules (SHIFTED)
=> WITHOUT: Acqui expanded showing: There is no page using the table configuration in this module.
=> CGI::param warning in log.
=> And: Problem = a value of table has been passed to param without key
=> And: Problem = a value of modules has been passed to param without key
=> WITH: Only the first module (Acqui) should be expanded.

Try: /cgi-bin/koha/admin/columns_settings.pl?module=acqui&module=admin&page=basket&table=orders
* Hash like: panel => acqui, admin => page, basket => table, orders => modules, $modules hash (SHIFTED)
=> WITHOUT: Acqui expanded showing: There is no page using the table configuration in this module.
=> And: CGI param log warning.
=> WITH:: Opens Acqui. Second module ignored. Scrolling.

Try: /cgi-bin/koha/admin/columns_settings.pl?module=admin&module=acqui&page=basket&table=orders
* Hash like: panel => admin, acqui=> page, basket => table, orders => modules, $modules hash (SHIFTED)
=> WITHOUT: Admin expanded showing: There is no page using the table configuration in this module.
=> And: CGI param log warning.
=> WITH: Admin should be expanded (page and table ignored, not in Admin). No scroll.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 1b11de87b991ddae4d31861c9cdc321ce45d229d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit dbc24ece694b2bc1a56e32ff663765b1f1dd5d1b)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
5 months agoBug 34413: Fix style of Flatpickr in iOS mobile view
Owen Leonard [Thu, 9 Nov 2023 13:21:06 +0000 (13:21 +0000)]
Bug 34413: Fix style of Flatpickr in iOS mobile view

This patch updates Flatpickr CSS in the OPAC and staff interface so that
date fields are displayed correctly in iOS mobile views.

To test, apply the patch and rebuild the OPAC and staff interface CSS.

- In the OPAC, click "Create new account"
- In the account entry form, confirm that the date of birth field looks
  correct and that the date-picker works as it should.
- In the staff client, go to Patrons -> New patron.
- Check the date of birth field in this form too.

This patch has been tested in the Xcode iOS device simulator with iOS
17. While I wasn't able to reproduce the problem in Firefox, I was able
to use the developer tools' responsive design mode to trigger the mobile
view and thus be able to see the styles which are being applied:

- In the OPAC, on the "Create new account" screen, open the Web
  Developer Tools panel (Tools -> Browser tools -> Web Developer Tools).
- Click the "Responsive Design Mode" button in the upper-right corner of
  the developer tools panel (it looks like a phone and tablet together).
- The main browser window will now how some settings at the top.
- In the first dropdown, choose an iPhone model.
- The date of birth field should now be styled differently because of
  the addition of a "flatpickr-mobile" style.
- Right-click the field and choose "Inspect." In the developer console
  you can see the styles which are being applied to the field. One of
  those should be ".flatpickr-input.flatpickr-mobile"

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 9e9fa64d5a9f8966c45a923b258c994df70ac35f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 0b468bd4139b1d35e87e0ff44b6f5e48ca26641d)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
5 months agoBug 35295: Move JS asset in returns.tt
Lucas Gass [Wed, 8 Nov 2023 21:18:27 +0000 (21:18 +0000)]
Bug 35295: Move JS asset in returns.tt

To Test:
1. Place a hold
2. Check-in an item of the held record
3. No hold modal 😱
4. APPLY PATCH
5. Hold modal!!!

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 771334218acc2a5eb97bac1eab38a53543084444)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 6abfcbecd878bb634b129df59c345f2c80c4955f)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
5 months agoBug 35262: Improve OPAC self registration confirmation page
Owen Leonard [Mon, 6 Nov 2023 19:40:06 +0000 (19:40 +0000)]
Bug 35262: Improve OPAC self registration confirmation page

This patch corrects logic in the OPAC self registration confirmation
template so that the right column markup is shown when various
combinations of OpacNav, OpacNavBottom, and OpacNavRight are displayed.

To test, apply the patch and enable the PatronSelfRegistration system
preference, and deactivate the PatronSelfRegistrationVerifyByEmail
preference.

- Go to the OPAC and start the process of registering online.
- Fill in the form and submit it.
- On the registration confirmation page, check that the layout looks
  correct.
- Test with the presence of various combinations of OpacNav,
  OpacNavBottom, and OpacNavRight HTML customizations.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 64edb692458262133818553c4cbfa86ca3612260)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 4e34b92112df0e97d7a4fcc72c5bd95ca7c202dd)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
5 months agoBug 35206: Adjust style of add button on curbside pickups administration
Owen Leonard [Tue, 31 Oct 2023 17:10:15 +0000 (17:10 +0000)]
Bug 35206: Adjust style of add button on curbside pickups administration

This patch adds Bootstrap classes to the "Add" button on the curbside
administration page, in the "Curbside pickup hours" section. This makes
it consistent with the markup of similar buttons in the interface and
makes it slightly smaller so that it fits better in the form.

To test, apply the patch and make sure the "CurbsidePickup" preference
is enabled.

- Go to Administration -> Curbside pickups.
- Fill out the form, including the "New slot" fields in the "Curbside
  pickup hours" section.
  - Confirm that the corresponding "Add" button looks correct, and that
    it works to add your new slot.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit cc70e17f5d07ad8988a1a4a02e0049abc7428547)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit b7cb356363d09c1bb1839165cbc4d090c47317ea)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
5 months agoBug 35198: Sort database column names alphabetically on automatic item modification...
Owen Leonard [Tue, 31 Oct 2023 13:48:11 +0000 (13:48 +0000)]
Bug 35198: Sort database column names alphabetically on automatic item modification page

This patch modifies the automatic item modification by age page so that
the rule entry form sorts <select>s alphabetically, making it easier to
find the entry you need.

The [% FOR field IN... %] directives now include the "sort" method, e.g.

    [% FOR field IN agefields.sort %]

To test, apply the patch and go to Cataloging -> Item modifications by
age

- Click the "Add rules" button, then the "Add rule" button.
- Check the "Age field," "Conditions," and "Substitutions" dropdowns to
  confirm that the choices are listed alphabetically.
- Fill in the form and save the rule.
- Go back and edit the rule you created. Check that the dropdowns are
  still correct.

Signed-off-by: Andrew Auld <andrew.auld@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit fd258280482e0c84bf6baf61d7054b1c628e53f7)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 2872ebe3d49e3425077b58ce6829a34e954b80c0)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
5 months agoBug 34704: Remove regex for adding additional line breaks to print templates
Katrin Fischer [Tue, 7 Nov 2023 22:31:31 +0000 (22:31 +0000)]
Bug 34704: Remove regex for adding additional line breaks to print templates

This makes sure that we don't change the line breaking for either
HTML nor plain text print notices.
For plain text, the <pre> is used to keep the line breaks as defined
in the notices template.
For HTML we require on the line breaks added by block elements in the
HTML notice, not adding any additional ones like before.
This gives the full control of the formatting to the notice editor.

To test:
* Make sure your patron doesn't have an email address
* Make sure to check the hold filled notice in messaging preferences
* Place a old on any item
* Checkin the item
* Confirm hold
* Verify notices tab shows the Hold (print) notice
* ./misc/cronjobs/gather_print_notices.pl ./ --html
* Verify the generated file has the HTML output wrapped in pre.
* Reformat the HOLD print notice to be HTML by setting the checkbox.
  Mmake sure to add some empty lines for (they should not print later)
  and some <br>, <p>, <div>  - They should be reflected in the notice later.
* Repeat test.
* All should be well :)

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 4c15ad658d59d7f63d27fe61dc102ecd4c22a03d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit e0eb511d59093321b7df638a654a93b8010ddb10)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
5 months agoBug 35187: Fix missing line breaks in WELCOME notice
Katrin Fischer [Fri, 10 Nov 2023 18:24:15 +0000 (18:24 +0000)]
Bug 35187: Fix missing line breaks in WELCOME notice

When a notices is marked as HTML, we need to use block elements
(p, div, li, etc.) or explicit line breaks.
This adds the line breaks where required.

To test:

WELCOME
* Without patch
* Make sure your Koha can send email (set up SMTP server, KohaAdminLibraryAddress)
* Make sure your patron has an email set
* In patron account, use "More > Welcome email"
* Verify all text is on one line
* Apply patch
* reset_all to install new sample notice templates
* Repeat test, verify welcome notice is now nice

(cherry picked from commit d60fe27ea4bda16efcd0db096d756e8a54552056)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
5 months agoBug 35280: Fix patron attributes "clear" link in OPAC patron entry form
Owen Leonard [Tue, 7 Nov 2023 17:07:17 +0000 (17:07 +0000)]
Bug 35280: Fix patron attributes "clear" link in OPAC patron entry form

This patch makes a minor correction to the JavaScript controlling the
behavior of the "clear" link which appears on the patron entry form next
to patron attribute <select>s or <textarea>s which are editable in the
OPAC.

To test, apply the patch and create patron attributes
which have both "Display in OPAC" and "Editable in OPAC" checked.

- Create one which is tied to an authorized value, and one which isn't.
- Log in to the OPAC and click the "Personal details" tab.
- In the entry form, find the patron attribute fields under the
  Additional information" heading..
- Select a value in the dropdown, and enter text in the textarea.
- Confirm that clicking the corresponding "Clear" link for each works as
  expected.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 3a027a0da974ecc72d2144f2b503d3013257c8a7)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit f49e438ed9a8fcc99854fac60869e19e75f4d0f1)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
5 months agoBug 34857: Do not enable hidden select element (regression from bug 33233).
Andreas Jonsson [Tue, 7 Nov 2023 13:42:58 +0000 (14:42 +0100)]
Bug 34857: Do not enable hidden select element (regression from bug 33233).

Test plan:

Using Chrome as web browser:

* Go to opac advanced search
* Press "more options"
* Search for two keywords using "and" operator (on ktd search for idea AND behind, which matches 1 result)
* Search for two keywords using "or" operator (on ktd search for idea OR behind, which matches 4 results)
* Search for two keywords using "not" operator (on ktd search for idea NOT behind, which matches 2 results)

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit b5d174c7d9e87766fc7dbe6160932052199b4638)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit edbe64ef5e278be69bdfa7f57d6d55cf0d07a00d)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
5 months agoBug 31041: (follow-up) Clean up and generalise
Martin Renvoize [Tue, 7 Nov 2023 11:35:22 +0000 (11:35 +0000)]
Bug 31041: (follow-up) Clean up and generalise

This patch cleans out the print media css rules that were originally
added for modalprinting.  The window.open method is simpler to maintain
and will more reliably print modal content as expected.

We factor out the printer code into it's own JS asset that we can apply
to other printable modals and then use it in the two existing places
where such modals have been defined already (cashup summary and bundle
confirmation).

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit ef880e349f959686a830bda67ec5a295e3d76eb4)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 39a8ff6bb5c97b07cf8e73424e7432cf675b3777)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
5 months agoBug 31041: Prevent duplicate display of cashup summary when printing
Lucas Gass [Thu, 2 Nov 2023 19:56:00 +0000 (19:56 +0000)]
Bug 31041: Prevent duplicate display of cashup summary when printing

To test:
1. Have POS on.
2. Have some registers and items for sale. Make some sales to 'Cashup'.
3. If you have enough enough lines in the table so that 'register.pl' would print on 2 or more pages, the summary will be duplicated that same number of time.

If you are lazy like me and don't want to make that many transaction you can also add some content to the page like this:

for (let i = 0; i < 100; i++) {
  $('#register').append('<h1>TEST</h1>');
}

4. APPLY PATCH, clear browser cahche
5. Try printing again, you should only get one cashup summary when printing.

Signed-off-by: Juliet Heltibridle <jheltibridle@rcplib.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 85fb62f3d6e0784bf75309325b78712f18877055)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit d74cec96120cec3ea6bec79006c371e4794cb3da)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
5 months agoBug 31041: add modal_printer.js asset to registers.tt
Lucas Gass [Tue, 7 Nov 2023 22:32:47 +0000 (22:32 +0000)]
Bug 31041: add modal_printer.js asset to registers.tt

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit fcd97d8741d1141ee99e5ad0d8ec89d0f9ea32c8)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit fc117555718bd4ff47c4dc0c14617097ce924944)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
5 months agoBug 34931: Remove fieldset/legend in favor of div/h3
Lucas Gass [Thu, 12 Oct 2023 22:14:10 +0000 (22:14 +0000)]
Bug 34931: Remove fieldset/legend in favor of div/h3

1. Create some PA_CLASS authorized values.
2. Create some custom patron attributes and add them to the newly created PA_CLASS's.
3.  Set CollapseFieldsPatronAddForm to collapse 'Additional attributes and identifiers'.
4. Go to a new or existing patron record.
5. At the top of the page click the checkbox for "Show collapsed fields:".
6. Scroll down to that section and notice the PA_CLASS <legend> element is shown but not the individual patron attributes within that PA_CLASS.
7. Apply patch
8. Try again, the Additional attributes and identifiers fieldset should display properly.

Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 1944c66fc03e0e661745ece4bbc04e0607dd6def)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 2d96b55f32771965dcfba6c135d57e4adf17e817)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
5 months agoBug 34375: Fix the option to provide no fund in budget dropdown
Matt Blenkinsop [Mon, 6 Nov 2023 10:40:33 +0000 (10:40 +0000)]
Bug 34375: Fix the option to provide no fund in budget dropdown

Currently it is not possible to use the No fund option as the dropwdown will default to the first budget in the list. This patch re-adds this option so that the defaulting behaviour is fixed

Test plan:
1) Go to a vendor record in Acquisitions and then Receive Shipment
2) Enter an invoice number
3) Leave the Shipping cost empty and Shipping Fund as 'No fund'
4) Receive some orders or go straight to Finish receiving
5) Notice the Shipping fund has defaulted to the first fund in the alphabetical list of funds.  It is not possible to select 'No fund' and the selected fund is recorded in shipmentcost_budgetid incorrectly.
6) Apply patch
7) Repeat steps 1-5 and this time the No fund option should be used correctly

Signed-off-by: Georgia Newman <g.newman@arts.ac.uk>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit e7e0390dabbe267abb702812c03a484c4a7909b8)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 534cee26ba59132c63826c3d44fa1411521984a7)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
5 months agoBug 35245: Set default width for select2 in authorities
Pedro Amorim [Fri, 3 Nov 2023 10:17:23 +0000 (10:17 +0000)]
Bug 35245: Set default width for select2 in authorities

Test plan:
1) Edit a authority Marc framework, e.g. 'CHRON_TERM', visit:
   /cgi-bin/koha/admin/auth_tag_structure.pl?authtypecode=CHRON_TERM
2) Pick any field to turn into a AV field, e.g. 371, and edit its subfields:
   /cgi-bin/koha/admin/auth_subfields_structure.pl?tagfield=371&authtypecode=CHRON_TERM
3) Pick a subfield e.g. 'd' and click edit, visit:
   /cgi-bin/koha/admin/auth_subfields_structure.pl?op=add_form&tagfield=371&tagsubfield=d&authtypecode=CHRON_TERM#subdfield
4) Pick a Authorized value list e.g. DEPARTMENT, click Submit
5) Create a new authority of the same type 'CHRON_TERM', visit:
   /cgi-bin/koha/authorities/authorities.pl?authtypecode=CHRON_TERM
6) Click on Tab '3' and click on field 371 ADDRESS to expand it
7) Notice field 'd' select2 width is very narrow
8) Apply patch. Repeat. Notice its not narrow anymore

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit f918c3ff803d811ad025bff42e1263e3b3aafa83)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit c577710c40a60236549e88700c654d718da5f7df)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
5 months agoBug 34993: (QA follow-up) Perltidy
Katrin Fischer [Sun, 5 Nov 2023 11:50:17 +0000 (11:50 +0000)]
Bug 34993: (QA follow-up) Perltidy

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 24e1ee2118311bad39203a932dd4c6ab67c5d8c9)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 6b193a80975bc43c9462493cd70117a75d7c7088)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
5 months agoBug 34993: Pass context parameters to generate_subfield_form
Emily Lamancusa [Thu, 2 Nov 2023 16:56:35 +0000 (12:56 -0400)]
Bug 34993: Pass context parameters to generate_subfield_form

Pass necessary parameters from the UI to ensure that the basic
MARC editor can correctly identify when a framework is changed,
a bib is being duplicated, or a bib is being imported with Z39.50 -
for purposes of filling in default values according to the settings
of ApplyFrameworkDefaults.

To test:
1. Set the system preference ApplyFrameworkDefaults - Select All
2. Create or edit a MARC bibliographic framework with a default value in
   one of the fields (such as 500$a)
3. Go to the Cataloguing module and create a new record using the
   framework from step 2
   --> Confirm that the default value is filled in
4. Search for an existing bib record
5. Click Edit > Edit record to open the basic editor
6. If the field from step 2 already has data, clear it
7. Switch the framework to the framework from step 2
   --> Confirm that the default value is filled in
8. Clear the field again, and save the edit
9. Click Edit > Edit as new (duplicate)
   --> Confirm that the default value is filled in
10. Go to the cataloguing module and do a Z39.50 search
11. Find a record that does not have a value for the subfield from step 2
12. Import the record using the framework from step 2
    --> Confirm that the default value is filled in

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 0c941147903294dd33996a8d293285c9a82e4f13)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit e72ac1bacc063fa3650c528c84eee132d888f8ea)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
5 months agoBug 35212: Correct mismatched label on identity provider entry form
Owen Leonard [Wed, 1 Nov 2023 10:21:41 +0000 (10:21 +0000)]
Bug 35212: Correct mismatched label on identity provider entry form

This patch corrects the identity provider form so that the label for the
"Allow staff" field has the correct "for" attribute. Currently it is a
duplicate of the one for the "Allow OPAC" field.

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

- Click "New identity provider"
- Near the bottom of the form, look for the "Allow staff" field.
- Clicking the "Allow staff" label should activate the corresponding
  dropdown.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 15f0dc2c2a027896c0b2f62c4e08cd46279426e9)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit ddc3c4172a013e01d2dcfc4149d4133c514621f7)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
5 months agoBug 17798: (follow-up) Adjust color of fieldset nested in .dialog.alert
Owen Leonard [Fri, 3 Nov 2023 12:22:34 +0000 (12:22 +0000)]
Bug 17798: (follow-up) Adjust color of fieldset nested in .dialog.alert

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit aaa0bd2391fc49a23c2d7a5a8369c7b7300e6bdf)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 1d15d94279790c4561ee0e4bd71f496d7e582c3a)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
5 months agoBug 17798: Add fieldset for 'Yes, check out (Y)'
Nick Clemens [Thu, 2 Nov 2023 19:10:02 +0000 (19:10 +0000)]
Bug 17798: Add fieldset for 'Yes, check out (Y)'

With the increased text, the buttons don't arrange neatly. Adding a
fieldset around the options for 'Yes' mitigates this somewhat - it
could do with a bit more styling, however, it also fixes bug 23953

To test:
Confirm the 'Yes' options are more clear that they only affect the yes
button
Confirm the other buttons arrange nicely

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 5d291a6f1d9df762232379bc214753953c2d672e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 8ac35d4f15a96101bd68ead6af38f2e7e80a041b)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
5 months agoBug 17798: Confirm hold when printing slip from another patron's account
Nick Clemens [Thu, 2 Nov 2023 19:05:16 +0000 (19:05 +0000)]
Bug 17798: Confirm hold when printing slip from another patron's account

This patch adds a few pieces of information to the print slip button
and makes the code confirm the hold

As we are printing before the confirm, we also add the ability to pass
in the itemnumber to 'ReserveSlip'

This is slightly hacky, however, I don't see another way to allow
printing without an additional page reload.

To test:
 1 - Place a title level hold for patron A, for delivery to library B
 2 - Attempt to checkout an item from the record above to Patron B from
     library A
 3 - You receive an alert about the hold
 4 - Click "Don't check out, confirm hold, and print slip"
 5 - Confirm the slip looks correct and has item info
 6 - Confirm that item is in transit to fill hold
 7 - Revert transit status
 8 - Attempt to checkout the item to Patron B from Library B
 9 - Click "Don't check out, confirm hold, and print slip"
10 - Confirm slip is correct
11 - Confirm item is marked waiting

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 3ec73d80e2a88e3a87eefc886865ccfb91f9be09)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 96442d7ac738c3baf3a0e6914362e908bdc7adc3)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
5 months agoBug 32379: Add check on existing item
Marcel de Rooy [Thu, 2 Nov 2023 10:47:50 +0000 (10:47 +0000)]
Bug 32379: Add check on existing item

Simplest fix; bail out with output_error.

Test plan:
Try /cgi-bin/koha/cataloguing/additem.pl?biblionumber=1&op=saveitem&itemnumber=999999
Note: Replace 1 by existing biblionumber, and iitem 999999 should not exist.
You should get the 404 screen now.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 0677a53e1445342ac4927a1177100f69e4f02271)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 7890c068fa5c3e51abeb94fa76f2f425af777768)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
5 months agoBug 30024: Make link_bibs_to_authorities.pl rely on LinkerRelink
Tomas Cohen Arazi [Tue, 27 Sep 2022 19:10:51 +0000 (16:10 -0300)]
Bug 30024: Make link_bibs_to_authorities.pl rely on LinkerRelink

This patch makes the trivial change of making the linker script rely on
LinkerRelink instead of CatalogModuleRelink, which is confusing and
incorrect (according to both sysprefs descriptions).

To test:
1. Verify that relinking is now tied to the right syspref

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 4310e13a6416d680e825621278859e3b91b1942a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 234e00b1d62db02d0fa7870d8045b4398ef80eb5)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
5 months agoBug 35242: Force memcache restart after koha upgrade
Mason James [Thu, 2 Nov 2023 22:56:51 +0000 (11:56 +1300)]
Bug 35242: Force memcache restart after koha upgrade

to test..

1/ install koha-common
    $ sudo apt install koha-common

2/ start memcached, check PID
    $ sudo service memcached start
    $ sudo systemctl status  memcached | grep PID
        Main PID: 52851 (memcached)

3/ build and install new koha-common package (will trigger a restart)
    $ sudo apt install ./koha-common-git+deadbeef.deb

5/ check that memcache is started, and has new PID (52900)
    $ sudo systemctl status  memcached | grep PID
        Main PID: 52900 (memcached)

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 1fa096e7a03ad7d42ca5f4de12d873ea1b8a4bce)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 557425afd92dffeedb2794231852e99806d9733b)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
5 months agoBug 35073: perltidy subscription-batchedit.pl
Pedro Amorim [Tue, 17 Oct 2023 09:24:09 +0000 (09:24 +0000)]
Bug 35073: perltidy subscription-batchedit.pl

git show -w <this_patch_hash>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit ffb5022591f6b96c50bf8a9c0409bd01b108a65c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 3621e32bd13a467734894486db73e84a21d7baf6)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
5 months agoBug 35073: Default to existing value if there is one
Pedro Amorim [Tue, 17 Oct 2023 09:20:59 +0000 (09:20 +0000)]
Bug 35073: Default to existing value if there is one

For values that dont exist in the batch edit submission, i.e. UI says 'No change', we default to existing value if there is one.

Test plan:
Preparation - Additional fields:
1) Add a new 'additional field', visit:
/cgi-bin/koha/admin/additional-fields.pl
2) Click 'subscription' and '+ New field'. Enter a 'name' and hit 'save'.

Serials:
1) Add a new serial, visit:
/cgi-bin/koha/serials/subscription-add.pl
2) Put a biblionumber in the 'record' field, i.e. '112'. Press 'next' and click 'ok' on the alert box
3) Fill all the required fields and click 'test prediction'
4) Input something in the additional field created previously.
5) Click 'save subscription'. Notice the additional field is as expected.
6) Repeat steps 1-5 to create a second serial.

Batch edit:
1) Visit serials and hit the 'Search' button:
/cgi-bin/koha/serials/serials-home.pl
2) Click the 2 checkboxes for the 2 serials we created previously and click the new link that pops up 'edit selected serials'.
3) Click 'Save' without changing anything.
4) Go back to either of the serials, notice the value for the additional field is unchanged. Visit:
/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=1

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 7294908de35a46f491af4e170fb9f6294a5fb4bf)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit bcb2adb604d74f9eebee462b19d6493a426bb67c)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
5 months agoBug 35073: Rename additional_fields to available_additional_fields
Pedro Amorim [Tue, 17 Oct 2023 09:18:29 +0000 (09:18 +0000)]
Bug 35073: Rename additional_fields to available_additional_fields

'additional_fields' is ambiguous and in other places we name this available_additional_fields instead. Do the same here.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 05d131febf2d98d1c0ec18da845589dcd80a5e8d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit a5fa92d2c0cd30a982660e427285a22b8f1a8977)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>