From 7a3a28d4316024ab2747d5a8c84fda2f96d324a8 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 Signed-off-by: Ray Delahunty Signed-off-by: Marcel de Rooy --- .../data/mysql/atomicupdate/bug_35628.pl | 34 +++++++++++++++++++ installer/data/mysql/kohastructure.sql | 2 ++ .../data/mysql/mandatory/auth_val_cat.sql | 5 +++ .../en/modules/admin/authorised_values.tt | 2 ++ 4 files changed, 43 insertions(+) create mode 100755 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 100755 index 00000000000..e1014582e19 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_35628.pl @@ -0,0 +1,34 @@ +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 cfcce6f6658..002dbb1cd4d 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -6309,6 +6309,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`), @@ -6331,6 +6332,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 11ccab61a5a..c93408efd17 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 @@ -515,6 +515,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.44.0