$incident_sla .= "</td>";
	$incident_sla .= "</tr>";
	$incident_sla .= "<tr>";
	$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, 'open', true, true, '', 'no_border', 4, 'less_widht');

$table->data[0][0] = $left_side;
$table->data[0][1] = $right_side;

echo "<div id='indicent-details-view'>";

echo '<h2>'.__('Tickets').' #'.$incident["id_incidencia"].'</h2><h4>'. $incident['titulo'];


if (!$pure) {
	echo integria_help ("incident_dashboard_detail", true);
	echo "<div id='button-bar-title'>";
	echo "<ul>";

	//Only incident manager and user with IR flag which are owners and admin can edit incidents
Пример #2
0
    // JSON STRING
    $html .= "</div>";
    $html .= "<ul></ul>";
    $html .= "</div>";
    $table_description = new stdClass();
    $table_description->width = '99%';
    $table_description->id = 'incident_file_description';
    $table_description->class = 'search-table-button';
    $table_description->data = array();
    $table_description->data[0][0] = print_textarea("file_description", 3, 40, '', '', true, __('Description'));
    $table_description->data[1][0] = print_submit_button(__('Add'), 'crt_btn', false, 'class="sub create"', true);
    $html .= "<div id='file_description_table_hook' style='display:none;'>";
    $html .= print_table($table_description, true);
    $html .= "</div>";
    $table->colspan[10][0] = 4;
    $table->data[10][0] = print_container('file_upload_container', __('File upload'), $html, 'closed', true, false);
}
if ($create_incident) {
    $button = print_input_hidden('action', 'insert', true);
    if (give_acl($config["id_user"], 0, "IW")) {
        $button .= print_submit_button(__('Create'), 'action2', false, 'class="sub create"', true);
    }
} else {
    $button = print_input_hidden('id', $id, true);
    $button .= print_input_hidden('action', 'update', true);
    $button .= print_submit_button(__('Update'), 'action2', false, 'class="sub upd"', true);
}
$table->colspan['button'][0] = 4;
$table->data['button'][0] = $button;
if ($has_permission) {
    if ($create_incident) {
Пример #3
0
				//$tracking_group .= "</table>";
				
				echo print_container('incident_tracking_group', __('Statistics by group'), $tracking_group, 'open', true, '20px', '', '', 1, 'less_widht');
			echo "</td>";	
			echo "<td style='vertical-align:top;width: 33%;'>";
				//$tracking_user = "******";
				foreach ($stats[INCIDENT_METRIC_USER] as $key => $value) {
					$name = get_db_value ('nombre_real', 'tusuario', 'id_usuario', $key);
					$tracking_user = "******";
					$tracking_user .= "<td><strong>".$name."</strong>:</td>";
					$tracking_user .= "<td style='text-align:right;'>".give_human_time($value,true,true,true)."</td>";
					$tracking_user .= "</tr>";
				}
				//$tracking_user .= "</table>";
				
				echo print_container('incident_tracking_user', __('Statistics by owner'), $tracking_user, 'open', true, '20px', '', '', 1, 'less_widht');
			echo "</td>";	
		echo "</tr>";
	echo "</table>";
}

$trackings = get_db_all_rows_field_filter ('tincident_track', 'id_incident', $id, 'timestamp DESC, id_it DESC');

if ($trackings !== false) {
	unset($table);
	$table = new StdClass;
	$table->width = "100%";
	$table->class = 'listing';
	$table->data = array ();
	$table->head = array ();
	$table->head[0] = __('Description');
Пример #4
0
                $tasks_report .= '<div class="pie_frame">';
                $tasks_report .= print_table($table_task, true);
                $tasks_report .= '</div><br>';
                if ($pdf_output) {
                    $tasks_report .= '<hr>';
                }
            }
        }
    }
    //Print containers
    echo print_container('project_labour_report', __('Labour'), $labour, 'no', true, true, "container_simple_title", "container_simple_div");
    echo print_container('project_budget_report', __('Budget'), $budget, 'no', true, true, "container_simple_title", "container_simple_div");
    echo print_container('project_involved_people_report', __('People involved'), $people_involved, 'no', true, true, "container_simple_title", "container_simple_div");
    echo print_container('project_task_distribution_report', __('Task distribution'), $task_distribution, 'no', true, true, "container_simple_title", "container_simple_div");
    echo print_container('project_workload_distribution_report', __('Workload distribution'), $workload_distribution, 'no', true, true, "container_simple_title", "container_simple_div");
    echo print_container('project_tasks_report', __('Project tasks'), $tasks_report, 'no', true, true, "container_simple_title", "container_simple_div");
}
?>

