From 75f7b0bb79e16b887a7101daca87633d7f057e31 Mon Sep 17 00:00:00 2001 From: Thierry Bugier Date: Thu, 17 Oct 2019 11:02:16 +0200 Subject: [PATCH] refactor(formanswer): use HTML class, remove unused var Signed-off-by: Thierry Bugier --- inc/formanswer.class.php | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/inc/formanswer.class.php b/inc/formanswer.class.php index 4438ad491..2a5955178 100644 --- a/inc/formanswer.class.php +++ b/inc/formanswer.class.php @@ -480,7 +480,6 @@ public function showForm($ID, $options = []) { $canEdit = $this->fields['status'] == self::STATUS_REFUSED && $_SESSION['glpiID'] == $this->fields['requester_id']; - $canValidate = $this->canValidate(); echo ''; @@ -612,23 +611,29 @@ public function showForm($ID, $options = []) { echo ''; // Display validation form - } else if (($this->fields['status'] == self::STATUS_WAITING) && $canValidate) { + } else if (($this->fields['status'] == self::STATUS_WAITING) && $this->canValidate()) { echo '
'; echo ''; - echo ''; + Html::textarea([ + 'name' => 'comment', + 'value' => $this->fields['comment'] + ]); echo '
' . __('Required if refused', 'formcreator') . '
'; echo '
'; echo '
'; echo '
'; - echo ''; + echo Html::submit( + __('Refuse', 'formcreator'), [ + 'name' => 'refuse_formanswer', + 'onclick' => 'return checkComment(this)', + ]); echo '
'; echo '
'; - echo ''; + echo Html::submit( + __('Accept', 'formcreator'), [ + 'name' => 'accept_formanswer', + ]); echo '
'; echo '
'; $options['canedit'] = true; @@ -643,7 +648,7 @@ public function showForm($ID, $options = []) { // echo ''; echo '