From 9d7dc5bb86c0939c2942d9f4525ec260d1db736f Mon Sep 17 00:00:00 2001 From: Julian Maurice Date: Tue, 9 Oct 2012 17:01:58 +0200 Subject: [PATCH] Bug 7674: Open shelf browser in appropriate tab If you click on "Browse shelf" under " holdings", shelf browser should open under this tab. If you click on "Browse shelf" under "other holdings" tab, it should open under "other holdings" tab. Signed-off-by: Kyle M Hall Signed-off-by: Katrin Fischer Signed-off-by: Jared Camins-Esakov --- .../opac-tmpl/prog/en/modules/opac-detail.tt | 317 +++++++++++------- opac/opac-detail.pl | 10 +- 2 files changed, 206 insertions(+), 121 deletions(-) diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt index 218e549c30..e43add326f 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt @@ -81,7 +81,7 @@ }); [% END %] - $("#holdingst").tablesorter({[% IF ( dateformat == 'metric' ) %] + $(".holdingst").tablesorter({[% IF ( dateformat == 'metric' ) %] dateFormat: 'uk',[% END %] widgets : ['zebra'], sortList: [[0,0]] @@ -743,73 +743,13 @@ YAHOO.util.Event.onContentReady("furtherm", function () { [% END %] -[% BLOCK items_table %] - - - [% IF ( item_level_itypes ) %][% END %] - - [% IF ( itemdata_ccode ) %][% END %] - - [% IF ( itemdata_enumchron ) %][% END %] - [% IF ( itemdata_uri ) %][% END %] - [% IF ( itemdata_copynumber ) %][% END %] - - [% IF ( itemdata_itemnotes ) %][% END %] - - [% IF ( OPACShowBarcode ) %][% END %] - [% IF holds_count.defined %] - - [% ELSIF show_priority %] - - [% END %] - - [% FOREACH ITEM_RESULT IN items %] - [% IF ( item_level_itypes ) %][% END %] - - [% IF ( itemdata_ccode ) %][% END %] - - [% IF ( itemdata_enumchron ) %][% END %] - [% IF ( itemdata_uri ) %][% END %] - [% IF ( itemdata_copynumber ) %][% END %] - - [% IF ( itemdata_itemnotes ) %][% END %] - - [% IF ( OPACShowBarcode ) %][% END %] - [% IF holds_count.defined || show_priority %] - - [% END %] - - [% END %] -
Item typeLocationCollectionCall numberVol infourlCopyStatusNotesDate dueBarcodeItem holdsItem hold queue priority
[% 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 %] - [% END %] - -
[% ITEM_RESULT.branch_opac_info %]
- [% END %] - [% ITEM_RESULT.location_description %] -
[% ITEM_RESULT.ccode %][% IF ( ITEM_RESULT.itemcallnumber ) %] [% ITEM_RESULT.itemcallnumber %][% IF ( OPACShelfBrowser ) %] (Browse shelf)[% END %][% END %][% ITEM_RESULT.enumchron %][% ITEM_RESULT.uri %][% ITEM_RESULT.copynumber %][% INCLUDE 'item-status.inc' item = ITEM_RESULT %][% ITEM_RESULT.itemnotes %][% ITEM_RESULT.datedue | $KohaDates %][% ITEM_RESULT.barcode %] - [% 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 %] - [% END %] - [% END %] -
-[% END %][%# end of items_table block %]
[% IF ( itemloop.size ) %] [% IF ( lotsofitems ) %]

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

[% ELSE %] - [% PROCESS items_table items=itemloop %] + [% INCLUDE items_table items=itemloop tab="holdings" %] [% END %] [% IF holds_count.defined || priority %]
@@ -835,72 +775,18 @@ YAHOO.util.Event.onContentReady("furtherm", function () { [% END %] [% END %] -[% IF ( OpenOPACShelfBrowser ) %] -
-
[% IF ( starting_homebranch ) %]Browsing [% starting_homebranch %] Shelves[% END %][% IF ( starting_location ) %], Shelving location: [% starting_location %][% END %][% IF ( starting_ccode ) %], Collection code: [% starting_ccode %][% END %] Close shelf browser
- - - - -[% FOREACH PREVIOUS_SHELF_BROWS IN PREVIOUS_SHELF_BROWSE %] - -[% END %] - -[% FOREACH NEXT_SHELF_BROWS IN NEXT_SHELF_BROWSE %] - -[% END %] - - - - -[% FOREACH PREVIOUS_SHELF_BROWS IN PREVIOUS_SHELF_BROWSE %] - -[% END %] - -[% FOREACH NEXT_SHELF_BROWS IN NEXT_SHELF_BROWSE %] - -[% END %] - -
- [% IF ( OPACAmazonCoverImages ) %][% IF ( PREVIOUS_SHELF_BROWS.browser_normalized_isbn ) %][% ELSE %]No cover image available[% END %][% END %] - [% IF ( SyndeticsEnabled ) %][% IF ( SyndeticsCoverImages ) %][% IF ( content_identifier_exists ) %] - [% IF ( using_https ) %] - - [% ELSE %][% END %] - [% ELSE %]No cover image available[% END %][% END %][% END %] - [% IF ( GoogleJackets ) %][% IF ( PREVIOUS_SHELF_BROWS.browser_normalized_isbn ) %]
[% ELSE %]No cover image available[% END %][% END %] - [% IF ( BakerTaylorEnabled ) %][% IF ( PREVIOUS_SHELF_BROWS.browser_normalized_isbn ) %] - See Baker & Taylor[% ELSE %]No cover image available[% END %][% END %] - -
- - [% IF ( OPACAmazonCoverImages ) %][% IF ( NEXT_SHELF_BROWS.browser_normalized_isbn ) %] - [% ELSE %]No cover image available[% END %][% END %] - - [% IF ( SyndeticsEnabled ) %][% IF ( SyndeticsCoverImages ) %][% IF ( content_identifier_exists ) %] - [% IF ( using_https ) %] - - [% ELSE %][% END %] - [% ELSE %]No cover image available[% END %][% END %][% END %] - - [% IF ( GoogleJackets ) %][% IF ( NEXT_SHELF_BROWS.browser_normalized_isbn ) %]
[% ELSE %]No cover image available[% END %][% END %] - [% IF ( BakerTaylorEnabled ) %][% IF ( NEXT_SHELF_BROWS.browser_normalized_isbn ) %] - See Baker & Taylor[% ELSE %]No cover image available[% END %][% END %] - -
[% PREVIOUS_SHELF_BROWS.itemcallnumber %][% PREVIOUS_SHELF_BROWS.title |html %][% NEXT_SHELF_BROWS.itemcallnumber %][% NEXT_SHELF_BROWS.title |html %]
- -
-[% END %] +[% INCLUDE shelfbrowser tab='holdings' %]
[% IF (SeparateHoldings) %]
[% IF (otheritemloop.size) %] - [% PROCESS items_table items=otheritemloop %] + [% INCLUDE items_table items=otheritemloop tab="otherholdings" %] [% ELSE %] No other items. [% END %] + [% INCLUDE shelfbrowser tab='otherholdings' %]
[% END %] @@ -1281,3 +1167,196 @@ YAHOO.util.Event.onContentReady("furtherm", function () { [% END %] [% INCLUDE 'opac-bottom.inc' %] + +[%# End of template %] + +[% BLOCK items_table %] + + + [% IF ( item_level_itypes ) %][% END %] + + [% IF ( itemdata_ccode ) %][% END %] + + [% IF ( itemdata_enumchron ) %][% END %] + [% IF ( itemdata_uri ) %][% END %] + [% IF ( itemdata_copynumber ) %][% END %] + + [% IF ( itemdata_itemnotes ) %][% END %] + + [% IF ( OPACShowBarcode ) %][% END %] + [% IF holds_count.defined %] + + [% ELSIF show_priority %] + + [% END %] + + [% FOREACH ITEM_RESULT IN items %] + [% IF ( item_level_itypes ) %][% END %] + + [% IF ( itemdata_ccode ) %][% END %] + + [% IF ( itemdata_enumchron ) %][% END %] + [% IF ( itemdata_uri ) %][% END %] + [% IF ( itemdata_copynumber ) %][% END %] + + [% IF ( itemdata_itemnotes ) %][% END %] + + [% IF ( OPACShowBarcode ) %][% END %] + [% IF holds_count.defined || show_priority %] + + [% END %] + + [% END %] +
Item typeLocationCollectionCall numberVol infourlCopyStatusNotesDate dueBarcodeItem holdsItem hold queue priority
[% 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 %] + [% END %] + +
[% ITEM_RESULT.branch_opac_info %]
+ [% END %] + [% ITEM_RESULT.location_description %] +
[% ITEM_RESULT.ccode %][% IF ( ITEM_RESULT.itemcallnumber ) %] [% ITEM_RESULT.itemcallnumber %][% IF ( OPACShelfBrowser ) %] (Browse shelf)[% END %][% END %][% ITEM_RESULT.enumchron %][% ITEM_RESULT.uri %][% ITEM_RESULT.copynumber %][% INCLUDE 'item-status.inc' item = ITEM_RESULT %][% ITEM_RESULT.itemnotes %][% ITEM_RESULT.datedue | $KohaDates %][% ITEM_RESULT.barcode %] + [% 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 %] + [% END %] + [% END %] +
+[% END %][%# end of items_table block %] + +[% BLOCK shelfbrowser %] + [% IF ( OpenOPACShelfBrowser and shelfbrowser_tab == tab) %] + [% tab %] + [% shelfbrowser_tab %] +
+
+ [% IF ( starting_homebranch ) %]Browsing [% starting_homebranch %] Shelves[% END %] + [% IF ( starting_location ) %], Shelving location: [% starting_location %][% END %] + [% IF ( starting_ccode ) %], Collection code: [% starting_ccode %][% END %] + Close shelf browser +
+ + + + + [% FOREACH PREVIOUS_SHELF_BROWS IN PREVIOUS_SHELF_BROWSE %] + + [% END %] + + [% FOREACH NEXT_SHELF_BROWS IN NEXT_SHELF_BROWSE %] + + [% END %] + + + + + + [% FOREACH PREVIOUS_SHELF_BROWS IN PREVIOUS_SHELF_BROWSE %] + + [% END %] + + [% FOREACH NEXT_SHELF_BROWS IN NEXT_SHELF_BROWSE %] + + [% END %] + +
+
+ Previous +
+
+ + [% IF ( OPACAmazonCoverImages ) %] + [% IF ( PREVIOUS_SHELF_BROWS.browser_normalized_isbn ) %] + + [% ELSE %] + No cover image available + [% END %] + [% END %] + [% IF ( SyndeticsEnabled ) %] + [% IF ( SyndeticsCoverImages ) %] + [% IF ( content_identifier_exists ) %] + [% IF ( using_https ) %] + + [% ELSE %] + + [% END %] + [% ELSE %] + No cover image available + [% END %] + [% END %] + [% END %] + [% IF ( GoogleJackets ) %] + [% IF ( PREVIOUS_SHELF_BROWS.browser_normalized_isbn ) %] +
+ [% ELSE %] + No cover image available + [% END %] + [% END %] + [% IF ( BakerTaylorEnabled ) %] + [% IF ( PREVIOUS_SHELF_BROWS.browser_normalized_isbn ) %] + See Baker & Taylor + [% ELSE %] + No cover image available + [% END %] + [% END %] +
+
+ + [% IF ( OPACAmazonCoverImages ) %] + [% IF ( NEXT_SHELF_BROWS.browser_normalized_isbn ) %] + + [% ELSE %] + No cover image available + [% END %] + [% END %] + + [% IF ( SyndeticsEnabled ) %] + [% IF ( SyndeticsCoverImages ) %] + [% IF ( content_identifier_exists ) %] + [% IF ( using_https ) %] + + [% ELSE %] + + [% END %] + [% ELSE %] + No cover image available + [% END %] + [% END %] + [% END %] + + [% IF ( GoogleJackets ) %] + [% IF ( NEXT_SHELF_BROWS.browser_normalized_isbn ) %] +
+ [% ELSE %] + No cover image available + [% END %] + [% END %] + [% IF ( BakerTaylorEnabled ) %] + [% IF ( NEXT_SHELF_BROWS.browser_normalized_isbn ) %] + See Baker & Taylor + [% ELSE %] + No cover image available + [% END %] + [% END %] +
+
+
+ Next +
+
+ [% PREVIOUS_SHELF_BROWS.itemcallnumber %] + [% PREVIOUS_SHELF_BROWS.title |html %] + + [% NEXT_SHELF_BROWS.itemcallnumber %] + [% NEXT_SHELF_BROWS.title |html %] +
+
+ [% END %] +[% END %][%# end of shelfbrowser block %] diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl index 6730163253..c0483a3110 100755 --- a/opac/opac-detail.pl +++ b/opac/opac-detail.pl @@ -874,8 +874,7 @@ if ( C4::Context->preference( "SocialNetworks" ) ) { # Shelf Browser Stuff if (C4::Context->preference("OPACShelfBrowser")) { - # pick the first itemnumber unless one was selected by the user - my $starting_itemnumber = $query->param('shelfbrowse_itemnumber'); # || $items[0]->{itemnumber}; + my $starting_itemnumber = $query->param('shelfbrowse_itemnumber'); if (defined($starting_itemnumber)) { $template->param( OpenOPACShelfBrowser => 1) if $starting_itemnumber; my $nearby = GetNearbyItems($starting_itemnumber,3); @@ -892,6 +891,13 @@ if (C4::Context->preference("OPACShelfBrowser")) { PREVIOUS_SHELF_BROWSE => $nearby->{prev}, NEXT_SHELF_BROWSE => $nearby->{next}, ); + + # in which tab shelf browser should open ? + if (grep { $starting_itemnumber == $_->{itemnumber} } @itemloop) { + $template->param(shelfbrowser_tab => 'holdings'); + } else { + $template->param(shelfbrowser_tab => 'otherholdings'); + } } } -- 2.39.5