Commit Graph

26269 Commits

Author SHA1 Message Date
Owen Leonard 5b8756f7b2
Bug 41764: ISSN hidden input missing from Z39.50 search form navigation
This patch modifies the Acquisitions and Cataloging Z39.50 search forms
so that the pagination form includes a hidden ISSN input. This is
necessary for the form to submit the same search parameters each time
the user requests a new page of results.

To test, apply the patch and go to Acquisitions.

- Search for a vendor, and create a basket if necessary.
- Add to the basket and choose "From an external source."
- In the "ISSN" field, enter a partial ISSN number, e.g. 0361, and
  search.
- At the bottom of the search results, click the "Next page" button.
- The second page of results should load correctly. At the top of the
  table of results it should say "You searched for: ISSN: 0361"
- Perform the same test in Cataloging:
  - Cataloging -> New from Z39.50/SRU

Sponsored-by: Athens County Public Libraries
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-02-06 15:17:31 -07:00
Emmi Takkinen c27f4e54ac
Bug 41431: Use correct data-attribute to fetch existing circulation rule note
If you click Edit on a line with a note, the note field is not displayed
in the editing line and is blanked upon save (i.e., the note is lost,
even if you made no edits on the note). Value of the note is stored to
data-attribute which was changed to use Bootstraps own data-attribute.
So now the value must be fetched with keyword "bsContent" instead of
just "content".

To test:
1. Add note for a circulation rule.
2. Edit the rule.
=> Note that notes value is not displayed in editing row.
3. Apply this patch.
4. Edit rule again.
=> Note that notes value is now displayed as expected.

Sponsored-by: Koha-Suomi Oy
Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-02-06 15:17:29 -07:00
Tomás Cohen Arazi b7ab84f560
Bug 41617: Remove extra spaces breaking CSV formatting
This patch removes extra spaces breaking CSV parsing in tools like Excel.

To test:
1. Perform an item search selecting the CSV option
2. Open the CSV with a TEXT EDITOR of your choice
=> FAIL: Notice the extra spaces after the commas (those used as separators, no the ones within the double quotes)
3. Apply this patch
4. Repeat 1-2
=> SUCCESS: No extra spaces!
5. Sign off :-D

Note: On the first attempt you can open the file on Excel if you have it and notice things are not aligned.
Note2: Using double quotes on all fields regardless of the context works for most parsers, but is not correct CSV. Will deal with it on a separate bug.

Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-02-06 15:17:28 -07:00
Martin Renvoize 971e2ead4b
Bug 41749: Display patron consents on staff patron detail page
Adds a read-only "Consents" section to the staff patron detail page
showing the patron's consent status for GDPR (when PrivacyPolicyConsent
is enabled) and any plugin-defined consent types.

Each consent displays with visual status indicators:
- Green checkmark with timestamp when consent was given
- Red X with timestamp when consent was refused
- Gray "Not specified" when no consent recorded

Test plan:
1. Enable PrivacyPolicyConsent system preference
2. As patron in OPAC: give/refuse consent at "Your consents"
3. As staff: view patron detail page
4. Verify "Consents" section shows correct status and timestamp
5. Test with no consent recorded (should show "Not specified")
6. If available, test with plugin-defined consent types

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-02-06 15:17:28 -07:00
Ayoub Glizi-Vicioso 707a208e16
Bug 41689: Make patron message labels translatable
To Test:

BEFORE APPLYING PATCH:
1- Go to any patron account > Add message
2- Add a message for: "Staff - Internal note"
3- Add a second message for: "OPAC - [NAME OF THE PATRON SELECTED]"

