Commit Graph

2800 Commits

Author SHA1 Message Date
Tomás Cohen Arazi 3f7c9f0f6c
Bug 40481: Fix OPAC MARC detail showing hidden items
The OPAC MARC detail view (opac-MARCdetail.pl) uses $record->fields()
to build the items table. This pulls item fields from the embedded MARC
record, bypassing the OPACHiddenItems filtering done by
filter_by_visible_in_opac.

This patch replaces the $record->fields() call with the already-filtered
$items resultset, converting each Koha::Item back to a MARC::Field via
as_marc_field.

Test plan:
1. Apply patch, do not restart plack yet
2. Setup:
   $ ktd --shell
  k$ koha-mysql kohadev <<< "UPDATE systempreferences SET value = 'damaged: [1]' WHERE variable = 'OpacHiddenItems';"
  k$ koha-mysql kohadev <<< "UPDATE items SET damaged = 1 WHERE biblionumber = 416 LIMIT 1;"
  k$ flush_memcached
3. Point your browser to the OPAC MARC detail view:
   http://kohadev.localhost/cgi-bin/koha/opac-MARCdetail.pl?biblionumber=416
=> FAIL: The damaged item is displayed in the items table
4. Restart plack:
  k$ restart_all
5. Refresh the page
=> SUCCESS: The damaged item is no longer displayed
6. Undo the test data:
  k$ koha-mysql kohadev <<< "UPDATE items SET damaged = 0 WHERE biblionumber = 416;"
  k$ koha-mysql kohadev <<< "UPDATE systempreferences SET value = '' WHERE variable = 'OpacHiddenItems';"
  k$ flush_memcached
7. Sign off :-D

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
2026-03-20 11:54:32 +00:00
David Cook 532d10a800
Bug 30261: Render opac 404 for opac/tracklinks.pl
This patch updates C4::Output::output_error to take
an additional argument which contains an "interface"
parameter, so that opac/tracklinks.pl can generate
an OPAC error instead of an Intranet error.

Test plan:
0. Apply patch and koha-plack --restart kohadev
1. Go to http://localhost:8081/test.pl
2. Note normal Intranet 404 error
3. Go to http://localhost:8080/cgi-bin/koha/tracklinks.pl?uri=https%3A%2F%2Ftest.com&biblionumber=29
4. Note normal Opac 404 error
4b. For extra points, note that tracklinks.pl returns a 404 instead of a 302 to the 404.pl page
5. Change 'TrackClicks' syspref to "Track"
6. Go to http://localhost:8080/cgi-bin/koha/tracklinks.pl?uri=https%3A%2F%2Ftest.com&biblionumber=29
7. Note normal Opac 404 error
7b. For extra points, note that tracklinks.pl returns a 404 instead of a 302 to the 404.pl page
8. Rejoice!

Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
2026-03-20 11:54:32 +00:00
Janusz Kaczmarek 194a3b4a9f
Bug 42020: (Bug 39482 follow-up) Library info link shown in OPAC without OpacLibraryInfo and library URL
Prior to Bug 39482 a link to library info modal (with (i) icon) was
generated only if OpacLibraryInfo was defined (cf. original Bug
29616). Now it is there even if there is no OpacLibraryInfo at all
and no URL defined for the library. It is generated in any
circumstances.

The test on $item->holding_branch->opac_info( { lang => $lang } ) in
opac-detail.pl now returns always true. This is because
Koha::Library::opac_info returns a RS now, and not an object, as it
was before (find_best_match --> search_for_display).

This patch restores the original behavior designed in Bug 29616.

Test plan:
1. Have a standard ktd installation.
2. Make sure there is no OpacLibraryInfo defined in HTML customizations.
3. Make sure there is no URL for any library.
4. In OPAC, perform any search. On a detail page you would see a link
   to an empty modal from the Current library items column.
5. Apply the patch ; restart_all.
6. Repeat p. 4. There should be no link generated now.
7. Extent the test to follow Bug 29616 logic:

A. One with both branches.branchurl and OpacLibraryInfo defined
B. One with branches.branchurl but no OpacLibraryInfo defined
C. One with OpacLibraryInfo defined but no branches.branchurl
D. One with neither branches.branchurl nor OpacLibraryInfo defined
(neither for a specific library, nor default one)

View the bibliographic detail page in the OPAC for title(s) which have
holdings from the libraries you configured above. In the holdings table,
check the behavior of the library name in the "Current library" or "Home
library" columns *

- Case A: The library name appears as a link with an "info" icon.
  Clicking it shows the library information in a modal window. In the
  modal footer, a "Visit web site" button should take you to the correct
  URL.
- Case B: The library name appears as a link without an icon. Clicking
  the link takes you to the correct URL.
- Case C: The library name appears as a link with an "info" icon.
  Clicking it shows the library information in a modal window. In the
  modal footer there is no "Visit web site" button.
- Case D: The library name is plain text.

* Display of "Current library" and/or "Home library" is controlled by
  the OpacLocationBranchToDisplay system preference.

Sponsored-by: Pontificia Università di San Tommaso d'Aquino (Angelicum)
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
2026-03-20 11:54:31 +00:00
David Cook 16c8d0d9a4
Bug 39055: Change "op" to "login_op" when logging in to allow original op to flow through
This patch changes "op" to "login_op" when logging in, so that the original op can
flow through to whichever controller is processing the login and subsequent op.

Test plan:
0. apply the patch and koha-plack --restart kohadev
1. Without logging in, go to the following:
http://localhost:8081/cgi-bin/koha/reports/guided_reports.pl?id=1&op=run
2. Log in and note that you can see the report
3. Try logging into the OPAC
4. Try logging into the self-checkout
5. Create a new self-reg account and try logging in with the auto-filled details
6. Test anything else you can think to test here

Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
2026-03-19 10:51:27 +00:00
Jonathan Druart a6009fbd0d
Bug 41582: Tidy kohaTable - opac-detail.tt
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-03-12 15:03:16 -06:00
Jonathan Druart 7fdf10b9ad
Bug 41558: Fix and standardize links to tab on opac-user
We have different implemented solution to select a tab on opac-user:
* a "tab" variable (from bug 37972), it's never used
* several variables passed from the controller to the template, depending on the tab to select (it works and is used)
* use of anchors (it does not work and is used)

We should fix and standardize it.

I've linked to several reports that seem to conflict with each others.

This patch suggests to have a "tab" variable

Test plan:
Confirm that the different links to tab to opac-user are not using a
query parameter to pass the tab to select, e.g. from the opac-main page.

Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-03-05 08:33:55 -07:00
Janusz Kaczmarek 184e966de4
Bug 41864: (Bug 40966 follow-up) Simple OPAC search generates warnings: Odd number of elements in anonymous hash
After introducing Bug 40966 opac-search.pl, when invoked in the
simple form (not as advanced search) generates warnings like:

[WARN] Odd number of elements in anonymous hash at /kohadevbox/koha/opac/opac-search.pl line 529.

Test plan:
==========
1. Perform a simple search from main OPAC page.
2. Check the content of plack-opac-error.log. You should see a
   warning like:
   [WARN] Odd number of elements in anonymous hash at /kohadevbox/koha/opac/opac-search.pl line 529.
3. Apply the patch ; restart_all.
4. Repeat p. 1. There should be no new warning now.

Sponsored-by: Ignatianum University in Cracow
Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-02-26 09:04:16 -07:00
Martin Renvoize f1b20b645c
Bug 3492: Modernize hold fee system and migrate to circulation rules
This commit completely modernizes the hold fee system by migrating from
the deprecated categories.reservefee column to the circulation rules framework
and implementing modern Koha::Objects patterns.

WHAT CHANGED:

1. MIGRATION TO CIRCULATION RULES:
   - Moved hold fees from categories.reservefee to circulation_rules table
   - Added database migration script with atomic update
   - Maintains existing fee amounts during migration
   - Provides rule hierarchy: category+itemtype+branch specific rules

2. NEW SYSTEM PREFERENCE: TitleHoldFeeStrategy
   - Options: highest, lowest, most_common
   - Addresses inconsistent title-level hold fees when items have different fees
   - Default: 'highest' (safest approach for library revenue)

