diff --git a/inc/targetbase.class.php b/inc/targetbase.class.php index 25df4f58e..358e780cb 100644 --- a/inc/targetbase.class.php +++ b/inc/targetbase.class.php @@ -1517,19 +1517,19 @@ protected function showActorSettingsHeader($type) { /** * Show header for actors edition * - * @param integer $type see CommonITILActor constants + * @param integer $actorType see CommonITILActor constants * @param array $actors actors to show * @return void */ - protected function showActorSettingsForType($type, array $actors) { + protected function showActorSettingsForType($actorType, array $actors) { $itemActor = $this->getItem_Actor(); $dropdownItems = ['' => Dropdown::EMPTY_VALUE] + $itemActor::getEnumActorType(); - switch ($type) { // Values from CommonITILObject::getSearchOptionsActors() + switch ($actorType) { // Values from CommonITILObject::getSearchOptionsActors() case CommonITILActor::REQUESTER: $type = 'requester'; - unset($dropdownItems['supplier']); - unset($dropdownItems['question_supplier']); + unset($dropdownItems[PluginFormcreatorTarget_Actor::ACTOR_TYPE_SUPPLIER]); + unset($dropdownItems[PluginFormcreatorTarget_Actor::ACTOR_TYPE_QUESTION_SUPPLIER]); $changeActorJSFunction = 'plugin_formcreator_ChangeActorRequester(this.value)'; $actorRole = PluginFormcreatorTarget_Actor::ACTOR_ROLE_REQUESTER; break; @@ -1643,6 +1643,28 @@ protected function showActorSettingsForType($type, array $actors) { ); echo ''; + if ($actorType == CommonITILActor::ASSIGN) { + echo ''; + + echo ''; + } + echo '
'; echo __('Email followup'); Dropdown::showYesNo('use_notification', 1); @@ -1713,6 +1735,17 @@ protected function showActorSettingsForType($type, array $actors) { echo $img_user . ' ' . __('Actors from the question', 'formcreator') . ' "' . $question->getName() . '"'; break; + case PluginFormcreatorTarget_Actor::ACTOR_TYPE_SUPPLIER : + $supplier = new Supplier(); + $supplier->getFromDB($values['actor_value']); + echo $img_supplier . ' ' . __('Supplier') . ' "' . $supplier->getName() . '"'; + break; + case PluginFormcreatorTarget_Actor::ACTOR_TYPE_QUESTION_SUPPLIER : + $question = new PluginFormcreatorQuestion(); + $question->getFromDB($values['actor_value']); + echo $img_supplier . ' ' . __('Supplier from the question', 'formcreator') + . ' "' . $question->getName() . '"'; + break; } echo $values['use_notification'] ? ' ' . $img_mail . ' ' : ' ' . $img_nomail . ' '; echo self::getDeleteImage($id);