From 45cca9d1f2b137b5c597bacaf8ef19eb8b1ad5c0 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 Signed-off-by: Lisette Scheer Signed-off-by: Marcel de Rooy Signed-off-by: Nick Clemens (cherry picked from commit b25c063f950076234cf7bb4a496921983a7cc23f) Signed-off-by: Martin Renvoize (cherry picked from commit e81fdb07c68fb80bc497190dfd2dd15f24491447) Signed-off-by: Fridolin Somers --- .../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 0f06a53855..57a6de6321 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 @@ -84,13 +84,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 5a8ada6ff0..996266b987 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt @@ -467,7 +467,7 @@ h4.local_collapse a { font-size : 80%; text-decoration: none; } fieldset.brief o [% END %] [% FOREACH s IN SuggestionStatuses %] - [% IF s.authorised_value == selected_status %] + [% IF s.authorised_value == suggestion.STATUS %] [% ELSE %] -- 2.39.5