2012-07-27 Miguel de Dios <miguel.dedios@artica.es>
* godmode/gis_maps/index.php, godmode/groups/group_list.php, godmode/db/db_main.php, godmode/agentes/agent_manager.php, godmode/agentes/module_manager_editor_common.php: cleaned source code style. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6821 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
765cb7860b
commit
e2c6686186
|
@ -1,3 +1,10 @@
|
|||
2012-07-27 Miguel de Dios <miguel.dedios@artica.es>
|
||||
|
||||
* godmode/gis_maps/index.php, godmode/groups/group_list.php,
|
||||
godmode/db/db_main.php, godmode/agentes/agent_manager.php,
|
||||
godmode/agentes/module_manager_editor_common.php: cleaned source
|
||||
code style.
|
||||
|
||||
2012-07-27 Miguel de Dios <miguel.dedios@artica.es>
|
||||
|
||||
* include/Image/Graph/*, include/Image/Graph.php,
|
||||
|
|
|
@ -322,18 +322,23 @@ else {
|
|||
$path_warning = $path . $icon_path . ".warning.png";
|
||||
}
|
||||
|
||||
$table->data[4][1] = html_print_select($arraySelectIcon, "icon_path", $icon_path, "changeIcons();", __('None'), '', true) .
|
||||
|
||||
' ' . html_print_image($path_ok, true, array("id" => "icon_ok", "style" => "display:".$display_icons.";")) .
|
||||
|
||||
' ' . html_print_image($path_bad, true, array("id" => "icon_bad", "style" => "display:".$display_icons.";")) .
|
||||
|
||||
' ' . html_print_image($path_warning, true, array("id" => "icon_warning", "style" => "display:".$display_icons.";"));
|
||||
$table->data[4][1] = html_print_select($arraySelectIcon, "icon_path",
|
||||
$icon_path, "changeIcons();", __('None'), '', true) .
|
||||
' ' . html_print_image($path_ok, true,
|
||||
array("id" => "icon_ok", "style" => "display:".$display_icons.";")) .
|
||||
' ' . html_print_image($path_bad, true,
|
||||
array("id" => "icon_bad", "style" => "display:".$display_icons.";")) .
|
||||
' ' . html_print_image($path_warning, true,
|
||||
array("id" => "icon_warning", "style" => "display:".$display_icons.";"));
|
||||
|
||||
if ($config['activate_gis']) {
|
||||
$table->data[5][0] = __('Ignore new GIS data:');
|
||||
$table->data[5][1] = __('Disabled').' '.html_print_radio_button_extended ("update_gis_data", 1, '', $update_gis_data, false, '', 'style="margin-right: 40px;"', true);
|
||||
$table->data[5][1] .= __('Enabled').' '.html_print_radio_button_extended ("update_gis_data", 0, '', $update_gis_data, false, '', 'style="margin-right: 40px;"', true);
|
||||
$table->data[5][1] = __('Disabled') . ' ' .
|
||||
html_print_radio_button_extended ("update_gis_data", 1, '',
|
||||
$update_gis_data, false, '', 'style="margin-right: 40px;"', true);
|
||||
$table->data[5][1] .= __('Enabled') . ' ' .
|
||||
html_print_radio_button_extended ("update_gis_data", 0, '',
|
||||
$update_gis_data, false, '', 'style="margin-right: 40px;"', true);
|
||||
}
|
||||
|
||||
$table->data[6][0] = __('Url address:');
|
||||
|
@ -378,7 +383,8 @@ if ($id_agente) {
|
|||
html_print_submit_button (__('Update'), 'updbutton', false, 'class="sub upd"');
|
||||
html_print_input_hidden ('update_agent', 1);
|
||||
html_print_input_hidden ('id_agente', $id_agente);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
html_print_submit_button (__('Create'), 'crtbutton', false, 'class="sub wand"');
|
||||
html_print_input_hidden ('create_agent', 1);
|
||||
}
|
||||
|
|
|
@ -286,32 +286,34 @@ if ($__code_from == 'modules') {
|
|||
$__id_where = 'b.id_agente_modulo';
|
||||
$__id = (int)$id_agent_module;
|
||||
// Code comes from policy module editor
|
||||
}else {
|
||||
}
|
||||
else {
|
||||
global $__id_pol_mod;
|
||||
$__table_modules= 'ttag_policy_module';
|
||||
$__id_where = 'b.id_policy_module';
|
||||
$__id = $__id_pol_mod;
|
||||
}
|
||||
|
||||
$table_advanced->data[6][1] = html_print_select_from_sql ("SELECT id_tag, name
|
||||
FROM ttag
|
||||
WHERE id_tag NOT IN (
|
||||
SELECT a.id_tag
|
||||
FROM ttag a, $__table_modules b
|
||||
WHERE a.id_tag = b.id_tag AND $__id_where = $__id )
|
||||
ORDER BY name",
|
||||
'id_tag_available[]', $id_tag, '','','', true, true, false, false, 'width: 200px', '5');
|
||||
$table_advanced->data[6][1] = html_print_select_from_sql (
|
||||
"SELECT id_tag, name
|
||||
FROM ttag
|
||||
WHERE id_tag NOT IN (
|
||||
SELECT a.id_tag
|
||||
FROM ttag a, $__table_modules b
|
||||
WHERE a.id_tag = b.id_tag AND $__id_where = $__id )
|
||||
ORDER BY name", 'id_tag_available[]', $id_tag, '','','',
|
||||
true, true, false, false, 'width: 200px', '5');
|
||||
$table_advanced->data[6][2] = html_print_image('images/darrowright.png', true, array('id' => 'right', 'title' => __('Add tags to module'))); //html_print_input_image ('add', 'images/darrowright.png', 1, '', true, array ('title' => __('Add tags to module')));
|
||||
$table_advanced->data[6][2] .= '<br><br><br><br>' . html_print_image('images/darrowleft.png', true, array('id' => 'left', 'title' => __('Delete tags to module'))); //html_print_input_image ('add', 'images/darrowleft.png', 1, '', true, array ('title' => __('Delete tags to module')));
|
||||
|
||||
$table_advanced->data[6][3] = '<b>' . __('Tags selected') . '</b>';
|
||||
$table_advanced->data[6][4] = html_print_select_from_sql ("SELECT a.id_tag, name
|
||||
FROM ttag a, $__table_modules b
|
||||
WHERE a.id_tag = b.id_tag AND $__id_where = $__id
|
||||
ORDER BY name",
|
||||
'id_tag_selected[]', $id_tag, '','','', true, true, false, false, 'width: 200px', '5');
|
||||
//$table_advanced->data[6][4] .= html_print_input_hidden('id_tag_serialize', '');
|
||||
|
||||
$table_advanced->data[6][4] = html_print_select_from_sql (
|
||||
"SELECT a.id_tag, name
|
||||
FROM ttag a, $__table_modules b
|
||||
WHERE a.id_tag = b.id_tag AND $__id_where = $__id
|
||||
ORDER BY name",
|
||||
'id_tag_selected[]', $id_tag, '','','', true, true, false,
|
||||
false, 'width: 200px', '5');
|
||||
?>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
|
|
@ -179,9 +179,10 @@ echo '<tr class="rowPair"><td>';
|
|||
echo __('Last time on DB maintance');
|
||||
echo '<td>';
|
||||
|
||||
if (!isset($config['db_maintance'])){
|
||||
if (!isset($config['db_maintance'])) {
|
||||
echo "<b><font size=12px>".__("Never")."</font></b>";
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$seconds = time()-$config['db_maintance'];
|
||||
if ($seconds > 90000) //(1,1 days)
|
||||
echo "<b><font color='#ff0000' size=12px>";
|
||||
|
|
|
@ -115,7 +115,8 @@ if ($maps){
|
|||
|
||||
if (!empty ($table->data)) {
|
||||
html_print_table($table);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
echo '<div class="nf">'.('No maps defined').'</div>';
|
||||
}
|
||||
|
||||
|
|
|
@ -165,17 +165,19 @@ $check = db_get_value('nombre', 'tgrupo', 'nombre', $name);
|
|||
$result = db_process_sql_insert('tgrupo', $values);
|
||||
if ($result) {
|
||||
echo "<h3 class='suc'>".__('Group successfully created')."</h3>";
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
echo "<h3 class='error'>".__('There was a problem creating group')."</h3>";
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
echo "<h3 class='error'>".__('Each group must have a different name')."</h3>";
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
//$result = false;
|
||||
echo "<h3 class='error'>".__('Group must have a name')."</h3>";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* Update group */
|
||||
|
@ -194,26 +196,28 @@ if ($update_group) {
|
|||
switch ($config["dbtype"]) {
|
||||
case "mysql":
|
||||
$sql = sprintf ('UPDATE tgrupo SET nombre = "%s",
|
||||
icon = "%s", disabled = %d, parent = %d, custom_id = "%s", propagate = %d, id_skin = %d
|
||||
WHERE id_grupo = %d',
|
||||
$name, substr ($icon, 0, -4), !$alerts_enabled, $id_parent, $custom_id, $propagate, $skin, $id_group);
|
||||
icon = "%s", disabled = %d, parent = %d, custom_id = "%s", propagate = %d, id_skin = %d
|
||||
WHERE id_grupo = %d',
|
||||
$name, substr ($icon, 0, -4), !$alerts_enabled, $id_parent, $custom_id, $propagate, $skin, $id_group);
|
||||
break;
|
||||
case "postgresql":
|
||||
case "oracle":
|
||||
$sql = sprintf ('UPDATE tgrupo SET nombre = \'%s\',
|
||||
icon = \'%s\', disabled = %d, parent = %d, custom_id = \'%s\', propagate = %d, id_skin = %d
|
||||
WHERE id_grupo = %d',
|
||||
$name, substr ($icon, 0, -4), !$alerts_enabled, $id_parent, $custom_id, $propagate, $skin, $id_group);
|
||||
icon = \'%s\', disabled = %d, parent = %d, custom_id = \'%s\', propagate = %d, id_skin = %d
|
||||
WHERE id_grupo = %d',
|
||||
$name, substr ($icon, 0, -4), !$alerts_enabled, $id_parent, $custom_id, $propagate, $skin, $id_group);
|
||||
break;
|
||||
}
|
||||
$result = db_process_sql ($sql);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$result = false;
|
||||
}
|
||||
|
||||
if ($result !== false) {
|
||||
echo "<h3 class='suc'>".__('Group successfully updated')."</h3>";
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
echo "<h3 class='error'>".__('There was a problem modifying group')."</h3>";
|
||||
}
|
||||
}
|
||||
|
@ -245,13 +249,12 @@ if ($delete_group) {
|
|||
else {
|
||||
echo "<h3 class='error'>".__('There was a problem deleting group')."</h3>";
|
||||
}
|
||||
|
||||
}
|
||||
db_clean_cache();
|
||||
$groups = users_get_groups_tree ($config['id_user'], "AR", true);
|
||||
$table->width = '98%';
|
||||
|
||||
if(!empty($groups)) {
|
||||
if (!empty($groups)) {
|
||||
$table->head = array ();
|
||||
$table->head[0] = __('Name');
|
||||
$table->head[1] = __('ID');
|
||||
|
|
Loading…
Reference in New Issue