3. MODERN Koha::Objects API:
   - Koha::Item->holds_fee($patron): Calculate fee for specific item
   - Koha::Hold->calculate_hold_fee(): Enhanced item/title-level logic
   - Koha::Hold->should_charge($stage): Centralized charging logic
   - Koha::Hold->charge_hold_fee(): Modern fee charging with proper accounting
   - Removed C4::Reserves::GetReserveFee and ChargeReserveFee

4. ENHANCED FUNCTIONALITY:
   - Proper ReservesControlBranch logic (patron home vs item home library)
   - Complete HoldFeeMode implementation (placement/collection/not_always)
   - Clear OPAC messaging with "You will be charged..." commitment
   - Comprehensive test coverage for all fee scenarios

5. TECHNICAL IMPROVEMENTS:
   - Object-oriented design following Koha patterns
   - Proper error handling and edge case management
   - Modern test structure with comprehensive coverage
   - Clean separation between fee calculation and charging

TEST PLAN:

A) MIGRATION AND SETUP:
   1. Apply all patches and run database update
   2. Verify existing hold fees migrated to circulation rules:
      - Administration > Circulation and fine rules
      - Previous categories.reservefee values now in "Hold fee" column
   3. Confirm old categories.reservefee column no longer used

B) BASIC FEE CALCULATION:
   1. Set up patron categories with different hold fees in circulation rules
   2. Create items with different item types, each with different hold fees
   3. Test item-level holds charge correct fees based on specific item
   4. Test title-level holds use TitleHoldFeeStrategy preference

C) TITLE-LEVEL HOLD STRATEGIES:
   1. Set TitleHoldFeeStrategy to "highest":
      - Create title with items having fees $1.00, $2.00, $3.00
      - Verify title-level holds charge $3.00
   2. Set TitleHoldFeeStrategy to "lowest":
      - Verify same title charges $1.00
   3. Set TitleHoldFeeStrategy to "most_common":
      - Add multiple items with $2.00 fee
      - Verify title-level holds charge $2.00 (most common)

D) HOLDFEEMODE PREFERENCES:
   1. Set HoldFeeMode to "any_time_is_placed":
      - Place holds and verify immediate fee charging
      - Check patron account for correct hold fee debits
   2. Set HoldFeeMode to "any_time_is_collected":
      - Place holds, verify no immediate charges
      - Check out items to patron, verify fee charged on collection
   3. Set HoldFeeMode to "not_always":
      - With available items: verify no fee charged
      - With all items checked out but no other holds: verify no fee
      - With all items checked out and other holds exist: verify fee charged

E) RULE HIERARCHY TESTING:
   1. Set different fees for different category/itemtype/branch combinations
   2. Verify most specific rule applies:
      - Branch + Category + ItemType (most specific)
      - Category + ItemType
      - Category only (most general)
   3. Test with different patron categories and item types

F) USER INTERFACE TESTING:
   1. OPAC interface:
      - Verify "You will be charged..." messages display correct amounts
      - Test both item-level and title-level hold fee messages
      - Confirm fees match actual charges in patron account
   2. Staff interface:
      - Place holds for patrons and verify fee calculations
      - Check Administration > Circulation rules interface works correctly

G) EDGE CASES AND ERROR HANDLING:
   1. Test $0.00 fees (no charge scenarios)
   2. Test patrons with no applicable fee rules (should default to $0.00)
   3. Test items with no holdable copies (should return $0.00)
   4. Test invalid/missing itemtypes or categories
   5. Test holds on biblios with no items

H) REGRESSION TESTING:
   1. Verify existing hold placement workflows unchanged
   2. Check patron account charging remains accurate
   3. Confirm OPAC and staff interfaces display correctly
   4. Test that existing holds continue to work properly

I) UNIT TESTS:
   Run the following test suites to verify functionality:
   - prove t/db_dependent/Koha/Hold.t
   - prove t/db_dependent/Koha/Item.t
   - prove t/db_dependent/Reserves.t
   - prove t/db_dependent/Circulation.t

BACKWARDS COMPATIBILITY:
- All existing functionality preserved
- Hold fee amounts maintained during migration
- Existing workflows continue unchanged
- Legacy code updated to use new API seamlessly

Sponsored-by: OpenFifth <https://openfifth.co.uk>
Signed-off-by: Jackie Usher <jackie.usher@westsussex.gov.uk>
Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-02-09 12:57:56 -07:00
Tomás Cohen Arazi 402a251392
Bug 40966: Make sure 'whole_record' and 'weighted_fields' are passed around
The ES query builder correctly handles this parameters (passed from
search.pl and opac-search.pl) when it builds the ES query. But the
returned 'query_cgi' that is used later for keeping the search results
query context for building things like facets, just doesn't pass this
values around, leading to a loss of them on the generated links.

This patch makes sure they are passed around.

To test:

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

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-02-06 15:17:17 -07:00
Pedro Amorim afaee3651b
Bug 41204: Fallback to Standard earlier
The fallback to 'Standard' if 'FreeForm' needs to happen earlier in the code, before other backend checks are performed

Test plan, before applying patch:
1) Enabled ILLModule
2) Login to OPAC and access a FreeForm URL directly:
<opac_url>/cgi-bin/koha/opac-illrequests.pl?backend=FreeForm&op=add_form
3) Notice you get a 404. Apply patch and restart plack.
4) Repeat 2) Notice you get the 'Standard' form as expected. Create the ILL request. It's created as a 'Standard' request.

Signed-off-by: Leo O’Neill <leo.o’neill@uwl.ac.uk>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-02-06 15:17:15 -07:00
Hammat Wele 1838b1c4a0
Bug 41655: Local OPAC covers are not displayed in OPAC lists
Local cover images are no longer displayed in OPAC lists since Bug 41078.
In Koha versions prior to 25.05.05, local cover images were correctly displayed in OPAC lists.

This appears to be a regression.

To reproduce

1. Set the system preferences LocalCoverImages and OPACLocalCoverImages to Show.

2. Find a bibliographic record and open the record detail page.

3. Upload a local cover image file for the record.

4. Create a public list and add the record to the list.

5. In the OPAC, open the public list.
   --> The local cover image is missing.

6. Apply the patch.

7. Reload the OPAC list page.
   --> The local cover image is now displayed correctly.

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Laura_Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-02-06 15:17:14 -07:00
Jonathan Druart 849f67988f
Bug 41076: Adjust our perl tidiness for v20250105
Generated using
  `perl misc/devel/tidy.pl --perl`

Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-02-05 09:03:51 -07:00
David Cook c3169205ec
Bug 41662: Prevent CSRF on opac-patron-consent.pl
This change prevents CSRF on opac-patron-consent.pl by
adding checking of the "op".

Test plan:
0. Apply the patch and koha-plack --restart kohadev
1. Set system preference PrivacyPolicyConsent to "permissive"
2. Log into the OPAC and go to this path:
/cgi-bin/koha/opac-patron-consent.pl?check_GDPR_PROCESSING=1
3. Note that it doesn't change the consent
4. Go to this path:
/cgi-bin/koha/opac-patron-consent.pl?check_GDPR_PROCESSING=0
5. Note that it doesn't change the consent
6. Click the "Yes" radio button and click "Save"
7. Note it changes the consent to Yes
8. Click the "No" radio button and click "Save"
9. Note it changes the consent to No

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-01-29 15:11:21 -07:00
Pedro Amorim 63d1023317
Bug 41237: (QA follow-up): Utilize available logged in user object
Instead of re-fetching the patron object.

This also adjusts tests:
prove t/db_dependent/Koha/ILL/Requests.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-01-21 07:44:21 -07:00
Pedro Amorim ee348649a2
Bug 41237: Update fetch of patron's branchcode to search additional_contents by
Signed-off-by: Stephen Graham <s.graham4@herts.ac.uk>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-01-21 07:44:20 -07:00
Lari Taskula 61dc0bd36d
Bug 32483: Add OPAC notification on pending patron modification request
To test:
1. Apply patch
2. In OPAC, submit updates to your patron details under "Personal
   details"
