From 7d4e6c81913521c2ff15c7a51773569ec4af2f2a Mon Sep 17 00:00:00 2001 From: Pedro Amorim Date: Tue, 15 Apr 2025 09:38:20 +0000 Subject: [PATCH] Bug 39446: Show both status and status_alias Content-Type: text/plain; charset=utf-8 If a request has a status_alias and that status_alias does not have a lib_opac defined, it'll show as an empty status on the OPAC. Staff UI always shows the request's status and adds the status_alias only if that is defined. The same should happen on the OPAC. To test: 1) Enabled ILLModule 2) Create a new ILL request, visit: http://localhost:8081/cgi-bin/koha/ill/ill-requests.pl?method=create&backend=Standard 3) Add '42' on the cardnumber. Pick any library. Click 'Create'. 4) Add a new 'status_alias' entry, visit the authorized values page: http://localhost:8081/cgi-bin/koha/admin/authorised_values.pl 5) Search for 'ill_'. Pick 'ILL_STATUS_ALIAS'. Click 'Add a new authorized value'. 6) Enter the 'Authorized value' of 'test', and 'Description' of 'test'. Click 'Save'. 7) Visit the previously created ILL request: http://localhost:8081/cgi-bin/koha/ill/ill-requests.pl?op=illview&illrequest_id=1 8) Click 'Edit request' from the top toolbar. 9) On the 'Status' dropdown, pick 'test'. Click 'Submit'. 10) Visit the ILL on the OPAC: http://localhost:8080/cgi-bin/koha/opac-illrequests.pl 11) Notice the 'status' column does not display the status_alias. Click the 'View', notice the 'status' entry does not display the status_alias. 12) Apply patch. Repeat. Notice it defaults to displaying the authorised value code if lib_opac is empty. Signed-off-by: Brendan Gallagher Signed-off-by: Marcel de Rooy --- Koha/ILL/Request.pm | 2 +- .../opac-tmpl/bootstrap/en/modules/opac-illrequests.tt | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Koha/ILL/Request.pm b/Koha/ILL/Request.pm index 39cf029908..5b5cd14c32 100644 --- a/Koha/ILL/Request.pm +++ b/Koha/ILL/Request.pm @@ -2099,7 +2099,7 @@ This method returns the list of publicly readable database fields for both API a sub public_read_list { return [ qw( - illrequest_id backend status extended_attributes placed updated + illrequest_id backend status status_alias extended_attributes placed updated ) ]; } diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-illrequests.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-illrequests.tt index bea33ac12b..034a7de286 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-illrequests.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-illrequests.tt @@ -183,7 +183,12 @@
  • - [% request.status_alias ? request.statusalias.lib_opac : request.capabilities.$status.name | html %] + [% request.capabilities.$status.name | html %] + [% IF request.status_alias && request.statusalias.lib_opac %] + [% request.statusalias.lib_opac | html %] + [% ELSE %] + [% request.statusalias.authorised_value | html %] + [% END %]
  • -- 2.39.5