Koha/opac
Nick Clemens 0d4f520761
Bug 34886: Adjust holdability checks on opac details page
This patch tries to simplify some of the logic here to match that on the search results. When we don't have a patron, we fallback to determining if an item can be held buy determining whether there are any items that don't have holds disallowed at the all libraries level. We also remove items with non-holdable statuses like withdrawn etc (and check some system preferences)

If we don't have a patron, then we are done, however, if we do, then we need to check each item against the policies related to that patron.

This patch also removes two checks at the end:
CountItemsIssued($biblionumber)
$biblio->has_items_waiting_or_intransit

These seem to be from bug 4319 - however, those rules are checked by IsAvailableForItemLevelRequest and are only relevant when we have a patron. These checks essentially assumed 'onshelfholds' policy of 'If any unavailable' For consistency sake I think we should follow the same logic as the results page.

To test:
1 - Find a record with two items, of different types, set a 'Default checkout, hold and return policy' of 'No holds allowed'
2 - Search opac, not logged in, and verify neither the results page or details page shows the place hold button
3 - Delete that rule, make both items withdrawn
4 - Search opac, not logged in, and verify neither the results page or details page shows the place hold button
5 - Mark one item as not withdrawn
6 - Search opac, not logged in, and verify both the results page or details page shows the place hold button
7 - Log in to opac
8 - Search opac, logged in, and verify both the results page or details page shows the place hold button
9 - Place an 'On shelf holds policy' rule for that patron category of 'If any unavailable'
10 - Search opac, logged in, and verify the results and details page shows the place hold button
11 - Set the other item to not withdrawn
12 - Search opac, logged in, and verify the results page shows the place hold button, but details does not
13 - Try various other scenarios - details page should be more correct, results page is always an approximation

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>
2024-04-02 17:59:06 +02:00
..
clubs Bug 29844: Fix ->search occurrences 2022-02-09 15:36:23 -10:00
errors Bug 36148: Improve error handling and restore programming errors 2024-03-01 11:01:06 +01:00
external/overdrive
sci Bug 34478: Changes for opac/sci/sci-main 2024-03-01 10:57:38 +01:00
sco Bug 34478: Fix sco-patron-image.pl access control regression 2024-03-01 10:59:42 +01:00
svc Bug 36418: opac/svc/club: switch content-type to application/json 2024-04-02 17:59:05 +02:00
ilsdi.pl Bug 30944: Undo change to ILS-DI documentation 2022-10-03 13:44:11 -03:00
maintenance.pl Bug 23798: Convert OpacMaintenanceNotice system preference to additional contents 2023-11-08 17:41:27 -03:00
oai.pl
opac-account-pay-return.pl
opac-account-pay.pl Bug 36088: Remove useless code form opac-account-pay.pl 2024-03-07 15:02:43 +01:00
opac-account.pl Bug 29844: Fix ->search occurrences 2022-02-09 15:36:23 -10:00
opac-addbybiblionumber.pl Bug 34478: Changes for opac-addbybiblionumber 2024-03-01 10:57:37 +01:00
opac-alert-subscribe.pl Bug 34478: op =~ ^cud- in pl/pm 2024-03-01 10:56:11 +01:00
opac-alert-subscriptions.pl Bug 34478: Remove generate_csrf from pl 2024-03-01 10:55:56 +01:00
opac-article-request-cancel.pl
opac-authorities-home.pl Bug 34478: op =~ ^cud- in pl/pm 2024-03-01 10:56:11 +01:00
opac-authoritiesdetail.pl Bug 21330: Allow XSLT for authority detail view in OPAC 2023-05-15 18:24:03 -03:00
opac-basket.pl Bug 33102: Display fields from biblioitems in OPAC/staff interface cart 2023-05-05 17:45:19 -03:00
opac-blocked.pl Bug 35952: Remove unnecessary line for OpacSuppressionMessage 2024-03-07 15:02:50 +01:00
opac-browse.pl
opac-browser.pl Bug 34478: op =~ ^cud- in pl/pm 2024-03-01 10:56:11 +01:00
opac-changelanguage.pl
opac-course-details.pl Bug 32445: (follow-up) Fix availability display on opac-course-details 2023-01-05 09:09:48 -03:00
opac-course-reserves.pl
opac-curbside-pickups.pl Bug 34478: op =~ ^cud- in pl/pm 2024-03-01 10:56:11 +01:00
opac-detail.pl Bug 34886: Adjust holdability checks on opac details page 2024-04-02 17:59:06 +02:00
opac-discharge.pl Bug 34478: op =~ ^cud- in pl/pm 2024-03-01 10:56:11 +01:00
opac-dismiss-message.pl Bug 34478: Changes for opac-dismiss-message / opac-note.inc 2024-03-01 10:57:39 +01:00
opac-downloadcart.pl Bug 29697: Use flag embed_items 2022-07-22 15:24:11 -03:00
opac-downloadshelf.pl Bug 33069: Fix error in MARC download for OPAC lists 2023-05-09 10:57:55 -03:00
opac-export.pl Bug 29697: Use flag embed_items 2022-07-22 15:24:11 -03:00
opac-holdshistory.pl
opac-ics.pl Bug 30927: Improve formatting or iCal files for checkout due dates 2022-08-09 07:39:17 -03:00
opac-idref.pl
opac-illrequests.pl Bug 34478: Move compatibility code 2024-03-01 10:58:06 +01:00
opac-image.pl Bug 33047: Return 404 instead of 500 when biblio does not exist 2023-07-10 15:43:14 -03:00
opac-imageviewer.pl
opac-ISBDdetail.pl Bug 34836: Add patron check to isbd and marc detail pages 2023-10-03 08:51:11 -04:00
opac-issue-note.pl Bug 34478: op =~ ^cud- in pl/pm - Manual cud-email => email 2024-03-01 10:57:14 +01:00
opac-library.pl Bug 31775: Show single library 2022-10-17 08:25:55 -03:00
opac-main.pl Bug 31383: Create a parent-child DB relation for additional content 2023-10-20 14:43:56 -03:00
opac-MARCdetail.pl Bug 35266: Fix biblio check in opac-MARCdetail 2023-11-15 16:07:04 -03:00
opac-memberentry.pl Bug 35538: Sort OPAC self registration library list by library name 2024-03-08 18:58:20 +01:00
opac-messaging.pl Bug 34478: Add 'op' to opac-messaging 2024-03-01 10:57:07 +01:00
opac-modrequest-suspend.pl Bug 34478: Manual fix - add ops - hold-table.inc opac-user.tt 2024-03-01 10:57:21 +01:00
opac-modrequest.pl Bug 34478: Manual fix - add ops - hold-table.inc opac-user.tt 2024-03-01 10:57:21 +01:00
opac-mymessages.pl
opac-news-rss.pl
opac-overdrive-search.pl Bug 29318: Tidy the code 2021-10-26 16:46:03 +02:00
opac-page.pl Bug 31383: Create a parent-child DB relation for additional content 2023-10-20 14:43:56 -03:00
opac-passwd.pl Bug 34478: op =~ ^cud- in pl/pm 2024-03-01 10:56:11 +01:00
opac-password-recovery.pl Bug 34478: Changes for opac-password-recovery 2024-03-01 10:57:35 +01:00
opac-patron-consent.pl Bug 31503: Make opac-patron-consent more generic 2023-10-25 10:35:20 -03:00
opac-patron-image.pl Bug 29931: (follow-up) Similar thing in opac-patron-image.pl 2022-03-15 22:30:50 -10:00
opac-privacy.pl Bug 34478: op =~ ^cud- in pl/pm 2024-03-01 10:56:11 +01:00
opac-ratings.pl Bug 34478: Add 'op' to opac-ratings 2024-03-01 10:57:09 +01:00
opac-readingrecord.pl Bug 33949: Replace GetAllIssues with Koha::Checkouts - opac 2023-10-18 15:41:26 -03:00
opac-recall.pl Bug 34478: op =~ ^cud- in pl/pm 2024-03-01 10:56:11 +01:00
opac-recalls.pl Bug 30291: Changes to OPAC files 2022-05-05 11:17:36 -10:00
opac-registration-verify.pl Bug 34478: op =~ ^cud- in pl/pm - Manual cud-email => email 2024-03-01 10:57:14 +01:00
opac-renew.pl Bug 34478: op =~ ^cud- in pl/pm 2024-03-01 10:56:11 +01:00
opac-reportproblem.pl Bug 34478: Manual fix - problem_reports 2024-03-01 10:56:59 +01:00
opac-request-article.pl Bug 34478: Add 'op' to opac-request-article 2024-03-01 10:57:08 +01:00
opac-reserve.pl Bug 34478: Changes for opac-reserve 2024-03-01 10:57:23 +01:00
opac-reset-password.pl Bug 34478: op =~ ^cud- in pl/pm 2024-03-01 10:56:11 +01:00
opac-restrictedpage.pl
opac-retrieve-file.pl
opac-review.pl Bug 34478: Changes for opac-review 2024-03-01 10:57:20 +01:00
opac-routing-lists.pl
opac-search-history.pl Bug 34478: Manual fix - action to op / add cud- - opac-search-history 2024-03-01 10:57:13 +01:00
opac-search.pl Bug 35833: Silence few warnings from searching 2024-01-29 12:24:58 +01:00
opac-sendbasket.pl Bug 34478: op =~ ^cud- in pl/pm - Manual cud-email => email 2024-03-01 10:57:14 +01:00
opac-sendshelf.pl Bug 34478: Changes for opac-sendshelf 2024-03-01 10:57:25 +01:00
opac-serial-issues.pl
opac-shareshelf.pl Bug 34478: Changes for opac-shareshelf 2024-03-01 10:59:26 +01:00
opac-shelves.pl Bug 34478: Manual fix - opac-shelves (WIP) 2024-03-01 10:56:52 +01:00
opac-showmarc.pl
opac-showreviews.pl Bug 29697: Replace GetMarcBiblio occurrences with $biblio->metadata->record 2022-07-22 15:24:11 -03:00
opac-suggestions.pl Bug 34478: op =~ ^cud- in pl/pm 2024-03-01 10:56:11 +01:00
opac-tags.pl Bug 34478: Add 'op' to opac-tags 2024-03-01 10:57:08 +01:00
opac-tags_subject.pl
opac-topissues.pl Bug 34478: op =~ ^cud- - Manual - cud-do_it => do_it 2024-03-01 10:58:32 +01:00
opac-user.pl Bug 34478: Remove check_csrf from pl files 2024-03-01 10:56:01 +01:00
tracklinks.pl Bug 30262: Trim whitespace off tracklinks.pl URLs 2022-08-31 08:46:11 -03:00
unapi Bug 17600: Fix opac/unapi 2021-11-22 11:04:51 +01:00