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

(-)a/installer/data/mysql/atomicupdate/bug_27944.perl (+30 lines)
Line 0 Link Here
1
$DBversion = 'XXX';    # will be replaced by the RM
2
if ( CheckVersion($DBversion) ) {
3
4
    # you can use $dbh here like:
5
    $dbh->do(
6
"ALTER TABLE `article_requests` MODIFY `status` enum('REQUESTED', 'PENDING','PROCESSING','COMPLETED','CANCELED') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'REQUESTED'"
7
    );
8
9
    $dbh->do(
10
        q{
11
        UPDATE  `letter`
12
        SET     `code` = 'AR_REQUESTED',
13
                `name` = 'Article requested'
14
        WHERE   `module` = 'circulation'
15
                AND `code` = 'AR_PENDING'
16
    }
17
    );
18
19
    $dbh->do(
20
        q{
21
        INSERT IGNORE INTO `letter` (`module`, `code`, `branchcode`, `name`, `is_html`, `title`, `content`, `message_transport_type`) VALUES
22
        ('circulation', 'AR_PENDING', '', 'Article request - open', 0, 'Pending article request', 'Dear <<borrowers.firstname>> <<borrowers.surname>> (<<borrowers.cardnumber>>)\r\n\r\nYour request for an article from <<biblio.title>> (<<items.barcode>>) is now in pending state.\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\n\r\n\r\nThank you!', 'email')
23
    }
24
    );
25
26
    # Always end with this (adjust the bug info)
27
    NewVersion( $DBversion, 27944,
28
"Add REQUESTED as enum element for status column, move AR_PENDING letter to AR_REQUESTED, and add new AR_PENDING letter"
29
    );
30
}
(-)a/installer/data/mysql/kohastructure.sql (-2 / +1 lines)
Lines 749-755 CREATE TABLE `article_requests` ( Link Here
749
  `pages` mediumtext COLLATE utf8mb4_unicode_ci DEFAULT NULL,
749
  `pages` mediumtext COLLATE utf8mb4_unicode_ci DEFAULT NULL,
750
  `chapters` mediumtext COLLATE utf8mb4_unicode_ci DEFAULT NULL,
750
  `chapters` mediumtext COLLATE utf8mb4_unicode_ci DEFAULT NULL,
751
  `patron_notes` mediumtext COLLATE utf8mb4_unicode_ci DEFAULT NULL,
751
  `patron_notes` mediumtext COLLATE utf8mb4_unicode_ci DEFAULT NULL,
752
  `status` enum('PENDING','PROCESSING','COMPLETED','CANCELED') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'PENDING',
752
  `status` enum('REQUESTED', 'PENDING','PROCESSING','COMPLETED','CANCELED') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'REQUESTED',
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
- 

Return to bug 27944