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'); $table->head[1] = __('User'); $table->head[2] = __('Date'); $table->style[2] = "width: 150px"; foreach ($trackings as $tracking) { $data = array ();
function combo_users_task($id_task, $icon_list = false, $return = false) { global $config; // Show only users assigned to this project $task_users = get_db_all_rows_field_filter('trole_people_task', 'id_task', $id_task); $visible_users = get_user_visible_users($config["id_user"], 'PR', true); $users = array(); if ($task_users) { foreach ($task_users as $user) { if (isset($visible_users[$user['id_user']])) { if ($icon_list) { array_push($users, $user); } else { $users[$user['id_user']] = $user['id_user']; } } } } $output = ''; if (!$icon_list) { $output .= print_select($users, 'user', '', '', '', '', true, 0, true, false, false, "width:100px"); } else { $text = __('Users') . ':<br />'; $users_size = count($users); $count = 0; foreach ($users as $user) { $count++; $text .= $user["id_user"]; if ($count < $users_size) { $text .= ", "; } } $output .= print_help_tip($text, true, 'tip_people'); } if ($return) { return $output; } echo $output; }
function print_project_timegraph($id_project, $start_date = false, $end_date = false, $id_user_filter = "") { if ($id_user_filter == "") { $users = get_users_project($id_project); } else { $sql = "SELECT *\n FROM trole_people_project\n WHERE id_project = {$id_project} AND id_user = '******'"; $users = get_db_all_rows_sql($sql); } $tasks = get_db_all_rows_field_filter('ttask', 'id_project', $id_project); $data = array(); foreach ($tasks as $task) { foreach ($users as $user) { $user_name = get_db_value('nombre_real', 'tusuario', 'id_usuario', $user['id_user']); $hours = get_task_workunit_hours_user($task['id'], $user['id_user'], 0, $start_date, $end_date); if (empty($hours)) { continue; } $data[$task['id']][$user['id_user']] = array('parent_name' => safe_output($task['name']), 'name' => safe_output($user_name), 'value' => $hours, 'tooltip' => "<b>" . __('Task:') . "</b> " . $task['name'] . "<br />" . "<b>" . __('User:'******'Hours:') . "</b> " . $hours, 'id' => $task['id'] . "_" . $user['id_user']); } } if (empty($data)) { ui_print_error_message(__('There are not tasks with hours in this period.')); return; } graph_print_d3js_treemap($data); }
$sql = sprintf ('DELETE FROM tobject_type_field WHERE id = %d', $id_object_type_field); $result = process_sql ($sql); if ($result) echo ui_print_success_message (__("Successfully deleted"), '', true, 'h3', true); else echo ui_print_error_message (__("Could not be deleted"), '', true, 'h3', true); $id = 0; } //********************************************************************** // List fields //********************************************************************** $objects_type_fields = get_db_all_rows_field_filter ('tobject_type_field', 'id_object_type', $id_object_type, 'id'); $table = new StdClass; $table->width = '99%'; echo '<div class="divresult">'; if ($objects_type_fields !== false) { //echo "<h3>".__('Defined objects types fields')."</h3>"; $table->class = 'listing'; $table->data = array (); $table->head = array (); $table->head[0] = __('Label'); $table->head[1] = __('Type'); $table->head[2] = __('Unique'); $table->head[3] = __('Inherit'); $table->head[4] = __('Show in list');
// but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. check_login(); include_once "include/functions_projects.php"; $id = (int) get_parameter('id_project'); $project = get_db_row('tproject', 'id', $id); $project_access = get_project_access($config['id_user'], $project['id']); // ACL - To see the project, you should have read access if ($project === false || !$project_access['read']) { // Doesn't have access to this page audit_db($config['id_user'], $config["REMOTE_ADDR"], "ACL Violation", "Trying to access project " . $id); no_permission(); } echo '<h1>' . __('Project tracking') . ' » ' . $project['name'] . '</h1>'; $trackings = get_db_all_rows_field_filter('tproject_track', 'id_project', $id); if ($trackings !== false) { $table->width = "99%"; $table->class = 'listing'; $table->data = array(); $table->head = array(); $table->head[1] = __('Description'); $table->head[2] = __('User'); $table->head[3] = __('Date'); foreach ($trackings as $tracking) { $data = array(); $data[0] = get_project_tracking_state($tracking['state']); $data[1] = dame_nombre_real($tracking['id_user']); $data[2] = $tracking['timestamp']; array_push($table->data, $data); }
function user_get_projects($id_user) { $return = get_db_all_rows_field_filter('trole_people_project', 'id_user', $id_user); if (empty($return)) { return array(); } else { return $return; } }
function get_incident_tracking($id_incident) { return get_db_all_rows_field_filter('tincident_track', 'id_incident', $id_incident); }
function crm_get_contract_files($id_contract, $order_desc = false) { if ($order_desc) { $order = "id_attachment DESC"; } else { $order = ""; } return get_db_all_rows_field_filter('tattachment', 'id_contract', $id_contract, $order); }
$read_permission = inventory_check_acl($config['id_user'], $id); if (!$read_permission) { audit_db($config['id_user'], $config["REMOTE_ADDR"], "ACL Violation", "Trying to access to inventory " . $id); include "general/error_perms.php"; exit; } } //********************************************************************** // Tabs //********************************************************************** print_inventory_tabs('tracking', $id, $inventory_name); if (!$id) { require "general/noaccess.php"; exit; } $trackings = get_db_all_rows_field_filter('tinventory_track', 'id_inventory', $id, 'timestamp DESC'); if ($trackings !== false) { $table->width = "99%"; $table->class = 'listing'; $table->data = array(); $table->head = array(); $table->head[1] = __('Description'); $table->head[2] = __('User'); $table->head[3] = __('Date'); foreach ($trackings as $tracking) { $data = array(); $data[0] = $tracking['description']; $data[1] = dame_nombre_real($tracking['id_user']); $data[2] = $tracking['timestamp']; array_push($table->data, $data); }
echo $category; echo "<td align=right>"; if (give_acl($config["id_user"], 0, "KW")) { echo "<a href='index.php?sec=kb&sec2=operation/kb/manage_data&update=" . $kb_data['id'] . "'><img border=0 title='" . __('Edit') . "' src='images/application_edit.png'></a>"; } echo "</table>"; echo "</div>"; // Body echo "<div class='notebody'>"; echo "<table class='blank' width='100%' cellpadding=0 cellspacing=0>"; echo "<tr><td valign='top'>"; echo clean_output_breaks($data); echo "</table>"; echo "</div>"; // Show list of attachments $attachments = get_db_all_rows_field_filter('tattachment', 'id_kb', $id, 'description'); if ($attachments !== false && $id) { echo '<h3>' . __('Attachment list') . '</h3>'; $table->width = '735'; $table->class = 'listing'; $table->data = array(); $table->head = array(); $table->head[0] = __('Filename'); $table->head[1] = __('Description'); foreach ($attachments as $attachment) { $data = array(); $attach_id = $attachment['id_attachment']; $link = 'operation/common/download_file.php?type=kb&id_attachment=' . $attachment['id_attachment']; $data[0] = '<a href="' . $link . '" title="' . $attachment['description'] . '">'; $data[0] .= '<img src="images/disk.png"/> '; $data[0] .= $attachment['filename'];