From 85c9b7fb3a3802a892e011437fada866383c71e1 Mon Sep 17 00:00:00 2001 From: Andrew Isherwood Date: Tue, 17 Apr 2018 12:03:07 +0100 Subject: [PATCH] Bug 20581: Add display of status_alias to staff vw - This patch adds display of the new status_alias value, when set, in favour of the request's status value. - It also allows the user to set a status_alias for an existing request. When set, this value will be displayed in preference to the status. Signed-off-by: Niamh.Walker-Headon@it-tallaght.ie Signed-off-by: Katrin Fischer Signed-off-by: Katrin Fischer Signed-off-by: Nick Clemens --- ill/ill-requests.pl | 11 ++++- .../prog/en/modules/ill/ill-requests.tt | 44 +++++++++++++++---- 2 files changed, 44 insertions(+), 11 deletions(-) diff --git a/ill/ill-requests.pl b/ill/ill-requests.pl index d962773188..e84ccab6b4 100755 --- a/ill/ill-requests.pl +++ b/ill/ill-requests.pl @@ -162,8 +162,11 @@ if ( $backends_available ) { value => {} }; $template->param( - whole => $backend_result, - request => $request + whole => $backend_result, + request => $request, + status_aliases => scalar Koha::AuthorisedValues->search( + { category => 'ILLSTATUS' } + ) ); } else { # Commit: @@ -174,6 +177,10 @@ if ( $backends_available ) { $request->price_paid($params->{price_paid}); $request->notesopac($params->{notesopac}); $request->notesstaff($params->{notesstaff}); + my $alias = ($params->{status_alias} =~ /\d/) ? + $params->{status_alias} : + undef; + $request->status_alias($alias); $request->store; my $backend_result = { error => 0, diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt index 575e17f357..3187447aea 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt @@ -191,7 +191,25 @@
  • [% stat = request.status %] - [% request.capabilities.$stat.name | html %] + [% current_alias = request.status_alias %] +
  • @@ -334,7 +352,11 @@
  • Status: - [% request.capabilities.$req_status.name | html %] + [% IF request.statusalias %] + [% request.statusalias.authorised_value | html %] + [% ELSE %] + [% request.capabilities.$req_status.name | html%] + [% END %]
  • Last updated: @@ -724,14 +746,18 @@ // Render function for request status var createStatus = function(data, type, row, meta) { - var origData = meta.settings.oInit.originalData; - if (origData.length > 0) { - var status_name = meta.settings.oInit.originalData[0].capabilities[ - row.status - ].name; - return getStatusName(status_name); + if (row.status_alias) { + return row.status_alias.authorised_value; } else { - return ''; + var origData = meta.settings.oInit.originalData; + if (origData.length > 0) { + var status_name = meta.settings.oInit.originalData[0].capabilities[ + row.status + ].name; + return getStatusName(status_name); + } else { + return ''; + } } }; -- 2.39.5