mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-31 01:35:36 +02:00
2012-08-17 Miguel de Dios <miguel.dedios@artica.es>
* godmode/users/configure_user.php: fixed when the metaconsole is not set. * godmode/reporting/reporting_builder.php: cleaned source code style. * include/functions_reports.php: fixed into the function "reports_get_reports" to get reports in All group for users of others groups. * include/functions_api.php: fixed the confused error messages when there is data events. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6878 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
b2b23c7cb0
commit
39c0cf9f84
@ -1,3 +1,18 @@
|
||||
2012-08-17 Miguel de Dios <miguel.dedios@artica.es>
|
||||
|
||||
* godmode/users/configure_user.php: fixed when the metaconsole is
|
||||
not set.
|
||||
|
||||
* godmode/reporting/reporting_builder.php: cleaned source code
|
||||
style.
|
||||
|
||||
* include/functions_reports.php: fixed into the function
|
||||
"reports_get_reports" to get reports in All group for users of
|
||||
others groups.
|
||||
|
||||
* include/functions_api.php: fixed the confused error messages when
|
||||
there is data events.
|
||||
|
||||
2012-08-17 Sergio Martin <sergio.martin@artica.es>
|
||||
|
||||
* include/javascript/pandora_modules.js
|
||||
|
@ -141,7 +141,8 @@ switch ($action) {
|
||||
if (!empty($ids_serialize)) {
|
||||
$sql = "DELETE FROM treport_content WHERE id_rc IN ($ids_serialize)";
|
||||
$resultOperationDB = db_process_sql($sql);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$resultOperationDB = false;
|
||||
}
|
||||
|
||||
@ -156,7 +157,8 @@ switch ($action) {
|
||||
|
||||
if (($countItems < $position_to_delete) || ($position_to_delete < 1)) {
|
||||
$resultOperationDB = false;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$sql = "SELECT id_rc FROM treport_content WHERE id_report=$idReport ORDER BY '`order`'";
|
||||
$items = db_get_all_rows_sql($sql);
|
||||
switch ($pos_delete) {
|
||||
@ -202,13 +204,14 @@ switch ($action) {
|
||||
}
|
||||
|
||||
$subsection = '';
|
||||
switch ($activeTab){
|
||||
|
||||
case 'main': $buttons['list_reports']['active'] = true;
|
||||
$subsection = ' » '.__('Custom reporting');
|
||||
break;
|
||||
default: $subsection = reporting_enterprise_add_subsection_main($activeTab, $buttons);
|
||||
break;
|
||||
switch ($activeTab) {
|
||||
case 'main':
|
||||
$buttons['list_reports']['active'] = true;
|
||||
$subsection = ' » '.__('Custom reporting');
|
||||
break;
|
||||
default:
|
||||
$subsection = reporting_enterprise_add_subsection_main($activeTab, $buttons);
|
||||
break;
|
||||
}
|
||||
|
||||
// Report LIST
|
||||
@ -230,7 +233,7 @@ switch ($action) {
|
||||
$search = trim(get_parameter ("search", ""));
|
||||
|
||||
$search_sql = '';
|
||||
if ($search != ""){
|
||||
if ($search != "") {
|
||||
$search_name = "%$search%' OR description LIKE '%$search%";
|
||||
}
|
||||
|
||||
@ -259,7 +262,8 @@ switch ($action) {
|
||||
// Show only selected groups
|
||||
if ($id_group > 0) {
|
||||
$group = array("$id_group" => $id_group);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$group = false;
|
||||
}
|
||||
|
||||
@ -273,14 +277,16 @@ switch ($action) {
|
||||
'name' => $search_name,
|
||||
'order' => 'name'
|
||||
);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$filter = array (
|
||||
'order' => 'name'
|
||||
);
|
||||
}
|
||||
|
||||
$reports = reports_get_reports ($filter,
|
||||
array ('name', 'id_report', 'description', 'private', 'id_user', 'id_group'), $return_all_group, 'IR', $group);
|
||||
array ('name', 'id_report', 'description', 'private',
|
||||
'id_user', 'id_group'), $return_all_group, 'IR', $group);
|
||||
$table->width = '0px';
|
||||
if (sizeof ($reports)) {
|
||||
$table->id = 'report_list';
|
||||
@ -332,7 +338,7 @@ switch ($action) {
|
||||
|
||||
if (check_acl ($config["id_user"], $report["id_group"], "AW")) {
|
||||
$data[0] = '<a href="index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&action=edit&id_report='.
|
||||
$report['id_report'].'">'.$report['name'].'</a>';
|
||||
$report['id_report'].'">'.$report['name'].'</a>';
|
||||
}
|
||||
else {
|
||||
$data[0] = $report['name'];
|
||||
@ -996,13 +1002,14 @@ switch ($action) {
|
||||
$buttons = reporting_enterprise_add_main_Tabs($buttons);
|
||||
|
||||
$subsection = '';
|
||||
switch ($activeTab){
|
||||
|
||||
case 'main': $buttons['list_reports']['active'] = true;
|
||||
$subsection = ' » '.__('Custom reporting');
|
||||
break;
|
||||
default: $subsection = reporting_enterprise_add_subsection_main($activeTab, $buttons);
|
||||
break;
|
||||
switch ($activeTab) {
|
||||
case 'main':
|
||||
$buttons['list_reports']['active'] = true;
|
||||
$subsection = ' » '.__('Custom reporting');
|
||||
break;
|
||||
default:
|
||||
$subsection = reporting_enterprise_add_subsection_main($activeTab, $buttons);
|
||||
break;
|
||||
}
|
||||
|
||||
// Report LIST
|
||||
@ -1010,7 +1017,6 @@ switch ($action) {
|
||||
|
||||
reporting_enterprise_select_main_tab($action);
|
||||
}
|
||||
|
||||
return;
|
||||
break;
|
||||
}
|
||||
@ -1040,7 +1046,7 @@ if ($enterpriseEnable) {
|
||||
|
||||
$buttons['view'] = array('active' => false,
|
||||
'text' => '<a href="index.php?sec=reporting&sec2=operation/reporting/reporting_viewer&id=' . $idReport . '">' .
|
||||
html_print_image("images/reporting.png", true, array ("title" => __('View report'))) .'</a>');
|
||||
html_print_image("images/reporting.png", true, array ("title" => __('View report'))) .'</a>');
|
||||
|
||||
$buttons[$activeTab]['active'] = true;
|
||||
|
||||
@ -1075,5 +1081,4 @@ switch ($activeTab) {
|
||||
reporting_enterprise_select_tab($activeTab);
|
||||
break;
|
||||
}
|
||||
|
||||
?>
|
@ -84,7 +84,8 @@ $update_user = (bool) get_parameter ('update_user');
|
||||
$status = get_parameter ('status', -1);
|
||||
|
||||
// Reset status var if current action is not update_user
|
||||
if ($new_user || $create_user || $add_profile || $delete_profile || $update_user){
|
||||
if ($new_user || $create_user || $add_profile ||
|
||||
$delete_profile || $update_user) {
|
||||
$status = -1;
|
||||
}
|
||||
|
||||
@ -409,7 +410,7 @@ else {
|
||||
}
|
||||
|
||||
// User only can change skins if has more than one group
|
||||
if (count($usr_groups) > 1){
|
||||
if (count($usr_groups) > 1) {
|
||||
if ($isFunctionSkins !== ENTERPRISE_NOT_HOOK) {
|
||||
$table->data[10][0] = __('Skin');
|
||||
$table->data[10][1] = skins_print_select($id_usr,'skin', $user_info['id_skin'], '', __('None'), 0, true);
|
||||
@ -422,18 +423,24 @@ $table->data[11][1] = html_print_select($values, 'flash_charts', $user_info["fla
|
||||
$table->data[12][0] = __('Block size for pagination');
|
||||
$table->data[12][1] = html_print_input_text ('block_size', $user_info["block_size"], '', 5, 5, true);
|
||||
|
||||
if($id == $config['id_user']) {
|
||||
if ($id == $config['id_user']) {
|
||||
$table->data[12][1] .= html_print_input_hidden('quick_language_change', 1, true);
|
||||
}
|
||||
|
||||
if(enterprise_installed()) {
|
||||
if (enterprise_installed()) {
|
||||
$user_info_metaconsole_access = 'only_console';
|
||||
if (isset($user_info["metaconsole_access"])) {
|
||||
$user_info_metaconsole_access = $user_info["metaconsole_access"];
|
||||
}
|
||||
$table->data[12][0] = __('Metaconsole access');
|
||||
$metaconsole_accesses = array('only_console' => __('No access'),
|
||||
'basic' => __('Basic (Only Metaconsole)'),
|
||||
'advanced' => __('Advanced (Only Metaconsole)'),
|
||||
//'custom' => __('Custom access (Only Metaconsole)'),
|
||||
'all' => __('Full (Metaconsole and normal console)'));
|
||||
$table->data[12][1] = html_print_select($metaconsole_accesses,'metaconsole_access',$user_info["metaconsole_access"],'','',-1,true, false, false);
|
||||
'basic' => __('Basic (Only Metaconsole)'),
|
||||
'advanced' => __('Advanced (Only Metaconsole)'),
|
||||
//'custom' => __('Custom access (Only Metaconsole)'),
|
||||
'all' => __('Full (Metaconsole and normal console)'));
|
||||
$table->data[12][1] = html_print_select($metaconsole_accesses,
|
||||
'metaconsole_access', $user_info_metaconsole_access,
|
||||
'','',-1,true, false, false);
|
||||
}
|
||||
|
||||
echo '<form method="post" autocomplete="off">';
|
||||
@ -442,7 +449,7 @@ html_print_table ($table);
|
||||
|
||||
echo '<div style="width: '.$table->width.'" class="action-buttons">';
|
||||
if ($new_user) {
|
||||
if ($config['admin_can_add_user']){
|
||||
if ($config['admin_can_add_user']) {
|
||||
html_print_input_hidden ('create_user', 1);
|
||||
html_print_submit_button (__('Create'), 'crtbutton', false, 'class="sub wand"');
|
||||
}
|
||||
@ -461,7 +468,7 @@ echo '<br />';
|
||||
if (empty ($id) || $new_user)
|
||||
return;
|
||||
|
||||
echo '<h4>'.__('Profiles/Groups assigned to this user').'</h4>';
|
||||
echo '<h4>'. __('Profiles/Groups assigned to this user') . '</h4>';
|
||||
|
||||
$table->width = '98%';
|
||||
$table->data = array ();
|
||||
@ -507,33 +514,30 @@ foreach ($result as $profile) {
|
||||
array_push ($table->data, $data);
|
||||
}
|
||||
|
||||
$data = array ();
|
||||
$data = array ();
|
||||
|
||||
$data[0] = '<form method="post">';
|
||||
if (check_acl ($config['id_user'], 0, "PM")) {
|
||||
$data[0] .= html_print_select (profile_get_profiles (), 'assign_profile', 0, '',
|
||||
__('None'), 0, true, false, false);
|
||||
}
|
||||
else {
|
||||
$data[0] .= html_print_select (profile_get_profiles (array ('pandora_management' => '<> 1',
|
||||
'db_management' => '<> 1')), 'assign_profile', 0, '', __('None'), 0,
|
||||
true, false, false);
|
||||
}
|
||||
$data[0] = '<form method="post">';
|
||||
if (check_acl ($config['id_user'], 0, "PM")) {
|
||||
$data[0] .= html_print_select (profile_get_profiles (), 'assign_profile', 0, '',
|
||||
__('None'), 0, true, false, false);
|
||||
}
|
||||
else {
|
||||
$data[0] .= html_print_select (profile_get_profiles (array ('pandora_management' => '<> 1',
|
||||
'db_management' => '<> 1')), 'assign_profile', 0, '', __('None'), 0,
|
||||
true, false, false);
|
||||
}
|
||||
|
||||
$data[1] = html_print_select_groups($config['id_user'], "UM",
|
||||
$own_info['is_admin'], 'assign_group', -1, '', __('None'), -1, true,
|
||||
false, false);
|
||||
$data[1] = html_print_select_groups($config['id_user'], "UM",
|
||||
$own_info['is_admin'], 'assign_group', -1, '', __('None'), -1, true,
|
||||
false, false);
|
||||
|
||||
$data[2] = html_print_input_image ('add', 'images/add.png', 1, '', true);
|
||||
$data[2] .= html_print_input_hidden ('id', $id, true);
|
||||
$data[2] .= html_print_input_hidden ('add_profile', 1, true);
|
||||
$data[2] .= '</form>';
|
||||
$data[2] = html_print_input_image ('add', 'images/add.png', 1, '', true);
|
||||
$data[2] .= html_print_input_hidden ('id', $id, true);
|
||||
$data[2] .= html_print_input_hidden ('add_profile', 1, true);
|
||||
$data[2] .= '</form>';
|
||||
|
||||
array_push ($table->data, $data);
|
||||
|
||||
html_print_table ($table);
|
||||
|
||||
|
||||
unset ($table);
|
||||
|
||||
?>
|
@ -4987,8 +4987,9 @@ function get_events_with_user($trash1, $trash2, $other, $returnType, $user_in_db
|
||||
$data['data'] = $result;
|
||||
|
||||
returnData($returnType, $data, $separator);
|
||||
|
||||
return;
|
||||
if (empty($result))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -5001,9 +5002,10 @@ function get_events_with_user($trash1, $trash2, $other, $returnType, $user_in_db
|
||||
*/
|
||||
function api_get_events($trash1, $trash2, $other, $returnType, $user_in_db = null) {
|
||||
if ($user_in_db !== null) {
|
||||
get_events_with_user($trash1, $trash2, $other, $returnType, $user_in_db);
|
||||
$correct = get_events_with_user($trash1, $trash2, $other, $returnType, $user_in_db);
|
||||
|
||||
$last_error = error_get_last();
|
||||
if (!empty($last_error)) {
|
||||
if (!$correct && !empty($last_error)) {
|
||||
$errors = array(E_ERROR, E_WARNING, E_USER_ERROR,
|
||||
E_USER_WARNING);
|
||||
if (in_array($last_error['type'], $errors)) {
|
||||
|
@ -83,22 +83,27 @@ function reports_get_reports ($filter = false, $fields = false, $returnAllGroup
|
||||
|
||||
$reports = array ();
|
||||
$all_reports = @db_get_all_rows_filter ('treport', $filter, $fields);
|
||||
|
||||
if (empty($all_reports))
|
||||
$all_reports = array();
|
||||
|
||||
if ($group) {
|
||||
$groups = $group;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
//Recheck in all reports if the user have permissions to see each report.
|
||||
$groups = users_get_groups ($config['id_user'], $privileges, $returnAllGroup);
|
||||
}
|
||||
|
||||
foreach ($all_reports as $report) {
|
||||
if (!in_array($report['id_group'], array_keys($groups)))
|
||||
continue;
|
||||
if ($config['id_user'] != $report['id_user']
|
||||
&& ! check_acl ($config['id_user'], $report['id_group'], 'AR'))
|
||||
continue;
|
||||
//If the report is not in all group.
|
||||
if ($report['id_group'] != 0) {
|
||||
if (!in_array($report['id_group'], array_keys($groups)))
|
||||
continue;
|
||||
if ($config['id_user'] != $report['id_user']
|
||||
&& ! check_acl ($config['id_user'], $report['id_group'], 'AR'))
|
||||
continue;
|
||||
}
|
||||
array_push ($reports, $report);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user