3. Navigate back to "Personal details"
4. Observe text "Your have recently submitted updates to your personal
   details. A librarian will review your updates before applying them."
5. In staff client, approve modification changes
6. Navigate back to OPAC "Personal details"
7. Observe the notification has disappeared

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Laura_Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-01-13 15:03:12 -07:00
Owen Leonard bfa29d0dc0
Bug 39482: Correct the link to edit OpacLibraryInfo from library edit page
When editing a library which has an associated OpacLibraryInfo HTML
customization the "Edit HTML content" link passes the wrong id
parameter.

To test, apply the patch and restart services.

- Rebuild OPAC CSS.
- Go to Administration -> Libraries.
- Edit a library.
- If there is no OpacLibraryInfo customization associated with that
  library, add at least two OpacLibraryInfo entries and then return to
  the library edit form.
- By the "OPAC information" label you should see all of the
  OpacLibraryInfo entries you added for that library.
- If you have permission to edit HTML customizations you should see
  an edit link.
- Test each to confirm that it opens the correct entry for editing.
- Return to Administration -> Libraries and click the library name to
  view it (rather than edit).
- The correct HTML customizations should appear. If you have permission
  to edit HTML customizations you should see corresponding "Edit" links.
- Test each to confirm that it opens the correct entry for editing.

- In the OPAC, locate a bibliographic record which has one or more items
  from the library you added OpacLibraryInfo to.
- In the holdings table, click the one of the library links to trigger
  the info modal.
- Confirm that all the correct information displays.
- Go to "Libraries" link in the menu under the quick search bar.
- Click the library you modified. Confirm that the correct
  OpacLibraryInfo entries display.

Sponsored-by: Athens County Public Libraries
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-12-29 09:56:16 -07:00
Matt Blenkinsop d3f94c0098
Bug 40082: Use the new duplicate checking method in the OPAC
Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>

Signed-off-by: Pamela Bird <pbird@cityofchesapeake.net>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-12-01 12:53:44 -07:00
David Cook 5908412f34
Bug 18148: Make list of lists in OPAC sortable
This patch adds sorting to lists of lists in the OPAC.

The mechanism used here for op=list is similar to the one
used in op=view, so it's stylistically and functionally
consistent with the rest of the Lists module in the OPAC.

Test plan:
0. Apply the patch and restart Plack (ie koha-plack --restart kohadev)
1. Create 20+ public lists and 20+ private lists for a particular user
you control (try to use names that range throughout the alphabet)
2. Using SQL, update the Modification date for at least 1 public
list and 1 private list
3. As an anonymous (ie not logged in user), go to
/cgi-bin/koha/opac-shelves.pl?op=list&public=0
4. Note you cannot see any lists
5. Go to http://localhost:8080/cgi-bin/koha/opac-shelves.pl?op=list&public=1
6, Note you can see public lists with a toolbar with the button "Sort"
below the alert "Log in to create a new list"
7. Using the "Sort" option, try out all the different sort options
for default, "List name", and "Modification date"
8. After sorting, try paging through the list of lists. You should
note that the sorting is retained through the paging.
9. prove t/db_dependent/Virtualshelves.t
10. Celebrate!

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Laura_Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-11-05 07:12:35 -07:00
Pedro Amorim 07275db04f
Bug 40517: Move creation of hold group into Patron class. Add exceptions
Refactor: Update controller logic to make use of patron->create_hold_group

This ensures consistency when creating a new hold group for a patron,
regardless if on the Staff UI or REST API

Signed-off-by: Anneli <anneli.osterman@koha-suomi.fi>
Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-10-29 11:50:07 -06:00
Pedro Amorim 2d063d00d5
Bug 41057: Return 404 if creating backend is not an OPAC backend
Test plan, ktd:
1) Enable ILLModule
2) Install an additional backend plugin e.g. 'RapidILL':
  https://github.com/openfifth/koha-ill-rapidill/releases/tag/v2.2.5
3) Restart plack if you have to:
$ koha-plack --restart kohadev
4) Edit the ILLOpacbackends system preference to just 'Standard'.
5) Now, attempt to create a request with the installed backend directly:
  <opac_url>/cgi-bin/koha/opac-illrequests.pl?op=add_form&backend=RapidILL
6) Notice the form is shown. It shouldn't be, as the only OPAC back is Standard.
7) Apply patch. Repeat. You get a 404.

Signed-off-by: Nial Halford-Busby <n.halford-busby@lboro.ac.uk>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-10-24 07:56:58 -06:00
Marcel de Rooy 0562121424
Bug 28146: Respect ReplytoDefault in error pages
Test plan:
Fill ReplytoDefault.
Check an error page on OPAC and intranet.
Verify that the send mail link refers to that email address.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-10-09 14:58:41 -06:00
Marcel de Rooy 013a469b45
Bug 40929: Add $hold test in opac-modrequest
Test plan:
Login at OPAC.
Pass an unexisting reserve_id in a opac-modrequest.pl URL.
Verify that you get a 403 redirect.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-10-06 09:15:19 -06:00
Nick Clemens 18fba45afd
Bug 34596: Add rebuild queue where needed for existing calls to AddReturn
Existing calls to AddReturn:

C4/Circulation.pm
 - transferbook - calls ModDateLastSeen, queue is rebuilt
 - AddIssue - rebuild not needed, book is going out again immediately

C4/SIP/ILS/Transaction/Checkin.pm
 - do_checkin - added

Koha/Checkouts.pm
 - automatic_checkin - added

circ/circulation.pl
 - called in stats checkout, not needed

circ/returns.pl
 - added

opac/sci/sci-main.pl
- added

svc/checkin
 - added

svc/recall
 - wasn't actually called, removed the use statement

tools/inventory.pl
 - added

Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-10-06 09:15:17 -06:00
Tomas Cohen Arazi 844c2c6209
Bug 38936: Use redirect_if_opac_suppressed() in opac-*detail.pl pages
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-09-29 14:02:23 -06:00
Tomás Cohen Arazi cd44d6e430
Bug 40872: (follow-up) Tidy opac/unapi
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-09-24 09:25:06 -06:00
Tomás Cohen Arazi 6b478e0da9
Bug 40163: (follow-up) Fix wrong GNU links and update test
Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-09-24 09:25:04 -06:00
Tomás Cohen Arazi 059d5d569b
Bug 40262: (follow-up) Refactor copyright clearance to use dedicated methods
This patch refactors the copyright clearance confirmation functionality
to follow proper separation of concerns by moving business logic from
the controller to the model.

Changes:
- Add set_copyright_clearance_confirmed() method to Koha::ILL::Request
- Add get_copyright_clearance_confirmed() method to Koha::ILL::Request
- Update controller to use dedicated method instead of direct attribute manipulation
- Update staff template to use the new dedicated accessor method
- Add comprehensive test coverage for both methods

Benefits:
- Improved separation of concerns (business logic in model)
- Consistency with existing patterns (get_type, get_type_disclaimer_value)
- Better reusability and testability
- Centralized attribute name management

Test plan:
1. Apply patch
2. Run:
   $ ktd --shell
  k$ prove t/db_dependent/Koha/ILL/Request.t
=> SUCCESS: Tests pass! New methods work correctly
3. Test ILL copyright clearance workflow still works:
   - Enable ILLModule
   - Create HTML customization for ILLModuleCopyrightClearance
   - Create OPAC ILL request with copyright clearance
   - Verify confirmation is saved and displayed in staff interface
4. Sign off :-D

Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io>