4- Add any language (I'll use french-Canada, fr-CA, in this case):
From your koha instance, enter on the command line:
./misc/translator/translate install fr-CA

5- Go to Administration > System preferences > enter language
6- Make sure to check 'Français (fr-CA)' box from the 'StaffInterfaceLanguages'preference and save.

7- Go back to the specific patron in which you added the messages
8- Switch language to 'Français' (bottom left corner)

9- Notice that:
--> 'OPAC' is still the same (Since we spell OPAC the same way in both english and french. However, it might not be the case in other languages).
--> 'Staff note' is not translated.

10- apply patch

AFTER APPLYING PATCH:

11 - From you koha instance, enter on the command line:

./misc/translator/translate update fr-CA

./misc/translator/translate install fr-CA

12- Reload patron's page

13- Notice that 'Staff note' is now translated
** You should see this output: 'Note interne'

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-02-06 15:17:27 -07:00
Owen Leonard 531dbe668b
Bug 37773: Show search term in cataloging search results
This patch updates the cataloging search results page so that the search
term is shown in the page title, breadcrumb, and headings.

To test, apply the patch and go to Cataloging in the staff interface.

- Perform searches which will return varying results:
  - A search which returns records in both the catalog and the reservoir
    (perform some Z39.50 searches if the reservoir is empty).
  - A search which returns records in the catalog but not the reservoir.
  - A search which returns records in the reservoir but not the catalog.
  - A search which returns no results at all.
- In all cases, check the page title, breadcrumbs, and headings. Your
  search term should appear as expected.
- Test that the correct strings are translatable. In this example I'm
  testing fr-FR:

    - Update a translation:

    > gulp po:update
    > cd misc/translator
    > perl translate update fr-FR

    - Open the corresponding .po file for the strings pulled from the
      template e.g.  misc/translator/po/fr-FR-messages.po
    - Locate strings pulled from addbooks.tt for translation, e.g.:

      #: koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbooks.tt:93
      #: koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbooks.tt:207
      #, fuzzy, perl-brace-format
      msgid "No catalog search results for '{query}'"
      msgstr "Résultats de recherche pour '{query}'"

    - Delete the line starting with "#, fuzzy"
    - Edit the "msgstr" string however you want (it's just for testing)
    - Install the updated translation:

    > perl translate install fr-FR

- Switch to your updated translation in the staff interface and perform
  the same tests as above. The translations should appear as expected.

Sponsored-by: Athens County Public Libraries
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-02-06 15:17:26 -07:00
Owen Leonard e948934081
Bug 39255: Improve translation of title tags: OPAC part 4
This patch updates a batch of OPAC templates so that title tags can
be more easily translated.

To test, apply the patch and confirm that the following pages have
correct title tags:

- The summary page for a logged in user
- Most popular
- Purchase suggestions
- Recent comments
- Tags
- Lists
  - List of lists
  - List contents
  - Send list
  - Share a private list
- Send a cart
- View a subscription -> More details
- The opac-showmarc page isn't usually accessed directly but you can
  test it by opening the URL, e.g.
  http://localhost:8080/cgi-bin/koha/opac-showmarc.pl?viewas=html&id=5
- Self checkin (with SelfCheckInModule enabled).
- Self checkout (with WebBasedSelfCheck enabled).
  - Self checkout help
  - Self checkout slip

Sponsored-by: Athens County Public Libraries
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-02-06 15:17:26 -07:00
Lucas Gass 3e1b77f4f3
Bug 41536: (follow-up) Tidy the template
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-02-06 15:17:25 -07:00
Pedro Amorim 9c8a475d08
Bug 41536: Move 'Edit request' button to after backend actions buttons
This ensures that the 'Confirm request' will always be the first button in the toolbar.

Test plan:
1) Apply patch (skip this if sandbox)
2) Enable the ILLModule sys pref
3) Create a new request, visit:
<staff_url>/cgi-bin/koha/ill/ill-requests.pl?method=create&backend=Standard
4) Add any type, '42' as cardnumber, any library. Click 'Create'.
5) Notice the 'Confirm request' button is shown first, and with the 'primary button' styling.

Signed-off-by: Photonyx <Headtummy@gmail.com>
Signed-off-by: Laura_Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-02-06 15:17:25 -07:00
Pedro Amorim c47bbdec8d
Bug 41536: Add 'btn-primary' class to 'Confirm request' button
This makes the button stand out from the other available actions

