예제 #1
0
/**
 * Prints an array of fields in a popup menu of a form based on a SQL query.
 * The first and second columns of the query will be used.
 * 
 * The element will have an id like: "password-$value". Based on choose_from_menu() from Moodle.
 * 
 * @param string $sql SQL sentence, the first field will be the identifier of the option. 
 * The second field will be the shown value in the dropdown.
 * @param string $name Select form name
 * @param string $selected Current selected value.
 * @param string $script Javascript onChange code.
 * @param string $nothing Label when nothing is selected.
 * @param string $nothing_value Value when nothing is selected
 * @param bool $return Whether to return an output string or echo now (optional, echo by default).
 * @param bool $multiple Whether to allow multiple selections or not. Single by default
 * @param bool $sort Whether to sort the options or not. Sorted by default.
 * @param bool $disabled if it's true, disable the select.
 * @param string $style The string of style.
 * @param mixed $size Max elements showed in select or default (size=10) 
 * @param int $truncante_size Truncate size of the element, by default is set to GENERIC_SIZE_TEXT constant
 *
 * @return string HTML code if return parameter is true.
 */
function html_print_select_from_sql($sql, $name, $selected = '', $script = '', $nothing = '', $nothing_value = '0', $return = false, $multiple = false, $sort = true, $disabled = false, $style = false, $size = false, $trucate_size = GENERIC_SIZE_TEXT)
{
    global $config;
    $fields = array();
    $result = get_db_all_rows_sql($sql);
    if ($result === false) {
        $result = array();
    }
    foreach ($result as $row) {
        $id = array_shift($row);
        $value = array_shift($row);
        $fields[$id] = ui_print_truncate_text($value, $trucate_size, false, true, false);
    }
    return html_print_select($fields, $name, $selected, $script, $nothing, $nothing_value, $return, $multiple, $sort, '', $disabled, $style, '', $size);
}
    $incident_sla .= "<td id=slaSlicebarField colspan=2 style='text-align: center; padding: 1px 2px 1px 5px;'>";
    $incident_sla .= graph_sla_slicebar($id, $period, 155, 15, $ttl);
    $incident_sla .= "</td>";
    $incident_sla .= "<td colspan=2 style='text-align: center;' >";
    $incident_sla .= "<div class='pie_frame'>";
    $incident_sla .= graph_incident_sla_compliance($id, 155, 80, $ttl);
    $incident_sla .= "</div>";
    $incident_sla .= "</td>";
    $incident_sla .= "<tr>";
    $incident_sla .= "</table>";
}
$right_side .= print_container('incident_sla', __('SLA information'), $incident_sla);
$table->data[0][0] = $left_side;
$table->data[0][1] = $right_side;
echo "<div id='indicent-details-view'>";
echo '<h1>' . __('Tickets') . ' #' . $incident["id_incidencia"] . ' - ' . ui_print_truncate_text($incident['titulo'], 50);
if (!$clean_output) {
    echo "<div id='button-bar-title'>";
    echo "<ul>";
    //Only incident manager and user with IR flag which are owners and admin can edit incidents
    $check_acl = enterprise_hook("incidents_check_incident_acl", array($incident, false, "IW"));
    if ($check_acl === ENTERPRISE_NOT_HOOK || $check_acl) {
        echo "<li>";
        echo '<a href="index.php?sec=incidents&sec2=operation/incidents/incident_detail&id=' . $id . '">' . print_image("images/application_edit.png", true, array("title" => __("Edit"))) . '</a>';
        echo "</li>";
    }
    echo '<li>';
    echo '<a href="index.php?sec=incidents&sec2=operation/incidents/incident_dashboard_detail&id=' . $id . '&tab=workunits#incident-operations">' . print_image("images/star_dark.png", true, array("title" => __('Comments'))) . '</a>';
    echo '</li>';
    echo '<li>';
    echo '<a href="index.php?sec=incidents&sec2=operation/incidents/incident_dashboard_detail&id=' . $id . '&tab=files#incident-operations">' . print_image("images/disk.png", true, array("title" => __('Files'))) . '</a>';
예제 #3
0
        $default_id_group = get_db_sql("SELECT id_grupo FROM tusuario_perfil WHERE id_usuario = '{$usuario}' LIMIT 1");
    } else {
        $default_id_group = 1;
        $number_group = 1;
    }
}
//The user with IW flag or the incident owner can modify all data from the incident.
$has_permission = give_acl($config['id_user'], $id_grupo, "IW") || $usuario == $config['id_user'];
$has_im = give_acl($config['id_user'], $id_grupo, "IM");
$has_iw = give_acl($config['id_user'], $id_grupo, "IW");
if ($id) {
    echo "<h1>";
    if ($affected_sla_id != 0) {
        echo '<img src="images/exclamation.png" border=0 valign=top title="' . __('SLA Fired') . '">&nbsp;&nbsp;';
    }
    echo __('Ticket') . ' #' . $id . ' - ' . ui_print_truncate_text($incident['titulo'], 50) . "&nbsp;&nbsp;" . '<a href="index.php?sec=incidents&sec2=operation/incidents/incident_dashboard_detail&id=' . $id . '">' . print_image("images/world.png", true, array("title" => __("Link to ticket"))) . '</a>';
    if (give_acl($config["id_user"], 0, "IM")) {
        if ($incident["score"] > 0) {
            echo "( " . __("Scoring");
            echo " " . $incident["score"] . "/10 )";
        }
    }
    echo "<div id='button-bar-title'>";
    echo "<ul>";
    echo '<li>';
    echo '<a href="index.php?sec=incidents&sec2=operation/incidents/incident_dashboard_detail&id=' . $id . '">' . print_image("images/go-previous.png", true, array("title" => __("Back to incident"))) . "</a>";
    echo '</li>';
    /* Delete incident */
    if ($has_im) {
        echo "<li>";
        echo '<form id="delete_incident_form" name="delete_incident_form" class="delete action" method="post" action="index.php?sec=incidents&sec2=operation/incidents/incident_detail">';
예제 #4
0
function d3_bullet_chart($chart_data, $width, $height, $color, $legend, $homeurl, $unit, $font, $font_size)
{
    global $config;
    $output = '';
    $output .= include_javascript_d3(true);
    $id_bullet = uniqid();
    $output .= '<div id="bullet_graph_' . $id_bullet . '" class="bulle" style="overflow: hidden;"></div>
		<style>
			
			.bullet_graph {
				font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
				margin: auto;
				padding-top: 40px;
				position: relative;
				width: 100%;
			}
			
			.bullet { font: 7px sans-serif; }
			.bullet .marker.s0 { stroke: #FC4444; stroke-width: 2px; }
			.bullet .marker.s1 { stroke: #FAD403; stroke-width: 2px; }
			.bullet .marker.s2 { stroke: steelblue; stroke-width: 2px; }
			.bullet .tick line { stroke: #666; stroke-width: .5px; }
			.bullet .range.s0 { fill: #ddd; }
			.bullet .range.s1 { fill: #ddd; }
			.bullet .range.s2 { fill: #ccc; }
			.bullet .measure.s0 { fill: steelblue; }
			.bullet .measure.s1 { fill: steelblue; }
			.bullet .title { font-size: 7pt; font-weight: bold; text-align:left; }
			.bullet .subtitle { fill: #999; font-size: 7pt;}
			.bullet g text { font-size: 7pt;}
		
		</style>
		<script src="' . $config['homeurl'] . 'include/graphs/bullet.js"></script>
		<script language="javascript" type="text/javascript">
		
		var margin = {top: 5, right: 40, bottom: 20, left: 120};
		
		width = (' . $width . '+10);
		height = ' . $height . '- margin.top - margin.bottom;
		
		var chart = d3.bullet()
			.width(width)
			.height(height)
			.orient("left");
		';
    $temp = array();
    foreach ($chart_data as $data) {
        if (isset($data["label"])) {
            $name = io_safe_output($data["label"]);
        } else {
            $name = io_safe_output($data["nombre"]);
        }
        $name = ui_print_truncate_text($name, 15, false, true, false, '...', false);
        $marker = "";
        if ($data['value'] == 0) {
            $marker = ", 0";
        }
        $temp[] = '{"title":"' . $name . '","subtitle":"' . $data["unit"] . '",
				"ranges":[' . (double) $data['max'] . '],"measures":[' . $data['value'] . '],
					"markers":[' . $data['min_warning'] . ',' . $data['min_critical'] . $marker . ']}';
    }
    $output .= 'var data = [' . implode(",", $temp) . '];
	';
    $output .= '
		
		var svg = d3.select("#bullet_graph_' . $id_bullet . '").selectAll("svg")
			.data(data)
			.enter().append("svg")
				.attr("class", "bullet")
				.attr("width", "100%")
				.attr("height", height+ margin.top + margin.bottom)
			.append("g")
				.attr("transform", "translate(" + (margin.left) + "," + margin.top + ")")
				.call(chart);
			 
		
		var title = svg.append("g")
			.style("text-anchor", "end")
			.attr("transform", "translate(-20," + height  + ")");
		
		title.append("text")
			.attr("class", "title")
			.text(function(d) { return d.title; });
		
		title.append("text")
				.attr("class", "subtitle")
				.attr("dy", "1em")
				.text(function(d) { return d.subtitle; });
			
		$(".tick>text").each(function() {
			
			label = $(this).text().replace(/,/g,"");
			label = parseFloat(label);
			text = label.toLocaleString();
			if ( label >= 1000000)
				text = text.substring(0,3) + "M";
			else if (label >= 100000)
				text = text.substring(0,3) + "K";
			else if (label >= 1000)
				text = text.substring(0,2) + "K";
			
			$(this).text(text);
		});
		</script>';
    return $output;
}
예제 #5
0
//The user with IW flag can modify all data from the incident.

//~ $has_permission = (give_acl ($config['id_user'], $id_grupo, "IW") || ((get_standalone_user($config["id_user"])) && ($incident["id_creator"] == $config["id_user"])));
$has_permission = (give_acl ($config['id_user'], $id_grupo, "IW") || ((get_standalone_user($config["id_user"]))));
$has_im  = give_acl ($config['id_user'], $id_grupo, "IM");
$has_iw = (give_acl ($config['id_user'], $id_grupo, "IW") || ((get_standalone_user($config["id_user"])) && ($incident["id_creator"] == $config["id_user"])));


if ($id) {	
	
	echo "<h2>";
	if ($affected_sla_id != 0) {
		echo '<img src="images/exclamation.png" border=0 valign=top title="'.__('SLA Fired').'">&nbsp;&nbsp;';
	}

	echo __('Ticket').' #'.$id.'</h2><h4>'.ui_print_truncate_text($incident['titulo'],50);
	echo integria_help ("create_tickets", true);
	echo "&nbsp;&nbsp;".'<a href="index.php?sec=incidents&sec2=operation/incidents/incident_dashboard_detail&id='.$id.'">';
	echo print_image("images/world.png", true, array("title" => __("Link to ticket"))).'</a>';
	
    if (give_acl($config["id_user"], 0, "IM")){
        if ($incident["score"] > 0){
            echo "( ".__("Scoring");
            echo " ". $incident["score"]. "/10 )";
        }
    }
	
	echo "<div id='button-bar-title'>";
	echo "<ul>";
	echo '<li>';
	echo '<a href="index.php?sec=incidents&sec2=operation/incidents/incident_dashboard_detail&id='.$id.'">'.print_image("images/go-previous.png", true, array("title" => __("Back to incident")))."</a>";
예제 #6
0
function users_get_groups_for_select($id_user, $privilege = "IR", $returnAllGroup = true, $returnAllColumns = false, $id_groups = null, $keys_field = 'id_grupo')
{
    if ($id_groups === false) {
        $id_groups = null;
    }
    $user_groups = get_user_groups($id_user, $privilege, $returnAllGroup, $returnAllColumns);
    if ($id_groups !== null) {
        $childrens = groups_get_childrens($id_groups);
        foreach ($childrens as $child) {
            unset($user_groups[$child['id_grupo']]);
        }
        unset($user_groups[$id_groups]);
    }
    if (empty($user_groups)) {
        $user_groups_tree = array();
    } else {
        // First group it's needed to retrieve its parent group
        $first_group = reset(array_slice($user_groups, 0, 1));
        $parent_group = $first_group['parent'];
        $user_groups_tree = groups_get_groups_tree_recursive($user_groups, $parent_group);
    }
    $fields = array();
    foreach ($user_groups_tree as $group) {
        $groupName = ui_print_truncate_text($group['nombre'], GENERIC_SIZE_TEXT, false, true, false);
        $fields[$group[$keys_field]] = str_repeat("&nbsp;&nbsp;&nbsp;&nbsp;", $group['deep']) . $groupName;
    }
    return $fields;
}
예제 #7
0
 $url_update = "index.php?sec=incidents&sec2=operation/incidents/incident_type_field&update_field=1&id={$id}&id_field=" . $field['id'];
 if ($field['label'] == '') {
     $data[0] = '';
 } else {
     $data[0] = $field["label"];
 }
 if ($field_type = '') {
     $data[1] = '';
 } else {
     $data[1] = $field["type"];
 }
 if ($field["type"] == "combo") {
     $data[2] = ui_print_truncate_text($field["combo_value"], 40);
 } else {
     if ($field["type"] == "linked") {
         $data[2] = ui_print_truncate_text($field["linked_value"], 40);
     } else {
         $data[2] = "";
     }
 }
 if ($field["show_in_list"]) {
     $data[3] = __('Yes');
 } else {
     $data[3] = __('No');
 }
 $data[4] = "";
 if (!$field["global_id"]) {
     if (get_admin_user($config['id_user'])) {
         $data[4] = "<a\n\t\t\t\t\t\thref='" . $url_update . "'>\n\t\t\t\t\t\t<img src='images/wrench.png' border=0 /></a>";
     }
 } else {
예제 #8
0
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, $id_ticket = 0)
{
    global $config;
    echo '<div class = "incident_table" id = "incident_table">';
    $params = "";
    foreach ($filter as $key => $value) {
        $params .= "&search_" . $key . "=" . $value;
    }
    if ($filter['closed_by'] == '') {
        $filter['closed_by'] = get_parameter('search_closed_by', '');
    }
    if ($filter['from_date'] == '') {
        $filter['from_date'] = get_parameter('search_from_date', '');
    }
    //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
        if (isset($filter["limit"])) {
            $limit_aux = $filter["limit"];
        } else {
            $limit_aux = 0;
        }
    }
    // 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;
        echo "<div class='clear_both'>";
        $incidents = print_array_pagination($incidents, $url, $offset);
        echo "</div>";
    }
    $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 (is_array($order_by) && array_key_exists("id_incidencia", $order_by) && $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 (is_array($order_by) && array_key_exists("prioridad", $order_by) && $order_by["prioridad"] != "") {
            if ($order_by["prioridad"] == "DESC") {
                $priority_order_image = "<a href='javascript:changeIncidentOrder(\"prioridad\", \"ASC\")'><img src='images/arrow_down_orange.png'></a>";
            } else {
                $priority_order_image = "<a href='javascript:changeIncidentOrder(\"prioridad\", \"\")'><img src='images/arrow_up_orange.png'></a>";
            }
        } else {
            $priority_order_image = "<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="100%" cellpadding="0" cellspacing="0" border="0px" class="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 __('Prior') . $priority_order_image;
    echo "</th>";
    echo "<th>";
    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"';
            }
            if ($incident["id_incidencia"] != $id_ticket) {
                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><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 . '">' . ui_print_truncate_text(safe_output($incident['titulo']), 50) . '</a></strong><br>';
                } else {
                    echo '<strong>' . $incident['titulo'] . '</strong><br>';
                }
                echo "<span>";
                echo incidents_get_incident_type_text($incident["id_incidencia"]);
                // Added by slerena 26Ago2013
                $sql = sprintf("SELECT * FROM tincident_type_field WHERE 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;'>[" . safe_output($field_data) . "]</div>";
                            }
                        }
                    }
                }
                echo "{$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>{$company_name}</span>";
                    }
                }
                echo '</td>';
                $resolution = isset($resolutions[$incident['resolution']]) ? $resolutions[$incident['resolution']] : __('None');
                $gold = "";
                $black = "";
                if ($incident['gold_medals']) {
                    $gold = print_image('images/insignia_dorada.png', true) . "(" . $incident['gold_medals'] . ")";
                }
                if ($incident['black_medals']) {
                    $black = print_image('images/insignia_gris.png', true) . "(" . $incident['black_medals'] . ")";
                }
                echo '<td><strong>' . $statuses[$incident['estado']] . '</strong><br /><em>' . $resolution . '</em>' . $gold . $black . '</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 "<img src='images/comment.gif' title='" . $last_wu["id_user"] . "'>";
                }
                echo '</td>';
                echo '<td>' . human_time_comparation($incident["actualizacion"]);
                // Show only if it's different
                if ($incident["inicio"] != $incident["actualizacion"]) {
                    echo " / <br /> [" . human_time_comparation($incident["inicio"]);
                    echo "]";
                }
                //echo "<br>";
                echo '<span style="display:inline-table;">';
                /*
                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 "&nbsp;$updated_by";
                */
                echo "</span>";
                echo '</td>';
                if ($config["show_creator_incident"] == 1) {
                    echo "<td>";
                    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 "&nbsp;{$incident_creator}";
                    echo "</td>";
                }
                if ($config["show_owner_incident"] == 1) {
                    echo "<td>";
                    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 "&nbsp;{$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 "</div>";
}
예제 #9
0
		$details = $name."&nbsp;&nbsp;(".$country.")";

		$details_size = strlen(safe_output($details));

		$char_truncate = 30;

		$details = ui_print_truncate_text($details, $char_truncate, false, true);

		$lead_list .= "<div class='pipeline-list-details'>".$details."</div>";

		if (!empty($l['owner'])) {

			$char_truncate = 35;

			$owner = $l['owner'];
			$details = ui_print_truncate_text($owner, $char_truncate, false, true);

			$lead_list .= "<div class='pipeline-list-owner'>".$owner."</div>";
		}

		if (!empty($l['estimated_close_date']) && $l['estimated_close_date'] != '0000-00-00 00:00:00') {

			$estimated_close_date = date('Y-m-d', strtotime($l['estimated_close_date']));

			$lead_list .= "<div title= '".__('Estimated close date')."' class='pipeline-list-estimated_close_date'>".$estimated_close_date."</div>";
		}

		// Detect if the lead is pretty old 
		if (calendar_time_diff ($l["modification"]) > $lead_warning_time) {
			$human_time_lead = human_time_comparation ($l['modification']);
예제 #10
0
		$table->class = 'listing';
		$table->data = array ();
		$table->head[0] = __('Name');
		$table->head[1] = __('Groups');
		$table->head[2] = __('Description');

		if (get_admin_user ($config['id_user'])) {
			$table->head[3] = __('Actions');
		}
		
		foreach ($types as $type) {
			$data = array ();
			
			$data[0] = '<a href="index.php?sec=incidents&sec2=operation/incidents/type_detail&show_fields=1&id='.$type['id'].'">'.$type['name'].'</a>';
			if($type['id_group']){
				$data[1] = ui_print_truncate_text($type['id_group'], 60);
			} else {
				$data[1] = '';
			}
			
			$data[2] = $type['description'];
			
			if (get_admin_user ($config['id_user'])) {

				$data[3] = '<a href="index.php?sec=incidents&sec2=operation/incidents/type_detail&show_fields=1&id='.$type['id'].'"><img src="images/wrench.png" title="'.__('Add fields').'"/></a>';			
				$data[3] .= '&nbsp;&nbsp;<a href="index.php?sec=incidents&sec2=operation/incidents/type_detail&autofocus=1&id='. $type['id'].'"><img src="images/update_icon.png" title="'.__('Update').'"></a>';
				$data[3] .= '&nbsp;&nbsp;<a href="index.php?sec=incidents&sec2=operation/incidents/type_detail&delete_type=1&id='.$type['id'].'" onClick="if (!confirm(\''.__('Are you sure delete tyckets type?').'\'))return false;"><img src="images/cross.png" title="'.__('Delete').'"></a>';
			}
			array_push ($table->data, $data);
		}
		echo '<div class="divresult">';