true, 'text' => '' . html_print_image("images/list.png", true, array ("title" => __('Graph list'))) .''); if ($enterpriseEnable) { $buttons = reporting_enterprise_add_template_graph_tabs($buttons); } $subsection = ''; switch ($activeTab) { case 'main': $buttons['graph_list']['active'] = true; $subsection = ' » '.__('Graph list'); break; default: $subsection = reporting_enterprise_add_graph_template_subsection($activeTab, $buttons); break; } switch ($activeTab) { case 'main': require_once('godmode/reporting/graphs.php'); break; default: reporting_enterprise_select_graph_template_tab($activeTab); break; } $buttons['graph_container'] = array('active' => false, 'text' => '' . html_print_image("images/graph-container.png", true, array ("title" => __('Graphs containers'))) .''); $delete_graph = (bool) get_parameter ('delete_graph'); $view_graph = (bool) get_parameter ('view_graph'); $id = (int) get_parameter ('id'); $multiple_delete = (bool)get_parameter('multiple_delete', 0); // Header ui_print_page_header (__('Reporting')." » ".__('Custom graphs'), "images/chart.png", false, "", false, $buttons); // Delete module SQL code if ($delete_graph) { if ( $report_w || $report_m ) { $exist = db_get_value("id_graph", "tgraph_source", "id_graph", $id); if ($exist) { $result = db_process_sql_delete("tgraph_source", array('id_graph' =>$id)); if ($result) $result = ui_print_success_message(__('Successfully deleted')); else $result = ui_print_error_message(__('Not deleted. Error deleting data')); } $result = db_process_sql_delete("tgraph", array('id_graph' =>$id)); if ($result) { db_pandora_audit("Report management", "Delete graph #$id"); $result = ui_print_success_message(__('Successfully deleted')); } else { db_pandora_audit("Report management", "Fail try to delete graph #$id"); $result = ui_print_error_message(__('Not deleted. Error deleting data')); } echo $result; } else { db_pandora_audit("ACL Violation","Trying to delete a graph from access graph builder"); include ("general/noaccess.php"); exit; } } if ($multiple_delete) { $ids = (array)get_parameter('delete_multiple', array()); foreach ($ids as $id) { $result = db_process_sql_delete ('tgraph', array('id_graph' => $id)); if ($result === false) { break; } } if ($result !== false) $result = true; else $result = false; $str_ids = implode (',', $ids); if ($result) { db_pandora_audit("Report management", "Multiple delete graph: $str_ids"); } else { db_pandora_audit("Report management", "Fail try to delete graphs: $str_ids"); } ui_print_result_message ($result, __('Successfully deleted'), __('Not deleted. Error deleting data')); } $graphs = custom_graphs_get_user ($config['id_user'], false, true, $access); $offset = (int) get_parameter ("offset"); ui_pagination (count($graphs)); if (!empty ($graphs)) { $table = new stdClass(); $table->width = '100%'; $table->class = 'databox data'; $table->align = array (); $table->head = array (); $table->head[0] = __('Graph name'); $table->head[1] = __('Description'); $table->head[2] = __('Number of Graphs'); $table->head[3] = __('Group'); $table->size[0] = '30%'; $table->size[2] = '200px'; $table->size[3] = '200px'; $table->align[2] = 'left'; $table->align[3] = 'left'; $op_column = false; if ($report_w || $report_m) { $op_column = true; $table->align[4] = 'left'; $table->head[4] = __('Op.') . html_print_checkbox('all_delete', 0, false, true, false, 'check_all_checkboxes();'); $table->size[4] = '90px'; } $table->data = array (); $result_graphs = array_slice($graphs, $offset, $config['block_size']); foreach ($result_graphs as $graph) { $data = array (); $data[0] = '' . ui_print_truncate_text($graph['name'], 70) . ''; $data[1] = ui_print_truncate_text($graph["description"], 70); $data[2] = $graph["graphs_count"]; $data[3] = ui_print_group_icon($graph['id_group'],true); $data[4] = ''; if (($report_w || $report_m) && $manage_group_all) { $data[4] = ''.html_print_image("images/config.png", true).''; } $data[4] .= ' '; if ($report_m && $manage_group_all) { $data[4] .= '' . html_print_image("images/cross.png", true, array('alt' => __('Delete'), 'title' => __('Delete'))) . '' . html_print_checkbox_extended ('delete_multiple[]', $graph['id_graph'], false, false, '', 'class="check_delete" style="margin-left:2px;"', true); } array_push ($table->data, $data); } if (!empty($result_graphs)){ echo "
"; } echo "