<?php 
if (!$pdf_output) {
    ?>
<script type="text/javascript">
	$(function() {
		// Init the tooltip
		$('div.tooltip_title').tooltip({
			track: true,
			open: function (event, ui) {
				ui.tooltip.css('max-width', '800px');
			}
		});
Пример #5
0
echo "</td>";
echo "</strong>";
echo "</tr>";
echo "</table>";
echo "</td>";
echo "<td>";
$content = '<div class="pie_frame">' . graph_workunit_project_user_single(180, 150, $id_project) . '</div>';
print_container('planning_hours_worked', __("Hours worked"), $content, 'no', false, '10px');
echo "</td>";
echo "<td>";
$content = '<div class="pie_frame">' . graph_workunit_project_task_status(180, 150, $id_project) . '</div>';
print_container('planning_hours_summary_task', __("Summary task status"), $content, 'no', false, '10px');
echo "</td>";
echo "<td>";
$content = '<div class="pie_frame">' . graph_project_task_per_user(180, 150, $id_project) . '</div>';
print_container('planning_hours_task_user', __("Task per user"), $content, 'no', false, '10px');
echo "</td>";
echo "</tr>";
echo "</table>";
echo "</center>";
//Create button bar
echo "<div style='width:100%; border-spacing:0px;' class='button'>";
// Oppen the task creation
print_button(__('Add tasks'), 'addmass', false, '', 'class="sub create"');
// Submit the update form
print_button(__('Update'), 'update', false, 'document.forms[\'form-tasks\'].submit()', 'class="sub upd"');
echo "</div>";
//Get project users
$sql = sprintf("SELECT DISTINCT(id_user) FROM trole_people_project WHERE id_project = %d", $id_project);
$users_db = get_db_all_rows_sql($sql);
foreach ($users_db as $u) {
Пример #6
0
 	$filter['id_building'] = (int) get_parameter ('search_id_building');
 	$filter['sla_fired'] = (bool) get_parameter ('search_sla_fired');
 	$filter['id_incident_type'] = (int) get_parameter ('search_id_incident_type');
 	$filter['id_user'] = (string) get_parameter ('search_id_user', '');
 	$filter['id_incident_type'] = (int) get_parameter ('search_id_incident_type');
 	$filter['id_user'] = (string) get_parameter ('search_id_user', '');
 	$filter['first_date'] = (string) get_parameter ('search_first_date');
 	$filter['last_date'] = (string) get_parameter ('search_last_date');
}

if (!$output) {
	$output = __('All tickets');
}

$container_title = __("Ticket report parameters");
echo print_container('incident_report_parameters', $container_title, $output, 'no', true, true, "container_simple_title", "container_simple_incident_report_parameters ");  

if ($show_list) {

	$table->class = 'listing';
	$table->width = "95%";
	$table->style = array ();
	$table->style[0] = 'font-weight: bold';
	$table->head = array ();
	$table->head[0] = __('ID');
	$table->head[1] = __('SLA');
	$table->head[2] = __('% SLA');
	$table->head[3] = __('Ticket');
	$table->head[4] = __('Group')."<br><em>".__("Company")."</em>";
	$table->head[5] = __('Status')."<br /><em>".__('Resolution')."</em>";
	$table->head[6] = __('Priority');
Пример #7
0
    $managers_invoicing_volume = pie3d_graph($config['flash_charts'], $managers_invoicing, 300, 150, __('others'), "", "", $config['font'], $config['fontsize'] - 1, $ttl);
} else {
    $managers_invoicing_volume = __('No data to show');
}
$managers_invoicing_volume = '<br><div class="pie_frame">' . $managers_invoicing_volume . '</div>';
$table->data[2][1] = print_container('managers_invoicing_volume', __('Managers invoicing volume'), $managers_invoicing_volume, 'no', true, '10px');
//TOP 10 INVOICING
$companies_invoincing = crm_get_total_invoiced($where_clause);
if ($read && $enterprise) {
    $companies_invoincing = crm_get_user_companies($config['id_user'], $companies_invoincing);
}
if ($companies_invoincing != false) {
    $companies_invoincing_content = '<br>' . print_table(crm_print_most_invoicing_companies($companies_invoincing), true);
} else {
    $companies_invoincing_content = '<br><div>' . __('No data to show') . '</div>';
}
$table->data[3][0] = print_container('top_10_invoicing', __('Top 10 invoicing'), $companies_invoincing_content, 'no', true, '10px');
//TOP 10 MANAGERS INVOICING
if ($read && $enterprise) {
    $managers_invoicing = crm_get_invoicing_managers_acl($config['id_user'], $where_clause);
} else {
    $managers_invoicing = crm_get_managers_invoicing($where_clause);
}
if ($managers_invoicing != false) {
    $managers_invoicing_content = '<br>' . print_table(crm_print_most_invoicing_managers($managers_invoicing), true);
} else {
    $managers_invoicing_content = '<br><div>' . __('No data to show') . '</div>';
}
$table->data[3][1] = print_container('top_10_managers_invoicing', __('Top 10 managers invoicing'), $managers_invoicing_content, 'no', true, '10px');
echo '<br>';
print_table($table);
Пример #8
0
        }
        if (isset($row_2)) {
            $incidents_home .= "</table>";
        }
    } else {
        $incidents_home .= "<div class='landing_empty'>";
        $incidents_home .= __("There aren't active incidents");
        $incidents_home .= "</div>";
    }
    $much_more = "<a href='index.php?sec=incidents&sec2=operation/incidents/incident_dashboard'>";
    $much_more .= "<img class='much_more' src='images/add.png' title='" . __('Incidents') . "'>";
    $much_more .= "</a>";
    $subtitle = "<span class='landing_subtitle'>";
    $subtitle .= __('Total active incidents') . ": " . incidents_active_user($config["id_user"]);
    $subtitle .= "</span>";
    echo print_container('incidents_home', __('Incidents') . $subtitle . $much_more, $incidents_home, 'no');
    echo "</td>";
    echo "</tr>";
    echo "</table>";
} else {
    if (give_acl($config["id_user"], 0, "AR")) {
        include "operation/agenda/agenda.php";
    } else {
        echo "<h1>" . __("Welcome to Integria") . "</h1>";
    }
}
$check_browser = check_browser();
if ($check_browser) {
    $browser_message = '<h4>' . __('Recommended browsers are Firefox and Chrome. You are using another browser.') . '</h4>';
    echo "<div class= 'dialog ui-dialog-content' title='" . __("Info") . "' id='browser_dialog'>{$browser_message}</div>";
    echo "<script type='text/javascript'>";
Пример #9
0
        $tracking_group .= "</tr>";
    }
    $tracking_group .= "</table>";
    echo print_container('incident_tracking_group', __('Statistics by group'), $tracking_group, 'no', true, '20px');
    echo "</td>";
    echo "<td style='vertical-align:top;width: 33%;'>";
    $tracking_user = "******";
    foreach ($stats[INCIDENT_METRIC_USER] as $key => $value) {
        $name = get_db_value('nombre_real', 'tusuario', 'id_usuario', $key);
        $tracking_user .= "<tr>";
        $tracking_user .= "<td><strong>" . $name . "</strong>:</td>";
        $tracking_user .= "<td style='text-align:right;'>" . give_human_time($value, true, true, true) . "</td>";
        $tracking_user .= "</tr>";
    }
    $tracking_user .= "</table>";
    echo print_container('incident_tracking_user', __('Statistics by owner'), $tracking_user, 'no', true, '20px');
    echo "</td>";
    echo "</tr>";
    echo "</table>";
}
$trackings = get_db_all_rows_field_filter('tincident_track', 'id_incident', $id, 'timestamp DESC, id_it DESC');
if ($trackings !== false) {
    unset($table);
    $table->width = "99%";
    $table->class = 'listing';
    $table->data = array();
    $table->head = array();
    $table->head[0] = __('Description');
    $table->head[1] = __('User');
    $table->head[2] = __('Date');
    $table->style[2] = "width: 150px";
Пример #10
0
	echo "<th>".__("Completed").":<span style='background-color:#b8e0fd;'>&nbsp;".$completed."&nbsp;</span></th>";
	echo "<th>".__("In process").":<span style='background-color:#fceaa2;'>&nbsp;".$in_process."&nbsp;</span></th>";
	echo "<th>".__("Pending").":<span style='background-color:#FFF;'>&nbsp;".$pending."&nbsp;</span></th>";
echo "</tr></table>";

$content_general = "<tr><td valign='top' >";
		$content = '<tr><td colspan="2" valign=top style="height:250px;">'.graph_workunit_project_user_single(350, 150, $id_project).'</td></tr>';
	$content_general .=	print_container('planning_hours_worked', __("Hours worked"), $content, 'no', true, '10px');
$content_general .= "</td><td valign='top' >";
		$content = '<tr><td colspan="2" valign=top style="height:250px;">'. graph_workunit_project_task_status(350, 150, $id_project).'</td></tr>';
	$content_general .= print_container('planning_hours_summary_task', __("Summary task status"), $content, 'no', true, '10px');
$content_general .= "</td><td valign='top'  >";
		$content = '<tr><td colspan="2" valign=top style="height:250px;">'. graph_project_task_per_user(350, 150, $id_project).'</td></tr>';
	$content_general .= print_container('planning_hours_task_user', __("Task per user"), $content, 'no', true, '10px', '', '', 1, 'less_widht');
$content_general .= "</td></tr>";
print_container('task_information', __("Task Information"), $content_general, 'closed', false, '10px', '', '', 2);

//Starting main form for this view
echo "<form id='form-tasks' method='post' action='index.php?sec=projects&sec2=operation/projects/task_planning&id_project=".$id_project."'>";
print_input_hidden('update', 'update');
//Create table and table header.
echo "<table class='listing'>";
	echo "<thead>";
		echo "<tr>";
			echo "<th>".__('Task')."</th>";
			echo "<th>".__('Owner')."</th>";
			echo "<th>".__('Start date')."</th>";
			echo "<th>".__('End date')."</th>";
			echo "<th>".__('Hours worked')."</th>";
			echo "<th>".__('Delay (days)')."</th>";
			echo "<th>".__('Status')."</th>";
Пример #11
0
    $comp_invoiced_data[$comp_name] = $val;
}
switch ($search_invoice_type) {
    case 'Submitted':
        $container_title = __("Submitted billing per company");
        break;
    case 'Received':
        $container_title = __("Received billing per company");
        break;
    default:
        $container_title = "Submitted billing per company";
        break;
}
$companies_invoiced_graph = pie3d_graph($config["flash_charts"], $comp_invoiced_data, 400, 150, __('others'), $config["base_url"], "", $config['font'], $config['fontsize'], $graph_ttl);
$companies_invoiced_graph = '<div class="pie_frame">' . $companies_invoiced_graph . "</div>";
echo print_container('companies_invoiced', $container_title, $companies_invoiced_graph, 'no', true, true, "container_simple_title", "container_simple_div");
switch ($search_invoice_type) {
    case 'Submitted':
        $container_title = __("Submitted billing per currency");
        break;
    case 'Received':
        $container_title = __("Received billing per currency");
        break;
    default:
        $container_title = __("Submitted billing per currency");
        break;
}
echo print_container('currency_invoiced', $container_title, $currency_table, 'no', true, true, "container_simple_title", "container_simple_div");
?>

