Skip to content

Commit

Permalink
fix(glpiselectfield): restore entity restriction for users
Browse files Browse the repository at this point in the history
  • Loading branch information
btry committed Dec 1, 2022
1 parent d61b101 commit e525b3a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions inc/field/glpiselectfield.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
use Entity;
use CommonTreeDropdown;
use CommonDBTM;
use User;

use GlpiPlugin\Formcreator\Exception\ComparisonException;
use Glpi\Application\View\TemplateRenderer;
Expand All @@ -60,10 +61,11 @@ public function showForm(array $options): void {
$item = new $this->question->fields['itemtype'];
$this->question->fields['_is_entity_restrict'] = $item->isEntityAssign() ? '1' : '0';
}
if (isset($this->question->fields['itemtype']) && $this->question->fields['itemtype'] == User::class) {
$this->question->fields['_is_entity_restrict'] = '1';
}
if (isset($this->question->fields['itemtype']) && is_subclass_of($this->question->fields['itemtype'], CommonTreeDropdown::class)) {
$this->question->fields['_is_tree'] = '1';
// $item = new $this->question->fields['itemtype'];
// $this->question->fields['_is_entity_restrict'] = $item->isEntityAssign() ? '1' : '0';
}
$this->question->fields['default_values'] = Html::entities_deep($this->question->fields['default_values']);
$this->deserializeValue($this->question->fields['default_values']);
Expand Down

0 comments on commit e525b3a

Please sign in to comment.