Signed-off-by: Laura_Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-02-06 15:17:24 -07:00
Lucas Gass 27f4bb4c9d
Bug 41422: Fix I18N issue with FilterSearchResultsByLoggedInBranch
To test:
1. Apply patch
2. Search fof the FilterSearchResultsByLoggedInBranch system preference and set it to 'Do'.
3. Do a catalog search and notice the 'Show local items only' button above the "Location" column.
4. Click it to show information ( in that column ) that is only related to the branch you are currently logged in at.
5. In the same result set have some items that are checked out, withdrawn, lost, damaged, and notforlaon.
6. Play more with the search results and ensure everything is accurate.
7. Set the FilterSearchResultsByLoggedInBranch system preference to 'Don't' and confirm that there is no button to filter by branch anymore.

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-02-06 15:17:19 -07:00
Tomás Cohen Arazi 402a251392
Bug 40966: Make sure 'whole_record' and 'weighted_fields' are passed around
The ES query builder correctly handles this parameters (passed from
search.pl and opac-search.pl) when it builds the ES query. But the
returned 'query_cgi' that is used later for keeping the search results
query context for building things like facets, just doesn't pass this
values around, leading to a loss of them on the generated links.

This patch makes sure they are passed around.

To test:

1. Apply the regression tests
2. Run:
   $ ktd --shell
  k$ prove t/db_dependent/Koha/SearchEngine/Elasticsearch/QueryBuilder.t
=> FAIL: Tests fail! These params are not passed around!
3. Set ElasticsearchMARCFormat="Searchable array"
4. Reindex all the things:
  k$ koha-elasticsearch --rebuild -d -v kohadev
5. Go to advanced search, using the 'More options' option.
6. Check 'Search entire MARC record' and 'Apply weights to search'
7. Perform a search on 'FULL TEXT'
=> SUCCESS: The URL contains `whole_record=on` and `weighted_fields=on`
8. Hover on any facet and look at the link
=> FAIL: It doesn't contain them!
9. Apply this patch
10. Restart all
  k$ restart_all
11. Refresh the search results
12. Repeat 6
=> SUCCESS: Links have the needed parameters!
13. Repeat 2
=> SUCCESS: Tests pass! the parameters are passed around!
14. Sign off :-D

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-02-06 15:17:17 -07:00
Jonathan Druart 1776ba0e4e
Bug 41457: Add missing html filter
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-02-06 15:17:16 -07:00
Jonathan Druart ba5aa257b6
Bug 41457: Fix column visibility on the holds history table
We must use bKohaColumnsUseNames to correctly deal with the column
visibility if some columns are shown/hidden depending on sysprefs.

On the holds history table we have "item type" that is hidden if
AllowHoldItemTypeSelection is disabled.

Test plan:
1. Create a hold and select an item type
Note: I think there is a bug if you select it from "Hold next available
item", use "Hold details". Please confirm?
2. Go to the holds history view
3. Hide some columns
4. Modify the value of AllowHoldItemTypeSelection
5. Reload the page and notice that the state of the table is restored
   correctly, however the "item type" column is shown or hidden
   depending on the syspref's value.

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-02-06 15:17:15 -07:00
Tomás Cohen Arazi 5060bde417
Bug 41340: Better translatability on 'batch_item_record_modification.inc'
Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-02-06 15:17:13 -07:00
Fridolin Somers 15f21656fe
Bug 41043: Use op 'add_form' and 'edit_form' in z3950 servers
Since CSRF protection, 'op' arg for creating/editing an object uses add_form and edit_form.
This is missing only in admin/z3950servers.pl

This patch also removes TT variable add_form to avoid confusion

Test plan :
1) Create a new z3950 server
2) Enter mandatory datas in form and save
3) Edit this server
4) Copy this server
5) Repeat 1 to 4 for a SRU server

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-02-06 15:17:12 -07:00
Fridolin Somers d0cdf16a45
Bug 41043: Use op 'add_form' and 'edit_form' in oai servers
Since CSRF protection, 'op' arg for creating/editing an object uses add_form and edit_form.
This is missing only in admin/oai_servers.pl

This patch also removes TT variable add_form to avoid confusion

Test plan :
1) Create a new OAI repository
2) Enter mandatory datas in form and save
3) Edit this repository
4) Copy this repository

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-02-06 15:17:11 -07:00
Nick Clemens 643da6f9cd
Bug 41206: Add collection code to transfers to receive
This patch adds the collection code to the transfers to receive report
It wraps it in a span for styling/hiding

