Starting to make the availability general report

This commit is contained in:
mdtrooper 2015-03-31 12:53:21 +02:00
parent 48ca7ac999
commit 4749f3255b
1 changed files with 17 additions and 10 deletions

View File

@ -93,11 +93,11 @@ if ($idReport != 0) {
$edit = true; $edit = true;
break; break;
} }
if (! $edit) { if (! $edit) {
// The user that created the report should can delete it. Despite its permissions. // The user that created the report should can delete it. Despite its permissions.
$delete_report_bypass = false; $delete_report_bypass = false;
if ($action == 'delete_report') { if ($action == 'delete_report') {
if ($config['id_user'] == $report['id_user'] || is_user_admin ($config["id_user"])) { if ($config['id_user'] == $report['id_user'] || is_user_admin ($config["id_user"])) {
$delete_report_bypass = true; $delete_report_bypass = true;
@ -339,14 +339,14 @@ switch ($action) {
} }
break; break;
} }
if (! $delete) { if (! $delete) {
db_pandora_audit("ACL Violation", db_pandora_audit("ACL Violation",
"Trying to access report builder deletion"); "Trying to access report builder deletion");
require ("general/noaccess.php"); require ("general/noaccess.php");
exit; exit;
} }
$result = reports_delete_report ($idReport); $result = reports_delete_report ($idReport);
if ($result !== false) if ($result !== false)
db_pandora_audit("Report management", "Delete report #$idReport"); db_pandora_audit("Report management", "Delete report #$idReport");
@ -431,8 +431,14 @@ switch ($action) {
$filter['metaconsole'] = 0; $filter['metaconsole'] = 0;
$reports = reports_get_reports ($filter, $reports = reports_get_reports ($filter,
array ('name', 'id_report', 'description', 'private', array (
'id_user', 'id_group', 'non_interactive'), $return_all_group, 'RR', $group); 'name',
'id_report',
'description',
'private',
'id_user',
'id_group',
'non_interactive'), $return_all_group, 'RR', $group);
$table->width = '0px'; $table->width = '0px';
if (sizeof ($reports)) { if (sizeof ($reports)) {
@ -644,7 +650,7 @@ switch ($action) {
} }
break; break;
case 'update': case 'update':
case 'save': case 'save':
switch ($activeTab) { switch ($activeTab) {
case 'main': case 'main':
$reportName = get_parameter('name'); $reportName = get_parameter('name');
@ -724,8 +730,9 @@ switch ($action) {
$first_page = $config['custom_report_front_firstpage']; $first_page = $config['custom_report_front_firstpage'];
$footer = $config['custom_report_front_footer']; $footer = $config['custom_report_front_footer'];
} else { }
else {
$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;"> </p>
<p style="text-align: center;"> </p>
<p style="text-align: center;"> </p>
<p style="text-align: center;"> </p>
<p style="text-align: center;"> </p>
<p style="text-align: center;"> </p>
<p style="text-align: center;"> </p>
<p style="text-align: center;"><img src="" . $start_url . "/images/pandora_report_logo.png" alt="" width="800" /></p>
<p style="text-align: center;"> </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;"> </p>
<p style="text-align: center;"> </p>
<p style="text-align: center;"> </p>
<p style="text-align: center;"> </p>
<p style="text-align: center;"> </p>
<p style="text-align: center;"> </p>
<p style="text-align: center;"> </p>
<p style="text-align: center;"><img src="" . $start_url . "/images/pandora_report_logo.png" alt="" width="800" /></p>
<p style="text-align: center;"> </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>";
$logo = $header = $footer = null; $logo = $header = $footer = null;
@ -1548,7 +1555,7 @@ switch ($action) {
switch ($activeTab) { switch ($activeTab) {
case 'main': case 'main':
$buttons['list_reports']['active'] = true; $buttons['list_reports']['active'] = true;
$subsection = ' » '.__('Custom reporting'); $subsection = ' » ' . __('Custom reporting');
break; break;
default: default:
$subsection = reporting_enterprise_add_subsection_main($activeTab, $buttons); $subsection = reporting_enterprise_add_subsection_main($activeTab, $buttons);