diff --git a/inc/target.class.php b/inc/target.class.php index fd46e2472..37092acb5 100644 --- a/inc/target.class.php +++ b/inc/target.class.php @@ -172,15 +172,15 @@ public function prepareInputForAdd($input) { $targetTicket_actor = new PluginFormcreatorTargetTicket_Actor(); $targetTicket_actor->add([ 'plugin_formcreator_targettickets_id' => $id_targetticket, - 'actor_role' => 'requester', - 'actor_type' => 'creator', + 'actor_role' => PluginFormcreatorTarget_Actor::ACTOR_ROLE_REQUESTER, + 'actor_type' => PluginFormcreatorTarget_Actor::ACTOR_TYPE_CREATOR, 'use_notification' => '1' ]); $targetTicket_actor = new PluginFormcreatorTargetTicket_Actor(); $targetTicket_actor->add([ 'plugin_formcreator_targettickets_id' => $id_targetticket, - 'actor_role' => 'observer', - 'actor_type' => 'validator', + 'actor_role' => PluginFormcreatorTarget_Actor::ACTOR_ROLE_OBSERVER, + 'actor_type' => PluginFormcreatorTarget_Actor::ACTOR_TYPE_VALIDATOR, 'use_notification' => '1' ]); } diff --git a/inc/targetbase.class.php b/inc/targetbase.class.php index 9a950fb53..c96b234de 100644 --- a/inc/targetbase.class.php +++ b/inc/targetbase.class.php @@ -54,6 +54,9 @@ abstract class PluginFormcreatorTargetBase extends CommonDBTM implements PluginF protected $form = null; + /** @var boolean $skipCreateActors Flag to disable creation of actors after creation of the item */ + protected $skipCreateActors = false; + abstract public function export($remove_uuid = false); abstract public function save(PluginFormcreatorFormAnswer $formanswer); @@ -1134,7 +1137,11 @@ protected function showActorsSettings() { $itemActor = $this->getItem_Actor(); $itemActorTable = $itemActor::getTable(); $fk = self::getForeignKeyField(); - $actors = ['requester' => [], 'observer' => [], 'assigned' => []]; + $actors = [ + PluginFormcreatorTarget_Actor::ACTOR_ROLE_REQUESTER => [], + PluginFormcreatorTarget_Actor::ACTOR_ROLE_OBSERVER => [], + PluginFormcreatorTarget_Actor::ACTOR_ROLE_ASSIGNED => [], + ]; $result = $DB->request([ 'SELECT' => ['id', 'actor_role', 'actor_type', 'actor_value', 'use_notification'], 'FROM' => $itemActorTable, @@ -1195,7 +1202,7 @@ protected function showActorsSettings() { // => Add requester form echo '