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 <lisetteslatah@gmail.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit b25c063f95)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
Jonathan Druart 2018-07-11 18:23:49 -03:00 committed by Martin Renvoize
parent 8395187a98
commit e81fdb07c6
No known key found for this signature in database
GPG Key ID: 422B469130441A0F
2 changed files with 17 additions and 8 deletions

View File

@ -75,13 +75,22 @@
[% END %]
</td>
<td>
[% 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" %]<span>Requested</span>
[% CASE "CHECKED" %]<span>Checked by the library</span>
[% CASE "ACCEPTED" %]<span>Accepted by the library</span>
[% CASE "ORDERED" %]<span>Ordered by the library</span>
[% CASE "REJECTED" %]<span>Suggestion declined<span>
[% CASE "AVAILABLE" %]<span>Available in the library</span>
[% CASE %]
[% SET status_description = AuthorisedValues.GetByCode('SUGGEST_STATUS', s.STATUS) %]
[% IF status_description %]
[% status_description %]
[% ELSE %]
<span>Unknown</span>
[% END %]
[% END %]
[% IF s.reason %]([% s.reason %])[% END %]
</td>
</tr>
[% END %]

View File

@ -308,7 +308,7 @@
[% END %]
[% FOREACH s IN SuggestionStatuses %]
[% IF s.authorised_value == selected_status %]
[% IF s.authorised_value == suggestion.STATUS %]
<option value="[% s.authorised_value %]" selected="selected">[% s.lib %]</option>
[% ELSE %]
<option value="[% s.authorised_value %]">[% s.lib %]</option>