Bugzilla – Attachment 119020 Details for
Bug 27944
Add new stages to the article request process
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 27944: Add new letter in atomicupdate, and modify status column in article_requests table
Bug-27944-Add-new-letter-in-atomicupdate-and-modif.patch (text/plain), 3.81 KB, created by
Agustín Moyano
on 2021-03-30 16:20:15 UTC
(
hide
)
Description:
Bug 27944: Add new letter in atomicupdate, and modify status column in article_requests table
Filename:
MIME Type:
Creator:
Agustín Moyano
Created:
2021-03-30 16:20:15 UTC
Size:
3.81 KB
patch
obsolete
>From 0db15df0e51307bbe8482127d5f8510fcec63f55 Mon Sep 17 00:00:00 2001 >From: Agustin Moyano <agustinmoyano@theke.io> >Date: Tue, 30 Mar 2021 10:49:06 -0300 >Subject: [PATCH] Bug 27944: Add new letter in atomicupdate, and modify status > column in article_requests table > >--- > .../data/mysql/atomicupdate/bug_27944.perl | 30 +++++++++++++++++++ > installer/data/mysql/kohastructure.sql | 2 +- > 2 files changed, 31 insertions(+), 1 deletion(-) > create mode 100644 installer/data/mysql/atomicupdate/bug_27944.perl > >diff --git a/installer/data/mysql/atomicupdate/bug_27944.perl b/installer/data/mysql/atomicupdate/bug_27944.perl >new file mode 100644 >index 0000000000..29494d7ed9 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_27944.perl >@@ -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 `content` = '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!', >+ `title` = 'Pending article request' >+ WHERE `module` = 'circulation' >+ AND `code` = 'AR_PENDING' >+ } >+ ); >+ >+ $dbh->do( >+ q{ >+ INSERT INTO `letter` (`module`, `code`, `branchcode`, `name`, `is_html`, `title`, `content`, `message_transport_type`) VALUES >+ ('circulation', 'AR_REQUESTED', '', 'Article requested', 0, 'Article request received', '<<borrowers.firstname>> <<borrowers.surname>> (<<borrowers.cardnumber>>)\r\n\r\nWe have received your request for an article from <<biblio.title>> (<<items.barcode>>).\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, update AR_PENDING letter and add new AR_REQUESTED letter" >+ ); >+} >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index ae247e67c8..b6c637e045 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -764,7 +764,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, > `created_on` timestamp NULL DEFAULT NULL COMMENT 'Be careful with two timestamps in one table not allowing NULL', > `updated_on` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), >-- >2.25.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 27944
:
119020
|
119021
|
119022
|
120454
|
122673
|
122836
|
122837
|
122838
|
122839
|
122842
|
122843
|
122857
|
122984
|
122985
|
122986
|
122987
|
122988
|
122989
|
122990
|
123710
|
123711
|
123712
|
123943
|
123944
|
123945
|
123946
|
123947
|
123948
|
123949
|
123950
|
123951
|
123952
|
124966
|
124967
|
124968
|
124969
|
124970
|
124971
|
124972
|
124973
|
124974
|
124975
|
124976
|
125158
|
125544
|
125565
|
125567
|
125762
|
125813