Bugzilla – Attachment 8171 Details for
Bug 7398
Show number of holds on a title in the OPAC details
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
patch
0001-bug7398-OPACShowHoldsCount-syspref.patch (text/plain), 6.40 KB, created by
Srdjan Jankovic
on 2012-03-12 02:35:56 UTC
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Srdjan Jankovic
Created:
2012-03-12 02:35:56 UTC
Size:
6.40 KB
patch
obsolete
>From 13136a90caaec8598fbe637cff6b6a8727435187 Mon Sep 17 00:00:00 2001 >From: Srdjan Jankovic <srdjan@catalyst.net.nz> >Date: Mon, 12 Mar 2012 15:31:08 +1300 >Subject: [PATCH] bug7398: OPACShowHoldsCount syspref > >Show holds count on OPAC detail if OPACShowHoldsCount is yes >--- > installer/data/mysql/sysprefs.sql | 3 ++- > installer/data/mysql/updatedatabase.pl | 7 +++++++ > .../prog/en/modules/admin/preferences/opac.pref | 6 ++++++ > koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt | 9 +++++++++ > opac/opac-detail.pl | 10 ++++++++++ > 5 files changed, 34 insertions(+), 1 deletions(-) > >diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql >index d16ff81..21f6de4 100644 >--- a/installer/data/mysql/sysprefs.sql >+++ b/installer/data/mysql/sysprefs.sql >@@ -347,4 +347,5 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES(' > INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('LinkerKeepStale',0,'If ON the authority linker will keep existing authority links for headings where it is unable to find a match.',NULL,'YesNo'); > INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('CatalogModuleRelink',0,'If OFF the linker will never replace the authids that are set in the cataloging module.',NULL,'YesNo'); > INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('ExpireReservesMaxPickUpDelay', '0', '', 'Enabling this allows holds to expire automatically if they have not been picked by within the time period specified in ReservesMaxPickUpDelay', 'YesNo'); >-INSERT INTO systempreferences` (variable,value,options,explanation,type) VALUES ('ExpireReservesMaxPickUpDelayCharge', '0', NULL , 'If ExpireReservesMaxPickUpDelay is enabled, and this field has a non-zero value, than a borrower whose waiting hold has expired will be charged this amount.', 'free') >+INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('ExpireReservesMaxPickUpDelayCharge', '0', NULL , 'If ExpireReservesMaxPickUpDelay is enabled, and this field has a non-zero value, than a borrower whose waiting hold has expired will be charged this amount.', 'free'); >+INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OPACShowHoldsCount',0,'Show the total number of holds in the OPAC details',NULL,'YesNo'); >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index b844560..38d19e1 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -4892,6 +4892,13 @@ if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { > SetVersion($DBversion); > } > >+$DBversion = "3.07.00.XXX"; >+if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { >+ $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OPACShowHoldsCount',0,'Show the total number of holds in the OPAC details',NULL,'YesNo')"); >+ print "Upgrade to $DBversion done (Added system preference OPACShowHoldsCount)\n"; >+ SetVersion($DBversion); >+} >+ > =head1 FUNCTIONS > > =head2 DropAllForeignKeys($table) >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref >index 1acc414..339107e 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref >@@ -343,6 +343,12 @@ OPAC: > no: "Don't allow" > - patrons to place holds on specific items in the OPAC. If this is disabled, users can only put a hold on the next available item. > - >+ - pref: OPACShowHoldsCount >+ choices: >+ yes: Show >+ no: "Don't show" >+ - the total number of holds on the details page >+ - > - pref: OpacRenewalAllowed > choices: > yes: Allow >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 7af60a0..40c5389 100644 >--- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt >+++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt >@@ -589,6 +589,9 @@ YAHOO.util.Event.onContentReady("furtherm", function () { > <th>Status</th> > [% IF ( itemdata_itemnotes ) %]<th>Notes</th>[% END %] > <th>Date Due</th> >+ [% IF holds_count.defined %] >+ <th>Holds</th> >+ [% END %] > </tr></thead> > <tbody>[% FOREACH ITEM_RESULT IN ITEM_RESULTS %] > <tr>[% IF ( item_level_itypes ) %]<td>[% 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 %] >@@ -601,10 +604,16 @@ YAHOO.util.Event.onContentReady("furtherm", function () { > <td>[% INCLUDE 'item-status.inc' item = ITEM_RESULT %]</td> > [% IF ( itemdata_itemnotes ) %]<td>[% ITEM_RESULT.itemnotes %]</td>[% END %] > <td>[% ITEM_RESULT.datedue %]</td> >+ [% IF holds_count.defined %] >+ <td>[% ITEM_RESULT.holds_count %]</td> >+ [% END %] > </tr> > [% END %]</tbody> > </table> > [% END %] >+ [% IF holds_count.defined %] >+ <div id="bib_holds">Holds: [% holds_count %]</div> >+ [% END %] > [% ELSE %] > [% IF ( ALTERNATEHOLDINGS ) %] > [% FOREACH ALTERNATEHOLDING IN ALTERNATEHOLDINGS %] >diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl >index 27684d4..b07c240 100755 >--- a/opac/opac-detail.pl >+++ b/opac/opac-detail.pl >@@ -479,10 +479,20 @@ if ($dat->{'count'} >= 50 && !$viewallitems) { > > my $biblio_authorised_value_images = C4::Items::get_authorised_value_images( C4::Biblio::get_biblio_authorised_values( $biblionumber, $record ) ); > >+my %item_reserves; >+if ( C4::Context->preference("OPACShowHoldsCount") ) { >+ my ($reserve_count,$reserves) = GetReservesFromBiblionumber($biblionumber); >+ $template->param( holds_count => $reserve_count ); >+ foreach (@$reserves) { >+ $item_reserves{ $_->{itemnumber} }++ if $_->{itemnumber}; >+ } >+} >+ > my $norequests = 1; > my $branches = GetBranches(); > my %itemfields; > for my $itm (@items) { >+ $itm->{holds_count} = $item_reserves{ $itm->{itemnumber} }; > $norequests = 0 > if ( (not $itm->{'wthdrawn'} ) > && (not $itm->{'itemlost'} ) >-- >1.6.5 >
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 7398
:
8171
|
8181
|
8430
|
8441
|
8552
|
8625
|
8701
|
8737
|
9008
|
9251
|
9439
|
9733
|
14138