Bug fixing statecollection itemization :
status and itemcallnumbers were not taken into account. re writing some code in order to have only a few blocks for serialadditems. changing status to itemstatus in template wherever it was necessary for script to work -- itemstatus(notforloan) is not status(arrived missing)--.
This commit is contained in:
parent
80794dc915
commit
5cc4d00a6f
21
C4/Bull.pm
21
C4/Bull.pm
|
|
@ -474,7 +474,7 @@ sub serialsitemize {
|
|||
unless ($exists){
|
||||
my $marcrecord = MARC::Record->new();
|
||||
my ($tag,$subfield)=MARCfind_marc_from_kohafield($dbh,"items.barcode",$fwk);
|
||||
warn "items.barcode : $tag , $subfield";
|
||||
# warn "items.barcode : $tag , $subfield";
|
||||
my $newField = MARC::Field->new(
|
||||
"$tag",'','',
|
||||
"$subfield" => $info->{barcode}
|
||||
|
|
@ -482,7 +482,7 @@ sub serialsitemize {
|
|||
$marcrecord->insert_fields_ordered($newField);
|
||||
if ($info->{branch}){
|
||||
my ($tag,$subfield)=MARCfind_marc_from_kohafield($dbh,"items.homebranch",$fwk);
|
||||
warn "items.homebranch : $tag , $subfield";
|
||||
# warn "items.homebranch : $tag , $subfield";
|
||||
if ($marcrecord->field($tag)) {
|
||||
$marcrecord->field($tag)->add_subfields("$subfield" => $info->{branch})
|
||||
}else {
|
||||
|
|
@ -493,6 +493,7 @@ sub serialsitemize {
|
|||
$marcrecord->insert_fields_ordered($newField);
|
||||
}
|
||||
my ($tag,$subfield)=MARCfind_marc_from_kohafield($dbh,"items.holdingbranch",$fwk);
|
||||
# warn "items.holdingbranch : $tag , $subfield";
|
||||
if ($marcrecord->field($tag)) {
|
||||
$marcrecord->field($tag)->add_subfields("$subfield" => $info->{branch})
|
||||
}else {
|
||||
|
|
@ -503,8 +504,22 @@ sub serialsitemize {
|
|||
$marcrecord->insert_fields_ordered($newField);
|
||||
}
|
||||
}
|
||||
if ($info->{itemcallnumber}){
|
||||
my ($tag,$subfield)=MARCfind_marc_from_kohafield($dbh,"items.itemcallnumber",$fwk);
|
||||
# warn "items.itemcallnumber : $tag , $subfield";
|
||||
if ($marcrecord->field($tag)) {
|
||||
$marcrecord->field($tag)->add_subfields("$subfield" => $info->{itemcallnumber})
|
||||
}else {
|
||||
my $newField = MARC::Field->new(
|
||||
"$tag",'','',
|
||||
"$subfield" => $info->{itemcallnumber}
|
||||
);
|
||||
$marcrecord->insert_fields_ordered($newField);
|
||||
}
|
||||
}
|
||||
if ($info->{notes}){
|
||||
my ($tag,$subfield)=MARCfind_marc_from_kohafield($dbh,"items.itemnotes",$fwk);
|
||||
# warn "items.itemnotes : $tag , $subfield";
|
||||
if ($marcrecord->field($tag)) {
|
||||
$marcrecord->field($tag)->add_subfields("$subfield" => $info->{notes})
|
||||
}else {
|
||||
|
|
@ -517,6 +532,7 @@ sub serialsitemize {
|
|||
}
|
||||
if ($info->{location}){
|
||||
my ($tag,$subfield)=MARCfind_marc_from_kohafield($dbh,"items.location",$fwk);
|
||||
# warn "items.location : $tag , $subfield";
|
||||
if ($marcrecord->field($tag)) {
|
||||
$marcrecord->field($tag)->add_subfields("$subfield" => $info->{location})
|
||||
}else {
|
||||
|
|
@ -529,6 +545,7 @@ sub serialsitemize {
|
|||
}
|
||||
if ($info->{status}){
|
||||
my ($tag,$subfield)=MARCfind_marc_from_kohafield($dbh,"items.notforloan",$fwk);
|
||||
# warn "items.notforloan : $tag , $subfield";
|
||||
if ($marcrecord->field($tag)) {
|
||||
$marcrecord->field($tag)->add_subfields("$subfield" => $info->{status})
|
||||
}else {
|
||||
|
|
|
|||
|
|
@ -89,47 +89,43 @@ my ($template, $loggedinuser, $cookie)
|
|||
|
||||
my $subs = &getsubscription($subscriptionid);
|
||||
my ($totalissues,@serialslist) = getserials($subscriptionid);
|
||||
my $branches = getbranches;
|
||||
my @branchloop;
|
||||
foreach my $thisbranch (keys %$branches) {
|
||||
my %row =(value => $thisbranch,
|
||||
branchname => $branches->{$thisbranch}->{'branchname'},
|
||||
);
|
||||
push @branchloop, \%row;
|
||||
}
|
||||
|
||||
my $itemstatushash = getitemstatus;
|
||||
my @itemstatusloop;
|
||||
foreach my $thisitemstatus (keys %$itemstatushash) {
|
||||
my %row =(itemval => $thisitemstatus,
|
||||
itemlib => $itemstatushash->{$thisitemstatus},
|
||||
);
|
||||
warn "".$row{'itemval'}.", ". $row{"itemlib"};
|
||||
push @itemstatusloop, \%row;
|
||||
}
|
||||
|
||||
my $itemlocationhash = getitemlocation;
|
||||
my @itemlocationloop;
|
||||
foreach my $thisitemlocation (keys %$itemlocationhash) {
|
||||
my %row =(value => $thisitemlocation,
|
||||
itemlocationname => $itemlocationhash->{$thisitemlocation},
|
||||
);
|
||||
push @itemlocationloop, \%row;
|
||||
}
|
||||
|
||||
if (C4::Context->preference("serialsadditems")){
|
||||
my $bibid=MARCfind_MARCbibid_from_oldbiblionumber($dbh,$subscription->{biblionumber});
|
||||
my $fwk=MARCfind_frameworkcode($dbh,$bibid);
|
||||
|
||||
my $branches = getbranches;
|
||||
my @branchloop;
|
||||
foreach my $thisbranch (keys %$branches) {
|
||||
my %row =(value => $thisbranch,
|
||||
branchname => $branches->{$thisbranch}->{'branchname'},
|
||||
);
|
||||
push @branchloop, \%row;
|
||||
}
|
||||
|
||||
my $itemstatushash = getitemstatus($fwk);
|
||||
my @itemstatusloop;
|
||||
foreach my $thisitemstatus (keys %$itemstatushash) {
|
||||
my %row =(itemval => $thisitemstatus,
|
||||
itemlib => $itemstatushash->{$thisitemstatus},
|
||||
);
|
||||
warn "".$row{'itemval'}.", ". $row{"itemlib"};
|
||||
push @itemstatusloop, \%row;
|
||||
}
|
||||
|
||||
my $itemlocationhash = getitemlocation($fwk);
|
||||
my @itemlocationloop;
|
||||
foreach my $thisitemlocation (keys %$itemlocationhash) {
|
||||
my %row =(value => $thisitemlocation,
|
||||
itemlocationname => $itemlocationhash->{$thisitemlocation},
|
||||
);
|
||||
push @itemlocationloop, \%row;
|
||||
}
|
||||
foreach my $data (@serialslist){
|
||||
$data->{"itemstatusloop"}=\@itemstatusloop if (scalar(@itemstatusloop));
|
||||
$data->{"itemlocationloop"}=\@itemlocationloop if (scalar(@itemlocationloop));
|
||||
$data->{"branchloop"}=\@branchloop ;
|
||||
}
|
||||
}
|
||||
|
||||
my $sth=$dbh->prepare("select * from subscriptionhistory where subscriptionid = ?");
|
||||
$sth->execute($subscriptionid);
|
||||
my $solhistory = $sth->fetchrow_hashref;
|
||||
|
||||
if (C4::Context->preference("serialsadditems")){
|
||||
$template->param(serialadditems =>C4::Context->preference("serialsadditems"),
|
||||
branchloop => \@branchloop,
|
||||
) ;
|
||||
|
|
@ -139,6 +135,11 @@ if (C4::Context->preference("serialsadditems")){
|
|||
$template->param(branchloop=>[],itemstatusloop=>[],itemlocationloop=>[]) ;
|
||||
}
|
||||
|
||||
my $sth=$dbh->prepare("select * from subscriptionhistory where subscriptionid = ?");
|
||||
$sth->execute($subscriptionid);
|
||||
my $solhistory = $sth->fetchrow_hashref;
|
||||
|
||||
|
||||
$template->param(
|
||||
serialslist => \@serialslist,
|
||||
biblionumber => $subscription->{biblionumber},
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@
|
|||
</td>
|
||||
<td>
|
||||
<!--TMPL_IF Name="itemstatus"-->
|
||||
<select name="status" size="1">
|
||||
<select name="itemstatus" size="1">
|
||||
<option value="">Item Status</option>
|
||||
<!-- TMPL_LOOP name="itemstatusloop" -->
|
||||
<option value="<!-- TMPL_VAR name="itemval" -->" <!-- TMPL_IF name="selected" -->selected<!-- /TMPL_IF -->><!-- TMPL_VAR name="itemlib" --></option>
|
||||
|
|
@ -148,7 +148,7 @@
|
|||
</td>
|
||||
<td>
|
||||
<!-- TMPL_IF Name="itemstatus"-->
|
||||
<select name="status" size="1">
|
||||
<select name="itemstatus" size="1">
|
||||
<option value="">Item Status</option>
|
||||
<!-- TMPL_LOOP name="itemstatusloop" -->
|
||||
<option value="<!-- TMPL_VAR name="itemval" -->" <!-- TMPL_IF name="selected" -->selected<!-- /TMPL_IF -->><!-- TMPL_VAR name="itemlib" --></option>
|
||||
|
|
|
|||
Loading…
Reference in New Issue