diff --git a/inc/formanswer.class.php b/inc/formanswer.class.php index fbbf1c07c..eae0edaf4 100644 --- a/inc/formanswer.class.php +++ b/inc/formanswer.class.php @@ -25,7 +25,7 @@ * @license http://www.gnu.org/licenses/gpl.txt GPLv3+ * @link https://github.com/pluginsGLPI/formcreator/ * @link https://pluginsglpi.github.io/formcreator/ - * @link http://plugins.glpi-project.org/#/plugin/formcreatorp@ + * @link http://plugins.glpi-project.org/#/plugin/formcreator * --------------------------------------------------------------------- */ @@ -616,6 +616,11 @@ public function showForm($ID, $options = []) { // Edit mode for validator $editMode = !isset($options['edit']) ? false : ($options['edit'] != '0'); + // Can the current user edit the answers ? + $canEdit = $this->fields['status'] == self::STATUS_REFUSED + && Session::getLoginUserID() == $this->fields['requester_id'] + || $this->fields['status'] == self::STATUS_WAITING + && $this->canValidate() && $editMode; // form title if (version_compare(GLPI_VERSION, '10.0.3') < 0) { @@ -700,7 +705,7 @@ public function showForm($ID, $options = []) { } } } - echo $question->getRenderedHtml($domain, $editMode, $this, $visibility[$question->getType()][$question->getID()]); + echo $question->getRenderedHtml($domain, $canEdit, $this, $visibility[$question->getType()][$question->getID()]); $lastQuestion = $question; } echo '';