To test:
1 - Transfer some books with collection code set to another branch
2 - Sign in as that branch
3 - Circulation -> Transfers to receive
4 - No collection code shown
5 - Apply patch
6 - Refresh
7 - See collection code

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-02-06 15:17:10 -07:00
Pedro Amorim 62db27bc7c
Bug 41281: Only skip metadata if empty or undefined
1) Enable ILLModule
2) Create an ILL request:
<staff_url>/cgi-bin/koha/ill/ill-requests.pl?method=create&backend=Standard
3) Pick any type, add '42' for cardnumber and any library
4) Edit item metadata (assuming ID 1):
<staff_url>/cgi-bin/koha/ill/ill-requests.pl?op=edititem&illrequest_id=1
5) Click 'Add new field' under 'Custom fields'
6) Add any value for 'key' e.g. "test" and '0' for value.
7) Click 'Update'. Notice the custom field doesn't show.
8) Apply patch. Refresh. Verify it shows now.

Signed-off-by: Richard Bridgen <richard.bridgen@nhs.net>
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-02-06 15:17:08 -07:00
Baptiste Wojtkowski ba0b968a5a
Bug 39721: Changes suggestion_ref in order to remove it
suggestion_ref is quite messy, it needs to be reworked in order to use
objects in suggestion.pl.

As far as I studied, it is used as
- the whole input from forms,
- the default content to input in a form
- the content that will be amended in order to propose another hash to
  modSuggestion. However, ModSuggestion will be removed so we don't need
  such a hash
- every suggestion that need to be updated using the "change selected
  suggestion" tool
- create the object suggestion_only, whose purpose is still unclear to
  me.

As a result it is created by :
> 25 my $suggestion_ref = { $input->Vars };
And by removing a number of keys depending on the use of suggestion_ref
in the script.

In this patch, we remove every code made to use suggestion_ref as the
source object for form and use another variable, $stored_suggestion which is an object.

In next patch we aim at fully removing $suggestion_ref, which is still
used by ModSuggestion

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-02-06 15:17:06 -07:00
Laura_Escamilla 99e1ae7aa2
Bug 33544: (QA follow-up) fixed misspelled attribute
Signed-off-by: Laura_Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-02-06 15:17:05 -07:00
Martin Renvoize 9954466c10
Bug 33544: Move biblio ID into title link
This patch removes the separate biblio_id column and instead embeds
the biblio link directly within the title field of the details column,
reducing table width while maintaining access to the full record.

Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Laura_Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-02-06 15:17:04 -07:00
Martin Renvoize 9a3a9515bb
Bug 33544: Combine title details into single column
This patch consolidates the separate title details fields (title,
author, year, etc.) into a single combined column in the ILL requests
table for improved display and reduced horizontal scrolling.

Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Laura_Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-02-06 15:17:03 -07:00
Owen Leonard 290db21792
Bug 41350: Terminology: Biblio was already issued
This patch updates the string found in action logs, "Biblio was already
issued" replacing it with "An item from this bibliographic record is
already checked out."

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

- Set the AllowMultipleIssuesOnABiblio preference to "Don't allow."
- Locate a bibliographic record with more than one available item.
- Check out one of the items to a patron, then another.
- You should be asked for confirmation, "Patron has already checked out
  another item from this record. Check out anyway?"
  - Confirm the checkout.
- Go to Tools -> Log viewer and set both "Display from" and "Display to"
  set to today, and submit.
  - In the log you should see an entry containing the updated string:
    "An item from this bibliographic record is already checked out"

Sponsored-by: Athens County Public Libraries
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Laura_Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-02-06 15:17:03 -07:00
Owen Leonard b1c004c064
Bug 41677: Use template wrapper for tabs: OAI repositories
This patch updates the OAI repositories search include to use WRAPPERs
for the Bootstrap tabs markup.

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

- The search form in the header should have three options: Search OAI
  repositories, Check out, and Search catalog.
- Each tab should activate correctly, and each search form should should
  work as expected.*
  * Note that the OAI repositories form searches by repository name
    using a "Starts with" search.

