From e494fadf0aae8eb1f8c3822ba29592671f87107d Mon Sep 17 00:00:00 2001 From: Joshua Ferraro Date: Sat, 6 Oct 2007 16:08:36 -0500 Subject: [PATCH] partial 1481: adding to templates, fixing non-display of data Signed-off-by: Chris Cormack Signed-off-by: Joshua Ferraro --- C4/Biblio.pm | 12 ++-- catalogue/moredetail.pl | 2 +- {cataloguing => catalogue}/updateitem.pl | 9 +-- installer/kohastructure.sql | 2 + .../prog/en/modules/catalogue/moredetail.tmpl | 56 +++++++++++++++++-- 5 files changed, 64 insertions(+), 17 deletions(-) rename {cataloguing => catalogue}/updateitem.pl (92%) diff --git a/C4/Biblio.pm b/C4/Biblio.pm index 1d7e7b1305..8ebb1482d2 100644 --- a/C4/Biblio.pm +++ b/C4/Biblio.pm @@ -1177,18 +1177,18 @@ that C is given as C<$itemdata-E{bnotes}>. #' 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 diff --git a/catalogue/moredetail.pl b/catalogue/moredetail.pl index d8835869ff..3c504c68ac 100755 --- a/catalogue/moredetail.pl +++ b/catalogue/moredetail.pl @@ -50,7 +50,7 @@ my ($template, $loggedinuser, $cookie) = get_template_and_user({ 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 diff --git a/cataloguing/updateitem.pl b/catalogue/updateitem.pl similarity index 92% rename from cataloguing/updateitem.pl rename to catalogue/updateitem.pl index 9ffd9c9679..5add7277c5 100755 --- a/cataloguing/updateitem.pl +++ b/catalogue/updateitem.pl @@ -18,6 +18,7 @@ # 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; @@ -32,7 +33,7 @@ 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 $damaged=$cgi->param('damaged'); my $confirm=$cgi->param('confirm'); my $dbh = C4::Context->dbh; @@ -44,7 +45,7 @@ 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; +$item_data_hashref->{'damaged'} = $damaged if $damaged; # check reservations my ($status, $reserve) = CheckReserves($itemnumber, $item_data_hashref->{'barcode'}); @@ -85,7 +86,7 @@ $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); +$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"); diff --git a/installer/kohastructure.sql b/installer/kohastructure.sql index 7145a24c39..a30d742ea7 100644 --- a/installer/kohastructure.sql +++ b/installer/kohastructure.sql @@ -761,6 +761,7 @@ CREATE TABLE `deleteditems` ( `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, @@ -867,6 +868,7 @@ CREATE TABLE `items` ( `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, diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tmpl index 2b10f53d29..d3c837af2a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tmpl @@ -43,7 +43,7 @@

No. of Items:

&itemnumber=">Modify | &itemnumber=">Delete | - ">Requests + ">Holds
@@ -61,17 +61,61 @@ NAME="biblionumber"-->&itemnumber=">Modif Last Borrower 1:
Last Borrower 2:
Replacement Price:
- Item lost: YesNo
+ + Item Status Summary Item Lost Item Damaged Item Withdrawn
+ +Damaged Status: + +
+" /> +" /> +" /> + +" /> +" /> +
+ + +Lost Status: + +
+" /> +" /> +" /> + +" /> +" /> +
+ + + Paid for:
Notes:
Renewals:
&biblionumber=&invoice=&catview=yes"> Accession Date:
- Cancelled: YesNo
- &bi=&itm=">Total - Issues:
+ +Withdrawn:YesNo
+" /> +" /> +" /> +" /> +" /> + + +RestoreMake Withdrawn" />
+ + +Total Issues: (&bi=&itm=">View Circulation History) Group Number:
Biblio number:
-- 2.20.1