Distinguish between items marked 'not for loan' and 'Available'
This patch works with XSL* sysprefs == ON, a future patch will address XSL sysprefs==OFF
Items with notforloan set to a negative number still designate an 'ordered' status
Some items are marked 'not for loan' by setting that value at the item level, others by assigning
that value to that item's itemtype. This patch works for both scenarios.
Specific changes this patch introduces to the OPAC:
* Adds a new OPAC results page key 'Copies available for reference:'
* Changes 'Copies available at:' to 'Copies available for loan:'
* Changes the availability limit label in opac-advsearch from:
'Only items currently available' to 'Only items currently
available for loan or reference
* Displays the authorised value for the specific notforloan value in the OPAC detail page in
parentheses next to 'Not for Loan'
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
This commit is contained in:
parent
f823508b9e
commit
04270d01b2
|
|
@ -134,17 +134,20 @@ sub buildKohaItemsNamespace {
|
|||
my @items = C4::Items::GetItemsInfo($biblionumber);
|
||||
my $branches = GetBranches();
|
||||
my $itemtypes = GetItemTypes();
|
||||
|
||||
my $xml;
|
||||
for my $item (@items) {
|
||||
my $status;
|
||||
|
||||
my ( $transfertwhen, $transfertfrom, $transfertto ) = C4::Circulation::GetTransfers($item->{itemnumber});
|
||||
if ( $item->{notforloan} == -1 || $item->{onloan} || $item->{wthdrawn} || $item->{itemlost} || $item->{damaged} ||
|
||||
|
||||
if ( $itemtypes->{ $item->{itype} }->{notforloan} == 1 || $item->{notforloan} || $item->{onloan} || $item->{wthdrawn} || $item->{itemlost} || $item->{damaged} ||
|
||||
($transfertwhen ne '') || $item->{itemnotforloan} ) {
|
||||
if ( $item->{notforloan} == -1) {
|
||||
$status = "On order";
|
||||
}
|
||||
if ( $item->{itemnotforloan} ) {
|
||||
$status = "Not for loan";
|
||||
if ( $item->{itemnotforloan} > 0 || $item->{notforloan} > 0 || $itemtypes->{ $item->{itype} }->{notforloan} == 1 ) {
|
||||
$status = "reference";
|
||||
}
|
||||
if ($item->{onloan}) {
|
||||
$status = "Checked out";
|
||||
|
|
|
|||
|
|
@ -325,7 +325,7 @@
|
|||
</select>
|
||||
|
||||
|
||||
<div style="margin-top:.4em"><label for="available-items"><input type="checkbox" id="available-items" name="limit" value="available" /> Only items currently available</label></div>
|
||||
<div style="margin-top:.4em"><label for="available-items"><input type="checkbox" id="available-items" name="limit" value="available" /> Only items currently available for loan or reference</label></div>
|
||||
</fieldset></div>
|
||||
<!-- /TMPL_UNLESS -->
|
||||
<!-- /AVAILABILITY LIMITS -->
|
||||
|
|
|
|||
|
|
@ -266,9 +266,9 @@
|
|||
<!-- TMPL_IF NAME="serial" --><td><!-- TMPL_VAR NAME="serialseq" --> </td>
|
||||
<td><!-- TMPL_VAR NAME="publisheddate" --> </td><!-- /TMPL_IF -->
|
||||
<td><!-- TMPL_IF name="bi_notforloan" -->
|
||||
Not for loan
|
||||
Not for loan <!-- TMPL_IF NAME="notforloanvalue" -->(<!-- TMPL_VAR NAME="notforloanvalue" -->)<!-- /TMPL_IF -->
|
||||
<!-- TMPL_ELSIF NAME="itypenotforloan" -->
|
||||
Not for loan
|
||||
Not for loan <!-- TMPL_IF NAME="notforloanvalue" -->(<!-- TMPL_VAR NAME="notforloanvalue" -->)<!-- /TMPL_IF -->
|
||||
<!-- TMPL_ELSE -->
|
||||
<!-- TMPL_IF name="datedue" -->
|
||||
Checked out
|
||||
|
|
|
|||
|
|
@ -833,11 +833,11 @@
|
|||
</xsl:for-each>
|
||||
</xsl:when>
|
||||
|
||||
<xsl:when test="count(key('item-by-status', 'available'))=0">No copies available
|
||||
<xsl:when test="count(key('item-by-status', 'available'))=0 and count(key('item-by-status', 'reference'))=0">No copies available
|
||||
</xsl:when>
|
||||
<xsl:when test="count(key('item-by-status', 'available'))>0">
|
||||
<span class="available">
|
||||
<b><xsl:text>Copies available at: </xsl:text></b>
|
||||
<b><xsl:text>Copies available for loan: </xsl:text></b>
|
||||
<xsl:variable name="available_items"
|
||||
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])]">
|
||||
|
|
@ -850,6 +850,25 @@
|
|||
</span>
|
||||
</xsl:when>
|
||||
</xsl:choose>
|
||||
|
||||
<xsl:choose>
|
||||
<xsl:when test="count(key('item-by-status', 'reference'))>0">
|
||||
<span class="available">
|
||||
<b><xsl:text>Copies available for reference: </xsl:text></b>
|
||||
<xsl:variable name="reference_items"
|
||||
select="key('item-by-status', 'reference')"/>
|
||||
<xsl:for-each select="$reference_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:text> (</xsl:text>
|
||||
<xsl:value-of select="count(key('item-by-status-and-branch', concat(items:status, ' ', items:homebranch)))"/>
|
||||
<xsl:text>)</xsl:text>
|
||||
<xsl:choose><xsl:when test="position()=last()"><xsl:text>. </xsl:text></xsl:when><xsl:otherwise><xsl:text>, </xsl:text></xsl:otherwise></xsl:choose>
|
||||
</xsl:for-each>
|
||||
</span>
|
||||
</xsl:when>
|
||||
</xsl:choose>
|
||||
|
||||
<xsl:if test="count(key('item-by-status', 'Checked out'))>0">
|
||||
<span class="unavailable">
|
||||
<xsl:text>Checked out (</xsl:text>
|
||||
|
|
|
|||
Loading…
Reference in New Issue