Bugzilla – Attachment 12433 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 on biblio detail page (staff+opac)
0001-Bug-7674-Separate-items-in-two-tabs-on-biblio-detail.patch (text/plain), 30.60 KB, created by
Julian Maurice
on 2012-09-21 14:03:10 UTC
(
hide
)
Description:
Bug 7674: Separate items in two tabs on biblio detail page (staff+opac)
Filename:
MIME Type:
Creator:
Julian Maurice
Created:
2012-09-21 14:03:10 UTC
Size:
30.60 KB
patch
obsolete
>From ca3dd1139c905e30a06717108b28db13606fa9a8 Mon Sep 17 00:00:00 2001 >From: Paul Poulain <paul.poulain@biblibre.com> >Date: Fri, 21 Sep 2012 10:36:56 +0200 >Subject: [PATCH] Bug 7674: Separate items in two tabs on biblio detail page > (staff+opac) > >Two tabs: "<branch> holdings" / "Other holdings" > >"<branch> 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 >(opac)), the display is unchanged (1 tab "Holdings") >--- > catalogue/detail.pl | 23 +- > installer/data/mysql/sysprefs.sql | 2 + > installer/data/mysql/updatedatabase.pl | 15 + > .../en/modules/admin/preferences/cataloguing.pref | 13 +- > .../prog/en/modules/catalogue/detail.tt | 291 +++++++++++--------- > koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt | 34 ++- > opac/opac-detail.pl | 35 ++- > 7 files changed, 263 insertions(+), 150 deletions(-) > >diff --git a/catalogue/detail.pl b/catalogue/detail.pl >index 7126257..c354d24 100755 >--- a/catalogue/detail.pl >+++ b/catalogue/detail.pl >@@ -173,15 +173,20 @@ $dat->{'hiddencount'} = scalar @all_items + @hostitems - scalar @items; > my $shelflocations = GetKohaAuthorisedValues('items.location', $fw); > my $collections = GetKohaAuthorisedValues('items.ccode' , $fw); > my $copynumbers = GetKohaAuthorisedValues('items.copynumber', $fw); >-my (@itemloop, %itemfields); >+my (@itemloop, @otheritemloop, %itemfields); > my $norequests = 1; > my $authvalcode_items_itemlost = GetAuthValCode('items.itemlost',$fw); > my $authvalcode_items_damaged = GetAuthValCode('items.damaged', $fw); > > my $analytics_flag; > my $materials_flag; # set this if the items have anything in the materials field >+my $currentbranch = C4::Context->userenv ? C4::Context->userenv->{branch} : undef; >+if ($currentbranch and C4::Context->preference('SeparateHoldings')) { >+ $template->param(SeparateHoldings => 1); >+} > foreach my $item (@items) { > >+ my $homebranchcode = $item->{homebranch}; > $item->{homebranch} = GetBranchName($item->{homebranch}); > > # can place holds defaults to yes >@@ -261,10 +266,19 @@ foreach my $item (@items) { > $analytics_flag=1; > $item->{countanalytics} = $countanalytics; > } >- if ($item->{'materials'} ne ''){ >- $materials_flag = 1; >+ if ($item->{materials} and $item->{'materials'} ne ''){ >+ $materials_flag = 1; >+ } >+ >+ if ($currentbranch and $currentbranch ne "NO_LIBRARY_SET" and C4::Context->preference('SeparateHoldings')) { >+ if ($homebranchcode and $homebranchcode eq $currentbranch) { >+ push @itemloop, $item; >+ } else { >+ push @otheritemloop, $item; >+ } >+ } else { >+ push @itemloop, $item; > } >- push @itemloop, $item; > } > > $template->param( norequests => $norequests ); >@@ -328,6 +342,7 @@ foreach ( keys %{$dat} ) { > $template->param( AmazonTld => get_amazon_tld() ) if ( C4::Context->preference("AmazonCoverImages")); > $template->param( > itemloop => \@itemloop, >+ otheritemloop => \@otheritemloop, > biblionumber => $biblionumber, > ($analyze? 'analyze':'detailview') =>1, > subscriptions => \@subs, >diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql >index 7b33ce6..4ea6ce4 100644 >--- a/installer/data/mysql/sysprefs.sql >+++ b/installer/data/mysql/sysprefs.sql >@@ -382,3 +382,5 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES(' > INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacMainUserBlockMobile','','Show the following HTML in its own column on the main page of the OPAC (mobile version):',NULL,'free'); > INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacShowLibrariesPulldownMobile','1','Show the libraries pulldown on the mobile version of the OPAC.',NULL,'YesNo'); > INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacShowFiltersPulldownMobile','1','Show the search filters pulldown on the mobile version of the OPAC.',NULL,'YesNo'); >+INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('SeparateHoldings', '0', 'Separate current branch holdings from other holdings', NULL, 'YesNo'); >+INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacSeparateHoldings', '0', 'Separate current branch holdings from other holdings (OPAC)', NULL, 'YesNo'); >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index 21e6462..99ab737 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -5926,6 +5926,21 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { > SetVersion ($DBversion); > } > >+$DBversion = "XXX"; >+if (C4::Context->preference("Version") < TransformToNum($DBversion)) { >+ $dbh->do(" >+ INSERT INTO systempreferences (variable,value,explanation,options,type) >+ VALUES('SeparateHoldings', '0', 'Separate current branch holdings from other holdings', NULL, 'YesNo'); >+ "); >+ $dbh->do(" >+ INSERT INTO systempreferences (variable,value,explanation,options,type) >+ VALUES('OpacSeparateHoldings', '0', 'Separate current branch holdings from other holdings (OPAC)', NULL, 'YesNo'); >+ "); >+ >+ print "Upgrade to $DBversion done (Add systempreferences SeparateHoldings and OpacSeparateHoldings) \n"; >+ SetVersion ($DBversion); >+} >+ > > $DBversion = "3.09.00.053"; > if (C4::Context->preference("Version") < TransformToNum($DBversion)) { >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref >index 404a04e..3842cf3 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref >@@ -156,4 +156,15 @@ Cataloging: > - pref: OpacSuppressionByIPRange > class: short > - (Leave blank if not used. Define a range like <code>192.168.</code>.) >- >+ - >+ - pref: SeparateHoldings >+ choices: >+ yes: "Separate" >+ no: "Don't separate" >+ - current branch holdings from other holdings at staff interface. >+ - >+ - pref: OpacSeparateHoldings >+ choices: >+ yes: "Separate" >+ no: "Don't separate" >+ - current branch holdings from other holdings at OPAC. >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >index 22f7908..556d0e9 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >@@ -255,18 +255,22 @@ function verify_images() { > </div> > <div id="bibliodetails" class="toptabs"> > >-<ul> >-<li><a href="#holdings">Holdings</a></li> >+<ul> >+ [% IF (SeparateHoldings) %] >+ <li><a href="#holdings">[% LoginBranchname %] holdings</a></li> >+ <li><a href="#otherholdings">Other holdings</a></li> >+ [% ELSE %] >+ <li><a href="#holdings">Holdings</a></li> >+ [% END %] > <li><a href="#description">Descriptions</a></li> > [% IF ( subscriptionsnumber ) %]<li><a href="#subscriptions">Subscriptions</a></li>[% END %] > [% IF ( FRBRizeEditions ) %][% IF ( XISBNS ) %]<li><a href="#editions">Editions</a></li>[% END %][% END %] > [% IF ( LocalCoverImages ) %][% IF ( localimages || CAN_user_tools_upload_local_cover_images ) %]<li><a href="#images">Images</a></li>[% END %][% END %] > </ul> > >-<div id="holdings"> >-[% IF ( count ) %] >- [% IF ( showncount ) %] >- <table> >+[% BLOCK items_table %] >+ <table> >+ <thead> > <tr> > [% IF ( item_level_itypes ) %]<th>Item type</th>[% END %] > <th>Current location</th> >@@ -281,148 +285,171 @@ function verify_images() { > [% IF ( itemdata_copynumber ) %]<th>Copy no.</th>[% END %] > [% IF materials %]<th>Materials specified</th>[% END %] > [% IF ( itemdata_itemnotes ) %]<th>Public notes</th>[% END %] >- [% IF ( SpineLabelShowPrintOnBibDetails ) %]<th>Spine label</th>[% END %] >- [% IF ( hostrecords ) %]<th>Host records</th>[% END %] >- [% IF ( analyze ) %]<th>Used in</th><th></th>[% END %] >+ [% IF ( SpineLabelShowPrintOnBibDetails ) %]<th>Spine label</th>[% END %] >+ [% IF ( hostrecords ) %]<th>Host records</th>[% END %] >+ [% IF ( analyze ) %]<th>Used in</th><th></th>[% END %] > </tr> >- [% FOREACH itemloo IN itemloop %] >+ </thead> >+ <tbody> >+ [% FOREACH item IN items %] > <tr> > [% IF ( item_level_itypes ) %] >- <td class="itype"> >- [% IF !noItemTypeImages && itemloo.imageurl %] >- <img src="[% itemloo.imageurl %]" alt="[% itemloo.description %]" title="[% itemloo.description %]" /> >- [% END %] >- [% itemloo.description %] >- </td> >+ <td class="itype"> >+ [% IF !noItemTypeImages && item.imageurl %] >+ <img src="[% item.imageurl %]" alt="[% item.description %]" title="[% item.description %]" /> >+ [% END %] >+ [% item.description %] >+ </td> > [% END %] >- <td class="location">[% UNLESS ( singlebranchmode ) %][% itemloo.branchname %] [% END %]</td> >- <td class="homebranch">[% itemloo.homebranch %]<span class="shelvingloc">[% itemloo.location %]</span> </td> >- [% IF ( itemdata_ccode ) %]<td>[% itemloo.ccode %]</td>[% END %] >- <td class="itemcallnumber">[% IF ( itemloo.itemcallnumber ) %] [% itemloo.itemcallnumber %][% END %]</td> >+ <td class="location">[% UNLESS ( singlebranchmode ) %][% item.branchname %] [% END %]</td> >+ <td class="homebranch">[% item.homebranch %]<span class="shelvingloc">[% item.location %]</span> </td> >+ [% IF ( itemdata_ccode ) %]<td>[% item.ccode %]</td>[% END %] >+ <td class="itemcallnumber">[% IF ( item.itemcallnumber ) %] [% item.itemcallnumber %][% END %]</td> > <td class="status"> > >- [% IF ( itemloo.datedue ) %] >- <span class="datedue">Checked out >- [% UNLESS ( itemloo.NOTSAMEBRANCH ) %] >- to <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% itemloo.borrowernumber %]"> >- [% IF ( itemloo.hidepatronname ) %] >- [% itemloo.cardnumber %] >- [% ELSE %] >- [% itemloo.firstname %] [% itemloo.surname %] >- [% END %] >- </a> >- [% END %] >- : due [% itemloo.datedue %] >- </span> >- [% ELSIF ( itemloo.transfertwhen ) %] >- In transit from [% itemloo.transfertfrom %], >- to [% itemloo.transfertto %], since [% itemloo.transfertwhen %] >- <!-- FIXME: the "since" clause is redundant w/ lastseen field --> >- [% END %] >+ [% IF ( item.datedue ) %] >+ <span class="datedue">Checked out >+ [% UNLESS ( item.NOTSAMEBRANCH ) %] >+ to <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% item.borrowernumber %]"> >+ [% IF ( item.hidepatronname ) %] >+ [% item.cardnumber %] >+ [% ELSE %] >+ [% item.firstname %] [% item.surname %] >+ [% END %] >+ </a> >+ [% END %] >+ : due [% item.datedue %] >+ </span> >+ [% ELSIF ( item.transfertwhen ) %] >+ In transit from [% item.transfertfrom %], >+ to [% item.transfertto %], since [% item.transfertwhen %] >+ <!-- FIXME: the "since" clause is redundant w/ lastseen field --> >+ [% END %] > >- [% IF ( itemloo.itemlost ) %] >- [% IF ( itemloo.itemlostloop ) %] >- [% FOREACH itemlostloo IN itemloo.itemlostloop %] >- [% IF ( itemlostloo.selected ) %] >+ [% IF ( item.itemlost ) %] >+ [% IF ( item.itemlostloop ) %] >+ [% FOREACH itemlostloo IN item.itemlostloop %] >+ [% IF ( itemlostloo.selected ) %] > <span class="lost">[% itemlostloo.lib %]</span> >+ [% END %] >+ [% END %] >+ [% ELSE %] >+ <span class="lost">Unavailable (lost or missing)</span> >+ [% END %] > [% END %] >- [% END %] >- [% ELSE %] >- <span class="lost">Unavailable (lost or missing)</span> >- [% END %] >- [% END %] > >- [% IF ( itemloo.wthdrawn ) %] >- <span class="wdn">Withdrawn</span> >- [% END %] >+ [% IF ( item.wthdrawn ) %] >+ <span class="wdn">Withdrawn</span> >+ [% END %] > >- [% IF ( itemloo.damaged ) %] >- [% IF ( itemloo.itemdamagedloop ) %] >- [% FOREACH itemdamagedloo IN itemloo.itemdamagedloop %] >- [% IF ( itemdamagedloo.selected ) %] >+ [% IF ( item.damaged ) %] >+ [% IF ( item.itemdamagedloop ) %] >+ [% FOREACH itemdamagedloo IN item.itemdamagedloop %] >+ [% IF ( itemdamagedloo.selected ) %] > <span class="dmg">[% itemdamagedloo.lib %]</span> >+ [% END %] >+ [% END %] >+ [% ELSE %] >+ <span class="dmg">Damaged</span> >+ [% END %] > [% END %] >+ >+ [% IF ( item.itemnotforloan ) %] >+ Not for loan >+ [% IF ( item.notforloanvalue ) %] >+ ([% item.notforloanvalue %]) >+ [% END %] > [% END %] >- [% ELSE %] >- <span class="dmg">Damaged</span> >- [% END %] >- [% END %] > >- [% IF ( itemloo.itemnotforloan ) %] >- Not for loan >- [% IF ( itemloo.notforloanvalue ) %] >- ([% itemloo.notforloanvalue %]) >- [% END %] >- [% END %] >+ [% IF ( item.reservedate ) %] >+ [% IF ( item.waitingdate ) %] >+ Waiting >+ [% ELSE %] >+ Item-level hold >+ [% END %] >+ [% IF ( canreservefromotherbranches ) %] >+ for <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% item.ReservedForBorrowernumber %]"> >+ [% IF ( item.hidepatronname ) %] >+ [% item.Reservedcardnumber %] >+ [% ELSE %] >+ [% item.ReservedForFirstname %] [% item.ReservedForSurname %] >+ [% END %] >+ </a> >+ [% END %] >+ [% IF ( item.waitingdate ) %] >+ at[% ELSE %]for delivery at >+ [% END %] >+ [% item.ExpectedAtLibrary %] >+ [% IF ( item.waitingdate ) %] >+ since [% item.waitingdate %] >+ [% ELSE %] >+ [% IF ( item.reservedate ) %] >+ (placed [% item.reservedate %]) >+ [% END %] >+ [% END %] >+ [% END %] >+ [% UNLESS ( item.itemnotforloan or item.onloan or item.itemlost or item.wthdrawn or item.damaged or item.transfertwhen or item.reservedate ) %] >+ Available >+ [% END %] > >- >- [% IF ( itemloo.reservedate ) %] >- [% IF ( itemloo.waitingdate ) %] >- Waiting >- [% ELSE %] >- Item-level hold >- [% END %] >- [% IF ( canreservefromotherbranches ) %]for <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% itemloo.ReservedForBorrowernumber %]"> >- [% IF ( itemloo.hidepatronname ) %] >- [% itemloo.Reservedcardnumber %] >- [% ELSE %] >- [% itemloo.ReservedForFirstname %] [% itemloo.ReservedForSurname %] >- [% END %] >- </a>[% END %] >- [% IF ( itemloo.waitingdate ) %] >- at[% ELSE %]for delivery at >- [% END %] [% itemloo.ExpectedAtLibrary %] >- [% IF ( itemloo.waitingdate ) %] >- since [% itemloo.waitingdate %] >- [% ELSE %] >- [% IF ( itemloo.reservedate ) %](placed [% itemloo.reservedate %])[% END %] >- [% END %] >- [% END %] >- [% UNLESS ( itemloo.itemnotforloan ) %][% UNLESS ( itemloo.onloan ) %][% UNLESS ( itemloo.itemlost ) %][% UNLESS ( itemloo.wthdrawn ) %][% UNLESS ( itemloo.damaged ) %][% UNLESS ( itemloo.transfertwhen ) %][% UNLESS ( itemloo.reservedate ) %] >- Available >- [% END %][% END %][% END %][% END %][% END %][% END %][% END %] >+ [% IF ( item.restricted ) %] >+ <span class="restricted">([% item.restricted %])</span> >+ [% END %] > >- [% IF ( itemloo.restricted ) %]<span class="restricted">([% itemloo.restricted %])</span>[% END %] >- > </td> >- <td class="datelastseen">[% itemloo.datelastseen %]</td> >- <td><a href="/cgi-bin/koha/catalogue/moredetail.pl?type=[% itemloo.type %]&itemnumber=[% itemloo.itemnumber %]&biblionumber=[% itemloo.biblionumber %]&bi=[% itemloo.biblioitemnumber %]#item[% itemloo.itemnumber %]">[% itemloo.barcode %]</a></td> >- [% IF ( volinfo ) %] <td class="enumchron"> >- [% IF ( itemdata_enumchron ) %] >- [% IF ( itemloo.enumchron ) %] >- [% itemloo.enumchron %][% IF ( itemloo.serialseq ) %] -- [% END %] >- [% END %] >- [% itemloo.serialseq %][% IF ( itemloo.publisheddate ) %] ([% itemloo.publisheddate %])[% END %] >- [% END %] >- </td>[% END %] >- [% IF ( itemdata_uri ) %] >- <td class="uri"><a href="[% itemloo.uri %]">[% itemloo.uri %]</a></td> >- [% END %] >- [% IF ( itemdata_copynumber ) %] >- <td class="copynumber">[% itemloo.copynumber %]</td> >- [% END %] >- [% IF materials %] >- <td class="materials"> [% itemloo.materials %] </td> >- [% END %] >- [% IF ( itemdata_itemnotes ) %]<td><div class="itemnotes">[% itemloo.itemnotes %]</div></td>[% END %] >- [% IF ( SpineLabelShowPrintOnBibDetails ) %] >- <td><a href="/cgi-bin/koha/labels/spinelabel-print.pl?barcode=[% itemloo.barcode %]" >Print label</a></td> >- [% END %] >- [% IF ( hostrecords ) %] >- <td>[% IF ( itemloo.hostbiblionumber) %]<a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% itemloo.hostbiblionumber %]" >[% itemloo.hosttitle %]</a>[% END %]</td> >- [% END %] >- [% IF ( analyze ) %]<td> >- [% IF ( itemloo.countanalytics ) %] >- <a href="/cgi-bin/koha/catalogue/search.pl?idx=hi&q=[% itemloo.itemnumber %]">[% itemloo.countanalytics %] analytics</a> >- [% END %]</td> >- [% END %] >- [% IF ( analyze ) %] >- <td><a href="/cgi-bin/koha/cataloguing/addbiblio.pl?hostbiblionumber=[% itemloo.biblionumber %]&hostitemnumber=[% itemloo.itemnumber %]">Create analytics</a></td> >- [% END %] >+ <td class="datelastseen">[% item.datelastseen %]</td> >+ <td><a href="/cgi-bin/koha/catalogue/moredetail.pl?type=[% item.type %]&itemnumber=[% item.itemnumber %]&biblionumber=[% item.biblionumber %]&bi=[% item.biblioitemnumber %]#item[% item.itemnumber %]">[% item.barcode %]</a></td> >+ [% IF ( volinfo ) %] >+ <td class="enumchron"> >+ [% IF ( itemdata_enumchron ) %] >+ [% IF ( item.enumchron ) %] >+ [% item.enumchron %] >+ [% IF ( item.serialseq ) %] -- [% END %] >+ [% END %] >+ [% item.serialseq %] >+ [% IF ( item.publisheddate ) %] ([% item.publisheddate %])[% END %] >+ [% END %] >+ </td> >+ [% END %] >+ [% IF ( itemdata_uri ) %] >+ <td class="uri"><a href="[% item.uri %]">[% item.uri %]</a></td> >+ [% END %] >+ [% IF ( itemdata_copynumber ) %] >+ <td class="copynumber">[% item.copynumber %]</td> >+ [% END %] >+ [% IF materials %] >+ <td class="materials"> [% item.materials %] </td> >+ [% END %] >+ [% IF ( itemdata_itemnotes ) %] >+ <td><div class="itemnotes">[% item.itemnotes %]</div></td> >+ [% END %] >+ [% IF ( SpineLabelShowPrintOnBibDetails ) %] >+ <td><a href="/cgi-bin/koha/labels/spinelabel-print.pl?barcode=[% item.barcode %]" >Print label</a></td> >+ [% END %] >+ [% IF ( hostrecords ) %] >+ <td>[% IF ( item.hostbiblionumber) %]<a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% item.hostbiblionumber %]" >[% item.hosttitle %]</a>[% END %]</td> >+ [% END %] >+ [% IF ( analyze ) %] >+ <td> >+ [% IF ( item.countanalytics ) %] >+ <a href="/cgi-bin/koha/catalogue/search.pl?idx=hi&q=[% item.itemnumber %]">[% item.countanalytics %] analytics</a> >+ [% END %] >+ </td> >+ [% END %] >+ [% IF ( analyze ) %] >+ <td><a href="/cgi-bin/koha/cataloguing/addbiblio.pl?hostbiblionumber=[% item.biblionumber %]&hostitemnumber=[% item.itemnumber %]">Create analytics</a></td> >+ [% END %] > > </tr> > [% END %] >- </table> >+ </tbody> >+ </table> >+[% END %][%# end of block items_table %] >+ >+<div id="holdings"> >+[% IF ( count ) %] >+ [% IF ( showncount ) %] >+ [% PROCESS items_table items=itemloop %] > [% END %] > [% IF ( hiddencount ) %] > <p><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber %]&showallitems=1">Show all items ([% hiddencount %] hidden)</a> >@@ -445,6 +472,16 @@ function verify_images() { > [% END %] > [% END %] > </div> >+ >+[% IF (SeparateHoldings) %] >+ <div id="otherholdings"> >+ [% IF (otheritemloop.size) %] >+ [% PROCESS items_table items=otheritemloop %] >+ [% ELSE %] >+ No other items. >+ [% END %] >+ </div> >+[% END %] > > <div id="description"> > <div class="content_set"> >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..f2a217b 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 %][% LoginBranchname %] 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..ef73fc4 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 and C4::Context->preference('OpacSeparateHoldings')) { >+ $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 and C4::Context->preference('OpacSeparateHoldings')) { >+ 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