Пример #12
0
$lead_stats .= "</td>";
$lead_stats .= "<td style='text-align:right'>";
$lead_stats .= sprintf("%d", $total_leads);
$lead_stats .= "</td>";
$lead_stats .= "</tr>";
$lead_stats .= "<tr>";
$lead_stats .= "<td>";
$lead_stats .= "<strong>" . __("Total success") . "</strong>";
$lead_stats .= "</td>";
$lead_stats .= "<td style='text-align:right'>";
$leads_success = $data[200]["total_leads"];
$lead_stats .= sprintf("%d", $leads_success);
$lead_stats .= "</td>";
$lead_stats .= "</tr>";
$lead_stats .= "<tr>";
$lead_stats .= "<td>";
$lead_stats .= "<strong>" . __("Conversion rate") . "</strong>";
$lead_stats .= "</td>";
$lead_stats .= "<td style='text-align:right'>";
if ($total_leads) {
    $conversion_rate = $leads_success / $total_leads * 100;
} else {
    $conversion_rate = 0;
}
$lead_stats .= sprintf("%.2f %%", $conversion_rate);
$lead_stats .= "</td>";
$lead_stats .= "</tr>";
$lead_stats .= "</table>";
$lead_stats = '<br><div style="padding-left: 20px;">' . $lead_stats . '</div>';
echo print_container('lead_rate', __('Lead statistics'), $lead_stats, 'no', true, true, "container_simple_title", "container_simple_div");
print_table($table);
Пример #13
0
    echo "PHP 5.5.0 or later is required. Please upgrade your PHP installation.";
    die;
}
/* We’re live! */
require_once __DIR__ . DIRECTORY_SEPARATOR . 'bones.php';
require_once DIR_PHP . 'pagesetup.php';
if ($_SERVER['REQUEST_METHOD'] == 'GET') {
    if (isset($_GET['nav'])) {
        $_SESSION['nav'] = $_GET['nav'];
        include DIR_NAV . DIRECTORY_SEPARATOR . 'nav.php';
    }
}
ob_start();
echo "<!DOCTYPE html>";
echo "<html lang=\"en\">";
print_head();
echo "<body>";
print_noscript();
echo "<div class=\"oldie-display-none nojs-display-none\">";
print_navbar();
if (Config::read('var.showsession')) {
    print_session();
    unset($_SESSION['dev']);
}
print_container();
print_footer();
echo "</div>";
print_scripts();
echo "</body>";
echo "</html>";
ob_end_flush();
Пример #14
0
$html .= "<table width=\"99%\">";
$html .= "<td width=\"45%\">";
$html .= __('Drop the file here');
$html .= "<td>";
$html .= __('or');
$html .= "<td width=\"45%\">";
$html .= "<a id=\"browse_button\">" . __('browse it') . "</a>";
$html .= "<tr>";
$html .= "</table>";
$html .= "<input name=\"upfile\" type=\"file\" id=\"file-upfile\" class=\"sub file\" />";
$html .= "<input type=\"hidden\" name=\"upfiles\" id=\"upfiles\" />";
// JSON STRING
$html .= "</div>";
$html .= "<ul></ul>";
$html .= "</div>";
$table->data[3][0] = print_container('attachment_upload_container', __('Attachments'), $html, 'closed', true, false);
$table->data[4][0] = print_textarea("last_mail", 10, 1, $last_email, 'style="height:350px;"', true, __('Last E-mail'));
$table->data[5][0] = print_submit_button(__('Send email'), 'apply_btn', false, 'class="sub upd"', true);
$table->data[5][0] .= print_input_hidden('id', $id, true);
$table->data[5][0] .= print_input_hidden('send', 1, true);
echo '<form method="post" id="lead_mail_go">';
print_table($table);
echo "</form>";
?>

<script type="text/javascript" src="include/js/jquery.validate.js"></script>
<script type="text/javascript" src="include/js/jquery.validation.functions.js"></script>
<script type="text/javascript" src="include/js/jquery.fileupload.js"></script>
<script type="text/javascript" src="include/js/jquery.iframe-transport.js"></script>
<script type="text/javascript" src="include/js/jquery.knob.js"></script>
Пример #15
0
    $budget .= "</td><td>";
    if ($total_hr > 0) {
        $budget .= format_numeric($total_project_costs / $total_hr) . " " . $config["currency"];
    } else {
        $budget .= __("N/A");
    }
    $budget .= "</td></tr>";
    $budget .= "</table>";
    // Workload distribution
    $workload_distribution = '<div class="pie_frame">' . graph_workunit_project_user_single(350, 150, $id_project, $graph_ttl) . '</div>';
    //Print containers
    echo print_container('project_labour', __('Labour'), $labour);
    echo print_container('project_budget', __('Budget'), $budget);
    echo print_container('project_involved_people', __('People involved'), $people_involved);
    echo print_container('project_task_distribution', __('Task distribution'), $task_distribution);
    echo print_container('project_workload_distribution', __('Workload distribution'), $workload_distribution);
}
echo "</form>";
//div to show user info
echo "<div class= 'dialog ui-dialog-content' title='" . __("User info") . "' id='user_info_window'></div>";
?>
<script type="text/javascript" src="include/js/jquery.ui.slider.js"></script>
<script type="text/javascript" src="include/languages/date_<?php 
echo $config['language_code'];
?>
.js"></script>
<script type="text/javascript" src="include/js/integria_date.js"></script>
<script type="text/javascript" src="include/js/jquery.ui.autocomplete.js"></script>
<script type="text/javascript" src="include/js/integria_incident_search.js"></script>

<script type="text/javascript">
Пример #16
0
if ($has_im) {
	//Parent ticket
	$table->data[1][1] = print_input_text ('search_parent', $parent_name, '', 10, 100, true, __('Parent ticket'));
	$table->data[1][1] .= print_input_hidden ('id_parent', $id_parent, true);
	$table->data[1][1] .= print_image("images/cross.png", true, array("onclick" => "clean_parent_field()", "style" => "cursor: pointer"));
	//Delete tickets
	$table->data[1][3] = print_image("images/cross.png", true, array("onclick" => "delete_massive_tickets()", "style" => "cursor: pointer"));
}

$table->data[2][0] = print_submit_button (__('Update'), 'massive_update', false, 'class="sub next"', true);
$table->colspan[2][0] = 4;

$massive_oper_incidents = print_table ($table, true);

echo print_container('massive_oper_incidents', __('Massive operations over selected items'), $massive_oper_incidents, 'closed', true, '20px');

echo "<div class= 'dialog ui-dialog-content' title='".__("Tickets")."' id='parent_search_window'></div>";
?>

<script type="text/javascript" src="include/js/jquery.metadata.js"></script>
<script type="text/javascript" src="include/languages/date_<?php echo $config['language_code']; ?>.js"></script>
<script type="text/javascript" src="include/js/integria_incident_search.js"></script>
<script type="text/javascript" src="include/js/jquery.ui.autocomplete.js"></script>
<script type="text/javascript" src="include/js/integria_date.js"></script>

<script type="text/javascript">

// Datepicker
add_ranged_datepicker ("#text-search_first_date", "#text-search_last_date", null);
Пример #17
0
if (!$external_cost) {
    $external_cost = 0;
}
$table_advanced->data[0][0] .= print_label(__("External costs"), '', '', true);
$table_advanced->data[0][0] .= $external_cost . " " . $config["currency"];
// Abbreviation for "Estimated"
$labela = __('Est.');
$labelb = __('Real');
$a = round($hours);
$b = round(get_task_workunit_hours($id_task));
$image = histogram_2values($a, $b, $labela, $labelb);
$table_advanced->data[0][1] = print_label(__('Estimated hours'), '', '', true, $image);
$labela = __('Total');
$labelb = __('Imp');
$a = round(task_workunit_cost($id_task, 0));
$b = round(task_workunit_cost($id_task, 1));
$image = histogram_2values($a, $b, $labela, $labelb);
$table_advanced->data[0][1] .= print_label(__('Imputable estimation'), '', '', true, $image);
$labela = __('Est.');
$labelb = __('Real');
$a = $estimated_cost;
$b = round(task_workunit_cost($id_task, 1));
$image = histogram_2values($a, $b, $labela, $labelb);
$table_advanced->data[0][1] .= print_label(__('Cost estimation'), '', '', true, $image);
//Workload distribution chart
$image = graph_workunit_task(200, 170, $id_task, true);
$image = '<div class="graph_frame">' . $image . '</div>';
$table_advanced->data[0][2] = print_label(__('Workunit distribution'), '', '', true, $image);
$table->colspan['row_task_stats'][0] = 3;
$table->data['row_task_stats'][0] = print_container('task_stats', __('Task statitics'), print_table($table_advanced, true), 'open', true, false);
print_table($table);
Пример #18
0
	$table_advanced .= '<td>';
	$table_advanced .= print_company_autocomplete_input($params);
	$table_advanced .= '</td><td>';
	$table_advanced .= combo_kb_products ($id_category, true, 'Product type', true);
	$table_advanced .= '</td>';
	$table_advanced .= "<td rowspan=2 valign=top>".get_last_date_control ($last_date, 'last_date_search', __('Date'), $start_date, 'start_date_search', __('Start date'), $end_date, 'end_date_search', __('End date'));
	$table_advanced .= '</td>';
	$table_advanced .= '<tr><td>';
	$progress_values = lead_progress_array ();
	$table_advanced .= print_select ($progress_values, 'progress_search', $progress, '', __('Any'), 0, true, 0, false, __('Lead progress') );
	$table_advanced .= '</td><td>';
	$table_advanced .= print_select_from_sql ('SELECT id_language, name FROM tlanguage ORDER BY name',
		'id_language', $id_language, '', __('Any'), '', true, false, false, __('Language'));
	$table_advanced .= '<tr>';
	
	$table->data['advanced'][2] = print_container('lead_search_advanced', __('Advanced search'), $table_advanced, 'closed', true, false,'','no_border',3);
	$table->colspan['advanced'][2] = 4;
	// Delete new lines from the string
	$where_clause = str_replace(array("\r", "\n"), '', $where_clause);
	
	$form .= "<div class='divresult_left'>";
		$form .= print_table ($table,true);
	$form .= '</div>';
	$table->data = array ();
	
	$form .= "<div class='divform_right'>";
		$form .= "<div class='button-form'><ul>";
			$form .= '<li>' . print_button(__('Export to CSV'), '', false, 
				'window.open(\'include/export_csv.php?export_csv_leads=1&where_clause=' . 
					str_replace('"', "\'", $where_clause) . '\')', 'class="sub csv"', true) . '</li>';
			$form .='<li>' . print_submit_button (__('Search'), "search_btn", false, 'class="sub search"', true). '</li>';
