Пример #1
0
// CHECK LOGIN AND ACLs
check_login();
// SET VARS
$width = '99%';
if (!give_acl($config['id_user'], 0, "IR")) {
    audit_db($config['id_user'], $config["REMOTE_ADDR"], "ACL Violation", "Trying to access ticket viewer");
    require "general/noaccess.php";
    exit;
}
$incident_id = get_parameter('incident_id', 0);
if ($incident_id == 0) {
    ui_print_error_message(__('Unable to load ticket'));
    exit;
}
// GET THE WORKUNITS
$incident['workunits'] = get_incident_full_workunits($incident_id);
if ($incident['workunits'] === false) {
    $incident['workunits'] = array();
}
// SHOW THE WORKUNITS
$table->class = 'result_table';
$table->width = $width;
$table->id = 'incident_search_result_table';
$separator_style = 'border-bottom: 1px solid rgb(204, 204, 204);border-top: 1px solid rgb(204, 204, 204);';
$table->style = array();
$table->data = array();
$table->head = array();
$row = 0;
if (empty($incident['workunits'])) {
    $table->colspan[$row][0] = 2;
    $table->data[$row][0] = '<i>' . __('No workunit was done in this ticket') . '</i>';
Пример #2
0
/**
 * Return an array with the incident details, files and workunits
 *
 * @param array List of incidents to get stats.
 *
 */
function get_full_incident($id_incident, $only_names = false)
{
    $full_incident['details'] = get_db_row_filter('tincidencia', array('id_incidencia' => $id_incident), '*');
    $full_incident['files'] = get_incident_files($id_incident, true);
    if ($full_incident['files'] === false) {
        $full_incident['files'] = array();
    }
    $full_incident['workunits'] = get_incident_full_workunits($id_incident);
    if ($full_incident['workunits'] === false) {
        $full_incident['workunits'] = array();
    }
    return $full_incident;
}