PA amended: Test file name in commit message

Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-09-23 16:21:31 -06:00
Pedro Amorim e8cc5a8d2f
Bug 40262: (QA follow-up): Fix compatibility with ILLOpacUnauthenticatedRequest
This patch fixes the copyrightclearance_confirmed not saving if submitting an unauthenticated ILL request.

Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-09-23 16:21:31 -06:00
Pedro Amorim d572cdebcc
Bug 40262: Save and display copyrightclearance_confirmed
Test plan, k-t-d:
1) Enable ILLModule
2) Add a new HTML customization, visit:
<staff_url>/cgi-bin/koha/tools/additional-contents.pl?op=add_form&category=html_customizations&editmode=wysiwyg
3) Pick ILLModuleCopyrightClearance as the 'Display location'
4) Pick a 'Publication date' in the past
5) Add a title and content. Save.
6) Create a new ILL request in the OPAC, visit:
<opac_url>/cgi-bin/koha/opac-illrequests.pl?op=add_form&backend=Standard
7) Notice the copyright clearance step is shown. Click 'Yes'.
8) Enter a 'type' and (optionally) some metadata. Click 'Create'.
9) Go back to the module in Staff UI and pick the request just created through the OPAC, visit:
<staff_url>/cgi-bin/koha/ill/ill-requests.pl
10) Notice the message 'Patron has confirmed copyright clearance for this request' is shown next to the patron in the the request details

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-09-23 16:21:30 -06:00
Tomas Cohen Arazi 1873d97c07
Bug 40163: Fix several http addresses in the code docs
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-09-23 16:21:29 -06:00
Marcel de Rooy 60b1cf95c4
Bug 40585: Check on Biblios->find in addbybiblionumber scripts
Just jumping to the next biblionumber (and adding found biblio recs) is
more user friendly than crashing without any further clarification to
the user.
Note that this should be a rare exception when the URL is not manipulated
(someone deleting a biblio while another wants to add it to a list).
For another bug: The template is not designed to handle the situation that
no biblio is found at all.

Test plan:
Select a biblio to add to a list and add a not-existent biblionumber
to the URL.
Without this patch, that URL will crash. With this patch, it will
silently ignore a wrong biblionumber.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-09-19 08:42:46 -06:00
Tomas Cohen Arazi cd4e1da3ec
Bug 40275: Use Koha::Patrons->find_by_identifier in the codebase
Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-09-03 14:00:46 -06:00
Martin Renvoize 5350a9276e
Bug 9762: (Alternative) Log circulation overrides
An alternative approach to the original submission for bug 9762. Instead
of recording a distinct action log line for a set of override messages
in addition to the standard issue record, this patch updates the
existing issue log to include any confirmation or impossible responses
from the preceeding CanBookBeIssued call.

We continue to record these as a JSON structure as the prior patch did,
but instead of human messages we use the predefined codes as returned
from the existing CanBookBeIssued response.

To test:

After each step, a single action log message should be displayed under
`Tools > Log viewer`. The message itself will now consist of a JSON
string with an array of 'confirmations' and 'forced' strings
representing the overriden feedback from CanBookBeIssued.

Circulation -- Checking out

1) Check out an item that is age-restricted (AgeRestrictionOverride syspref)
2) Check out an item that has a “not for loan” status (AllowNotForLoanOverride
   syspref)
3) Check out an item that has a “lost” status (IssueLostItem syspref)
4) Check out an item to a patron who has reached the checkout limit
   (AllowTooManyOverride syspref)
5) Check out an item to a patron who is not allowed to borrow this item type
6) Check out an item to a patron who has unpaid fines (AllFinesNeedOverride
   and/or AllowFineOverride + noissuescharge sysprefs)
7) Check out an item on hold for someone else
8) Check out an item on hold ready for pickup by someone else
9) Check out an item already checked out to someone else
   (AutoReturnCheckedOutItems syspref)
10) Check out to a patron who has restrictions

Circulation -- Checking in

11) Ignore a hold upon check in
12) Ignore a hold and transfer upon check in

Circulation – Renewing

13) Renew an item on hold for someone else
    (AllowRenewalOnHoldOverride syspref)
14) Renew an item that has reached the maximum number of renewals
    (AllowRenewalLimitOverride syspref)

Holds

15) Place a hold for a patron who is not allowed to place this item
    type on hold (AllowHoldPolicyOverride syspref)
16) Place a hold for a patron who has reached the maximum number of
    holds
17) Place an item-level hold when rules dictate that this is not
    allowed

Sponsored-by: OpenFifth <https://openfifth.co.uk/>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-09-03 11:42:10 -06:00
David Cook c1e7da6eed
Bug 15516: (follow-up) Tweaks to new feature
Bug 15516: Add ability to create and view hold groups from OPAC

This patch adds a "Treat as hold group" to opac-reserve.pl,
which lets OPAC users create a hold group which can include
1+ bibs and either bib-level holds, or item-level holds, or both.

This patch shows the item-level and bib-level holds in a hold group
for the user's holds in the OPAC. This includes both the opac-user.pl
page and the self-checkout hold display.

Bug 15516: (follow-up) Only show hold groups for multi hold in OPAC
Bug 15516: (follow-up) Only show hold groups for multi hold in staff interface
Bug 15516: Add 'DisplayAddHoldGroups' system preference to toggle ability to add titles to hold groups

These patches add the ability to create hold groups across multiple bibs in the staff interface or OPAC.
These hold groups are fulfilled by the first item checked in across the hold group.

Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-09-03 11:42:01 -06:00
Aleisha Amohia 559801d408
Bug 15516: Allow to reserve first available item from a group of titles
It can be useful, for instance, if a library has the same title from
different publishers (so 1 title but several biblio records) but the
user only wants a copy of the book, regardless of the publisher.

Test plan:
0. Run updatedatabase.pl and misc/devel/update_dbix_class_files.pl
1. Go to intranet search, display some results, click on some checkboxes
and click on 'Place hold' button at the top of the results.
2. Search for a patron
3. Check the 'Treat as hold group' checkbox
4. Click on 'Place hold'
5. In the next screen you should see all the holds you placed with the
additional text '(part of a hold group)' in Details column.
6. Click on the "hold group" link. A modal window should appear with
the content of the hold group (a list of holds)
7. Check in an item of one of the reserved biblios and confirm the hold
8. The hold status is changed to Waiting, and all other holds are deleted.
The other holds will also be removed from the holds queue.
9. Confirm tests pass
- t/db_dependent/Koha/Holds.t
- t/db_dependent/Reserves/HoldGroup.t
Note: the "hold group" link is displayed in the following pages:
- reserve/request.pl
- circ/circulation.pl
- members/moremember.pl
- circ/pendingreserves.pl
- circ/view_holdsqueue.pl
Note: A hold group is counted as only one hold

Sponsored-by: Catalyst IT

Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>

Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-09-03 11:42:00 -06:00
Lucas Gass 45a4f81830
Revert "Bug 39482: Correct the link to edit OpacLibraryInfo from library edit page"
This reverts commit 699ea73a93.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-08-20 15:57:00 -06:00
Owen Leonard 699ea73a93
Bug 39482: Correct the link to edit OpacLibraryInfo from library edit page
When editing a library which has an associated OpacLibraryInfo HTML
customization the "Edit HTML content" link passes the wrong id
parameter.

To test, apply the patch and restart services.

- Rebuild OPAC CSS.
- Go to Administration -> Libraries.
- Edit a library.
- If there is no OpacLibraryInfo customization associated with that
  library, add at least two OpacLibraryInfo entries and then return to
  the library edit form.
- By the "OPAC information" label you should see all of the
  OpacLibraryInfo entries you added for that library.
- If you have permission to edit HTML customizations you should see
  an edit link.
- Test each to confirm that it opens the correct entry for editing.
- Return to Administration -> Libraries and click the library name to
  view it (rather than edit).
- The correct HTML customizations should appear. If you have permission
  to edit HTML customizations you should see corresponding "Edit" links.
- Test each to confirm that it opens the correct entry for editing.

- In the OPAC, locate a bibliographic record which has one or more items
  from the library you added OpacLibraryInfo to.
- In the holdings table, click the one of the library links to trigger
  the info modal.
- Confirm that all the correct information displays.
- Go to "Libraries" link in the menu under the quick search bar.
- Click the library you modified. Confirm that the correct
  OpacLibraryInfo entries display.

Sponsored-by: Athens County Public Libraries
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-08-20 12:53:41 -06:00
Pedro Amorim 9657c19608
Bug 40075: Only show pickup_location libraries in OPAC
And list alphabetically on branchname

