From 85247939ee147137bfe41ae756eb5f981916c2eb Mon Sep 17 00:00:00 2001 From: Srdjan Date: Mon, 26 Mar 2012 21:34:34 +1300 Subject: [PATCH] bug_7825: Sign off Changed OPACItemHolds syspref to be no|tes|force choice Amended opac-reserve.tt accordingly Signed-off-by: Delaye Stephane --- installer/data/mysql/sysprefs.sql | 2 +- installer/data/mysql/updatedatabase.pl | 8 ++++ .../prog/en/modules/admin/preferences/opac.pref | 5 ++- .../opac-tmpl/prog/en/modules/opac-reserve.tt | 44 +++++++------------- 4 files changed, 28 insertions(+), 31 deletions(-) diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql index 31485bc..d975796 100644 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -183,7 +183,7 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OAI-PMH:archiveID','KOHA-OAI-TEST','OAI-PMH archive identification',NULL,'Free'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OAI-PMH:MaxCount','50','OAI-PMH maximum number of records by answer to ListRecords and ListIdentifiers queries',NULL,'Integer'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OAI-PMH:ConfFile','','If empty, Koha OAI Server operates in normal mode, otherwise it operates in extended mode.',NULL,'File'); -INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACItemHolds','1','Allow OPAC users to place hold on specific items. If OFF, users can only request next available copy.','','YesNo'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACItemHolds','yes','Allow OPAC users to place hold on specific items. If No, users can only request next available copy. If Yes, users can choose between next available and specific copy. If Force, users *must* choose a specific copy.','no|yes|force','Choice'); INSERT INTO `systempreferences` (variable, value,options,type, explanation) VALUES ('AddPatronLists','categorycode','categorycode|category_type','Choice','Allow user to choose what list to pick up from when adding patrons'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('ExtendedPatronAttributes','0','Use extended patron IDs and attributes',NULL,'YesNo'); diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index f3a90d8..be64534 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -6984,6 +6984,14 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ( } + +$DBversion = "3.13.00.XXX"; +if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { + $dbh->do("UPDATE systempreferences SET type = 'Choice', options = 'no|yes|force', value = CASE value WHEN '1' THEN 'yes' ELSE 'no' END, explanation = 'Allow OPAC users to place hold on specific items. If No, users can only request next available copy. If Yes, users can choose between next available and specific copy. If Force, users *must* choose a specific copy.' WHERE variable = 'OPACItemHolds'"); + print "Upgrade to $DBversion done (Changed OPACItemHolds syspref to Choice)\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 81824e4..b1dc8e9 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 @@ -454,9 +454,10 @@ OPAC: - - pref: OPACItemHolds choices: - yes: Allow 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. + yes: Allow + force: Force + - 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. If this is forced, users must put a hold on a specific item. - - pref: OpacRenewalAllowed choices: 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 8e58e28..f5b9dde 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tt @@ -278,8 +278,8 @@ [% END %] Hold not needed after [% IF ( OPACShowHoldNotes ) %]Notes[% END %] - [% IF ( OPACItemHolds ) %] - Place on + [% IF OPACItemHolds == 'yes' %] + Place On [% END %] [% UNLESS ( singleBranchMode ) %] [% IF ( choose_branch ) %] @@ -367,50 +367,38 @@ [% IF ( OPACShowHoldNotes ) %][% IF ( bibitemloo.holdable ) %][% END %][% END %] [% IF ( bibitemloo.holdable ) %] - - [% IF ( OPACItemHolds ) %] - + + [% IF OPACItemHolds == 'yes' %] + - [% END %][% END %] - + [% ELSIF OPACItemHolds == 'force' %] + + [% END %] + [% END # holdable%] [% UNLESS ( singleBranchMode ) %] [% IF ( bibitemloo.holdable ) %] [% IF ( choose_branch ) %] @@ -456,7 +444,7 @@ [% END %] [% END %] - [% IF ( OPACItemHolds ) %] + [% IF OPACItemHolds == 'yes' || OPACItemHolds == 'force' %] [% IF ( bibitemloo.holdable ) %]   -- 1.7.10.4