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

(-)a/installer/data/mysql/atomicupdate/bug_27947.pl (+41 lines)
Line 0 Link Here
1
use Modern::Perl;
2
3
return {
4
    bug_number => "27947",
5
    description => "Add authorised values list in article requests cancellation",
6
    up => sub {
7
        my ($args) = @_;
8
        my ($dbh, $out) = @$args{qw(dbh out column_exists)};
9
        # Do you stuffs here
10
        $dbh->do(q{
11
            INSERT IGNORE INTO authorised_value_categories( category_name, is_system )
12
            VALUES ('AR_CANCELLATION', 0)
13
        });
14
        # Print useful stuff here
15
        say $out "Add AR_CANCELLATION category for authorised values";
16
17
        $dbh->do(q{
18
            INSERT IGNORE INTO authorised_values (category, authorised_value, lib) VALUES ('AR_CANCELLATION','NOT_FOUND','Item could not be located on shelves');
19
        });
20
21
        $dbh->do(q{
22
            INSERT IGNORE INTO authorised_values (category, authorised_value, lib) VALUES ('AR_CANCELLATION','DAMAGED','Item was found to be too damaged to fill article request');
23
        });
24
25
        say $out "Add AR_CANCELLATION authorised values";
26
27
        $dbh->do(q{
28
            ALTER TABLE `article_requests` ADD COLUMN `cancellation_reason` varchar(80) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'optional authorised value AR_CANCELLATION' AFTER `urls`
29
        }) unless column_exists('article_requests', 'cancellation_reason');
30
31
        # Print useful stuff here
32
        say $out "Add cancellation_reason column in article_requests table";
33
34
        $dbh->do(q{
35
            UPDATE `letter`
36
            SET    `content` = 'Dear <<borrowers.firstname>> <<borrowers.surname>> (<<borrowers.cardnumber>>),\r\n\r\nYour request for an article from <<biblio.title>> (<<items.barcode>>) has been canceled for the following reason:\r\n\r\n<<reason>>\r\n\r\nArticle requested:\r\nTitle: <<article_requests.title>>\r\nAuthor: <<article_requests.author>>\r\nVolume: <<article_requests.volume>>\r\nIssue: <<article_requests.issue>>\r\nDate: <<article_requests.date>>\r\nPages: <<article_requests.pages>>\r\nChapters: <<article_requests.chapters>>\r\nNotes: <<article_requests.patron_notes>>\r\nFormat: [% IF article_request.format == ''PHOTOCOPY'' %]Copy[% ELSIF article_request.format == ''SCAN'' %]Scan[% END %]\r\n\r\nYour library'
37
            WHERE   `module` = 'circulation'
38
                    AND `code` = 'AR_CANCELED'
39
        })
40
    },
41
}
(-)a/installer/data/mysql/en/optional/auth_val.yml (+9 lines)
Lines 300-302 tables: Link Here
300
        - category: "HOLD_CANCELLATION"
300
        - category: "HOLD_CANCELLATION"
301
          authorised_value: "DAMAGED"
301
          authorised_value: "DAMAGED"
302
          lib: "Item was found to be too damaged to fill hold"
302
          lib: "Item was found to be too damaged to fill hold"
303
304
        # article request cancellations
305
        - category: "AR_CANCELLATION"
306
          authorised_value: "NOT_FOUND"
307
          lib: "Item could not be located on shelves"
308
309
        - category: "AR_CANCELLATION"
310
          authorised_value: "DAMAGED"
311
          lib: "Item was found to be too damaged to fill article request"
