Commit Graph

27407 Commits

Author SHA1 Message Date
Pedro Amorim 5ca53cf2bc
Bug 34632: Add patron_import background job display template
patron_import.inc provides the report/detail/js blocks consumed by the
background job viewer: a summary of counts when finished, a live progress
bar while running, and the full feedback and error analysis in the detail
section. background_jobs.tt gains a patron_import entry in the job type
filter dropdown.

Test plan:
1) Apply patches, restart plack.
2) Navigate to the patron import tool:
  <staff_url>/cgi-bin/koha/tools/import_borrowers.pl
3) Upload the provided sample CSV file and click 'Import patrons'.
4) Confirm the page shows "The patron import job has been enqueued!" with a link to view the job.
5) Follow the link to the background job. Confirm a progress bar is shown while the job is running.
6) Once finished, confirm the report shows the correct counts (imported, overwritten, already_in_db, invalid, total).
7) Confirm the imported patrons exist under 'Patrons'.
8) Re-import the same file with 'Overwrite cardnumber' unchecked. Confirm 'already_in_db' count is 5.
9) Re-import again with 'Overwrite cardnumber' checked. Confirm 'overwritten' count is 5.
10) Visit the background jobs admin and filter by type 'Import patrons':
  <staff_url>/cgi-bin/koha/admin/background_jobs.pl
11) Confirm the jobs appear in the list.
12) Run the tests:
  prove t/db_dependent/Koha/BackgroundJob/PatronImport.t

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-09-11 16:06:04 +00:00
Pedro Amorim 88644d26af
Bug 34632: Use PatronImport background job in import_borrowers
import_borrowers.pl now reads the uploaded file into memory and calls
Koha::BackgroundJob::PatronImport->enqueue() instead of running the import
synchronously. On success the template shows a confirmation with a link to
the background job viewer; on failure it shows an error alert.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-09-11 16:06:03 +00:00
Laura_Escamilla 5d75b6fdad
Bug 39420: (QA follow-up) Replace tabs with spaces
Signed-off-by: Laura_Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-09-11 16:05:55 +00:00
Samuel Sowanick 97235dea0d
Bug 39420: adjusted additem.tt breadcrumb to lead back to item
Bug 39420: removed old breadcrumb - Update additem.tt

Bug 39420: Removed old edit breadcrumb.

Bug 39420: Fixing syntax error in END tag

Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-09-11 16:05:52 +00:00
Jonathan Druart 693c447736
Bug 41995: Show all entries
Signed-off-by: Michaela <michaela.sieber@kit.edu>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-09-11 15:07:05 +00:00
David Nind 7d52823ac5
Bug 43432: Move ReportsExportLimit to reports category
Move the ReportsExportLimit system preference from the
staff interface category to the reports category, as
it relates only to the reports module.

1. Go to Administration > System preferences.
2. Search for the ReportsExportLimit system preference.
3. Note that it is in the Staff interface > Options category.
4. Apply the patch.
5. Repeat step 2.
6. Note that it is now in the Reports > Options category.
7. Note that the "Reports access" section is now in sentence case.

Signed-off-by: Bastien CHAUVET <bastien.chauvet@inlibro.com>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-09-11 15:07:01 +00:00
David Nind 87e8f605bb
Bug 43432: Update ReportsExportLimit system preference description
The current description uses "records". It actually controls the
number of rows (or results) exported, which may or may not be records.

Additional updates were also made to improve the description notes.

1. Go to Administration > System preferences.
2. Search for the ReportsExportLimit system preference.
3. Note the use of "records" in the description - results returned may or
   may not necessarily be records.
4. Apply the patch.
5. Refresh the page.
6. Note the updated description:
   - "records" changed to "rows"
   - changes to the notes:
     . NOTE changed to bold, consistent with other descriptions
     . now uses an unordered list
     . active voice used
     . removed note about requiring a positive vale
     . added a note about the "Open in DataTables" option
7. Sign off 8-).

Current description:
Download a maximum of _____ records when downloading from the
reports module.
NOTE: Only a positive value will enforce a limit. A specific
limit in the report overrides this setting.

Updated description:
Download a maximum of _____ rows when exporting report results.
NOTE:
- Using LIMIT in a report overrides this setting.
- It does not limit results when using 'Open in DataTables'
  export options.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-09-11 15:07:00 +00:00
Owen Leonard f8ef545ca4
Bug 38638: Offer non-priority option when placing multiple holds
This patch adds a checkbox for setting holds as non-priority when
placing multiple holds at once.

To test, apply the patch and make sure the DisplayMultiPlaceHold system
preference is enabed.

- Perform a catalog search in the staff client which will return
  multiple results.
- Check the checkboxes for 2 or more titles in the results and click
  "Place hold" in the toolbar.
- When confirming the holds, check the "Non priority hold" checkbox.
- Confirm that the holds are saved as non priority holds.
  - You can check by viewing the list of holds on a title. The "Details"
    column for that hold should say "Non priority hold."

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: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-09-11 15:06:56 +00:00
David Nind b8d1993582
Bug 43225: Fix punctuation for renewal confirmation message
A renewal confirmation message (when the AllowFineOverrideRenewing
system preference is set to "Allow") is missing a period and space
between the amount due and the second sentence.

It currently reads:
"The patron has a debt of [amount]Are you sure you want to renew checkout(s)?"

Test plan:
1. Set the AllowFineOverrideRenewing system preference to "Allow".
2. Check out an item to a patron (for example, 39999000011418 to Mary Burton).
3. Add a $110 manual charge to the patron's account:
   - [Patron account] > Accounting > Create manual invoice
   - Should now have a message on the patron's page:
     Charges: Patron has outstanding charges of 110.00. Make payment Pay all charges
4. Attempt to renew the checked out item from the checkouts section:
   - Check out > Checkouts > Show checkouts
   - Below the checkouts table, select "Override fine restrictions"
   - Click "Renew all"
5. There is a pop-up message with incorrect punctuation:
     The patron has a debt of 110.00Are you sure you want to renew checkout(s)?
6. Click the cancel option.
7. Repeat steps 4 to 6 from the details section (Details > Checkouts >
   Show checkouts) and note the same incorrect punctuation.
8. Apply the patch.
9. Repeat steps 4 to 7.
10. The pop-up message now reads:
      The patron has a debt of 110.00. Are you sure you want to renew checkout(s)?
11. Sign off.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Laura_Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-09-11 15:06:55 +00:00
Jan Kissig 374295c25c
Bug 42296: auto tidy for follow-ups
Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-09-10 14:25:43 +00:00
Jan Kissig 0602877c31
Bug 42296: (follow-up) Remove unused base_url on barcode-print
The JS variable base_url on barcode-print is never referenced. The remaining JS block did not contain TT interpolation, so data-tt-allowed can be removed.

Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-09-10 14:25:41 +00:00
Jan Kissig 667c8883e6
Bug 42296: (follow-up) Split JS block in auth.tt
Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-09-10 14:25:40 +00:00
Jonathan Druart 4a4843e481
Bug 42296: Tidy all script tags - trivial occurrences
In order to tidy all the script tags of the .tt files we isolate the
interpolation of Template::Toolkit variables in a separate script tag.

This patch only adds 'data-tt-allowed="true"' when needed. The work to
move the JS variable to a separate script tag has been done already on
bug 41324.

Signed-off-by: Jan Kissig <bibliothek@th-wildau.de>
Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-09-10 14:25:38 +00:00
Katrin Fischer 5ae82ddd18
Bug 41318: (QA follow-up) Change Options to Examples in system preference description
While 'Options' might give the impression that the selection is
limited to the listed values, 'Examples' seems the better wording.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-09-10 14:25:35 +00:00
Jonathan Druart 18134d8343
Bug 41318: Rename AmazonLocale to AmazonLocaleTld
To be more flexible we could allow the top-level domain instead of
having a predefined list.
However this patch still list the different available options (and adds
Brazilian) for easy selection.

