Bug 27944: Add new letter in atomicupdate, and modify status column in article_requests table
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
parent
3a913552c8
commit
2edfeb9e4d
|
|
@ -0,0 +1,30 @@
|
|||
$DBversion = 'XXX'; # will be replaced by the RM
|
||||
if ( CheckVersion($DBversion) ) {
|
||||
|
||||
# you can use $dbh here like:
|
||||
$dbh->do(
|
||||
"ALTER TABLE `article_requests` MODIFY `status` enum('REQUESTED', 'PENDING','PROCESSING','COMPLETED','CANCELED') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'REQUESTED'"
|
||||
);
|
||||
|
||||
$dbh->do(
|
||||
q{
|
||||
UPDATE `letter`
|
||||
SET `code` = 'AR_REQUESTED',
|
||||
`name` = 'Article requested'
|
||||
WHERE `module` = 'circulation'
|
||||
AND `code` = 'AR_PENDING'
|
||||
}
|
||||
);
|
||||
|
||||
$dbh->do(
|
||||
q{
|
||||
INSERT IGNORE INTO `letter` (`module`, `code`, `branchcode`, `name`, `is_html`, `title`, `content`, `message_transport_type`) VALUES
|
||||
('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')
|
||||
}
|
||||
);
|
||||
|
||||
# Always end with this (adjust the bug info)
|
||||
NewVersion( $DBversion, 27944,
|
||||
"Add REQUESTED as enum element for status column, move AR_PENDING letter to AR_REQUESTED, and add new AR_PENDING letter"
|
||||
);
|
||||
}
|
||||
|
|
@ -749,7 +749,7 @@ CREATE TABLE `article_requests` (
|
|||
`pages` mediumtext COLLATE utf8mb4_unicode_ci DEFAULT NULL,
|
||||
`chapters` mediumtext COLLATE utf8mb4_unicode_ci DEFAULT NULL,
|
||||
`patron_notes` mediumtext COLLATE utf8mb4_unicode_ci DEFAULT NULL,
|
||||
`status` enum('PENDING','PROCESSING','COMPLETED','CANCELED') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'PENDING',
|
||||
`status` enum('REQUESTED', 'PENDING','PROCESSING','COMPLETED','CANCELED') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'REQUESTED',
|
||||
`notes` mediumtext COLLATE utf8mb4_unicode_ci DEFAULT NULL,
|
||||
`format` enum('PHOTOCOPY', 'SCAN') NOT NULL DEFAULT 'PHOTOCOPY',
|
||||
`urls` MEDIUMTEXT,
|
||||
|
|
|
|||
Loading…
Reference in New Issue