@@ -, +, @@ sudo koha-shell kohadev perl misc/cronjobs/holds/build_holds_queue.pl --- C4/Items.pm | 4 +++- C4/Search.pm | 2 +- C4/XSLT.pm | 6 +++++- koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc | 5 +++++ koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl | 6 ++++++ 5 files changed, 20 insertions(+), 3 deletions(-) --- a/C4/Items.pm +++ a/C4/Items.pm @@ -1338,7 +1338,8 @@ sub GetItemsInfo { holding.branchcode, holding.branchname, holding.opac_info as holding_branch_opac_info, - home.opac_info as home_branch_opac_info + home.opac_info as home_branch_opac_info, + tmp_holdsqueue.itemnumber AS pending_hold "; $query .= " FROM items @@ -1350,6 +1351,7 @@ sub GetItemsInfo { LEFT JOIN borrowers USING (borrowernumber) LEFT JOIN serialitems USING (itemnumber) LEFT JOIN serial USING (serialid) + LEFT JOIN tmp_holdsqueue USING (itemnumber) LEFT JOIN itemtypes ON itemtypes.itemtype = " . (C4::Context->preference('item-level_itypes') ? 'items.itype' : 'biblioitems.itemtype'); $query .= q| --- a/C4/Search.pm +++ a/C4/Search.pm @@ -2233,7 +2233,7 @@ sub searchResults { # XSLT processing of some stuff # we fetched the sysprefs already before the loop through all retrieved record! if (!$scan && $xslfile) { - $oldbiblio->{XSLTResultsRecord} = XSLTParse4Display($oldbiblio->{biblionumber}, $marcrecord, $xslsyspref, 1, \@hiddenitems, $sysxml, $xslfile, $lang); + $oldbiblio->{XSLTResultsRecord} = C4::XSLT::XSLTParse4Display($oldbiblio->{biblionumber}, $marcrecord, $xslsyspref, 1, \@hiddenitems, $sysxml, $xslfile, $lang); # the last parameter tells Koha to clean up the problematic ampersand entities that Zebra outputs } --- a/C4/XSLT.pm +++ a/C4/XSLT.pm @@ -27,6 +27,7 @@ use C4::Context; use C4::Items; use C4::Koha; use C4::Biblio; +use C4::HoldsQueue; use C4::Circulation; use C4::Reserves; use Koha::AuthorisedValues; @@ -292,7 +293,7 @@ sub buildKohaItemsNamespace { my $reservestatus = C4::Reserves::GetReserveStatus( $item->{itemnumber} ); if ( $itemtypes->{ $item->{itype} }->{notforloan} || $item->{notforloan} || $item->{onloan} || $item->{withdrawn} || $item->{itemlost} || $item->{damaged} || - (defined $transfertwhen && $transfertwhen ne '') || $item->{itemnotforloan} || (defined $reservestatus && $reservestatus eq "Waiting") ){ + (defined $transfertwhen && $transfertwhen ne '') || $item->{itemnotforloan} || (defined $reservestatus && $reservestatus eq "Waiting") || $item->{pending_hold} ){ if ( $item->{notforloan} < 0) { $status = "On order"; } @@ -317,6 +318,9 @@ sub buildKohaItemsNamespace { if (defined $reservestatus && $reservestatus eq "Waiting") { $status = 'Waiting'; } + if ($item->{pending_hold}) { + $status = 'Pending hold'; + } } else { $status = "available"; } --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc +++ a/koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc @@ -78,6 +78,11 @@ not use an API to fetch items that populates item.datedue. On order [% END %] +[% IF item.pending_hold %] + [% SET itemavailable = 0 %] + Pending hold +[% END %] + [% IF ( itemavailable ) %] Available [% IF ( item.restrictedopac ) %]([% item.restrictedopac %])[% END %] [% END %] --- a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl +++ a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl @@ -1280,6 +1280,12 @@ ). + + + Pending hold ( + + ). + In transit ( --