Note that this system preference is not used to retrieve the image but
only to link to from the image. Contrary to what the reporter of the bug
report thought. And actually what I thought as well until I finished to
write the patch and started testing it!
Anyway now the patch is written, there should not be any changes in
behaviour. Most of the time the links are actually broken when not using
.com. So I think we either broke the whole feature at some point, or it
never really worked. On a separate bug we could eventually have a look
at fetching from the locale tld.

Test plan:
Turn on OPACAmazonCoverImages and AmazonCoverImages
http://localhost:8081/cgi-bin/koha/catalogue/detail.pl?biblionumber=5
http://localhost:8080/cgi-bin/koha/opac-detail.pl?biblionumber=5
=> You see the PBP cover
click on it, it opens the lightbox, click "(see the original image)" at
the bottom
=> This is where the syspref AmazonLocale/AmazonLocaleTld acts

Modify the syspref's value and confirm that the link is modified and
point to the correct domain (leading to 404 or broken pages most of the time,
at least in my tests).

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-09-10 14:25:34 +00:00
Jonathan Druart 9d0f7d2f3c
Bug 42344: Remove CircSidebar
Test plan:
Run the updatedatabase script and notice that the sidebar is visible in
the circulation module but that you can hide/collapse it on demand.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-09-10 14:25:31 +00:00
Chloé Zermatten 99442e36b3
Bug 10190: (QA follow-up): fix: prevent delay-less rule sets
Since the decision was made that the add / edit trigger form should
never let a trigger be created or edited to not have a delay, it
follows that this must apply to the rule set reset flow as well.

Retain the warning message to the user, and also disable the
'Confirm reset' button if the reset would result in delay-less
sets.

The same applies to the trigger deletion functionality: if deleting
a trigger that is a default for all libraries would then leave any
libraries with one or more delay-less rule set, block the trigger
deletion (deactivate 'Confirm deletion') and inform the user. Here
as well we also still display the warning message.

Test plan:

A) Create one or more 'Default for all libraries' triggers.
B) Create one or more library-specific triggers.
C) For one or more of these, add itemtype and/or category specific overrides with not delay override.
D) For one or more of these, add itemtype and/or category specific overrides with a delay override.
E) Select 'Reset' on a rule set with overrides of type D) and notice that the 'Confirm reset' button is enabled.
F) Select 'Reset' on a rule set with overrides of type C) and notice that the 'Confirm reset' button is disabled,
    and that the warning message explains why reset is unavailable
G) Select 'Delete' on the highest 'Default for all libraries' trigger, and notice that, where one or more library-specific overrides are of type D), 'Confirm deletion' is disabled, whereas it is otherwise enabled.
H) Delete a trigger for which no override exists and confirm success.
I) Delete a trigger for which only type D) overrides exist and confirm success.
J) Reset a rule set for which only type D) overrides exist and confirm success.
K) Reset a rule set for which no override exists and confirm success.

Assisted-by: Claude Opus 5 (Anthropic)
Sponsored-by: Glasgow Colleges Library Group <https://library.cityofglasgowcollege.ac.uk>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-09-10 14:25:28 +00:00
Chloé Zermatten b38d6d5201
Bug 10190: (QA follow-up): fix: keyboard delay delete behaviour
If the 'Delay' input field value is deleted using backspace or other,
block form submission. The same behaviour apply if the delete button
is used, as both clear out the value.

As triggers with no delay are not processed and would also cause
higher triggers to then also not be processed, we do not allow the
creation of triggers without a set delay.

Triggers when edited individually do not check for impact on any overrides
they might have. It is therefore safest not to allow submission of a trigger
where the user explicitly unset the value.

An explicit 'reset to fallback' feature is possible and would constitute a follow up enhancement.

Test plan (based on comment 872):

A) 'Administration' > 'Circulation triggers' > 'Add new trigger' for any library/category. Set a Delay, a Notice, and a transport type.
B) Select the Delay field's value and clear it via the 'X' clear button.
C) Notice 'Submit' is disabled.
D) Select the Delay field's value and clear it via the keyboard (Backspace/Delete). Click 'Submit'.
E) Notice 'Submit' is disabled.

Assisted-by: Claude Opus 5 (Anthropic)
Sponsored-by: Glasgow Colleges Library Group <https://library.cityofglasgowcollege.ac.uk>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-09-10 14:25:27 +00:00
Chloé Zermatten ec22f77b76
Bug 10190: (QA follow-up): fix: permissions
Important note: the following assumes manage_circ_triggers is intended
as a sibling to manage_circ_rules, and that of the two, only
manage_circ_triggers ought to grant access to client-side circulation
trigger configuration actions.

When manage_circ_triggers was introduced, it was not applied client-side,
resulting in the router and menu permission checks incorrectly expecting
manage_circ_rules. Amend that.

Additionally, while the API endpoint blocked a user with only
manage_circ_triggers from editing non-triggers circulation rules,
it did not block a user with only manage_circ_rules from editing
trigger circulation rules. Add a guard clause.

Test plan (based on comment 872):
A) Go to a patron's 'More' > 'Set permissions' tab. Check 'catalogue' (needed for basic staff login), and under circulation-rules sub-permissions, check only 'Manage overdue notice triggers' - leave 'Manage circulation rules' unchecked.
B) Log in as that patron, go to 'Administration' - 'Circulation triggers' link present (admin-home.tt now correctly checks CAN_user_parameters_manage_circ_triggers), 'Circulation and fine rules' is not present.
C) Visit http://localhost:8081/cgi-bin/koha/admin/circulation_triggers directly - you are granted access.
D) Confirm that you can create and edit circulation triggers.
E) Go to a patron's 'More' > 'Set permissions' tab. Check 'catalogue' (needed for basic staff login), and under circulation-rules sub-permissions, check only 'Manage circulation rules' - leave 'Manage overdue notice triggers' unchecked.
F) Log in as that patron, go to 'Administration' - no 'Circulation triggers' link present (as we require manage_circ_triggers), however 'Circulation and fine rules' is present.
G) Visit http://localhost:8081/cgi-bin/koha/admin/circulation_triggers directly - you see "Error: You do not have permission to access this page" and are prompted to log in as a different user (as we require manage_circ_triggers).
H) Go to http://localhost:8081/cgi-bin/koha/admin/smart-rules.pl, and confirm that you can edit circulation rules for your library (no regression).

Assisted-by: Claude Opus 5 (Anthropic)
Sponsored-by: Glasgow Colleges Library Group <https://library.cityofglasgowcollege.ac.uk>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-09-10 14:25:25 +00:00
Nick Clemens 14e7814c15
Bug 10190: (QA follow-up) Fix spelling for QA tools
Other complaints are invalid:
ContextA spelling - this is a variable
Use of _("") - this is in regex for 'overdue_(' when checking rules
git manipulation - not ideal adding and removing in same set, but this is a long
   work, not asking for a squash here

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-09-10 14:25:23 +00:00
Chloé Zermatten 2e3f9bd1ce
Bug 10190: (QA follow-up): fixes phase four
- Display new manage_circ_triggers permission (add to template)
- Ensure loading messages are informative to the user

Sponsored-by: Glasgow Colleges Library Group <https://library.cityofglasgowcollege.ac.uk>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-09-10 14:25:20 +00:00
Chloe Zermatten d6f596c514
Bug 10190: (QA follow-up) UI/UX improvements and fixes - phase three
Trigger deletion and rule set reset
- warn the user that resetting or deleting a given set will break sets using it as fallback.
- indicate which sets will be affected.
- display a preview of the post reset state of each affected rule set.
- preparation: allow TriggerTable to take a title parameter.
- refactor to remove 'has_rules' from the store's rule suffixes list so those match the DB.
- DRY: refactor to implement TriggerTable rather than use custom templates.
- select context stage handles narrower viewports
- prevent crash on missing rule set

TriggersTable: refactor: the <a> elements used as buttons are now button elements
- this is so they may be marked as disabled.