Signed-off by: Chris Rowlands <chris.rowlands6@nhs.net>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-08-01 13:22:48 -06:00
Eric Garcia 9517a57ee2
Bug 40143: Added links to private lists in bibliographic record detail page in OPAC
Test Plan:
1. In OPAC create a public list, add a book to the list.
2. Notice a link to the list on the biblio's detail page.
3. Create a private list and add the book to it. Notice there is no link to the list in the details page.
4. Apply patch, restart_all
5. Notice there is now a link to the private list

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>
2025-07-28 16:26:44 -06:00
Jonathan Druart bb71c19635
Bug 38102: Fix default sort order
DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception:
DBD::mysql::st execute failed: Unknown column 'date_due desc' in 'order
clause' at /kohadevbox/koha/Koha/Objects.pm line 401

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-07-18 11:09:53 -06:00
Jonathan Druart dd28d473cd
Bug 38102: Fix limit to 50 items in the checkout history - OPAC
Checkout history does not limit to 50 items, it's a regression from bug
33949.

To limit to 50 items we need to use "rows", not "limit".

Test plan:
Have more than 50 checkouts and confirm that by default the table only
displays 50 entries.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-07-18 11:09:53 -06:00
Lucas Gass a827e5dbe3
Revert "Bug 36586: Define self-checkin timer using Javascript class"
This reverts commit ff403dcfb3.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-07-10 09:43:18 -06:00
PhilipOrr 9516fe517c
Bug 39498: Correct patron restrictions displays
This patch updates the way patron restrictions are displayed in the OPAC
and staff interface, with the intention of making the details of each
restriction more clear. In the OPAC, a new include file is created to be
reused on the holds page and the user summary page. opac-user.pl is
updated to allow a parameter to be passed to automatically open the
"Overdues" tab.

Test plan:
1. Before applying the patch, check how the display is currently. First
   set syspref PatronRestrictionTypes to "Allow"
2. Add two different new restriction types, fill out both "Code" and
   "Label"
3. Go to a patron's checkout page and add one of each of these
   restrictions, but do not fill out the comment field when adding them!
4. Observe that in the checkouts page and details page of the patron, it
   just says "Restricted since..." and does not show the restriction
   types.
5. Add another restriction, this time fill out the comment field
6. Observe that now in checkout and detail pages, the labels from the
   restriction types are listed and the comment shown.
7. Apply patch
8. Go to patron's details and checkout pages and check the restrictions
   are now displayed correctly, that is the text "with the explanation"
   is only shown for the restrictions that actually have a comment
   8b. Log in to the OPAC with that patron and check they are displayed
       correctly in their summary page and when the patron is trying to
       place a hold.
9. Go to a different patron's account and add a restriction without a
   comment
10. Check it is now displayed correctly
11. Add more restrictions and check they are displayed correctly. Also
    add an OVERDUES restriction:
    11a. Find a patron with an overdue item checked out (or create an
         overdue checkout on a patron's account)
    11b. Go to Tools -> Overdue notice/status triggers
    11c. Set up a rule for that patron's category, e.g. "First" ->
         Delay: 1, make sure to mark the check box for "Restrict" and
         "Print"
    11d. Run misc/cronjobs/overdue_notices.pl
    11e. That patron should now also have an OVERDUES restriction
12. Turn PatronRestrictionTypes off again and check the patrons if
    everything is still displayed correctly
13. Go to another different patron and add a restriction with no
    comment, check if it is displayed correctly
14. Add another restriction with a comment and check it is displayed
    correctly
15. Log in to the OPAC with the patron that had OVERDUES restriction and
    check they are displayed correctly in their summary page and when
    the patron is trying to place a hold.
16. Same thing for the other patron without the OVERDUES restriction.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-06-26 11:10:05 -06:00
Tomas Cohen Arazi 33032f99a8
Bug 40101: Make opac-reserve.pl use `$patron->can_place_holds()`
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kristi Krueger <kkrueger@cuyahogalibrary.org>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-06-26 11:10:03 -06:00
Andreas Jonsson 04ebdd4ac1
Bug 38974: Fix error in OPAC patron update
Test plan:

1) Make sure Patron category is checked in the system preference PatronSelfModificationBorrowerUnwantedField
2) Log in to the opac
3) Go to "Personal details"
4) Select any value for "Date of birth"
5) Click save
6) This must not yield error 500. (But may be a successful save or a validation error).

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-06-06 09:41:18 -06:00
Jonathan Druart 492e6814a1
Bug 39834: Replace some tabs with spaces
In order to remove false positives with the QA script we should replace some tabs with spaces.

There are more but I wanted to make sure no regression would be
introduced

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-06-02 15:26:17 -06:00
Matt Blenkinsop 84076d5169
Bug 30301: Update templates
Signed-off-by: Hanna Leiker <tech.hanna@salinapublic.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-05-19 18:54:30 +02:00
Baptiste Wojtkowski e398743e06
Bug 39148: Correct sort by publicationdate in OPAC lists
Test plan (UNIMARC):
1 - Create a list with different publicationdates, chose to sort it by
  copyright gate
2 - Go to the list in the OPAC -> it is not correctly sorted
3 - Pick sort order: copyright date -> not correctly sorted
4 - Apply patch
5 - Retry 2&3 and see it works

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-05-12 18:31:23 +02:00
Fridolin Somers cef1685925
Bug 39737: Obsolete call on system preference 'PatronSelfRegistrationAdditionalInstructions'
Bug 34889 moved to additional contents.
Remove call in opac pages.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-05-12 18:31:22 +02:00
Fridolin Somers a210683610
Bug 39736: Remove obsolete call on system preference 'OPACResultsSidebar'
Bug 34869 moved additional contents.
Remove call in opac/opac-search.pl

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-05-12 18:31:22 +02:00
Alexander Blanchard 1f6e2c8f3c
Bug 39579: Restrict Patron Self Reg Date of Birth
Some libraries are getting dates of birth from the
self-registration form that make patrons impossible
ages, e.g. year of birth 1900.

To Test:
1) Navigate to the oPac
2) Ensure you are not logged in
3) Below the log in, see 'Create an Account'
4) Click the link and complete the relevant fields
5) Add an unrealistic d.o.b e.g 1900
6) Complete the verification and click 'Submit'
7) Your acount has been created
8) Apply the patch
9) Navigate to the staff site
10) Navigate to Administration > SystemPreferences
11) Navigate to OPAC preferences
12) Identify PatronSelfRegistrationAgeRestriction
13) Add a maximum age in numberals e.g. 100
14) Repeat steps 1 - 6
15) An error message that you have exceeded max age will appear.
16) Alter your date of birth to make your age below that of the max age you set
17) Complete the verification
18) Your account should be created as normal

Sponsored-by: Cheshire
Signed-off-by: Emmanuel Bétemps <e.betemps@gmail.com>
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-05-08 08:49:55 +02:00
David Cook ff403dcfb3
Bug 36586: Define self-checkin timer using Javascript class
This patch rewrites the self-checkin timer code to be defined in a
Javascript class which is then instantiated in once in sci-main.pl
depending on certain conditions (ie a barcode has been entered, or
an item has been checked in by barcode).

To test:
1 - Set SelfCheckinTimeout to a small value like 5
2 - Go to the self checkin:
    http://localhost:8080/cgi-bin/koha/sci/sci-main.pl
3 - Sign in as the SCI user
4 - Watch the page, it should refresh every 5 seconds
5 - Confirm that moving the mouse/typing prevents the reset
6 - Check in an item
7 - Wait and confirm reload of main page happens when idle
8 - Confirm mouse/typing prevents refresh
9 - Sign off!

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>

Bug 36586: Add sc-timer to sco

This patch implements the timer form the last patch on the sco

To test:
1 - Set SelfCheckTimout to 5 or something low for testing
2 - Go to the self checkout module
3 - Either sign in or confirm you have AutoSelfCheck user setup
4 - Observe the page reloads every 5 seocnds (or as you set above)
5 - Sign in as a patron
6 - Confirm on idle you are logged out to home page
7 - Sign off!

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>

Bug 36586: Fix tidy

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-05-08 07:59:09 +02:00
Fridolin Somers 0a32b7371f
Bug 39735: Fix typo in system preference call 'OPACFineNoRenewalsIncludeCredit'
Typo in system preference call 'OPACFineNoRenewalsIncludeCredit'
=> 'OPACFineNoRenewalsIncludeCredits'

