@@ -, +, @@ --- C4/Items.pm | 11 +++- installer/data/mysql/sysprefs.sql | 2 + installer/data/mysql/updatedatabase.pl | 8 +++ .../prog/en/modules/admin/preferences/opac.pref | 16 +++++ koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt | 62 +++++++++++++++----- opac/opac-detail.pl | 5 ++ 6 files changed, 89 insertions(+), 15 deletions(-) --- a/C4/Items.pm +++ a/C4/Items.pm @@ -1270,7 +1270,8 @@ sub GetItemsInfo { itemtypes.notforloan as notforloan_per_itemtype, holding.branchurl, holding.branchname, - holding.opac_info as branch_opac_info + holding.opac_info as branch_opac_info, + home.branchurl AS homebranchurl FROM items LEFT JOIN branches AS holding ON items.holdingbranch = holding.branchcode LEFT JOIN branches AS home ON items.homebranch=home.branchcode @@ -1322,6 +1323,14 @@ sub GetItemsInfo { if ( my $bdata = $bsth->fetchrow_hashref ) { $data->{'branchname'} = $bdata->{'branchname'}; } + $bsth = $dbh->prepare( + "SELECT * FROM branches WHERE branchcode = ? + " + ); + $bsth->execute( $data->{'homebranch'} ); + if ( my $bdata = $bsth->fetchrow_hashref ) { + $data->{'homebranchname'} = $bdata->{'branchname'}; + } $data->{'datedue'} = $datedue; # get notforloan complete status if applicable --- a/installer/data/mysql/sysprefs.sql +++ a/installer/data/mysql/sysprefs.sql @@ -245,6 +245,8 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('opaclanguagesdisplay','0','','If ON, enables display of Change Language feature on OPAC','YesNo'), ('opaclayoutstylesheet','opac.css','','Enter the name of the layout CSS stylesheet to use in the OPAC','free'), ('OPACLocalCoverImages','0','1','Display local cover images on OPAC search and details pages.','YesNo'), +('OpacLocationBranchToDisplay','holding','holding|home|both','In the OPAC, under location show which branch for Location in the record details.','Choice'), +('OpacLocationBranchToDisplayShelving','holding','holding|home|both','In the OPAC, display the shelving location under which which column.', 'Choice'), ('OpacMaintenance','0','','If ON, enables maintenance warning in OPAC','YesNo'), ('OpacMainUserBlock','Welcome to Koha...\r\n
Item type | [% END %] -Location | + [% IF ( OpacLocationBranchToDisplay == 'holding' || OpacLocationBranchToDisplay == 'both' || singleBranchMode ) %] +Current Location | + [% END %] + [% UNLESS ( singleBranchMode ) %] + [% IF ( OpacLocationBranchToDisplay == 'home' || OpacLocationBranchToDisplay == 'both' ) %] +Home Library | + [% END %] + [% END %] [% IF ( itemdata_ccode ) %]Collection | [% END %]Call number | [% IF ( itemdata_enumchron ) %]Vol info | [% END %] @@ -1528,21 +1535,48 @@ YAHOO.util.Event.onContentReady("furtherm", function () {
---|---|---|---|---|---|---|
[% UNLESS ( noItemTypeImages ) %][% IF ( ITEM_RESULT.imageurl ) %][% END %][% END %] [% ITEM_RESULT.description %] | [% END %] -
-
-
- [% UNLESS ( singleBranchMode ) %]
-
- [% IF ( ITEM_RESULT.branchurl ) %]
- [% ITEM_RESULT.branchname %]
+ [% UNLESS ( singleBranchMode ) %]
+ [% IF ( OpacLocationBranchToDisplay == 'holding' || OpacLocationBranchToDisplay == 'both' ) %]
+
- [% END %]
- [% ITEM_RESULT.location_description %]
-
+
+
+
+ [% IF ( ITEM_RESULT.branchurl ) %]
+ [% ITEM_RESULT.branchname %]
+ [% ELSE %]
+ [% ITEM_RESULT.branchname %]
+ [% END %]
+
+
+ [% IF ( OpacLocationBranchToDisplayShelving == 'holding' || OpacLocationBranchToDisplayShelving == 'both' ) %]
+ [% ITEM_RESULT.location_description %]
+ [% END %]
+
+ |
+ [% END %]
+
+ [% IF ( OpacLocationBranchToDisplay == 'home' || OpacLocationBranchToDisplay == 'both' ) %]
+ [% ITEM_RESULT.branch_opac_info %]
+
+
+
+
+
+ [% IF ( ITEM_RESULT.homebranchurl ) %]
+ [% ITEM_RESULT.homebranchname %]
+ [% ELSE %]
+ [% ITEM_RESULT.homebranchname %]
+ [% END %]
+
+
+ [% IF ( OpacLocationBranchToDisplayShelving == 'home' || OpacLocationBranchToDisplayShelving == 'both' ) %]
+ [% ITEM_RESULT.location_description %]
+ [% END %]
+ |
+ [% END %]
[% ELSE %]
- [% ITEM_RESULT.branchname %]
+ [% ITEM_RESULT.location_description %] |
[% END %]
- [% ITEM_RESULT.branch_opac_info %]
- |
[% IF ( itemdata_ccode ) %][% ITEM_RESULT.ccode %] | [% END %][% IF ( ITEM_RESULT.itemcallnumber ) %] --- a/opac/opac-detail.pl +++ a/opac/opac-detail.pl @@ -1100,4 +1100,9 @@ if ( C4::Context->preference('UseCourseReserves') ) { } } +$template->param( + 'OpacLocationBranchToDisplay' => C4::Context->preference('OpacLocationBranchToDisplay') , + 'OpacLocationBranchToDisplayShelving' => C4::Context->preference('OpacLocationBranchToDisplayShelving'), +); + output_html_with_http_headers $query, $cookie, $template->output; -- |