From a4855c3ce287c8fb8f985f41e611d86f86b86599 Mon Sep 17 00:00:00 2001 From: Pedro Amorim Date: Thu, 15 Feb 2024 15:18:38 +0000 Subject: [PATCH] Bug 36105: Add 'No status alias' option MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 1) Install FreeForm and enable ILLModule, run: bash <(curl -s https://raw.githubusercontent.com/ammopt/koha-ill-dev/master/start-ill-dev.sh) 2) Visit /cgi-bin/koha/admin/authorised_values.pl add search for 'alias', click on ILL_STATUS_ALIAS 3) Click on the 'New authorized value for ILL_STATUS_ALIAS' button and add 'alias_code' in authorized value and 'Alias Description' in Description 4) Visit /cgi-bin/koha/ill/ill-requests.pl and create a new FreeForm request 5) After created, click 'Manage request', and then click the 'Edit request' button 6) Edit the Status and select 'Alias Description', click 'Submit' 7) Create a second request but do not set a status alias this time 7) Visit /cgi-bin/koha/ill/ill-requests.pl and select 'Alias description' on the 'Status aliases:' left-side filter 8) Notice the correct record is returned. 9) Now repeat 7) and select 'No status alias'. Notice the request with an empty status_alias is returned 10) Repeat 7 but select 'All status aliases'. Notice both requests are returned Signed-off-by: Lucas Gass Signed-off-by: Nell O’Hora Signed-off-by: Martin Renvoize Signed-off-by: Katrin Fischer --- .../prog/en/includes/ill-list-table-strings.inc | 1 + koha-tmpl/intranet-tmpl/prog/js/ill-list-table.js | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/ill-list-table-strings.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/ill-list-table-strings.inc index c3cbf09df1..f0b0d8194e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/ill-list-table-strings.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/ill-list-table-strings.inc @@ -5,6 +5,7 @@ var ill_manage_select_backend_first = _("Select a backend first"); var ill_all_statuses = _("All statuses"); var ill_all_status_aliases = _("All status aliases"); + var ill_no_status_alias = _("No status alias"); var ill_status_aliases = _("Status aliases"); diff --git a/koha-tmpl/intranet-tmpl/prog/js/ill-list-table.js b/koha-tmpl/intranet-tmpl/prog/js/ill-list-table.js index be491f4921..8cf93d1baa 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/ill-list-table.js +++ b/koha-tmpl/intranet-tmpl/prog/js/ill-list-table.js @@ -119,7 +119,11 @@ $(document).ready(function() { subquery_and.push( {"me.status":{"=": status }}); } if(status_alias){ - subquery_and.push({"me.status_alias":{"=": status_alias }}); + if (status_alias === 'null' ){ + subquery_and.push({ "me.status_alias": { "=": null } }); + }else{ + subquery_and.push({ "me.status_alias": { "=": status_alias } }); + } } filters.push({"-and": subquery_and}); @@ -489,7 +493,8 @@ $(document).ready(function() { return '
  • '; }); $('#illfilter_status_alias').append( - '' + ''+ + '' ); status_aliases.sort((a, b) => a.str.localeCompare(b.str)).forEach(function (status_alias) { $('#illfilter_status_alias').append( -- 2.39.5