Bug 24476: (QA follow-up) Standardize on 'auto renew(al)' and improve db update
authorKatrin Fischer <katrin.fischer.83@web.de>
Sun, 22 Mar 2020 17:07:57 +0000 (17:07 +0000)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Tue, 24 Mar 2020 11:24:03 +0000 (11:24 +0000)
There were several versions: auto renew, auto-renew, autorenew
I've decided to use auto renew (from automatic renewal) to keep
things a bit more consistent.

The DB update was missing AFTER and IGNORE for the sys pref.
Also fixed a tiny typo (tp > to)
Also changed

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

installer/data/mysql/atomicupdate/bug_24476_opt_out_of_auto_renewal.perl
installer/data/mysql/sysprefs.sql
koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt

index c83325f..151c9b2 100644 (file)
@@ -1,16 +1,16 @@
 $DBversion = 'XXX';
 if( CheckVersion( $DBversion ) ) {
     unless( column_exists('borrowers','autorenew_checkouts') ){
-        $dbh->do( "ALTER TABLE borrowers ADD COLUMN autorenew_checkouts TINYINT(1) NOT NULL DEFAULT 1" );
+        $dbh->do( "ALTER TABLE borrowers ADD COLUMN autorenew_checkouts TINYINT(1) NOT NULL DEFAULT 1 AFTER anonymized" );
     }
     unless( column_exists('deletedborrowers','autorenew_checkouts') ){
-        $dbh->do( "ALTER TABLE deletedborrowers ADD COLUMN autorenew_checkouts TINYINT(1) NOT NULL DEFAULT 1" );
+        $dbh->do( "ALTER TABLE deletedborrowers ADD COLUMN autorenew_checkouts TINYINT(1) NOT NULL DEFAULT 1 AFTER anonymized" );
     }
     $dbh->do(q{
-        INSERT INTO systempreferences
+        INSERT IGNORE INTO systempreferences
         ( `variable`, `value`, `options`, `explanation`, `type` )
         VALUES
-        ('AllowPatronToControlAutorenewal','0',NULL,'If enabled, patrons will have a field in their account tp choose whether their checkouts are auto renewed or not','YesNo')
+        ('AllowPatronToControlAutorenewal','0',NULL,'If enabled, patrons will have a field in their account to choose whether their checkouts are auto renewed or not','YesNo')
     });
     SetVersion( $DBversion );
     print "Upgrade to $DBversion done (Bug 24476 - Allow patrons to opt-out of autorenewal)\n";
index 91c5537..6eeff84 100644 (file)
@@ -34,7 +34,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `
 ('AllowMultipleIssuesOnABiblio',1,'Allow/Don\'t allow patrons to check out multiple items from one biblio','','YesNo'),
 ('AllowNotForLoanOverride','0','','If ON, Koha will allow the librarian to loan a not for loan item.','YesNo'),
 ('AllowOfflineCirculation','0','','If on, enables HTML5 offline circulation functionality.','YesNo'),
-('AllowPatronToControlAutorenewal','0',NULL,'If enabled, patrons will have a field in their account tp choose whether their checkouts are auto renewed or not','YesNo'),
+('AllowPatronToControlAutorenewal','0',NULL,'If enabled, patrons will have a field in their account to choose whether their checkouts are auto renewed or not','YesNo'),
 ('AllowPatronToSetCheckoutsVisibilityForGuarantor',  '0', NULL, 'If enabled, the patron can set checkouts to be visible to his or her guarantor',  'YesNo'),
 ('AllowPatronToSetFinesVisibilityForGuarantor',  '0', NULL, 'If enabled, the patron can set fines to be visible to his or her guarantor',  'YesNo'),
 ('AllowPKIAuth','None','None|Common Name|emailAddress','Use the field from a client-side SSL certificate to look a user in the Koha database','Choice'),
index 43d9c28..13c2e70 100644 (file)
@@ -256,7 +256,7 @@ Patrons:
            choices:
                yes: Allow patrons
                no: Allow only staff
-         - "to allow/disallow auto-renewal for account. If allowed a patron will be able to update their own account to allow/disallow autorenewals"
+         - "to allow/disallow auto renewal for account. If allowed a patron will be able to update their own account to allow/disallow auto renewals"
 
     Privacy:
      -
index e649229..f886df0 100644 (file)
@@ -52,7 +52,7 @@
                     [% IF Koha.Preference('AllowPatronToControlAutorenewal') %]
                     <form id="autorenewal_option" action="/cgi-bin/koha/opac-user.pl" method="post">
                             <label for="yes-autorenew_checkouts">
-                                Allow auto-renewal:
+                                Allow auto renewal:
                             </label>
                                 [% IF ( borrower.autorenew_checkouts ) %]
                                     <label class="radio inline" for="yes-autorenew_checkouts">
@@ -76,7 +76,7 @@
                                 [% END %]
                         <input type="hidden" name="csrf_token" value="[% csrf_token | html %]" />
                         <input type="hidden" name="update_arc" value="1" />
-                        <input type="submit" value="Update autorenewal preference" />
+                        <input type="submit" value="Update auto renewal preference" />
                     </form>
                     [% END %]
                     [% IF ( patronupdate ) %]<div class="alert alert-info"><h3>Thank you!</h3><p>Your corrections have been submitted to the library, and a staff member will update your record as soon as possible.</p></div>[% END %]