From bf38b1f7bb851b6550287550991ef2315b03e8c0 Mon Sep 17 00:00:00 2001 From: Jane Wagner Date: Mon, 17 Aug 2009 10:14:44 -0400 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 --- .../prog/en/modules/members/moremember.tmpl | 9 +++++- members/moremember.pl | 28 +++++++++++++++++-- 2 files changed, 34 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 d3deaf90d7..076c31009c 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tmpl @@ -434,7 +434,14 @@ if (nodename =="barcodes[]"){ ">"> , by ; , &itemnumber=#item"> - + + + + + + + + diff --git a/members/moremember.pl b/members/moremember.pl index 494121f643..b0cab92447 100755 --- a/members/moremember.pl +++ b/members/moremember.pl @@ -224,14 +224,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; - } - + } #find the charge for an item my ( $charge, $itemtype ) = GetIssuingCharges( $issue->[$i]{'itemnumber'}, $borrowernumber ); -- 2.39.5