Error fixes

This commit is contained in:
Alejandro Gallardo Escobar 2015-04-10 12:34:42 +02:00
parent 488c4976b0
commit 10c94d51d9
2 changed files with 17 additions and 20 deletions

View File

@ -260,7 +260,7 @@ if ($vconsoles_write || $vconsoles_manage) {
if (!defined('METACONSOLE'))
echo '<form action="index.php?sec=reporting&amp;sec2=godmode/reporting/visual_console_builder" method="post">';
else {
echo '<form action="index.php?operation=edit_visualmap&sec=screen&sec2=screens/screens&action=visualmap&pure=' . $pure . '" method="post">';
echo '<form action="index.php?sec=screen&sec2=screens/screens&action=visualmap&action2=new&operation=new_visualmap&tab=data&pure=' . $pure . '" method="post">';
}
html_print_input_hidden ('edit_layout', 1);
html_print_submit_button (__('Create'), '', false, 'class="sub next"');

View File

@ -26,8 +26,21 @@ enterprise_include_once('include/functions_visual_map.php');
set_unless_defined ($idVisualConsole, 0); // Set default
$idVisualConsole = get_parameter('id_visual_console', $idVisualConsole);
if (!defined('METACONSOLE')) {
$action_name_parameter = 'action';
}
else {
$action_name_parameter = 'action2';
}
$action = get_parameterBetweenListValues($action_name_parameter,
array('new', 'save', 'edit', 'update', 'delete', 'multiple_delete'),
'new');
$activeTab = get_parameterBetweenListValues('tab', array('data', 'list_elements', 'wizard', 'wizard_services', 'editor'), 'data');
// Visual console creation tab and actions
if ($activeTab == "data" && ($action == "new" || $action == "save")) {
if (empty($idVisualConsole)) {
$visualConsole = null;
// General ACL
@ -35,8 +48,8 @@ if ($activeTab == "data" && ($action == "new" || $action == "save")) {
$vconsole_write = check_acl ($config['id_user'], 0, "VW");
$vconsole_manage = check_acl ($config['id_user'], 0, "VM");
}
// Retrieving the visual console data
else if (!empty($idVisualConsole)) {
// The visual console exists
else if ($activeTab != 'data' || ($activeTab == 'data' && $action != 'new')) {
// Load the visual console data
$visualConsole = db_get_row_filter('tlayout', array('id' => $idVisualConsole));
@ -57,8 +70,6 @@ else if (!empty($idVisualConsole)) {
$vconsole_write = check_acl ($config['id_user'], $visualConsole['id_group'], "VW");
$vconsole_manage = check_acl ($config['id_user'], $visualConsole['id_group'], "VM");
}
// The visual console should exist.
// The only exception is the visual console creation.
else {
db_pandora_audit("ACL Violation",
"Trying to access report builder");
@ -74,25 +85,11 @@ if (!$vconsole_write && !$vconsole_manage) {
exit;
}
$pure = (int) get_parameter ('pure', 0);
$refr = (int) get_parameter ('refr', $config['vc_refr']);
$id_layout = 0;
if (!defined('METACONSOLE')) {
$action_name_parameter = 'action';
}
else {
$action_name_parameter = 'action2';
}
$action = get_parameterBetweenListValues($action_name_parameter,
array('new', 'save', 'edit', 'update', 'delete', 'multiple_delete'),
'new');
$activeTab = get_parameterBetweenListValues('tab', array('data', 'list_elements', 'wizard', 'wizard_services', 'editor'), 'data');
//Save/Update data in DB
global $statusProcessInDB;