Main page - trigger actions (delete button display)
- disable the trigger deletion button.
  - if the context has been narrowed down ('delete' deletes all explicit rule set per trigger per library).
  - if the trigger belongs to default library AND one or more libraries have a trigger of a number bigger than the selected one.
  This is to protect trigger sequentiality from being broken for the relevant libraries.
  We also include an on hover message to explain the disabled button.

Add/ Edit trigger form
- clarify letters 'undo' button behaviour:
- swap the native vue select X for a fa-undo icon.
- display 'undo override and reset to fallback' on hover.
- only display the add/edit button at the selectOrAdd step.
- restore selected trigger yellow highlight (regression fix).
- display any temporarily saved data from prior step in a green 'success' container.
- only messages and data pulled from the DB for informative purposes display in blue containers.

Other
- redirect to correct URL (admin home) if store load fails
- mtt fallbacks display as such consistently (bold italics) - is a bugfix.
- catch errors on store initialisation
- remove whitespace duplicate
- ensure that mtt, if set, always display

Assisted-by: Claude Opus 4.7 (Anthropic)

AI used to help trace back potential bug sources, flag potential regressions, and draft enhancements. Changes were reviewed, tweaked, and commited manually and gradually (with a pre-submission commit squash).

Sponsored-by: Glasgow Colleges Library Group <https://library.cityofglasgowcollege.ac.uk>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-09-10 14:25:18 +00:00
Chloe Zermatten 37a9684669
Bug 10190: (QA follow-up): UI/UX bug fixes - phase two
Fix: handle exiting modal
 - prevent data reload when the user exits the modal
 - as preparation for the above: refactor to use one handler only
Fix: new trigger saves with delay defined
 - Identified an old refactor omission - we were still passing 'i' despite the from now relying on this.triggerNumber
Fix: return to correct trigger tab after save or reset
Fix: restore delete button and bold italic info
 - restore display, fixes a regression introduced by the previous UI/UX patch set
Fix: order dropdown options by description or name (not code)
Fix: circ rule resets
 - restore reset funtionality
  (mtt was still occasionally passed as a string, and would then get compared to an array. Ensure this is not the case.)
 - do not trigger the data refresh if the current ruleset did not get deleted
 - make sure triggerNumber is defined when navigation is caused by reset
 - add the notice code in brackets to letter names for display (eg. Overdue notice (ODUE))

Assisted-by: Claude Opus 4.6 (Anthropic)

AI used to help trace back potential bug sources and draft fixes. Changes were reviewed, tweaked, and commited manually and gradually (with a pre-submission commit squash)

Sponsored-by: Glasgow Colleges Library Group <https://library.cityofglasgowcollege.ac.uk>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-09-10 14:25:15 +00:00
Chloe Zermatten 0fa640b387
Bug 10190: (QA follow-up) UI/UX improvements and fixes
- Refactor (prepation): Extract form sub-components for better maintainability
  - Template stucture improvements (eg. consistent fieldset use)
  - Ensure triggerNumber is always cast to integer from query params
  - Add/Edit trigger form UI/UX improvements/fixes:
      - Restore add/edit button functionality on trigger tables in the form
      - Update Context section title to dynamically change depending on whether editing or displaying
      - Display trigger context as informational when not in confirmContext mode
      - Hide required labels and validation on view-only context fields
      - Always display trigger context at the top of the form
      - Add renewal/autorenewal summary (renewals allowed, automatic renewal) to circulation rules summary panel
      - Sort notice letter dropdowns by name rather than code
      - Update Circulation rules summary title to be more descriptive
  - Scroll behaviour improvements:
      - Extract scrollToElementById to store with polling and null guard
      - Block page scroll when modal is open
      - Disambiguate duplicate trigger-table element ids (trigger-table-main
        vs trigger-table-form) to fix unpredictable scroll-to behaviour

Assisted-by: Claude Sonnet 4.6 (Anthropic)

Experimenting a little here - not quite certain where we draw the line for substantial use so I thought I would add a description in case it's useful, especially since the AI code guidelines are quite fresh:

AI was used primarily to help parse longer Vue templates (CirculationTriggersFormAdd.vue) and help isolate elements for extractions as well as highlight template formatting inconsistencies and propose improvements. The refactoring itself was achieved starting from AI-proposed changes which were then thoroughly re-worked manually towards the code changes submitted.
I also trialled using it (currently experimenting with this) for minor coding tasks where there is a clear precedent (for example, to add renewal/autorenewal information and do so in a way that follows exactly what we had written).
In those cases, each code change made by AI was the outcome of multiple iterations with direct feedback (which it did require a fair amount of) from me to ensure the output matched what I would have written myself.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-09-10 14:25:14 +00:00
Chloe Zermatten 8f6ff0a73d
Bug 10190: (follow-up): feat: indicate mtt is required
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-09-10 14:25:13 +00:00
Chloe Zermatten 6dcfe9f878
Bug 10190: (follow-up): fix: handle fallbacks in edit/add
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-09-10 14:25:12 +00:00
Chloe Zermatten b12d701494
Bug 10190: (follow-up): fix: reset rule info message
The information message showing in the reset modal
still referred to an earlier version of the UI.
Update it to correctly name the relevant filter.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-09-10 14:25:11 +00:00
Chloe Zermatten aa905b0801
Bug 10190: (follow-up): fix: mtt formating: handle unset
This is needed to handle creating new triggers
for libraries for which all earlier triggers are
defaults (do not exist in the DB , are not explicitly set)

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-09-10 14:25:10 +00:00
Martin Renvoize e4aecaa519
Bug 10190: Add manage_circ_triggers permission for notice trigger access
Replaces the broad manage_circ_rules permission requirement on the
circulation triggers page with a new dedicated manage_circ_triggers
sub-permission (under parameters, flag 3).

- Add manage_circ_triggers to userpermissions.sql
- Update atomicupdate to add the permission, grant it to existing
  edit_notice_status_triggers users, and remove the old permission
- Update admin/circulation_triggers.pl to require manage_circ_triggers
- Add manage_circ_triggers as an OR option on all circulation_rules
  API endpoints (GET/PUT /circulation_rules, /kinds, /config)
- Restrict manage_circ_triggers users in the API controller to
  overdue_* rule names only on write

