Bug fixing : 2470 Serials forgetting library

Using default values for PrepareItemrecordDisplay
It changes Biblio.pm
Adding a hash with default values to PrepareItemrecordDisplay
Usunf that API in Serials.pm and serials-edit.pl

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
This commit is contained in:
Henri-Damien LAURENT 2008-08-05 16:27:14 +02:00 committed by Joshua Ferraro
parent 111298c5b9
commit d7a56c856e
3 changed files with 24 additions and 4 deletions

View file

@ -1880,7 +1880,7 @@ Returns a hash with all the fields for Display a given item data in a template
sub PrepareItemrecordDisplay {
my ( $bibnum, $itemnum ) = @_;
my ( $bibnum, $itemnum, $defaultvalues ) = @_;
my $dbh = C4::Context->dbh;
my $frameworkcode = &GetFrameworkCode( $bibnum );
@ -1939,6 +1939,26 @@ sub PrepareItemrecordDisplay {
$value = $temp->subfield($CNsubfield);
}
}
if ( $tagslib->{$tag}->{$subfield}->{kohafield} eq
'items.itemcallnumber'
&& $defaultvalues->{'callnumber'} )
{
my $temp = $itemrecord->field($subfield) if ($itemrecord);
unless ($temp) {
$value = $defaultvalues->{'callnumber'};
}
}
if ( ($tagslib->{$tag}->{$subfield}->{kohafield} eq
'items.holdingbranch' ||
$tagslib->{$tag}->{$subfield}->{kohafield} eq
'items.homebranch')
&& $defaultvalues->{'branchcode'} )
{
my $temp = $itemrecord->field($subfield) if ($itemrecord);
unless ($temp) {
$value = $defaultvalues->{branchcode};
}
}
if ( $tagslib->{$tag}->{$subfield}->{authorised_value} ) {
my @authorised_values;
my %authorised_lib;

View file

@ -265,7 +265,7 @@ sub GetSerialInformation {
#Maybe GetMarcItem should return values on failure
$debug and warn "itemnumber :$itemnum->[0], bibnum :".$data->{'biblionumber'};
my $itemprocessed =
PrepareItemrecordDisplay( $data->{'biblionumber'}, $itemnum->[0] );
PrepareItemrecordDisplay( $data->{'biblionumber'}, $itemnum->[0] , $data );
$itemprocessed->{'itemnumber'} = $itemnum->[0];
$itemprocessed->{'itemid'} = $itemnum->[0];
$itemprocessed->{'serialid'} = $serialid;
@ -275,7 +275,7 @@ sub GetSerialInformation {
}
else {
my $itemprocessed =
PrepareItemrecordDisplay( $data->{'biblionumber'} );
PrepareItemrecordDisplay( $data->{'biblionumber'}, '', $data );
$itemprocessed->{'itemid'} = "N$serialid";
$itemprocessed->{'serialid'} = $serialid;
$itemprocessed->{'biblionumber'} = $data->{'biblionumber'};

View file

@ -145,7 +145,7 @@ foreach my $subscriptionid (@subscriptionids){
if ($serialdatalist[0]->{'serialsadditems'}){
#Create New empty item
$cell =
PrepareItemrecordDisplay( $serialdatalist[0]->{'biblionumber'} );
PrepareItemrecordDisplay( $serialdatalist[0]->{'biblionumber'},'', GetSubscription($subscriptionid));
$cell->{serialsadditems} = 1;
}
$cell->{'subscriptionid'}=$subscriptionid;