Html::back();
    } elseif (isset($_POST['actor_role'])) {
        Session::checkRight("entity", UPDATE);
        $id = (int) $_POST['id'];
        $actor_value = isset($_POST['actor_value_' . $_POST['actor_type']]) ? $_POST['actor_value_' . $_POST['actor_type']] : '';
        $use_notification = $_POST['use_notification'] == 0 ? 0 : 1;
        $query = "INSERT INTO glpi_plugin_formcreator_targettickets_actors SET\n                  `plugin_formcreator_targettickets_id` = {$id},\n                  `actor_role`                          = '" . $_POST['actor_role'] . "',\n                  `actor_type`                          = '" . $_POST['actor_type'] . "',\n                  `actor_value`                         = " . (int) $actor_value . ",\n                  `use_notification`                    = " . (int) $use_notification;
        $DB->query($query);
        Html::back();
    } elseif (isset($_GET['delete_actor'])) {
        $query = "DELETE FROM glpi_plugin_formcreator_targettickets_actors\n                WHERE id = " . (int) $_GET['delete_actor'];
        $DB->query($query);
        Html::back();
        // Show target ticket form
    } else {
        Html::header(__('Form Creator', 'formcreator'), $_SERVER['PHP_SELF'], 'admin', 'PluginFormcreatorForm');
        $itemtype = "PluginFormcreatorTargetTicket";
        $target = new PluginFormcreatorTarget();
        $found = $target->find("itemtype = '{$itemtype}' AND items_id = " . (int) $_REQUEST['id']);
        $first = array_shift($found);
        $form = new PluginFormcreatorForm();
        $form->getFromDB($first['plugin_formcreator_forms_id']);
        $_SESSION['glpilisttitle'][$itemtype] = sprintf(__('%1$s = %2$s'), $form->getTypeName(1), $form->getName());
        $_SESSION['glpilisturl'][$itemtype] = $form->getFormURL() . "?id=" . $form->getID();
        $targetticket->display($_REQUEST);
        Html::footer();
    }
    // Or display a "Not found" error
} else {
    Html::displayNotFoundError();
}
 /**
  * Prepare input datas for adding the question
  * Check fields values and get the order for the new question
  *
  * @param $input datas used to add the item
  *
  * @return the modified $input array
  **/
 public function prepareInputForAdd($input)
 {
     $form = new PluginFormcreatorForm();
     $form->getFromDB($input['plugin_formcreator_forms_id']);
     $input['name'] = $form->getName();
     return $input;
 }