Skip to content

Commit

Permalink
Bug 10856: (Follow-up) improve behavior of the "close shelf browser" …
Browse files Browse the repository at this point in the history
…link

In Firefox at least, the shelf browser cannot be reopened after
hiding it with the "close shelf browser" link. This followup improves
the behavior of the "close shelf browser" link so that the shelf browser
can be redisplayed.

To test, open a bibliographic detail page in the OPAC and click a
"browse shelf" link. Click the "close shelf browser" link--the shelf
browser should be hidden. Click the original "browse shelf" link and the
shelf browser should reappear without reloading the page.

Test with Firefox and Chrome (at least).

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
All tests and QA script pass.

Testing notes:
- New unit tests in t/db_dependent/ShelfBrowser.t pass.
- System preference  OPACShelfBrowser still works as expected.
- Closing and opening the shelf browser works as expected.
- Next and Previous links show new and nicer behaviour.
- Logs are clean.

Tested with Firefox and Chromium under Ubuntu.

Notes: The currently displayed record could maybe be highlighted
a bit better.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
  • Loading branch information
oleonard authored and gmcharlt committed Oct 4, 2013
1 parent 8449496 commit ff7b4d4
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
2 changes: 1 addition & 1 deletion koha-tmpl/opac-tmpl/prog/en/includes/shelfbrowser.inc
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
$(document).ready(function(){
$(".close_shelf").click(function(e){
e.preventDefault();
$("#shelfbrowser").hide();
$("#shelfbrowser").toggle();
});
[% IF shelfbrowser_prev_item.itemnumber %]
$("#browser_previous a").click(function(e){
Expand Down
15 changes: 13 additions & 2 deletions koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt
Original file line number Diff line number Diff line change
Expand Up @@ -1540,12 +1540,23 @@ YAHOO.util.Event.onContentReady("furtherm", function () {
<span class="shelvingloc">[% ITEM_RESULT.location_description %]</span>
</td>
[% IF ( itemdata_ccode ) %]<td class="collection">[% ITEM_RESULT.ccode %]</td>[% END %]
<td class="call_no" property="sku">[% IF ( ITEM_RESULT.itemcallnumber ) %] [% ITEM_RESULT.itemcallnumber %][% IF ( OPACShelfBrowser ) %] (<a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% ITEM_RESULT.biblionumber %]&amp;shelfbrowse_itemnumber=[% ITEM_RESULT.itemnumber %]#[% tab %]">Browse shelf</a>)[% END %][% END %]</td>
<td class="call_no" property="sku">
[% IF ( ITEM_RESULT.itemcallnumber ) %]
[% ITEM_RESULT.itemcallnumber %]
[% IF ( OPACShelfBrowser ) %]
[% IF ( ITEM_RESULT.itemnumber == starting_itemnumber ) %]
(<a class="close_shelf" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% ITEM_RESULT.biblionumber %]&amp;shelfbrowse_itemnumber=[% ITEM_RESULT.itemnumber %]#[% tab %]">Browse shelf</a>)
[% ELSE %]
(<a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% ITEM_RESULT.biblionumber %]&amp;shelfbrowse_itemnumber=[% ITEM_RESULT.itemnumber %]#[% tab %]">Browse shelf</a>)
[% END %]
[% END %]
[% END %]
</td>
[% IF ( itemdata_enumchron ) %]<td class="vol_info">[% ITEM_RESULT.enumchron %]</td>[% END %]
[% IF ( itemdata_uri ) %]<td class="url">
[% IF ITEM_RESULT.uri %]
[% IF trackclicks == 'track' || trackclicks == 'anonymous' %]
<a href="/cgi-bin/koha/tracklinks.pl?uri=[% ITEM_RESULT.uri | url %]&biblionumber=[% biblionumber |url %]&itemnumber=[% ITEM_RESULT.itemnumber | url %]" property="url"> Link to resource </a>
<a href="/cgi-bin/koha/tracklinks.pl?uri=[% ITEM_RESULT.uri | url %]&amp;biblionumber=[% biblionumber |url %]&amp;itemnumber=[% ITEM_RESULT.itemnumber | url %]" property="url"> Link to resource </a>
[% ELSE %]
<a href="[% ITEM_RESULT.uri %]" property="url">[% ITEM_RESULT.uri %]</a>
[% END %]
Expand Down
1 change: 1 addition & 0 deletions opac/opac-detail.pl
Original file line number Diff line number Diff line change
Expand Up @@ -931,6 +931,7 @@ BEGIN
my $nearby = GetNearbyItems($starting_itemnumber);

$template->param(
starting_itemnumber => $starting_itemnumber,
starting_homebranch => $nearby->{starting_homebranch}->{description},
starting_location => $nearby->{starting_location}->{description},
starting_ccode => $nearby->{starting_ccode}->{description},
Expand Down

0 comments on commit ff7b4d4

Please sign in to comment.