function calendar_get_events_agenda($start, $end, $pn = array(), $id_user = "", $show_projects = 1, $show_tasks = 1, $show_events = 1, $show_wo = 1, $show_clients = 1)
{
    global $config;
    $cal_events = array();
    $day_in_seconds = 24 * 3600;
    //Calculate mysql dates
    $mysql_start = date('Y-m-d', $start);
    $mysql_end = date('Y-m-d', $end);
    //Get project information
    if ($show_projects) {
        $agenda_project = calendar_get_project_date_range($mysql_start, $mysql_end);
        foreach ($agenda_project as $agenda_pitem) {
            list($pname, $idp, $pend, $owner, $pstart) = explode("|", $agenda_pitem);
            $url = "index.php?sec=projects&sec2=operation/projects/project_detail&id_project=" . $idp;
            array_push($cal_events, array("name" => $pname, "start" => strtotime($pstart), "end" => strtotime($pend), "bgColor" => "#E46554", "allDay" => true, "url" => $url));
        }
    }
    //Get tasks information
    if ($show_tasks) {
        $agenda_task = calendar_get_task_date_range($mysql_start, $mysql_end);
        foreach ($agenda_task as $agenda_titem) {
            list($tname, $idt, $tend, $pname, $idp, $tstart) = explode("|", $agenda_titem);
            $url = "index.php?sec=projects&sec2=operation/projects/task_detail&id_task=" . $idt . "&operation=view";
            array_push($cal_events, array("name" => $tname, "start" => strtotime($tstart), "end" => strtotime($tend), "bgColor" => "#80D580", "allDay" => true, "url" => $url));
        }
    }
    if ($show_wo) {
        $agenda_wo = calendar_get_wo_date_range($mysql_start, $mysql_end, $config["id_user"]);
        foreach ($agenda_wo as $agenda_woitem) {
            list($idwo, $woname, $woowner, $wocreator, $wopriority, $woend, $wostart) = explode("|", $agenda_woitem);
            $url = "index.php?sec=projects&sec2=operation/workorders/wo&operation=view&id=" . $idwo;
            $wopriority_img = print_priority_flag_image($wopriority, true);
            array_push($cal_events, array("name" => $woname, "start" => strtotime($wostart), "end" => strtotime($woend), "bgColor" => "#6A6D6D", "allDay" => true, "url" => $url));
        }
    }
    if ($show_events) {
        for ($i = $start; $i <= $end; $i = $i + $day_in_seconds) {
            $mysql_date = date('Y-m-d', $i);
            // Search for agenda item for this date
            $sqlquery = "SELECT * FROM tagenda WHERE timestamp LIKE '{$mysql_date}%' ORDER BY timestamp ASC";
            $res = mysql_query($sqlquery);
            while ($row = mysql_fetch_array($res)) {
                $event_public = $row["public"];
                $event_user = $row["id_user"];
                if (agenda_get_entry_permission($id_user, $row["id"])) {
                    $dur_sec = $row["duration"] * 3600;
                    //Duration in seconds
                    $start_timestamp = strtotime($row["timestamp"]);
                    $start_timestamp = $start_timestamp + $dur_sec;
                    $end_date = $start_timestamp;
                    $url_date = date("Y-m-d", $start_timestamp);
                    $url = "javascript: show_agenda_entry(" . $row["id"] . ", '" . $url_date . "', '0', true)";
                    array_push($cal_events, array("name" => $row["title"], "start" => strtotime($row["timestamp"]), "end" => $end_date, "bgColor" => "#8EC8DF", "allDay" => false, "url" => $url));
                }
            }
        }
    }
    if ($show_clients and !$show_events) {
        for ($i = $start; $i <= $end; $i = $i + $day_in_seconds) {
            $mysql_date = date('Y-m-d', $i);
            // Search for agenda item for this date
            $sqlquery = "SELECT tagenda.* FROM tagenda, tinvoice WHERE tagenda.title like CONCAT('%',(tinvoice.bill_id),'%') and tagenda.timestamp LIKE '{$mysql_date}%' ORDER BY tagenda.timestamp ASC";
            $res = mysql_query($sqlquery);
            while ($row = mysql_fetch_array($res)) {
                $event_public = $row["public"];
                $event_user = $row["id_user"];
                if (agenda_get_entry_permission($id_user, $row["id"])) {
                    $dur_sec = $row["duration"] * 3600;
                    //Duration in seconds
                    $start_timestamp = strtotime($row["timestamp"]);
                    $start_timestamp = $start_timestamp + $dur_sec;
                    $end_date = $start_timestamp;
                    $url_date = date("Y-m-d", $start_timestamp);
                    $url = "javascript: show_agenda_entry(" . $row["id"] . ", '" . $url_date . "', '0', true)";
                    array_push($cal_events, array("name" => $row["title"], "start" => strtotime($row["timestamp"]), "end" => $end_date, "bgColor" => "#8EC8DF", "allDay" => false, "url" => $url));
                }
            }
        }
    }
    return $cal_events;
}
}
/* 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';
    }
示例#3
0
if ($disabled_itype || $blocked_incident) {
    $disabled_itype = true;
}
if ($config['required_ticket_type']) {
    $select = '';
} else {
    $select = 'select';
}
$table->data[0][2] .= print_select($types, 'id_incident_type', $id_incident_type, '', $select, '', true, 0, true, false, $disabled_itype);
$disabled = false;
if ($disabled) {
    $table->data[1][0] = print_label(__('Priority'), '', '', true, $priority);
} else {
    $table->data[1][0] = print_select(get_priorities(), 'priority_form', $priority, '', '', '', true, false, false, __('Priority'), $blocked_incident);
}
$table->data[1][0] .= '&nbsp;' . print_priority_flag_image($priority, true);
if (!$create_incident) {
    if ($incident["estado"] != STATUS_CLOSED) {
        $table->data[1][1] = "<div id='div_incident_resolution' style='display: none;'>";
    } else {
        $table->data[1][1] = "<div id='div_incident_resolution'>";
    }
    if ($has_im) {
        $table->data[1][1] .= combo_incident_resolution($resolution, $blocked_incident, true);
    } else {
        $table->data[1][1] .= print_label(__('Resolution'), '', '', true, render_resolution($resolution));
        $table->data[1][1] .= print_input_hidden('incident_resolution', $resolution, true);
    }
    $table->data[1][1] .= "</div>";
}
$table->data[1][2] = combo_incident_status($estado, $blocked_incident, 0, true, false, '', '', 0);
示例#4
0
    $filter .= sprintf(' AND (titulo LIKE "%%%s%%" OR descripcion LIKE "%%%s%%")', $search, $search);
}
$filter .= ' ORDER BY actualizacion DESC';
$incidents = get_incidents($filter);
if (empty($incidents)) {
    $table->colspan[0][0] = 9;
    $table->data[0][0] = __('Nothing was found');
    $incidents = array();
}
$row = 0;
foreach ($incidents as $incident) {
    $table->data[$row][0] = '#' . $incident['id_incidencia'];
    $table->data[$row][1] = '<a href="index.php?sec=incidents&sec2=operation/incidents_simple/incident&id=' . $incident['id_incidencia'] . '">' . $incident['titulo'] . '</a>';
    $resolution = isset($resolutions[$incident['resolution']]) ? $resolutions[$incident['resolution']] : __('None');
    $table->data[$row][2] = '<strong>' . $statuses[$incident['estado']] . '</strong><br /><em>' . $resolution . '</em>';
    $table->data[$row][3] = print_priority_flag_image($incident['prioridad'], true);
    $table->data[$row][4] = human_time_comparation($incident["actualizacion"]);
    $table->data[$row][4] .= '<br /><em>';
    $table->data[$row][4] .= human_time_comparation($incident["inicio"]);
    $table->data[$row][4] .= '</em>';
    if ($config["show_owner_incident"] == 1) {
        $table->data[$row][5] = $incident['id_usuario'];
    }
    if ($incident["estado"] < 3) {
        $table->rowclass[$row] = 'red';
    } elseif ($incident["estado"] < 6) {
        $table->rowclass[$row] = 'yellow';
    } else {
        $table->rowclass[$row] = 'green';
    }
    $table->rowstyle[$row] = 'border-bottom: 1px solid rgb(204, 204, 204);';
	$table->head[3] = __("Priority");
	$table->head[4] = __("Updated");
	$table->data = array();

	foreach ($incidents as $inc) {
		$data = array();

		if (give_acl($config["id_user"], 0, "IR")) {
			$link_start = '<a href="index.php?sec=incidents&sec2=operation/incidents/incident_dashboard_detail&id='.$inc["id_incidencia"].'">';
			$link_end = '</a>';
		} else {
			$link_start = "";
			$link_end = "";
		}

		$data[0] = $link_start."#".$inc["id_incidencia"].$link_end;
		$data[1] = $link_start.$inc["titulo"].$link_end;
	
		$status = get_db_value("name", "tincident_status", "id", $inc["estado"]);

		$data[2] = $status;
		$data[3] = print_priority_flag_image ($inc['prioridad'], true);
		$data[4] = human_time_comparation ($inc["actualizacion"]); 
	
		array_push($table->data, $data);
	}

	print_table($table);
}
?>
示例#6
0
	public function getIncidentsList ($href = "", $ajax = false) {
		$system = System::getInstance();
		$ui = Ui::getInstance();

		if ($href == "") {
			$href = "index.php?page=incident";
		}

		$html = "";
		
		if (! $ajax) {
			$html .= "<ul id='listview' class='ui-itemlistview' data-role='listview'>";
		}
		if ($this->getCountIncidents() > 0) {
			$sql = $this->getIncidentsQuery();
			$new = true;
			while ( $incident = get_db_all_row_by_steps_sql($new, $result_query, $sql) ) {
				$new = false;
				// Background color
				if ($incident["estado"] < 3) {
					$background_color = "light-red-background";
				} elseif ($incident["estado"] < 7) {
					$background_color = "light-yellow-background";
				} elseif ($incident["estado"] == 7) {
					$background_color = "light-green-background";
				} else {
					$background_color = "";
				}
				$html .= "<li class=\"$background_color\">";
				$html .= "<a href='$href&id_incident=".$incident['id_incidencia']."' class='ui-link-inherit' data-ajax='false'>";
					//$html .= $ui->getPriorityFlagImage($incident['prioridad']);
					$html .= print_priority_flag_image ($incident['prioridad'], true, "../", "priority-list ui-li-icon");
					$html .= "<h3 class='ui-li-heading'>#".$incident['id_incidencia'];
					$html .= "&nbsp;&nbsp;-&nbsp;&nbsp;".$incident['titulo']."</h3>";
					$html .= "<p class='ui-li-desc'>".__('Owner').": ".$incident['id_usuario'];
					if ( include_once ($system->getConfig('homedir')."/include/functions_calendar.php") ) {
						$html .= "&nbsp;&nbsp;-&nbsp;&nbsp;".human_time_comparation($incident["actualizacion"])."&nbsp;".__('since the last update')."</p>";
					} else {
						$html .= "&nbsp;&nbsp;-&nbsp;&nbsp;".__('Last update').": ".$incident['actualizacion']."</p>";
					}
				$html .= "</a>";
				
				//~ $options = array(
					//~ 'popup_id' => 'delete_popup_'.$incident['id_incidencia'],
					//~ 'delete_href' => 'index.php?page=incidents&operation=delete&id_incident='.$incident['id_incidencia']
					//~ );
				//~ $html .= $ui->getDeletePopupHTML($options);
				//~ $html .= "<a data-icon=\"delete\" data-rel=\"popup\" href=\"#delete_popup_".$incident['id_incidencia']."\"></a>";
				$html .= "</li>";
			}
		} else {
			$html .= "<li>";
			$html .= "<h3 class='error'>".__('There is no tickets')."</h3>";
			$html .= "</li>";
		}
		if (! $ajax) {
			$html .= "</ul>";
		} else {
			ob_clean();
		}
		
		return $html;
	}
示例#7
0
			$data[0] = "<a href='index.php?sec=projects&sec2=operation/workorders/wo&operation=view&id=".
				$wo['id']."'>#<b>".$wo["id"]."</b></a>";

			$data[2] = "<a href='index.php?sec=projects&sec2=operation/workorders/wo&operation=view&id=".
				$wo['id']."'>".short_string ($wo['name'],45)."</a>";

			if ($wo["id_task"] != 0){

				$id_project = get_db_value ("id_project", "ttask", "id", $wo["id_task"]);
				$project_title = short_string (get_db_value ("name", "tproject", "id", $id_project), 35);
				$task_title = short_string (get_db_value ("name", "ttask", "id", $wo["id_task"]), 35);
				$buffer = "<br><span style='font-size: 9px'>" . $project_title . " / " . $task_title . "</span>";
				$data[2] .= $buffer;
			}

			$data[3] = print_priority_flag_image ($wo["priority"], true);
			
			$data[4] = translate_wo_status($wo["progress"]);
			
			if ($wo["assigned_user"] == $config["id_user"]) {
				$data[5] = '<a href="index.php?sec=projects&sec2=operation/workorders/wo&owner='.$wo["assigned_user"].'">'.__("Me").'</a>';
			}
			else {
				$data[5] = '<a href="index.php?sec=projects&sec2=operation/workorders/wo&owner='.$wo["assigned_user"].'">'.$wo["assigned_user"].'</a>';
			}
			
			if ($wo["assigned_user"] != $wo["created_by_user"]) {
				if ($wo["created_by_user"] == $config["id_user"]) {
					$data[6] = '<a href="index.php?sec=projects&sec2=operation/workorders/wo&creator='.$wo["created_by_user"].'">'.__("Me").'</a>';
				} else {
					$data[6] = '<a href="index.php?sec=projects&sec2=operation/workorders/wo&creator='.$wo["created_by_user"].'">'.$wo["created_by_user"].'</a>';
function incidents_search_result_group_by_project($filter, $ajax = false, $return_incidents = false, $print_result_count = false)
{
    global $config;
    // ----------------------------------------
    // 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');
    echo "</th>";
    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');
    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>";
    $tasks_in_tickets = incidents_get_filter_tickets_tree($filter, 'tasks');
    if ($tasks_in_tickets === false) {
        $tasks_in_tickets = array();
    }
    $i = 0;
    $tickets_str = '';
    $add_no_project = false;
    foreach ($tasks_in_tickets as $task_ticket) {
        if ($i == 0) {
            $tickets_str = $task_ticket['id_task'];
        } else {
            $tickets_str .= ',' . $task_ticket['id_task'];
        }
        if ($task_ticket['id_task'] == 0) {
            $add_no_project = true;
        }
        $i++;
    }
    if (!empty($tasks_in_tickets)) {
        $sql = "SELECT t1.name as n_task, t2.name as n_project, t1.id as id_task FROM ttask t1, tproject t2\n\t\t\tWHERE t1.id_project=t2.id AND t1.id IN ({$tickets_str})\n\t\t\tORDER BY t2.name";
        $tickets = get_db_all_rows_sql($sql);
    } else {
        $tickets = false;
    }
    if ($tickets === false) {
        $tickets = array();
    }
    if ($add_no_project) {
        $tickets[$i]['id_task'] = 0;
        $tickets[$i]['n_project'] = __('No associated project');
    }
    foreach ($tickets as $task_ticket) {
        $task = get_db_row('ttask', 'id', $task_ticket['id_task']);
        $img = print_image("images/input_create.png", true, array("style" => 'vertical-align: middle;', "id" => $img_id));
        $img_task = print_image("images/task.png", true, array("style" => 'vertical-align: middle;'));
        //tickets in task
        $filter['id_task'] = $task_ticket['id_task'];
        $tickets_in_task = incidents_get_filter_tickets_tree($filter, 'tickets');
        $count_tickets = count($tickets_in_task);
        //print ticket with task
        if ($task_ticket['id_task'] != 0) {
            $project_name = $task_ticket['n_project'] . ' - ' . $task_ticket['n_task'];
        } else {
            $project_name = $task_ticket['n_project'];
        }
        //print project-task
        echo '<tr><td colspan="10" valign="top">';
        echo "\n\t\t<a onfocus='JavaScript: this.blur()' href='javascript: check_rows(\"" . $task_ticket['id_task'] . "\")'>" . $img . "&nbsp;" . $img_task . "&nbsp;" . safe_output($project_name) . "&nbsp;" . "({$count_tickets})" . "</a>" . "&nbsp;&nbsp;";
        echo '</td></tr>';
        foreach ($tickets_in_task as $incident) {
            $class = $task_ticket['id_task'] . "-task";
            $tr_status = 'class="' . $class . '"';
            if ($incident["estado"] < 3) {
                $tr_status = 'class="red_row ' . $class . '"';
            } elseif ($incident["estado"] < 6) {
                $tr_status = 'class="yellow_row ' . $class . '"';
            } else {
                $tr_status = 'class="green_row ' . $class . '"';
            }
            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>';
            echo '<strong><a href="' . $link . '">#' . $incident['id_incidencia'] . '</a></strong></td>';
            // SLA Fired ??
            if ($incident["affected_sla_id"] != 0) {
                echo '<td width="25"><img src="images/exclamation.png" /></td>';
            } else {
                echo '<td></td>';
            }
            echo '<td>';
            echo '<strong><a href="' . $link . '">' . $incident['titulo'] . '</a></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 $last_wu["id_user"];
            echo $updated_by;
            echo "</span>";
            echo '</td>';
            if ($config["show_creator_incident"] == 1) {
                echo "<td class='f9'>";
                $incident_creator = $incident["id_creator"];
                echo substr($incident_creator, 0, 12);
                echo "</td>";
            }
            if ($config["show_owner_incident"] == 1) {
                echo "<td class='f9'>";
                $incident_owner = $incident["id_usuario"];
                echo substr($incident_owner, 0, 12);
                echo "</td>";
            }
            echo '</tr>';
        }
    }
    echo '</tbody>';
    echo '</table>';
}
    print_submit_button(__('Go'), 'sub_btn', false, 'class="upd sub"');
    echo "<td>";
    echo "</form></table>";
}
echo "<table  class='listing' width=99%>";
echo "<th>" . __('Pri');
echo "<th>" . __('Project');
echo "<th>" . __('Task');
echo "<th>" . __('Progress');
echo "<th>" . __('Worked hours');
echo "<th>" . __('Last update');
echo "<th>" . __('Operation');
$result = mysql_query($sql);
while ($row = mysql_fetch_array($result)) {
    echo "<tr>";
    echo "<td>" . print_priority_flag_image($row['priority'], true);
    echo "<td>" . $row[2];
    $id_proj = $row[4];
    $id_task = $row[5];
    echo "<td><a href='index.php?sec=projects&sec2=operation/projects/task_detail&id_project={$id_proj}&id_task={$id_task}&operation=view'>" . $row[1] . "</a>";
    echo "<td >";
    echo progress_bar($row[3], 70, 20);
    echo "<td align=center>" . get_task_workunit_hours_user($row[0], $id_user);
    echo "<td class='f9'>";
    $time1 = get_db_sql("SELECT timestamp\n\t\tFROM tworkunit_task, tworkunit\n\t\tWHERE tworkunit.id_user = '******'\n\t\tAND tworkunit_task.id_task = " . $row[0] . ' AND tworkunit.id = tworkunit_task.id_workunit
		ORDER BY timestamp DESC LIMIT 1');
    echo substr($time1, 0, 10);
    echo "<td>";
    if (give_acl($config["id_user"], 0, "PM")) {
        echo "<a href='index.php?sec=users&sec2=operation/users/user_task_assigment&op=fin&id_task={$id_task}&id_user={$id_user}'><img src='images/upd.png' title='" . __("Finish this task") . "'></a>";
        echo "&nbsp;&nbsp;";
示例#10
0
function show_task_row ($table, $id_project, $task, $level) {
	global $config;
	global $graph_ttl;
	
	$data = array ();

	// Task  name
	$data[0] = '';
	
	for ($i = 0; $i < $level; $i++)
		$data[0] .= '<img src="images/small_arrow_right_green.gif" style="position: relative; top: 5px;"> ';
		
	
	$data[0] .= '<a href="index.php?sec=projects&sec2=operation/projects/task_detail&id_project='. $id_project.'&id_task='.$task['id'].'&operation=view">'. $task['name'].'</a>';

	// Priority
    $data[1] = print_priority_flag_image ($task['priority'], true);
	
	// Completion
	
	$data[2] = progress_bar($task["completion"], 70, 20, $graph_ttl);
	
	// Estimation
	$imghelp = "Estimated hours = ".$task["hours"];
	$taskhours = get_task_workunit_hours ($task["id"]);

	$imghelp .= ", Worked hours = $taskhours";
	$a = round ($task["hours"]);
	$b = round ($taskhours);
	$mode = 2;

	if ($a > 0)
		$data[3] = histogram_2values($a, $b, __("Planned"), __("Real"), $mode, 60, 18, $imghelp, $graph_ttl);
	else
		$data[3] = '--';

	// Time used on all child tasks + this task
	$recursive_timeused = task_duration_recursive ($task["id"]);
	
	if ($taskhours == 0)
		$data[4] = "--";
	elseif ($taskhours == $recursive_timeused)
		$data[4] = $taskhours;
	else
		$data[4] = $taskhours . "<span title='Subtasks WU/HR'> (".$recursive_timeused. ")</span>";
		
	$wu_incidents = get_incident_task_workunit_hours ($task["id"]);
	
	
	if ($wu_incidents > 0)
	$data[4] .= "<span title='".__("Time spent in related tickets")."'> ($wu_incidents) </span>";

	// People
	$data[5] = combo_users_task ($task['id'], 1, true);
	$data[5] .= ' ';
	$data[5] .= get_db_value ('COUNT(DISTINCT(id_user))', 'trole_people_task', 'id_task', $task['id']);

	if ($task["start"] == $task["end"]){
		$data[6] = date ('Y-m-d', strtotime ($task['start'])) . "<br>";
		$data[6] .= __('Recurrence').': '.get_periodicity ($task['periodicity']);
	} else {
		// Start
		$start = strtotime ($task['start']);
		$end = strtotime ($task['end']);
		$now = time ();
		
		$data[6] = date ('Y-m-d', $start) ."<br>";
		
		if ($task['completion'] == 100) {
			$data[6] .= '<span style="color: green">';
		} else {
			if ($now > $end)
				$data[6] .= '<span style="color: red">';
			else
				$data[6] .= '<span>';
		}
		$data[6] .= date ('Y-m-d', $end);
		$data[6] .= '</span>';
	}

	array_push ($table->data, $data);
}
示例#11
0
 public function getWorkOrdersList($href = "", $delete_button = true, $delete_href = "", $ajax = false)
 {
     $system = System::getInstance();
     $ui = Ui::getInstance();
     if ($href == "") {
         $href = "index.php?page=workorder&operation=view";
     }
     if (!$ajax) {
         $html = "<ul id='listview' class='ui-itemlistview' data-role='listview'>";
     }
     if ($this->getCountWorkorders() > 0) {
         $sql = $this->getWorkOrdersQuery();
         $new = true;
         while ($workorder = get_db_all_row_by_steps_sql($new, $result_query, $sql)) {
             $new = false;
             $html .= "<li>";
             $html .= "<a href='{$href}&id_workorder=" . $workorder['id'] . "' class='ui-link-inherit' data-ajax='false'>";
             //$html .= $ui->getPriorityFlagImage($workorder['priority']);
             $html .= print_priority_flag_image($workorder['priority'], true, "../", "priority-list ui-li-icon");
             $html .= "<h3 class='ui-li-heading'>" . $workorder['name'] . "</h3>";
             $html .= "<p class='ui-li-desc'>" . __('Owner') . ": " . $workorder['assigned_user'];
             $html .= "&nbsp;&nbsp;-&nbsp;&nbsp;" . __('Creator') . ": " . $workorder['created_by_user'] . "</p>";
             $html .= "</a>";
             if ($delete_button) {
                 if ($delete_href == "") {
                     $delete_href = "index.php?page=workorders&operation=delete&filter_status=0&filter_owner=" . $system->getConfig('id_user');
                 }
                 $options = array('popup_id' => 'delete_popup_' . $workorder['id'], 'delete_href' => "{$delete_href}&id_workorder=" . $workorder['id']);
                 $html .= $ui->getDeletePopupHTML($options);
                 $html .= "<a data-icon=\"delete\" data-rel=\"popup\" href=\"#delete_popup_" . $workorder['id'] . "\"></a>";
             }
             $html .= "</li>";
         }
     } else {
         $html .= "<li>";
         $html .= "<h3 class='error'>" . __('There is no workorders') . "</h3>";
         $html .= "</li>";
     }
     if (!$ajax) {
         $html .= "</ul>";
     }
     return $html;
 }
示例#12
0
function tasks_print_tree($id_project, $sql_search = '')
{
    global $config;
    global $pdf_output;
    if ($pdf_output) {
        $graph_ttl = 2;
    } else {
        $graph_ttl = 1;
    }
    echo "<table class='blank' style='width:98%'>";
    echo "<tr><td style='width:60%' valign='top'>";
    $sql = "SELECT t.*\n\t\t\tFROM ttask t\n\t\t\tWHERE t.id_parent_task=0\n\t\t\t\tAND t.id>0\n\t\t\t\tAND t.id_project={$id_project}\n\t\t\t\t{$sql_search}\n\t\t\tORDER BY t.name";
    //$sql_search = base64_encode($sql_search);
    $sql_count = "SELECT COUNT(*) AS num\n\t\t\tFROM ttask t\n\t\t\tWHERE t.id_parent_task=0\n\t\t\t\tAND t.id>0\n\t\t\t\tAND t.id_project={$id_project}\n\t\t\t\t{$sql_search}";
    $countRows = process_sql($sql_count);
    if ($countRows === false) {
        $countRows = 0;
    } else {
        $countRows = (int) $countRows[0]['num'];
    }
    if ($countRows == 0) {
        echo '<h3 class="error">' . __('No tasks found') . '</h3>';
        return;
    }
    $new = true;
    $count = 0;
    echo "<ul style='margin: 0; margin-top: 20px; padding: 0;'>\n";
    $first = true;
    while ($task = get_db_all_row_by_steps_sql($new, $result, $sql)) {
        $new = false;
        $count++;
        echo "<li style='margin: 0; padding: 0;'>";
        echo "<span style='display: inline-block;'>";
        $branches = array();
        if ($first) {
            if ($count != $countRows) {
                $branches[] = true;
                $img = print_image("images/tree/first_closed.png", true, array("style" => 'vertical-align: middle;', "id" => "tree_image" . $task['id'] . "_task_" . $task['id'], "pos_tree" => "0"));
                $first = false;
            } else {
                $branches[] = false;
                $img = print_image("images/tree/one_closed.png", true, array("style" => 'vertical-align: middle;', "id" => "tree_image" . $task['id'] . "_task_" . $task['id'], "pos_tree" => "1"));
            }
        } else {
            if ($count != $countRows) {
                $branches[] = true;
                $img = print_image("images/tree/closed.png", true, array("style" => 'vertical-align: middle;', "id" => "tree_image" . $task['id'] . "_task_" . $task['id'], "pos_tree" => "2"));
            } else {
                $branches[] = false;
                $img = print_image("images/tree/last_closed.png", true, array("style" => 'vertical-align: middle;', "id" => "tree_image" . $task['id'] . "_task_" . $task['id'], "pos_tree" => "3"));
            }
        }
        $task_access = get_project_access($config["id_user"], $id_project, $task["id"], false, true);
        if ($task_access["read"]) {
            // Background color
            if ($task["completion"] < 40) {
                $background_color = "background: #FFFFFF;";
            } else {
                if ($task["completion"] < 90) {
                    $background_color = "background: #FFE599;";
                } else {
                    if ($task["completion"] < 100) {
                        $background_color = "background: #A4BCFA;";
                    } else {
                        if ($task["completion"] == 100) {
                            $background_color = "background: #B6D7A8;";
                        } else {
                            $background_color = "";
                        }
                    }
                }
            }
            // Priority
            $priority = print_priority_flag_image($task['priority'], true);
            // Task name
            $name = safe_output($task['name']);
            if (strlen($name) > 30) {
                $name = substr($name, 0, 30) . "...";
                $name = "<a title='" . safe_output($task['name']) . "' href='index.php?sec=projects&sec2=operation/projects/task_detail\n\t\t\t\t\t&id_project=" . $task['id_project'] . "&id_task=" . $task['id'] . "&operation=view'>" . $name . "</a>";
            } else {
                $name = "<a href='index.php?sec=projects&sec2=operation/projects/task_detail\n\t\t\t\t\t&id_project=" . $task['id_project'] . "&id_task=" . $task['id'] . "&operation=view'>" . $name . "</a>";
            }
            if ($task["completion"] == 100) {
                $name = "<s>{$name}</s>";
            }
            // Completion
            $progress = progress_bar($task['completion'], 70, 20, $graph_ttl);
            // Estimation
            $imghelp = "Estimated hours = " . $task['hours'];
            $taskhours = get_task_workunit_hours($task['id']);
            $imghelp .= ", Worked hours = {$taskhours}";
            $a = round($task["hours"]);
            $b = round($taskhours);
            $mode = 2;
            if ($a > 0) {
                $estimation = histogram_2values($a, $b, __("Planned"), __("Real"), $mode, 60, 18, $imghelp, $graph_ttl);
            } else {
                $estimation = "--";
            }
            // Time used on all child tasks + this task
            $recursive_timeused = task_duration_recursive($task["id"]);
            $time_used = _('Time used') . ": ";
            if ($taskhours == 0) {
                $time_used .= "--";
            } elseif ($taskhours == $recursive_timeused) {
                $time_used .= $taskhours;
            } else {
                $time_used .= $taskhours . "<span title='Subtasks WU/HR'> (" . $recursive_timeused . ")</span>";
            }
            $wu_incidents = get_incident_task_workunit_hours($task["id"]);
            if ($wu_incidents > 0) {
                $time_used .= "<span title='" . __("Time spent in related tickets") . "'> ({$wu_incidents})</span>";
            }
            // People
            $people = combo_users_task($task['id'], 1, true);
            $people .= ' ';
            $people .= get_db_value('COUNT(DISTINCT(id_user))', 'trole_people_task', 'id_task', $task['id']);
            // Branches
            $branches_json = json_encode($branches);
            // New WO / Incident
            $wo_icon = print_image("images/paste_plain.png", true, array("style" => 'vertical-align: middle;', "id" => "wo_icon", "title" => __('Work order')));
            $incident_icon = print_image("images/incident.png", true, array("style" => 'vertical-align: middle; height:19px; width:20px;', "id" => "incident_icon", "title" => __('Ticket')));
            $wo_icon = "<a href='index.php?sec=projects&sec2=operation/workorders/wo&operation=create&id_task=" . $task['id'] . "'>{$wo_icon}</a>";
            $incident_icon = "<a href='index.php?sec=incidents&sec2=operation/incidents/incident_detail&id_task=" . $task['id'] . "'>{$incident_icon}</a>";
            $launch_icons = $wo_icon . "&nbsp;" . $incident_icon;
            echo "<a onfocus='JavaScript: this.blur()' href='javascript: loadTasksSubTree(" . $task['id_project'] . "," . $task['id'] . ",\"" . $branches_json . "\", " . $task['id'] . ",\"" . $sql_search . "\")'>";
            echo "<script type=\"text/javascript\">\n\t\t\t\t\t  \$(document).ready (function () {\n\t\t\t\t\t\t  loadTasksSubTree(" . $task['id_project'] . "," . $task['id'] . ",\"" . $branches_json . "\", " . $task['id'] . ",\"" . $sql_search . "\");\n\t\t\t\t\t  });\n\t\t\t\t  </script>";
            echo $img;
            echo "</a>";
            echo "<span style='" . $background_color . " padding: 4px;'>";
            echo "<span style='vertical-align:middle; display: inline-block;'>" . $priority . "</span>";
            echo "<span style='margin-left: 5px; min-width: 250px; vertical-align:middle; display: inline-block;'>" . $name . "</span>";
            echo "<span title='" . __('Progress') . "' style='margin-left: 15px; vertical-align:middle; display: inline-block;'>" . $progress . "</span>";
            echo "<span style='margin-left: 15px; min-width: 70px; vertical-align:middle; display: inline-block;'>" . $estimation . "</span>";
            echo "<span style='margin-left: 15px; vertical-align:middle; display: inline-block;'>" . $people . "</span>";
            echo "<span style='margin-left: 15px; min-width: 200px; display: inline-block;'>" . $time_used . "</span>";
            echo "<span style='margin-left: 15px; vertical-align:middle; display: inline-block;'>" . __('New') . ": " . $launch_icons . "</span>";
            echo "</span>";
        } else {
            // Task name
            $name = safe_output($task['name']);
            if (strlen($name) > 60) {
                $name = substr($name, 0, 60) . "...";
                $name = "<div title='" . safe_output($task['name']) . "'>" . $name . "</a>";
            }
            if ($task["completion"] == 100) {
                $name = "<s>{$name}</s>";
            }
            // Priority
            $priority = print_priority_flag_image($task['priority'], true);
            // Branches
            $branches_json = json_encode($branches);
            echo "<a onfocus='JavaScript: this.blur()' href='javascript: loadTasksSubTree(" . $task['id_project'] . "," . $task['id'] . ",\"" . $branches_json . "\", " . $task['id'] . ",\"" . $sql_search . "\")'>";
            echo "<script type=\"text/javascript\">\n\t\t\t\t\t  \$(document).ready (function () {\n\t\t\t\t\t\t  loadTasksSubTree(" . $task['id_project'] . "," . $task['id'] . ",\"" . $branches_json . "\", " . $task['id'] . ",\"" . $sql_search . "\");\n\t\t\t\t\t  });\n\t\t\t\t  </script>";
            echo $img;
            echo "</a>";
            echo "<span title='" . __('You are not assigned to this task') . "' style='padding: 4px;'>";
            echo "<span style='vertical-align:middle; display: inline-block;'>" . $priority . "</span>";
            echo "<span style='color: #D8D8D8; margin-left: 5px; display: inline-block;'>" . $name . "</span>";
            echo "</span>";
        }
        echo "<div hiddenDiv='1' loadDiv='0' style='display: none; margin: 0px; padding: 0px;' class='tree_view tree_div_" . $task['id'] . "' id='tree_div" . $task['id'] . "_task_" . $task['id'] . "'></div>";
        echo "</li>";
    }
    echo "</ul>";
    echo "</td></tr>";
    echo "</table>";
    return;
}
示例#13
0
 // Show Incident items
 // ==============================================================
 $incidents_home = '';
 if ($incidents > 0) {
     $sql_2 = "SELECT * FROM tincidencia WHERE (id_creator = '" . $config["id_user"] . "' OR id_usuario = '" . $config["id_user"] . "') AND estado IN (1,2,3,4,5) ORDER BY actualizacion DESC limit 5";
     $result_2 = mysql_query($sql_2);
     if ($result_2) {
         $incidents_home .= "<table width=100% class='landing_incidents listing'>";
         $incidents_home .= "<tr><th>" . _("Status") . "</th><th>" . __("Priority") . "</th><th>" . __("Updated") . "</th><th>" . __("Ticket") . "</th><th>" . __("Last WU") . "</th></tr>";
     }
     while ($row_2 = mysql_fetch_array($result_2)) {
         $idi = $row_2["id_incidencia"];
         $incidents_home .= "<tr><td>";
         $incidents_home .= render_status($row_2["estado"]);
         $incidents_home .= "<td>";
         $incidents_home .= print_priority_flag_image($row_2['prioridad'], true);
         $incidents_home .= "<td>";
         $incidents_home .= human_time_comparation($row_2["actualizacion"]);
         $incidents_home .= "<td>";
         $incidents_home .= "<a href='index.php?sec=incidents&sec2=operation/incidents/incident_dashboard_detail&id={$idi}'>";
         $incidents_home .= $row_2["titulo"];
         $incidents_home .= "</b></a>";
         $incidents_home .= "</td>";
         $incidents_home .= "<td style='font-size: 10px'>";
         $last_wu = get_incident_lastworkunit($idi);
         $incidents_home .= $last_wu["id_user"];
         $incidents_home .= "</td></tr>";
     }
     if (isset($row_2)) {
         $incidents_home .= "</table>";
     }
示例#14
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;
 }