Browse Source

partial 1481: adding to templates, fixing non-display of data

Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
3.0.x
Joshua Ferraro 17 years ago
parent
commit
e494fadf0a
  1. 12
      C4/Biblio.pm
  2. 2
      catalogue/moredetail.pl
  3. 9
      catalogue/updateitem.pl
  4. 2
      installer/kohastructure.sql
  5. 56
      koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tmpl

12
C4/Biblio.pm

@ -1177,18 +1177,18 @@ that C<biblioitems.notes> is given as C<$itemdata-E<gt>{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

2
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

9
cataloguing/updateitem.pl → 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");

2
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,

56
koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tmpl

@ -43,7 +43,7 @@
<p><b>No. of Items:</b> <!-- TMPL_VAR NAME="count" --></p>
<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> |
<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" -->
@ -61,17 +61,61 @@ NAME="biblionumber"-->&amp;itemnumber=<!-- TMPL_VAR NAME="itemnumber" -->">Modif
<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" -->&amp;biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->&amp;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?&amp;biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->&amp;bi=<!-- TMPL_VAR NAME="biblioitemnumber" -->&amp;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?&amp;biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->&amp;bi=<!-- TMPL_VAR NAME="biblioitemnumber" -->&amp;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 -->

Loading…
Cancel
Save