|
25 | 25 | * @license http://www.gnu.org/licenses/gpl.txt GPLv3+
|
26 | 26 | * @link https://github.com/pluginsGLPI/formcreator/
|
27 | 27 | * @link https://pluginsglpi.github.io/formcreator/
|
28 |
| - * @link http://plugins.glpi-project.org/#/plugin/formcreatorp@ |
| 28 | + * @link http://plugins.glpi-project.org/#/plugin/formcreator |
29 | 29 | * ---------------------------------------------------------------------
|
30 | 30 | */
|
31 | 31 |
|
@@ -616,6 +616,11 @@ public function showForm($ID, $options = []) {
|
616 | 616 |
|
617 | 617 | // Edit mode for validator
|
618 | 618 | $editMode = !isset($options['edit']) ? false : ($options['edit'] != '0');
|
| 619 | + // Can the current user edit the answers ? |
| 620 | + $canEdit = $this->fields['status'] == self::STATUS_REFUSED |
| 621 | + && Session::getLoginUserID() == $this->fields['requester_id'] |
| 622 | + || $this->fields['status'] == self::STATUS_WAITING |
| 623 | + && $this->canValidate() && $editMode; |
619 | 624 |
|
620 | 625 | // form title
|
621 | 626 | if (version_compare(GLPI_VERSION, '10.0.3') < 0) {
|
@@ -700,7 +705,7 @@ public function showForm($ID, $options = []) {
|
700 | 705 | }
|
701 | 706 | }
|
702 | 707 | }
|
703 |
| - echo $question->getRenderedHtml($domain, $editMode, $this, $visibility[$question->getType()][$question->getID()]); |
| 708 | + echo $question->getRenderedHtml($domain, $canEdit, $this, $visibility[$question->getType()][$question->getID()]); |
704 | 709 | $lastQuestion = $question;
|
705 | 710 | }
|
706 | 711 | echo '</div>';
|
|
0 commit comments