5 description => "Add authorised values list in article requests cancellation",
8 my ($dbh, $out) = @$args{qw(dbh out column_exists)};
10 INSERT IGNORE INTO authorised_value_categories( category_name, is_system )
11 VALUES ('AR_CANCELLATION', 0)
13 say $out "Add AR_CANCELLATION category for authorised values";
16 INSERT IGNORE INTO authorised_values (category, authorised_value, lib) VALUES
17 ('AR_CANCELLATION','NOT_FOUND','Item could not be located on shelves'),
18 ('AR_CANCELLATION','DAMAGED','Item was found to be too damaged to fill article request'),
19 ('AR_CANCELLATION','OPAC','Cancelled from the OPAC user page')
21 say $out "Add AR_CANCELLATION authorised values";
24 ALTER TABLE `article_requests` ADD COLUMN `cancellation_reason` varchar(80) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'optional authorised value AR_CANCELLATION' AFTER `urls`
25 }) unless column_exists('article_requests', 'cancellation_reason');
26 say $out "Add cancellation_reason column in article_requests table";
29 UPDATE letter SET content=REPLACE(content, '<<article_requests.notes>>', '<<reason>>')
30 WHERE module = 'circulation' AND code = 'AR_CANCELED'
32 say $out "Replace notes by reason in notice AR_CANCELED";