function dbmgr_main() { echo '<link rel="stylesheet" href="include/styles/dbmanager.css" type="text/css" />'; $sql = (string) get_parameter('sql'); $clean_output = get_parameter("clean_output", 0); if ($clean_output == 0) { echo "<h1>" . __('Extensions') . " » " . __('Database interface'); $html_report_image = print_html_report_image("index.php?sec=godmode&sec2=godmode/setup/dbmanager&sql={$sql}", __("Report")); if ($html_report_image) { echo " " . $html_report_image; } echo "</h1>"; echo '<div class="note_simple">'; echo __("This is an advanced extension to interface with Integria IMS database directly using native SQL sentences. Please note that <b>you can damage</b> your Integria IMS installation if you don't know </b>exactly</b> what are you doing, this means that you can severily damage your setup using this extension. This extension is intended to be used <b>only by experienced users</b> with a depth knowledgue of Integria IMS."); echo '</div>'; echo "<br />"; echo __("Some samples of usage:") . " <blockquote><em>SHOW STATUS;<br />DESCRIBE tincidencia<br />SELECT * FROM tincidencia<br />UPDATE tincidencia SET sla_disabled = 1 WHERE inicio < '2010-01-10 00:00:00';</em></blockquote>"; echo "<br /><br />"; echo "<form method='post' action=''>"; print_textarea('sql', 5, 50, html_entity_decode($sql, ENT_QUOTES)); echo "<div style='width: 99%; text-align: right; margin-top: 6px;'>"; print_submit_button(__('Execute SQL'), '', false, 'class="sub next"'); echo "</div>"; echo "</form>"; } else { echo "<form method='post' action=''>"; print_textarea('sql', 2, 40, html_entity_decode($sql, ENT_QUOTES)); echo "<div style='width: 99%; text-align: right; margin-top: 6px;'>"; print_submit_button(__('Execute SQL'), '', false, 'class="sub next"'); echo "</div>"; echo "</form>"; } // Processing SQL Code if ($sql == '') { return; } echo "<br />"; echo "<hr />"; echo "<br />"; $error = ''; $result = dbmanager_query($sql, $error); if ($result === false) { echo '<strong>An error has occured when querying the database.</strong><br />'; echo $error; return; } if (!is_array($result)) { echo "<strong>Output: <strong>" . $result; return; } $table->width = '90%'; $table->class = 'dbmanager'; $table->head = array_keys($result[0]); $table->data = $result; print_table($table); }
exit; } echo "<h2>".__('Annual report')."</h2>"; echo "<h4>".__('For user').": ". $id_user_show; echo "<div id='button-bar-title'><ul>"; if ($clean_output == 0) { // link full screen if ($pure) { $html_report_image = print_html_report_image ("index.php?sec=users&sec2=operation/user_report/report_annual&id_user=$id_user_show&year=$year", __("Full screen"), "", array("pure" => 0)); } else { $html_report_image = print_html_report_image ("index.php?sec=users&sec2=operation/user_report/report_annual&id_user=$id_user_show&year=$year", __("Full screen"), "", array("pure" => 1)); if ($html_report_image) { echo "<li>" . $html_report_image . "</li>"; } // link PDF report $report_image = print_report_image ("index.php?sec=users&sec2=operation/user_report/report_annual&id_user=$id_user_show&year=$year", __("PDF report")); if ($report_image) { echo "<li>" . $report_image . "</li>"; } } } echo "</ul>"; echo "</div>";
$table->head[0] = __('Name/Edit'); $table->head[1] = __('View'); $table->head[2] = __('PDF'); $table->head[3] = __('CSV'); $table->head[4] = __('Delete'); $table->size = array(); foreach ($reports as $report) { $data = array(); if (dame_admin($config['id_user'])) { $data[0] = '<a href="index.php?sec=users&sec2=operation/inventories/inventory_reports_detail&id=' . $report['id'] . '">'; $data[0] .= $report['name']; $data[0] .= '</a>'; } else { $data[0] .= $report['name']; } $data[1] = print_html_report_image("index.php?sec=users&sec2=operation/inventories/inventory_reports_detail&render_html=1&id=" . $report['id'], __("HTML report")); $data[2] = print_report_image("index.php?sec=users&sec2=operation/inventories/inventory_reports_detail&render_html=1&id=" . $report['id'], __("PDF report")); $data[3] = "<a href='index.php?sec=users&sec2=operation/inventories/inventory_reports_detail&render=1&raw_output=1&clean_output=1&id=" . $report['id'] . "'><img src='images/binary.png'></a>"; $data[4] = "<a href='index.php?sec=users&sec2=operation/inventories/inventory_reports&delete_report=1&id=" . $report["id"] . "'>"; $data[4] .= '<img src="images/cross.png">'; $data[4] .= '</a>'; array_push($table->data, $data); } print_table($table); } echo '<form method="post" action="index.php?sec=users&sec2=operation/inventories/inventory_reports_detail">'; echo '<div class="button" style="width: 99%">'; if (dame_admin($config['id_user'])) { print_submit_button(__('Create'), 'new_btn', false, 'class="sub create"'); } echo '</div>';
audit_db($id_user, $config["REMOTE_ADDR"], "ACL Violation", "Trying to access to another user yearly report without proper rights"); include "general/noaccess.php"; exit; } // Extended ACL check for project manager // TODO - Move to enteprrise, encapsulate in a general function $users = get_user_visible_users(); if ($id_user_show == "" || $id_user_show != $config["id_user"] && !in_array($id_user_show, array_keys($users))) { audit_db("Noauth", $config["REMOTE_ADDR"], "No permission access", "Trying to access user workunit report"); require "general/noaccess.php"; exit; } echo "<h1>" . __('Annual report for user') . " " . $id_user_show; if ($clean_output == 0) { // link full screen $html_report_image = print_html_report_image("index.php?sec=users&sec2=operation/user_report/report_annual&id_user={$id_user_show}&year={$year}", __("Full screen")); if ($html_report_image) { echo " " . $html_report_image; } // link PDF report $report_image = print_report_image("index.php?sec=users&sec2=operation/user_report/report_annual&id_user={$id_user_show}&year={$year}", __("PDF report")); if ($report_image) { echo " " . $report_image; } } echo "</h1>"; echo "<table class='search-table' width=99% style='text-align:right;'><tr><td>"; echo "<table style='margin: 0px auto; '><tr>"; echo "<td style='text-align:right;'>"; echo "<a href='index.php?sec=users&sec2=operation/user_report/annual_workunits&operation=show_vacations&year={$year}&id_user={$id_user_show}'>" . __('Vacations days') . '</a>'; echo "<td class='day_vacation day_legend'>";
WHERE id = %d', $target_project, $id_task); process_sql($sql); // Move subtasks of this task $sql = sprintf('UPDATE ttask SET id_project = %d WHERE id_parent_task = %d', $target_project, $id_task); process_sql($sql); task_tracking($id_task, TASK_MOVED); } else { no_permission(); } } // MAIN LIST OF TASKS $search_text = (string) get_parameter('search_text', ''); echo '<h1>' . $project['name'] . ' » ' . __('Task management'); if (!$clean_output) { $html_report_image = print_html_report_image("index.php?sec=projects&sec2=operation/projects/task&id_project={$id_project}&search_text={$search_text}", __("Report")); if ($html_report_image) { echo " " . $html_report_image; } } echo '</h1>'; $where_clause = ' 1=1 '; if ($search_text != "") { $where_clause .= sprintf(' AND name LIKE "%%%s%%" OR description LIKE "%%%s%%"', $search_text, $search_text); } // DON'T DELETE THIS YET - TEMPORARILY COMMENTED //~ $table->width = '400px'; //~ $table->class = 'search-table'; //~ $table->style = array (); //~ $table->style[0] = 'font-weight: bold;'; //~ $table->style[2] = 'font-weight: bold;';
} if ($user_id != ""){ $do_search = 1; } echo "<h2>" . __("Full report") . "</h2>"; echo "<h4>"; if ($user_id != "") { echo dame_nombre_real ($user_id); } if ($clean_output == 0){ // link full screen if($render_resolution == 0){ $html_report_image = print_html_report_image ("index.php?sec=users&sec2=operation/user_report/report_full&render_resolution=1&user_id=$user_id&end_date=$end_date&start_date=$start_date&incident_resolution=$resolution&search_id_group=$id_group&author=$author&editor=$editor&search_status=$status&only_projects=$only_projects", __("Full screen"), "", "", 1); if ($html_report_image) { echo " " . $html_report_image; } // link PDF report $report_image = print_report_image ("index.php?sec=users&sec2=operation/user_report/report_full&user_id=$user_id&end_date=$end_date&start_date=$start_date&incident_resolution=$resolution&search_id_group=$id_group&author=$author&editor=$editor&search_status=$status&only_projects=$only_projects", __("PDF report")); if ($report_image) { echo " " . $report_image; } } if($render_resolution == 1){ echo "<a style='float:right;' href='index.php?sec=users&sec2=operation/user_report/report_full&user_id=$user_id'>".print_image ("images/flecha_volver.png", true, array("title" => __("Back to full report")))."</a>"; } }
audit_db($id_user, $config["REMOTE_ADDR"], "ACL Violation", "Trying to delete WU {$id_workunit} without rigths"); include "general/noaccess.php"; exit; } } // -------------------- // Workunit report // -------------------- $ahora = date("Y-m-d H:i:s"); if ($timestamp_h == "") { $timestamp_h == $ahora; } echo "<h1>"; echo __('Workunit personal report for user'); echo " '" . dame_nombre_real($id_user) . "'."; $html_report_image = print_html_report_image("index.php?sec=users&sec2=operation/users/user_workunit_report×tamp_l={$timestamp_l}×tamp_h={$timestamp_h}&id={$id_user}&id_task={$id_task}", __("Report")); if ($html_report_image) { echo " " . $html_report_image; } echo "</h1>"; echo "<div class='under_tabs_info'>"; echo __("Between dates"); echo ": "; if ($timestamp_l != "" and $timestamp_h != "") { echo " : " . $timestamp_l . " " . __("to") . " " . $timestamp_h; } if ($id_task != 0) { echo "<br>" . __("Task") . " : " . get_db_sql("SELECT name FROM ttask WHERE id = {$id_task}"); } echo "</div><br>"; if ($id_workunit != -1) {