From c80fe2be2dd56c6be63a84922dacf78999c09bec Mon Sep 17 00:00:00 2001 From: Srdjan Date: Wed, 23 May 2012 13:03:02 +1200 Subject: [PATCH] bug_7398: Replaced OPACDisplayRequestPriority syspref with OPACShowHoldQueueDetails New syspref is Choice, options being: - None - Priority only - Holds number only - Holds number and priority Show holds count on OPAC detail Signed-off-by: Kyle M Hall Signed-off-by: Paul Poulain --- admin/systempreferences.pl | 2 +- installer/data/mysql/sysprefs.sql | 2 +- installer/data/mysql/updatedatabase.pl | 15 +++++ .../en/modules/admin/preferences/opac.pref | 10 ++-- .../opac-tmpl/prog/en/modules/opac-detail.tt | 31 ++++++++++ .../opac-tmpl/prog/en/modules/opac-reserve.tt | 34 +++++++---- opac/opac-detail.pl | 24 ++++++++ opac/opac-reserve.pl | 60 ++++++++++--------- opac/opac-user.pl | 11 ++-- 9 files changed, 139 insertions(+), 50 deletions(-) diff --git a/admin/systempreferences.pl b/admin/systempreferences.pl index 5e3848d623..3659791c2f 100755 --- a/admin/systempreferences.pl +++ b/admin/systempreferences.pl @@ -348,7 +348,7 @@ $tabsysprefs{OPACViewOthersSuggestions} = "OPAC"; $tabsysprefs{URLLinkText} = "OPAC"; $tabsysprefs{OPACSearchForTitleIn} = "OPAC"; $tabsysprefs{OPACShelfBrowser} = "OPAC"; -$tabsysprefs{OPACDisplayRequestPriority} = "OPAC"; +$tabsysprefs{OPACShowHoldQueueDetails} = "OPAC"; $tabsysprefs{OPACAllowHoldDateInFuture} = "OPAC"; $tabsysprefs{OPACPatronDetails} = "OPAC"; $tabsysprefs{OPACFinesTab} = "OPAC"; diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql index 12928cc09d..cc3a9e2933 100644 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -234,7 +234,7 @@ INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES ('CurrencyFormat','US','US|FR','Determines the display format of currencies. eg: \'36000\' is displayed as \'360 000,00\' in \'FR\' or \'360,000.00\' in \'US\'.','Choice'); INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES ('AcqCreateItem','ordering','ordering|receiving|cataloguing','Define when the item is created : when ordering, when receiving, or in cataloguing module','Choice'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('AllowRenewalLimitOverride', '0', 'if ON, allows renewal limits to be overridden on the circulation screen',NULL,'YesNo'); -INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES ('OPACDisplayRequestPriority','0','','Show patrons the priority level on holds in the OPAC','YesNo'); +INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES ('OPACShowHoldQueueDetails','none','none|priority|holds|holds_priority','Show holds details in OPAC','Choice'); INSERT INTO `systempreferences` ( `variable` , `value` , `options` , `explanation` , `type` ) VALUES ( 'UseBranchTransferLimits', '0', '', 'If ON, Koha will will use the rules defined in branch_transfer_limits to decide if an item transfer should be allowed.', 'YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('AllowHoldPolicyOverride', '0', 'Allow staff to override hold policies when placing holds',NULL,'YesNo'); INSERT INTO `systempreferences` ( `variable` , `value` , `options` , `explanation` , `type` ) VALUES ( 'BranchTransferLimitsType', 'ccode', 'itemtype|ccode', 'When using branch transfer limits, choose whether to limit by itemtype or collection code.', 'Choice'); diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 82d48e74cd..b55220e26d 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -5269,6 +5269,21 @@ if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { SetVersion($DBversion); } + + +$DBversion = "3.07.00.XXX"; +if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { + $dbh->do("UPDATE systempreferences SET + variable = 'OPACShowHoldQueueDetails', + value = CASE value WHEN '1' THEN 'priority' ELSE 'none' END, + options = 'none|priority|holds|holds_priority', + explanation = 'Show holds details in OPAC', + type = 'Choice' + WHERE variable = 'OPACDisplayRequestPriority'"); + print "Upgrade to $DBversion done (Changed system preference OPACDisplayRequestPriority -> OPACShowHoldQueueDetails)\n"; + SetVersion($DBversion); +} + =head1 FUNCTIONS =head2 TableExists($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 89d3c42ccc..e4ea15ba26 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 @@ -79,11 +79,13 @@ OPAC: no: "Don't include" - "COinS / OpenURL / Z39.88 in OPAC search results.
Warning: Enabling this feature will slow OPAC search response times." - - - pref: OPACDisplayRequestPriority + - pref: OPACShowHoldQueueDetails choices: - yes: Show - no: "Don't show" - - patrons the priority level of their holds in the OPAC. + none: "Don't show any hold details" + priority: "Show priority level" + holds: "Show holds" + holds_priority: "Show holds and their priority level" + - to patrons in the OPAC. - - pref: OPACShowCheckoutName default: 0 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 cc59fb2ef1..e7cc4a3bdf 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt @@ -718,6 +718,11 @@ YAHOO.util.Event.onContentReady("furtherm", function () { Status [% IF ( itemdata_itemnotes ) %]Notes[% END %] Date due + [% IF holds_count.defined %] + Item holds + [% ELSIF show_priority %] + Item hold queue priority + [% END %] [% FOREACH ITEM_RESULT IN ITEM_RESULTS %] [% IF ( item_level_itypes ) %][% UNLESS ( noItemTypeImages ) %][% IF ( ITEM_RESULT.imageurl ) %][% ITEM_RESULT.description %][% END %][% END %] [% ITEM_RESULT.description %][% END %] @@ -742,10 +747,36 @@ YAHOO.util.Event.onContentReady("furtherm", function () { [% INCLUDE 'item-status.inc' item = ITEM_RESULT %] [% IF ( itemdata_itemnotes ) %][% ITEM_RESULT.itemnotes %][% END %] [% ITEM_RESULT.datedue | $KohaDates %] + [% IF holds_count.defined || show_priority %] + + [% 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 %] [% END %] + [% IF holds_count.defined || priority %] +
+ [% IF holds_count.defined %] + Total holds: [% holds_count %] + [% END %] + [% IF priority %] + [% IF holds_count.defined %] + (priority [% priority %]) + [% ELSE %] + Overall queue priority: [% priority %] + [% END %] + [% END %] +
+ [% END %] [% ELSE %] [% IF ( ALTERNATEHOLDINGS ) %] [% FOREACH ALTERNATEHOLDING IN ALTERNATEHOLDINGS %] diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tt index a78bc68188..050020b9d3 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tt @@ -242,7 +242,11 @@ [% UNLESS ( item_level_itypes ) %] Item type [% END %] - [% IF ( showpriority ) %] + [% IF showholds && showpriority %] + Holds and priority + [% ELSIF showholds %] + Holds + [% ELSIF showpriority %] Priority [% END %] [% IF ( reserve_in_future ) %] @@ -297,19 +301,23 @@ [% END %] - [% IF ( bibitemloo.holdable ) %][% UNLESS ( item_level_itypes ) %] - - [% IF ( bibitemloo.imageurl ) %][% END %] - [% bibitemloo.description %] - - [% END %][% END %] [% IF ( bibitemloo.holdable ) %] - [% IF ( showpriority ) %] - - [% bibitemloo.rank %] out of [% bibitemloo.reservecount %] - [% END %][% END %] - [% IF ( reserve_in_future ) %] - [% IF ( bibitemloo.holdable ) %] + + [% UNLESS ( item_level_itypes ) %] + + [% IF ( bibitemloo.imageurl ) %][% END %] + [% bibitemloo.description %] + + [% END %] + [% IF showholds || showpriority %] + + [% IF showpriority %] [% bibitemloo.rank %] [% END %] + [% IF showholds && showpriority %] out of [% END %] + [% IF showholds %] [% bibitemloo.reservecount %] [% END %] + + [% END %] + [% IF ( reserve_in_future ) %] +