diff --git a/C4/Items.pm b/C4/Items.pm index d2936081c2..939e68241b 100644 --- a/C4/Items.pm +++ b/C4/Items.pm @@ -65,6 +65,7 @@ BEGIN { GetItemInfosOf GetItemsByBiblioitemnumber GetItemsInfo + GetItemsLocationInfo get_itemnumbers_of GetItemnumberFromBarcode GetBarcodeFromItemnumber @@ -1347,6 +1348,72 @@ sub GetItemsInfo { } } +=head2 GetItemsLocationInfo + + my @itemlocinfo = GetItemsLocationInfo($biblionumber); + +Returns the branch names, shelving location and itemcallnumber for each item attached to the biblio in question + +C returns a list of references-to-hash. Data returned: + +=over 2 + +=item C<$data-E{homebranch}> + +Branch Name of the item's homebranch + +=item C<$data-E{holdingbranch}> + +Branch Name of the item's holdingbranch + +=item C<$data-E{location}> + +Item's shelving location code + +=item C<$data-E{location_intranet}> + +The intranet description for the Shelving Location as set in authorised_values 'LOC' + +=item C<$data-E{location_opac}> + +The OPAC description for the Shelving Location as set in authorised_values 'LOC'. Falls back to intranet description if no OPAC +description is set. + +=item C<$data-E{itemcallnumber}> + +Item's itemcallnumber + +=item C<$data-E{cn_sort}> + +Item's call number normalized for sorting + +=back + +=cut + +sub GetItemsLocationInfo { + my $biblionumber = shift; + my @results; + + my $dbh = C4::Context->dbh; + my $query = "SELECT a.branchname as homebranch, b.branchname as holdingbranch, + location, itemcallnumber, cn_sort + FROM items, branches as a, branches as b + WHERE homebranch = a.branchcode AND holdingbranch = b.branchcode + AND biblionumber = ? + ORDER BY cn_sort ASC"; + my $sth = $dbh->prepare($query); + $sth->execute($biblionumber); + + while ( my $data = $sth->fetchrow_hashref ) { + $data->{location_intranet} = GetKohaAuthorisedValueLib('LOC', $data->{location}); + $data->{location_opac}= GetKohaAuthorisedValueLib('LOC', $data->{location}, 1); + push @results, $data; + } + return @results; +} + + =head2 GetLastAcquisitions my $lastacq = GetLastAcquisitions({'branches' => ('branch1','branch2'), diff --git a/C4/VirtualShelves/Page.pm b/C4/VirtualShelves/Page.pm index 3614c24ce6..bbe89e83b1 100644 --- a/C4/VirtualShelves/Page.pm +++ b/C4/VirtualShelves/Page.pm @@ -221,7 +221,7 @@ sub shelfpage ($$$$$) { $this_item->{'normalized_oclc'} = GetNormalizedOCLCNumber($record,$marcflavour); $this_item->{'normalized_isbn'} = GetNormalizedISBN(undef,$record,$marcflavour); # Getting items infos for location display - my @items_infos = &GetItemsInfo( $this_item->{'biblionumber'}, $type ); + my @items_infos = &GetItemsLocationInfo( $this_item->{'biblionumber'}); $this_item->{'itemsissued'} = CountItemsIssued( $this_item->{'biblionumber'} ); $this_item->{'ITEM_RESULTS'} = \@items_infos; diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-basket.tmpl b/koha-tmpl/opac-tmpl/prog/en/modules/opac-basket.tmpl index 288f338fac..3c31cf6b9b 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-basket.tmpl +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-basket.tmpl @@ -293,7 +293,7 @@ function tagAdded() { Location(s)
  • - , + , () @@ -367,7 +367,7 @@ function tagAdded() {
    • - , + , () diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-shelves.tmpl b/koha-tmpl/opac-tmpl/prog/en/modules/opac-shelves.tmpl index 464636529e..da6ce16f6d 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-shelves.tmpl +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-shelves.tmpl @@ -271,7 +271,7 @@ $(function() { Holdings: - , + , ()., diff --git a/opac/opac-basket.pl b/opac/opac-basket.pl index 2ec664d279..5e92d15a77 100755 --- a/opac/opac-basket.pl +++ b/opac/opac-basket.pl @@ -68,7 +68,7 @@ foreach my $biblionumber ( @bibs ) { my $marcsubjctsarray = GetMarcSubjects( $record, $marcflavour ); my $marcseriesarray = GetMarcSeries ($record,$marcflavour); my $marcurlsarray = GetMarcUrls ($record,$marcflavour); - my @items = &GetItemsInfo( $biblionumber, 'opac' ); + my @items = &GetItemsLocationInfo( $biblionumber ); my $subtitle = GetRecordValue('subtitle', $record, GetFrameworkCode($biblionumber)); my $hasauthors = 0;