Test plan :
Run : prove t/db_dependent/Circulation.t
Run test plan of Bug 23293

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-05-07 14:29:53 +02:00
Fridolin Somers 49e852e0a8
Bug 39738: Obsolete call on system preference 'SelfCheckHelpMessage'
Bug 35065 moved to additional contents.
Remove call in opac/sco/help.pl.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-05-02 08:49:24 +02:00
Nick Clemens 3f649cfed7
Bug 36867: (follow-up) Don't check IP if ILS-DI disabled
When ILS-DI is disabled we still expect to return the correct service name/section in the
xml, but just indicate that it is disabled.

We should skip the check for authorized IPs in this case, as the IP only matters when service is enabled

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-05-02 08:49:17 +02:00
Pedro Amorim f9a97918bc
Bug 38441: ILLHistoryCheck: OPAC
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-04-28 18:51:36 +02:00
Jonathan Druart 69b8341a8c
Bug 39325: Manual fixes
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-04-28 18:51:23 +02:00
Jonathan Druart 1d844a7d2f
Bug 39325: Automatic fix
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-04-28 18:51:22 +02:00
Nick Clemens b6763d622e
Bug 36867: Do not allow access to ILS-DI for IPs not explicitly listed in ILS-DI:AuthorizedIPs
This patch forces a check of authorized IPs against the Koha system preference, if nothing is present, no access is allowed

To test:
 1 - Enable ILS-DI, leave  ILS-DI:AuthorizedIPs blank
 2 - In another window:
    http://localhost:8080/cgi-bin/koha/ilsdi.pl?service=GetAvailability&id=1+2+99999&id_type=item
 3 - You get a response
 4 - Apply patch and restart all
 5 - Reload ilsdi page, 'Not authorized'
 6 - Copy the IP listed as refused and paste into ILS-DI:AuthorizedIPs
 7 - Reload the page, you get a response again
 8 - Change ILS-DI:AuthorizedIPs to:
    0:0:0:0/0
 9 - You still have access
10 - Paste your specific IP again, and add a second made up IP (comma separated)
11 - Reload and confirm you still have access

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-04-28 18:51:19 +02:00
Jonathan Druart 77a53e2c6f
Bug 38969: Prevent JS error when adding tags with quote at the OPAC
Uncaught SyntaxError: missing ) after argument list

There are way more to fix in this controller...

Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-04-28 18:51:17 +02:00
Tadeusz „tadzik” Sośnierz a715c695f7
Bug 39600: Cleanup the changes -- tidy, document, add a missing TT filter
Sponsored-by: Wiko <https://www.wiko-berlin.de/>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-04-25 19:23:40 +02:00
Tadeusz „tadzik” Sośnierz 44743bc3c7
Bug 39600: Switch OPAC ILL request listing to server-side rendering
This brings it technologically closer to intranet's ILL table and also enables pagination.

Test plan:

1. In KTD, go to http://localhost:8081/cgi-bin/koha/admin/preferences.pl?tab=&op=search&searchfield=master+switch and enable the ILL module
2. Run the following in koha-shell to populate the request list for user `koha`:

    perl -Mt::lib::TestBuilder -e '
      my $builder = t::lib::TestBuilder->new;

      do {
        $builder->build_sample_ill_request({borrowernumber => 51});
      } for (1..50);
    '
3. Navigate to http://localhost:8080/cgi-bin/koha/opac-illrequests.pl, log in as `koha` as needed
4. Observe the new request list being paginated and server-side-sortable

Sponsored-by: Wiko <https://www.wiko-berlin.de/>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-04-25 19:23:38 +02:00
Pedro Amorim 8c35c83272
Bug 36197: (QA follow-up): Adopt POST REDIRECT GET pattern
Upon submitting the unauthenticated request, the user is now redirected to a different page and the request details are passed through a session variable. This is to prevent the user from being able to resubmit the same unauthenticated request multiple times (see security bug 39611)

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-04-25 08:47:11 +02:00
Pedro Amorim e677ba112f
Bug 36197: (QA follow-up): Add public form captcha
Feedback provided by David Cook + Matthias Meusburger at KohaCon24

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-04-25 08:47:11 +02:00
Pedro Amorim ce3b8e0b0c
Bug 36197: (QA follow-up): Pass the filtered OPAC backends to OPAC template
The list of backends in the dropdown in this page:
http://localhost:8080/cgi-bin/koha/opac-illrequests.pl?op=create

If unauthenticated is enabled, this is listing all backends, instead of
making use of opac_available_backends.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-04-25 08:47:08 +02:00
Pedro Amorim d5198e5c49
Bug 36197: Only add cardnumber info to request is a user is logged in
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-04-25 08:47:05 +02:00
Pedro Amorim e55d647184
Bug 36197: Make authentication not required if conditions are met
/cgi-bin/koha/opac-illrequests.pl was an authrequired page
Now, its authnotrequired if creating or viewing an unauthenticated
request

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-04-25 08:47:04 +02:00
Pedro Amorim 0ee5fdd8af
Bug 36197: OPAC unauthenticated screen
unauth_view to show request details after its been submitted

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-04-25 08:47:03 +02:00
Pedro Amorim 2eff8bb298
Bug 36197: Refactor -> opac_available_backends method
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-04-25 08:47:01 +02:00
Pedro Amorim b3777fbbcb
Bug 36197: Consider unauthenticated_ill in 'Standard' create form
This also makes sure an empty left side bar exists for opac unauthenticated screens

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-04-25 08:47:00 +02:00
Jonathan Druart 5e2eea4e2b
Bug 39365: Fix 3 files
Those 3 were failing but an easy fix can make them pass

Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-04-23 09:35:18 +02:00
Marcel de Rooy 81359cc8a6
Bug 39485: Fix wide character in print-warn in opac-export
Similar change in intranet counterpart: catalogue/export.

Test plan:
Verify no warning anymore when using ris or isbd when record
contains specific Unicode character(s).

Signed-off-by: Magnus Enger <magnus@libriotech.no>
I could not trigger "Wide character" for RIS in the OPAC, but for
ISBD I can see it removes that warning.
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-04-23 09:35:13 +02:00
David Cook 8e9a3d851d
Bug 39374: Add feature to block sending of lists from OPAC
This change adds a system preference OPACDisableSendList which
disables the ability to send lists from the OPAC, and hides the
"Send list" link on the opac-shelves.pl page.

This is useful in situations where you do not want OPAC users to be
able to generate emails to arbitrary addresses with arbitrary comments.

Test plan:
0. Apply the patch and koha-plack --restart kohadev
1. Create a public list with at least one record and view it in the OPAC
2. Click "Send list" and note you can fill out boxes for "Email address"
and "Comment"
3. Change syspref OPACDisableSendList to "Don't allow" and click "Send list"
again
4. Note the popup window now says "You do not have permission to send this list."
5. Reload the list web page and notice "Send list" no longer appears on the toolbar
next to "Print list"

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-04-22 08:46:39 +02:00
Baptiste Wojtkowski 438137ebf6
Bug 14250: (QA follow-up) Small changes
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
[EDIT] Changed commit title. Tidied opac script.
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-04-22 08:46:26 +02:00
Baptiste Wojtkowski 2fcb2145c2
Bug 14250: Patron with fines cannot be discharged anymore
TEST PLAN:
1 - In the intranet add fines to a client and ensure they have no checkout
2 - Set syspref useDischarge to 'Allow'
3 - On client profile click on "Discharge", see it is possible
4 - On the opac, go to the tab "Ask for discharge", see it is possible
5 - Apply patch
6 - Click on the button "Ask for discharge" -> it will not be possible
  and you will be propperly messaged
7 - Return to the tab "Ask for a discharge", there will be no button
  anymore
8 - On the intranet page, there will be no button anymore
9 - Check out a book
10 - Repeat 7 and 8 and see the message include issue with checkout
11 - Remove fine and repeat 7 & 8

Bug 14250: (QA follow-up) Deduplicate checks

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Bug 14250: (follow-up) Update messages

Update the text for the reasons the patron cannot be discharged.

Bug 14250: (follow-up) Refacto the algorithm for discharge messages

TEST PLAN:
1 - In the intranet add fines to a client and ensure they have no checkout
2 - Set syspref useDischarge to 'Allow'
3 - On client profile click on "Discharge", see it is possible
4 - On the opac, go to the tab "Ask for discharge", see it is possible
5 - Apply patch
6 - Click on the button "Ask for discharge" -> it will not be possible
  and you will be propperly messaged
7 - Return to the tab "Ask for a discharge", there will be no button
  anymore
8 - On the intranet page, there will be no button anymore
9 - Check out a book
10 - Repeat 7 and 8 and see the message include issue with checkout
11 - Remove fine and repeat 7 & 8

Note: removing the useless has_checkout and has_debt

Bug 14250: (follow-up) Refacto discharge messages display

The script that determines if one should display messages to the user,
informing him whether they are allowed or not to ask for a discharge is
quite hard to understand.

For sake of readability, transforming the unless to an if since the
error behaviour was in the unless and the success in the else.
Changing to success behaviour in the if and failure in the else.

Bug 14250: Tidy

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-04-22 08:46:26 +02:00
Jonathan Druart 15a030bc76
Bug 39319: Fixes for Pod::Checker
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-04-14 08:51:21 +02:00
Pedro Amorim c51d28e623
Bug 35604: ConfirmAuto workflow stage
Sponsored-by: NHS England
Sponsored-by: PTFS Europe Ltd
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-04-14 08:51:05 +02:00
Marcel de Rooy 7fb30a073e
Bug 39226: (follow-up) Similar change for the cud-update branch
Resolve
DBIx::Class::Storage::DBI::insert(): Missing value for primary key column 'verification_token' on BorrowerModification

Test plan:
Update details for existing borrower.

Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-04-11 09:52:41 +02:00
Marcel de Rooy c7bdbf937c
Bug 39226: Add borrowernumber 0 when creating patron modification
Test plan:
Test with and without this patch. Verify that you see no warn with Missing
value for primary key column anymore in plack-opac-error.
Enable self registration.
Register a new patron.

Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-04-11 09:52:40 +02:00
Nick Clemens 5cf5811d01
Bug 22458: Don't check for duplicate email on borrower self modification
This patch adds an extra variable to internal function CheckValidBorrower to set the
context as 'create' or 'update'

To test:
1 - Enable PatronSelfRegistrationEmailMustBeUnique
2 - Edit a patron in staff interface and set email to 'a@example.org'
3 - Open an incognito window and go to opac
4 - Self register a patron using email a@example.org
5 - You receive an error
6 - Use b@example.org for email
7 - No problem
8 - Sign in as the new patron
9 - Edit your information
10 - Set email to a@example.org
11 - You receive an error
12 - Apply patch, restart all
13 - Edit patron again
14 - No error!
15 - Register another patron on the opac
16 - Confirm still wanred if using a@example.org as the email

Signed-off-by: Allax Guillen <AGuillen@roseville.ca.us>
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-04-11 09:52:38 +02:00
Hammat Wele e303854076
Bug 33224: OPACHoldsIfAvailableAtPickup and no on-shelf holds don't mix well
When OPACHoldsIfAvailableAtPickup preference is set to Don't allow and circulation rules allow on-shelf holds only if any unavailable, and we have a record with a checked out copy at Centerville and an available copy at Midway, a Midway patron should not be able to place a hold for pickup at Midway since the Midway copy is available.

This is the setting:
- circulation rules allow on-shelf holds only if any unavailable
- OPACHoldsIfAvailableAtPickup is set to Don't allow

To test:
1. Set up the circulation rule so that on-shelf holds are allowed ('Yes')
2. Create a record with two items, one at Centerville and one at Midway
3. Check out the Centerville item
4. Log into the OPAC with a Midway patron (I used Henry Acevedo)
5. Try to place a hold on the record
   --> Midway is not a valid pickup location (correct behaviour)
6. Cancel
7. Change the circulation rules so that on-shelf holds are only allowed 'if any unavailable'
8. Try to place a hold on the record from the OPAC again
   --> The system allows you to place the hold for pickup at Midway (incorrect behaviour)
