From 264a6e5979b49707106bd0d3f8949fac470861bb Mon Sep 17 00:00:00 2001 From: Lucas Gass Date: Mon, 22 Aug 2022 22:21:22 +0000 Subject: [PATCH] Bug 31374: (follow-up) change private note to staff_note and reorder columns Signed-off-by: Katrin Fischer Signed-off-by: Tomas Cohen Arazi --- Koha/Schema/Result/Suggestion.pm | 4 ++-- Koha/Suggestion.pm | 2 +- admin/columns_settings.yml | 4 ++-- api/v1/swagger/definitions/suggestion.yaml | 2 +- installer/data/mysql/atomicupdate/bug_31374.pl | 8 ++++---- installer/data/mysql/kohastructure.sql | 2 +- .../prog/en/modules/suggestion/suggestion.tt | 14 +++++++------- 7 files changed, 18 insertions(+), 18 deletions(-) diff --git a/Koha/Schema/Result/Suggestion.pm b/Koha/Schema/Result/Suggestion.pm index f822dc1a4f..edc76ee7ad 100644 --- a/Koha/Schema/Result/Suggestion.pm +++ b/Koha/Schema/Result/Suggestion.pm @@ -136,7 +136,7 @@ is the suggestion archived? note entered on the suggestion -=head2 privatenote +=head2 staff_note data_type: 'longtext' is_nullable: 1 @@ -333,7 +333,7 @@ __PACKAGE__->add_columns( { data_type => "tinyint", default_value => 0, is_nullable => 0 }, "note", { data_type => "longtext", is_nullable => 1 }, - "privatenote", + "staff_note", { data_type => "longtext", is_nullable => 1 }, "author", { data_type => "varchar", is_nullable => 1, size => 80 }, diff --git a/Koha/Suggestion.pm b/Koha/Suggestion.pm index f66f9f9209..9d9e460a65 100644 --- a/Koha/Suggestion.pm +++ b/Koha/Suggestion.pm @@ -160,7 +160,7 @@ sub to_api_mapping { lastmodificationby => 'last_status_change_by', STATUS => 'status', note => 'note', - privatenote => 'privatenote', + staff_note => 'staff_note', author => 'author', title => 'title', copyrightdate => 'copyright_date', diff --git a/admin/columns_settings.yml b/admin/columns_settings.yml index c5ebf56d10..b5359610e2 100644 --- a/admin/columns_settings.yml +++ b/admin/columns_settings.yml @@ -191,9 +191,9 @@ modules: - columnname: library_fund - - columnname: suggestion_status + columnname: staff_note - - columnname: privatenote + columnname: suggestion_status - columnname: actions cannot_be_toggled: 1 diff --git a/api/v1/swagger/definitions/suggestion.yaml b/api/v1/swagger/definitions/suggestion.yaml index 780773bd42..c0b4b58450 100644 --- a/api/v1/swagger/definitions/suggestion.yaml +++ b/api/v1/swagger/definitions/suggestion.yaml @@ -75,7 +75,7 @@ properties: - string - "null" description: note entered on the suggestion - privatenote: + staff_note: type: - string - "null" diff --git a/installer/data/mysql/atomicupdate/bug_31374.pl b/installer/data/mysql/atomicupdate/bug_31374.pl index 861a71f856..80c278e934 100755 --- a/installer/data/mysql/atomicupdate/bug_31374.pl +++ b/installer/data/mysql/atomicupdate/bug_31374.pl @@ -2,19 +2,19 @@ use Modern::Perl; return { bug_number => "31374", - description => "Add a non-public note cololumn to the suggestions table", + description => "Add a non-public note collumn to the suggestions table", up => sub { my ($args) = @_; my ($dbh, $out) = @$args{qw(dbh out)}; - if( !column_exists( 'suggestions', 'privatenote' ) ) { + if( !column_exists( 'suggestions', 'staff_note' ) ) { $dbh->do(q{ ALTER TABLE suggestions - ADD COLUMN privatenote longtext NULL DEFAULT NULL + ADD COLUMN staff_note longtext NULL DEFAULT NULL COMMENT "suggestions table non-public note" AFTER note }); } # Print useful stuff here - say $out "Add privatenote column to suggestions table"; + say $out "Add staff_note column to suggestions table"; }, }; diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 6462f21116..b9ec78eaca 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -5185,7 +5185,7 @@ CREATE TABLE `suggestions` ( `STATUS` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT 'suggestion status (ASKED, CHECKED, ACCEPTED, REJECTED, ORDERED, AVAILABLE or a value from the SUGGEST_STATUS authorised value category)', `archived` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'is the suggestion archived?', `note` longtext COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'note entered on the suggestion', - `privatenote` longtext COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'non-public note entered on the suggestion', + `staff_note` longtext COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'non-public note entered on the suggestion', `author` varchar(80) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'author of the suggested item', `title` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'title of the suggested item', `copyrightdate` smallint(6) DEFAULT NULL COMMENT 'copyright date of the suggested item', diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt index 0005a3278d..70640fa035 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt @@ -185,10 +185,10 @@ [% note | html %] [% END %] - [% IF ( privatenote ) %] + [% IF ( staff_note ) %]
  • Notes: - [% privatenote | html %] + [% staff_note | html %]
  • [% END %] @@ -417,7 +417,7 @@
  • - +
  • @@ -753,8 +753,8 @@ Last updated Library Fund - Status Non-public note + Status   @@ -832,6 +832,9 @@ [% s.fund.budget_name | html %] + + [% s.staff_note | html %] + [% IF s.STATUS == 'ASKED' %] Pending @@ -855,9 +858,6 @@
    ([% s.reason | html %]) [% END %] - - [% s.privatenote | html %] -
    Edit -- 2.39.5