View | Details | Raw Unified | Return to bug 23260
Collapse All | Expand All

(-)a/installer/data/mysql/atomicupdate/bug_23260.perl (+22 lines)
Line 0 Link Here
1
use Modern::Perl;
2
3
return {
4
    bug_number  => "23260",
5
    description => "Make borrowernumber from items_last_borrower nullable, and add AnonymizeLastBorrower and AnonymizeLastBorrowerDays preferences",
6
    up          => sub {
7
        my ($args) = @_;
8
        my ( $dbh, $out ) = @$args{qw(dbh out)};
9
10
        # Do you stuffs here
11
        $dbh->do(q{});
12
        $dbh->do( "ALTER TABLE items_last_borrower MODIFY COLUMN `borrowernumber` int(11) default NULL" );
13
        say $out "items_last_borrower updated to allow NULL borrowernumbers";
14
15
        $dbh->do(q{
16
            INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES
17
            ('AnonymizeLastBorrower','0',NULL,'If enabled, anonymize item\'s last borrower','YesNo'),
18
            ('AnonymizeLastBorrowerDays','0',NULL,'Item\'s last borrower older than this preference will be anonymized','Integer')
19
        });
20
        say $out "Added new system preferences 'AnonymizeLastBorrower' and 'AnonymizeLastBorrowerDays'";
21
    },
22
};
(-)a/installer/data/mysql/kohastructure.sql (-1 / +1 lines)
Lines 4228-4234 DROP TABLE IF EXISTS `items_last_borrower`; Link Here
4228
CREATE TABLE `items_last_borrower` (
4228
CREATE TABLE `items_last_borrower` (
4229
  `id` int(11) NOT NULL AUTO_INCREMENT,
4229
  `id` int(11) NOT NULL AUTO_INCREMENT,
4230
  `itemnumber` int(11) NOT NULL,
4230
  `itemnumber` int(11) NOT NULL,
4231
  `borrowernumber` int(11) NOT NULL,
4231
  `borrowernumber` int(11) NULL,
4232
  `created_on` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
4232
  `created_on` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
4233
  PRIMARY KEY (`id`),
4233
  PRIMARY KEY (`id`),
4234
  UNIQUE KEY `itemnumber` (`itemnumber`),
4234
  UNIQUE KEY `itemnumber` (`itemnumber`),
(-)a/installer/data/mysql/mandatory/sysprefs.sql (+2 lines)
Lines 62-67 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
62
('AmazonCoverImages','0','','Display Cover Images in staff interface from Amazon Web Services','YesNo'),
62
('AmazonCoverImages','0','','Display Cover Images in staff interface from Amazon Web Services','YesNo'),
63
('AmazonLocale','US','US|CA|DE|FR|IN|JP|UK','Use to set the Locale of your Amazon.com Web Services','Choice'),
63
('AmazonLocale','US','US|CA|DE|FR|IN|JP|UK','Use to set the Locale of your Amazon.com Web Services','Choice'),
64
('AnonSuggestions','0',NULL,'Set to enable Anonymous suggestions to AnonymousPatron borrowernumber','YesNo'),
64
('AnonSuggestions','0',NULL,'Set to enable Anonymous suggestions to AnonymousPatron borrowernumber','YesNo'),
65
('AnonymizeLastBorrower','0',NULL,'If enabled, anonymise item\'s last borrower','YesNo'),
66
('AnonymizeLastBorrowerDays','0',NULL,'Item\'s last borrower older than this preference will be anonymised','Integer'),
65
('AnonymousPatron','0',NULL,'Set the identifier (borrowernumber) of the anonymous patron. Used for suggestion and checkout history privacy',''),
67
('AnonymousPatron','0',NULL,'Set the identifier (borrowernumber) of the anonymous patron. Used for suggestion and checkout history privacy',''),
66
('ApplyFrameworkDefaults', 'new', 'new|duplicate|changed|imported', 'Configure when to apply framework default values - when cataloguing a new record, or when editing a record as new (duplicating), or when changing framework, or when importing a record', 'multiple'),
68
('ApplyFrameworkDefaults', 'new', 'new|duplicate|changed|imported', 'Configure when to apply framework default values - when cataloguing a new record, or when editing a record as new (duplicating), or when changing framework, or when importing a record', 'multiple'),
67
('ArticleRequests', '0', NULL, 'Enables the article request feature', 'YesNo'),
69
('ArticleRequests', '0', NULL, 'Enables the article request feature', 'YesNo'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref (-1 / +8 lines)
Lines 462-467 Patrons: Link Here
462
           initiator: populateCookieConsentedJS
462
           initiator: populateCookieConsentedJS
463
           processor: prepareCookieConsentedJS
463
           processor: prepareCookieConsentedJS
464
         - '<br><strong>NOTE:</strong> The cookie consent modal can be customised using the <a href="/cgi-bin/koha/tools/additional-contents.pl?category=html_customizations" target="_blank">CookieConsentPopup</a> html customisation.'
464
         - '<br><strong>NOTE:</strong> The cookie consent modal can be customised using the <a href="/cgi-bin/koha/tools/additional-contents.pl?category=html_customizations" target="_blank">CookieConsentPopup</a> html customisation.'
465
     -
466
         - pref: AnonymizeLastBorrower
467
           choices:
468
               yes: Anonymize
469
               no: "Don't anonymize"
470
         - " item's last borrower after "
471
         - pref: AnonymizeLastBorrowerDays
472
         - days.
465
    Security:
473
    Security:
466
     -
474
     -
467
         - Login passwords for staff and patrons must be at least
475
         - Login passwords for staff and patrons must be at least
468
- 

Return to bug 23260