Bug 7379: display of copy number description (AV)
The biblio/items detail pages (staff and OPAC) display the copynumber description if an authorized value is configured accordingly. Signed-off-by: Gaetan Boisson <gaetan.boisson@biblibre.com> Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
This commit is contained in:
parent
0023e2a1ce
commit
b9f6122ec6
4 changed files with 20 additions and 5 deletions
|
@ -172,6 +172,7 @@ $dat->{'hiddencount'} = scalar @all_items + @hostitems - scalar @items;
|
|||
|
||||
my $shelflocations = GetKohaAuthorisedValues('items.location', $fw);
|
||||
my $collections = GetKohaAuthorisedValues('items.ccode' , $fw);
|
||||
my $copynumbers = GetKohaAuthorisedValues('items.copynumber', $fw);
|
||||
my (@itemloop, %itemfields);
|
||||
my $norequests = 1;
|
||||
my $authvalcode_items_itemlost = GetAuthValCode('items.itemlost',$fw);
|
||||
|
@ -203,10 +204,13 @@ foreach my $item (@items) {
|
|||
$item->{itemdamagedloop} = GetAuthorisedValues($authvalcode_items_damaged, $item->{damaged}) if $authvalcode_items_damaged;
|
||||
}
|
||||
#get shelf location and collection code description if they are authorised value.
|
||||
# same thing for copy number
|
||||
my $shelfcode = $item->{'location'};
|
||||
$item->{'location'} = $shelflocations->{$shelfcode} if ( defined( $shelfcode ) && defined($shelflocations) && exists( $shelflocations->{$shelfcode} ) );
|
||||
my $ccode = $item->{'ccode'};
|
||||
$item->{'ccode'} = $collections->{$ccode} if ( defined( $ccode ) && defined($collections) && exists( $collections->{$ccode} ) );
|
||||
my $copynumber = $item->{'copynumber'};
|
||||
$item->{'copynumber'} = $copynumbers->{$copynumber} if ( defined($copynumber) && defined($copynumbers) && exists( $copynumbers->{$copynumber} ) );
|
||||
foreach (qw(ccode enumchron copynumber itemnotes uri)) {
|
||||
$itemfields{$_} = 1 if ( $item->{$_} );
|
||||
}
|
||||
|
|
|
@ -119,6 +119,7 @@ $data->{'showncount'}=$showncount;
|
|||
$data->{'hiddencount'}=$hiddencount; # can be zero
|
||||
|
||||
my $ccodes= GetKohaAuthorisedValues('items.ccode',$fw);
|
||||
my $copynumbers = GetKohaAuthorisedValues('items.copynumber',$fw);
|
||||
my $itemtypes = GetItemTypes;
|
||||
|
||||
$data->{'itemtypename'} = $itemtypes->{$data->{'itemtype'}}->{'description'};
|
||||
|
@ -134,7 +135,15 @@ foreach my $item (@items){
|
|||
$item->{'collection'} = $ccodes->{ $item->{ccode} } if ($ccodes);
|
||||
$item->{'itype'} = $itemtypes->{ $item->{'itype'} }->{'description'};
|
||||
$item->{'replacementprice'} = sprintf( "%.2f", $item->{'replacementprice'} );
|
||||
$item->{'copyvol'} = $item->{'copynumber'};
|
||||
if ( defined $item->{'copynumber'} ) {
|
||||
$item->{'displaycopy'} = 1;
|
||||
if ( defined $copynumbers->{ $item->{'copynumber'} } ) {
|
||||
$item->{'copyvol'} = $copynumbers->{ $item->{'copynumber'} }
|
||||
}
|
||||
else {
|
||||
$item->{'copyvol'} = $item->{'copynumber'};
|
||||
}
|
||||
}
|
||||
|
||||
# item has a host number if its biblio number does not match the current bib
|
||||
if ($item->{biblionumber} ne $biblionumber){
|
||||
|
|
|
@ -56,7 +56,7 @@
|
|||
[% END %]
|
||||
[% IF ( ITEM_DAT.collection ) %]<li><span class="label">Collection:</span> [% ITEM_DAT.collection %]</li> [% END %]
|
||||
<li><span class="label">Item callnumber:</span> [% ITEM_DAT.itemcallnumber %] </li>
|
||||
[% IF ( ITEM_DAT.copyvol ) %]<li><span class="label">Copy / Vol :</span> [% ITEM_DAT.copyvol %] </li> [% END %]
|
||||
[% IF ( ITEM_DAT.displaycopy ) %]<li><span class="label">Copy / Vol :</span> [% ITEM_DAT.copyvol %] </li> [% END %]
|
||||
[% IF ( ITEM_DAT.replacementprice ) %]<li><span class="label">Replacement price:</span> [% ITEM_DAT.replacementprice %] </li> [% END %]
|
||||
[% IF ITEM_DAT.materials %]<li><span class="label">Materials specified:</span> [% ITEM_DAT.materials %] </li> [% END %]
|
||||
</ol></div>
|
||||
|
|
|
@ -451,6 +451,7 @@ if ( $itemtype ) {
|
|||
}
|
||||
my $shelflocations =GetKohaAuthorisedValues('items.location',$dat->{'frameworkcode'}, 'opac');
|
||||
my $collections = GetKohaAuthorisedValues('items.ccode',$dat->{'frameworkcode'}, 'opac');
|
||||
my $copynumbers = GetKohaAuthorisedValues('items.copynumber',$dat->{'frameworkcode'}, 'opac');
|
||||
|
||||
#coping with subscriptions
|
||||
my $subscriptionsnumber = CountSubscriptionFromBiblionumber($biblionumber);
|
||||
|
@ -532,9 +533,10 @@ for my $itm (@items) {
|
|||
}
|
||||
|
||||
# get collection code description, too
|
||||
if ( my $ccode = $itm->{'ccode'} ) {
|
||||
$itm->{'ccode'} = $collections->{$ccode} if ( defined($collections) && exists( $collections->{$ccode} ) );
|
||||
}
|
||||
my $ccode = $itm->{'ccode'};
|
||||
$itm->{'ccode'} = $collections->{$ccode} if ( defined($collections) && exists( $collections->{$ccode} ) );
|
||||
my $copynumber = $itm->{'copynumber'};
|
||||
$itm->{'copynumber'} = $copynumbers->{$copynumber} if ( defined($copynumbers) && defined($copynumber) && exists( $copynumbers->{$copynumber} ) );
|
||||
if ( defined $itm->{'location'} ) {
|
||||
$itm->{'location_description'} = $shelflocations->{ $itm->{'location'} };
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue