Bug 3532 show lost, damaged statuses on patron record
authorHenri-Damien LAURENT <henridamien.laurent@biblibre.com>
Wed, 9 Sep 2009 21:42:58 +0000 (23:42 +0200)
committerHenri-Damien LAURENT <henridamien.laurent@biblibre.com>
Wed, 16 Sep 2009 21:19:45 +0000 (23:19 +0200)
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 <gmcharlt@gmail.com>
Signed-off-by: Henri-Damien LAURENT <henridamien.laurent@biblibre.com>
koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tmpl
members/moremember.pl

index e118d7e..f295ca6 100644 (file)
@@ -376,7 +376,14 @@ $(document).ready(function() {
                 <!-- TMPL_VAR NAME="itemtype_description" --></td>
             <td><!-- TMPL_IF NAME="red" --><a class="overdue" href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->"><!-- TMPL_VAR NAME="title" escape="html"--></a><!-- TMPL_ELSE --><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->"><!-- TMPL_VAR NAME="title" escape="html" --></a><!-- /TMPL_IF --> <!-- TMPL_IF NAME="author" -->, by <!-- TMPL_VAR name="author" --><!-- /TMPL_IF --> <!-- TMPL_IF name="publishercode" -->; <!-- TMPL_VAR name="publishercode" --> <!-- /TMPL_IF --> <!-- TMPL_IF name="publicationyear" -->, <!-- TMPL_VAR name="publicationyear" --><!-- /TMPL_IF --> <a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->&amp;itemnumber=<!-- TMPL_VAR NAME="itemnumber" -->#item<!-- TMPL_VAR NAME="itemnumber" -->"><!-- TMPL_VAR NAME="barcode" --></a></td>
             <td><!-- TMPL_VAR NAME="issuedate" --></td>
-            <td><!-- TMPL_IF NAME="red" --><span class="overdue"><!-- TMPL_VAR NAME="date_due" --></span><!-- TMPL_ELSE --><!-- TMPL_VAR NAME="date_due" --><!-- /TMPL_IF --></td>
+            <td><!-- TMPL_IF NAME="red" --><span class="overdue"><!-- TMPL_VAR NAME="date_due" --></span><!-- TMPL_ELSE --><!-- TMPL_VAR NAME="date_due" --><!-- /TMPL_IF -->
+                <!-- TMPL_IF NAME="itemlost" -->
+                                        <span class="lost"><!-- TMPL_VAR NAME="itemlost" --></span>
+                    <!-- /TMPL_IF -->
+                <!-- TMPL_IF NAME="damaged" -->
+                                        <span class="dmg"><!-- TMPL_VAR NAME="itemdamaged" --></span>
+                <!-- /TMPL_IF -->
+</td>
             <td><!-- TMPL_VAR NAME="charge" --></td>
             <td><!-- TMPL_VAR NAME="replacementprice" --></td>
       <!-- TMPL_IF NAME="renew_failed" -->
index 0be8a53..286a811 100755 (executable)
@@ -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 "<font color=red>";
        }
-    $row{toggle} = $toggle++ % 2;
-
     #find the charge for an item
     my ( $charge, $itemtype ) =
       GetIssuingCharges( $issue->[$i]{'itemnumber'}, $borrowernumber );