Пример #19
0
$where_clause_top10 = $where_clause . " AND progress < 100";
$leads_sales = crm_get_total_sales_lead($where_clause_top10);
if ($read && $enterprise) {
    $leads_sales = crm_get_user_leads($config['id_user'], $leads_sales);
}
if ($leads_sales != false) {
    $leads_sales_content = print_table(crm_print_estimated_sales_leads($leads_sales), true);
} else {
    $leads_sales_content = '<br><div class="pie_frame">' . __('No data to show') . '</div>';
}
echo print_container('top_10_sales', __('Top 10 estimated sales'), $leads_sales_content, 'no', true, true, "container_simple_title", "container_simple_div");
//NEW LEADS
$leads_creation = crm_get_total_leads_creation($where_clause);
if ($read && $enterprise) {
    $leads_creation = crm_get_user_leads($config['id_user'], $leads_creation);
}
$leads_creation = crm_get_data_lead_creation_graph($leads_creation);
if ($leads_creation !== false) {
    $area_width = 400;
    $area_height = 250;
    if ($clean_output) {
        $area_width = 240;
        $area_height = 155;
    }
    $leads_creation_content = area_graph($config['flash_charts'], $leads_creation, $area_width, $area_height, "#2179B1", '', '', '', "", "", $config["base_url"], "", '', '', '', $ttl);
} else {
    $leads_creation_content = __('No data to show');
}
$leads_creation_content = '<br><div class="pie_frame"><br>' . $leads_creation_content . '</div>';
echo print_container('new_leads', __('New leads'), $leads_creation_content, 'no', true, true, "container_simple_title", "container_simple_div");
Пример #20
0
$hint = print_help_tip(__("The task cannot start before all tasks in this section start"), true);
$table_advanced->data[0][0] = print_select($links_1, 'link_1', NULL, '', '', '', true, false, false, __('Start to start') . $hint);
$table_advanced->data[0][0] .= "&nbsp;&nbsp;<a href='javascript: show_task_link_selector(1," . $id_project . "," . $id_task . ");'>" . print_image('images/add.png', true, array('title' => __('Add'))) . "</a>";
$table_advanced->data[0][0] .= "&nbsp;&nbsp;<a href='javascript: remove_link(1);'>" . print_image('images/cross.png', true, array('title' => __('Remove'))) . "</a>";
$links_0 = projects_get_task_links($id_project, $id_task, 0);
$hint = print_help_tip(__("The task cannot start before all tasks in this section end"), true);
$table_advanced->data[0][1] = print_select($links_0, 'link_0', NULL, '', '', '', true, false, false, __('Finish to start') . $hint);
$table_advanced->data[0][1] .= "&nbsp;&nbsp;<a href='javascript: show_task_link_selector(0," . $id_project . "," . $id_task . ");'>" . print_image('images/add.png', true, array('title' => __('Add'))) . "</a>";
$table_advanced->data[0][1] .= "&nbsp;&nbsp;<a href='javascript: remove_link(0);'>" . print_image('images/cross.png', true, array('title' => __('Remove'))) . "</a>";
$links_2 = projects_get_task_links($id_project, $id_task, 2);
$hint = print_help_tip(__("The task cannot end before all tasks in this section end, although it may end later"), true);
$table_advanced->data[0][2] = print_select($links_2, 'link_2', NULL, '', '', '', true, false, false, __('Finish to finish') . $hint);
$table_advanced->data[0][2] .= "&nbsp;&nbsp;<a href='javascript: show_task_link_selector(2," . $id_project . "," . $id_task . ");'>" . print_image('images/add.png', true, array('title' => __('Add'))) . "</a>";
$table_advanced->data[0][2] .= "&nbsp;&nbsp;<a href='javascript: remove_link(2);'>" . print_image('images/cross.png', true, array('title' => __('Remove'))) . "</a>";
$table->colspan['row_links'][0] = 3;
$table->data['row_links'][0] = print_container('task_links', __('Task links'), print_table($table_advanced, true), 'open', true, false);
$table->colspan[5][0] = 3;
$table->data[5][0] = print_textarea('description', 8, 30, $description, '', true, __('Description'));
$button = '';
if ($operation != "create" && $task_permission['manage'] || $operation == "create") {
    if ($operation != "create") {
        if ($gantt_editor) {
            $button .= print_submit_button(__('Delete'), 'delete_btn', false, 'class="sub delete"', true);
        }
        $button .= print_submit_button(__('Update'), 'update_btn', false, 'class="sub upd"', true);
        $button .= print_input_hidden('operation', 'update', true);
    } else {
        $button .= print_submit_button(__('Create'), 'create_btn', false, 'class="sub create"', true);
        $button .= print_input_hidden('operation', 'insert', true);
    }
    $button .= print_input_hidden('id_project', $id_project, true);
Пример #21
0
	else
		$budget .= __("N/A");
	$budget .= "</td></tr>";
	
	//Print containers
	echo print_container('project_labour', __('Labour'), $labour);
	echo "<div class='divhalf divhalf-left divhalf-border'>";
		echo print_container_div('container_pie_graphs project_workload_distribution', __('Workload distribution'), $workload_distribution);
	echo "</div>";
	echo "<div class='divhalf divhalf-right divhalf-border'>";
		echo print_container_div('container_pie_graphs project_task_distribution', __('Task distribution'), $task_distribution);
	echo "</div>";
	if ($project_activity) {
		echo print_container('project_activity', __('Project activity'), $project_activity, 'closed');
	}
	echo print_container('project_budget', __('Budget'), $budget);
}
echo "</div>";
echo "</form>";

//div to show user info
echo "<div class= 'dialog ui-dialog-content' title='".__("User info")."' id='user_info_window'></div>";

?>
<script type="text/javascript" src="include/js/jquery.ui.slider.js"></script>
<script type="text/javascript" src="include/languages/date_<?php echo $config['language_code']; ?>.js"></script>
<script type="text/javascript" src="include/js/integria_date.js"></script>
<script type="text/javascript" src="include/js/jquery.ui.autocomplete.js"></script>
<script type="text/javascript" src="include/js/integria_incident_search.js"></script>

<script type="text/javascript">
Пример #22
0
	if (!isset($rows[$db_priority])) {
		$count_priority = 0;
	} else {
		$count_priority = $rows[$db_priority];
	}

	$search_by_priority .= $count_priority;

	$search_by_priority .= "</div></a>";
	$search_by_priority .= "</td>";
}

$search_by_priority .="</tr>";

$right_side .= print_container('incident_search_by_priority', __('Search by priority'), $search_by_priority,'open',true,true,'','no_border',5,'search_by_priority ');

$table->data[1][0] = $left_side;
$table->data[1][1] = $right_side;

print_table($table);

?>

