#'
sub GetBiblioItemData {
- my ($bibitem) = @_;
+ my ($biblioitemnumber) = @_;
my $dbh = C4::Context->dbh;
my $sth =
$dbh->prepare(
-"Select *,biblioitems.notes as bnotes from biblioitems, biblio,itemtypes where biblio.biblionumber = biblioitems.biblionumber and biblioitemnumber = ? and biblioitems.itemtype = itemtypes.itemtype"
+ "SELECT *,biblioitems.notes AS bnotes
+ FROM biblioitems,biblio,itemtypes
+ WHERE biblio.biblionumber = biblioitems.biblionumber
+ AND biblioitemnumber = ? "
);
my $data;
-
- $sth->execute($bibitem);
-
+ $sth->execute($biblioitemnumber);
$data = $sth->fetchrow_hashref;
-
$sth->finish;
return ($data);
} # sub &GetBiblioItemData
my $biblionumber=$query->param('biblionumber');
my $title=$query->param('title');
my $bi=$query->param('bi');
-
+$bi = $biblionumber unless $bi;
my $data=GetBiblioItemData($bi);
my $dewey = $data->{'dewey'};
# FIXME Dewey is a string, not a number, & we should use a function
--- /dev/null
+#!/usr/bin/perl
+
+# $Id: updateitem.pl,v 1.9.2.1.2.4 2006/10/05 18:36:50 kados Exp $
+# Copyright 2006 LibLime
+#
+# This file is part of Koha.
+#
+# Koha is free software; you can redistribute it and/or modify it under the
+# terms of the GNU General Public License as published by the Free Software
+# Foundation; either version 2 of the License, or (at your option) any later
+# version.
+#
+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along with
+# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA 02111-1307 USA
+use strict; use warnings;
+use CGI;
+use C4::Context;
+use C4::Biblio;
+use C4::Output;
+use C4::Circulation;
+use C4::Accounts;
+use C4::Reserves;
+
+my $cgi= new CGI;
+
+my $biblionumber=$cgi->param('biblionumber');
+my $itemnumber=$cgi->param('itemnumber');
+my $biblioitemnumber=$cgi->param('biblioitemnumber');
+my $itemlost=$cgi->param('itemlost');
+my $wthdrawn=$cgi->param('wthdrawn');
+my $damaged=$cgi->param('damaged');
+
+my $confirm=$cgi->param('confirm');
+my $dbh = C4::Context->dbh;
+# get the rest of this item's information
+my $item_data_sth = $dbh->prepare("SELECT * FROM items WHERE itemnumber=?");
+$item_data_sth->execute($itemnumber);
+my $item_data_hashref = $item_data_sth->fetchrow_hashref();
+
+# superimpose the new on the old
+$item_data_hashref->{'itemlost'} = $itemlost if $itemlost;
+$item_data_hashref->{'wthdrawn'} = $wthdrawn if $wthdrawn;
+$item_data_hashref->{'damaged'} = $damaged if $damaged;
+
+# check reservations
+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();
+
+# 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
+ WHERE borrowernumber=? AND itemnumber=?");
+ $sth1->execute($issues->{'borrowernumber'},$itemnumber);
+ my $existing_charge_hashref=$sth1->fetchrow_hashref();
+
+ # OK, they haven't
+ unless ($existing_charge_hashref) {
+ # This item is on issue ... add replacement cost to the borrower's record and mark it returned
+ my $accountno = getnextacctno('',$issues->{'borrowernumber'},$dbh);
+ my $sth2=$dbh->prepare("INSERT INTO accountlines
+ (borrowernumber,accountno,date,amount,description,accounttype,amountoutstanding,itemnumber)
+ VALUES
+ (?,?,now(),?,?,'L',?,?)");
+ $sth2->execute($issues->{'borrowernumber'},$accountno,$item_data_hashref->{'replacementprice'},
+ "Lost Item $item_data_hashref->{'title'} $item_data_hashref->{'barcode'}",
+ $item_data_hashref->{'replacementprice'},$itemnumber);
+ $sth2->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");
+++ /dev/null
-#!/usr/bin/perl
-
-# $Id: updateitem.pl,v 1.9.2.1.2.4 2006/10/05 18:36:50 kados Exp $
-# Copyright 2006 LibLime
-#
-# This file is part of Koha.
-#
-# Koha is free software; you can redistribute it and/or modify it under the
-# terms of the GNU General Public License as published by the Free Software
-# Foundation; either version 2 of the License, or (at your option) any later
-# version.
-#
-# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
-# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
-# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along with
-# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
-# Suite 330, Boston, MA 02111-1307 USA
-use strict; use warnings;
-use C4::Context;
-use C4::Biblio;
-use C4::Output;
-use C4::Circulation;
-use C4::Accounts;
-use C4::Reserves;
-
-my $cgi= new CGI;
-
-my $biblionumber=$cgi->param('biblionumber');
-my $itemnumber=$cgi->param('itemnumber');
-my $biblioitemnumber=$cgi->param('biblioitemnumber');
-my $itemlost=$cgi->param('itemlost');
-my $wthdrawn=$cgi->param('wthdrawn');
-my $binding=$cgi->param('binding');
-
-my $confirm=$cgi->param('confirm');
-my $dbh = C4::Context->dbh;
-# get the rest of this item's information
-my $item_data_sth = $dbh->prepare("SELECT * FROM items WHERE itemnumber=?");
-$item_data_sth->execute($itemnumber);
-my $item_data_hashref = $item_data_sth->fetchrow_hashref();
-
-# superimpose the new on the old
-$item_data_hashref->{'itemlost'} = $itemlost if $itemlost;
-$item_data_hashref->{'wthdrawn'} = $wthdrawn if $wthdrawn;
-$item_data_hashref->{'binding'} = $binding if $binding;
-
-# check reservations
-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();
-
-# 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
- WHERE borrowernumber=? AND itemnumber=?");
- $sth1->execute($issues->{'borrowernumber'},$itemnumber);
- my $existing_charge_hashref=$sth1->fetchrow_hashref();
-
- # OK, they haven't
- unless ($existing_charge_hashref) {
- # This item is on issue ... add replacement cost to the borrower's record and mark it returned
- my $accountno = getnextacctno('',$issues->{'borrowernumber'},$dbh);
- my $sth2=$dbh->prepare("INSERT INTO accountlines
- (borrowernumber,accountno,date,amount,description,accounttype,amountoutstanding,itemnumber)
- VALUES
- (?,?,now(),?,?,'L',?,?)");
- $sth2->execute($issues->{'borrowernumber'},$accountno,$item_data_hashref->{'replacementprice'},
- "Lost Item $item_data_hashref->{'title'} $item_data_hashref->{'barcode'}",
- $item_data_hashref->{'replacementprice'},$itemnumber);
- $sth2->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=?,binding=? WHERE itemnumber=?");
-$sth->execute($wthdrawn,$itemlost,$binding,$itemnumber);
-
-print $cgi->redirect("moredetail.pl?biblionumber=$biblionumber&itemnumber=$itemnumber");
`datelastseen` date default NULL,
`stack` tinyint(1) default NULL,
`notforloan` tinyint(1) default NULL,
+ `damaged` tinyint(1) default NULL,
`itemlost` tinyint(1) default NULL,
`wthdrawn` tinyint(1) default NULL,
`bulk` varchar(30) default NULL,
`datelastseen` date default NULL,
`stack` tinyint(1) default NULL,
`notforloan` tinyint(1) default NULL,
+ `damaged` tinyint(1) default NULL,
`itemlost` tinyint(1) default NULL,
`wthdrawn` tinyint(1) default NULL,
`itemcallnumber` varchar(30) default NULL,
<p><b>No. of Items:</b> <!-- TMPL_VAR NAME="count" --></p>
<a href="/cgi-bin/koha/cataloguing/additem.pl?op=edititem&biblionumber=<!-- TMPL_VAR NAME="biblionumber"-->&itemnumber=<!-- TMPL_VAR NAME="itemnumber" -->">Modify</a> |
<a href="/cgi-bin/koha/cataloguing/additem.pl?op=delitem&biblionumber=<!--TMPL_VAR NAME="biblionumber"-->&itemnumber=<!--TMPL_VAR NAME="itemnumber"-->">Delete</a> |
- <a href="/cgi-bin/koha/reserve/request.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->">Requests</a>
+ <a href="/cgi-bin/koha/reserve/request.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->">Holds</a>
<br />
<!-- /TMPL_LOOP -->
<!-- TMPL_LOOP NAME="ITEM_DATA" -->
<b>Last Borrower 1:</b> <!-- TMPL_VAR NAME="card0" --><br />
<b>Last Borrower 2:</b> <!-- TMPL_VAR NAME="card1" --><br />
<b>Replacement Price:</b> <!-- TMPL_VAR NAME="replacementprice" --><br />
- <b>Item lost:</b> <!-- TMPL_IF NAME="itemlost" -->Yes<!-- TMPL_ELSE -->No<!-- /TMPL_IF --><br />
+
+ <b>Item Status Summary</b><!-- TMPL_IF name="notforloantext" --><!-- TMPL_VAR name="notforloantext" --> <!-- /TMPL_IF --><!-- TMPL_IF name="itemlost"-->Item Lost<!-- /TMPL_IF --> <!-- TMPL_IF NAME="binding" -->Item Damaged<!-- /TMPL_IF --> <!-- TMPL_IF NAME="wthdrawn" -->Item Withdrawn<!-- /TMPL_IF --><br/>
+
+<tr><th>Damaged Status:</th>
+<td>
+<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" -->" />
+<select name="binding" >
+<!-- TMPL_LOOP NAME="itembindingloop" -->
+<option value="<!-- TMPL_VAR NAME="authorised_value" -->"<!-- TMPL_IF NAME="selected" --> selected="selected"<!-- /TMPL_IF -->><!-- TMPL_VAR NAME="lib" --></option>
+<!-- /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>
+</td></tr>
+
+<tr><th>Lost Status:</th>
+<td>
+<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" -->" />
+<select name="itemlost" >
+<!-- TMPL_LOOP NAME="itemlostloop" -->
+<option value="<!-- TMPL_VAR NAME="authorised_value" -->"<!-- TMPL_IF NAME="selected" --> selected="selected"<!-- /TMPL_IF -->><!-- TMPL_VAR NAME="lib" --></option>
+<!-- /TMPL_LOOP -->
+</select>
+<input type="hidden" name="wthdrawn" value="<!-- TMPL_VAR NAME="wthdrawn" -->" />
+<input type="hidden" name="binding" value="<!-- TMPL_VAR NAME="binding" -->" />
+<input type="submit" name="submit" class="submit" value="Set Status" /></form>
+</td></tr>
+
+
<b>Paid for:</b> <!-- TMPL_VAR NAME="paidfor" --><br />
<b>Notes:</b> <!-- TMPL_VAR NAME="itemnotes" --><br />
<b>Renewals:</b> <!-- TMPL_VAR NAME="renewals" --><br />
<b><a href="/cgi-bin/koha/acqui/orderreceive.pl?recieve=<!-- TMPL_VAR NAME="ordernumber" -->&biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->&invoice=<!-- TMPL_VAR NAME="booksellerinvoicenumber" -->&catview=yes">
Accession
Date:</a></b> <!-- TMPL_VAR NAME="dateaccessioned" --><br />
- <b>Cancelled:</b> <!-- TMPL_IF NAME="wthdrawn" -->Yes<!-- TMPL_ELSE -->No<!-- /TMPL_IF --><br />
- <b><a
- href="/cgi-bin/koha/circ/bookcount.pl?&biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->&bi=<!-- TMPL_VAR NAME="biblioitemnumber" -->&itm=<!-- TMPL_VAR NAME="itemnumber" -->">Total
- Issues:</a></b> <!-- TMPL_VAR NAME="issues" --><br />
+
+<tr><th>Withdrawn:</th><td><!-- TMPL_IF NAME="wthdrawn" -->Yes<!-- TMPL_ELSE -->No<!-- /TMPL_IF --> <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" -->" />
+<input type="hidden" name="itemlost" value="<!-- TMPL_VAR NAME="itemlost" -->" />
+<input type="hidden" name="binding" value="<!-- TMPL_VAR NAME="binding" -->" />
+
+<!-- TMPL_IF NAME="wthdrawn" --><input type="hidden" name="wthdrawn" value="0" /><!-- TMPL_ELSE --><input type="hidden" name="wthdrawn" value="1" /><!-- /TMPL_IF -->
+<input type="submit" name="submit" class="submit" value="<!-- TMPL_IF NAME="wthdrawn" -->Restore<!-- TMPL_ELSE -->Make Withdrawn<!-- /TMPL_IF -->" /></form></td></tr>
+
+
+<tr><th>Total Issues:</th><td><!-- TMPL_VAR NAME="issues" --> (<a href="/cgi-bin/koha/bookcount.pl?&biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->&bi=<!-- TMPL_VAR NAME="biblioitemnumber" -->&itm=<!-- TMPL_VAR NAME="itemnumber" -->">View Circulation History</a>)</td></tr>
<b>Group Number:</b> <!-- TMPL_VAR NAME="biblioitemnumber" --> <br />
<b>Biblio number:</b> <!-- TMPL_VAR NAME="biblionumber" --> <br />
<!-- /TMPL_LOOP -->