Bug 2655: Partial fix for Items on hold shelf showing as available.
Fixes the opac results (opac-search.pl), if using xsl to transform data. I have no way to test UNIMARC results, if someone could test it for me. Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
This commit is contained in:
parent
5c6632a893
commit
9fa69bff82
3 changed files with 21 additions and 2 deletions
10
C4/XSLT.pm
10
C4/XSLT.pm
|
@ -26,6 +26,7 @@ use C4::Items;
|
|||
use C4::Koha;
|
||||
use C4::Biblio;
|
||||
use C4::Circulation;
|
||||
use C4::Reserves;
|
||||
use Encode;
|
||||
use XML::LibXML;
|
||||
use XML::LibXSLT;
|
||||
|
@ -173,8 +174,10 @@ sub buildKohaItemsNamespace {
|
|||
|
||||
my ( $transfertwhen, $transfertfrom, $transfertto ) = C4::Circulation::GetTransfers($item->{itemnumber});
|
||||
|
||||
if ( $itemtypes->{ $item->{itype} }->{notforloan} || $item->{notforloan} || $item->{onloan} || $item->{wthdrawn} || $item->{itemlost} || $item->{damaged} ||
|
||||
(defined $transfertwhen && $transfertwhen ne '') || $item->{itemnotforloan} ) {
|
||||
my ( $reservestatus, $reserveitem ) = C4::Reserves::CheckReserves($item->{itemnumber});
|
||||
|
||||
if ( $itemtypes->{ $item->{itype} }->{notforloan} || $item->{notforloan} || $item->{onloan} || $item->{wthdrawn} || $item->{itemlost} || $item->{damaged} ||
|
||||
(defined $transfertwhen && $transfertwhen ne '') || $item->{itemnotforloan} || (defined $reservestatus && $reservestatus eq "Waiting") ){
|
||||
if ( $item->{notforloan} < 0) {
|
||||
$status = "On order";
|
||||
}
|
||||
|
@ -196,6 +199,9 @@ sub buildKohaItemsNamespace {
|
|||
if (defined $transfertwhen && $transfertwhen ne '') {
|
||||
$status = 'In transit';
|
||||
}
|
||||
if (defined $reservestatus && $reservestatus eq "Waiting") {
|
||||
$status = 'Waiting';
|
||||
}
|
||||
} else {
|
||||
$status = "available";
|
||||
}
|
||||
|
|
|
@ -1010,6 +1010,12 @@
|
|||
<xsl:value-of select="count(key('item-by-status', 'In transit'))"/>
|
||||
<xsl:text>). </xsl:text> </span>
|
||||
</xsl:if>
|
||||
<xsl:if test="count(key('item-by-status', 'Waiting'))>0">
|
||||
<span class="unavailable">
|
||||
<xsl:text>On hold (</xsl:text>
|
||||
<xsl:value-of select="count(key('item-by-status', 'Waiting'))"/>
|
||||
<xsl:text>). </xsl:text> </span>
|
||||
</xsl:if>
|
||||
</span>
|
||||
</xsl:template>
|
||||
|
||||
|
|
|
@ -189,6 +189,13 @@
|
|||
<xsl:text>). </xsl:text>
|
||||
</span>
|
||||
</xsl:if>
|
||||
<xsl:if test="count(key('item-by-status', 'Waiting'))>0">
|
||||
<span class="unavailable">
|
||||
<xsl:text>On hold (</xsl:text>
|
||||
<xsl:value-of select="count(key('item-by-status', 'Waiting'))"/>
|
||||
<xsl:text>). </xsl:text>
|
||||
</span>
|
||||
</xsl:if>
|
||||
</span>
|
||||
|
||||
</xsl:template>
|
||||
|
|
Loading…
Reference in a new issue