From f38ed0334e67929867dda552d689c294daf5b156 Mon Sep 17 00:00:00 2001 From: Henri-Damien LAURENT Date: Wed, 9 Sep 2009 23:42:58 +0200 Subject: [PATCH] Bug 3532 show lost, damaged statuses on patron record The patron record Details tab list of checkouts does not show lost, long overdue, claims returned, or damaged status, only that an item is overdue. Added a check for lost and damaged statuses and a display of any matching statuses to the patron Details tab. (revised version to drop unneeded lines from moremember.tmpl file) Signed-off-by: Galen Charlton Signed-off-by: Henri-Damien LAURENT --- .../prog/en/modules/members/moremember.tmpl | 9 ++++++- members/moremember.pl | 27 +++++++++++++++++-- 2 files changed, 33 insertions(+), 3 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tmpl index e118d7e5d7..f295ca6905 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tmpl @@ -376,7 +376,14 @@ $(document).ready(function() { ">"> , by ; , &itemnumber=#item"> - + + + + + + + + diff --git a/members/moremember.pl b/members/moremember.pl index 0be8a538a2..286a811f00 100755 --- a/members/moremember.pl +++ b/members/moremember.pl @@ -230,15 +230,38 @@ for ( my $i = 0 ; $i < $count ; $i++ ) { my $datedue = $issue->[$i]{'date_due'}; $issue->[$i]{'date_due'} = C4::Dates->new($issue->[$i]{'date_due'},'iso')->output('syspref'); $issue->[$i]{'issuedate'} = C4::Dates->new($issue->[$i]{'issuedate'},'iso')->output('syspref'); + my $biblionumber = $issue->[$i]{'biblionumber'}; my %row = %{ $issue->[$i] }; $totalprice += $issue->[$i]{'replacementprice'}; $row{'replacementprice'} = $issue->[$i]{'replacementprice'}; + # item lost, damaged loops + if ($row{'itemlost'}) { + my $fw = GetFrameworkCode($issue->[$i]{'biblionumber'}); + my $category = GetAuthValCode('items.itemlost',$fw); + my $lostdbh = C4::Context->dbh; + my $sth = $lostdbh->prepare("select lib from authorised_values where category=? and authorised_value =? "); + $sth->execute($category, $row{'itemlost'}); + my $loststat = $sth->fetchrow; + if ($loststat) { + $row{'itemlost'} = $loststat; + } + } + if ($row{'damaged'}) { + my $fw = GetFrameworkCode($issue->[$i]{'biblionumber'}); + my $category = GetAuthValCode('items.damaged',$fw); + my $damageddbh = C4::Context->dbh; + my $sth = $damageddbh->prepare("select lib from authorised_values where category=? and authorised_value =? "); + $sth->execute($category, $row{'damaged'}); + my $damagedstat = $sth->fetchrow; + if ($damagedstat) { + $row{'itemdamaged'} = $damagedstat; + } + } + # end lost, damaged if ( $datedue lt $today ) { $overdues_exist = 1; $row{'red'} = 1; #print ""; } - $row{toggle} = $toggle++ % 2; - #find the charge for an item my ( $charge, $itemtype ) = GetIssuingCharges( $issue->[$i]{'itemnumber'}, $borrowernumber ); -- 2.39.5