From a553ea88b15926286966699165e0aba85eff30d9 Mon Sep 17 00:00:00 2001 From: Paul POULAIN Date: Wed, 26 Dec 2007 12:55:31 -0600 Subject: [PATCH] fix to handle notforloan authorised values (we now handle wthdrawn, itemlost, damaged AND notforloan fields) Signed-off-by: Chris Cormack Signed-off-by: Joshua Ferraro --- C4/Search.pm | 11 +++++++++-- .../prog/en/modules/catalogue/results.tmpl | 1 + 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/C4/Search.pm b/C4/Search.pm index d90cb1bda5..71d07a41a2 100644 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -1001,6 +1001,10 @@ sub searchResults { $sth->execute; my ($itemtag) = $sth->fetchrow; + # get notforloan authorised value list + $sth = $dbh->prepare("SELECT authorised_value FROM `marc_subfield_structure` WHERE kohafield = 'items.notforloan' AND frameworkcode=''"); + $sth->execute; + my ($notforloan_authorised_value) = $sth->fetchrow; ## find column names of items related to MARC my $sth2 = $dbh->prepare("SHOW COLUMNS FROM items"); $sth2->execute; @@ -1171,15 +1175,18 @@ sub searchResults { } # item is withdrawn, lost or damaged - if ( $item->{wthdrawn} || $item->{itemlost} || $item->{damaged} ) { + if ( $item->{wthdrawn} || $item->{itemlost} || $item->{damaged} || $item->{notforloan} ) { $wthdrawn_count++ if $item->{wthdrawn}; $itemlost_count++ if $item->{itemlost}; $itemdamaged_count++ if $item->{damaged}; - $item->{status} = $item->{wthdrawn}."-".$item->{itemlost}."-".$item->{damaged}; + $item->{status} = $item->{wthdrawn}."-".$item->{itemlost}."-".$item->{damaged}."-".$item->{notforloan}; $other_count++; + $other_items->{ $item->{'homebranch'}.'--'.$item->{location}.$item->{'itemcallnumber'}.$item->{status} }->{wthdrawn} = $item->{wthdrawn}; $other_items->{ $item->{'homebranch'}.'--'.$item->{location}.$item->{'itemcallnumber'}.$item->{status} }->{itemlost} = $item->{itemlost}; $other_items->{ $item->{'homebranch'}.'--'.$item->{location}.$item->{'itemcallnumber'}.$item->{status} }->{damaged} = $item->{damaged}; + $other_items->{ $item->{'homebranch'}.'--'.$item->{location}.$item->{'itemcallnumber'}.$item->{status} }->{notforloan} = GetAuthorisedValueDesc('','',$item->{notforloan},'','',$notforloan_authorised_value) if $notforloan_authorised_value; + $other_items->{ $item->{'homebranch'}.'--'.$item->{location}.$item->{'itemcallnumber'}.$item->{status} }->{count}++ if $item->{'homebranch'}; $other_items->{ $item->{'homebranch'}.'--'.$item->{location}.$item->{'itemcallnumber'}.$item->{status} }->{branchname} = $item->{'branchname'}; $other_items->{ $item->{'homebranch'}.'--'.$item->{location}.$item->{'itemcallnumber'}.$item->{status} }->{location} = $locations{$item->{location}}; diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tmpl index 42ad9de361..a3ba5c8c50 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tmpl @@ -341,6 +341,7 @@ $(window).load(function() { (Withdrawn) (Lost) (Damaged) + () -- 2.39.5