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

(-)a/installer/data/mysql/atomicupdate/bug_23260.pl (+33 lines)
Line 0 Link Here
1
use Modern::Perl;
2
use Koha::Installer::Output qw(say_warning say_success say_info);
3
4
return {
5
    bug_number  => "23260",
6
    description =>
7
        "Make created_on from items_last_borrower not update to current timestamp ON UPDATE, and add AnonymizeLastBorrower and AnonymizeLastBorrowerDays preferences",
8
    up => sub {
9
        my ($args) = @_;
10
        my ( $dbh, $out ) = @$args{qw(dbh out)};
11
12
        # Do you stuffs here
13
        $dbh->do("ALTER TABLE items_last_borrower MODIFY COLUMN `borrowernumber` int(11) NULL");
14
        say_success( $out, "items_last_borrower updated to allow NULL borrowernumbers" );
15
16
        $dbh->do(
17
            q{
18
            ALTER TABLE items_last_borrower
19
            MODIFY created_on timestamp NOT NULL DEFAULT current_timestamp()
20
        }
21
        );
22
        say_success( $out, "Fixed items_last_borrower.created_on column to prevent automatic timestamp updates" );
23
24
        $dbh->do(
25
            q{
26
            INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES
27
            ('AnonymizeLastBorrower','0',NULL,'If enabled, anonymize item\'s last borrower','YesNo'),
28
            ('AnonymizeLastBorrowerDays','0',NULL,'Item\'s last borrower older than this preference will be anonymized','Integer')
29
        }
30
        );
31
        say_success( $out, "Added new system preferences 'AnonymizeLastBorrower' and 'AnonymizeLastBorrowerDays'" );
32
    },
33
};
(-)a/installer/data/mysql/kohastructure.sql (-1 / +1 lines)
Lines 4256-4262 DROP TABLE IF EXISTS `items_last_borrower`; Link Here
4256
CREATE TABLE `items_last_borrower` (
4256
CREATE TABLE `items_last_borrower` (
4257
  `id` int(11) NOT NULL AUTO_INCREMENT,
4257
  `id` int(11) NOT NULL AUTO_INCREMENT,
4258
  `itemnumber` int(11) NOT NULL,
4258
  `itemnumber` int(11) NOT NULL,
4259
  `borrowernumber` int(11) NOT NULL,
4259
  `borrowernumber` int(11) NULL,
4260
  `created_on` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
4260
  `created_on` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
4261
  PRIMARY KEY (`id`),
4261
  PRIMARY KEY (`id`),
4262
  KEY `borrowernumber` (`borrowernumber`),
4262
  KEY `borrowernumber` (`borrowernumber`),
(-)a/installer/data/mysql/mandatory/sysprefs.sql (+2 lines)
Lines 62-67 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
62
('AmazonCoverImages','0',NULL,'Display Cover Images in staff interface from Amazon Web Services','YesNo'),
62
('AmazonCoverImages','0',NULL,'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
('ApiKeyLog', '0', NULL, 'If enabled, log API key actions (create, revoke, activate, delete)', 'YesNo'),
68
('ApiKeyLog', '0', NULL, 'If enabled, log API key actions (create, revoke, activate, delete)', 'YesNo'),
67
('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'),
69
('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'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref (-1 / +8 lines)
Lines 468-473 Patrons: Link Here
468
           initiator: populateCookieConsentedJS
468
           initiator: populateCookieConsentedJS
469
           processor: prepareCookieConsentedJS
469
           processor: prepareCookieConsentedJS
470
         - '<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.'
470
         - '<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.'
471
     -
472
         - pref: AnonymizeLastBorrower
473
           choices:
474
               yes: Anonymize
475
               no: "Don't anonymize"
476
         - " item's last borrower after "
477
         - pref: AnonymizeLastBorrowerDays
478
         - days.
471
    Security:
479
    Security:
472
     -
480
     -
473
         - Login passwords for staff and patrons must be at least
481
         - Login passwords for staff and patrons must be at least
474
- 

Return to bug 23260