Bugzilla – Attachment 12416 Details for
Bug 7674
Separate tabs for my holdings and others holdings
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 7674: Separate items in two tabs (opac/opac-detail.pl)
Bug-7674-Separate-items-in-two-tabs-opacopac-detai.patch (text/plain), 6.61 KB, created by
Julian Maurice
on 2012-09-21 12:47:18 UTC
(
hide
)
Description:
Bug 7674: Separate items in two tabs (opac/opac-detail.pl)
Filename:
MIME Type:
Creator:
Julian Maurice
Created:
2012-09-21 12:47:18 UTC
Size:
6.61 KB
patch
obsolete
>From 71f5ef96135416c7c924a7ebdd4c347a6d43a056 Mon Sep 17 00:00:00 2001 >From: Julian Maurice <julian.maurice@biblibre.com> >Date: Fri, 21 Sep 2012 11:36:44 +0200 >Subject: [PATCH] Bug 7674: Separate items in two tabs (opac/opac-detail.pl) > >Two tabs: "My holdings" / "Other holdings" > >"My holdings" tab contains items whose homebranch is the current branch. >"Other holdings" tab contains all other items. > >If current branch is not set (connected with mysql user, or not logged >in), the display is unchanged (1 tab "Holdings") >--- > koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt | 34 ++++++++++++++----- > opac/opac-detail.pl | 35 +++++++++++++++----- > 2 files changed, 51 insertions(+), 18 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 f740488..04fa783 100644 >--- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt >+++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt >@@ -643,9 +643,12 @@ YAHOO.util.Event.onContentReady("furtherm", function () { > <div id="bibliodescriptions" class="toptabs"> > > <ul> >-[% IF ( defaulttab == 'holdings' ) %]<li id="tab_holdings" class="ui-tabs-selected">[% ELSE %]<li id="tab_holdings">[% END %] >- <a href="#holdings">Holdings ( [% count %] )</a> >-</li> >+ [% IF ( defaulttab == 'holdings' ) %]<li id="tab_holdings" class="ui-tabs-selected">[% ELSE %]<li id="tab_holdings">[% END %] >+ <a href="#holdings">[% IF SeparateHoldings %]My holdings[% ELSE %]Holdings[% END %] ( [% itemloop.size || 0 %] )</a> >+ </li> >+ [% IF (SeparateHoldings) %] >+ <li><a href="#otherholdings">Other holdings ( [% otheritemloop.size || 0 %] )</a></li> >+ [% END %] > <li id="tab_descriptions"> <a href="#descriptions">Title notes</a></li> > [% IF ( SYNDETICS_TOC ) %] > <li id="tab_toc"> <a href="#toc">TOC</a></li> >@@ -733,11 +736,7 @@ YAHOO.util.Event.onContentReady("furtherm", function () { > </div> > [% END %] > >-<div id="holdings"> >-[% IF ( count ) %] >- [% IF ( lotsofitems ) %] >- <p>This record has many physical items. <a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblionumber %]&viewallitems=1#holdings">Click here to view them all.</a></p> >- [% ELSE %] >+[% BLOCK items_table %] > <table id="holdingst"> > <thead><tr> > [% IF ( item_level_itypes ) %]<th id="item_itemtype">Item type</th>[% END %] >@@ -757,7 +756,7 @@ YAHOO.util.Event.onContentReady("furtherm", function () { > <th>Item hold queue priority</th> > [% END %] > </tr></thead> >- <tbody>[% FOREACH ITEM_RESULT IN ITEM_RESULTS %] >+ <tbody>[% FOREACH ITEM_RESULT IN items %] > <tr>[% IF ( item_level_itypes ) %]<td class="itype">[% UNLESS ( noItemTypeImages ) %][% IF ( ITEM_RESULT.imageurl ) %]<img src="[% ITEM_RESULT.imageurl %]" title="[% ITEM_RESULT.description %]" alt="[% ITEM_RESULT.description %]" />[% END %][% END %] [% ITEM_RESULT.description %]</td>[% END %] > <td class="location"> > [% UNLESS ( singleBranchMode ) %] >@@ -796,6 +795,14 @@ YAHOO.util.Event.onContentReady("furtherm", function () { > </tr> > [% END %]</tbody> > </table> >+[% END %][%# end of items_table block %] >+ >+<div id="holdings"> >+[% IF ( itemloop.size ) %] >+ [% IF ( lotsofitems ) %] >+ <p>This record has many physical items. <a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblionumber %]&viewallitems=1#holdings">Click here to view them all.</a></p> >+ [% ELSE %] >+ [% PROCESS items_table items=itemloop %] > [% END %] > [% IF holds_count.defined || priority %] > <div id="bib_holds"> >@@ -880,6 +887,15 @@ YAHOO.util.Event.onContentReady("furtherm", function () { > <br clear="all" /> > </div> > >+[% IF (SeparateHoldings) %] >+ <div id="otherholdings"> >+ [% IF (otheritemloop.size) %] >+ [% PROCESS items_table items=otheritemloop %] >+ [% ELSE %] >+ No other items. >+ [% END %] >+ </div> >+[% END %] > > <div id="descriptions"> > <div class="content_set"> >diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl >index cdb4a5a..b075efe 100755 >--- a/opac/opac-detail.pl >+++ b/opac/opac-detail.pl >@@ -481,13 +481,6 @@ foreach my $subscription (@subscriptions) { > > $dat->{'count'} = scalar(@items); > >-# If there is a lot of items, and the user has not decided >-# to view them all yet, we first warn him >-# TODO: The limit of 50 could be a syspref >-my $viewallitems = $query->param('viewallitems'); >-if ($dat->{'count'} >= 50 && !$viewallitems) { >- $template->param('lotsofitems' => 1); >-} > > my $biblio_authorised_value_images = C4::Items::get_authorised_value_images( C4::Biblio::get_biblio_authorised_values( $biblionumber, $record ) ); > >@@ -516,6 +509,11 @@ $template->param( show_priority => $has_hold ) ; > my $norequests = 1; > my $branches = GetBranches(); > my %itemfields; >+my (@itemloop, @otheritemloop); >+my $currentbranch = C4::Context->userenv ? C4::Context->userenv->{branch} : undef; >+if ($currentbranch) { >+ $template->param(SeparateHoldings => 1); >+} > for my $itm (@items) { > $itm->{holds_count} = $item_reserves{ $itm->{itemnumber} }; > $itm->{priority} = $priority{ $itm->{itemnumber} }; >@@ -566,6 +564,24 @@ for my $itm (@items) { > $itm->{transfertfrom} = $branches->{$transfertfrom}{branchname}; > $itm->{transfertto} = $branches->{$transfertto}{branchname}; > } >+ my $homebranch = $itm->{homebranch}; >+ if ($currentbranch) { >+ if ($homebranch and $homebranch eq $currentbranch) { >+ push @itemloop, $itm; >+ } else { >+ push @otheritemloop, $itm; >+ } >+ } else { >+ push @itemloop, $itm; >+ } >+} >+ >+# If there is a lot of items, and the user has not decided >+# to view them all yet, we first warn him >+# TODO: The limit of 50 could be a syspref >+my $viewallitems = $query->param('viewallitems'); >+if (scalar(@itemloop) >= 50 && !$viewallitems) { >+ $template->param('lotsofitems' => 1); > } > > ## get notes and subjects from MARC record >@@ -694,7 +710,8 @@ if(C4::Context->preference("ISBD")) { > } > > $template->param( >- ITEM_RESULTS => \@items, >+ itemloop => \@itemloop, >+ otheritemloop => \@otheritemloop, > subscriptionsnumber => $subscriptionsnumber, > biblionumber => $biblionumber, > subscriptions => \@subs, >@@ -957,7 +974,7 @@ my $defaulttab = > ? 'subscriptions' : > $opac_serial_default eq 'serialcollection' && @serialcollections > 0 > ? 'serialcollection' : >- $opac_serial_default eq 'holdings' && $dat->{'count'} > 0 >+ $opac_serial_default eq 'holdings' && scalar (@itemloop) > 0 > ? 'holdings' : > $subscriptionsnumber > ? 'subscriptions' : >-- >1.7.10.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 7674
:
12416
|
12417
|
12418
|
12433
|
12749
|
12750
|
13002
|
13003
|
13189
|
13190
|
13191
|
13204
|
13205
|
13206
|
13207
|
13215
|
13832
|
13833
|
13834
|
13835
|
13990
|
13991
|
13992
|
13993
|
14082
|
14111
|
14528
|
16493
|
16502