Sponsored-by: Athens County Public Libraries
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Laura_Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-02-06 15:17:02 -07:00
Pedro Amorim ab14eb2bca
Bug 41214: (QA follow-up): Tidy fix
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-02-06 15:17:01 -07:00
Matt Blenkinsop 76d7a0bc72
Bug 41214: Apply the same logic to table columns
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-02-06 15:17:01 -07:00
Matt Blenkinsop 4c316e25cd
Bug 41214: Convert hideIn to a callback to allow total removal of fields via syspref
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-02-06 15:17:00 -07:00
Pedro Amorim 4544e70b37
Bug 41214: Only show cash register if UseCashRegisters sys pref is enabled
Test plan:
1) Add a new account:
http://localhost:8081/cgi-bin/koha/sip2/accounts/add
2) Notice the 'cash register' field does not show
3) Enable UseCashRegisters sys pref
4) Repeat 1 (or edit an existing account). Refresh the page.
5) Notice the 'cash register' field now shows

Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-02-06 15:16:51 -07:00
Lucas Gass 2aaf585013
Revert "Bug 41173: Fix ERM breadcrumb causing page reload"
This reverts commit 7a614e4c67.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-02-06 09:58:58 -07:00
Lucas Gass 928abfcdc2
Bug 39916: (RM follow-up) Tidy
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-02-06 07:21:02 -07:00
Paul Derscheid 37c8b7544e
Bug 39916: (QA follow-up) Fix startRange class lost on month navigation
When selecting a booking start date that triggers month navigation
(e.g., selecting Feb 1 while viewing January), the flatpickr calendar
would lose the 'startRange' CSS class on the selected date. This
occurred because setting maxDate in the onChange handler triggered a
calendar redraw, and flatpickr only applies startRange during the
initial click event, not during redraws.

This caused the Cypress test "should handle date range validation
correctly" to fail on dates near month boundaries (e.g., January 30).

The fix re-applies the startRange class after the maxDate is set,
using setTimeout to ensure it runs after the redraw completes. A
guard ensures this only happens when exactly one date is selected,
preventing interference with end date selection.

To test:
- Apply patch
- Open a biblio detail page with bookable items
- Click "Place booking"
- Select a patron, pickup location, and item
- In the date picker, click a date that's in the next month
  (visible in the "next month" area of the calendar)
- Verify the selected date shows the startRange styling (highlighted
  as the range start)
- Select an end date
- Verify the range is properly selected and the form can be submitted
- Run Cypress tests:
  yarn cypress run --spec t/cypress/integration/Circulation/bookingsModalDatePicker_spec.ts
- Verify all tests pass

Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-02-06 07:21:01 -07:00
Pedro Amorim f06c5fc5e6
Bug 39971: (QA follow-up): Tidy fix
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-01-30 10:54:26 -07:00
Pedro Amorim b57ff25c9a
Bug 39971: Move form rendering to reusable tt block
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-01-30 10:54:23 -07:00
Lucas Gass 2df89cf721
Bug 30331: Update system preference descriptions
Signed-off-by: Trevor Diamond <trevor.diamond@mainlib.org>
Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-01-30 10:54:22 -07:00
Lucas Gass 15d83804b3
Bug 30331: Rename RenewalPeriodBase as ManualRenewalPeriodBase and add AutomaticRenewalPeriodBase sys pref
Signed-off-by: Trevor Diamond <trevor.diamond@mainlib.org>
Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-01-30 10:54:20 -07:00
Martin Renvoize e58d39671f
Bug 39584: Fix end date disable to check selected item, not all items
When a specific item is selected in the booking modal, the end date
disable logic was incorrectly checking if ALL bookable items were
unavailable before disabling a date. This meant dates with existing
bookings for the selected item remained selectable if other items
were available.

Now when a specific item is selected (booking_item_id != 0), the
logic checks if that specific item is in the unavailable_items list.
The "all items unavailable" check is only used when "Any item" is
selected.

This aligns the end date selection behavior with the start date
selection behavior, which already correctly checks only the selected
item.

Signed-off-by: Kristi Krueger <kkrueger@cuyahogalibrary.org>
Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-01-30 10:54:20 -07:00
Martin Renvoize 22c8829738
Bug 39584: Fix trail period incorrectly limiting max booking date
This commit fixes a bug where the trail period was preventing selection
of the maximum end date allowed by circulation rules, even when there
were no booking conflicts in the trail period.

