From b1a21d8fd6cddc8bfb81c64a3a0b9dc4835e3f92 Mon Sep 17 00:00:00 2001 From: Romain Lecouvreur Date: Fri, 9 Feb 2024 14:26:45 +0100 Subject: [PATCH 1/9] Fix identical status label in simplified dashboard --- inc/formanswer.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inc/formanswer.class.php b/inc/formanswer.class.php index 9fcde93f4..9dab052d0 100644 --- a/inc/formanswer.class.php +++ b/inc/formanswer.class.php @@ -75,7 +75,7 @@ class PluginFormcreatorFormAnswer extends CommonDBTM public static function getStatuses() { return [ - self::STATUS_WAITING => __('Waiting', 'formcreator'), + self::STATUS_WAITING => __('Waiting for approval'), self::STATUS_REFUSED => __('Refused', 'formcreator'), self::STATUS_ACCEPTED => __('Accepted', 'formcreator'), ]; From d53bd4645b2ce3e43c66501a56aab5200bd333ce Mon Sep 17 00:00:00 2001 From: Romain Lecouvreur Date: Fri, 9 Feb 2024 16:01:49 +0100 Subject: [PATCH 2/9] Change constant name from STATUS_WAITING to STATUS_APPROVAL --- inc/common.class.php | 2 +- inc/form.class.php | 6 ++-- inc/formanswer.class.php | 28 +++++++++---------- inc/issue.class.php | 8 +++--- tests/3-unit/PluginFormcreatorCommon.php | 2 +- tests/3-unit/PluginFormcreatorFormAnswer.php | 2 +- tests/3-unit/PluginFormcreatorIssue.php | 4 +-- .../3-unit/PluginFormcreatorTargetTicket.php | 10 +++---- 8 files changed, 31 insertions(+), 31 deletions(-) diff --git a/inc/common.class.php b/inc/common.class.php index 8174bf630..4d4fac7c3 100644 --- a/inc/common.class.php +++ b/inc/common.class.php @@ -274,7 +274,7 @@ public static function getTicketStatusForIssue(Ticket $item) : int { switch ($item->fields['global_validation']) { case CommonITILValidation::WAITING: if (!in_array($item->fields['status'], [Ticket::SOLVED, Ticket::CLOSED])) { - $status = PluginFormcreatorFormAnswer::STATUS_WAITING; + $status = PluginFormcreatorFormAnswer::STATUS_APPROVAL; } break; case CommonITILValidation::REFUSED: diff --git a/inc/form.class.php b/inc/form.class.php index 6ac380221..a9cb61c7c 100644 --- a/inc/form.class.php +++ b/inc/form.class.php @@ -126,7 +126,7 @@ public static function getMenuContent() { title="' . PluginFormcreatorIssue::getTypeName(Session::getPluralNumber()) . '">'; $menu['links']['search'] = PluginFormcreatorFormList::getSearchURL(false); - $menu['links'][$validation_image] = PluginFormcreatorFormAnswer::getSearchURL(false).'?criteria[0][link]=AND&criteria[0][field]=8&criteria[0][searchtype]=equals&criteria[0][value]=' . PluginFormcreatorFormAnswer::STATUS_WAITING; + $menu['links'][$validation_image] = PluginFormcreatorFormAnswer::getSearchURL(false).'?criteria[0][link]=AND&criteria[0][field]=8&criteria[0][searchtype]=equals&criteria[0][value]=' . PluginFormcreatorFormAnswer::STATUS_APPROVAL; $menu['links'][$import_image] = PluginFormcreatorForm::getFormURL(false)."?import_form=1"; $menu['links'][$requests_image] = PluginFormcreatorIssue::getSearchURL(false); return $menu; @@ -939,7 +939,7 @@ protected function showMyLastForms() : void { echo '