Lines 34-45
use Koha::Libraries;
Link Here
|
34 |
|
34 |
|
35 |
my $input = new CGI; |
35 |
my $input = new CGI; |
36 |
my $itm = $input->param('itm'); |
36 |
my $itm = $input->param('itm'); |
37 |
my $bi = $input->param('bi'); |
|
|
38 |
my $biblionumber = $input->param('biblionumber'); |
37 |
my $biblionumber = $input->param('biblionumber'); |
39 |
|
38 |
|
40 |
my $idata = itemdatanum($itm); |
|
|
41 |
my $biblio = Koha::Biblios->find( $biblionumber ); |
39 |
my $biblio = Koha::Biblios->find( $biblionumber ); |
42 |
die "No valid biblionumber passed" unless $biblio; # FIXME A bit rude! |
40 |
my $item = Koha::Items->find( $itm ); |
|
|
41 |
|
42 |
if ( !defined $biblio or !defined $item ) { |
43 |
print $input->redirect("/cgi-bin/koha/errors/400.pl"); |
44 |
} |
43 |
|
45 |
|
44 |
my $lastmove = lastmove($itm); |
46 |
my $lastmove = lastmove($itm); |
45 |
|
47 |
|
Lines 76-85
$template->param(
Link Here
|
76 |
biblionumber => $biblionumber, |
78 |
biblionumber => $biblionumber, |
77 |
title => $biblio->title, |
79 |
title => $biblio->title, |
78 |
author => $biblio->author, |
80 |
author => $biblio->author, |
79 |
barcode => $idata->{'barcode'}, |
81 |
barcode => $item->barcode, |
80 |
biblioitemnumber => $bi, |
82 |
homebranch => $item->homebranch, |
81 |
homebranch => $idata->{homebranch}, |
83 |
holdingbranch => $item->holdingbranch, |
82 |
holdingbranch => $idata->{holdingbranch}, |
|
|
83 |
lastdate => $lastdate ? $lastdate : 0, |
84 |
lastdate => $lastdate ? $lastdate : 0, |
84 |
count => $count, |
85 |
count => $count, |
85 |
libraries => $libraries, |
86 |
libraries => $libraries, |
Lines 88-100
$template->param(
Link Here
|
88 |
output_html_with_http_headers $input, $cookie, $template->output; |
89 |
output_html_with_http_headers $input, $cookie, $template->output; |
89 |
exit; |
90 |
exit; |
90 |
|
91 |
|
91 |
sub itemdatanum { |
|
|
92 |
my ($itemnumber) = @_; |
93 |
my $sth = C4::Context->dbh->prepare("SELECT * FROM items WHERE itemnumber=?"); |
94 |
$sth->execute($itemnumber); |
95 |
return $sth->fetchrow_hashref; |
96 |
} |
97 |
|
98 |
sub lastmove { |
92 |
sub lastmove { |
99 |
my ($itemnumber) = @_; |
93 |
my ($itemnumber) = @_; |
100 |
my $dbh = C4::Context->dbh; |
94 |
my $dbh = C4::Context->dbh; |