Exemplo n.º 1
0
function plugin_escalade_item_add_user($item)
{
    global $DB;
    if ($item instanceof Ticket_User) {
        //prevent escalade hook to trigger on ticket creation
        if (isset($_SESSION['plugin_escalade']['skip_hook_add_user'])) {
            //unset($_SESSION['plugin_escalade']['skip_hook_add_user']);
            return true;
        }
        //this hook is only for assign
        if ($item->fields['type'] == CommonITILActor::ASSIGN) {
            return PluginEscaladeTicket::item_add_user($item);
        }
    }
    return true;
}
Exemplo n.º 2
0
function plugin_escalade_item_add_user($item)
{
    global $DB;
    if ($item instanceof User) {
        $config = new PluginEscaladeConfig();
        $config->getFromDB(1);
        $default_value = $config->fields["use_filter_assign_group"];
        $query = "INSERT INTO glpi_plugin_escalade_users (`users_id`, `use_filter_assign_group`)\n                  VALUES (" . $item->getID() . ", {$default_value})";
        $DB->query($query);
    }
    if ($item instanceof Ticket_User) {
        //prevent escalade hook to trigger on ticket creation
        if (isset($_SESSION['plugin_escalade']['skip_hook_add_user'])) {
            //unset($_SESSION['plugin_escalade']['skip_hook_add_user']);
            return true;
        }
        //this hook is only for assign
        if ($item->fields['type'] == CommonITILActor::ASSIGN) {
            return PluginEscaladeTicket::item_add_user($item);
        }
    }
    return true;
}