<script type="text/javascript">
$('.incident_container h2').click(function() {
	var arrow = $('#' + $(this).attr('id') + ' img').attr('src');
	var arrow_class = $('#' + $(this).attr('id') + ' img').attr('class');
	var new_arrow = '';
	
	if (arrow_class == 'arrow_down') {
Пример #23
0
$prev_year = $year;
if ($prev_month == 0) {
    $prev_month = 12;
    $prev_year = $prev_year - 1;
}
$next_month = $month + 1;
$next_year = $year;
if ($next_month == 13) {
    $next_month = 1;
    $next_year = $next_year + 1;
}
$day = date('d', strtotime("now"));
$from_one_month = "{$prev_year}-{$prev_month}-{$day}";
$next_one_month = "{$next_year}-{$next_month}-{$day}";
echo "<h1>" . __('Monthly report for') . " {$id_user}</h1>";
echo "<table class=search-table width=99%>";
echo "<tr><td style='text-align: center;'>";
echo "<a href='index.php?sec=users&sec2=operation/user_report/monthly_graph&month={$prev_month}&year={$prev_year}&id={$id_user}'><img src='images/control_rewind_blue.png' title='" . __('Prev') . "'> </a>";
echo "<span style='font-size: 18px;'>" . $year . "/" . $month . "</span>";
echo "<a href='index.php?sec=users&sec2=operation/user_report/monthly_graph&month={$next_month}&year={$next_year}&id={$id_user}'> <img src='images/control_fastforward_blue.png' title='" . __('Next') . "'></a>";
echo "</table>";
// Show graphs
//$from_one_month = date('Y-m-d', strtotime("now - 1 month"));
echo "<table style='width: 100%; padding: 0px'>";
echo "<tr><td class=datos>";
$workunit_by_task = '<br><div class="pie_frame">' . graph_workunit_user(750, 270, $id_user, $from_one_month, 0) . '</div>';
echo print_container('month_report_workunit_by_task', __('Workunit by task'), $workunit_by_task, 'no', true, '10px');
echo "<tr><td class=datos>";
$workunit_by_project = '<br><div class="pie_frame">' . graph_workunit_project_user(750, 270, $id_user, $from_one_month, 0, true) . '</div>';
echo print_container('month_report_workunit_by_project', __('Workunit by project'), $workunit_by_project, 'no', true, '10px');
echo "</table>";
Пример #24
0
			} else {
				$info_general .= '<td><img title=' . __('Forbidden') . ' src="images/lock_big.png" /></td>';
			}
			//$info_general .= "<td class='no_border'></td>";
			$info_general .= "</tr>";
			
		}
		if($nprojects == 0) {
			$info_general = "<tr>";
			// Project name
			//$info_general .= "<td class='no_border size_min'></td>";
			$info_general .= "<td colspan='5'>";
			$info_general .= "<b>" . __("This group doesn't have projects.") . "</b></td>";
			$info_general .= "</td>";
			$info_general .= "<td class='no_border'></td>";	
			$info_general .= "</tr>";
		}
		$title = "<img src='images/project_groups_small/" . $group["icon"] . "' style= 'float: left;'><a href='index.php?sec=projects&sec2=operation/projects/project_overview&search_id_project_group=".$group["id"]."'>".$group["name"]."</a>&nbsp; | &nbsp;".__('Nº Projects').": ".$nprojects;
		print_container('info_projects_'.$group["id"], $title, $info_general, $apertura, false, '10px', '', '', 6, 'no_border_bottom');
	}
}
if ($total_projects == 0) {
	ui_print_error_message(__('There are not projects to show.'));
}
echo "</div>";
?>
<script type="text/javascript" src="include/js/jquery.validation.functions.js"></script>
<script type="text/javascript">
	trim_element_on_submit("#text-search_text");
</script>
    $incident_sla .= format_numeric(get_sla_compliance_single_id($id));
    $incident_sla .= "</td>";
    $incident_sla .= "</tr>";
    $incident_sla .= "<tr>";
    $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>';
Пример #26
0
/**
 * Print a table with statistics of a list of incidents.
 *
 * @param array List of incidents to get stats.
 * @param bool Whether to return an output string or echo now (optional, echo by default).
 *
 * @return Incidents stats if return parameter is true. Nothing otherwise
 */
