File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 39
39
use Entity ;
40
40
use CommonTreeDropdown ;
41
41
use CommonDBTM ;
42
+ use User ;
42
43
43
44
use GlpiPlugin \Formcreator \Exception \ComparisonException ;
44
45
use Glpi \Application \View \TemplateRenderer ;
@@ -60,10 +61,11 @@ public function showForm(array $options): void {
60
61
$ item = new $ this ->question ->fields ['itemtype ' ];
61
62
$ this ->question ->fields ['_is_entity_restrict ' ] = $ item ->isEntityAssign () ? '1 ' : '0 ' ;
62
63
}
64
+ if (isset ($ this ->question ->fields ['itemtype ' ]) && $ this ->question ->fields ['itemtype ' ] == User::class) {
65
+ $ this ->question ->fields ['_is_entity_restrict ' ] = '1 ' ;
66
+ }
63
67
if (isset ($ this ->question ->fields ['itemtype ' ]) && is_subclass_of ($ this ->question ->fields ['itemtype ' ], CommonTreeDropdown::class)) {
64
68
$ this ->question ->fields ['_is_tree ' ] = '1 ' ;
65
- // $item = new $this->question->fields['itemtype'];
66
- // $this->question->fields['_is_entity_restrict'] = $item->isEntityAssign() ? '1' : '0';
67
69
}
68
70
$ this ->question ->fields ['default_values ' ] = Html::entities_deep ($ this ->question ->fields ['default_values ' ]);
69
71
$ this ->deserializeValue ($ this ->question ->fields ['default_values ' ]);
You can’t perform that action at this time.
0 commit comments