From 65fdd9c0e047dfce535b874ad85f604bc09f7cb9 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 11 Jul 2018 18:23:49 -0300 Subject: [PATCH] Bug 21048: Fix display of suggestion's status (SUGGEST_STATUS) When a suggestion's status is set to a customized value (AV SUGGEST_STATUS), the description is not always displayed correctly. Test plan: - Create different values for the AV SUGGEST_STATUS - Create several suggestions - Change the status using the SUGGEST_STATUS values - Edit the suggestion and change again the status - View the suggestions for a given patron (members/purchase-suggestions.pl?borrowernumber=XX), the statuses must displayed correctly --- .../en/modules/members/purchase-suggestions.tt | 23 +++++++++++++++------- .../prog/en/modules/suggestion/suggestion.tt | 2 +- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/purchase-suggestions.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/purchase-suggestions.tt index 6794bc0810..0f37bbbafd 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/purchase-suggestions.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/purchase-suggestions.tt @@ -75,13 +75,22 @@ [% END %] - [% IF ( s.ASKED ) %]Requested[% END %] - [% IF ( s.CHECKED ) %]Checked by the library[% END %] - [% IF ( s.ACCEPTED ) %]Accepted by the library[% END %] - [% IF ( s.ORDERED ) %]Ordered by the library[% END %] - [% IF ( s.REJECTED ) %]Suggestion declined [% END %] - [% IF ( s.AVAILABLE ) %]Available in the library[% END %] - [% IF ( s.reason ) %]([% s.reason %])[% END %] + [% SWITCH s.STATUS %] + [% CASE "ASKED" %]Requested + [% CASE "CHECKED" %]Checked by the library + [% CASE "ACCEPTED" %]Accepted by the library + [% CASE "ORDERED" %]Ordered by the library + [% CASE "REJECTED" %]Suggestion declined + [% CASE "AVAILABLE" %]Available in the library + [% CASE %] + [% SET status_description = AuthorisedValues.GetByCode('SUGGEST_STATUS', s.STATUS) %] + [% IF status_description %] + [% status_description %] + [% ELSE %] + Unknown + [% END %] + [% END %] + [% IF s.reason %]([% s.reason %])[% END %] [% END %] 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 16f4ccf256..63bcab8491 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt @@ -308,7 +308,7 @@ [% END %] [% FOREACH s IN SuggestionStatuses %] - [% IF s.authorised_value == selected_status %] + [% IF s.authorised_value == suggestion.STATUS %] [% ELSE %] -- 2.11.0