Fixes to two issues with status display on OPAC:
authorJoshua Ferraro <jmf@liblime.com>
Wed, 4 Feb 2009 16:46:24 +0000 (10:46 -0600)
committerHenri-Damien LAURENT <henridamien.laurent@biblibre.com>
Tue, 26 May 2009 19:14:56 +0000 (21:14 +0200)
1. rather than testing for notforloan == -1, test for any negative values to set the On order status
2. in cases where itemcallnumber is blank or null, don't display the itemcallnumber brackets []

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
Signed-off-by: Henri-Damien LAURENT <henridamien.laurent@biblibre.com>
C4/XSLT.pm
koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACResults.xsl

index 8e77ea9..cf9c51b 100644 (file)
@@ -143,7 +143,7 @@ sub buildKohaItemsNamespace {
 
         if ( $itemtypes->{ $item->{itype} }->{notforloan} == 1 || $item->{notforloan} || $item->{onloan} || $item->{wthdrawn} || $item->{itemlost} || $item->{damaged} ||
              ($transfertwhen ne '') || $item->{itemnotforloan} ) {
-            if ( $item->{notforloan} == -1) {
+            if ( $item->{notforloan} < 0) {
                 $status = "On order";
             } 
             if ( $item->{itemnotforloan} > 0 || $item->{notforloan} > 0 || $itemtypes->{ $item->{itype} }->{notforloan} == 1 ) {
index 094b5cb..9cb67c2 100644 (file)
                            select="key('item-by-status', 'available')"/>
                        <xsl:for-each select="$available_items[generate-id() = generate-id(key('item-by-status-and-branch', concat(items:status, ' ', items:homebranch))[1])]">
                            <xsl:value-of select="items:homebranch"/>
-                                                  [<xsl:value-of select="items:itemcallnumber"/>]
+                                                  <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber">[<xsl:value-of select="items:itemcallnumber"/>]</xsl:if>
                            <xsl:text> (</xsl:text>
                            <xsl:value-of select="count(key('item-by-status-and-branch', concat(items:status, ' ', items:homebranch)))"/>
                            <xsl:text>)</xsl:text>