Clean up moredetail.pl and updateitem.pl
authorRyan Higgins <rch@liblime.com>
Sun, 9 Dec 2007 18:54:49 +0000 (12:54 -0600)
committerJoshua Ferraro <jmf@liblime.com>
Wed, 12 Dec 2007 14:03:10 +0000 (08:03 -0600)
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
C4/Biblio.pm
C4/Koha.pm
catalogue/moredetail.pl
catalogue/updateitem.pl
koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css
koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tmpl

index 966343d..ecd5fca 100755 (executable)
@@ -3905,8 +3905,9 @@ sub _koha_modify_item {
        my $error;
 
        # calculate items.cn_sort
-    $item->{'cn_sort'} = GetClassSort($item->{'items.cn_source'}, $item->{'itemcallnumber'}, "");
-
+    if($item->{'itemcallnumber'}) {
+               $item->{'cn_sort'} = GetClassSort($item->{'items.cn_source'}, $item->{'itemcallnumber'}, "");
+       }
     my $query = "UPDATE items SET ";
        my @bind;
        for my $key ( keys %$item ) {
@@ -3915,7 +3916,7 @@ sub _koha_modify_item {
     }
        $query =~ s/,$//;
     $query .= " WHERE itemnumber=?";
-    push @bind, $item->{'itemnumber'};
+       push @bind, $item->{'itemnumber'};
     my $sth = $dbh->prepare($query);
     $sth->execute(@bind);
     if ( $dbh->errstr ) {
index 06ff7a3..1724e6d 100644 (file)
@@ -68,6 +68,7 @@ $VERSION = 3.00;
   &GetAuthorisedValues
   &FixEncoding
   &GetKohaAuthorisedValues
+  &GetAuthValCode
   &GetManagedTagSubfields
 
   $DEBUG
@@ -787,6 +788,22 @@ sub displaySecondaryServers {
     return;    #$secondary_servers_loop;
 }
 
+=head2 GetAuthValCode
+
+$authvalcode = GetAuthValCode($kohafield,$frameworkcode);
+
+=cut
+
+sub GetAuthValCode {
+       my ($kohafield,$fwcode) = @_;
+       my $dbh = C4::Context->dbh;
+       $fwcode='' unless $fwcode;
+       my $sth = $dbh->prepare('select authorised_value from marc_subfield_structure where kohafield=? and frameworkcode=?');
+       $sth->execute($kohafield,$fwcode);
+       my ($authvalcode) = $sth->fetchrow_array;
+       return $authvalcode;
+}
+
 =head2 GetAuthorisedValues
 
 $authvalues = GetAuthorisedValues($category);
@@ -879,18 +896,17 @@ sub FixEncoding {
 =cut
 
 sub GetKohaAuthorisedValues {
-  my ($kohafield) = @_;
+  my ($kohafield,$fwcode) = @_;
+  $fwcode='' unless $fwcode;
   my %values;
   my $dbh = C4::Context->dbh;
-  my $sthnflstatus = $dbh->prepare('select authorised_value from marc_subfield_structure where kohafield=?');
-  $sthnflstatus->execute($kohafield);
-  my $authorised_valuecode = $sthnflstatus->fetchrow;
-  if ($authorised_valuecode) {  
-    $sthnflstatus = $dbh->prepare("select authorised_value, lib from authorised_values where category=? ");
-    $sthnflstatus->execute($authorised_valuecode);
-    while ( my ($val, $lib) = $sthnflstatus->fetchrow_array ) { 
-      $values{$val}= $lib;
-    }
+  my $avcode = GetAuthValCode($kohafield,$fwcode);
+  if ($avcode) {  
+    my $sth = $dbh->prepare("select authorised_value, lib from authorised_values where category=? ");
+    $sth->execute($avcode);
+       while ( my ($val, $lib) = $sth->fetchrow_array ) { 
+               $values{$val}= $lib;
+       }
   }
   return \%values;
 }
index b82d967..96b85a9 100755 (executable)
@@ -65,20 +65,22 @@ my $dewey = $data->{'dewey'};
 # $data->{'dewey'}=$dewey;
 
 my @results;
-
+my $fw = GetFrameworkCode($biblionumber);
 my $items= GetItemsByBiblioitemnumber($bi);
 my $count=@$items;
 $data->{'count'}=$count;
 
 my $ordernum = GetOrderNumber($biblionumber,$bi);
 my $order = GetOrder($ordernum);
-
+my $ccodes= GetKohaAuthorisedValues('items.ccode',$fw);
+my $itemtypes = GetItemTypes;
 $results[0]=$data;
-
 foreach my $item (@$items){
-       $item->{itemlostloop}= GetAuthorisedValues('LOST',$item->{itemlost});
-       $item->{itemdamagedloop}= GetAuthorisedValues('DAMAGED',$item->{damaged});
-    $item->{'replacementprice'}=sprintf("%.2f", $item->{'replacementprice'});
+       $item->{itemlostloop}= GetAuthorisedValues(GetAuthValCode('items.itemlost',$fw),$item->{itemlost});
+       $item->{itemdamagedloop}= GetAuthorisedValues(GetAuthValCode('items.damaged',$fw),$item->{damaged});
+       $item->{'collection'} = $ccodes->{$item->{ccode}};
+       $item->{'itype'} = $itemtypes->{$item->{'itype'}}->{'description'}; 
+       $item->{'replacementprice'}=sprintf("%.2f", $item->{'replacementprice'});
     $item->{'datelastborrowed'}= format_date($item->{'datelastborrowed'});
     $item->{'dateaccessioned'} = format_date($item->{'dateaccessioned'});
     $item->{'datelastseen'} = format_date($item->{'datelastseen'});
index 41e2dd5..0c4a35d 100755 (executable)
@@ -32,6 +32,7 @@ my $biblionumber=$cgi->param('biblionumber');
 my $itemnumber=$cgi->param('itemnumber');
 my $biblioitemnumber=$cgi->param('biblioitemnumber');
 my $itemlost=$cgi->param('itemlost');
+my $itemnotes=$cgi->param('itemnotes');
 my $wthdrawn=$cgi->param('wthdrawn');
 my $damaged=$cgi->param('damaged');
 
@@ -39,32 +40,48 @@ my $confirm=$cgi->param('confirm');
 my $dbh = C4::Context->dbh;
 # get the rest of this item's information
 my $item_data_hashref = GetItem($itemnumber, undef);
-
-# modify bib MARC
-if ((not defined($item_data_hashref->{'itemlost'})) or ($itemlost ne $item_data_hashref->{'itemlost'})) {
+my $newitemdata;
+# modify MARC item if input differs from items table.
+if ( $itemnotes ne $item_data_hashref->{'itemnotes'}) {
+    ModItemInMarconefield($biblionumber, $itemnumber, 'items.itemnotes', $itemnotes);
+       $newitemdata->{'itemnotes'} = $itemnotes;
+} elsif ($itemlost ne $item_data_hashref->{'itemlost'}) {
     ModItemInMarconefield($biblionumber, $itemnumber, 'items.itemlost', $itemlost);
-}
-if ((not defined($item_data_hashref->{'wthdrawn'})) or ($wthdrawn ne $item_data_hashref->{'wthdrawn'})) {
+       $newitemdata->{'itemlost'} = $itemlost;
+} elsif ($wthdrawn ne $item_data_hashref->{'wthdrawn'}) {
     ModItemInMarconefield($biblionumber, $itemnumber, 'items.wthdrawn', $wthdrawn);
-}
-if ((not defined($item_data_hashref->{'damaged'})) or ($damaged ne $item_data_hashref->{'damaged'})) {
+       $newitemdata->{'wthdrawn'} = $wthdrawn;
+} elsif ($damaged ne $item_data_hashref->{'damaged'}) {
     ModItemInMarconefield($biblionumber, $itemnumber, 'items.damaged', $damaged);
+       $newitemdata->{'damaged'} = $damaged;
+} else {
+       #nothings changed, so do nothing.
+       print $cgi->redirect("moredetail.pl?biblionumber=$biblionumber&itemnumber=$itemnumber");
 }
 
-# check reservations
-my ($status, $reserve) = CheckReserves($itemnumber, $item_data_hashref->{'barcode'});
-if ($reserve){
-       #print $cgi->header;
-       warn "Reservation found on item $itemnumber";
+# FIXME: eventually we'll use Biblio.pm, but it's currently too buggy  (is this current ??)
+#ModItem( $dbh,'',$biblionumber,$itemnumber,'',$item_hashref );
+       $newitemdata->{'itemnumber'} = $itemnumber;
+       &C4::Biblio::_koha_modify_item($dbh,$newitemdata);
+#$sth = $dbh->prepare("UPDATE items SET wthdrawn=?,itemlost=?,damaged=? WHERE itemnumber=?");
+#$sth->execute($wthdrawn,$itemlost,$damaged,$itemnumber);
+
+# check reservations (why ?)
+#my ($status, $reserve) = CheckReserves($itemnumber, $item_data_hashref->{'barcode'});
+#if ($reserve){
+##     #print $cgi->header;
+#      warn "Reservation found on item $itemnumber";
        #exit;
-}
-# check issues
-my $sth=$dbh->prepare("SELECT * FROM issues WHERE (itemnumber=? AND returndate IS NULL)");
-$sth->execute($itemnumber);
-my $issues=$sth->fetchrow_hashref();
+#}
+# check issues iff itemlost.
+ # FIXME : is there documentation or enforcement that itemlost value must be '1'?  if no replacement price, then borrower just doesn't get charged?
+if ($itemlost==1) {
+       my $sth=$dbh->prepare("SELECT * FROM issues WHERE (itemnumber=? AND returndate IS NULL)");
+       $sth->execute($itemnumber);
+       my $issues=$sth->fetchrow_hashref();
 
-# if a borrower lost the item, add a replacement cost to the their record
-if ( ($issues->{borrowernumber}) && ($itemlost==1) ){
+       # if a borrower lost the item, add a replacement cost to the their record
+       if ( ($issues->{borrowernumber}) && ($itemlost==1) ){
 
                # first make sure the borrower hasn't already been charged for this item
                my $sth1=$dbh->prepare("SELECT * from accountlines
@@ -84,13 +101,10 @@ if ( ($issues->{borrowernumber}) && ($itemlost==1) ){
                        "Lost Item $item_data_hashref->{'title'} $item_data_hashref->{'barcode'}",
                        $item_data_hashref->{'replacementprice'},$itemnumber);
                        $sth2->finish;
+               # FIXME: Log this ?
                }
+       }
+       $sth->finish;
 }
-$sth->finish;
-
-# FIXME: eventually we'll use Biblio.pm, but it's currently too buggy
-#ModItem( $dbh,'',$biblionumber,$itemnumber,'',$item_hashref );
-$sth = $dbh->prepare("UPDATE items SET wthdrawn=?,itemlost=?,damaged=? WHERE itemnumber=?");
-$sth->execute($wthdrawn,$itemlost,$damaged,$itemnumber);
 
 print $cgi->redirect("moredetail.pl?biblionumber=$biblionumber&itemnumber=$itemnumber");
index 8e2a410..5fc7181 100644 (file)
@@ -833,6 +833,11 @@ ol.bibliodetails span.label {
        margin-right: 1em;  
 }
 
+ol.bibliodetails span.listgroup {
+       font-weight: bold;
+       font-style: oblique;
+}
+
 div.sysprefs h3 {
        margin : .2em 0 .2em .4em;
 }
@@ -1103,4 +1108,4 @@ h1#logo a {
 
 .patroninfo+#menu {
        margin-right : 0;
-}
\ No newline at end of file
+}
index 8f3bfc0..a26e8fc 100644 (file)
@@ -21,9 +21,9 @@
        <!-- TMPL_LOOP NAME="BIBITEM_DATA" -->
                <h2><!-- TMPL_VAR NAME="title" --> <!-- TMPL_IF NAME="author" -->, by <!-- TMPL_VAR NAME="author" --><!-- /TMPL_IF --></h2>
        <ol class="bibliodetails">
-               <li><span class="label">Collection:</span><!-- TMPL_IF NAME="description" --><!-- TMPL_VAR NAME="description" --><!-- TMPL_ELSE --><!-- /TMPL_IF --> </li>
                <li><span class="label">Biblionumber:</span> <!-- TMPL_VAR NAME="biblionumber" --></li>
-               <li><span class="label">Item type:</span> <!-- TMPL_IF NAME="itemtype" --><!-- TMPL_VAR NAME="itemtype" --><!-- TMPL_ELSE -->&nbsp;<!-- /TMPL_IF --></li>
+               <!-- TMPL_UNLESS NAME="item-level_itypes" -->           <li><span class="label">Item type:</span> <!-- TMPL_IF NAME="itemtype" --><!-- TMPL_VAR NAME="itemtype" --><!-- TMPL_ELSE -->&nbsp;<!-- /TMPL_IF --></li><!-- /TMPL_UNLESS -->
+               <li><span class="label">Collection:</span><!-- TMPL_IF NAME="description" --><!-- TMPL_VAR NAME="description" --><!-- TMPL_ELSE -->&nbsp;<!-- /TMPL_IF --> </li>
                <li><span class="label">URL:</span> <!-- TMPL_IF NAME="url" --><a href="<!-- TMPL_VAR NAME="url" -->"><!-- TMPL_VAR NAME="url" --></a><!-- TMPL_ELSE -->&nbsp;<!-- /TMPL_IF --></li>
                <li><span class="label">Loan length:</span> <!-- TMPL_IF NAME="loanlength" --><!-- TMPL_VAR NAME="loanlength" --><!-- TMPL_ELSE -->&nbsp;<!-- /TMPL_IF --></li>
                <li><span class="label">Rental charge:</span> <!-- TMPL_IF NAME="rentalcharge" --><!-- TMPL_VAR NAME="rentalcharge" --><!-- TMPL_ELSE -->0.00<!-- /TMPL_IF --></li>
        <br clear="all" />
 <!-- TMPL_LOOP NAME="ITEM_DATA" -->
 <div class="yui-g">
-<h2>Barcode <!-- TMPL_VAR NAME="barcode" --></h2>
-        <!-- TMPL_IF NAME="CAN_user_editcatalogue" --><a href="/cgi-bin/koha/cataloguing/additem.pl?op=edititem&amp;biblionumber=<!-- TMPL_VAR
-NAME="biblionumber"-->&amp;itemnumber=<!-- TMPL_VAR NAME="itemnumber" -->">Modify</a> |
-        <a href="/cgi-bin/koha/cataloguing/additem.pl?op=delitem&amp;biblionumber=<!--TMPL_VAR NAME="biblionumber"-->&amp;itemnumber=<!--TMPL_VAR NAME="itemnumber"-->">Delete</a><!-- /TMPL_IF -->
-       
+<h2>Barcode <!-- TMPL_VAR NAME="barcode" -->  <!-- TMPL_IF name="notforloantext" --><!-- TMPL_VAR name="notforloantext" --> <!-- /TMPL_IF --></h2>
        
                <ol class="bibliodetails">
+                       <li><span class="listgroup">Item Information</span> <!-- TMPL_IF NAME="CAN_user_editcatalogue" --><a href="/cgi-bin/koha/cataloguing/additem.pl?op=edititem&amp;biblionumber=<!-- TMPL_VAR NAME="biblionumber"-->&amp;itemnumber=<!-- TMPL_VAR NAME="itemnumber" -->">Edit Items</a><!-- /TMPL_IF --></li>
+                       <ul>
                        <li><span class="label">Home Library:</span> <!-- TMPL_VAR NAME="homebranch" --></li>
-                       <li><span class="label">Current Library:</span> <!-- TMPL_VAR NAME="holdingbranch" --></li>
-                       <li><span class="label">Last seen:</span> <!-- TMPL_VAR NAME="datelastseen" --></li>
-                       <li><span class="label">Last borrowed:</span> <!-- TMPL_IF NAME="datelastborrowed" --><!-- TMPL_VAR NAME="datelastborrowed" --><!-- TMPL_ELSE -->&nbsp;<!-- /TMPL_IF --></li>
-                       <li><span class="label">Item Status:</span> <!-- TMPL_IF NAME="issue" -->Checked out to <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=<!-- TMPL_VAR NAME="borrowernumber" -->"><!-- TMPL_VAR NAME="cardnumber" --></a><!-- TMPL_ELSE -->Not Checked out <!-- /TMPL_IF --></li>
-                       <!-- TMPL_IF NAME="issue" --><li><span class="label">Date Due:</span> <!-- TMPL_VAR NAME="date_due" --></li><!-- /TMPL_IF -->
-                       <li><span class="label">Last Borrower 1:</span> <!-- TMPL_IF NAME="card0" --><!-- TMPL_VAR NAME="card0" --><!-- TMPL_ELSE -->&nbsp;<!-- /TMPL_IF --></li>
-                       <li><span class="label">Last Borrower 2:</span> <!-- TMPL_IF NAME="card1" --><!-- TMPL_VAR NAME="card1" --><!-- TMPL_ELSE -->&nbsp;<!-- /TMPL_IF --></li>
-                       <li><span class="label">Replacement Price:</span> <!-- TMPL_IF NAME="replacementprice" --><!-- TMPL_VAR NAME="replacementprice" --><!-- TMPL_ELSE -->&nbsp;<!-- /TMPL_IF --></li>
-                       <li><span class="label">Item Status Summary</span><!-- TMPL_IF name="notforloantext" --><!-- TMPL_VAR name="notforloantext" --> <!-- /TMPL_IF --><!-- TMPL_IF name="itemlost"-->Item Lost<!-- /TMPL_IF --> <!-- TMPL_IF NAME="damaged" -->Item Damaged<!-- /TMPL_IF --> <!-- TMPL_IF NAME="wthdrawn" -->Item Withdrawn<!-- /TMPL_IF --> &nbsp; </li>
-
-<li><span class="label">Damaged Status:</span>
-
-<form action="updateitem.pl" method="post">
-<input type="hidden" name="biblionumber" value="<!-- TMPL_VAR Name="biblionumber" -->" />
-<input type="hidden" name="biblioitemnumber" value="<!-- TMPL_VAR Name="biblioitemnumber" -->" />
-<input type="hidden" name="itemnumber" value="<!-- TMPL_VAR Name="itemnumber" -->" />
-<select name="damaged" >
-<!-- TMPL_LOOP NAME="itemdamagedloop" -->
-<!-- TMPL_IF NAME="selected" -->
-<option value="<!-- TMPL_VAR NAME="authorised_value" -->" selected="selected"><!-- TMPL_VAR NAME="lib" --></option>
-<!-- TMPL_ELSE -->
-<option value="<!-- TMPL_VAR NAME="authorised_value" -->"><!-- TMPL_VAR NAME="lib" --></option>
-<!-- /TMPL_IF -->
-<!-- /TMPL_LOOP -->
-</select>
-<input type="hidden" name="wthdrawn" value="<!-- TMPL_VAR NAME="wthdrawn" -->" />
-<input type="hidden" name="itemlost" value="<!-- TMPL_VAR NAME="itemlost" -->" />
-<input type="submit" name="submit" class="submit" value="Set Status" /></form>
-</li>
-
+                       <li><span class="label">Itemtype:</span> <!-- TMPL_IF NAME="itype" --><!-- TMPL_VAR NAME="itype" --><!-- TMPL_ELSE -->&nbsp;<!-- /TMPL_IF --></li>
+                       <!-- TMPL_IF NAME="collection" --><li><span class="label">Collection:</span> <!-- TMPL_VAR NAME="collection" --></li> <!-- /TMPL_IF -->  
+                       <li><span class="label">Item Callnumber:</span> <!-- TMPL_IF NAME="itemcallnumber" --><!-- TMPL_VAR NAME="itemcallnumber" --><!-- TMPL_ELSE -->&nbsp;<!-- /TMPL_IF --></li>
+                       <!-- TMPL_IF NAME="copyvol" --><li><span class="label">Copy / Vol :</span> <!-- TMPL_VAR NAME="copyvol" --></li> <!-- /TMPL_IF -->  
+                       <!-- TMPL_IF NAME="replacementprice" --><li><span class="label">Replacement Price:</span> <!-- TMPL_VAR NAME="replacementprice" --></li> <!-- /TMPL_IF -->
+                       </ul>
+                       <li> <span class="listgroup">Status</span>  ( <!-- TMPL_IF name="notforloantext" --><!-- TMPL_VAR name="notforloantext" --> <!-- /TMPL_IF --><!-- TMPL_IF name="itemlost"-->Item Lost<!-- /TMPL_IF --> <!-- TMPL_IF NAME="damaged" -->Item Damaged<!-- /TMPL_IF --> <!-- TMPL_IF NAME="wthdrawn" -->Item Withdrawn<!-- /TMPL_IF --> )</li>
+                       <ul>
+                       <li><span class="label">Current Location:</span> <!-- TMPL_VAR NAME="holdingbranch" --></li>
+                       <li><span class="label">Circulation Status:</span> <!-- TMPL_IF NAME="issue" -->Checked out to <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=<!-- TMPL_VAR NAME="borrowernumber" -->"><!-- TMPL_VAR NAME="cardnumber" --></a><!-- TMPL_ELSE -->Not Checked out <!-- /TMPL_IF --></li>
 <li><span class="label">Lost Status:</span>
-
-<form action="updateitem.pl" method="post">
-<input type="hidden" name="biblionumber" value="<!-- TMPL_VAR Name="biblionumber" -->" />
-<input type="hidden" name="biblioitemnumber" value="<!-- TMPL_VAR Name="biblioitemnumber" -->" />
-<input type="hidden" name="itemnumber" value="<!-- TMPL_VAR Name="itemnumber" -->" />
-<select name="itemlost" >
-<!-- TMPL_LOOP NAME="itemlostloop" -->
-<!-- TMPL_IF NAME="selected" -->
-<option value="<!-- TMPL_VAR NAME="authorised_value" -->" selected="selected"><!-- TMPL_VAR NAME="lib" --></option>
-<!-- TMPL_ELSE -->
-<option value="<!-- TMPL_VAR NAME="authorised_value" -->"><!-- TMPL_VAR NAME="lib" --></option>
-<!-- /TMPL_IF -->
-<!-- /TMPL_LOOP -->
-</select>
-<input type="hidden" name="wthdrawn" value="<!-- TMPL_VAR NAME="wthdrawn" -->" />
-<input type="hidden" name="damaged" value="<!-- TMPL_VAR NAME="damaged" -->" />
-<input type="submit" name="submit" class="submit" value="Set Status" /></form>
+       <form action="updateitem.pl" method="post">
+       <input type="hidden" name="biblionumber" value="<!-- TMPL_VAR Name="biblionumber" -->" />
+       <input type="hidden" name="biblioitemnumber" value="<!-- TMPL_VAR Name="biblioitemnumber" -->" />
+       <input type="hidden" name="itemnumber" value="<!-- TMPL_VAR Name="itemnumber" -->" />
+       <select name="itemlost" >
+       <!-- TMPL_LOOP NAME="itemlostloop" -->
+       <!-- TMPL_IF NAME="selected" -->
+       <option value="<!-- TMPL_VAR NAME="authorised_value" -->" selected="selected"><!-- TMPL_VAR NAME="lib" --></option>
+       <!-- TMPL_ELSE -->
+       <option value="<!-- TMPL_VAR NAME="authorised_value" -->"><!-- TMPL_VAR NAME="lib" --></option>
+       <!-- /TMPL_IF -->
+       <!-- /TMPL_LOOP -->
+       </select>
+       <input type="hidden" name="wthdrawn" value="<!-- TMPL_VAR NAME="wthdrawn" -->" />
+       <input type="hidden" name="damaged" value="<!-- TMPL_VAR NAME="damaged" -->" />
+       <input type="submit" name="submit" class="submit" value="Set Status" /></form>
+       </li>
+<li><span class="label">Damaged Status:</span>
+       <form action="updateitem.pl" method="post">
+       <input type="hidden" name="biblionumber" value="<!-- TMPL_VAR Name="biblionumber" -->" />
+       <input type="hidden" name="biblioitemnumber" value="<!-- TMPL_VAR Name="biblioitemnumber" -->" />
+       <input type="hidden" name="itemnumber" value="<!-- TMPL_VAR Name="itemnumber" -->" />
+       <select name="damaged" >
+       <!-- TMPL_LOOP NAME="itemdamagedloop" -->
+               <!-- TMPL_IF NAME="selected" -->
+               <option value="<!-- TMPL_VAR NAME="authorised_value" -->" selected="selected"><!-- TMPL_VAR NAME="lib" --></option>
+               <!-- TMPL_ELSE -->
+               <option value="<!-- TMPL_VAR NAME="authorised_value" -->"><!-- TMPL_VAR NAME="lib" --></option>
+               <!-- /TMPL_IF -->
+       <!-- /TMPL_LOOP -->
+       </select>
+       <input type="hidden" name="wthdrawn" value="<!-- TMPL_VAR NAME="wthdrawn" -->" />
+       <input type="hidden" name="itemlost" value="<!-- TMPL_VAR NAME="itemlost" -->" />
+       <input type="submit" name="submit" class="submit" value="Set Status" /></form>
 </li>
-       <li><span class="label">Paid for:</span> <!-- TMPL_IF NAME="paidfor" --><!-- TMPL_VAR NAME="paidfor" --><!-- TMPL_ELSE -->&nbsp;<!-- /TMPL_IF --></li>
-       <li><span class="label">Notes:</span> <!-- TMPL_IF NAME="itemnotes" --><!-- TMPL_VAR NAME="itemnotes" --><!-- TMPL_ELSE -->&nbsp;<!-- /TMPL_IF --></li>
-       <li><span class="label">Renewals:</span> <!-- TMPL_IF NAME="renewals" --><!-- TMPL_VAR NAME="renewals" --><!-- TMPL_ELSE -->&nbsp;<!-- /TMPL_IF --></li>
-       <li><span class="label"><!-- TMPL_IF NAME="CAN_user_editcatalogue" --><a href="/cgi-bin/koha/acqui/orderreceive.pl?recieve=<!-- TMPL_VAR NAME="ordernumber" -->&amp;biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->&amp;invoice=<!-- TMPL_VAR NAME="booksellerinvoicenumber" -->&amp;catview=yes">Accession Date:</a><!-- TMPL_ELSE -->Accession Date:<!-- /TMPL_IF --></span> <!-- TMPL_VAR NAME="dateaccessioned" --></li>
-
-
 <li><span class="label">Withdrawn:</span><!-- TMPL_IF NAME="wthdrawn" -->Yes<!-- TMPL_ELSE -->No<!-- /TMPL_IF --> <form action="updateitem.pl" method="post">
 <input type="hidden" name="biblionumber" value="<!-- TMPL_VAR Name="biblionumber" -->" />
 <input type="hidden" name="biblioitemnumber" value="<!-- TMPL_VAR Name="biblioitemnumber" -->" />
@@ -112,14 +101,33 @@ NAME="biblionumber"-->&amp;itemnumber=<!-- TMPL_VAR NAME="itemnumber" -->">Modif
 <!-- TMPL_IF NAME="wthdrawn" -->
     <input type="submit" name="submit" class="submit" value="Restore" />
 <!-- TMPL_ELSE -->
-    <input type="submit" name="submit" class="submit" value="Make Withdrawn" />
+    <input type="submit" name="submit" class="submit" value="Withdraw from Catalog" />
 <!-- /TMPL_IF -->
 </form></li>
+</ul>
+       <li> <span class="listgroup">History</span></li>
+       <ul>
+               <li><span class="label"><!-- TMPL_IF NAME="CAN_user_editcatalogue" --><a href="/cgi-bin/koha/acqui/orderreceive.pl?recieve=<!-- TMPL_VAR NAME="ordernumber" -->&amp;biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->&amp;invoice=<!-- TMPL_VAR NAME="booksellerinvoicenumber" -->&amp;catview=yes">Accession Date:</a><!-- TMPL_ELSE -->Accession Date:<!-- /TMPL_IF --></span> <!-- TMPL_VAR NAME="dateaccessioned" --></li>
+<li><span class="label">Renewals:</span> <!-- TMPL_IF NAME="renewals" --><!-- TMPL_VAR NAME="renewals" --><!-- TMPL_ELSE -->&nbsp;<!-- /TMPL_IF --></li>
+<li><span class="label">Total Issues:</span><!-- TMPL_IF NAME="issues" --><!-- TMPL_VAR NAME="issues" --><!-- TMPL_ELSE -->0<!-- /TMPL_IF -->  (<a href="/cgi-bin/koha/circ/bookcount.pl?&amp;biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->&amp;bi=<!-- TMPL_VAR NAME="biblioitemnumber" -->&amp;itm=<!-- TMPL_VAR NAME="itemnumber" -->">View Circulation History</a>)</li>
+                       <li><span class="label">Last seen:</span> <!-- TMPL_VAR NAME="datelastseen" --></li>
+                       <li><span class="label">Last borrowed:</span> <!-- TMPL_IF NAME="datelastborrowed" --><!-- TMPL_VAR NAME="datelastborrowed" --><!-- TMPL_ELSE -->&nbsp;<!-- /TMPL_IF --></li>
+                       <!-- TMPL_IF NAME="issue" --><li><span class="label">Date Due:</span> <!-- TMPL_VAR NAME="date_due" --></li><!-- /TMPL_IF -->
+                       <li><span class="label">Last Borrower 1:</span> <!-- TMPL_IF NAME="card0" --><!-- TMPL_VAR NAME="card0" --><!-- TMPL_ELSE -->&nbsp;<!-- /TMPL_IF --></li>
+                       <li><span class="label">Last Borrower 2:</span> <!-- TMPL_IF NAME="card1" --><!-- TMPL_VAR NAME="card1" --><!-- TMPL_ELSE -->&nbsp;<!-- /TMPL_IF --></li>
+       <li><span class="label">Paid for:</span> <!-- TMPL_IF NAME="paidfor" --><!-- TMPL_VAR NAME="paidfor" --><!-- TMPL_ELSE -->&nbsp;<!-- /TMPL_IF --></li>
 
+       </ul>
+<li> <span class="listgroup">Notes</span></li>
+<ul>
+       <li><span class="label">Public Note:</span> 
+               <form class="inline" action="updateitem.pl" method="post"><input type="hidden" name="biblionumber" value="<!-- TMPL_VAR Name="biblionumber" -->" />
+               <input type="hidden" name="biblioitemnumber" value="<!-- TMPL_VAR Name="biblioitemnumber" -->" /><input type="hidden" name="itemnumber" value="<!-- TMPL_VAR Name="itemnumber" -->" />
+               <textarea name="itemnotes" rows="2" cols="30" value="<!-- TMPL_VAR NAME="itemnotes" -->"><!-- TMPL_VAR NAME="itemnotes" --></textarea><input type="submit" name="submit" class="submit" value="Update" /> </form>
+        </li>
+
+</ul>
 
-<li><span class="label">Total Issues:</span><!-- TMPL_IF NAME="issues" --><!-- TMPL_VAR NAME="issues" --><!-- TMPL_ELSE -->0<!-- /TMPL_IF -->  (<a href="/cgi-bin/koha/circ/bookcount.pl?&amp;biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->&amp;bi=<!-- TMPL_VAR NAME="biblioitemnumber" -->&amp;itm=<!-- TMPL_VAR NAME="itemnumber" -->">View Circulation History</a>)</li>
-       <li><span class="label">Group Number:</span> <!-- TMPL_VAR NAME="biblioitemnumber" --> </li>
-       <li><span class="label">Biblio number:</span> <!-- TMPL_VAR NAME="biblionumber" --> </li>
 </ol>
 </div>
 <!-- /TMPL_LOOP -->