Update suggestion action logging to populate the diff column using the
correct before/after semantics:
- CREATE: empty before-state ({}), new suggestion data as after-state
- MODIFY: pre-change unblessed data as before, post-store object as after
- DELETE: log before the SQL DELETE so the object can still be fetched;
pass the suggestion as both $infos (info column) and $original (diff
before-state), logaction sets after-state to {}
Also add tests verifying the diff column is populated for all three actions.
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit efe6f26e41)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
This patch corrects several instances in the templates where "ID" is
incorrectly capitalized, "id" or "Id."
To test, an inspection of the patch/diff should be enough to confirm
that the changes are correct.
Signed-off-by: Andrew Auld <andrew.auld@openfifth.co.uk>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 00886b1f75)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
To test:
1. APPLY PATCH, restart_all
2. Go to Administration > Patron categories
3. Edit or create some categories with different Enrollment periods and messaaging preferences
4. Find or create some patrons in different categories than the ones setup in step 3.
5. Edit the patron and change the category to one setup in step 3.
6. Notice a popup asking about both patron expiratoin date and messaging preferences, both should be checked by default.
7. Confirm and check that both the patron expiration date and messaging preferences updated to the category defaults.
8. Try again, checking only one of the 2 checkboxes. Make sure things updated correctly. Try this with both checkboxes.
Signed-off-by: John Vinke <jvinke@austinseminary.edu>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 0809d09222)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
Fix the spelling for a patron categories form label. "Upperage limit"
should be "Upper age limit" (there should be a space between upper and
age). Also fixes the table row label when attempting to delete a
patron category.
Test plan:
1. Go to Administration > Patrons and circulation > Patron categories.
2. Add a new patron category (or edit an existing category).
3. Notice that the label "Upperage limit" has no space between
upper and age.
4. Attempt to delete a patron category, for example, Staff.
5. Note the itable row label is "Upperage limit".
6. Apply the patch.
7. Reload the pages for steps 2 and 4.
8. Note that the labels are now splet correctly as "Upper age limit".
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Gretchen Maxeiner <maxeinergl@gcc.edu>
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 1dd005c04d)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
There is no space between the guarantor name and relationship on the
patron's details page in the staff interface, for example:
Henry Acevedo(father).
Test plan:
1. Go to Patrons.
2. Search for Lisa Charles (borrower number = 37).
3. Select Edit.
4. In the patron guarantor section, click on "Add guarantor":
- Search for and select Henry as the guarantor
- For relationship, select an option
5. Click Save.
6. Go to the details section.
7. Note that under the Guarantor heading there is no space between the
guarantor's surname and the relationship,
for example: Henry Acevedo(father)
8. Apply the patch.
9. Refresh the page.
10. Note that there is now a space between the surname and relationship.
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>
(cherry picked from commit 1357768b00)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
The problem that arises here is that return meaning
'return to previous page' as a verb and 'Return' as a substantive
require different translation, at least in German.
Updated the display text 'Return' to 'Check-in' in:
- action-logs.inc: The action log display for the RETURN case
This resolves problems in the translation
Test plan:
1. Navigate to a page displaying Action logs
2. Look for entries with the RETURN action
3. Confirm the display text now shows 'Check-in' instead of 'Return'
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit d34e09d2f6)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
The prior patch incorrectly linked to 'circ' and 'holds' in the table settings, causing the Configure to take one to the wrong part of the table settings page and saved table settings to not be enforced.
To test:
1: Apply all patches, restart_all
2: Attempt a batch modification of two or more holds such that at least one modification will succeed and at least one will fail
3: On the results page, confirm the Configure button on both the "Updated holds" and "Failed holds" tables correctly lead to the modified_holds table settings
4: Adjust settings for the modified_holds table
5: Confirm your changes are reflected in the results page for subsequent batch hold modifications
Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 7e34351ede)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
To test:
1- Set ReservesControlBranch to 'item's home library'
2- Set Main library's 'Holds and bookings policies by item type' so that PASS items can only be picked up at Main
3- Place a hold on a bib whose only item is a PASS belonging to Main
4- Use the Batch hold modification tool to identify the hold you just placed
5- Update the pickup location to North. Note that the update is successful, and there's no indication that the pickup location is now a problem.
6- Check in Main's PASS, and note that the hold doesn't trigger to fill
7- APPLY PATCH, restart_all
8- Try again, this time the hold should fail to update at all.
9- You should see a new table with the 'Failed hold' in it, it should also include a 'Result' column which explains why the hold failed (New pickup location is invalid).
10- Try modifying a hold to an invalid pickup location, but also attempt to modify something else on the hold at the same time, like expiration date.
11- The hold should not modify anything. If the pickup location is invalid all other modifications should NOT happen on that hold.
12 - Play with the Table settings for the holds_modified tables, ensuring you can hide/show all the columns.
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>
(cherry picked from commit cc3b7cebf5)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
This change uses the text instad of the HTML for the delete SMS
provider confirm message.
Test plan:
0. Apply the patch
1. Go to Administration, click System preferences, search for SMSSendDriver
2. Set SMSSendDriver to "Email"
3. Go to administration
4. Click on "SMS cellular providers"
5. Click "New SMS provider"
6. For "Name" and "Domain" write: This & That
7. Click Submit
8. Click "Delete" for the new provider
9. Note that the message says "Are you sure you want to delete This & That?"
10. Click "OK"
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 63f8c65b36)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 0ebcc2b7fc)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
This patch updates authority types administration templates with
new markup and CSS for layout forms using CSS grids.
To test, apply the patch rebuild the staff interface CSS.
Check the following pages, confirming that the "New" and "Edit" versions
of the form look correct in each case:
- Administration -> Authority types
- Administration -> Authority types -> Tags
- Administration -> Authority types -> Subfields
Sponsored-by: Athens County Public Libraries
Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 2f71ea8407)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
This patch updates lists templates with new markup for laying out forms
using CSS grids.
To test, apply the patch rebuild the staff interface CSS.
Check the following pages, confirming that the forms look
correct.
- Lists -> New list
- Lists -> Edit list
- Lists -> View list -> Add records
- Lists -> View list -> Send list
- Lists -> View list -> Download
- We don't directly access the template for downloading lists anymore,
but it's still there:
http://127.0.0.1:8081/cgi-bin/koha/virtualshelves/downloadshelf.pl?shelfnumber=1
Sponsored-by: Athens County Public Libraries
Signed-off-by: Gretchen Maxeiner <maxeinergl@gcc.edu>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit cd73ef9f34)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 482c323144)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
This patch updates acquisitions-related administration templates with
new markup and CSS for layout forms using CSS grids.
To test, apply the patch rebuild the staff interface CSS.
Check the following pages, confirming that the "New" and
"Edit" versions of the form look correct in each case:
- Administration -> Currencies and exchange rates
- Administration -> Budgets (New, Edit, and Duplicate)
- Administration -> Contracts
- Administration -> Funds -> Add sub fund to a budget
- Administration -> EDI accounts
- Administration -> Library EANs
- Acquisitions -> Vendor -> Contracts
Sponsored-by: Athens County Public Libraries
Signed-off-by: Jessie Z <jzairo@bywatersolutions.com>
Bug 41823: (follow-up) Missed a form requiring an upgrade
- Actions -> Close
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit cac0556c53)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
This patch updates four administration templates to use new structure
and CSS for layout forms using CSS grids.
To test, apply the patch and go to Administration. Check the following
pages, confirming that the "New" and "Edit" versions of the form look
correct in each case:
- Administration -> Debit types
- Administration -> Credit types
- Administration -> Cash registers
- Administration -> Desks
Sponsored-by: Athens County Public Libraries
Signed-off-by: noah <noah@inlibro.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 09c5bd5a9a)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 2c7e644cee)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
Also adjusting the markup on the library add/edit form so that yes/no
selects are narrower.
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>
(cherry picked from commit 2566064028)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
This patch updates the library groups page to convert forms to use the
grid layout introduced in Bug 39483. Some changes are made the global
form-grid CSS:
- Use container queries rather than media queries to control the
responsive behavior of forms using the grid
- Add ".input-md" and ".input-sm" classes to be used when a form's
<input> corresponds to a database column which is smaller. In this
case:
".input-sm" for the row containing branches.branchcode (varchar 10)
".input-md" for the row containing branches.branchzip (varchar 25)
- These classes have been added to branches.tt
The library groups template has been updated with the new form grid
markup.
To test, apply the patch and rebuild the staff interface CSS.
- Go to Administration -> Libraries -> New library
- In the entry form, most form fields should equally wide.
- The library zipcode, IP, and MARC organization code fields should be
narrower.
- The library code field should be narrowest.
- Go to Administration -> Library groups -> New group. The "Add group"
form should be laid out vertically.
- Also test the form shown when editing a group.
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: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit e97636c6df)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
The previous patch incorrectly changed the 730 indicator filter from
[@ind2!=2] to [@ind2=2], which inverts which 730 fields display.
Most 730 fields have a blank second indicator (no information provided),
so this change caused them to disappear from the Uniform titles section.
This restores the original filter so 730 fields with blank or
non-analytical indicators continue to display as Uniform titles.
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit dc86d450d8)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
When 7XX fields contain both name ($a) and title ($t) subfields,
the link should search for the title rather than the name.
This is important for contained works that reference titles
within larger works.
This patch updates both intranet and OPAC XSLT files to check
for the presence of subfield $t and use title search (ti,phr:)
instead of author search (au:) when $t is present.
Test plan:
1. Find or create a bibliographic record with 7XX fields containing both $a (name) and $t (title) subfields
- For example: 700 $a Smith, John $t The Great Adventure
2. View the record detail page in both staff interface and OPAC
3. In the "Contained works" section, click on the link for the 7XX field entry
4. Verify the search is performed as a title search (ti,phr:"The Great Adventure") rather than author search (au:"Smith, John")
5. Confirm the search results show records matching the title from subfield $t
6. Test with records that have 7XX fields with only $a subfields to ensure they still search by author
7. Repeat testing for different 7XX field types (700, 710, 711)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 3c72e5d9c5)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
Test plan:
==========
1. Add some 130, 240, 730 + 7XX $a + $t fields to a record. Note that 730
and 7XX $a + $t fields have to have 2nd indicator set to 2.
You can link the fields to authority records. Ensure that one of the fields is not linkable to an authority record and leave it unlinked.
2. Note that the information displayed from these fields is not
'clickable' neither in OPAC, nor in the staff interface.
3. Apply the patch ; restart all.
4. You should be able to see and use the links now. If the fields are
linked to authotiry record and UseAuthoritiesForTracings
systempreference is set, the search will be performed with
authid identifier. There should be also a magnifying glass icon
with a link to the authority record.
5. The links for any unlinked authority should now point to ti,phr - eg /cgi-bin/koha/catalogue/search.pl?q=ti,phr:%22Uniform%20Bernard%22 instead of au
6. Click that link and ensure it finds at least one record (the one you started with)
Signed-off-by: Bernard Scaife <bernard.scaife@openfifth.co.uk>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 1cc432c168)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
MARC21 contain linking fields (130, 240, 730 + 7XX $a + $t) that currently
currently are not 'clickable'. This patch adds the links, similarly to the links
created for contributors', both in OPAC and staff interface.
Test plan:
==========
1. Add some 130, 240, 730 + 7XX $a + $t fields to a record. Note that 730
and 7XX $a + $t fields have to have 2nd indicator set to 2.
You can link the fields to authority records.
2. Not that the information displayed from these fields is not
'clickable' neither in OPAC, nor in the staff interface.
3. Apply the patch ; restart all.
4. You should be able to see and use the links now. If the fields are
linked to authotiry record and UseAuthoritiesForTracings
systempreference is set, the search will be performed with
authid identifier. There should be also a magnifying glass icon
with a link to the authority record.
Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Bernard Scaife <bernard.scaife@openfifth.co.uk>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 129c750218)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
Remove explicit "return undef" in favour of bare "return" to
satisfy Perl::Critic (PBP p.199).
Signed-off-by: Brian J. Barr <brian.barr@churchofjesuschrist.org>
Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 67df3e1e85)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
POST /api/v1/authorities currently offers only the heading-based
C4::AuthoritiesMarc::FindDuplicateAuthority check, and the only
escape hatch is the `x-koha-override` header.
Koha already ships configurable record matching rules (see
Administration > Record matching rules) and C4::Matcher already
supports `record_type = authority`. This patch lets an API caller
opt into one of those rules when creating an authority by sending
its numeric id in a new `x-koha-matchrule` header.
Behaviour:
* If no `x-koha-matchrule` header is sent the existing heading-based
duplicate check is used. Existing clients are unaffected.
* If `x-koha-matchrule: <id>` is sent:
* non-existent id -> 400 `matching_rule_not_found`
* matcher not record_type=authority
-> 400 `invalid_matching_rule_type`
* matcher returns matches -> 409 `duplicate`; the response
body additionally contains a
`matches: [{authid, score}, ...]`
array listing every hit returned
by the matcher
* matcher returns nothing -> record is created (201)
* `x-koha-override: any|duplicate` continues to bypass all duplicate
checks, including the matcher.
A non-integer header value is rejected by the OpenAPI schema
validator before the controller runs.
Test plan:
1) Apply the patch series.
2) Run `prove t/db_dependent/api/v1/authorities.t`
=> all subtests pass.
3) Log in to the staff interface as a user with the
'manage_matching_rules' subpermission and go to
Administration > Record matching rules > New record matching
rule:
a) Set Matching rule code e.g. `AUTH_HEADING`
b) Set Description e.g. `Authority heading match`
c) Set Record type to `authority`
d) Set Threshold to e.g. `1000`
e) Add a match point:
* Search index: `Heading-Main` (or your authorities index)
* Score: `1000`
* Tag: `110` (or the heading tag used by your
authority type)
* Subfields: `a`
f) Save. Note the numeric matching rule id in the edit URL
(`admin/matching-rules.pl?op=edit_matching_rule&matcher_id=N`).
4) Export an existing authority record as MARCXML (for example
from the authority details page). Save it as `duplicate.xml`.
5) From the command line, POST the record back to Koha using the
new header (replace <N>, credentials and host):
curl -u <user>:<pass> -X POST \
-H 'Content-Type: application/marcxml+xml' \
-H 'x-authority-type: CORPO_NAME' \
-H 'x-koha-matchrule: <N>' \
--data-binary @duplicate.xml \
http://<your-koha>/api/v1/authorities
=> Expect HTTP 409. The JSON response body contains
`error_code: "duplicate"` and a `matches` array listing the
authid(s) that were found along with their score.
6) Edit `duplicate.xml` so the main heading is something that is
not already in the catalogue. POST it again with the same
header.
=> Expect HTTP 201 and a `Location` header pointing to the new
authority.
7) Re-run the POST from step 5 but additionally send
`-H 'x-koha-override: duplicate'`.
=> Expect HTTP 201 (override bypasses the matcher).
8) Send a POST with `x-koha-matchrule: 999999`.
=> Expect HTTP 400 with `error_code: "matching_rule_not_found"`.
9) Create a second matching rule with Record type `biblio` and
note its id. POST with `x-koha-matchrule` set to that id.
=> Expect HTTP 400 with
`error_code: "invalid_matching_rule_type"`.
10) POST with `x-koha-matchrule: abc`.
=> Expect HTTP 400 from the OpenAPI schema validator.
11) POST without `x-koha-matchrule`.
=> Expect the existing heading-based duplicate check to run
exactly as before (409 for a known duplicate, 201 otherwise).
12) Sign off.
Signed-off-by: Brian J. Barr <brian.barr@churchofjesuschrist.org>
Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit cb8f1ff9d5)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
Extends the existing `post() tests` subtest in
t/db_dependent/api/v1/authorities.t with coverage for the new
`x-koha-matchrule` header that selects a Koha record matching rule
(`C4::Matcher`, record_type=authority) for duplicate detection when
creating authorities via POST /api/v1/authorities.
The new cases exercise:
* non-integer id (rejected by the OpenAPI schema validator)
* unknown matcher id -> 400 `matching_rule_not_found`
* biblio matcher id -> 400 `invalid_matching_rule_type`
* valid authority matcher returning duplicates -> 409 with a
`matches` array of `{authid, score}` objects
* valid authority matcher returning no duplicates -> 201
* matcher combined with `x-koha-override: duplicate` -> 201
(override wins, matcher is skipped)
`C4::Matcher` is mocked deterministically to avoid relying on the
authority search engine in the test database.
These tests fail without the controller/spec changes introduced in
the follow-up commit.
Test plan:
1) Apply only this patch and run
`prove t/db_dependent/api/v1/authorities.t`.
=> Failures are expected in the `post() tests` subtest for the
`x-koha-matchrule` cases.
2) Apply the next patch in the series and re-run the tests.
=> All subtests pass.
Signed-off-by: Brian J. Barr <brian.barr@churchofjesuschrist.org>
Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 5feb1e03eb)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
This extends the fix from Bug 37966 to circ/circulation.pl. The original
bug fix addressed circ/renew.pl, where renewing a book on hold with an
empty due date would result in the due date being set to "now" (today).
The same issue occurs in circ/circulation.pl when:
1. Attempting to check out an item that is already checked out to the
same patron (which triggers a renewal)
2. The item has a hold on it, triggering the hold override dialog
3. The librarian overrides the hold without specifying a due date
In this scenario, the renewal would incorrectly set the due date to
today instead of calculating it based on circulation rules.
CHANGES:
1. circ/circulation.pl (lines 550-558)
- Added logic to handle the `renewonholdduedate` parameter when
both RENEW_ISSUE and RESERVED conditions are present
- Follows the same pattern as circ/renew.pl
- If `renewonholdduedate` is empty, passes empty string to AddIssue/
AddRenewal, allowing proper date calculation
2. koha-tmpl/.../circulation.tt (lines 351-356)
- Added "Renewal due date" input field in the hold override dialog
- Only appears when both RESERVED and RENEW_ISSUE are true
- Optional field - if left empty, due date is calculated per
circulation rules
TEST PLAN:
1. Enable the RenewalOnHoldOverride system preference (set to "Allow")
2. Set up a patron, item, and circulation rules:
- Create a patron (or use existing)
- Create an item (or use existing)
- Ensure circulation rules have a renewal period (e.g., 14 days)
3. Create a hold scenario:
- Check out the item to the patron
- Place a title-level hold on the same item (you may need a second
patron or use the same patron depending on your holds rules)
4. Test renewal via circulation.pl:
- Go to Circulation (Home > Circulation)
- Scan the patron's barcode
- Scan the item's barcode (the one that's already checked out with
a hold)
- Observe the hold override dialog appears
5. Test WITHOUT this patch:
- Leave the "Renewal due date" field empty
- Click "Yes, renew"
- BUG: The due date is set to today (same as check-in date)
6. Test WITH this patch:
- Leave the "Renewal due date" field empty
- Click "Yes, renew"
- SUCCESS: The due date is calculated based on circulation rules
(e.g., 14 days from now if that's your renewal period)
7. Test optional due date override:
- Repeat the renewal process
- This time, enter a specific date in "Renewal due date" field
- Click "Yes, renew"
- SUCCESS: The due date is set to your specified date
8. Test SpecifyDueDate preference interaction:
- If SpecifyDueDate is enabled and a due date is set via that
interface, it should take precedence over renewonholdduedate
TECHNICAL NOTES:
The fix ensures that when `renewonholdduedate` is empty (empty string),
it's passed through to AddIssue which then calls AddRenewal. The
improved empty string handling in C4::Circulation (from the follow-up
commit) ensures empty strings are not parsed as "now" but instead
trigger proper date calculation based on circulation rules.
This matches the behavior fixed in circ/renew.pl and provides a
consistent user experience across both circulation interfaces.
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit d463fce02d)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
This commit improves upon the original fix by making the intent more
explicit when handling empty string date parameters in AddRenewal and
AddIssue functions.
WHY THIS IS BETTER:
The original fix (changing `defined $datedue` to just `$datedue`)
works correctly but relies on Perl's implicit truthy/falsy semantics:
if ( $datedue && ref $datedue ne 'DateTime' )
This is subtle because:
- Empty string "" is falsy, so parsing is skipped ✓
- But it's not immediately obvious that empty strings are being
handled specially
- The code doesn't explicitly show its intent
THIS APPROACH:
if ( defined $datedue && $datedue ne '' && ref $datedue ne 'DateTime' )
Benefits:
1. EXPLICIT: Clearly states "only parse if defined AND not empty
AND not already a DateTime"
2. SELF-DOCUMENTING: Intent is obvious to future developers
3. NO RELIANCE on truthy/falsy semantics
4. CONSISTENT: Same pattern applied across all date parameter handling
COMPREHENSIVE CHANGES:
1. AddRenewal (C4/Circulation.pm:3449)
- Made datedue empty string check explicit
2. AddIssue (C4/Circulation.pm:1611)
- Made datedue empty string check explicit
- Also updated issuedate handling (line 1616) to explicitly handle
empty strings
3. Test Coverage (t/db_dependent/Circulation/issue.t)
- Added test for AddIssue with empty string datedue
- Added test for AddIssue with empty string issuedate
- Ensures both functions properly calculate dates from circulation
rules instead of using "now"
The existing test for AddRenewal already covered empty string datedue
(added in the original Bug 37966 commit). These new tests ensure the
same correct behavior for AddIssue.
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 14de13d3ad)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 7dbaa5d77c)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
When renewing a book on hold with the RenewalOnHoldOverride sys pref set
to "Allow", if the due date is not specified then it becomes "now". By
checking the input is set rather than just defined the due date is set as
expected based on circulation rules.
Also change the description of the RenewalOnHoldOverride sys pref as the
due date would no longer be required to be entered with this change.
Test plan:
1. make sure RenewalOnHoldOverride is set to 'Allow'
2. check out a book, then place a title-level hold on it
3. renew the book, see the hold override dialog
4. leave the due date empty and hit the override button
5. observe the new due date is "now"
6. apply patch and restart plack
7. renew the book again, overriding the hold, and see the expected due date
as per circulation rules.
Signed-off-by: Marion Durand <marion.durand@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit c84de245e3)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit ce92e707e1)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 4586a37b7a)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 3598cea2ba)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
This patch adds support for printing PAYOUT receipts from the patron
account page (members/boraccount.pl) using the new PAYOUT notice template.
Previously, PAYOUT debits used the generic invoice print template. Now
they use the same dedicated PAYOUT receipt template that is used in the
POS register, providing consistent receipt formatting across both
interfaces.
Test plan:
1. Create a charge on a patron account (e.g., Lost item)
2. Pay the charge
3. Refund the payment with a cash payout
4. On the patron account page, click "Print" for the PAYOUT transaction
5. Verify the receipt uses the PAYOUT notice template showing:
- Transaction details (ID, operator, payout type)
- Refund details showing what was refunded
- Total payout amount
6. Verify it matches the format used in the POS register
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>
(cherry picked from commit 528f81b7fd)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
The receipt printing logic was failing because it always expected a credit
but the "Print receipt" button was passing the payout debit line ID.
This fix:
- Updates pos/printreceipt.pl to use previously added PAYOUT template based
on account line type
- Uses RECEIPT template for credits, PAYOUT template for PAYOUT debits
- Throws proper error for unsupported transaction types
Test plan:
1. Make a purchase through Point of Sale
2. Go to transaction history for the register used
3. Issue a refund for the purchase
4. Click "Print receipt" button for the refund
5. Verify receipt prints correctly with payout details
Sponsored-by: OpenFifth <https://openfifth.co.uk/>
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>
(cherry picked from commit e92dfc5ab0)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
When a refund is processed through Point of Sale, the system creates:
1. A credit account line (the refund)
2. A debit account line (the payout)
The receipt printing logic currently only accounts for RECEIPTs against
credits.
This patch adds a new 'PAYOUT' template for dealing with the negative
debits that make up a payout so we can construct a proper receipt for
this action.
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>
(cherry picked from commit 02fb697d21)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
PA amended: Removed bug number from subtest
Signed-off-by: Charlie Arthur <carthur@slolibrary.org>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit f0a4659e3c)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
The SIP fields in the database are too small for the templates of some configurations, and are truncated during upgrade resulting in invalid templates. It's likely we need more than 255 characters for some templates. We should convert all sip template fields to TEXT fields.
Test Plan:
1) For each template field on a sip account attempt to save a template like:
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXY
2) Note error preventing you from doing so
3) Apply this patch
4) Run updatedatabase.pl
5) Repeat step 1
6) Note you can now do so without error!
Signed-off-by: Charlie Arthur <carthur@slolibrary.org>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 7693360a0f)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
The advanced cataloging editor lets users hand-edit MARC records as
text but offers no equivalent of the basic editor's value_builder
popups for the fixed-length fields (Leader, 006, 007 and 008).
Catalogers have to type those byte strings by hand, which is error
prone.
This patch wires the 'open_helper_plugin' shortcut (added in the
preceding atomic update) to a new handler in the advanced editor
which:
- inspects the line under the cursor;
- if it is a Leader, 006, 007 or 008 control field, opens the
corresponding marc21_*.pl plugin from cataloguing/value_builder/
in a popup window, pre-populated with the current value;
- splices the plugin's returned value back into the CodeMirror buffer
when the popup closes.
The plugin templates are reused unchanged: a hidden
<input id="adv_editor_fixedfield_buffer"> on the editor page satisfies
the existing report() callback contract, and the editor polls
window.closed to detect submission. The 008 plugin is given the
current Leader value via &leader= so its material-type byte map
matches the record being edited.
The shortcut description is added to keyboard_shortcuts.inc so it
appears with a meaningful label in the in-editor "show shortcuts"
popover and in Administration > Keyboard shortcuts.
Test plan:
1. Apply this patch on top of the preceding atomic update.
2. Visit Administration > Keyboard shortcuts and confirm
'open_helper_plugin' is listed with description "Open fixed-length
field helper (Leader, 006, 007, 008)" and that the key combination
can be edited.
3. Open the advanced cataloging editor on any record:
a. Place the cursor on the 000 (Leader) line and press Shift-Ctrl-H.
The marc21_leader popup should open with the current Leader
value. Make a change, click OK, and confirm the Leader line
updates in the editor and is marked modified in the gutter.
b. Repeat for 006, 007 and 008. For 008, change the Leader's
material-type byte first and confirm the 008 popup form adapts.
c. Place the cursor on a 245 (or any non-fixed-length field) line
and press Shift-Ctrl-H. Nothing should happen.
d. Open a popup, then close it without saving. The editor line
should remain unchanged.
4. Save the record and confirm the new fixed-field values round-trip
correctly when the record is reloaded.
5. Confirm the basic editor's value_builder popups still work
unchanged on Leader / 006 / 007 / 008.
Sponsored-by: Main Library Alliance <https://www.mainlib.org/>
Signed-off-by: Jeanne Mauriello <jeanne.mauriello@mainlib.org>
Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 995bfe2083)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
This adds a new 'open_helper_plugin' keyboard shortcut to the
keyboard_shortcuts table, used by the advanced cataloging editor to
open the value_builder popup for the Leader, 006, 007 and 008 fixed
length fields. The default key combination is Shift-Ctrl-H ("Helper")
and is rebindable from Administration > Keyboard shortcuts. The
behaviour bound to this shortcut is added in a follow-up patch.
Test plan:
1. Apply this patch and run installer/data/mysql/updatedatabase.pl in
KTD.
2. Run:
SELECT * FROM keyboard_shortcuts
WHERE shortcut_name = 'open_helper_plugin';
Confirm a row exists with shortcut_keys = 'Shift-Ctrl-H'.
3. Re-run updatedatabase.pl and confirm the atomic update is idempotent
(no error, no duplicate row).
4. On a fresh install (or by re-loading mandatory/keyboard_shortcuts.sql
on an empty table) confirm the same row is created.
Sponsored-by: Main Library Alliance <https://www.mainlib.org/>
Signed-off-by: Jeanne Mauriello <jeanne.mauriello@mainlib.org>
Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 37ad6039c6)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
This patch fixes the url casing on both translation messages from "url"
to "URL" for better grammatical accuracy of the acronym.
Error not mentioned in original Bug Message hence replication is
undefined.
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit f019e490f9)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
Following the terminology guidelines, the descriptions for AutoSwitchPatron,
CardnumberLog and SelfCheckoutByLogin have been updated to use 'card number'
with a space.
Test plan:
1. Review the descriptions for the system preferences and note that 'cardnumber'
is used, instead of 'card number' for:
- AutoSwitchPatron
- CardnumberLog
- SelfCheckoutByLogin
2. Apply the patch.
3. Repeat step 1, and note that the system preferences now use 'card number'.
Signed-off-by: Tom Yates <tom@hire-tom.co.uk>
Signed-off-by: Andrew Auld <andrew.auld@openfifth.co.uk>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit dc644f0095)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
The original test only verified that a warning was emitted when a corrupt
authority record was encountered; it did not assert that get_matches
returned the recovered record, that an unrecoverable record was dropped,
or that a stale index pointing at a deleted authid was handled.
This patch turns the 'get_matches bad record test' subtest into a full
exercise of the three code paths introduced on this bug:
1 - Recoverable: a record with stray non-XML characters is repaired by
record_strip_nonxml and returned in the match list with the expected
authid.
2 - Unrecoverable: record_strip_nonxml is mocked to return undef; the
parse warning still fires but the record is silently dropped from
the result set (no die).
3 - Stale search index: search_auth_compat returns an authid that does
not exist in auth_header; get_matches no longer dies and returns an
empty result.
The MarcMatcher fixture is given an explicit threshold of 1 so the 1000
score on the authority matchpoint always passes and matches are returned.
Test plan:
1 - prove t/db_dependent/Matcher.t
2 - All subtests pass including the expanded 'get_matches bad record test'.
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 77237445b1)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
Adding an entry to admin/searchengine/elasticsearch/mappings.yaml is only
picked up by fresh installs or when an administrator explicitly resets the
search mappings (rebuild_elasticsearch.pl -r). Existing installations would
otherwise never see the new 'authid' index in the admin UI nor have it
available as a matching index until they ran the reset.
This atomicupdate inserts:
- a search_field row for 'authid' (type 'stdno', staff_client + opac on)
- search_marc_map rows for authorities/marc21/001 and authorities/unimarc/001
(INSERT IGNORE - the rows are shared with 'local-number' and usually
already exist)
- search_marc_to_field rows linking those MARC maps to the new field with
sort on, matching mappings.yaml
It is a no-op if 'authid' is already present.
Administrators still need to rebuild the Elasticsearch index for the new
field to become queryable - this is noted with say_info at the end.
Test plan:
1 - On an existing instance without the patch: note there is no 'authid'
field under Administration > Search engine configuration (Elasticsearch)
for authorities.
2 - Apply the whole patchset.
3 - perl installer/data/mysql/updatedatabase.pl
4 - Re-check the search engine configuration: 'authid' appears for the
authorities index, mapped to 001 for both MARC flavours.
5 - Run the update again - confirm the "already exists, skipping" warning.
6 - misc/search_tools/rebuild_elasticsearch.pl -r -v -a
7 - Confirm a matching rule using index 'authid' now works.
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 3a3797f3f5)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
The previous POD follow-up added headings for the private helper subs but
introduced several typos and used =head2, which puts them at the same level
as the public API in the generated docs. This patch:
- Fixes typos: matchpint, pionts, march matcher, mathcpoints, etc.
- Clarifies a couple of descriptions.
- Demotes each private helper from =head2 to =head3 so they render as
implementation notes rather than peers of the public methods, matching
the pattern used in Koha::Authority's "Internal methods" block.
Helper subs remain interleaved with the public API in source order to keep
the diff minimal; a wholesale move into a dedicated "Internal functions"
section would be a larger refactor outside the scope of this bug.
Test plan:
1 - perldoc C4/Matcher.pm
2 - Confirm no typos are rendered and the private helpers appear one level
deeper than the public methods.
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 9f1ae44cc7)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>