2013-11-19 Juan Manuel Ramon <juanmanuel.ramon@artica.es>
* godmode/reporting/reporting_builder.php: Fix filter groups of reports. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@9095 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
4a3343b8fc
commit
20b6a46055
|
@ -1,3 +1,8 @@
|
||||||
|
2013-11-19 Juan Manuel Ramon <juanmanuel.ramon@artica.es>
|
||||||
|
|
||||||
|
* godmode/reporting/reporting_builder.php: Fix filter groups
|
||||||
|
of reports.
|
||||||
|
|
||||||
2013-11-18 Sergio Martin <sergio.martin@artica.es>
|
2013-11-18 Sergio Martin <sergio.martin@artica.es>
|
||||||
|
|
||||||
* images/status_sets/default/server_ok.png: Change the
|
* images/status_sets/default/server_ok.png: Change the
|
||||||
|
|
|
@ -55,7 +55,12 @@ if ($idReport != 0) {
|
||||||
$edit = false;
|
$edit = false;
|
||||||
switch ($type_access_selected) {
|
switch ($type_access_selected) {
|
||||||
case 'group_view':
|
case 'group_view':
|
||||||
$edit = check_acl($config['id_user'], $report['id_group'], "RW");
|
## Workaround for user without RW,RM flags that want to delete reports
|
||||||
|
$delete_report_wa = get_parameter('action', 'none');
|
||||||
|
if ($delete_report_wa === 'delete_report')
|
||||||
|
$edit = check_acl($config['id_user'], $report['id_group'], "RR");
|
||||||
|
else
|
||||||
|
$edit = check_acl($config['id_user'], $report['id_group'], "RW");
|
||||||
break;
|
break;
|
||||||
case 'group_edit':
|
case 'group_edit':
|
||||||
$edit = check_acl($config['id_user'], $report['id_group_edit'], "RW");
|
$edit = check_acl($config['id_user'], $report['id_group_edit'], "RW");
|
||||||
|
@ -336,6 +341,17 @@ switch ($action) {
|
||||||
'order' => 'name'
|
'order' => 'name'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Fix : group filter was not working
|
||||||
|
// Show only selected groups
|
||||||
|
if ($id_group > 0) {
|
||||||
|
$group = array("$id_group" => $id_group);
|
||||||
|
$filter['id_group'] = $id_group;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$group = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Filter normal and metaconsole reports
|
// Filter normal and metaconsole reports
|
||||||
if ($config['metaconsole'] == 1 and defined('METACONSOLE'))
|
if ($config['metaconsole'] == 1 and defined('METACONSOLE'))
|
||||||
|
@ -346,6 +362,7 @@ switch ($action) {
|
||||||
$reports = reports_get_reports ($filter,
|
$reports = reports_get_reports ($filter,
|
||||||
array ('name', 'id_report', 'description', 'private',
|
array ('name', 'id_report', 'description', 'private',
|
||||||
'id_user', 'id_group'), $return_all_group, 'RR', $group);
|
'id_user', 'id_group'), $return_all_group, 'RR', $group);
|
||||||
|
|
||||||
$table->width = '0px';
|
$table->width = '0px';
|
||||||
if (sizeof ($reports)) {
|
if (sizeof ($reports)) {
|
||||||
$table->id = 'report_list';
|
$table->id = 'report_list';
|
||||||
|
@ -382,6 +399,15 @@ switch ($action) {
|
||||||
$table->size[$next] = '80px';
|
$table->size[$next] = '80px';
|
||||||
$table->style[$next] = 'text-align:center;';
|
$table->style[$next] = 'text-align:center;';
|
||||||
|
|
||||||
|
}
|
||||||
|
## Workaround for users without RM flag that want to delete reports
|
||||||
|
elseif (check_acl ($config['id_user'], 0, "RR")) {
|
||||||
|
|
||||||
|
$table->head[$next] = '<span title="Operations">' . __('Op.') . '</span>';
|
||||||
|
$table->size = array ();
|
||||||
|
$table->size[$next] = '80px';
|
||||||
|
$table->style[$next] = 'text-align:center;';
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($reports as $report) {
|
foreach ($reports as $report) {
|
||||||
|
@ -463,13 +489,18 @@ switch ($action) {
|
||||||
$data[$next] .= html_print_input_hidden ('id_report', $report['id_report'], true);
|
$data[$next] .= html_print_input_hidden ('id_report', $report['id_report'], true);
|
||||||
$data[$next] .= html_print_input_image ('edit', 'images/config.png', 1, '', true, array ('title' => __('Edit')));
|
$data[$next] .= html_print_input_image ('edit', 'images/config.png', 1, '', true, array ('title' => __('Edit')));
|
||||||
$data[$next] .= '</form>';
|
$data[$next] .= '</form>';
|
||||||
|
}
|
||||||
|
|
||||||
|
## Workaround for users without RM flag that want to delete reports
|
||||||
|
if (check_acl ($config['id_user'], 0, "RR")) {
|
||||||
|
|
||||||
$data[$next] .= '<form method="post" style="display:inline;" onsubmit="if (!confirm (\''.__('Are you sure?').'\')) return false">';
|
$data[$next] .= '<form method="post" style="display:inline;" onsubmit="if (!confirm (\''.__('Are you sure?').'\')) return false">';
|
||||||
$data[$next] .= html_print_input_hidden ('id_report', $report['id_report'], true);
|
$data[$next] .= html_print_input_hidden ('id_report', $report['id_report'], true);
|
||||||
$data[$next] .= html_print_input_hidden ('action','delete_report', true);
|
$data[$next] .= html_print_input_hidden ('action','delete_report', true);
|
||||||
$data[$next] .= html_print_input_image ('delete', 'images/cross.png', 1, '',
|
$data[$next] .= html_print_input_image ('delete', 'images/cross.png', 1, '',
|
||||||
true, array ('title' => __('Delete')));
|
true, array ('title' => __('Delete')));
|
||||||
$data[$next] .= '</form>';
|
$data[$next] .= '</form>';
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
array_push ($table->data, $data);
|
array_push ($table->data, $data);
|
||||||
|
@ -540,6 +571,7 @@ switch ($action) {
|
||||||
$private = 1;
|
$private = 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($action == 'update') {
|
if ($action == 'update') {
|
||||||
if ($reportName != "" && $idGroupReport != "") {
|
if ($reportName != "" && $idGroupReport != "") {
|
||||||
$new_values = array('name' => $reportName,
|
$new_values = array('name' => $reportName,
|
||||||
|
@ -583,13 +615,14 @@ switch ($action) {
|
||||||
$metaconsole_report = 0;
|
$metaconsole_report = 0;
|
||||||
|
|
||||||
$start_url = ui_get_full_url(false, false, false, false);
|
$start_url = ui_get_full_url(false, false, false, false);
|
||||||
$first_page = "<p style="text-align: center;">&nbsp;</p>
<p style="text-align: center;">&nbsp;</p>
<p style="text-align: center;">&nbsp;</p>
<p style="text-align: center;">&nbsp;</p>
<p style="text-align: center;">&nbsp;</p>
<p style="text-align: center;">&nbsp;</p>
<p style="text-align: center;">&nbsp;</p>
<p style="text-align: center;"><img src="" . $start_url . "/images/pandora_report_logo.png" alt="" width="800" /></p>
<p style="text-align: center;">&nbsp;</p>
<p style="text-align: center;"><span style="font-size: xx-large;">(_REPORT_NAME_)</span></p>
<p style="text-align: center;"><span style="font-size: large;">(_DATETIME_)</span></p>";
|
$first_page = "<p style="text-align: center;">&nbsp;</p>
<p style="text-align: center;">&nbsp;</p>
<p style="text-align: center;">&nbsp;</p>
<p style="text-align: center;">&nbsp;</p>
<p style="text-align: center;">&nbsp;</p>
<p style="text-align: center;">&nbsp;</p>
<p style="text-align: center;">&nbsp;</p>
<p style="text-align: center;"><img src="" . $start_url . "/images/logo_telefonica.jpg" alt="" width="800" /></p>
<p style="text-align: center;">&nbsp;</p>
<p style="text-align: center;"><span style="font-size: xx-large;">(_REPORT_NAME_)</span></p>
<p style="text-align: center;"><span style="font-size: large;">(_DATETIME_)</span></p>";
|
||||||
|
|
||||||
$idOrResult = db_process_sql_insert('treport',
|
$idOrResult = db_process_sql_insert('treport',
|
||||||
array('name' => $reportName,
|
array('name' => $reportName,
|
||||||
'id_group' => $idGroupReport,
|
'id_group' => $idGroupReport,
|
||||||
'description' => $description,
|
'description' => $description,
|
||||||
'first_page' => $first_page,
|
'first_page' => $first_page,
|
||||||
|
'custom_logo' => 'images/custom_logo/logo_telefonica_cabecera.jpg',
|
||||||
'private' => $private,
|
'private' => $private,
|
||||||
'id_group_edit' => $id_group_edit,
|
'id_group_edit' => $id_group_edit,
|
||||||
'id_user' => $config['id_user'],
|
'id_user' => $config['id_user'],
|
||||||
|
|
Loading…
Reference in New Issue