@@ -, +, @@ --- C4/Items.pm | 11 ++- installer/data/mysql/sysprefs.sql | 2 + installer/data/mysql/updatedatabase.pl | 7 + .../prog/en/modules/admin/preferences/opac.pref | 16 ++ koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt | 147 ++++++++++++-------- opac/opac-detail.pl | 5 + 6 files changed, 129 insertions(+), 59 deletions(-) --- a/C4/Items.pm +++ a/C4/Items.pm @@ -1222,7 +1222,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 @@ -1274,6 +1275,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 @@ -411,3 +411,5 @@ INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ( INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES('IDreamBooksReviews','0','Display book review snippets from IDreamBooks.com','','YesNo'); INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES('IDreamBooksReadometer','0','Display Readometer from IDreamBooks.com','','YesNo'); INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES('IDreamBooksResults','0','Display IDreamBooks.com rating in search results','','YesNo'); +INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) VALUES ('OpacLocationBranchToDisplay', 'holding', 'holding|home|both', 'In the OPAC, under location show which branch for Location in the record details.', 'Choice'); +INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) VALUES ('OpacLocationBranchToDisplayShelving', 'holding', 'holding|home|both', 'In the OPAC, display the shelving location under which which column.', 'Choice'); --- a/installer/data/mysql/updatedatabase.pl +++ a/installer/data/mysql/updatedatabase.pl @@ -6399,6 +6399,13 @@ if ( CheckVersion($DBversion) ) { SetVersion($DBversion); } +$DBversion = "3.11.00.XXX"; +if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { + $dbh->do("INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('OpacLocationBranchToDisplay', 'holding', 'holding|home|both', 'In the OPAC, under location show which branch for Location in the record details.', 'Choice')"); + $dbh->do("INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('OpacLocationBranchToDisplayShelving', 'holding', 'holding|home|both', 'In the OPAC, display the shelving location under which which column', 'Choice')"); + print "Upgrade to $DBversion done (Added system preference OpacLocationBranchToDisplay)\n"; + SetVersion($DBversion); +} =head1 FUNCTIONS --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref @@ -100,6 +100,22 @@ OPAC: no: "Don't show" - the name of the patron that has an item checked out on item detail pages on the OPAC. - + - Display the + - pref: OpacLocationBranchToDisplay + choices: + home: "home library" + holding: "holding library" + both: "home and holding libraries" + - for items on the OPAC record details page. + - + - Display the shelving location under the + - pref: OpacLocationBranchToDisplayShelving + choices: + home: "home library" + holding: "holding library" + both: "home and holding libraries" + - for items on the OPAC record details page. + - - pref: OpacKohaUrl default: 0 choices: --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt +++ a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt @@ -95,13 +95,13 @@ $("#highlight_toggle_off").show().click(function() {highlightOff(); return false;});[% END %][% END %] [% IF ( GoogleJackets ) %] KOHA.Google.GetCoverFromIsbn([% covernewwindow %]); - [% END %] - [% IF OpenLibraryCovers %] - KOHA.OpenLibrary.GetCoverFromIsbn(); - [% END %] - [% IF OPACLocalCoverImages %] - KOHA.LocalCover.GetCoverFromBibnumber(true); - [% END %] + [% END %] + [% IF OpenLibraryCovers %] + KOHA.OpenLibrary.GetCoverFromIsbn(); + [% END %] + [% IF OPACLocalCoverImages %] + KOHA.LocalCover.GetCoverFromBibnumber(true); + [% END %] [% IF ( NovelistSelectProfile ) %] novSelect.loadContentForISBN('[% normalized_isbn %]','[% NovelistSelectProfile %]', '[% NovelistSelectPassword %]', function(d){}); [% END %] @@ -355,17 +355,17 @@ function renderPagination(index, total, ul, highlIndex) YAHOO.util.Event.onContentReady("furtherm", function () { $("#furtherm").css("display","block").css("visibility","hidden"); - $("#furthersearches").parent().show(); - var furthersearchesMenu = new YAHOO.widget.Menu("furtherm"); - furthersearchesMenu.render(); - furthersearchesMenu.cfg.setProperty("context", ["furthersearches", "tr", "br"]); - furthersearchesMenu.subscribe("beforeShow",positionfurthersearchesMenu); - furthersearchesMenu.subscribe("show", furthersearchesMenu.focus); + $("#furthersearches").parent().show(); + var furthersearchesMenu = new YAHOO.widget.Menu("furtherm"); + furthersearchesMenu.render(); + furthersearchesMenu.cfg.setProperty("context", ["furthersearches", "tr", "br"]); + furthersearchesMenu.subscribe("beforeShow",positionfurthersearchesMenu); + furthersearchesMenu.subscribe("show", furthersearchesMenu.focus); function positionfurthersearchesMenu() { furthersearchesMenu.align("tr", "br"); - } - YAHOO.util.Event.addListener("furthersearches", "click", furthersearchesMenu.show, null, furthersearchesMenu); - YAHOO.widget.Overlay.windowResizeEvent.subscribe(positionfurthersearchesMenu); + } + YAHOO.util.Event.addListener("furthersearches", "click", furthersearchesMenu.show, null, furthersearchesMenu); + YAHOO.widget.Overlay.windowResizeEvent.subscribe(positionfurthersearchesMenu); }); //]]> @@ -555,25 +555,25 @@ YAHOO.util.Event.onContentReady("furtherm", function () { [% IF ( LibraryThingForLibrariesID ) %] - [% UNLESS ( LibraryThingForLibrariesTabbedView ) %] -
-
-
- [% END %] - - Reviews from LibraryThing.com: + [% UNLESS ( LibraryThingForLibrariesTabbedView ) %] +
+
+
+ [% END %] + + Reviews from LibraryThing.com: [% END %] [% IF ( GetShelves ) %] - List(s) this item appears in: - [% FOREACH GetShelve IN GetShelves %] - [% GetShelve.shelfname %] - [% IF ( loop.last ) %][% ELSE %]|[% END %] - [% END %] - + List(s) this item appears in: + [% FOREACH GetShelve IN GetShelves %] + [% GetShelve.shelfname %] + [% IF ( loop.last ) %][% ELSE %]|[% END %] + [% END %] + [% END %] [% IF ( TagsShowEnabled ) %] @@ -812,7 +812,7 @@ YAHOO.util.Event.onContentReady("furtherm", function () {
[% IF ( itemloop.size ) %] [% IF ( lotsofitems ) %] -

This record has many physical items. Click here to view them all.

+

This record has many physical items. Click here to view them all.

[% ELSE %] [% INCLUDE items_table items=itemloop tab="holdings" %] [% END %] @@ -915,13 +915,13 @@ YAHOO.util.Event.onContentReady("furtherm", function () { [% FOREACH SYNDETICS_REVIEW IN SYNDETICS_REVIEWS %] [% IF ( SYNDETICS_REVIEW.title ) %]

[% SYNDETICS_REVIEW.title %]

- [% FOREACH review IN SYNDETICS_REVIEW.reviews %] + [% FOREACH review IN SYNDETICS_REVIEW.reviews %] - [% IF ( review.content ) %] - [% review.content %] - [% END %] + [% IF ( review.content ) %] + [% review.content %] + [% END %] - [% END %] + [% END %] [% END %] [% END %]
@@ -1004,25 +1004,25 @@ YAHOO.util.Event.onContentReady("furtherm", function () { [% IF ( LibraryThingForLibrariesID ) %] [% IF ( LibraryThingForLibrariesTabbedView ) %] - -
-
- + +
+
+ - - -
- -
-
-
+ + +
+ +
+
+
- [% END %] + [% END %] [% END %] @@ -1261,7 +1261,14 @@ YAHOO.util.Event.onContentReady("furtherm", function () { [% IF ( item_level_itypes ) %][% END %] - + [% IF ( OpacLocationBranchToDisplay == 'holding' || OpacLocationBranchToDisplay == 'both' || singleBranchMode ) %] + + [% END %] + [% UNLESS ( singleBranchMode ) %] + [% IF ( OpacLocationBranchToDisplay == 'home' || OpacLocationBranchToDisplay == 'both' ) %] + + [% END %] + [% END %] [% IF ( itemdata_ccode ) %][% END %] [% IF ( itemdata_enumchron ) %][% END %] @@ -1279,19 +1286,43 @@ YAHOO.util.Event.onContentReady("furtherm", function () { [% FOREACH ITEM_RESULT IN items %] [% IF ( item_level_itypes ) %][% END %] - [% END %] - -
[% ITEM_RESULT.branch_opac_info %]
+ + [% IF ( OpacLocationBranchToDisplay == 'home' || OpacLocationBranchToDisplay == 'both' ) %] + + [% END %] + [% ELSE %] + [% END %] - [% ITEM_RESULT.location_description %] - [% IF ( itemdata_ccode ) %][% END %] [% IF ( itemdata_enumchron ) %][% END %] --- a/opac/opac-detail.pl +++ a/opac/opac-detail.pl @@ -1006,4 +1006,9 @@ if (C4::Context->preference('OpacHighlightedWords')) { $template->{VARS}->{query_desc} = $query->param('query_desc'); } +$template->param( + 'OpacLocationBranchToDisplay' => C4::Context->preference('OpacLocationBranchToDisplay') , + 'OpacLocationBranchToDisplayShelving' => C4::Context->preference('OpacLocationBranchToDisplayShelving'), +); + output_html_with_http_headers $query, $cookie, $template->output; --
Item typeLocationCurrent LocationHome LibraryCollectionCall numberVol info
[% UNLESS ( noItemTypeImages ) %][% IF ( ITEM_RESULT.imageurl ) %][% ITEM_RESULT.description %][% END %][% END %] [% ITEM_RESULT.description %] [% UNLESS ( singleBranchMode ) %] - - [% IF ( ITEM_RESULT.branchurl ) %] - [% ITEM_RESULT.branchname %] - [% ELSE %] - [% ITEM_RESULT.branchname %] + [% IF ( OpacLocationBranchToDisplay == 'holding' || OpacLocationBranchToDisplay == 'both' ) %] + + + [% IF ( ITEM_RESULT.branchurl ) %] + [% ITEM_RESULT.branchname %] + [% ELSE %] + [% ITEM_RESULT.branchname %] + [% END %] + + + [% IF ( OpacLocationBranchToDisplayShelving == 'holding' || OpacLocationBranchToDisplayShelving == 'both' ) %] + [% ITEM_RESULT.location_description %] + [% END %] + +
[% 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 %] + [% ITEM_RESULT.location_description %][% ITEM_RESULT.ccode %][% IF ( ITEM_RESULT.itemcallnumber ) %] [% ITEM_RESULT.itemcallnumber %][% IF ( OPACShelfBrowser ) %] (Browse shelf)[% END %][% END %][% ITEM_RESULT.enumchron %]