function incidents_search_result($filter, $ajax = false, $return_incidents = false, $print_result_count = false, $no_parents = false, $resolve_names = false, $report_mode = false, $csv_mode = false)
{
    global $config;
    $params = "";
    foreach ($filter as $key => $value) {
        $params .= "&search_" . $key . "=" . $value;
    }
    //Only show incident for last year if there isn't a search by dates
    if (!$filter['first_date'] && !$filter['last_date']) {
        $filter_year = $filter;
        $now = print_mysql_timestamp();
        $year_in_seconds = 3600 * 24 * 365;
        $year_ago_unix = time() - $year_in_seconds;
        $year_ago = date("Y-m-d H:i:s", $year_ago_unix);
        $filter_year['first_date'] = $year_ago;
        $filter_year['last_date'] = $now;
        $count_this_year = filter_incidents($filter_year, true, false, $no_parents, $csv_mode);
        $aux_text = "(" . $count_this_year . ")" . print_help_tip(__("Tickets created last year"), true);
    }
    if (!$report_mode) {
        //Add offset to filter parameters
        $offset = get_parameter("offset");
        $filter["offset"] = $offset;
        // Store the previous limit filter
        $limit_aux = $filter["limit"];
    }
    // Set the limit filter to 0 to retrieve all the tickets for the array pagination
    $filter["limit"] = 0;
    // All the tickets the user sees are retrieved
    $incidents = filter_incidents($filter, false, true, $no_parents, $csv_mode);
    $count = empty($incidents) ? 0 : count($incidents);
    if ($resolve_names) {
        $incidents_aux = array();
        $i = 0;
        foreach ($incidents as $inc) {
            $incidents_aux[$i] = $inc;
            $incidents_aux[$i]['estado'] = incidents_get_incident_status_text($inc['id_incidencia']);
            $incidents_aux[$i]['resolution'] = incidents_get_incident_resolution_text($inc['id_incidencia']);
            $incidents_aux[$i]['prioridad'] = incidents_get_incident_priority_text($inc['id_incidencia']);
            $incidents_aux[$i]['id_grupo'] = incidents_get_incident_group_text($inc['id_incidencia']);
            $incidents_aux[$i]['id_group_creator'] = incidents_get_incident_group_text($inc['id_incidencia']);
            //~ $incidents_aux[$i]['id_incident_type'] = incidents_get_incident_type_text ($inc['id_incidencia']);
            $i++;
        }
        $incidents = $incidents_aux;
    }
    if ($return_incidents) {
        return $incidents;
    }
    if (!$report_mode) {
        // Set the limit filter to its previous value
        $filter["limit"] = $limit_aux;
        $url = "index.php?sec=incidents&sec2=operation/incidents/incident_search" . $params;
        $incidents = print_array_pagination($incidents, $url, $offset);
    }
    $statuses = get_indicent_status();
    $resolutions = get_incident_resolutions();
    // ORDER BY
    if ($filter['order_by'] && !is_array($filter['order_by'])) {
        $order_by = json_decode(clean_output($filter['order_by']), true);
    } else {
        $order_by = $filter['order_by'];
    }
    if (!$report_mode) {
        if ($order_by["id_incidencia"] != "") {
            if ($order_by["id_incidencia"] == "DESC") {
                $id_order_image = "&nbsp;<a href='javascript:changeIncidentOrder(\"id_incidencia\", \"ASC\")'><img src='images/arrow_down_orange.png'></a>";
            } else {
                $id_order_image = "&nbsp;<a href='javascript:changeIncidentOrder(\"id_incidencia\", \"\")'><img src='images/arrow_up_orange.png'></a>";
            }
        } else {
            $id_order_image = "&nbsp;<a href='javascript:changeIncidentOrder(\"id_incidencia\", \"DESC\")'><img src='images/block_orange.png'></a>";
        }
        if ($order_by["prioridad"] != "") {
            if ($order_by["prioridad"] == "DESC") {
                $priority_order_image = "&nbsp;<a href='javascript:changeIncidentOrder(\"prioridad\", \"ASC\")'><img src='images/arrow_down_orange.png'></a>";
            } else {
                $priority_order_image = "&nbsp;<a href='javascript:changeIncidentOrder(\"prioridad\", \"\")'><img src='images/arrow_up_orange.png'></a>";
            }
        } else {
            $priority_order_image = "&nbsp;<a href='javascript:changeIncidentOrder(\"prioridad\", \"DESC\")'><img src='images/block_orange.png'></a>";
        }
    } else {
        $id_order_image = "";
        $priority_order_image = "";
    }
    // ----------------------------------------
    // Here we print the result of the search
    // ----------------------------------------
    echo '<table width="99%" cellpadding="0" cellspacing="0" border="0px" class="result_table listing" id="incident_search_result_table">';
    echo '<thead>';
    echo "<tr>";
    echo "<th>";
    echo print_checkbox('incidentcb-all', "", false, true);
    echo "</th>";
    echo "<th>";
    echo __('ID') . $id_order_image;
    echo "</th>";
    echo "<th>";
    echo __('SLA');
    echo "</th>";
    if ($report_mode) {
        echo "<th>";
        echo __(' % SLA');
        echo "</th>";
    }
    echo "<th>";
    echo __('Ticket');
    echo "</th>";
    echo "<th>";
    echo __('Group') . "<br><i>" . __('Company') . "</i>";
    echo "</th>";
    echo "<th>";
    echo __('Status') . "<br><i>" . __('Resolution') . "</i>";
    echo "</th>";
    echo "<th>";
    echo __('Priority') . $priority_order_image;
    echo "</th>";
    echo "<th style='width: 70px;'>";
    echo __('Updated') . "<br><i>" . __('Started') . "</i>";
    echo "</th>";
    if ($config["show_creator_incident"] == 1) {
        echo "<th>";
    }
    echo __('Creator');
    echo "</th>";
    if ($config["show_owner_incident"] == 1) {
        echo "<th>";
    }
    echo __('Owner');
    echo "</th>";
    echo "</tr>";
    echo '</thead>';
    echo "<tbody>";
    if ($incidents == false) {
        echo '<tr><td colspan="11">' . __('Nothing was found') . '</td></tr>';
    } else {
        foreach ($incidents as $incident) {
            /* We print the rows directly, because it will be used in a sortable
               jQuery table and it only needs the rows */
            if ($incident["estado"] < 3) {
                $tr_status = 'class="red_row"';
            } elseif ($incident["estado"] < 6) {
                $tr_status = 'class="yellow_row"';
            } else {
                $tr_status = 'class="green_row"';
            }
            echo '<tr ' . $tr_status . ' id="incident-' . $incident['id_incidencia'] . '"';
            echo " style='border-bottom: 1px solid #ccc;' >";
            echo '<td>';
            print_checkbox_extended('incidentcb-' . $incident['id_incidencia'], $incident['id_incidencia'], false, '', '', 'class="cb_incident"');
            echo '</td>';
            //Print incident link if not ajax, if ajax link to js funtion to replace parent
            $link = "index.php?sec=incidents&sec2=operation/incidents/incident_dashboard_detail&id=" . $incident["id_incidencia"];
            if ($ajax) {
                $link = "javascript:update_parent('" . $incident["id_incidencia"] . "')";
            }
            echo '<td>';
            if (!$report_mode) {
                echo '<strong><a href="' . $link . '">#' . $incident['id_incidencia'] . '</a></strong></td>';
            } else {
                echo '<strong>' . '#' . $incident['id_incidencia'] . '</strong></td>';
            }
            // SLA Fired ??
            if ($incident["affected_sla_id"] != 0) {
                echo '<td width="25"><img src="images/exclamation.png" /></td>';
            } else {
                echo '<td></td>';
            }
            // % SLA
            if ($report_mode) {
                echo "<td>";
                if ($incident["affected_sla_id"] != 0) {
                    echo format_numeric(get_sla_compliance_single_id($incident['id_incidencia']));
                } else {
                    echo "";
                }
                echo "</td>";
            }
            echo '<td>';
            if (!$report_mode) {
                echo '<strong><a href="' . $link . '">' . $incident['titulo'] . '</a></strong><br>';
            } else {
                echo '<strong>' . $incident['titulo'] . '</strong><br>';
            }
            echo "<span style='font-size:11px;font-style:italic'>";
            echo incidents_get_incident_type_text($incident["id_incidencia"]);
            // Added by slerena 26Ago2013
            $sql = sprintf("SELECT *\n\t\t\t\t\t\t\tFROM tincident_type_field\n\t\t\t\t\t\t\tWHERE id_incident_type = %d", $incident["id_incident_type"]);
            $config['mysql_result_type'] = MYSQL_ASSOC;
            $type_fields = get_db_all_rows_sql($sql);
            $type_fields_values_text = "";
            if ($type_fields) {
                foreach ($type_fields as $type_field) {
                    if ($type_field["show_in_list"]) {
                        $field_data = get_db_value_filter("data", "tincident_field_data", array("id_incident" => $incident["id_incidencia"], "id_incident_field" => $type_field["id"]));
                        if ($field_data) {
                            if ($type_field["type"] == "textarea") {
                                $field_data = "<div style='display: inline-block;' title='{$field_data}'>" . substr($field_data, 0, 15) . "...</div>";
                            }
                            $type_fields_values_text .= " <div title='" . $type_field["label"] . "' style='display: inline-block;'>[{$field_data}]</div>";
                        }
                    }
                }
            }
            echo "&nbsp;{$type_fields_values_text}";
            echo '</span></td>';
            echo '<td>' . get_db_value("nombre", "tgrupo", "id_grupo", $incident['id_grupo']);
            if ($config["show_creator_incident"] == 1) {
                $id_creator_company = get_db_value("id_company", "tusuario", "id_usuario", $incident["id_creator"]);
                if ($id_creator_company != 0) {
                    $company_name = (string) get_db_value('name', 'tcompany', 'id', $id_creator_company);
                    echo "<br><span style='font-size:11px;font-style:italic'>{$company_name}</span>";
                }
            }
            echo '</td>';
            $resolution = isset($resolutions[$incident['resolution']]) ? $resolutions[$incident['resolution']] : __('None');
            echo '<td class="f9"><strong>' . $statuses[$incident['estado']] . '</strong><br /><em>' . $resolution . '</em></td>';
            // priority
            echo '<td>';
            print_priority_flag_image($incident['prioridad']);
            $last_wu = get_incident_lastworkunit($incident["id_incidencia"]);
            if ($last_wu["id_user"] == $incident["id_creator"]) {
                echo "<br><img src='images/comment.gif' title='" . $last_wu["id_user"] . "'>";
            }
            echo '</td>';
            echo '<td style="font-size:11px;">' . human_time_comparation($incident["actualizacion"]);
            // Show only if it's different
            if ($incident["inicio"] != $incident["actualizacion"]) {
                echo "<br><em>[" . human_time_comparation($incident["inicio"]);
                echo "]</em>";
            }
            echo "<br>";
            echo '<span style="font-size:9px;">';
            if (isset($config["show_user_name"]) && $config["show_user_name"]) {
                $updated_by = get_db_value('nombre_real', 'tusuario', 'id_usuario', $last_wu["id_user"]);
            } else {
                $updated_by = $last_wu["id_user"];
            }
            echo $updated_by;
            echo "</span>";
            echo '</td>';
            if ($config["show_creator_incident"] == 1) {
                echo "<td class='f9'>";
                if (isset($config["show_user_name"]) && $config["show_user_name"]) {
                    $incident_creator = get_db_value('nombre_real', 'tusuario', 'id_usuario', $incident["id_creator"]);
                } else {
                    $incident_creator = $incident["id_creator"];
                }
                //~ echo substr($incident_creator,0,12);
                echo $incident_creator;
                echo "</td>";
            }
            if ($config["show_owner_incident"] == 1) {
                echo "<td class='f9'>";
                if (isset($config["show_user_name"]) && $config["show_user_name"]) {
                    $incident_owner = get_db_value('nombre_real', 'tusuario', 'id_usuario', $incident["id_usuario"]);
                } else {
                    $incident_owner = $incident["id_usuario"];
                }
                echo $incident_owner;
                echo "</td>";
            }
            echo '</tr>';
        }
    }
    echo "</tbody>";
    echo "</table>";
    if (!$report_mode) {
        pagination($count, $url, $offset, false, $aux_text);
    }
    if ($print_result_count) {
        echo "<h5>" . $count . __(" ticket(s) found") . "</h5>";
    }
    echo "<br>";
}
/* Users affected by the incident */
$table->width = '100%';
$table->class = "none";
$table->size = array();
$table->size[0] = '50%';
$table->size[1] = '50%';
$table->style = array();
$table->data = array();
$table->cellspacing = 0;
$table->cellpadding = 0;
$table->style[0] = "vertical-align: top";
$table->style[1] = "vertical-align: top";
$resolution = incidents_get_incident_resolution_text($id);
$priority = incidents_get_incident_priority_text($id);
$priority_image = print_priority_flag_image($incident['prioridad'], true);
$group = incidents_get_incident_group_text($id);
$status = incidents_get_incident_status_text($id);
$type = incidents_get_incident_type_text($id);
// Get the status color and icon
if ($incident['estado'] < 3) {
    $status_color = STATUS_COLOR_NEW;
    $status_icon = 'status_new';
} else {
    if ($incident['estado'] < 7) {
        $status_color = STATUS_COLOR_PENDING;
        $status_icon = 'status_pending';
    } else {
        $status_color = STATUS_COLOR_CLOSED;
        $status_icon = 'status_closed';
    }
}
Beispiel #3
0
 private function getIncidentDetail()
 {
     $system = System::getInstance();
     $ui = Ui::getInstance();
     $incident = get_db_row("tincidencia", "id_incidencia", $this->id_incident);
     if (!$incident) {
         $html = "<h2 class=\"error\">" . __('Ticket not found') . "</h2>";
     } else {
         include_once $system->getConfig('homedir') . "/include/functions_incidents.php";
         // DETAILS
         $resolution = incidents_get_incident_resolution_text($incident['id_incidencia']);
         $priority = incidents_get_incident_priority_text($incident['id_incidencia']);
         $priority_image = print_priority_flag_image($incident['prioridad'], true, "../");
         $group = incidents_get_incident_group_text($incident['id_incidencia']);
         $status = incidents_get_incident_status_text($incident['id_incidencia']);
         $type = incidents_get_incident_type_text($incident['id_incidencia']);
         // Get the status icon
         if ($incident['estado'] < 3) {
             $status_icon = 'status_new';
         } else {
             if ($incident['estado'] < 7) {
                 $status_icon = 'status_pending';
             } else {
                 $status_icon = 'status_closed';
             }
         }
         $ui->contentBeginGrid();
         // $options = array(
         // 	'action' => "index.php?page=incidents",
         // 	'method' => 'POST',
         // 	'data-ajax' => 'false'
         // 	);
         // $ui->beginForm($options);
         // 	// Filter status
         // 	$values = array();
         // 	$values[0] = __('Any');
         // 	$values[-10] = __('Not closed');
         // 	$status_table = process_sql ("select * from tincident_status");
         // 	foreach ($status_table as $status) {
         // 		$values[$status['id']] = __($status['name']);
         // 	}
         // 	$options = array(
         // 		'name' => 'filter_status',
         // 		'title' => __('Status'),
         // 		'items' => $values,
         // 		'selected' => $this->filter_status
         // 		);
         // 	$ui->formAddSelectBox($options);
         // $form_html = $ui->getEndForm();
         $status_cell = "<div class='detail-element'>\n\t\t\t\t\t\t\t\t" . __('Status') . "<br>\n\t\t\t\t\t\t\t\t<img src='../images/{$status_icon}.png'><br>\n\t\t\t\t\t\t\t\t<strong>{$status}</strong>\n\t\t\t\t\t\t\t</div>";
         $ui->contentGridAddCell($status_cell);
         $group_cell = "<div class='detail-element'>\n\t\t\t\t\t\t\t\t" . __('Group') . "<br>\n\t\t\t\t\t\t\t\t<img src='../images/group.png'><br>\n\t\t\t\t\t\t\t\t<strong>{$group}</strong>\n\t\t\t\t\t\t\t</div>";
         $ui->contentGridAddCell($group_cell);
         $priority_cell = "<div class='detail-element'>\n\t\t\t\t\t\t\t\t" . __('Priority') . "<br>\n\t\t\t\t\t\t\t\t{$priority_image}<br>\n\t\t\t\t\t\t\t\t<strong>{$priority}</strong>\n\t\t\t\t\t\t\t</div>";
         $ui->contentGridAddCell($priority_cell);
         $resolution_cell = "<div class='detail-element'>\n\t\t\t\t\t\t\t\t" . __('Resolution') . "<br>\n\t\t\t\t\t\t\t\t<img src='../images/resolution.png'><br>\n\t\t\t\t\t\t\t\t<strong>{$resolution}</strong>\n\t\t\t\t\t\t\t</div>";
         $ui->contentGridAddCell($resolution_cell);
         $type_cell = "<div class='detail-element'>\n\t\t\t\t\t\t\t\t" . __('Type') . "<br>\n\t\t\t\t\t\t\t\t<img src='../images/incident.png'><br>\n\t\t\t\t\t\t\t\t<strong>{$type}</strong>\n\t\t\t\t\t\t\t</div>";
         $ui->contentGridAddCell($type_cell);
         $detail_grid = $ui->getContentEndGrid();
         $ui->contentBeginCollapsible(__('Details'));
         $ui->contentCollapsibleAddItem($detail_grid);
         $detail = $ui->getEndCollapsible("", "b", "c", false);
         $detail = "<div style='padding-left: 2px; padding-right: 2px;'>{$detail}</div>";
         // DESCRIPTION
         if ($incident['descripcion'] != "") {
             $ui->contentBeginCollapsible(__('Description'));
             $ui->contentCollapsibleAddItem($incident['descripcion']);
             $description = $ui->getEndCollapsible("", "b", "c", false);
         }
         // CUSTOM FIELDS
         if ($incident['id_incident_type']) {
             $type_name = get_db_value("name", "tincident_type", "id", $incident['id_incident_type']);
             $fields = incidents_get_all_type_field($incident['id_incident_type'], $incident['id_incidencia']);
             $custom_fields = "";
             $ui->contentBeginCollapsible($type_name);
             foreach ($fields as $field) {
                 $custom_fields = $field["label"] . ":&nbsp;<strong>" . $field["data"] . "</strong>";
                 $ui->contentCollapsibleAddItem($custom_fields);
             }
             $custom_fields = $ui->getEndCollapsible("", "b", "c", false);
         }
         // PEOPLE
         $ui->contentBeginGrid();
         $name_creator = get_db_value_filter("nombre_real", "tusuario", array("id_usuario" => $incident['id_creator']));
         $avatar_creator = get_db_value_filter("avatar", "tusuario", array("id_usuario" => $incident['id_creator']));
         $creator_cell = "<div style='text-align: center;'>\n\t\t\t\t\t\t\t\t\t\t<div class='bubble_little'>\n\t\t\t\t\t\t\t\t\t\t\t<img src='../images/avatars/{$avatar_creator}.png'>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<strong style='color: #FF9933'>" . __('Created by') . ":</strong><br>\n\t\t\t\t\t\t\t\t\t{$name_creator}\n\t\t\t\t\t\t\t\t</div>";
         $ui->contentGridAddCell($creator_cell);
         $name_owner = get_db_value_filter("nombre_real", "tusuario", array("id_usuario" => $incident['id_usuario']));
         $avatar_owner = get_db_value_filter("avatar", "tusuario", array("id_usuario" => $incident['id_usuario']));
         $owner_cell = "<div style='text-align: center;'>\n\t\t\t\t\t\t\t\t\t\t<div class='bubble_little'>\n\t\t\t\t\t\t\t\t\t\t\t<img src='../images/avatars/{$avatar_owner}.png'>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<strong style='color: #FF9933'>" . __('Owned by') . ":</strong><br>\n\t\t\t\t\t\t\t\t\t{$name_owner}\n\t\t\t\t\t\t\t\t</div>";
         $ui->contentGridAddCell($owner_cell);
         if ($incident['estado'] == STATUS_CLOSED) {
             if (empty($incident["closed_by"])) {
                 $name_closer = __('Unknown');
                 $avatar_closer = '../avatar_unknown';
             } else {
                 $name_closer = get_db_value_filter("nombre_real", "tusuario", array("id_usuario" => $incident['closed_by']));
                 $avatar_closer = get_db_value_filter("avatar", "tusuario", array("id_usuario" => $incident['closed_by']));
             }
             $closer_cell = "<div style='text-align: center;'>\n\t\t\t\t\t\t\t\t\t\t<div class='bubble_little'>\n\t\t\t\t\t\t\t\t\t\t\t<img src='../images/avatars/{$avatar_closer}.png'>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t<strong style='color: #FF9933'>" . __('Closed by') . ":</strong><br>\n\t\t\t\t\t\t\t\t\t\t{$name_creator}\n\t\t\t\t\t\t\t\t\t</div>";
             $ui->contentGridAddCell($closer_cell);
         }
         $people_grid = $ui->getContentEndGrid();
         $ui->contentBeginCollapsible(__('People'));
         $ui->contentCollapsibleAddItem($people_grid);
         $people = $ui->getEndCollapsible("", "b", "c");
         // DATES
         $ui->contentBeginGrid();
         $created_timestamp = strtotime($incident['inicio']);
         $created_cell .= "<table width='97%' style='text-align: center;' id='incidents_dates_square'>";
         $created_cell .= "<tr>";
         $created_cell .= "<td>" . __('Created on') . ":</td>";
         $created_cell .= "</tr>";
         $created_cell .= "<tr>";
         $created_cell .= "<td id='created_on' class='mini_calendar'>";
         $created_cell .= "<table>";
         $created_cell .= "<tr>";
         $created_cell .= "<th>" . strtoupper(date('M\' y', $created_timestamp)) . "</th>";
         $created_cell .= "</tr>";
         $created_cell .= "<tr>";
         $created_cell .= "<td class='day'>" . date('d', $created_timestamp) . "</td>";
         $created_cell .= "</tr>";
         $created_cell .= "<tr>";
         $created_cell .= "<td class='time'><img src='../images/cal_clock_grey.png'>&nbsp;" . date('H:i:s', $created_timestamp) . "</td>";
         $created_cell .= "</tr>";
         $created_cell .= "</table>";
         $created_cell .= "</td>";
         $created_cell .= "</tr>";
         $created_cell .= "</table>";
         $ui->contentGridAddCell($created_cell);
         $updated_timestamp = strtotime($incident['actualizacion']);
         $updated_cell .= "<table width='97%' style='text-align: center;' id='incidents_dates_square'>";
         $updated_cell .= "<tr>";
         $updated_cell .= "<td>" . __('Updated on') . ":</td>";
         $updated_cell .= "</tr>";
         $updated_cell .= "<tr>";
         $updated_cell .= "<td id='updated_on' class='mini_calendar'>";
         $updated_cell .= "<table>";
         $updated_cell .= "<tr>";
         $updated_cell .= "<th>" . strtoupper(date('M\' y', $updated_timestamp)) . "</th>";
         $updated_cell .= "</tr>";
         $updated_cell .= "<tr>";
         $updated_cell .= "<td class='day'>" . date('d', $updated_timestamp) . "</td>";
         $updated_cell .= "</tr>";
         $updated_cell .= "<tr>";
         $updated_cell .= "<td class='time'><img src='../images/cal_clock_orange.png'>&nbsp;" . date('H:i:s', $updated_timestamp) . "</td>";
         $updated_cell .= "</tr>";
         $updated_cell .= "</table>";
         $updated_cell .= "</td>";
         $updated_cell .= "</tr>";
         $updated_cell .= "</table>";
         $ui->contentGridAddCell($updated_cell);
         if ($incident["estado"] == STATUS_CLOSED) {
             $closed_timestamp = strtotime($incident['cierre']);
             $closed_cell .= "<table width='97%' style='text-align: center;' id='incidents_dates_square'>";
             $closed_cell .= "<tr>";
             $closed_cell .= "<td>" . __('Closed on') . ":</td>";
             $closed_cell .= "</tr>";
             $closed_cell .= "<tr>";
             $closed_cell .= "<td id='closed_on' class='mini_calendar'>";
             $closed_cell .= "<table>";
             $closed_cell .= "<tr>";
             $closed_cell .= "<th>" . strtoupper(date('M\' y', $closed_timestamp)) . "</th>";
             $closed_cell .= "</tr>";
             $closed_cell .= "<tr>";
             $closed_cell .= "<td class='day'>" . date('d', $closed_timestamp) . "</td>";
             $closed_cell .= "</tr>";
             $closed_cell .= "<tr>";
             $closed_cell .= "<td class='time'><img src='../images/cal_clock_darkgrey.png'>&nbsp;" . date('H:i:s', $closed_timestamp) . "</td>";
             $closed_cell .= "</tr>";
             $closed_cell .= "</table>";
             $closed_cell .= "</td>";
             $closed_cell .= "</tr>";
             $closed_cell .= "</table>";
             $ui->contentGridAddCell($closed_cell);
         }
         $dates_grid = $ui->getContentEndGrid();
         $ui->contentBeginCollapsible(__('Dates'));
         $ui->contentCollapsibleAddItem($dates_grid);
         $dates = $ui->getEndCollapsible("", "b", "c");
         if ($system->getConfig('enabled_ticket_editor')) {
             $ui->contentBeginCollapsible(__('Quick edit'));
             $ui->contentCollapsibleAddItem($this->getIncidentQuickForm($incident));
             $quick_edit = $ui->getEndCollapsible("", "b", "c");
         } else {
             $quick_edit = "";
         }
         $html = "<h1 class='title'>" . $incident['titulo'] . "</h1>";
         $html .= $detail;
         if (!$description || !$custom_fields) {
             if ($description) {
                 $html .= $description;
             }
             if ($custom_fields) {
                 $html .= $custom_fields;
             }
         } else {
             $ui->contentBeginGrid();
             $ui->contentGridAddCell($description);
             $ui->contentGridAddCell($custom_fields);
             $html .= $ui->getContentEndGrid();
         }
         $ui->contentBeginGrid();
         $ui->contentGridAddCell($people);
         $ui->contentGridAddCell($dates);
         $html .= $ui->getContentEndGrid();
         $html .= $quick_edit;
     }
     return $html;
 }