9. Optionally, check the Holds to pull for Midway (the hold is there, it shouldn't)
10. Optionnaly, check in the Midway item (it is trapped for Henry's hold)
11. Apply the patch
12. Try again to place a hold on the record from the OPAC
   --> it is impossible to select Midway, Midway is not a valid pickup location

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-03-19 17:34:55 +01:00
Aleisha Amohia 0f077950fc
Bug 18798: Use Koha.Preference in OPAC Reading Record
This patch uses the Koha.Preference plugin method for the following
sysprefs:
 - OPACMySummaryHTML
 - OPACAmazonCoverImages
 - SyndeticsEnabled
 - SyndeticsCoverImages
 - SyndeticsClientCode
 - GoogleJackets
 - BakerTaylorEnabled
 - BakerTaylorBookstoreURL

To test confirm that enabling and disabling the above sysprefs does not
break anything.

Sponsored-by: Catalyst IT
Signed-off-by: Owen Leonard <oleonard@myacpl.org>

I'm not able to test Syndetics but everything else works correctly.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-03-19 11:55:30 +01:00
Marcel de Rooy 0aa87832dd
Bug 32051: Rename Library to Contact for one public library
Note:
I am using $rs in the script to prevent searching branches again
unneeded. And pass public_count to opac-library.tt to prevent
another call of Branches.all (for bread crumbs), like masthead
already does btw.

Test plan:
[1] Have two (or more) public libraries.
Verify that you see Libraries on the OPAC home page and that when
clicking Libraries, you first have the library list. Are the bread
crumbs as expected?
Click a library on that list. Do you get its details? Are the bread
crumbs as expected?

[2] Now have only one public library.
Verify that you see Contact on the home page.
And that when clicking Contact you go directly to the library details
without the intermediate library list. Are the bread crumbs still
as expected (with Contact instead of Libraries)?

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-03-07 18:02:55 +01:00
Marcel de Rooy baea457996
Bug 38903: Fix theme in some getTranslatedLanguages calls
Combining opac with pref template is wrong. This pref should
actually be renamed to something like intranetTheme(s) or so.

Replacing the obsolete prog theme in Languages.t by undef. This
achieves the same: getting all themes for that interface.

Test plan:
Add some languages for opac and intranet. Do not enable exactly
the same set.
Enable TranslateNotices.
Verify that you have all OPAC languages on memberentry and
opac-messaging. And all languages on additional contents.
Run t/db_dependent/Languages.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Tested with:
OPAC  languages: en, nl-NL, de-DE
Staff languages: en, de-DE, fr-FR
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-03-07 15:41:13 +01:00
Tomas Cohen Arazi e360959752
Bug 28478: Make opac-*detail.pl scripts use Koha::Biblio->opac_suppressed()
This patch makes the following scripts use the new method for checking
suppression:

* opac/opac-ISBDdetail.pl
* opac/opac-MARCdetail.pl
* opac/opac-detail.pl

In the `opac-detail.pl` case, it is a simple change by removing MARC
data traversal in favor of the new method. The code checking
suppression gets moved up so we don't process or make any other
calculations if the record is suppressed.

The other two scripts where completely missing the check and thus
leaking suppressed records.

To test:
1. Pick two records, one marked as suppressed, and the other not
   suppressed.
2. Try acessing them in the OPAC detail page.
=> SUCCESS: Suppressed records are suppressed, and not suppressed ones
are not.
3. Try the same records on the ISBD and MARC view
=> FAIL: They are not suppressed!
4. Apply this patch
5. Repeat 2
=> SUCCESS: Suppression is still respected
6. Repeat 3
=> SUCCESS: Suppression is respected on the ISBD and MARC views
7. Sign off :-D

Signed-off-by: Magnus Enger <magnus@libriotech.no>
Works as advertised. Remember to activate OPAC suppression with
OpacSuppression.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-03-06 13:54:28 +01:00
Jonathan Druart a8355add2c
Bug 35635: Fix server-side check
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-02-20 17:34:57 +01:00
Emily Lamancusa 2a5880d86b
Bug 36112: Port default CHECKOUT_NOTE notice to TT
Port the default notice text to Template Toolkit. Also, add access to
item information in order to give more useful information about the
checked-out item that the note refers to (in this case, the item barcode
instead of the biblionumber)

To test:
1. Apply patch and reset all
2. Enable the system preference AllowCheckoutNotes
3. Go to Administration > Libraries and edit the current logged-in
   library to ensure that there is a value in the Email field
4. Check out an item to a patron
5. Ensure the patron has values in the first name and surname fields
6. Log into the OPAC as that patron
7. Click to display the patron's current checkouts
8. Click the + button to the right of a checkout
9. Click the "Add Note" button beneath the table
10. Add some text and submit the note
11. Return to the staff interface and go to the Notices tab for the patron
--> Confirm that there is a notice called "Checkout note" with all the
correct information

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-02-19 17:05:35 +01:00
Koha Development Team d659526b5a
Bug 38664: Tidy the whole codebase
This commit is generated using:
  % perl misc/devel/tidy.pl
*within* ktd, to get the same version of perltidy than what will be used
by our CI (currently v20230309).

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-02-11 14:58:24 +01:00
Jonathan Druart 3d3ec03bec
Bug 38714: prettier-ignore opac-browser.tt
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-02-11 14:57:45 +01:00
Lucas Gass 81446a7ce7
Bug 39003: Fix the tab template variable in opac-user.pl
To test:
1. SuspendHoldsOpac to 'allow'
2. Make some holds for a patron
3. Log in as that patron and go to 'Summary'
4. Click the 'Holds' tab
5. No suspend column
6. APPLY PATCH, restart_all
7. Try again, the column should show.
8. Turn off SuspendHoldsOpac, the column should be hidden.

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-01-31 15:57:33 +01:00
Fridolin Somers ed3481786f
Bug 38963: Check for existence of biblio object before fetching cover images in the OPAC
This patch adds a conditional to ensure the biblio object has been retrieved
and assumes no cover images otherwise. This is similar to bug 37425 that
fixed the issue for the staff interface.

Test plan:
 1. Enable the OPACLocalCoverImages system preference.
 2. Search in the OPAC (for example, attic).
 3. Find the biblionumber for one of the results and delete it
    from the database using SQL:
     DELETE FROM biblio WHERE biblionumber=3;
 4. Search again.
    NOTE: Steps 3 and 4 need to be done very quickly to generate the error.
    I had the terminal open with the SQL already loaded, and the browser
    also open.
 5. Error trace generated:
     Can't call method "cover_images" on an undefined value at /kohadevbox/koha/opac/opac-search.pl line 702.
 at /kohadevbox/koha/opac/opac-search.pl line 701
 6. Reindex, confirm error is gone: koha-rebuild-zebra -d -f -v kohadev
 7. Apply the patch.
 8. Repeat steps 2 to 4 - I searched for perl and used biblionumber 13.
 9. No error generated
10. Reindex and repeat search and confirm no error.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-01-30 19:13:53 +01:00
Tomas Cohen Arazi 414f085781
Bug 38813: Make the 'curbside pickups' tab display selected if so
This patch fixes a wrong condition check in `usermenu.inc` for
determining if the tab should be active.

It currently checks for `ermview`, probably a copy and paste error.

This patch adds a new `curbside_pickups_view` parameter that is passed
instead.

Note: I tidied the code block I changed, inline to avoid extra commits.

To test:
1. Enable the `CurbsidePickup` system preference
2. Log into the OPAC
=> SUCCESS: There's a 'Curbside pickups' tab
3. Click on the tab
=> SUCCESS: The 'Curbside pickups' section gets displayed
=> FAIL: The tab remains inactive
4. Apply this patch
5. Restart plack:
   $ ktd --shell
  k$ koha-plack --restart kohadev
6. Repeat 3
=> SUCCESS: The 'Curbside pickups' section gets displayed
=> SUCCESS: The tab is rendered as active
7. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-01-21 15:56:42 +01:00
David Cook 996ec95274
Bug 38846: Only call getLanguages for advanced search pages
This change makes it so that C4::Languages::getLanguages is only
called for the advanced search pages and not the search result pages
where the output is not used.

Test plan:
0. Apply the patch and koha-plack --restart kohadev
1. Go to http://localhost:8081/cgi-bin/koha/catalogue/search.pl?expanded_options=1
2. Note that the "Language" and "Language of original" dropdowns appear with language
options
3. Go to the following
http://localhost:8081/cgi-bin/koha/catalogue/search.pl?advsearch=1
&idx=kw&q=test&sort_by=relevance
4. Note that the page loads normally

5. Go to http://localhost:8080/cgi-bin/koha/opac-search.pl?expanded_options=1
6. Note that the "Language" dropdown appears with language options
7. Go to http://localhost:8080/cgi-bin/koha/opac-search.pl?idx=&q=test&weight_search=1
8. Note that the page loads normally

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-01-10 19:19:24 +01:00
Lucas Gass d0cbb308f7
Bug 26211: (follow-up) Remove age_low and age_high template variables
Signed-off-by: Sam Sowanick <sam.sowanick@corvallisoregon.gov>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-12-30 15:12:45 +01:00
Amit Gupta 579389ed32
Bug 26211: Patron age verification while doing the self-registration.
To Test
1. Create the patron category from the staff page for ex: Kid and give age required and age Upperage limit
   age required 5 yrs and upperage limit 17.
2. Allow category in PatronSelfRegistrationDefaultCategory for online registration from opac.
3. Go to /cgi-bin/koha/opac-memberentry.pl page.
4. Fill the form and give choose date of birth 10/10/1974 and click OK. Now you can able to save the page.
5. Apply the patch.
6. Again go to cgi-bin/koha/opac-memberentry.pl page.
7. Fill the form and give choose date of birth 10/10/1974 and click OK. It will give the error message.
   Patron's age is incorrect for their category. Ages allowed are 5-17.

Signed-off-by: Sam Sowanick <sam.sowanick@corvallisoregon.gov>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-12-30 15:12:45 +01:00
Lari Taskula f66379c075
Bug 35975: Show biblionumber when download cart as BibTeX
To test:
1. In OPAC, add a record to your cart
2. Go to your cart
3. Click Download -> BibTeX
4. Observe downloaded file in your favorite text editor
5. Observe Koha::Hash(xxx) within file contents
6. Apply patch
7. Repeat steps 3 and 4
8. Observe Koha::Hash has been replaced with biblionumber

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-12-27 17:33:49 +01:00
Roman Dolny 4b8db36d2a
Bug 38772: Typo 'minPasswordPreference' system preference
Typo in system preference 'minPasswordPreference' -> 'minPasswordLength'
in opac/opac-password-recovery.pl

There is no 'minPasswordPreference' system preference in database.
Bug 23816 added the capability to override minPasswordLength.

Test plan:
==========
1. Check 'minPasswordPreference' appearances:
   git grep -i 'minPasswordPreference' **/*
--> Note: only one in opac-password-recovery.pl; no one in sysprefs.sql
2. Apply the patch.
3. Repeat p. 1. Note there is not 'minPasswordPreference' at all.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-12-27 17:33:39 +01:00
Fridolin Somers bf82831913
Bug 38653: Remove call on system preference 'OPACLocalCoverImagesPriority'
This is in opac/opac-search.pl a call on system preference
OPACLocalCoverImagesPriority. This preference does not exists elsewhere
and dates back to Koha 3.8 from Bug 1633

This patch removes the call and fixes folding of if.

Check this returns empty : git grep OPACLocalCoverImagesPriority

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-12-23 10:35:32 +01:00
Lucas Gass 8d0e7ff906
Bug 38362: Fix printing lists on opac/opac-shelves.pl
To test from the OPAC:
1 - create a list with more than 10 items
2 - print the list -> there is a pagination and that only 10 items
  are printed
3 - Apply patch
4 - print the list again -> every items are being printed

Signed-off-by: Sam Sowanick <sam.sowanick@corvallisoregon.gov>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
[EDIT] Tidied: added a few spaces.
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-12-03 14:36:25 +01:00