(-)a/installer/data/mysql/fr-CA/facultatif/auth_val.sql (+4 lines)
Lines 90-92 INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('RETURN_ Link Here
90
-- hold cancellation
90
-- hold cancellation
91
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('HOLD_CANCELLATION','NOT_FOUND','Item could not be located on shelves');
91
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('HOLD_CANCELLATION','NOT_FOUND','Item could not be located on shelves');
92
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('HOLD_CANCELLATION','DAMAGED','Item was found to be too damaged to fill hold');
92
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('HOLD_CANCELLATION','DAMAGED','Item was found to be too damaged to fill hold');
93
94
-- article request cancellation
95
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('AR_CANCELLATION','NOT_FOUND','Item could not be located on shelves');
96
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('AR_CANCELLATION','DAMAGED','Item was found to be too damaged to fill article request');
(-)a/installer/data/mysql/fr-FR/1-Obligatoire/authorised_values.sql (+4 lines)
Lines 724-726 INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('RETURN_ Link Here
724
-- hold cancellation
724
-- hold cancellation
725
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('HOLD_CANCELLATION','NOT_FOUND','Item could not be located on shelves');
725
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('HOLD_CANCELLATION','NOT_FOUND','Item could not be located on shelves');
726
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('HOLD_CANCELLATION','DAMAGED','Item was found to be too damaged to fill hold');
726
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('HOLD_CANCELLATION','DAMAGED','Item was found to be too damaged to fill hold');
727
728
-- article request cancellation
729
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('AR_CANCELLATION','NOT_FOUND','Item could not be located on shelves');
730
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('AR_CANCELLATION','DAMAGED','Item was found to be too damaged to fill article request');
(-)a/installer/data/mysql/kohastructure.sql (+1 lines)
Lines 753-758 CREATE TABLE `article_requests` ( Link Here
753
  `notes` mediumtext COLLATE utf8mb4_unicode_ci DEFAULT NULL,
753
  `notes` mediumtext COLLATE utf8mb4_unicode_ci DEFAULT NULL,
754
  `format` enum('PHOTOCOPY', 'SCAN') NOT NULL DEFAULT 'PHOTOCOPY',
754
  `format` enum('PHOTOCOPY', 'SCAN') NOT NULL DEFAULT 'PHOTOCOPY',
755
  `urls` MEDIUMTEXT,
755
  `urls` MEDIUMTEXT,
756
  `cancellation_reason` varchar(80) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'optional authorised value AR_CANCELLATION',
756
  `created_on` timestamp NULL DEFAULT NULL COMMENT 'Be careful with two timestamps in one table not allowing NULL',
757
  `created_on` timestamp NULL DEFAULT NULL COMMENT 'Be careful with two timestamps in one table not allowing NULL',
757
  `updated_on` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
758
  `updated_on` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
758
  PRIMARY KEY (`id`),
759
  PRIMARY KEY (`id`),
(-)a/installer/data/mysql/mandatory/auth_val_cat.sql (-1 / +2 lines)
Lines 18-24 INSERT IGNORE INTO authorised_value_categories( category_name, is_system ) Link Here
18
    ('PAYMENT_TYPE', 0),
18
    ('PAYMENT_TYPE', 0),
19
    ('PA_CLASS', 0),
19
    ('PA_CLASS', 0),
20
    ('HOLD_CANCELLATION', 0),
20
    ('HOLD_CANCELLATION', 0),
21
    ('ROADTYPE', 0);
21
    ('ROADTYPE', 0),
22
    ('AR_CANCELLATION', 0);
22
23
23
INSERT IGNORE INTO authorised_value_categories( category_name, is_system )
24
INSERT IGNORE INTO authorised_value_categories( category_name, is_system )
24
    VALUES
25
    VALUES
(-)a/installer/data/mysql/nb-NO/2-Valgfritt/auth_val.sql (-1 / +4 lines)
Lines 109-111 INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('RETURN_ Link Here
109
-- hold cancellation
109
-- hold cancellation
110
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('HOLD_CANCELLATION','NOT_FOUND','Item could not be located on shelves');
110
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('HOLD_CANCELLATION','NOT_FOUND','Item could not be located on shelves');
111
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('HOLD_CANCELLATION','DAMAGED','Item was found to be too damaged to fill hold');
111
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('HOLD_CANCELLATION','DAMAGED','Item was found to be too damaged to fill hold');
112
- 
112
113
-- article request cancellation
114
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('AR_CANCELLATION','NOT_FOUND','Item could not be located on shelves');
115
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('AR_CANCELLATION','DAMAGED','Item was found to be too damaged to fill article request');

Return to bug 27947