function print_incidents_stats_simply($incidents, $return = false, $simple_mode = false)
{
    global $config;
    require_once $config["homedir"] . "/include/functions_graph.php";
    $pdf_output = (int) get_parameter('pdf_output', 0);
    $ttl = $pdf_output + 1;
    // Max graph legend string length (without the '...')
    $max_legend_strlen = 17;
    // Necessary for flash graphs
    include_flash_chart_script();
    // TODO: Move this function to function_graphs to encapsulate flash
    // chart script inclusion or make calls to functions_graph when want
    // print a flash chart
    $output = '';
    $total = sizeof($incidents);
    $opened = 0;
    $total_hours = 0;
    $total_workunits = 0;
    $total_lifetime = 0;
    $max_lifetime = 0;
    $oldest_incident = false;
    $scoring_sum = 0;
    $scoring_valid = 0;
    if ($incidents === false) {
        $incidents = array();
    }
    $assigned_users = array();
    $creator_users = array();
    $submitter_label = "";
    $user_assigned_label = "";
    $incident_id_array = array();
    //Initialize incident status array
    $incident_status = array();
    $incident_status[STATUS_NEW] = 0;
    $incident_status[STATUS_UNCONFIRMED] = 0;
    $incident_status[STATUS_ASSIGNED] = 0;
    $incident_status[STATUS_REOPENED] = 0;
    $incident_status[STATUS_VERIFIED] = 0;
    $incident_status[STATUS_RESOLVED] = 0;
    $incident_status[STATUS_PENDING_THIRD_PERSON] = 0;
    $incident_status[STATUS_CLOSED] = 0;
    //Initialize priority array
    $incident_priority = array();
    $incident_priority[PRIORITY_INFORMATIVE] = 0;
    $incident_priority[PRIORITY_LOW] = 0;
    $incident_priority[PRIORITY_MEDIUM] = 0;
    $incident_priority[PRIORITY_SERIOUS] = 0;
    $incident_priority[PRIORITY_VERY_SERIOUS] = 0;
    $incident_priority[PRIORITY_MAINTENANCE] = 0;
    //Initialize status timing array
    $incident_status_timing = array();
    $incident_status_timing[STATUS_NEW] = 0;
    $incident_status_timing[STATUS_UNCONFIRMED] = 0;
    $incident_status_timing[STATUS_ASSIGNED] = 0;
    $incident_status_timing[STATUS_REOPENED] = 0;
    $incident_status_timing[STATUS_VERIFIED] = 0;
    $incident_status_timing[STATUS_RESOLVED] = 0;
    $incident_status_timing[STATUS_PENDING_THIRD_PERSON] = 0;
    $incident_status_timing[STATUS_CLOSED] = 0;
    //Initialize users time array
    $users_time = array();
    //Initialize groups time array
    $groups_time = array();
    foreach ($incidents as $incident) {
        $inc_stats = incidents_get_incident_stats($incident["id_incidencia"]);
        if ($incident['actualizacion'] != '0000-00-00 00:00:00') {
            $lifetime = $inc_stats[INCIDENT_METRIC_TOTAL_TIME];
            if ($lifetime > $max_lifetime) {
                $oldest_incident = $incident;
                $max_lifetime = $lifetime;
            }
            $total_lifetime += $lifetime;
        }
        //Complete incident status timing array
        foreach ($inc_stats[INCIDENT_METRIC_STATUS] as $key => $value) {
            $incident_status_timing[$key] += $value;
        }
        //fill users time array
        foreach ($inc_stats[INCIDENT_METRIC_USER] as $user => $time) {
            if (!isset($users_time[$user])) {
                $users_time[$user] = $time;
            } else {
                $users_time[$user] += $time;
            }
        }
        //Inidents by group time
        foreach ($inc_stats[INCIDENT_METRIC_GROUP] as $key => $time) {
            if (!isset($groups_time[$key])) {
                $groups_time[$key] = $time;
            } else {
                $groups_time[$key] += $time;
            }
        }
        //Get only id from incident filter array
        //used for filter in some functions
        array_push($incident_id_array, $incident['id_incidencia']);
        // Take count of assigned / creator users
        if (isset($assigned_users[$incident["id_usuario"]])) {
            $assigned_users[$incident["id_usuario"]]++;
        } else {
            $assigned_users[$incident["id_usuario"]] = 1;
        }
        if (isset($creator_users[$incident["id_creator"]])) {
            $creator_users[$incident["id_creator"]]++;
        } else {
            $creator_users[$incident["id_creator"]] = 1;
        }
        // Scoring avg.
        if ($incident["score"] > 0) {
            $scoring_valid++;
            $scoring_sum = $scoring_sum + $incident["score"];
        }
        $hours = get_incident_workunit_hours($incident['id_incidencia']);
        $workunits = get_incident_workunits($incident['id_incidencia']);
        $total_hours += $hours;
        $total_workunits = $total_workunits + sizeof($workunits);
        //Open incidents
        if ($incident["estado"] != 7) {
            $opened++;
        }
        //Incidents by status
        $incident_status[$incident["estado"]]++;
        //Incidents by priority
        $incident_priority[$incident["prioridad"]]++;
    }
    $closed = $total - $opened;
    $opened_pct = 0;
    $mean_work = 0;
    $mean_lifetime = 0;
    if ($total != 0) {
        $opened_pct = format_numeric($opened / $total * 100);
        $mean_work = format_numeric($total_hours / $total, 2);
    }
    $mean_lifetime = $total_lifetime / $total;
    // Get avg. scoring
    if ($scoring_valid > 0) {
        $scoring_avg = format_numeric($scoring_sum / $scoring_valid);
    } else {
        $scoring_avg = "N/A";
    }
    // Get incident SLA compliance
    $sla_compliance = get_sla_compliance($incidents);
    //Create second table
    // Find the 5 most active users (more hours worked)
    $most_active_users = array();
    if ($incident_id_array) {
        $most_active_users = get_most_active_users(8, $incident_id_array);
    }
    $users_label = '';
    $users_data = array();
    foreach ($most_active_users as $user) {
        $users_data[$user['id_user']] = $user['worked_hours'];
    }
    // Remove the items with no value
    foreach ($users_data as $key => $value) {
        if (!$value || $value <= 0) {
            unset($users_data[$key]);
        }
    }
    if (empty($most_active_users) || empty($users_data)) {
        $users_label = "<div class='container_adaptor_na_graphic2'>";
        $users_label .= graphic_error(false);
        $users_label .= __("N/A");
        $users_label .= "</div>";
    } else {
        arsort($users_data);
        $users_label .= pie3d_graph($config['flash_charts'], $users_data, 300, 150, __('others'), $config["base_url"], "", $config['font'], $config['fontsize'], $ttl);
    }
    // Find the 5 most active incidents (more worked hours)
    $most_active_incidents = get_most_active_incidents(5, $incident_id_array);
    $incidents_label = '';
    foreach ($most_active_incidents as $incident) {
        $incidents_data[$incident['id_incidencia']] = $incident['worked_hours'];
    }
    // Remove the items with no value
    foreach ($incidents_data as $key => $value) {
        if (!$value || $value <= 0) {
            unset($incidents_data[$key]);
        }
    }
    if (empty($most_active_incidents) || empty($incidents_data)) {
        $incidents_label .= graphic_error(false);
        $incidents_label .= __("N/A");
        $incidents_label = "<div class='container_adaptor_na_graphic'>" . $incidents_label . "</div>";
    } else {
        arsort($incidents_data);
        $incidents_label .= pie3d_graph($config['flash_charts'], $incidents_data, 300, 150, __('others'), $config["base_url"], "", $config['font'], $config['fontsize'], $ttl);
    }
    // TOP X creator users
    $creator_assigned_data = array();
    foreach ($creator_users as $clave => $valor) {
        $creator_assigned_data["{$clave} ({$valor})"] = $valor;
    }
    if (empty($creator_assigned_data)) {
        $submitter_label = "<div style='width:300px; height:150px;'>";
        $submitter_label .= graphic_error(false);
        $submitter_label .= __("N/A");
        $submitter_label .= "</div>";
    } else {
        arsort($creator_assigned_data);
        $submitter_label .= "<br/>" . pie3d_graph($config['flash_charts'], $creator_assigned_data, 300, 150, __('others'), $config["base_url"], "", $config['font'], $config['fontsize'], $ttl);
    }
    // TOP X scoring users
    $scoring_label = "";
    $top5_scoring = get_best_incident_scoring(5, $incident_id_array);
    foreach ($top5_scoring as $submitter) {
        $scoring_data[$submitter["id_usuario"]] = $submitter["total"];
    }
    if (empty($top5_scoring)) {
        $scoring_label .= graphic_error(false);
        $scoring_label .= __("N/A");
        $scoring_label = "<div class='container_adaptor_na_graphic2'>" . $scoring_label . "</div>";
    } else {
        arsort($scoring_data);
        $scoring_label .= "<br/>" . pie3d_graph($config['flash_charts'], $scoring_data, 300, 150, __('others'), $config["base_url"], "", $config['font'], $config['fontsize'], $ttl);
    }
    // TOP X assigned users
    $user_assigned_data = array();
    foreach ($assigned_users as $clave => $valor) {
        $user_assigned_data["{$clave} ({$valor})"] = $valor;
    }
    if (empty($user_assigned_data)) {
        $user_assigned_label = "<div style='width:300px; height:150px;'>";
        $user_assigned_label .= graphic_error(false);
        $user_assigned_label .= __("N/A");
        $user_assigned_label .= "</div>";
    } else {
        arsort($user_assigned_data);
        $user_assigned_label .= "<br/>" . pie3d_graph($config['flash_charts'], $user_assigned_data, 300, 150, __('others'), $config["base_url"], "", $config['font'], $config['fontsize'], $ttl);
    }
    // Show graph with incidents by group
    foreach ($incidents as $incident) {
        $grupo = safe_output(dame_grupo($incident["id_grupo"]));
        if (strlen($grupo) > $max_legend_strlen) {
            $grupo = substr($grupo, 0, $max_legend_strlen) . "...";
        }
        if (!isset($incident_group_data[$grupo])) {
            $incident_group_data[$grupo] = 0;
        }
        $incident_group_data[$grupo] = $incident_group_data[$grupo] + 1;
    }
    arsort($incident_group_data);
    // Show graph with incidents by source group
    foreach ($incidents as $incident) {
        $grupo_src = safe_output(dame_grupo($incident["id_group_creator"]));
        if (strlen($grupo_src) > $max_legend_strlen) {
            $grupo_src = substr($grupo_src, 0, $max_legend_strlen) . "...";
        }
        if (!isset($incident_group_data2[$grupo_src])) {
            $incident_group_data2[$grupo_src] = 0;
        }
        $incident_group_data2[$grupo_src] = $incident_group_data2[$grupo_src] + 1;
    }
    arsort($incident_group_data2);
    // Show graph with tickets open/close histogram
    $ticket_oc_graph = '<div class="pie_frame">' . graph_ticket_oc_histogram($incidents, 650, 250, $ttl) . "</div>";
    $container_title = __("Ticket Open/Close histogram");
    $container_ticket_oc = print_container('container_ticket_oc', $container_title, $ticket_oc_graph, 'open', true, true, "container_simple_title", "container_simple_div");
    // Show graph with tickets open/close histogram
    $ticket_activity_graph = '<div class="pie_frame">' . graph_ticket_activity_calendar($incidents) . "</div>";
    $container_title = __("Ticket activity");
    $container_ticket_activity = print_container('container_ticket_activity', $container_title, $ticket_activity_graph, 'open', true, true, "container_simple_title", "container_simple_div");
    //Print first table
    $output .= "<table class='listing' width=190px border=0 cellspacing=0 cellpadding=0 border=0 >";
    $output .= "<tr>";
    $output .= "<th>" . __("Metric") . "</th>";
    $output .= "<th>" . __("Value") . "</th>";
    $output .= "</tr>";
    $output .= "<tr>";
    $output .= "<td align=center><strong>" . __('Total tickets') . "</strong></td>";
    $output .= "<td valign=top align=center>";
    $output .= $total;
    $output .= "</td>";
    $output .= "</tr>";
    $output .= "<tr>";
    $output .= "<td align=center><strong>" . __('Avg. life time') . "</strong></td>";
    $output .= "<td valign=top align=center>";
    $output .= format_numeric($mean_lifetime / 86400, 2) . " " . __("Days");
    $output .= "</td>";
    $output .= "</tr>";
    $output .= "<tr>";
    $output .= "<td align=center><strong>";
    $output .= __('Avg. work time');
    $output .= "</strong></td>";
    $output .= "<td align=center>" . $mean_work . ' ' . __('Hours') . "</td>";
    $output .= "</tr>";
    $output .= "<tr>";
    $output .= "<td align=center><strong>";
    $output .= __('Avg. Scoring');
    $output .= "</strong></td>";
    $output .= "<td align=center>" . $scoring_avg . "</td>";
    $output .= "<tr>";
    $output .= "<td align=center><strong>";
    $output .= __('Total work time');
    $output .= "</strong></td>";
    $output .= "<td align=center>" . $total_hours . " " . __("Hours") . "</td>";
    $output .= "</tr>";
    $output .= "<tr>";
    $output .= "<td align=center><strong>";
    $output .= __('Total work units');
    $output .= "</strong></td>";
    $output .= "<td align=center>" . $total_workunits . "</td>";
    $output .= "</tr></table>";
    $container_title = __("Tickets statistics");
    $container_incident_statistics = print_container('container_incident_statistics', $container_title, $output, 'no', true, true, "container_simple_title", "container_simple_div");
    $output = "<div class='pie_frame'>" . $incidents_label . "</div>";
    $container_title = __("Top 5 active tickets");
    $container_top5_incidents = print_container('container_top5_incidents', $container_title, $output, 'no', true, true, "container_simple_title", "container_simple_div");
    if ($incidents) {
        $output = graph_incident_statistics_sla_compliance($incidents, 300, 150, $ttl);
    } else {
        $output = "<div style='width:300px; height:150px;'>";
        $output .= graphic_error(false);
        $output .= __("N/A");
        $output .= "</div>";
    }
    $output = "<div class='container_adaptor_graphic'>" . $output . "</div>";
    $output = "<div class='pie_frame'>" . $output . "</div>";
    $container_title = __("SLA compliance");
    $container_sla_compliance = print_container('container_sla_compliance', $container_title, $output, 'no', true, true, "container_simple_title", "container_simple_div");
    $status_aux .= "<table class='listing' style='width: 420px; margin: 10px auto;' cellspacing=0 cellpadding=0 border=0>";
    $status_aux .= "<tr>";
    $status_aux .= "<th style='text-align:center;'><strong>" . __("Status") . "</strong></th>";
    $status_aux .= "<th style='text-align:center;'><strong>" . __("Number") . "</strong></th>";
    $status_aux .= "<th style='text-align:center;'><strong>" . __("Total time") . "</strong></th>";
    $status_aux .= "</tr>";
    foreach ($incident_status as $key => $value) {
        $name = get_db_value('name', 'tincident_status', 'id', $key);
        $status_aux .= "<tr>";
        $status_aux .= "<td>" . $name . "</td>";
        $status_aux .= "<td style='text-align:center;'>" . $value . "</td>";
        $time = $incident_status_timing[$key];
        $status_aux .= "<td style='text-align:center;'>" . give_human_time($time, true, true, true) . "</td>";
        $status_aux .= "</tr>";
    }
    $status_aux .= "</table>";
    $container_title = __("Ticket by status");
    $container_status_incidents = print_container('container_status_incidents', $container_title, $status_aux, 'no', true, true, "container_simple_title", "container_simple_div");
    $priority_aux .= "<table class='listing table_priority_report' style='width: 420px;' cellspacing=0 cellpadding=0 border=0>";
    $priority_aux .= "<tr>";
    $priority_aux .= "<th style='text-align:center;'><strong>" . __("Priority") . "</strong></th>";
    $priority_aux .= "<th style='text-align:center;'><strong>" . __("Number") . "</strong></th>";
    $priority_aux .= "</tr>";
    foreach ($incident_priority as $key => $value) {
        $priority_aux .= "<tr>";
        $priority_aux .= "<td>" . get_priority_name($key) . "</td>";
        $priority_aux .= "<td style='text-align:center;'>" . $value . "</td>";
        $priority_aux .= "</tr>";
    }
    $priority_aux .= "</table>";
    $priority_aux = $priority_aux;
    $container_title = __("Tickets by priority");
    $container_priority_incidents = print_container('container_priority_incidents', $container_title, $priority_aux, 'no', true, true, "container_simple_title", "container_simple_div");
    if ($oldest_incident) {
        $oldest_incident_time = get_incident_workunit_hours($oldest_incident["id_incidencia"]);
        $output = "<table class='listing'>";
        $output .= "<th>";
        $output .= __("Metric");
        $output .= "</th>";
        $output .= "<th>";
        $output .= __("Value");
        $output .= "</th>";
        $output .= "</tr>";
        $output .= "<tr>";
        $output .= "<td>";
        $output .= "<strong>" . __("Ticket Id") . "</strong>";
        $output .= "</td>";
        $output .= "<td>";
        $output .= '<a href="index.php?sec=incidents&sec2=operation/incidents/incident_dashboard_detail&id=' . $oldest_incident['id_incidencia'] . '">#' . $oldest_incident['id_incidencia'] . "</strong></a>";
        $output .= "</td>";
        $output .= "</tr>";
        $output .= "<tr>";
        $output .= "<td>";
        $output .= "<strong>" . __("Ticket title") . "</strong>";
        $output .= "</td>";
        $output .= "<td>";
        $output .= '<a href="index.php?sec=incidents&sec2=operation/incidents/incident_dashboard_detail&id=' . $oldest_incident['id_incidencia'] . '">' . $oldest_incident['titulo'] . "</strong></a>";
        $output .= "</td>";
        $output .= "</tr>";
        $output .= "<tr>";
        $output .= "<td>";
        $output .= "<strong>" . __("Worktime hours") . "</strong>";
        $output .= "</td>";
        $output .= "<td>";
        $output .= $oldest_incident_time . " " . __("Hours");
        $output .= "</td>";
        $output .= "</tr>";
        $output .= "<tr>";
        $output .= "<td>";
        $output .= "<strong>" . __("Lifetime") . "</strong>";
        $output .= "</td>";
        $output .= "<td>";
        $output .= format_numeric($max_lifetime / 86400) . " " . __("Days");
        $output .= "</td>";
        $output .= "</tr>";
        $output .= "</table>";
    } else {
        $output = graphic_error(false);
        $output .= __("N/A");
    }
    $output_aux = "<div style='width:100%; height:170px;'>";
    $output_aux .= $output;
    $output_aux .= "</div>";
    $container_title = __("Longest closed ticket");
    $container_longest_closed = print_container('container_longest_closed', $container_title, $output_aux, 'no', true, true, "container_simple_title", "container_simple_div");
    $data = array(__('Open') => $opened, __('Closed') => $total - $opened);
    $data = array(__('Close') => $total - $opened, __('Open') => $opened);
    $output = pie3d_graph($config['flash_charts'], $data, 300, 150, __('others'), $config["base_url"], "", $config['font'], $config['fontsize'], $ttl);
    $output = "<div class='pie_frame'>" . $output . "</div>";
    $container_title = __("Open / Close ticket");
    $container_openclose_incidents = print_container('container_openclose_incidents', $container_title, $output, 'no', true, true, "container_simple_title", "container_simple_div");
    $clean_output = get_parameter("clean_output");
    $container_title = __("Top active users");
    $output = "<div class='pie_frame'>" . $users_label . "</div>";
    $container_topactive_users = print_container('container_topactive_users', $container_title, $output, 'no', true, true, "container_simple_title", "container_simple_div");
    $container_title = __("Top ticket submitters");
    $output = "<div class='pie_frame'>" . $submitter_label . "</div>";
    $container_topincident_submitter = print_container('container_topincident_submitter', $container_title, $output, 'no', true, true, "container_simple_title", "container_simple_div");
    $container_title = __("Top assigned users");
    $output = "<div class='pie_frame'>" . $user_assigned_label . "</div>";
    $container_user_assigned = print_container('container_user_assigned', $container_title, $output, 'no', true, true, "container_simple_title", "container_simple_div");
    $container_title = __("Tickets by group");
    $output = "<br/>" . pie3d_graph($config['flash_charts'], $incident_group_data, 300, 150, __('others'), $config["base_url"], "", $config['font'], $config['fontsize'] - 1, $ttl);
    $output = "<div class='pie_frame'>" . $output . "</div>";
    $container_incidents_group = print_container('container_incidents_group', $container_title, $output, 'no', true, true, "container_simple_title", "container_simple_div");
    $container_title = __("Tickets by creator group");
    $output = "<br/>" . pie3d_graph($config['flash_charts'], $incident_group_data2, 300, 150, __('others'), $config["base_url"], "", $config['font'], $config['fontsize'] - 1, $ttl);
    $output = "<div class='pie_frame'>" . $output . "</div>";
    $container_incident_creator_group = print_container('container_incident_creator_group', $container_title, $output, 'no', true, true, "container_simple_title", "container_simple_div");
    $container_title = __("Top 5 average scoring by user");
    $output = "<div class='pie_frame'>" . $scoring_label . "</div>";
    $container_top5_scoring = print_container('container_top5_scoring', $container_title, $output, 'no', true, true, "container_simple_title", "container_simple_div");
    //Print second table
    $output = "<table class='listing' style='width: 320px; margin: 10px auto'>";
    $output .= "<tr>";
    $output .= "<th style='text-align:center;'><strong>" . __("Group") . "</strong></th>";
    $output .= "<th style='text-align:center;'><strong>" . __("Time") . "</strong></th>";
    $output .= "</tr>";
    $count = 1;
    arsort($groups_time);
    foreach ($groups_time as $key => $value) {
        //Only show first 5
        if ($count == 5) {
            break;
        }
        $output .= "<tr>";
        $group_name = get_db_value('nombre', 'tgrupo', 'id_grupo', $key);
        $output .= "<td>" . $group_name . "</td>";
        $output .= "<td style='text-align: center'>" . give_human_time($value, true, true, true) . "</td>";
        $output .= "</tr>";
        $count++;
    }
    $output .= "</table>";
    $output .= '<br>';
    $output .= '<br>';
    $container_title = __("Top 5 group by time");
    $container_top5_group_time = print_container('container_top5_group_time', $container_title, $output, 'no', true, true, "container_simple_title", "container_simple_div");
    $output = "<table class='listing' style='width: 420px; margin: 10px'>";
    $output .= "<tr>";
    $output .= "<th style='text-align:center;'><strong>" . __("User") . "</strong></th>";
    $output .= "<th style='text-align:center;'><strong>" . __("Time") . "</strong></th>";
    $output .= "</tr>";
    $count = 1;
    arsort($users_time);
    foreach ($users_time as $key => $value) {
        //Only show first 5
        if ($count == 5) {
            break;
        }
        $output .= "<tr>";
        $user_real = get_db_value('nombre_real', 'tusuario', 'id_usuario', $key);
        $output .= "<td>" . $user_real . "</td>";
        $output .= "<td style='text-align: center'>" . give_human_time($value, true, true, true) . "</td>";
        $output .= "</tr>";
        $count++;
    }
    $output .= "</table>";
    $output .= "</table>";
    $container_title = __("Top 5 users by time");
    $container_top5_user_time = print_container('container_top5_user_time', $container_title, $output, 'no', true, true, "container_simple_title", "container_simple_div");
    if ($simple_mode) {
        // First row
        echo $container_incidents_group;
        echo $container_topincident_submitter;
        echo $container_user_assigned;
        // Second row
        echo $container_incident_statistics;
        echo $container_top5_group_time;
        echo $container_sla_compliance;
    } else {
        // First row
        echo $container_incidents_group;
        echo $container_topincident_submitter;
        echo $container_user_assigned;
        // Second row
        echo $container_incident_statistics;
        echo $container_top5_group_time;
        echo $container_sla_compliance;
        echo '<br><br>';
        // Third row
        echo $container_status_incidents;
        echo $container_priority_incidents;
        //Fourth row
        echo $container_topactive_users;
        echo $container_top5_incidents;
        echo $container_openclose_incidents;
        echo '<br><br><br>';
        //~ // Fifth row
        echo $container_ticket_oc;
        echo '<br><br><br><br><br><br><br><br><br><br><br><br>';
        //~ // Sixth row
        echo $container_ticket_activity;
    }
}
Пример #27
0
		$count_priority = 0;
	} else {
		$count_priority = $rows[$db_priority];
	}

	$search_by_priority .= $count_priority;

	$search_by_priority .= "</a>";
	$search_by_priority .= "</td>";
}

