update item-at-wrong-branch error message to show homebranch.

Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
This commit is contained in:
Ryan Higgins 2007-11-13 11:59:09 -06:00 committed by Joshua Ferraro
parent 11140b426f
commit 9c2d58a470
3 changed files with 20 additions and 13 deletions

View File

@ -1209,9 +1209,9 @@ sub GetBiblioItemByBiblioNumber {
=over 4
$item = &GetBiblioFromItemNumber($itemnumber);
$item = &GetBiblioFromItemNumber($itemnumber,$barcode);
Looks up the item with the given itemnumber.
Looks up the item with the given itemnumber. if undef, try the barcode.
C<&itemnodata> returns a reference-to-hash whose keys are the fields
from the C<biblio>, C<biblioitems>, and C<items> tables in the Koha
@ -1223,16 +1223,22 @@ database.
#'
sub GetBiblioFromItemNumber {
my ( $itemnumber ) = @_;
my ( $itemnumber, $barcode ) = @_;
my $dbh = C4::Context->dbh;
my $sth = $dbh->prepare(
"SELECT * FROM items
LEFT JOIN biblio ON biblio.biblionumber = items.biblionumber
LEFT JOIN biblioitems ON biblioitems.biblioitemnumber = items.biblioitemnumber
WHERE items.itemnumber = ?"
);
$sth->execute($itemnumber);
my $sth;
if($itemnumber) {
$sth=$dbh->prepare( "SELECT * FROM items
LEFT JOIN biblio ON biblio.biblionumber = items.biblionumber
LEFT JOIN biblioitems ON biblioitems.biblioitemnumber = items.biblioitemnumber
WHERE items.itemnumber = ?") ;
$sth->execute($itemnumber);
} else {
$sth=$dbh->prepare( "SELECT * FROM items
LEFT JOIN biblio ON biblio.biblionumber = items.biblionumber
LEFT JOIN biblioitems ON biblioitems.biblioitemnumber = items.biblioitemnumber
WHERE items.barcode = ?") ;
$sth->execute($barcode);
}
my $data = $sth->fetchrow_hashref;
$sth->finish;
return ($data);

View File

@ -247,7 +247,7 @@ if ($barcode) {
my $noerror = 1;
my $noquestion = 1;
# Get the item title for more information
my $getmessageiteminfo = GetBiblioFromItemNumber($barcode);
my $getmessageiteminfo = GetBiblioFromItemNumber(undef,$barcode);
foreach my $impossible ( keys %$error ) {
$template->param(
@ -265,6 +265,7 @@ if ($barcode) {
$noquestion = 0;
}
$template->param(
itemhomebranch => $getmessageiteminfo->{'homebranch'} ,
day => $day,
month => $month,
year => $year

View File

@ -189,7 +189,7 @@ No patron matched <span class="ex"><!-- TMPL_VAR name="message" --></span>
<!-- /TMPL_IF -->
<!-- TMPL_IF NAME="NOTSAMEBRANCH" -->
<li><span class="problem">This item does not belong here!</span></li>
<li><span class="problem">This item belongs to <!-- TMPL_VAR NAME="itemhomebranch" --> and cannot be issued from this location.</span></li>
<!-- /TMPL_IF -->
</ul>