Bug 7611: (follow-up) Fix display of undefined statuses and add a class

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
Nick Clemens 2019-11-05 16:32:45 +00:00 committed by Martin Renvoize
parent 128fcb8dd4
commit 2513b4f596
Signed by: martin.renvoize
GPG key ID: 422B469130441A0F
2 changed files with 6 additions and 3 deletions

View file

@ -344,8 +344,7 @@ sub buildKohaItemsNamespace {
}
elsif ( $item->notforloan ) {
$status = "reallynotforloan";
$substatus = $descs{$item->{notforloan}} || '';
$substatus = $substatus->{opac_description} if $substatus;
$substatus = exists $descs{$item->{notforloan}} ? $descs{$item->{notforloan}}->{opac_description} : "Not for loan_$item->{notforloan}";
}
elsif ( exists $itemtypes->{ $item->effective_itemtype }
&& $itemtypes->{ $item->effective_itemtype }->{notforloan} == 1 )

View file

@ -1343,7 +1343,11 @@
<br />
<xsl:variable name="reference_items" select="key('item-by-status', 'reallynotforloan')"/>
<xsl:for-each select="$reference_items[generate-id() = generate-id(key('item-by-substatus-and-branch', concat(items:substatus, ' ', items:homebranch))[1])]">
<span class="ItemSummary">
<span>
<xsl:attribute name="class">
ItemSummary
<xsl:value-of select="translate(items:substatus,' ','_')"/>
</xsl:attribute>
<xsl:if test="$singleBranchMode=0">
<span class="ItemBranch"><xsl:value-of select="items:homebranch"/><xsl:text> </xsl:text></span>
</xsl:if>