The Problem:
============
The hover logic in place_booking.js checked if ANY disabled date fell
within the trail period and would prevent selection. However, dates can
be disabled for multiple reasons:
1. They conflict with an existing booking (correct reason to disable)
2. They are beyond the maxDate set by circulation rules (incorrect!)
3. They are in the past

When hovering over the max selectable end date, the trail period would
extend beyond the maxDate. Those dates were disabled by flatpickr
automatically, and the code incorrectly interpreted this as a booking
conflict, preventing selection of the otherwise valid max date.

The Fix:
========
Modified the trail period conflict check (lines 995-1005) to only
consider dates that are within the max date range. Disabled dates
beyond the maxDate are now ignored when checking for trail conflicts.

Before:
  if (elemDate.isAfter(trailStart) && elemDate.isSameOrBefore(trailEnd)) {
      trailDisable = true;
  }

After:
  if (elemDate.isAfter(trailStart) && elemDate.isSameOrBefore(trailEnd)) {
      const maxDate = periodPicker.config.maxDate ? dayjs(periodPicker.config.maxDate) : null;
      if (!maxDate || elemDate.isSameOrBefore(maxDate)) {
          trailDisable = true;
      }
  }

This ensures trail periods only prevent selection when they conflict
with actual bookings, not when they extend beyond the circulation
rules' maximum date.

Signed-off-by: Kristi Krueger <kkrueger@cuyahogalibrary.org>
Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-01-30 10:54:19 -07:00
Andrew Fuerste Henry 433b5e0f3f
Bug 40364: Correct wording in user permissions
Changes the descriptions of the holds history and checkout history permissions to say "view" rather than "viewing"

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-01-30 10:54:17 -07:00
Andrew Fuerste Henry 6e1065e840
Bug 40364: Implement holds history permission
To test:
1 - enable IntranetReadingHistoryHolds system preference
2 - make some holds for a patron, confirm you can see Holds History in the patron record when logged in as a superlibrarian
3 - log in as a non-superlibrarian with edit_borrowers permission, confirm you can see holds history in pthe patron record
4 - apply patch, updatedatabase, restat_all
5 - confirm you can see holds history as a superlibrarian
6 - confirm your non-superlibrarian from step 3 was given view_holds_history permission and can view holds history
7 - remove view_holds_history permission from your user, confirm you can no longer access holds history

Signed-off-by: Trevor Diamond <trevor.diamond@mainlib.org>
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-01-30 10:54:15 -07:00
David Flater 3a2f84f0cd
Bug 32682: Implement reading history permission
To test:
1. Create or modify a staff user with edit_borrowers permssion enabled ( Staff A )
2. Create or modify a staff user without edit_borrowers permssion enabled ( Staff B )
3. Ensure the "intranetreadinghistory" syspref is enabled
4. Check out an assortment of items to any patron
5. Apply patch, update_database, then restart_all
6. Check the permissions of the staff user A and ensure that they have been automatically assigned the new "view_checkout_history" permission
7. Check the permissions of the staff user B and ensure that they have NOT been automatically assigned the new "view_checkout_history" permission
8. View the same patron and ensure you can still see their checkout history as Staff A and as a superlibrarain
9. Disable the "intranetreadinghistory" syspref and remove the "view_checkout_history" permission of the staff user

Signed-off-by: Trevor Diamond <trevor.diamond@mainlib.org>
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-01-30 10:54:12 -07:00
Jonathan Druart e7325583f3
Bug 39438: (bug 38446 follow-up) Add agreement_period to /erm/extended_attribute_types
Sponsored-by: Karlsruhe Institute of Technology (KIT)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-01-30 10:54:11 -07:00
Matt Blenkinsop 080fccc0c5
Bug 39438: Add additional fields support to ERM agreement periods
This patch enables additional fields functionality for agreement periods
in the ERM (Electronic Resource Management) module, allowing libraries
to define custom metadata fields for agreement period records.

Changes include:
- Update Koha::AdditionalField to support erm_agreement_periods table
- Modify API definitions to include extended_attributes in responses
- Add erm_agreement_periods option to additional fields admin interface
- Enhance Vue components to display and manage additional field values
- Update ShowElement component to handle period-specific attributes

