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 4036-4042 DROP TABLE IF EXISTS `items_last_borrower`; Link Here
4036
CREATE TABLE `items_last_borrower` (
4036
CREATE TABLE `items_last_borrower` (
4037
  `id` int(11) NOT NULL AUTO_INCREMENT,
4037
  `id` int(11) NOT NULL AUTO_INCREMENT,
4038
  `itemnumber` int(11) NOT NULL,
4038
  `itemnumber` int(11) NOT NULL,
4039
  `borrowernumber` int(11) NOT NULL,
4039
  `borrowernumber` int(11) NULL,
4040
  `created_on` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
4040
  `created_on` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
4041
  PRIMARY KEY (`id`),
4041
  PRIMARY KEY (`id`),
4042
  UNIQUE KEY `itemnumber` (`itemnumber`),
4042
  UNIQUE KEY `itemnumber` (`itemnumber`),
(-)a/installer/data/mysql/mandatory/sysprefs.sql (+2 lines)
Lines 57-62 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
57
('AmazonCoverImages','0','','Display Cover Images in staff interface from Amazon Web Services','YesNo'),
57
('AmazonCoverImages','0','','Display Cover Images in staff interface from Amazon Web Services','YesNo'),
58
('AmazonLocale','US','US|CA|DE|FR|IN|JP|UK','Use to set the Locale of your Amazon.com Web Services','Choice'),
58
('AmazonLocale','US','US|CA|DE|FR|IN|JP|UK','Use to set the Locale of your Amazon.com Web Services','Choice'),
59
('AnonSuggestions','0',NULL,'Set to enable Anonymous suggestions to AnonymousPatron borrowernumber','YesNo'),
59
('AnonSuggestions','0',NULL,'Set to enable Anonymous suggestions to AnonymousPatron borrowernumber','YesNo'),
60
('AnonymizeLastBorrower','0',NULL,'If enabled, anonymise item\'s last borrower','YesNo'),
61
('AnonymizeLastBorrowerDays','0',NULL,'Item\'s last borrower older than this preference will be anonymised','Integer'),
60
('AnonymousPatron','0',NULL,'Set the identifier (borrowernumber) of the anonymous patron. Used for suggestion and checkout history privacy',''),
62
('AnonymousPatron','0',NULL,'Set the identifier (borrowernumber) of the anonymous patron. Used for suggestion and checkout history privacy',''),
61
('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'),
63
('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'),
62
('ArticleRequests', '0', NULL, 'Enables the article request feature', 'YesNo'),
64
('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 427-432 Patrons: Link Here
427
           initiator: populateCookieConsentedJS
427
           initiator: populateCookieConsentedJS
428
           processor: prepareCookieConsentedJS
428
           processor: prepareCookieConsentedJS
429
         - '<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.'
429
         - '<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.'
430
     -
431
         - pref: AnonymizeLastBorrower
432
           choices:
433
               yes: Anonymize
434
               no: "Don't anonymize"
435
         - " item's last borrower after "
436
         - pref: AnonymizeLastBorrowerDays
437
         - days.
430
    Security:
438
    Security:
431
     -
439
     -
432
         - Login passwords for staff and patrons must be at least
440
         - Login passwords for staff and patrons must be at least
433
- 

Return to bug 23260