$search_by_priority .="</tr>";

$search_by_priority .= "</table>";

$right_side .= print_container('incident_search_by_priority', __('Search by priority'), $search_by_priority);

$table->data[1][0] = $left_side;
$table->data[1][1] = $right_side;

print_table($table);

?>

<script type="text/javascript">
$('.incident_container h2').click(function() {
	var arrow = $('#' + $(this).attr('id') + ' img').attr('src');
	var arrow_class = $('#' + $(this).attr('id') + ' img').attr('class');
	var new_arrow = '';
	
	if (arrow_class == 'arrow_down') {
Пример #28
0
$result = mysql_query($sql1);
$color = 1;
while ($row = mysql_fetch_array($result)) {
    if ($color == 1) {
        $tdcolor = "datos";
        $color = 0;
    } else {
        $tdcolor = "datos2";
        $color = 1;
    }
    $roles .= "<tr><td valign='top' class='{$tdcolor}'><b>" . $row["name"] . "</b>";
    $roles .= '<td valign="top" class="' . $tdcolor . '">' . $row["description"];
    $roles .= '<td valign="top" class="' . $tdcolor . '" align="center">' . $row["cost"];
}
$roles .= "</table>";
print_container('people_roles', __('Available roles'), $roles, 'closed', false, '10px');
?>

<script type="text/javascript" src="include/js/jquery.ui.autocomplete.js"></script>

<script type="text/javascript" >
$(document).ready (function () {
	$("#textarea-description").TextAreaResizer ();
	
	var idUser = "******";
	var idProject = "<?php 
echo $id_project;
?>
Пример #29
0
    /**
     * Given an old page version, output the version content
     *
     * @global object $CFG
     * @global object $OUTPUT
     * @global object $PAGE
     */
    private function print_version_view() {
        global $CFG, $OUTPUT, $PAGE;
        $pageversion = wiki_get_version($this->version->id);

        if ($pageversion) {
            $restorelink = new moodle_url('/mod/wiki/restoreversion.php', array('pageid' => $this->page->id, 'versionid' => $this->version->id));
            echo $OUTPUT->heading(get_string('viewversion', 'wiki', $pageversion->version) . '<br />' . html_writer::link($restorelink->out(false), '(' . get_string('restorethis', 'wiki') . ')', array('class' => 'wiki_restore')) . '&nbsp;', 4);
            $userinfo = wiki_get_user_info($pageversion->userid);
            $heading = '<p><strong>' . get_string('modified', 'wiki') . ':</strong>&nbsp;' . userdate($pageversion->timecreated, get_string('strftimedatetime', 'langconfig'));
            $viewlink = new moodle_url('/user/view.php', array('id' => $userinfo->id));
            $heading .= '&nbsp;&nbsp;&nbsp;<strong>' . get_string('user') . ':</strong>&nbsp;' . html_writer::link($viewlink->out(false), fullname($userinfo));
            $heading .= '&nbsp;&nbsp;&rarr;&nbsp;' . $OUTPUT->user_picture(wiki_get_user_info($pageversion->userid), array('popup' => true)) . '</p>';
            print_container($heading, false, 'mdl-align wiki_modifieduser wiki_headingtime');
            $options = array('swid' => $this->subwiki->id, 'pretty_print' => true, 'pageid' => $this->page->id);

            $pageversion->content = file_rewrite_pluginfile_urls($pageversion->content, 'pluginfile.php', $this->modcontext->id, 'mod_wiki', 'attachments', $this->subwiki->id);

            $parseroutput = wiki_parse_content($pageversion->contentformat, $pageversion->content, $options);
            $content = print_container(format_text($parseroutput['parsed_text'], FORMAT_HTML, array('overflowdiv'=>true)), false, '', '', true);
            echo $OUTPUT->box($content, 'generalbox wiki_contentbox');

        } else {
            print_error('versionerror', 'wiki');
        }
    }
Пример #30
0
$table_advanced .= "<td style='text-align:left;'>" .  print_select ($links_0, 'link_0', NULL,
								'', '', '', true, false, false, __('Finish to start').$hint);
$table_advanced .= "&nbsp;&nbsp;<a href='javascript: show_task_link_selector(0,".$id_project.",".$id_task.");'>" . print_image('images/add.png', true, array('title' => __('Add'))) . "</a>";
$table_advanced .= "&nbsp;&nbsp;<a href='javascript: remove_link(0);'>" . print_image('images/cross.png', true, array('title' => __('Remove'))) . "</a>";

$links_2 = projects_get_task_links ($id_project, $id_task, 2);

$hint = print_help_tip (__("The task cannot end before all tasks in this section end, although it may end later"), true);
$table_advanced .= "<td style='text-align:left;'>" .  print_select ($links_2, 'link_2', NULL,
								'', '', '', true, false, false, __('Finish to finish').$hint);
$table_advanced .= "&nbsp;&nbsp;<a href='javascript: show_task_link_selector(2,".$id_project.",".$id_task.");'>" . print_image('images/add.png', true, array('title' => __('Add'))) . "</a>";
$table_advanced .= "&nbsp;&nbsp;<a href='javascript: remove_link(2);'>" . print_image('images/cross.png', true, array('title' => __('Remove'))) . "</a>";

$table->colspan['row_links'][0] = 3;
$table->style['row_links'] = 'margin-top: 10px;';
$table->data['row_links'][0] = print_container('task_links', __('Task links'), $table_advanced, 'open', true, '10px', '', '', 2, 'no_border_bottom " style="width: 99%;"');

$table->colspan[5][0] = 3;
$table->data[5][0] = print_textarea ('description', 8, 30, $description, '',
	true, __('Description'));

print_table ($table);

$button = '';
echo '<div class="button-form" style="width:100%;">';
if (($operation != "create" && $task_permission['manage']) || $operation == "create") {
	unset($table->data);
	$table->width = '100%';
	$table->class = "button-form";
	if ($operation != "create") {