예제 #1
0
<?php

include "../../../inc/includes.php";
header("Content-Type: text/html; charset=UTF-8");
Html::header_nocache();
Session::checkLoginUser();
PluginEscaladeHistory::showCentralList();
예제 #2
0
<?php

include "../../../inc/includes.php";
header("Content-Type: text/html; charset=UTF-8");
Html::header_nocache();
Session::checkLoginUser();
if (!isset($_REQUEST['tickets_id'])) {
    exit;
}
PluginEscaladeHistory::getHistory($_REQUEST['tickets_id']);
예제 #3
0
 /**
  *  remove old groups to a ticket when a new group assigned
  *  called by "pre_item_add" hook on Group_Ticket object
  * @param CommonDBTM $item the ticket object
  */
 static function addHistoryOnAddGroup(CommonDBTM $item)
 {
     global $DB;
     if ($_SESSION['plugins']['escalade']['config']['remove_group'] == false) {
         return true;
     }
     //if group sent is not an assign group, return
     if ($item->input['type'] != CommonITILActor::ASSIGN) {
         return;
     }
     $tickets_id = $item->input['tickets_id'];
     $groups_id = $item->input['groups_id'];
     //if group already assigned, return
     $group_ticket = new Group_Ticket();
     $condition = "tickets_id = {$tickets_id} AND groups_id = {$groups_id} AND type = 2";
     if ($group_ticket->find($condition)) {
         unset($_SESSION['plugin_escalade']['keep_users']);
         return;
     }
     $item->fields['status'] = CommonITILObject::ASSIGNED;
     //add line in history table
     $history = new PluginEscaladeHistory();
     $history->add(array('tickets_id' => $tickets_id, 'groups_id' => $groups_id));
     //remove old user(s) (pass if user added by new ticket form)
     $backtrace = debug_backtrace();
     $first_trace = array_pop($backtrace);
     if (strpos($first_trace['file'], 'ticket.form.php') === false || $first_trace['function'] != "add" || !$first_trace['object'] instanceof Ticket) {
         self::removeAssignUsers($tickets_id);
     }
     //add a task to inform the escalation (pass if solution)
     if (isset($_SESSION['plugin_escalade']['solution'])) {
         unset($_SESSION['plugin_escalade']['solution']);
         return $item;
     }
     if ($_SESSION['plugins']['escalade']['config']['task_history']) {
         $group = new Group();
         $group->getFromDB($groups_id);
         $task = new TicketTask();
         $task->add(array('tickets_id' => $tickets_id, 'is_private' => true, 'state' => 0, 'content' => __("escalated to the group", "escalade") . " " . $group->getName()));
     }
     //check if event is not triggered by behaviors plugin
     //to prevent user remove when "add technician group" option is active
     if (strpos($first_trace['file'], 'ticket.form.php') !== false && $first_trace['function'] == "add" && $first_trace['object'] instanceof Ticket) {
         return;
     }
     if ($_SESSION['plugins']['escalade']['config']['ticket_last_status'] != -1) {
         $ticket = new Ticket();
         $ticket->update(array('id' => $tickets_id, 'status' => $_SESSION['plugins']['escalade']['config']['ticket_last_status']));
     }
     return $item;
 }