From 9144a5b429bac953c89d0aec71567c8e623f58ca Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Thu, 21 Dec 2023 15:57:41 +0000 Subject: [PATCH] Bug 35628: Add status to tickets This patch adds a new TICKET_STATUS authorized value category as well as adding the new 'status' field to both 'tickets' and 'ticket_updates' tables. Signed-off-by: Esther Melander --- .../data/mysql/atomicupdate/bug_35628.pl | 28 +++++++++++++++++++ installer/data/mysql/kohastructure.sql | 2 ++ .../data/mysql/mandatory/auth_val_cat.sql | 5 ++++ .../en/modules/admin/authorised_values.tt | 2 ++ 4 files changed, 37 insertions(+) create mode 100644 installer/data/mysql/atomicupdate/bug_35628.pl diff --git a/installer/data/mysql/atomicupdate/bug_35628.pl b/installer/data/mysql/atomicupdate/bug_35628.pl new file mode 100644 index 00000000000..d8d14d46869 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_35628.pl @@ -0,0 +1,28 @@ +use Modern::Perl; + +return { + bug_number => "35626", + description => "Add statuses to catalog concerns", + up => sub { + my ($args) = @_; + my ($dbh, $out) = @$args{qw(dbh out)}; + unless( column_exists('tickets','status') ){ + $dbh->do(q{ + ALTER TABLE tickets ADD COLUMN status varchar(80) DEFAULT NULL COMMENT 'current status of the ticket' AFTER body + }); + + say $out "Added column 'tickets.status'"; + } + unless( column_exists('ticket_updates','status') ){ + $dbh->do(q{ + ALTER TABLE ticket_updates ADD COLUMN status varchar(80) DEFAULT NULL COMMENT 'status of ticket at this update' AFTER message + }); + + say $out "Added column 'ticket_updates.status'"; + } + $dbh->do(q{ + INSERT IGNORE INTO authorised_value_categories( category_name, is_system ) VALUES ('TICKET_STATUS', 1); + }); + say $out "Added TICKET_STATUS authorised value category"; + }, +}; diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 0b59ad8d85c..7e7dada360e 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -6270,6 +6270,7 @@ CREATE TABLE `ticket_updates` ( `public` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'boolean flag to denote whether this update is public', `date` timestamp NOT NULL DEFAULT current_timestamp() COMMENT 'date and time this update was logged', `message` text NOT NULL COMMENT 'update message content', + `status` varchar(80) DEFAULT NULL COMMENT 'status of ticket at this update', PRIMARY KEY (`id`), KEY `ticket_updates_ibfk_1` (`ticket_id`), KEY `ticket_updates_ibfk_2` (`user_id`), @@ -6291,6 +6292,7 @@ CREATE TABLE `tickets` ( `reported_date` timestamp NOT NULL DEFAULT current_timestamp() COMMENT 'date and time this ticket was reported', `title` text NOT NULL COMMENT 'ticket title', `body` text NOT NULL COMMENT 'ticket details', + `status` varchar(80) DEFAULT NULL COMMENT 'current status of the ticket', `resolver_id` int(11) DEFAULT NULL COMMENT 'id of the user who resolved the ticket', `resolved_date` datetime DEFAULT NULL COMMENT 'date and time this ticket was resolved', `biblio_id` int(11) DEFAULT NULL COMMENT 'id of biblio linked', diff --git a/installer/data/mysql/mandatory/auth_val_cat.sql b/installer/data/mysql/mandatory/auth_val_cat.sql index 375ba87caf8..a867be43da7 100644 --- a/installer/data/mysql/mandatory/auth_val_cat.sql +++ b/installer/data/mysql/mandatory/auth_val_cat.sql @@ -95,3 +95,8 @@ VALUES ('ERM_DATABASE_REPORTS_METRICS', 1), ('ERM_TITLE_REPORTS_METRICS', 1), ('ERM_ITEM_REPORTS_METRICS', 1); + +-- For ticket statuses +INSERT IGNORE INTO authorised_value_categories (category_name, is_system) +VALUES + ('TICKET_STATUS', 1); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/authorised_values.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/authorised_values.tt index 5b99965925d..e2c40524546 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/authorised_values.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/authorised_values.tt @@ -504,6 +504,8 @@

A list of additional custom status values for suggestions that can be used in addition to the default values.

[% CASE 'TERM' %]

Terms to be used in Course Reserves module. Enter terms that will show in the drop down menu when setting up a Course reserve. (For example: Spring, Summer, Winter, Fall).

+ [% CASE 'TICKET_STATUS' %] +

A list of custom status values for tickets that can be used in addition to the default values of "New" and "Resolved".

[% CASE 'UPLOAD' %]

Categories to be assigned to file uploads. Without a category an upload is considered temporary and may be removed during automated cleanup.

[% CASE 'VENDOR_TYPE' %] -- 2.43.0