Bug 28422: OPAC MARC detail view doesn't correctly evaluate holdability
This patch modifies the MARC detail view in the OPAC so that it evaluates whether a title can be placed on hold in the same way it is done on the "normal" detail page and the ISBD detail page. This allows for consistency in the display of the "Place hold" link. To test, apply the patch and log into the OPAC. - Perform a search which will return results, at least one of which can be placed on hold. - View the detail page, the MARC detail page, and the ISBD detail page. In each case the "Place hold" link should appear in the sidebar. - View the same pages for a record which cannot be placed on hold to confirm that the link doesn't appear. For instance: - All items are not for loan. - All items are lost. - There are no items attached. Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
This commit is contained in:
parent
ac593159a2
commit
b542c9971e
|
|
@ -138,11 +138,21 @@ $template->param(
|
|||
) if $tagslib->{$bt_tag}->{$bt_subtag}->{hidden} <= 0 && # <=0 OPAC visible.
|
||||
$tagslib->{$bt_tag}->{$bt_subtag}->{hidden} > -8; # except -8;
|
||||
|
||||
my $norequests = 1;
|
||||
my $allow_onshelf_holds;
|
||||
my $items = $biblio->items;
|
||||
|
||||
while ( my $item = $items->next ) {
|
||||
$allow_onshelf_holds = Koha::CirculationRules->get_onshelfholds_policy( { item => $item, patron => $patron } );
|
||||
last if $allow_onshelf_holds;
|
||||
$norequests = 0
|
||||
if $norequests
|
||||
&& !$item->withdrawn
|
||||
&& !$item->itemlost
|
||||
&& ($item->notforloan < 0 || not $item->notforloan )
|
||||
&& !Koha::ItemTypes->find($item->effective_itemtype)->notforloan
|
||||
&& $item->itemnumber;
|
||||
|
||||
$allow_onshelf_holds = Koha::CirculationRules->get_onshelfholds_policy( { item => $item, patron => $patron } )
|
||||
unless $allow_onshelf_holds;
|
||||
}
|
||||
|
||||
if( $allow_onshelf_holds || CountItemsIssued($biblionumber) || $biblio->has_items_waiting_or_intransit ) {
|
||||
|
|
@ -381,6 +391,7 @@ $template->param(
|
|||
item_header_loop => \@item_header_loop,
|
||||
item_subfield_codes => \@item_subfield_codes,
|
||||
biblio => $biblio,
|
||||
norequests => $norequests,
|
||||
);
|
||||
|
||||
output_html_with_http_headers $query, $cookie, $template->output;
|
||||
|
|
|
|||
Loading…
Reference in New Issue