mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-31 01:35:36 +02:00
2013-11-19 Ramon Novoa <rnovoa@artica.es>
* godmode/reporting/reporting_builder.php, include/functions_groups.php, include/functions_users.php: Reverted changes for TSOL. Will be merged after the 5.0SP1 release. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@9100 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
e81f59e1e7
commit
bf88f47af1
@ -1,3 +1,10 @@
|
|||||||
|
2013-11-19 Ramon Novoa <rnovoa@artica.es>
|
||||||
|
|
||||||
|
* godmode/reporting/reporting_builder.php,
|
||||||
|
include/functions_groups.php,
|
||||||
|
include/functions_users.php: Reverted changes for TSOL. Will be merged
|
||||||
|
after the 5.0SP1 release.
|
||||||
|
|
||||||
2013-11-19 Miguel de Dios <miguel.dedios@artica.es>
|
2013-11-19 Miguel de Dios <miguel.dedios@artica.es>
|
||||||
|
|
||||||
* include/config_process.php: added lost line about the autorefresh.
|
* include/config_process.php: added lost line about the autorefresh.
|
||||||
|
@ -55,11 +55,6 @@ if ($idReport != 0) {
|
|||||||
$edit = false;
|
$edit = false;
|
||||||
switch ($type_access_selected) {
|
switch ($type_access_selected) {
|
||||||
case 'group_view':
|
case 'group_view':
|
||||||
## 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");
|
$edit = check_acl($config['id_user'], $report['id_group'], "RW");
|
||||||
break;
|
break;
|
||||||
case 'group_edit':
|
case 'group_edit':
|
||||||
@ -342,17 +337,6 @@ switch ($action) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
# 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'))
|
||||||
$filter['metaconsole'] = 1;
|
$filter['metaconsole'] = 1;
|
||||||
@ -362,7 +346,6 @@ 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';
|
||||||
@ -399,15 +382,6 @@ 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) {
|
||||||
@ -489,10 +463,6 @@ 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);
|
||||||
@ -500,7 +470,6 @@ switch ($action) {
|
|||||||
$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);
|
||||||
@ -571,7 +540,6 @@ 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,
|
||||||
@ -615,14 +583,13 @@ 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/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>";
|
$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>";
|
||||||
|
|
||||||
$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'],
|
||||||
|
@ -483,11 +483,10 @@ function groups_flatten_tree_groups($tree, $deep) {
|
|||||||
* @param array $groups The list of groups to create the treefield list.
|
* @param array $groups The list of groups to create the treefield list.
|
||||||
* @param integer $parent The id_group of parent actual scan branch.
|
* @param integer $parent The id_group of parent actual scan branch.
|
||||||
* @param integer $deep The level of profundity in the branch.
|
* @param integer $deep The level of profundity in the branch.
|
||||||
* @param boolean $for_select This flag will be true if this function is used for select group filter # Fix!
|
|
||||||
*
|
*
|
||||||
* @return array The treefield list of groups.
|
* @return array The treefield list of groups.
|
||||||
*/
|
*/
|
||||||
function groups_get_groups_tree_recursive($groups, $trash = 0, $trash2 = 0, $for_select = false) {
|
function groups_get_groups_tree_recursive($groups, $trash = 0, $trash2 = 0) {
|
||||||
$return = array();
|
$return = array();
|
||||||
|
|
||||||
$tree = $groups;
|
$tree = $groups;
|
||||||
@ -496,12 +495,6 @@ function groups_get_groups_tree_recursive($groups, $trash = 0, $trash2 = 0, $for
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
# Fix : Don't execute this code if for_select = true
|
|
||||||
if (!$for_select){
|
|
||||||
|
|
||||||
$tree[$group['parent']]['hash_branch'] = 1;
|
|
||||||
$tree[$group['parent']]['branch'][$key] = &$tree[$key];
|
|
||||||
|
|
||||||
// If the user has ACLs on a gruop but not in his father,
|
// If the user has ACLs on a gruop but not in his father,
|
||||||
// we consider it as a son of group "all"
|
// we consider it as a son of group "all"
|
||||||
if(!in_array($group['parent'], array_keys($groups))) {
|
if(!in_array($group['parent'], array_keys($groups))) {
|
||||||
@ -513,8 +506,6 @@ function groups_get_groups_tree_recursive($groups, $trash = 0, $trash2 = 0, $for
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Fix : Don't execute this code if for_select = true
|
|
||||||
if (!$for_select){
|
|
||||||
// Depends on the All group we give different format
|
// Depends on the All group we give different format
|
||||||
if (isset($groups[0])) {
|
if (isset($groups[0])) {
|
||||||
$tree = array($tree[0]);
|
$tree = array($tree[0]);
|
||||||
@ -522,7 +513,6 @@ function groups_get_groups_tree_recursive($groups, $trash = 0, $trash2 = 0, $for
|
|||||||
else {
|
else {
|
||||||
$tree = $tree[0]['branch'];
|
$tree = $tree[0]['branch'];
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
$return = groups_flatten_tree_groups($tree, 0);
|
$return = groups_flatten_tree_groups($tree, 0);
|
||||||
|
|
||||||
|
@ -112,8 +112,7 @@ function users_get_groups_for_select($id_user, $privilege = "AR", $returnAllGro
|
|||||||
$first_group = reset(array_slice($user_groups, 0, 1));
|
$first_group = reset(array_slice($user_groups, 0, 1));
|
||||||
$parent_group = $first_group['parent'];
|
$parent_group = $first_group['parent'];
|
||||||
|
|
||||||
# Fix : Added new parameter to avoid bad behaviour in this function
|
$user_groups_tree = groups_get_groups_tree_recursive($user_groups, $parent_group);
|
||||||
$user_groups_tree = groups_get_groups_tree_recursive($user_groups, $parent_group, 0, true);
|
|
||||||
}
|
}
|
||||||
$fields = array();
|
$fields = array();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user