bug 1616: update bib MARC and zebraqueue on item update

Fixed so that when using updateitem.pl to change an
item's lost, damaged, or withdrawn status, the
bib's MARC XML is updated and an entry is added
to zebraqueue.

As part of the fix, C4::Biblio::ModItemInMarconefield
now works correctly.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
This commit is contained in:
Galen Charlton 2007-11-27 10:28:09 -06:00 committed by Joshua Ferraro
parent 4bf5c1b132
commit eb52fe26c3
2 changed files with 14 additions and 9 deletions

View File

@ -472,7 +472,8 @@ sub ModItemInMarconefield {
$tag->update( $tagsubfield => $newvalue );
$record->delete_field($tag);
$record->insert_fields_ordered($tag);
&ModItemInMarc( $record, $biblionumber, $itemnumber, 0 );
my $frameworkcode = GetFrameworkCode( $biblionumber );
&ModItemInMarc( $record, $biblionumber, $itemnumber, $frameworkcode );
}
}
}
@ -481,7 +482,7 @@ sub ModItemInMarconefield {
=over
&ModItemInMarc( $record, $biblionumber, $itemnumber )
&ModItemInMarc( $record, $biblionumber, $itemnumber, $frameworkcode )
=back

View File

@ -38,14 +38,18 @@ 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();
my $item_data_hashref = GetItem($itemnumber, undef);
# 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;
# modify bib MARC
if ($itemlost ne $item_data_hashref->{'itemlost'}) {
ModItemInMarconefield($biblionumber, $itemnumber, 'items.itemlost', $itemlost);
}
if ($wthdrawn ne $item_data_hashref->{'wthdrawn'}) {
ModItemInMarconefield($biblionumber, $itemnumber, 'items.wthdrawn', $wthdrawn);
}
if ($damaged ne $item_data_hashref->{'damaged'}) {
ModItemInMarconefield($biblionumber, $itemnumber, 'items.damaged', $damaged);
}
# check reservations
my ($status, $reserve) = CheckReserves($itemnumber, $item_data_hashref->{'barcode'});