Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Requester can edit refused answer #3382

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions inc/formanswer.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
* ---------------------------------------------------------------------
*/

Expand Down Expand Up @@ -615,6 +615,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) {
Expand Down Expand Up @@ -699,7 +704,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 '</div>';
Expand Down