Skip to content

Commit de0a303

Browse files
committed
fix(targetticket,targetchange): cannot use dropdown type questions to set entity, category
Signed-off-by: Thierry Bugier <[email protected]>
1 parent 671fd3c commit de0a303

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

inc/abstracttarget.class.php

+6-5
Original file line numberDiff line numberDiff line change
@@ -927,7 +927,7 @@ protected function showDestinationEntitySetings($rand) {
927927
$this->getForm()->getID(),
928928
[
929929
'fieldtype' => ['glpiselect'],
930-
'values' => User::class,
930+
'values' => ['LIKE', '%"itemtype":"' . User::class . '"%'],
931931
],
932932
'_destination_entity_value_user',
933933
$this->fields['destination_entity_value']
@@ -939,7 +939,7 @@ protected function showDestinationEntitySetings($rand) {
939939
$this->getForm()->getID(),
940940
[
941941
'fieldtype' => ['glpiselect'],
942-
'values' => Entity::class,
942+
'values' => ['LIKE', '%"itemtype":"' . Entity::class . '"%'],
943943
],
944944
'_destination_entity_value_entity',
945945
$this->fields['destination_entity_value']
@@ -1193,6 +1193,7 @@ protected function showCategorySettings($rand) {
11931193
$this->getForm()->getID(),
11941194
[
11951195
'fieldtype' => ['dropdown'],
1196+
'values' => ['LIKE', '%"itemtype":"' . ITILCategory::class . '"%'],
11961197
],
11971198
'_category_question',
11981199
$this->fields['category_question']
@@ -1934,7 +1935,7 @@ protected function showActorSettingsForType($actorType, array $actors) {
19341935
'OR' => [
19351936
'AND' => [
19361937
'fieldtype' => ['glpiselect'],
1937-
'values' => User::class,
1938+
'values' => ['LIKE', '%"itemtype":"' . User::class . '"%'],
19381939
],
19391940
[
19401941
'fieldtype' => ['email'],
@@ -1951,7 +1952,7 @@ protected function showActorSettingsForType($actorType, array $actors) {
19511952
$this->getForm()->getID(),
19521953
[
19531954
'fieldtype' => ['glpiselect'],
1954-
'values' => Group::class,
1955+
'values' => ['LIKE', '%"itemtype":"' . Group::class . '"%'],
19551956
],
19561957
'actor_value_' . PluginFormcreatorTarget_Actor::ACTOR_TYPE_QUESTION_GROUP,
19571958
0
@@ -2003,7 +2004,7 @@ protected function showActorSettingsForType($actorType, array $actors) {
20032004
$this->getForm()->getID(),
20042005
[
20052006
'fieldtype' => ['glpiselect'],
2006-
'values' => Supplier::class,
2007+
'values' => ['LIKE', '%"itemtype":"' . Supplier::class . '"%'],
20072008
],
20082009
'actor_value_' . PluginFormcreatorTarget_Actor::ACTOR_TYPE_QUESTION_SUPPLIER,
20092010
0

0 commit comments

Comments
 (0)