@@ -, +, @@ --- C4/Circulation.pm | 6 +++--- Koha/Patron.pm | 2 +- api/v1/swagger/definitions/patron.json | 2 +- api/v1/swagger/paths/patrons.json | 4 ++-- .../bug_24476_opt_out_of_auto_renewal.perl | 16 ++++++++-------- installer/data/mysql/kohastructure.sql | 6 +++--- .../prog/en/modules/circ/circulation.tt | 6 +++--- .../prog/en/modules/members/memberentrygen.tt | 22 +++++++++++----------- .../prog/en/modules/members/members-update.tt | 2 +- .../prog/en/modules/members/moremember-brief.tt | 2 +- .../prog/en/modules/members/moremember.tt | 4 ++-- .../bootstrap/en/modules/opac-memberentry.tt | 22 +++++++++++----------- misc/cronjobs/automatic_renewals.pl | 2 +- t/db_dependent/Circulation.t | 16 ++++++++-------- 14 files changed, 56 insertions(+), 56 deletions(-) --- a/C4/Circulation.pm +++ a/C4/Circulation.pm @@ -2751,7 +2751,7 @@ sub CanBookBeRenewed { return ( 0, 'overdue'); } - if ( $issue->auto_renew && $patron->autorenewal ) { + if ( $issue->auto_renew && $patron->autorenew_checkouts ) { if ( $patron->category->effective_BlockExpiredPatronOpacActions and $patron->is_expired ) { return ( 0, 'auto_account_expired' ); @@ -2807,10 +2807,10 @@ sub CanBookBeRenewed { if ( $soonestrenewal > DateTime->now( time_zone => C4::Context->tz() ) ) { - return ( 0, "auto_too_soon" ) if $issue->auto_renew && $patron->autorenewal; + return ( 0, "auto_too_soon" ) if $issue->auto_renew && $patron->autorenew_checkouts; return ( 0, "too_soon" ); } - elsif ( $issue->auto_renew && $patron->autorenewal ) { + elsif ( $issue->auto_renew && $patron->autorenew_checkouts ) { $auto_renew = 1; } } --- a/Koha/Patron.pm +++ a/Koha/Patron.pm @@ -1671,7 +1671,7 @@ sub to_api_mapping { smsalertnumber => 'sms_number', sort1 => 'statistics_1', sort2 => 'statistics_2', - autorenewal => 'autorenewal', + autorenew_checkouts => 'autorenew_checkouts', streetnumber => 'street_number', streettype => 'street_type', zipcode => 'postal_code', --- a/api/v1/swagger/definitions/patron.json +++ a/api/v1/swagger/definitions/patron.json @@ -191,7 +191,7 @@ "type": ["string", "null"], "description": "a field that can be used for any information unique to the library" }, - "autorenewal": { + "autorenew_checkouts": { "type": "boolean", "description": "indicate whether auto-renewal is allowed for patron" }, --- a/api/v1/swagger/paths/patrons.json +++ a/api/v1/swagger/paths/patrons.json @@ -296,9 +296,9 @@ "required": false, "type": "string" }, { - "name": "autorenewal", + "name": "autorenew_checkouts", "in": "query", - "description": "Search on autorenewal", + "description": "Search on autorenew_checkouts", "required": false, "type": "boolean" }, { --- a/installer/data/mysql/atomicupdate/bug_24476_opt_out_of_auto_renewal.perl +++ a/installer/data/mysql/atomicupdate/bug_24476_opt_out_of_auto_renewal.perl @@ -1,20 +1,20 @@ $DBversion = 'XXX'; if( CheckVersion( $DBversion ) ) { - unless( column_exists('borrowers','autorenewal') ){ - $dbh->do( "ALTER TABLE borrowers ADD COLUMN autorenewal TINYINT(1) NOT NULL DEFAULT 1" ); + unless( column_exists('borrowers','autorenew_checkouts') ){ + $dbh->do( "ALTER TABLE borrowers ADD COLUMN autorenew_checkouts TINYINT(1) NOT NULL DEFAULT 1" ); } - unless( column_exists('deletedborrowers','autorenewal') ){ - $dbh->do( "ALTER TABLE deletedborrowers ADD COLUMN autorenewal TINYINT(1) NOT NULL DEFAULT 1" ); + unless( column_exists('deletedborrowers','autorenew_checkouts') ){ + $dbh->do( "ALTER TABLE deletedborrowers ADD COLUMN autorenew_checkouts TINYINT(1) NOT NULL DEFAULT 1" ); } - unless( column_exists('borrower_modifications','autorenewal') ){ - $dbh->do( "ALTER TABLE borrower_modifications ADD COLUMN autorenewal TINYINT(1) NOT NULL DEFAULT 1" ); + unless( column_exists('borrower_modifications','autorenew_checkouts') ){ + $dbh->do( "ALTER TABLE borrower_modifications ADD COLUMN autorenew_checkouts TINYINT(1) NOT NULL DEFAULT 1" ); } $dbh->do(q{ UPDATE systempreferences - SET value = CONCAT(value,'|autorenewal') + SET value = CONCAT(value,'|autorenew_checkouts') WHERE variable IN ('PatronSelfModificationBorrowerUnwantedField','PatronSelfRegistrationBorrowerUnwantedField') - AND value NOT LIKE '%autorenewal%' + AND value NOT LIKE '%autorenew_checkouts%' }); SetVersion( $DBversion ); print "Upgrade to $DBversion done (Bug 24476 - Allow patrons to opt-out of autorenewal)\n"; --- a/installer/data/mysql/kohastructure.sql +++ a/installer/data/mysql/kohastructure.sql @@ -589,7 +589,7 @@ CREATE TABLE `deletedborrowers` ( -- stores data related to the patrons/borrower `login_attempts` int(4) default 0, -- number of failed login attemps `overdrive_auth_token` MEDIUMTEXT default NULL, -- persist OverDrive auth token `anonymized` TINYINT(1) NOT NULL DEFAULT 0, -- flag for data anonymization - `autorenewal` TINYINT(1) NOT NULL DEFAULT 1, -- flag for allowing auto-renewal + `autorenew_checkouts` TINYINT(1) NOT NULL DEFAULT 1, -- flag for allowing auto-renewal KEY borrowernumber (borrowernumber), KEY `cardnumber` (`cardnumber`), KEY `sms_provider_id` (`sms_provider_id`) @@ -1531,7 +1531,7 @@ CREATE TABLE `borrowers` ( -- this table includes information about your patrons `login_attempts` int(4) default 0, -- number of failed login attemps `overdrive_auth_token` MEDIUMTEXT default NULL, -- persist OverDrive auth token `anonymized` TINYINT(1) NOT NULL DEFAULT 0, -- flag for data anonymization - `autorenewal` TINYINT(1) NOT NULL DEFAULT 1, -- flag for allowing auto-renewal + `autorenew_checkouts` TINYINT(1) NOT NULL DEFAULT 1, -- flag for allowing auto-renewal UNIQUE KEY `cardnumber` (`cardnumber`), PRIMARY KEY `borrowernumber` (`borrowernumber`), KEY `categorycode` (`categorycode`), @@ -3439,7 +3439,7 @@ CREATE TABLE IF NOT EXISTS `borrower_modifications` ( `privacy` int(11) DEFAULT NULL, `extended_attributes` MEDIUMTEXT DEFAULT NULL, `gdpr_proc_consent` datetime, -- data processing consent - `autorenewal` TINYINT(1) NOT NULL DEFAULT 1, -- flag for allowing auto-renewal + `autorenew_checkouts` TINYINT(1) NOT NULL DEFAULT 1, -- flag for allowing auto-renewal PRIMARY KEY (`verification_token` (191),`borrowernumber`), KEY `verification_token` (`verification_token` (191)), KEY `borrowernumber` (`borrowernumber`) --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt @@ -568,7 +568,7 @@