summaryrefslogtreecommitdiff
authorJulian Maurice <julian.maurice@biblibre.com>2014-07-23 08:49:01 (GMT)
committer Tomas Cohen Arazi <tomascohen@gmail.com>2014-11-04 22:10:28 (GMT)
commit4e896da9cab2daba2cb925fc2a8bf61a70c6ea10 (patch) (side-by-side diff)
tree61d76cb66156b32d1820b837890208322d127247
parent2f2ff6729ddc7fe630382a376165955503033220 (diff)
Bug 11425: Display location label instead of code
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Minor conflicts solved Last three patches signed No koha-qa errors. Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Diffstat (more/less context) (ignore whitespace changes)
-rwxr-xr-xcatalogue/itemsearch.pl17
1 files changed, 14 insertions, 3 deletions
diff --git a/catalogue/itemsearch.pl b/catalogue/itemsearch.pl
index 280f35a..35d1a00 100755
--- a/catalogue/itemsearch.pl
+++ b/catalogue/itemsearch.pl
@@ -90,6 +90,9 @@ my ($template, $borrowernumber, $cookie) = get_template_and_user({
my $notforloan_avcode = GetAuthValCode('items.notforloan');
my $notforloan_values = GetAuthorisedValues($notforloan_avcode);
+my $location_avcode = GetAuthValCode('items.location');
+my $location_values = GetAuthorisedValues($location_avcode);
+
if (scalar keys %params > 0) {
# Parameters given, it's a search
@@ -193,10 +196,19 @@ if (scalar keys %params > 0) {
$notforloan_map->{$nfl_value->{authorised_value}} = $nfl_value->{lib};
}
+ # Get location labels
+ my $location_map = {};
+ foreach my $loc_value (@$location_values) {
+ $location_map->{$loc_value->{authorised_value}} = $loc_value->{lib};
+ }
+
foreach my $item (@$results) {
$item->{biblio} = GetBiblio($item->{biblionumber});
($item->{biblioitem}) = GetBiblioItemByBiblioNumber($item->{biblionumber});
$item->{status} = $notforloan_map->{$item->{notforloan}};
+ if (defined $item->{location}) {
+ $item->{location} = $location_map->{$item->{location}};
+ }
}
}
@@ -236,12 +248,11 @@ if ($format eq 'html') {
label => $branches->{$branchcode}->{branchname},
};
}
- my $locations = GetAuthorisedValues('LOC');
my @locations;
- foreach my $location (@$locations) {
+ foreach my $location (@$location_values) {
push @locations, {
value => $location->{authorised_value},
- label => $location->{lib},
+ label => $location->{lib} // $location->{authorised_value},
};
}
my @itemtypes = C4::ItemType->all();