@@ -, +, @@ --- C4/Items.pm | 11 +- installer/data/mysql/sysprefs.sql | 2 + installer/data/mysql/updatedatabase.pl | 9 + .../prog/en/modules/admin/preferences/opac.pref | 16 ++ koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt | 225 +++++++++++--------- opac/opac-detail.pl | 5 + 6 files changed, 164 insertions(+), 104 deletions(-) --- a/C4/Items.pm +++ a/C4/Items.pm @@ -1192,7 +1192,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 @@ -1244,6 +1245,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 @@ -375,3 +375,5 @@ INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ( INSERT INTO systempreferences (variable,value,explanation,type) VALUES('EnableBorrowerFiles','0','If enabled, allows librarians to upload and attach arbitrary files to a borrower record.','YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('UpdateTotalIssuesOnCirc','0','Whether to update the totalissues field in the biblio on each circ.',NULL,'YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('IntranetSlipPrinterJS','','Use this JavaScript for printing slips. Define at least function printThenClose(). For use e.g. with Firefox PlugIn jsPrintSetup, see http://jsprintsetup.mozdev.org/','','Free'); +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'); +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'); --- a/installer/data/mysql/updatedatabase.pl +++ a/installer/data/mysql/updatedatabase.pl @@ -5556,6 +5556,15 @@ if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { SetVersion($DBversion); } +$DBversion = "3.09.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 preferences OpacLocationBranchToDisplay, OpacLocationBranchToDisplayShelving)\n"; + SetVersion($DBversion); +} + =head1 FUNCTIONS =head2 TableExists($table) --- 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 @@ -45,19 +45,19 @@ widgets : ['zebra'], sortList: [[0,0]] }); - [% IF ( GoogleJackets ) %] + [% 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 %] - [% IF ( opacuserlogin ) %][% IF ( loggedinusername ) %][% IF ( TagsEnabled ) %] + [% IF ( opacuserlogin ) %][% IF ( loggedinusername ) %][% IF ( TagsEnabled ) %] $(".tagbutton").click(KOHA.Tags.add_tag_button);[% END %][% END %][% END %] @@ -255,17 +255,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); }); //]]> @@ -444,25 +444,25 @@ YAHOO.util.Event.onContentReady("furtherm", function () { [% IF ( LibraryThingForLibrariesID ) %] - [% UNLESS ( LibraryThingForLibrariesTabbedView ) %] -
Library | -Serial collection | -
---|---|
[% serialcollection.branch %] | -[% serialcollection.text %] | -
Library | +Serial collection | +
[% serialcollection.branch %] | +[% serialcollection.text %] | +
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 %]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 %] @@ -725,45 +732,57 @@ YAHOO.util.Event.onContentReady("furtherm", function () {Item hold queue priority | [% END %]||||
---|---|---|---|---|---|---|---|---|---|---|---|
[% UNLESS ( noItemTypeImages ) %][% IF ( ITEM_RESULT.imageurl ) %][% END %][% END %] [% ITEM_RESULT.description %] | [% END %] -
- [% UNLESS ( singleBranchMode ) %]
-
- [% IF ( ITEM_RESULT.branchurl ) %]
- [% ITEM_RESULT.branchname %]
- [% ELSE %]
- [% ITEM_RESULT.branchname %]
- [% END %]
-
- [% ITEM_RESULT.branch_opac_info %]
- [% END %]
- [% ITEM_RESULT.location_description %]
- |
- [% IF ( itemdata_ccode ) %][% ITEM_RESULT.ccode %] | [% END %] -[% IF ( ITEM_RESULT.itemcallnumber ) %] [% ITEM_RESULT.itemcallnumber %][% IF ( OPACShelfBrowser ) %] (Browse shelf)[% END %][% END %] | - [% IF ( itemdata_enumchron ) %][% ITEM_RESULT.enumchron %] | [% END %] - [% IF ( itemdata_uri ) %][% ITEM_RESULT.uri %] | [% END %] - [% IF ( itemdata_copynumber ) %][% ITEM_RESULT.copynumber %] | [% END %] -[% INCLUDE 'item-status.inc' item = ITEM_RESULT %] | - [% IF ( itemdata_itemnotes ) %][% ITEM_RESULT.itemnotes %] | [% END %] -[% ITEM_RESULT.datedue | $KohaDates %] | - [% IF ( OPACShowBarcode ) %][% ITEM_RESULT.barcode %] | [% END %] - [% IF holds_count.defined || show_priority %] -- [% IF holds_count.defined %] [% ITEM_RESULT.holds_count %] [% END %] - [% IF ITEM_RESULT.priority %] - [% IF holds_count.defined %] - (priority [% ITEM_RESULT.priority %]) - [% ELSE %] - [% ITEM_RESULT.priority %] + |
[% UNLESS ( noItemTypeImages ) %][% IF ( ITEM_RESULT.imageurl ) %][% END %][% END %] [% ITEM_RESULT.description %] | [% END %] + [% UNLESS ( singleBranchMode ) %] + [% 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 %]
+ |
+ [% END %]
+
+ [% IF ( OpacLocationBranchToDisplay == 'home' || OpacLocationBranchToDisplay == 'both' ) %]
+ + + [% 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.location_description %] [% END %] - [% END %] - - [% END %] -