Sponsored-by: Glasgow Colleges Library Group <https://library.cityofglasgowcollege.ac.uk>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-09-10 14:25:09 +00:00
Martin Renvoize fabe480e52
Bug 10190: (follow-up) Add missing CSP nonce to inline script tag
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-09-10 14:25:08 +00:00
Chloe Zermatten f2951ab377
Bug 10190: (follow-up) mtt formatting
The Transport Type options when displaying in 'edit' mode were showing as
a comma separated string rather than as separate options (as they do when being set).
Ammends this so that they display as separate options consistently.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-09-10 14:25:07 +00:00
Martin Renvoize 4fdc9c76e1
Bug 10190: Fix false conflict error when editing specific trigger rules
When editing a specific rule (e.g. */Kids/Books) alongside an all/all/all
rule, the conflict check incorrectly reported a conflict. The effective=true
API response always returns context as */*/* (fallback), so ruleSetInDb.context
differed from currentRuleSet.context (which was overridden to the real context).

Fix by overriding ruleSetInDb.context before the hasConflict comparison,
consistent with the existing pattern in setCurrentRuleSet.

Signed-off-by: Michaela <michaela.sieber@kit.edu>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-09-10 14:25:06 +00:00
Martin Renvoize bc461cdde1
Bug 10190: Center tables in add modal
Signed-off-by: Michaela <michaela.sieber@kit.edu>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-09-10 14:25:03 +00:00
Martin Renvoize 88b16e6445
Bug 10190: Enforce manage_circ_rules_from_any_libraries permission
- Add OR-type x-koha-authorization to /circulation_rules, /circulation_rules/kinds,
  and /circulation_rules/config endpoints so users with either
  circulate:circulate_remaining_permissions OR parameters:manage_circ_rules
  can access them
- Enforce manage_circ_rules_from_any_libraries in the set_rules controller:
  users without this permission may only set rules for their own library and
  cannot set default (*) rules
- Add explicit use C4::Auth qw(haspermission) import to CirculationRules.pm
- Lock the library selector in the Vue UI for users who lack
  manage_circ_rules_from_any_libraries, defaulting them to their own library
- Update set_rules() tests to cover the new permission restrictions

Signed-off-by: Michaela <michaela.sieber@kit.edu>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-09-10 14:25:02 +00:00
Martin Renvoize 14fe8cb2f5
Bug 10190: (QA follow-up) Fix six issues reported during QA
1. Letter context: setFilteredLetters() was reading library_id from
   currentRuleSet (which has no top-level library_id property) instead
   of this.context.library_id, causing library-specific letter templates
   to never match.

2. False conflict on edit: conflict check fetched rule set from DB with
   effective=false (raw), but the in-memory snapshot was fetched with
   effective=true (with fallbacks). Comparing raw vs effective always
   triggered a conflict when a context inherited any value from a more
   general rule. Fixed by using effective=true for the DB fetch too.

3. Incomplete deletion: updateCircRuleSets() inside deleteRuleSet() was
   called without await, creating a race condition where the page refresh
   could complete before the deletion API call, leaving stale data visible.
   Also added a guard to skip rule sets with no explicit rules for the
   trigger being deleted, and simplified rulesForDeletion construction.

4. No rules displayed on initial load: the route watcher in
   CirculationTriggersList fired immediately before init() had loaded
   patron categories and item types, causing setAllExhaustiveEffectiveRuleSets()
   to produce an empty result. Fixed with a metaInitialized flag that the
   watcher waits for before proceeding.

5. DefaultToLoggedInLibraryOverdueTriggers syspref not respected: the
   default_view template variable was computed but never applied to the
   store's currentLibraryId. Fixed by passing it to init().

6. UI colors: info box background changed from #84c1f3 to #DAECFB (lighter,
   matching the circulation rules page). Error alert messages changed from
   alert-info (blue) to alert-warning (yellow) to match Koha conventions.

Signed-off-by: Michaela <michaela.sieber@kit.edu>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-09-10 14:25:01 +00:00
Martin Renvoize b80df78435
Bug 10190: warn when no default triggers exist and show libraries with rules
When viewing the default library context with no triggers defined, show
a warning message explaining defaults apply to all libraries. If any
libraries have specific triggers, list them as clickable links that
switch the filter to that library. If no rules exist anywhere, show a
prompt to add the first trigger.

Signed-off-by: Michaela <michaela.sieber@kit.edu>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-09-10 14:24:56 +00:00
Martin Renvoize 17c3aab6c4
Bug 10190: fix NaN trigger number when adding first rule for a library
When no circulation rules exist for a library, triggerCounts[library_id]
is undefined, causing undefined + 1 = NaN. Use nullish coalescing to
default to 0 so the first trigger correctly gets number 1.

Signed-off-by: Michaela <michaela.sieber@kit.edu>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-09-10 14:24:55 +00:00
Martin Renvoize 7413d2724e
Bug 10190: remove has_rules sentinel from circulation_rules table
has_rules was a purely frontend marker stored as a circulation rule to
signal that a context had explicitly-saved overdue trigger rules. The
backend never reads it; the information is fully derivable from whether
any of delay/notice/mtt/restrict are non-null for a given context.

Replace all has_rules DB reads/writes with a hasExplicitRulesForTrigger()
helper that checks the four real rule suffixes directly. has_rules remains
as a computed in-memory concept in the Vue store (derived in findEffectiveRule)
so templates require no changes.

Also adds an atomicupdate to delete existing has_rules rows from the DB,
and removes the has_rules insert from the bug_10190 migration script.

Signed-off-by: Michaela <michaela.sieber@kit.edu>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-09-10 14:24:54 +00:00
Chloe Zermatten 8c8160761d
Bug 10190: Deprecate permission
user_permissions rows do not need manual cleanup because the FK on
user_permissions(module_bit, code) references permissions(module_bit, code)
ON DELETE CASCADE, so deleting from permissions automatically removes
per-patron rows.

Signed-off-by: Michaela <michaela.sieber@kit.edu>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-09-10 14:24:48 +00:00
Chloe Zermatten 564f15ca59
Bug 10190: prevent duplicate ruleset load
- prevent the initial API call and subsequent exhaustive applied ruleset list generation logic from running twice

Signed-off-by: Michaela <michaela.sieber@kit.edu>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-09-10 14:24:46 +00:00
Chloe Zermatten a45a7aa8e1
Bug 10190: trigger add/edit form UI/UX enhancements
- scroll to the add/edit form on button click
    - prevent redundant full page reload upon the user swapping between adding and editing while the modal is open
    - ensure robust scroll behaviour, handling:
          - the URL being accessed directly
          - the edit button in the table in the main page being used to access the form directly
          - the stepper workflow being used
          - the user swapping between add and edit once already looking at the form
- dynamic display of 'Transport Type' consistency: only show if a 'Notice' has been selected
- if a notice has been selected, prevent form submission if transport type isn't set and display an alert on submission attempt

Signed-off-by: Michaela <michaela.sieber@kit.edu>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-09-10 14:24:44 +00:00
Chloe Zermatten d3022cb950
Bug 10190: (QA follow-up) add missing filter
Signed-off-by: Michaela <michaela.sieber@kit.edu>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-09-10 14:24:43 +00:00
Chloe Zermatten d508b600dd
Bug 10190: enhance trigger context display in modal
- improve modal scroll behaviour
- improve modal dimensions
- display contexts as a horizontal list to make better use of the available space
- fully contain dropdowns within the modal body

Signed-off-by: Michaela <michaela.sieber@kit.edu>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-09-10 14:24:42 +00:00
Chloe Zermatten 298b4b6efc
Bug 10190: refactor to remove redundant try..catch
Signed-off-by: Michaela <michaela.sieber@kit.edu>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-09-10 14:24:36 +00:00
Chloe Zermatten 7e70013450
Bug 10190: remove circ triggers link from tools menu
Signed-off-by: Michaela <michaela.sieber@kit.edu>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-09-10 14:24:35 +00:00
Chloe Zermatten cf8230cdda
Bug 10190: fix permissions
- add a config API endpoint to Circulations Triggers so permissions can be fetched
- update the permissions in the Vue App so that manage_circ_rules is required
- update the permissions in the Circulation Rules API so that manage_circ_rules is required for PUT operations
- update the circulation-rules store to so that it is compatible with recently intorduced compostables
- implement a redirect into the route so that permission requirements are honoured

Signed-off-by: Michaela <michaela.sieber@kit.edu>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-09-10 14:24:34 +00:00
Chloe Zermatten 839bc81e80
Bug 10190: (follow-up) Complete Vue.js rewrite of Circulation Triggers administration interface
This patch aims to resolve the following issues as reported by comment 193:

- missing atomic update for overde_X_has_rules (amended to account for comment 227)
- existing delays being overwritten by the client when a rule set is displayed
- inability to save circulation overdue rule sets for context for which circulations rules where already set
- address bug_10190.pl db script warnings (undef values were being concatenated with strings)
- add a guard clause to bug_101090.pl: check that the tables the script pulls the data from do still exist, otherwise exit.
- remove duplicate Letters options in the circulation triggers add / edit form

Signed-off-by: Michaela <michaela.sieber@kit.edu>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-09-10 14:24:33 +00:00
Martin Renvoize 8d5d976ff0
Bug 10190: Remove old overduerules interface
This patch updates the link from the tools homepage to open the new
circulation triggers administration page.

We then remove the old overduerules controller and template, and finally
we drop the no longer referenced
C4::Overdues::GetOverdueMessageTransportTypes method and associated unit
tests.

Sponsored-by: Glasgow Colleges Library Group <https://library.cityofglasgowcollege.ac.uk>
Signed-off-by: George Harkins <George.Harkins@cityofglasgowcollege.ac.uk>
Signed-off-by: Michaela <michaela.sieber@kit.edu>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-09-10 14:24:29 +00:00
Chloé Zermatten d2c575a93d
Bug 10190: Complete Vue.js rewrite of Circulation Triggers administration interface
This patch introduces a modern Vue.js-based interface for managing circulation triggers (overdue notice/status triggers), replacing the legacy Tools-based interface with a more intuitive, feature-rich administration page.

New Features

Enhanced Visibility & Navigation
- Exhaustive effective rule lists showing all rules that apply to each context
- Toggle between "all exhaustive rules" and "explicitly set rules" views
- Advanced filtering by patron category and/or item type
- Clear display of fallback/default rules for each context

Rule Management Actions
- Delete triggers (last trigger in a sequence for any given library)
- Reset entire rule sets for a given context (with safeguards)
- Edit existing triggers with improved context awareness
- Add new triggers with intelligent delay constraints

Improved User Experience
- Multi-step form wizard with clear workflow progression
- Context-aware letter template filtering (only shows applicable templates)
- Placeholder values showing fallback rules when clearing inputs
- Dynamic min/max constraints for delay values based on neighboring triggers
- Real-time form validation and feedback
- Partial page reloads (only reload affected sections, not entire page)
- Specific loading messages for different operations

Technical Improvements
- Centralized Vuex store for state management
- Reusable CirculationTriggersForm component
- API clients for libraries, circulation rules, item types, and patron categories
- Consistent async/await pattern throughout
- Separation of repositories, utilities, and services
- Improved naming consistency and code maintainability
- "Dumb" TriggersTable component for better separation of concerns

Test Plan

Prerequisites
1. Log in to staff interface with appropriate permissions (tools_edit_notice_status_triggers)
2. Ensure you have test data: multiple libraries, patron categories, item types, and notice templates
3. Navigate to Administration > Circulation triggers (new interface)

Part 1: Basic Navigation & Interface
1. Verify the new "Circulation triggers" link appears in Administration home under the Circulation section
2. Access the new interface and confirm it loads successfully
3. Verify the default view shows either "All libraries" or your logged-in library based on DefaultToLoggedInLibraryOverdueTriggers system preference
4. Confirm the interface displays a list of triggers organized by context (library/patron category/item type combinations)

Part 2: Viewing and Filtering Rules
1. Toggle between "All exhaustive rules" and "Explicitly set rules" views
  - Verify "All exhaustive rules" shows inherited/fallback rules
  - Verify "Explicitly set rules" shows only rules you've specifically configured
2. Test the patron category filter:
  - Select a specific patron category
  - Confirm only rules for that category are displayed
3. Test the item type filter:
  - Select a specific item type
  - Confirm only rules for that item type are displayed
4. Test combined filters (patron category + item type simultaneously)
5. Clear filters and verify all rules display again

Part 3: Adding New Triggers
1. Click "Add trigger" button
2. Step 1 - Confirm Context:
  - Select Library (required)
  - Select Patron category (required)
  - Select Item type (required)
  - Click "Confirm context"
3. Step 2 - Review Existing Triggers:
  - Verify existing triggers for this context are displayed
  - Note the trigger numbers and delays
4. Step 3 - Configure New Trigger:
  - Enter a delay value (should be constrained by neighboring triggers)
  - Try entering an invalid delay (too low or too high) - verify validation
  - Set "Restricts checkouts" (Yes/No/Fallback to default)
  - Note the placeholder showing the fallback value
  - Select a letter template
  - Verify only templates for the selected library context appear
  - Set "Debarring" options if desired
  - Select "Charged notice fees" if applicable
5. Submit the form
6. Verify the new trigger appears in the list without a full page reload
7. Verify success message is displayed

Part 4: Editing Existing Triggers
1. Locate an existing trigger in the list
2. Click the edit icon/button
3. Verify the form pre-populates with existing values
4. Test delay modification:
  - Try changing the delay within valid bounds - should succeed
  - Try changing delay beyond neighboring triggers - should show validation error
  - Use the increment/decrement buttons to adjust delay
5. Test clearing values:
  - Clear a field (e.g., delay or restrict checkouts)
  - Verify placeholder shows the fallback/default value
  - Submit with cleared value - should save as null and inherit fallback
6. Change the letter template to a different valid template
7. Submit changes
8. Verify the trigger updates in the list without full page reload
9. Verify the changes persist after refreshing the page

Part 5: Deleting Triggers
1. Identify a trigger that is the last in its sequence
2. Click the delete button/icon
3. Verify a confirmation dialog appears
4. Confirm deletion
5. Verify the trigger is removed from the list without page reload
6. Verify the deletion persists after page refresh
7. Test delete constraints:
  - Try to delete a trigger that's not the last in sequence
  - Verify appropriate error/warning message

Part 6: Resetting Rule Sets
1. Locate a context with explicitly set rules (not just inherited)
2. Ensure this is not the only rule set for this trigger sequence
3. Click the "Reset" button for that context
4. Verify confirmation dialog explains what will be reset
5. Confirm the reset
6. Verify the explicit rules are removed and context now shows inherited rules
7. Verify changes persist after page refresh
8. Test reset constraints:
  - Try to reset when it would leave no rules for that trigger
  - Verify appropriate warning/prevention

Part 7: Context-Specific Behavior
1. Test library-specific letter filtering:
  - Create/edit a trigger for a specific library
  - Verify only letter templates with matching branchcode or default templates appear
  - Switch to a different library context
  - Verify the letter list updates accordingly
2. Test default rules:
  - View rules for "All libraries" / "All patron categories" / "All item types"
  - Verify these are labeled as "Default rule for [context]"
  - Confirm these serve as fallback for more specific rules
3. Test DefaultToLoggedInLibraryOverdueTriggers preference:
  - Set preference to "Yes"
  - Reload circulation triggers page
  - Verify it defaults to your logged-in library
  - Set preference to "No"
  - Verify it defaults to "All libraries"

Part 8: Form Workflow & Validation
1. Test required fields:
  - Try submitting add/edit form without selecting library - should fail
  - Try submitting without patron category - should fail
  - Try submitting without item type - should fail
2. Test stepper navigation:
  - Start adding a trigger
  - Verify you must confirm context before proceeding
  - Verify you see existing triggers before editing/adding
  - Verify trigger form only appears after context confirmation
3. Test cancellation:
  - Start adding/editing a trigger
  - Click Cancel
  - Verify you return to the list without changes
  - Verify no partial data was saved

Part 9: Loading States & Messages
1. On slow connections or with many rules:
  - Verify "Loading context..." appears while fetching context data
  - Verify "Loading rule set information..." appears while fetching rules
  - Verify section-specific loading messages appear during updates
2. After form submission:
  - Verify appropriate success/error messages display
  - Verify loading indicators during async operations

Part 10: Permissions
1. Log in as a user without tools_edit_notice_status_triggers permission
2. Verify the "Circulation triggers" link does not appear in Administration
3. Try accessing /cgi-bin/koha/admin/circulation_triggers directly
4. Verify access is denied

Part 11: Data Integrity & Persistence
1. Create a complex set of rules with multiple triggers across different contexts
2. Refresh the page and verify all rules persist
3. Restart the Koha services
4. Verify all rules still display correctly
5. Check the database circulation_rules table:
  - Verify rules are stored with correct rule_name pattern (overdue_1_delay, etc.)
  - Verify null values are properly stored for inheritance
  - Verify the overdue_X_has_rules rule kind is present

Part 12: Edge Cases
1. Test with no existing triggers - verify empty state message
2. Test with maximum trigger sequences (e.g., trigger 1, 2, 3)
3. Test rapid successive edits
4. Test with special characters in letter template names
5. Test browser back/forward buttons during form workflow

Part 13: Comparison with Legacy Interface
1. Access the old interface if still available (via Tools menu)
2. Create a trigger using the new interface
3. Verify it appears correctly in the old interface (if applicable)
4. Create a trigger using the old interface (if still available)
5. Verify it appears correctly in the new interface

Signed-off-by: Michaela <michaela.sieber@kit.edu>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-09-10 14:24:25 +00:00
Lucas Gass b369ba5d17
Bug 36868: Move array splice in OPAC js to after the -1 check
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-09-10 14:24:14 +00:00
Brendan Lawlor ae903a008d
Bug 36868: (QA follow-up) Fix deletion off by one error
When the biblionumber is not in the array -1 is returned.

Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-09-10 14:24:12 +00:00
Lucas Gass 9b5f75a79e
Bug 36868: (follow-up) Fix deletion when nothing is in the cart, and make DB update better
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-09-10 14:24:11 +00:00
Lucas Gass fac6a1adfe
Bug 36868: (follow-up) Fix variable names
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-09-10 14:24:10 +00:00
Lucas Gass 1e8f39e7a6
Bug 36868: Add logic for OPAC
1. APPLY PATCH, updatedatabase, restart_all
2. Search for the new AutoDeleteFromCartWhenHoldPlaced system preference
3. Turn it on for both staff and OPAC
4. From the staff interface put some items in your cart.
5. Place a hold on all of them.
6. Once the hold(s) have been successfully done those items should no longer be in your cart.
7. Put more items into your staff cart, place a hold on some of them but not all.
8. Only the items you have placed a hold on should be removed.
9. Go to the OPAC and put some items in your cart.
10. Place a hold on all of them, those items should now be deleted from the cart.
11. Place more items into your OPAC cart, place a hold on some of them but not all.
12. Only the items you have placed a hold on should be removed.
13. Switch the AutoDeleteFromCartWhenHoldPlaced to only be for 'staff'.
14. Try steps 4-8 again.
15. Switch the AutoDeleteFromCartWhenHoldPlaced to only be for 'opac'.
16. Try steps 9 -12 again.

Signed-off-by: Sam Lau <samalau@gmail.com>

Signed-off-by: Sarah Fletcher <sfletcher@ncwlibraries.org>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-09-10 14:24:08 +00:00
Lucas Gass 42ca5a7b6a
Bug 36868: (follow-up) Fix staff interface code
Signed-off-by: Sam Lau <samalau@gmail.com>

Signed-off-by: Sarah Fletcher <sfletcher@ncwlibraries.org>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-09-10 14:24:07 +00:00
Lucas Gass 723258423c
Bug 36868: Add system preference AutoDeleteFromCartWhenHoldPlaced
Signed-off-by: Sam Lau <samalau@gmail.com>

Signed-off-by: Sarah Fletcher <sfletcher@ncwlibraries.org>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-09-10 14:24:03 +00:00
Lucas Gass 4d50205d4a
Bug 42722: Add noItemsOnBib error message
Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-09-09 15:50:03 +00:00
Eric Phetteplace f87ee4aecb
Bug 42722: Improve invalidPickupBranch error message
Ensure you have the patch from Bug 41879 and follow its test plan.
You should see the message 'Target item or record has an invalid
pickup location. Either move the hold onto a valid item type or
select a valid pickup location.' when attempting an invalid hold.

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-09-09 15:50:01 +00:00
Owen Leonard 4c0424994c
Bug 42685: Capitalization corrections in some ILL files
This patch makes two capitalization corrections in files related to ILL:

"ISO18626 Messages" -> "ISO18626 messages"
"Requesting Agencies" -> "Requesting agencies"

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-09-09 15:50:00 +00:00
Owen Leonard 6de2c57c27
Bug 43325: Remove event attribute from point of sale receipt window
This patch removes event attributes from the point of sale receipt
template in favor of adding the "close_window" class to the links. The
class has a globally-defined event handler for the close window
operation

To test, apply the patch and enable the EnablePointOfSale system
preference if necessary.

- If necessary, got to Administration -> Debit types and create at least
  one debit type which has the "Can be sold" checkbox checked.
- Go to the point of sale page and add at least one item to purchase.
- Fill out the "Collect payment" form and confirm.
- When the payment is received, click the "Print receipt button" in the
  dialog.
- On the receipt window which opens, click the "Close" button. The
  window should close.
- Open the receipt window again and change the "accountlines_id"
  parameter in the URL to an accountlines ID which doesn't exist
- The page should show an error message instead of a receipt. Test the
  "Close" button in this view.

Sponsored-by: Athens County Public Libraries
Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-09-09 15:49:57 +00:00
Owen Leonard 685be2e643
Bug 43319: Remove event attribute from library_groups.tt
This patch updates the library groups administration page so that an
event attribute is not necessary. We don't need an onclick event handler
to submit the form--we can just use a submit button as the menu item.

To test, apply the patch and go to Administration -> Library groups.

- If necessary, create a new library group.
- From the list of groups, click an "Add library" menu button and then
  click one of the libraries which appear as menu items.
- The page should reload and the library you selected should now show up
  as being part of that library group.

Sponsored-by: Athens County Public Libraries
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-09-09 15:49:56 +00:00
Matt Blenkinsop ec1691b59d
Bug 43320: (QA follow-up) Add html filter and fix translatability
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-09-09 15:49:55 +00:00
Nick Clemens 8e663ae7bd
Bug 43320: OPAC adjustments
Similar test plan, but on the OPAC

Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-09-09 15:49:53 +00:00
Nick Clemens 403288c5cd
Bug 43320: Don't quoted already quoted searches and add feedback
Bug 31213 added a quoted search when no results were found,
this patch builds on that to:
1 - Notify the user when their search is repeated quoted
2 - Not repeat a search when already quoted

To test:
 0 - Set system preferences
     RedirectToSoleResult to 'Don't redirect'
     IntranetAddMastheadLibraryPulldown to Show
     IntranetCatalogSearchPulldown to Show
 1 - Add the sample records to your catalog
 2 - Search for the quoted phrase "happy family big" in the 'title' index
 3 - Note you get a result
 4 - Check the record - the phrase is not found, but the record contains all the terms
 5 - Search for the unquoted phrase: 6:20 man
 6 - Confirm search is quoted and result found
 7 - Apply patch, restart all
 8 - Repeat 5
 9 - Confirm you are now told search was quoted and result found
10 - Repeat 2
11 - Confirm no result found, no notice of repeated search

Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-09-09 15:49:52 +00:00
Jacob O'Mara 3e483cd61a
Bug 39658: (follow-up) block checkout when linked accounts over charge limit
When AllowFineOverride is disabled and NoIssuesChargeLinkedAccounts
is exceeded, hide the barcode field and show 'Cannot check out'.
Signed-off-by: Trevor Diamond <trevor.diamond@mainlib.org>
Signed-off-by: Kellie Stephens <kellie.stephens@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-09-09 12:07:41 +00:00
Jacob O'Mara f41cd57410
Bug 39658: Admin: Add linked account system preferences UI
Add prefs for EnablePatronAccountLinking and related settings.
Signed-off-by: Trevor Diamond <trevor.diamond@mainlib.org>
Signed-off-by: Kellie Stephens <kellie.stephens@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-09-09 12:07:34 +00:00
Jacob O'Mara 23de8ce68e
Bug 39658: Patron detail UI: Add linked accounts section
Display linked patrons with Add/Leave link group buttons.
Signed-off-by: Trevor Diamond <trevor.diamond@mainlib.org>
Signed-off-by: Kellie Stephens <kellie.stephens@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-09-09 12:07:33 +00:00
Jacob O'Mara 2b210d6da8
Bug 39658: Circulation UI: Add linked account fee/hold messages
Display warnings for combined debt and linked hold pickup.
Signed-off-by: Trevor Diamond <trevor.diamond@mainlib.org>
Signed-off-by: Kellie Stephens <kellie.stephens@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-09-09 12:07:31 +00:00
Martin Renvoize 9371504d98
Bug 30144: (QA follow-up) Only show servicing instructions when EDIFACT is available
The new servicing instructions UI on the "add order" form was showing
unconditionally, even when the EDIFACT system preference is disabled
or the vendor has no EDI account configured. Elsewhere in acquisitions
(e.g. acqui/basket.tt) EDI-only UI is gated on
Koha.Preference('EDIFACT') && ediaccount, so apply the same check here.

Test plan:
1. With EDIFACT disabled, or EDIFACT enabled but the vendor has no
   entry in vendor_edi_accounts, open Acquisitions > a basket > Add
   order (neworderempty.pl)
   => No "Servicing instructions" field is shown
2. Enable EDIFACT and add a vendor_edi_accounts row for the vendor
   => The "Servicing instructions" field appears and behaves as before

Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-09-09 12:07:23 +00:00
Jonathan Druart f612fda1e9
Bug 41995: Add nonce
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-09-04 11:24:14 +00:00
Jonathan Druart 76504e598a
Bug 41995: Remove extra JS code
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-09-04 11:24:12 +00:00
Jonathan Druart dd536cae2e
Bug 41995: Fix conflict with bug 37762
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-09-04 11:24:11 +00:00
Jonathan Druart 061cc915ad
Bug 41995: Add autocomplete on the admin home page
Signed-off-by: Anneli Österman <anneli.osterman@koha-suomi.fi>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-09-04 11:24:10 +00:00
Jonathan Druart c9cfa985b6
Bug 41995: Autocomplete for syspref search
This patch adds autocompletion to the syspref search in the header.

Test plan:
1. Go to the admin home page - /cgi-bin/koha/admin/admin-home.pl
2. In the header start typing the name of a syspref and notice that
   there is now autocompletion (you need at least 3 chars)
3. Select an entry and confirm that you are correctly redirected to the
   correct search result

Signed-off-by: Anneli Österman <anneli.osterman@koha-suomi.fi>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-09-04 11:24:09 +00:00
Tomás Cohen Arazi 78906e00da
Bug 42443: (QA follow-up) Use POST /transfers/{transfer_id}/cancellation
Cancelling a transfer is a state change on the resource, not a deletion of
it, so it should be modelled as an action sub-resource rather than a DELETE
on the transfer itself. This aligns the endpoint with the API coding
guidelines (REST2: non-CRUD actions use action sub-resources; REST3.2:
conflicts return 409) and with the design used in bug 43454.

Changes:
- Replace DELETE /transfers/{transfer_id} with
  POST /transfers/{transfer_id}/cancellation
- Rename the controller method delete() to cancel(), look the transfer up
  with objects->find_rs, and return 200 with the updated resource
  representation instead of 204 with an empty body
- Make cancellation_reason optional, defaulting to 'Manual', matching the
  legacy returns.pl behaviour
- Return 409 with a structured error_code ('already_arrived',
  'already_cancelled') when the transfer cannot be cancelled, instead of a
  bare 400
- Update the transfers to receive page to POST to the new endpoint and to
  treat 404/409 as "already gone, refresh the table"
- Adapt the tests accordingly, including coverage for the default reason
- The *_date API attribute names introduced by this bug are kept, as they
  are the guideline-compliant form (REST1.3.4.1: *_date, not date_*)

Test plan:
1. Apply patch
2. Run the tests:
   $ ktd --shell
  k$ prove t/db_dependent/api/v1/transfers.t
=> SUCCESS: Tests pass!
3. Rebuild and validate the API spec:
  k$ yarn api:bundle
  k$ prove xt/api.t
=> SUCCESS: Tests pass!
4. In the staff interface, go to Circulation -> Transfers to receive,
   click "Cancel transfer" on a row
=> SUCCESS: The transfer is cancelled and the row drops off the table
5. Cancel the same transfer again from a second tab
=> SUCCESS: The API returns 409 (already_cancelled) and the row is
   treated as already gone
6. Sign off :-D

Assisted-by: Sonnet 4.6 (Anthropic)
Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-09-04 11:23:41 +00:00
Martin Renvoize d7a87e2cbd
Bug 42443: (QA follow-up) Use library selects for Sent from and Home library filters
Replace the free-text filter inputs for the "Sent from" and "Home library"
columns with select dropdowns populated from the full library list, consistent
with other DataTables pages such as the pending bookings page.

The "Sent from" column is made visible again (it was previously hidden since
rowGroup provides the visual grouping); showing it also allows its filter cell
to render.

The "On hold for" column intentionally has no filter: it is computed from two
different embedded sub-objects (item.first_hold.patron or item.recall.patron)
and has no single API field to filter against server-side.

Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-09-04 11:23:40 +00:00
Martin Renvoize ebb77c8fa9
Bug 42443: (QA follow-up) Group transfers by sending library using rowGroup
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-09-04 11:23:38 +00:00
Martin Renvoize 19d1db91d2
Bug 42443: (QA follow-up) Fix escaping of branchcode in JS context
Using | html to embed a TT value inside a JS string literal is
incorrect: it produces HTML entities rather than JS-safe characters.
Store the branchcode in a data attribute (where | html is correct)
and read it from there in JavaScript.

Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-09-04 11:23:34 +00:00
Martin Renvoize 16b2ac663e
Bug 42443: (QA follow-up) Guard nullable embed access in JS renderers
from_library and home_library can be null if a transfer references an
orphaned branch row. Accessing .name on null throws a TypeError and
crashes the DataTable renderer; guard both accesses.

Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-09-04 11:23:33 +00:00
Kyle M Hall c813fb2574
Bug 42443: Add ability to cancel a transfer via the REST API
This patch adds a DELETE /transfers/{transfer_id} route that cancels the
given transfer by id and reverts an in transit recall for the item the same
way as returns.pl does. The cancellation reason is passed in the request body
so this api endpoint could be used in other places we can cancel transfers.

Signed-off-by: Alex Carver [Acerock7] <alex@rcls.org>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-09-04 11:23:29 +00:00
Kyle M Hall 560d7b7ff7
Bug 42443: Convert transfers to receive page to ajax datatable
Updates circ/transferstoreceive.pl to use the new REST API with
an ajax DataTable to display transfer to receive.

Test Plan:
1) Apply this patch
2) Restart all the things!
3) Set an item in transit to your logged in library ( check it in at another
   branch so it is sent home, or place a hold to trigger a transfer )
4) Place a hold on a second transferred item, and a recall on a third
5) Browse to /cgi-bin/koha/circ/transferstoreceive.pl
6) Note the "On hold for" column shows the hold patron, the recall patron or
   "None"
7) Set TransfersMaxDaysWarning low and note the "days late" badge appears
8) Click "Cancel transfer" and note the transfer is cancelled
9) A library with no incoming transfers will get "No transfers to receive"

Signed-off-by: Alex Carver [Acerock7] <alex@rcls.org>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-09-04 11:23:28 +00:00
Lisette Scheer 2aa2cc0e7f
Bug 42330: (QA follow-up) Fix file permissions on new test and tidy
This patch
- Fixes the file permissions on the new test
- Removes a variable declaration from the new test that's unused
- Removes a new line from the end of staff-global.scss

Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-09-04 11:23:24 +00:00
Jonathan Druart 6cb0f5161c
Bug 42330: Auto-tidy
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-09-04 11:23:23 +00:00
Jonathan Druart fc32990f49
Bug 42330: Add new template tools/restore-records.tt
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-09-04 11:23:21 +00:00
Owen Leonard 248c0fe224
Bug 42330: (follow-up) Some corrections to sidebars
- The structure of the search facets, advanced MARC editor, and
  HTML customiztions sidebars need to be corrected in order for
  the collapse button to work correctly.
- The "toggle_sidebar" click handler should be inside a
  "$(document).ready()" in order to work correctly on pages where the JS
  is in the header.

Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-09-04 11:23:19 +00:00
Jonathan Druart ad694a3411
Bug 42330: Tidy
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-09-04 11:23:17 +00:00
Jonathan Druart b02ca1270d
Bug 42330: Use main-container from all our templates
This goal here is to uniformize the structure of our templates.
Using main-container.inc will also introduce the sidebar collapse (from
bug 42322) where it was missing

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-09-04 11:23:13 +00:00
David Cook 0acaa7fd55
Bug 43202: Make it easier to find ERM system preferences
This patch makes key ERM system preferences contain the words
ERM, e-resource, and electronic resource to improve discoverability
when searching system preferences.

Test plan:
0. Don't apply the patch yet
1. Go to Administration and type "electronic" into "Search system
   preferences" and search
2. Note you get the message "No system preferences matched your search
   for: electronic"
3. Apply the patch
4. Search for "electronic" in the system preferences again
5. Note that "ERMModule" and "ERMProviders" appear

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-09-03 15:54:04 +00:00
Aleisha Amohia 37e6568a9b
Bug 32419: Show item availability on lists view
To test:

1. Create or use a biblio record with multiple items, for example biblionumber 235.
2. Check out an item attached to the record to a patron, i.e. check out barcode 39999000010190 to your logged in user
3. Go to the Detail view for this record.
4. Edit another item attached to the record and give it a not for loan status, i.e. edit barcode 39999000010213 and set it to Not for loan
5. Click the Add to list button above the record. Add the record to an existing list, or create a new one and Save.
6. Go to the Lists module in the staff interface and view the contents of the list you just added your record to.
7. Confirm you see accurate Availability information in the list results within the callnumber column.

Sponsored-by: Pymble Ladies' College
Signed-off-by: Hayley Cheng <hacheng@pymblelc.nsw.edu.au>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-09-03 15:54:03 +00:00
Martin Renvoize 9a4a9415ab
Bug 42997: Warn staff when a due date override runs into the next booking
When checking out a booked item, staff may override the suggested due
date. If that override runs into the next booking for the item, the
previous patch would silently keep the booking's original end date -
staff had no way of knowing their override crossed another booking.

This patch adds an exclude_booking_id option to Koha::Item->find_booking
so a lookup can skip a specific booking (here: the patron's own booking
being collected), and uses it in CanBookBeIssued to detect when an
explicitly requested due date would run into the next booking for the
item. When it would, a new BOOKED_DUE_DATE_CLASH confirmation is raised
and displayed on the checkout screen, telling staff the linked booking
will keep its original end date if they continue.

Only explicitly requested due dates trigger the confirmation -
calculated due dates are clamped to the booking end date later in the
staff checkout flow, so checking them would produce false positives.
SIP is unaffected as it never passes a requested due date.

Test plan:
1) Run t/db_dependent/Circulation.t and t/db_dependent/Koha/Item.t
2) Create two consecutive bookings on the same item for two patrons
3) Check the item out to the first patron specifying a due date beyond
   the second booking's start date; confirm the new confirmation
   message appears and checkout only proceeds once confirmed

Sponsored-by: OpenFifth <https://openfifth.co.uk/\>
Sponsored-by: Westminster City Council <https://www.westminster.gov.uk/\>
Signed-off-by: Hannah Dunne-Howrie <hdunne-howrie@westminster.gov.uk>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-09-03 15:53:52 +00:00
Marcel de Rooy 3ec3c465ba
Bug 36001: Show MARC21 362 on OPAC and staff
Test plan:
Find a serial.
Add a 362 with some content in $a
Check the normal view on OPAC and staff.

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-09-03 15:53:46 +00:00
Brendan Lawlor b7df6f071f
Bug 38196: (QA follow-up) Rename Include as Show
Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-09-03 10:57:01 +00:00
Jan Kissig 54c5c2a9c4
Bug 38196: (follow-up) Fix issue with concern filters containing underscores
This fixes the issue that a filter for a ticket status is not applied when the underlying authorised value for that ticket status contains an underscore.
Also the fa icons are changed to be more intuitive.

Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-09-03 10:57:00 +00:00
Jan Kissig f14a046bb1
Bug 38196: (follow-up) Rename Filter to Hide in concerns.tt
This changes the filter names in concerns.tt from "Filter ..." to "Hide ..." to clarify that a filter here will remove items with that value from the table.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-09-03 10:56:59 +00:00
Jan Kissig 69217a2bc4
Bug 38196: Fix filter in catalog concerns to show tickets where status is NULL
This patch fixes issues on catalog concerns when filtering for self defined authorized values (AV).
When querying for status != AV, also rows with status = NULL are omitted as SQL here only checks for defined values in status.
The patch wraps the a filter query with an 'or status is NULL'.

Test plan:
apply patch dependencies (42283) if not already included and run restart_all
a) enable system preference CatalogConcerns
b) create some authorised values in TICKET_STATUS
c) create several concerns/tickets (biblio detail page -> new catalog concern)
d) go to /cgi-bin/koha/cataloguing/concerns.pl and change some ticket status to have some variation for filtering
e) play with the filters on the top (resolved and self created TICKET_STATUS)
- when clicking 'Filter resolved' tickets with status 'Resolved by ... date' get filtered
- when filtering self created TICKET_STATUS values tickets with that status AND tickets with status Open are disappearing
f) apply patch and run restart_all
g) retry steps in e) and check that only the filtered status are filtered from the results list.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-09-03 10:56:58 +00:00
Nick Clemens f1ca516b60
Bug 39829: Allow custom title in SIP responses
This patch adds a custom aj_field_template to the sip accounts
This allows libraries to specify a template for the title (AJ) field in sip
messages

The template allows using item and biblio fields (item provides access to biblio. but we pass
both in order to makes the templates simpler

To test:
1 - Install patches
2 - updatedatabase, yarn build, restart_all
3 - Setup a sip account, KTD already has a sip patron, term1, you can use that
    don't add the aj_field_template yet
4 - Find or create a biblio with 245a and 245b like 245$aTitle : $bSubtitle and add item with TESTBARCODE
5 - From the command line:
    perl misc/sip_cli_emulator.pl -su term1 -sp term1 -l CPL -t CR -a localhost -p 6001 -m item_information --item TESTBARCODE
6 - Confirm AJ field shows "Title :" as expected
7 - Edit sip account, set aj_field_template to:
    [% biblio.title %] [% biblio.subtitle %] [% item.barcode %]
8 - Repeat the sip test
9 - Confirm you get the response like:
    Title : Subtitle TESTBARCODE
10 - Sign off!

Signed-off-by: Bob Bennhoff <bbennhoff@clicweb.org>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-09-03 10:56:52 +00:00
Jonathan Druart 6a040f8003
Bug 42975: (bug 35380 follow-up) Fix patron category filtering on Record overlay rules
Test plan:
Turn on MARCOverlayRules
Go to /cgi-bin/koha/admin/marc-overlay-rules.pl
Confirm the "Filter" column is correctly adjusted when the "source"
dropdown is modified

Signed-off-by: Jan Kissig <bibliothek@th-wildau.de>
Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-09-03 10:56:50 +00:00
Pedro Amorim 481e170da1
Bug 42968: Revert "Bug 42968: Add fallback label for 505 contents notes"
This reverts commit 3bdecfb4e6.

Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-09-01 15:52:24 +00:00
Laura_Escamilla 3bdecfb4e6
Bug 42968: Add fallback label for 505 contents notes
To test:

1. Create or locate a bibliographic record with a MARC 505 field.

2. Leave the first indicator blank.

3. Add text to the 505 field.

4. View the record detail page.

5. Notice that the 505 contents display without a label.

6. Apply the patch

7. Refresh the record detail page. Notice that the 505 content displays a label now.

8. Sign off and have a lovely day! :D

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-09-01 15:42:19 +00:00
Jonathan Druart 02491b08d3
Bug 43394: DT - Cast pageLength to Integer
In "Edit patron card batch" the pageLength is coming from the syspref,
the value is a string.
But DataTable's needs an integer.
Let's fix this in datatables.js, in the kohaTable's constructor

Test plan:
Got to cgi-bin/koha/patroncards/edit-batch.pl
Enter more than 20 borrowernumbers and "Add patron(s)"
Click "next" and notice that with this patch the pagination works.
Without this patch the JS error is
"Uncaught TypeError: can't access property "nTr", p is undefined"

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-09-01 15:42:14 +00:00