Test plan:
1. Navigate to Administration > Additional fields
2. Create new fields for "Agreement periods"
3. Edit an ERM agreement and add/edit period information
4. Verify additional fields appear and can be populated
5. Confirm values are saved and displayed correctly

Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-01-30 10:54:10 -07:00
Lari Taskula bee9d8da78
Bug 40933: Add the ability to send custom SMS messages to a patron
To test:
1. Make sure SMSSendDriver system preference is enabled
2. In staff client, navigate to patron details of any patron
3. From the members menu toolbar, click "Add Message"
4. Under "Add a message for", select "SMS - sms number of patron"
5. Write a custom message
6. Click "Save"
7. Navigate to patron's Notices tab
8. Observe a new notice titled "SMS added by a librarian"
9. Click it
10. Observe the content you wrote in step 5
11. Repeat steps 2-4
12. Select predefined patron notice. If you don't have one,
navigate to Tools > Notices and slips > New notice > Patrons (custom message)
and add content under sms delivery option
13. Repeat steps 6-7
14. Observe your custom message in the notices table
15. Observe your custom message content when you click the notice

Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>

Signed-off-by: Charlie Arthur <carthur@slolibrary.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-01-30 10:54:10 -07:00
Owen Leonard 4ddbf50529
Bug 40060: Update structure of popup windows in the OPAC
This patch updates templates for OPAC popup windows to add a
fixed "navbar" element at the top of the window with the main heading at
an "X" button which closes the window.

To test, apply the patch and rebuild the OPAC CSS. On each page, test
that the pop-up window looks correct. Confirm that the "X" in the upper
right works to close the window.

- Clear your browser cache if necessary.
- Make sure the opacbookbag, virtualshelves, and OPACComments system
  preferences are enabled.
- Log in to the OPAC and perform a catalog search which will return
  multiple results.
- Select multiple results and choose Add to list -> New list.
  - Test Add to list -> More lists
  - Test Add to list -> (existing list)
- View the contents of a list.
  - Click "Send list" and test the process of sending a list.
- Return to your catalog search results and add multiple items to the
  cart.
  - View the cart
  - Test the "Send" option
- With the OPACComments system preferenc enabled, view the detail page
  for a bibliographic record.
  - Under the comments tab, click "Post your comments..."

Sponsored-by: Athens County Public Libraries
Signed-off-by: Ludovic Julien <ludovic.julien@inLibro.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-01-30 10:54:09 -07:00
Nick Clemens 83e553dd9e
Bug 40905: (QA follow-up) Apply same fix for exceptions table
This table also has a show past holidays button, we need the same fix

To test:
1 - Spam holidays into both tables
    You can run the SQL commands below a few times each
INSERT INTO special_holidays (branchcode, day, month, year,isexception, title,description) VALUES ('CPL',FLOOR(RAND() * 28) + 1,FLOOR(RAND() * 12) + 1,FLOOR(RAND() * 6) + 2020,0,LEFT(UUID(),8),UUID());

INSERT INTO special_holidays (branchcode, day, month, year,isexception, title,description) VALUES ('CPL',FLOOR(RAND() * 28) + 1,FLOOR(RAND() * 12) + 1,FLOOR(RAND() * 6) + 2020,1,LEFT(UUID(),8),UUID());

2 - Go to Tools->Calendar
3 - Click 'Show past holidays' for exceptions and unique holidays
4 - Confirm checking and unchecking work on both tables

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-01-30 10:54:09 -07:00
Slava Shishkin 27b89b20b8
Bug 40905: Fix "Show past entries" checkbox in unique holidays
Test plan:
1. Go to Tools → Calendar.
2. Select a branch with past unique holidays.
   If you don't have past closed days: Create a new holiday in a past
   month or so.
3. In the Unique holidays section, enable "Show past entries".
4. Past entries are not displayed.
5. Apply patch:
6. Repeat the steps above.
7. Past entries are displayed immediately.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-01-30 10:54:08 -07:00
Martin Renvoize b322e3e959
Bug 40769: Display hold fees in staff client when placing holds
This patch adds hold fee information display in the staff client's hold
request interface, bringing it to feature parity with the OPAC.

