[Koha-patches] [PATCH] RenewPrechecked System preference

Kyle M Hall kyle.m.hall at gmail.com
Thu Apr 1 16:45:12 CEST 2010


Enables a library to choose whether or not to have the
renew checkboxes checked automatically on the circ screen.
---
 circ/circulation.pl                                |    1 +
 installer/data/mysql/en/mandatory/sysprefs.sql     |    1 +
 .../1-Obligatoire/unimarc_standard_systemprefs.sql |    1 +
 installer/data/mysql/updatedatabase.pl             |    7 +++++++
 .../en/modules/admin/preferences/circulation.pref  |    6 ++++++
 .../prog/en/modules/circ/circulation.tmpl          |   10 +++++-----
 6 files changed, 21 insertions(+), 5 deletions(-)

diff --git a/circ/circulation.pl b/circ/circulation.pl
index ee13b9d..8a99354 100755
--- a/circ/circulation.pl
+++ b/circ/circulation.pl
@@ -713,6 +713,7 @@ if ( scalar( @canned_notes ) ) {
 $template->param(
     debt_confirmed            => $debt_confirmed,
     SpecifyDueDate            => $duedatespec_allow,
+    RenewPrechecked           => C4::Context->preference("RenewPrechecked"),
     CircAutocompl             => C4::Context->preference("CircAutocompl"),
 	AllowRenewalLimitOverride => C4::Context->preference("AllowRenewalLimitOverride"),
     dateformat                => C4::Context->preference("dateformat"),
diff --git a/installer/data/mysql/en/mandatory/sysprefs.sql b/installer/data/mysql/en/mandatory/sysprefs.sql
index 29e904c..5c10494 100644
--- a/installer/data/mysql/en/mandatory/sysprefs.sql
+++ b/installer/data/mysql/en/mandatory/sysprefs.sql
@@ -286,3 +286,4 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES
 INSERT INTO `systempreferences` ( `variable` , `value` , `options` , `explanation` , `type` ) VALUES ( 'PrintNoticesMaxLines', '0', '', 'If greater than 0, sets the maximum number of lines an overdue notice will print. If the number of items is greater than this number, the notice will end with a warning asking the borrower to check their online account for a full list of overdue items.', 'Integer' );
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('ILS-DI','0','Enables ILS-DI services at OPAC.','','YesNo');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('ILS-DI:Authorized_IPs','','.','Restricts usage of ILS-DI to some IPs','Free');
+INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES ( 'RenewPrechecked', '1', '' , 'Enables and disables the pre-checking of the renew checkboxes on the circ screen' , 'YesNo' );
diff --git a/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql b/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql
index e3ce7f3..f9afd43 100644
--- a/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql
+++ b/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql
@@ -288,3 +288,4 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('soundon','0','Activer les événements sonores de circulation pendant le prêt et le retour dans l''intranet. N''est pas encore supporté par tous les navigateurs web.','','YesNo');
 INSERT INTO `systempreferences` ( `variable` , `value` , `options` , `explanation` , `type` ) VALUES ( 'PrintNoticesMaxLines', '0', '', 'If greater than 0, sets the maximum number of lines an overdue notice will print. If the number of items is greater than this number, the notice will end with a warning asking the borrower to check their online account for a full list of overdue items.', 'Integer' );
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('ILS-DI','0','Active les services ILS-DI à l''OPAC.','','YesNo');
+INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES ( 'RenewPrechecked', '1', '' , 'Enables and disables the pre-checking of the renew checkboxes on the circ screen' , 'YesNo' );
diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl
index e21b37c..4f5d520 100755
--- a/installer/data/mysql/updatedatabase.pl
+++ b/installer/data/mysql/updatedatabase.pl
@@ -3548,6 +3548,13 @@ if (C4::Context->preference('Version') < TransformToNum($DBversion)){
     SetVersion ($DBversion);
 }
 
+$DBversion = "3.01.00.129";
+if (C4::Context->preference("KohaPlusVersion") < TransformToNum($DBversion)) {
+    $dbh->do("INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES ( 'RenewPrechecked', '1', '' , 'Enables and disables the pre-checking of the renew checkboxes on the circ screen' , 'YesNo' )");
+    print "Upgrade to $DBversion done ( Added RenewPrechecked system preference )\n";
+    SetVersion($DBversion);
+}
+
 =item DropAllForeignKeys($table)
 
   Drop all foreign keys of the table $table
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref
index a17be02..e971a6f 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref
@@ -65,6 +65,12 @@ Circulation:
                   yes: Show
                   no: "Don't show"
             - a button to clear the current patron from the screen on the circulation screen.
+        -
+            - pref: RenewPrechecked
+              choices:
+                  yes: Pre-check
+                  no: "Don't Pre-check"
+            - renewal checkboxes on the circulation screen.
     Checkout Policy:
         -
             - pref: AllowNotForLoanOverride
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl
index d7a70fe..dbb8f8e 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl
@@ -676,9 +676,9 @@ No patron matched <span class="ex"><!-- TMPL_VAR name="message" --></span>
       <!-- TMPL_ELSE -->
         <td><span style="padding: 0 1em;"><!-- TMPL_VAR NAME="renewals" --></span>
         <!-- TMPL_IF NAME="can_renew" -->
-        <input type="checkbox" name="all_items[]" value="<!-- TMPL_VAR NAME="itemnumber" -->" checked="checked" style="display: none;" />
+        <input type="checkbox" name="all_items[]" value="<!-- TMPL_VAR NAME="itemnumber" -->" <!-- TMPL_IF NAME="RenewPrechecked" -->checked="checked"<!-- /TMPL_IF -->	 style="display: none;" />
         <!-- TMPL_IF NAME="od" -->
-            <input type="checkbox" name="items[]" value="<!-- TMPL_VAR NAME="itemnumber" -->" checked="checked" />
+            <input type="checkbox" name="all_items[]" value="<!-- TMPL_VAR NAME="itemnumber" -->" <!-- TMPL_IF NAME="RenewPrechecked" -->checked="checked"<!-- /TMPL_IF --> />
         <!-- TMPL_ELSE -->
             <input type="checkbox" name="items[]" value="<!-- TMPL_VAR NAME="itemnumber" -->" />
         <!-- /TMPL_IF -->
@@ -686,7 +686,7 @@ No patron matched <span class="ex"><!-- TMPL_VAR name="message" --></span>
             <!-- TMPL_IF NAME="can_confirm" --><span class="renewals-allowed" style="display: none">
                 <input type="checkbox" name="all_items[]" value="<!-- TMPL_VAR NAME="itemnumber" -->" checked="checked" style="display: none;" />
                 <!-- TMPL_IF NAME="od" -->
-                    <input type="checkbox" name="items[]" value="<!-- TMPL_VAR NAME="itemnumber" -->" checked="checked" />
+                    <input type="checkbox" name="all_items[]" value="<!-- TMPL_VAR NAME="itemnumber" -->" <!-- TMPL_IF NAME="RenewPrechecked" -->checked="checked"<!-- /TMPL_IF --> />
                 <!-- TMPL_ELSE -->
                     <input type="checkbox" name="items[]" value="<!-- TMPL_VAR NAME="itemnumber" -->" />
                 <!-- /TMPL_IF -->
@@ -744,7 +744,7 @@ No patron matched <span class="ex"><!-- TMPL_VAR name="message" --></span>
         <!-- TMPL_IF NAME="can_renew" -->
         <input type="checkbox" name="all_items[]" value="<!-- TMPL_VAR NAME="itemnumber" -->" checked="checked" style="display: none;" />
         <!-- TMPL_IF NAME="od" -->
-            <input type="checkbox" name="items[]" value="<!-- TMPL_VAR NAME="itemnumber" -->" checked="checked" />
+            <input type="checkbox" name="all_items[]" value="<!-- TMPL_VAR NAME="itemnumber" -->" <!-- TMPL_IF NAME="RenewPrechecked" -->checked="checked"<!-- /TMPL_IF --> />
         <!-- TMPL_ELSE -->
             <input type="checkbox" name="items[]" value="<!-- TMPL_VAR NAME="itemnumber" -->" />
         <!-- /TMPL_IF -->
@@ -752,7 +752,7 @@ No patron matched <span class="ex"><!-- TMPL_VAR name="message" --></span>
             <!-- TMPL_IF NAME="can_confirm" --><span class="renewals-allowed" style="display: none">
                 <input type="checkbox" name="all_items[]" value="<!-- TMPL_VAR NAME="itemnumber" -->" checked="checked" style="display: none;" />
                 <!-- TMPL_IF NAME="od" -->
-                    <input type="checkbox" name="items[]" value="<!-- TMPL_VAR NAME="itemnumber" -->" checked="checked" />
+                    <input type="checkbox" name="all_items[]" value="<!-- TMPL_VAR NAME="itemnumber" -->" <!-- TMPL_IF NAME="RenewPrechecked" -->checked="checked"<!-- /TMPL_IF --> />
                 <!-- TMPL_ELSE -->
                     <input type="checkbox" name="items[]" value="<!-- TMPL_VAR NAME="itemnumber" -->" />
                 <!-- /TMPL_IF -->
-- 
1.5.6.5




More information about the Koha-patches mailing list