diff --git a/C4/XSLT.pm b/C4/XSLT.pm
index 19ec16282b..6600045a34 100644
--- a/C4/XSLT.pm
+++ b/C4/XSLT.pm
@@ -188,7 +188,7 @@ sub XSLTParse4Display {
UseAuthoritiesForTracings TraceSubjectSubdivisions
Display856uAsImage OPACDisplay856uAsImage
UseControlNumber IntranetBiblioDefaultView BiblioDefaultView
- singleBranchMode
+ singleBranchMode OPACItemLocation
AlternateHoldingsField AlternateHoldingsSeparator / )
{
my $sp = C4::Context->preference( $syspref );
@@ -232,8 +232,14 @@ sub buildKohaItemsNamespace {
my %hi = map {$_ => 1} @$hidden_items;
@items = grep { !$hi{$_->{itemnumber}} } @items;
}
+
+ my $shelflocations = GetKohaAuthorisedValues('items.location',GetFrameworkCode($biblionumber), 'opac');
+ my $ccodes = GetKohaAuthorisedValues('items.ccode',GetFrameworkCode($biblionumber), 'opac');
+
my $branches = GetBranches();
my $itemtypes = GetItemTypes();
+ my $location = "";
+ my $ccode = "";
my $xml = '';
for my $item (@items) {
my $status;
@@ -272,8 +278,12 @@ sub buildKohaItemsNamespace {
$status = "available";
}
my $homebranch = $item->{homebranch}? xml_escape($branches->{$item->{homebranch}}->{'branchname'}):'';
- my $itemcallnumber = xml_escape($item->{itemcallnumber});
+ $location = xml_escape($shelflocations->{$item->{location}});
+ $ccode = xml_escape($ccodes->{$item->{ccode}});
+ my $itemcallnumber = xml_escape($item->{itemcallnumber});
$xml.= "- $homebranch".
+ "$location".
+ "$ccode".
"$status".
"".$itemcallnumber.""
. "
";
diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql
index ca9b6bd012..40bbfed3d8 100644
--- a/installer/data/mysql/sysprefs.sql
+++ b/installer/data/mysql/sysprefs.sql
@@ -416,3 +416,4 @@ INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES (
INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('IntranetNumbersPreferPhrase','0', NULL, 'Control the use of phr operator in callnumber and standard number staff client searches', 'YesNo');
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('UNIMARCField100Language', 'fre','UNIMARC field 100 default language',NULL,'short');
INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES('Persona',0,'Use Mozilla Persona for login','','YesNo');
+INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacItemLocation','callnum','Show the shelving location of items in the opac','callnum|ccode|location','Choice');
diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl
index 7e5e243566..5b5fb6cd8d 100755
--- a/installer/data/mysql/updatedatabase.pl
+++ b/installer/data/mysql/updatedatabase.pl
@@ -6445,6 +6445,13 @@ if ( CheckVersion($DBversion) ) {
}
+$DBversion = "3.11.00.XXX";
+if ( CheckVersion($DBversion) ) {
+ $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacItemLocation','callnum','Show the shelving location of items in the opac','callnum|ccode|location','Choice');");
+ print "Upgrade to $DBversion done (Bug 5079: Add OpacItemLocation syspref)\n";
+ SetVersion ($DBversion);
+}
+
=head1 FUNCTIONS
=head2 TableExists($table)
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref
index 6d6672c665..f1be4494ab 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref
@@ -277,6 +277,14 @@ OPAC:
yes: Allow
no: "Don't allow"
- patrons to log in to their accounts on the OPAC.
+ -
+ - Show
+ - pref: OpacItemLocation
+ choices:
+ location: location
+ ccode: "collection code"
+ callnum: "call number only"
+ - for items on the OPAC search results.
-
- pref: OpacPasswordChange
choices:
diff --git a/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACResults.xsl b/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACResults.xsl
index cdc803e6ec..cfcc2dd773 100644
--- a/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACResults.xsl
+++ b/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACResults.xsl
@@ -27,6 +27,7 @@
+
@@ -1039,7 +1040,7 @@
- []
+ []
(
)
@@ -1058,24 +1059,6 @@
-
-
-
- Copies available for reference:
-
-
-
- []
- (
-
- )
- . ,
-
-
-
-
-
Checked out (
@@ -1120,6 +1103,41 @@
).
+
+
+
+ Location(s):
+
+
+
+
+
+
+
+
+
+
+ . ,
+
+
+
+
+
+
+
+
+
+
+
+
+ . ,
+
+
+
+
+
+
+