The OPAC already shows patrons the fee that will be charged for placing
a hold, but the staff client did not display this information when staff
place holds on behalf of patrons. This creates a transparency gap where
staff cannot inform patrons about potential charges.

Changes:
- Import GetReserveFee function in reserve/request.pl
- Calculate reserve charges for each biblio record
- Display fee information in both single and multi-hold interfaces
- Show appropriate messaging based on HoldFeeMode system preference
- Use consistent formatting with currency display

Test Plan:
1. Set up hold fees:
   - Go to Administration > Patron categories
   - Edit a patron category and set a "Hold fee" (e.g., 1.00)
   - Ensure HoldFeeMode system preference is set (default: "only if all
     items are checked out and the record has at least one")

2. Test single hold with fee display:
   - Go to a bibliographic record
   - Click "Place hold"
   - Find a patron from the category with hold fees configured
   - Verify fee information displays after the title:
     * Shows "Note: [Patron Name] will be charged a hold fee of $1.00
       for placing this hold" when the HoldFeeMode is set to "any time
       a hold is placed"
     * Or "...when they collect this item" if HoldFeeMode is set to "any
       time a hold is collected"

3. Test multi-hold with fee display:
   - Ensure 'DisplayMultiPlaceHold' preference is set to 'Enable'
   - Search the catalog
   - On the search results page, select multiple biblios and click
     'Place hold'
   - Search for the same patron
   - In the confirmation table, verify each record shows:
     * "Hold fee: $1.00 (charged when placed)" in the Information column
     * Or "(charged when collected)" based on HoldFeeMode

4. Test no fee display:
   - Repeat tests with a patron from a category with no hold fee
   - Verify no fee information is displayed

5. Test different HoldFeeMode settings:
   - Change HoldFeeMode system preference to 'any_time_is_collected'
   - Verify messaging changes to "when they collect this item"
   - Test with 'not_always' mode and verify fee only shows when appropriate

6. Verify existing functionality:
   - Ensure hold placement still works normally
   - Verify all other hold interface elements remain unchanged
   - Test that holds are properly placed with or without fees

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-01-30 10:54:08 -07:00
Pedro Amorim fd87ee6edf
Bug 41512: (OPAC) Additional fix
This is needed or else the OPAC still throws the 'malformed query string' mentioned on the original test plan.
This is because the fix from bug 40865 was only applied to intra datatables.js not the OPAC datatables.

I don't know why this fixes it for the OPAC, but it does.

Joubu, thoughts?

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-01-30 10:54:07 -07:00
Pedro Amorim 20d20ba9a9
Bug 41512: Fix ILLCheckAvailability
1) Install the unpaywall plugin:
  https://github.com/openfifth/koha-plugin-ill-avail-unpaywall/releases/tag/1.0.2
2) Configure an email address on the plugin configuration (I believe any email address should work):
<staff_url>/cgi-bin/koha/plugins/run.pl?class=Koha%3A%3APlugin%3A%3ACom%3A%3APTFSEurope%3A%3AAvailabilityUnpaywall&method=configure
3) Enable ILLModule and ILLCheckAvailability sys prefs
4) Create a new ILL request, visit:
  <staff_url>/cgi-bin/koha/ill/ill-requests.pl?method=create&backend=Standard
5) Pick type: journal article and enter the DOI: 10.1002/bjs.1800621024
6) Enter a cardnumber e.g. '42' for koha user and any library.
7) Notice the availability screen never renders, a console error is logged on the browser.
8) Apply patch. Refresh. Repeat.

This appears to have stopped working after bug 26553. Using git bisect, after bug 26553 (cc09868152), this started returning a 'bad request: malformed query string' because query params were being sent to the plugin API route (which doesn't consider them). Bug 40865 then fixed the bad request error, but resulted in the console error we see now, which is fixed by this patch.
ajax.dataSrc appears to now be returning an additional level of 'data' due to datatables upgrade (?), this patch changes the dataSrc override to be more in line with the example doc at https://datatables.net/reference/option/ajax.dataSrc

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-01-30 10:54:07 -07:00