2012-07-18 Miguel de Dios <miguel.dedios@artica.es>

* extensions/resource_registration.php,
	extensions/update_manager/lib/libupdate_manager.php,
	extensions/plugin_registration.php,
	operation/incidents/incident.php,
	mobile/operation/agents/monitor_status.php,
	mobile/operation/agents/view_agents.php: cleaned source code style.

	* operation/tree.php: improve the code for to set more readble.




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6789 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2012-07-18 14:31:58 +00:00
parent 5da06e0448
commit 50cd6e1033
8 changed files with 515 additions and 501 deletions

View File

@ -1,3 +1,14 @@
2012-07-18 Miguel de Dios <miguel.dedios@artica.es>
* extensions/resource_registration.php,
extensions/update_manager/lib/libupdate_manager.php,
extensions/plugin_registration.php,
operation/incidents/incident.php,
mobile/operation/agents/monitor_status.php,
mobile/operation/agents/view_agents.php: cleaned source code style.
* operation/tree.php: improve the code for to set more readble.
2012-07-18 Miguel de Dios <miguel.dedios@artica.es> 2012-07-18 Miguel de Dios <miguel.dedios@artica.es>
* general/logon_ok.php, godmode/db/db_event.php, * general/logon_ok.php, godmode/db/db_event.php,

View File

@ -117,7 +117,7 @@ function pluginreg_extension_main () {
for ($ax=1; $ax <= $ini_array["plugin_definition"]["total_modules_provided"]; $ax++){ for ($ax=1; $ax <= $ini_array["plugin_definition"]["total_modules_provided"]; $ax++){
$label = "module".$ax; $label = "module".$ax;
$values = array( $values = array(
'name' => io_safe_input ($ini_array[$label]["name"]), 'name' => io_safe_input ($ini_array[$label]["name"]),
'description' => io_safe_input ($ini_array[$label]["description"]), 'description' => io_safe_input ($ini_array[$label]["description"]),
@ -142,18 +142,18 @@ function pluginreg_extension_main () {
'min_ff_event' => isset($ini_array[$label]["min_ff_event"]) ? $ini_array[$label]["min_ff_event"] : '', 'min_ff_event' => isset($ini_array[$label]["min_ff_event"]) ? $ini_array[$label]["min_ff_event"] : '',
'tcp_port' => isset($ini_array[$label]["tcp_port"]) ? $ini_array[$label]["tcp_port"] : '', 'tcp_port' => isset($ini_array[$label]["tcp_port"]) ? $ini_array[$label]["tcp_port"] : '',
'id_plugin' => $create_id); 'id_plugin' => $create_id);
db_process_sql_insert('tnetwork_component', $values); db_process_sql_insert('tnetwork_component', $values);
echo "<h3 class=suc>".__("Module plugin registered"). " : ". $ini_array[$label]["name"] ."</h2>"; echo "<h3 class=suc>".__("Module plugin registered"). " : ". $ini_array[$label]["name"] ."</h2>";
} }
echo "<h2 class=suc>".__("Plugin"). " ". $ini_array["plugin_definition"]["name"] . " ". __("Registered successfully")."</h2>"; echo "<h2 class=suc>".__("Plugin"). " ". $ini_array["plugin_definition"]["name"] . " ". __("Registered successfully")."</h2>";
unlink ($config["attachment_store"] . "/plugin_definition.ini"); unlink ($config["attachment_store"] . "/plugin_definition.ini");
} }
extensions_add_godmode_menu_option (__('Register plugin'), 'PM','gservers',''); extensions_add_godmode_menu_option (__('Register plugin'), 'PM','gservers','');
extensions_add_godmode_function('pluginreg_extension_main'); extensions_add_godmode_function('pluginreg_extension_main');
?> ?>

View File

@ -168,7 +168,7 @@ function process_upload_xml_report($xml, $group_filter = 0) {
switch ($item['type']) { switch ($item['type']) {
case 1: case 1:
case 'simple_graph': case 'simple_graph':
break; break;
case 'simple_baseline_graph': case 'simple_baseline_graph':
break; break;
case 2: case 2:

View File

@ -326,7 +326,7 @@ function um_db_get_all_package_logs ($ip = '', $order_by = 'timestamp', $limit =
$result = oracle_recode_query ('SELECT * FROM '.DB_PREFIX.'tupdate_package_log WHERE', $set, 'AND', false); $result = oracle_recode_query ('SELECT * FROM '.DB_PREFIX.'tupdate_package_log WHERE', $set, 'AND', false);
// Delete rnum row generated by oracle_recode_query() function // Delete rnum row generated by oracle_recode_query() function
for ($i=0; $i < count($result); $i++) { for ($i=0; $i < count($result); $i++) {
unset($result[$i]['rnum']); unset($result[$i]['rnum']);
} }
break; break;
} }
@ -677,7 +677,7 @@ function um_db_update_auth ($id_auth, $client_key, $subscription_limit, $descrip
$values = array ('client_key' => $client_key, $values = array ('client_key' => $client_key,
'subscription_limit' => $subscription_limit, 'subscription_limit' => $subscription_limit,
'description' => $description, 'description' => $description,
'developer' => $developer); 'developer' => $developer);
$where = array ('id' => $id_auth); $where = array ('id' => $id_auth);
$result = db_process_sql_update(DB_PREFIX.'tupdate_auth', $values, $where); $result = db_process_sql_update(DB_PREFIX.'tupdate_auth', $values, $where);

View File

@ -96,7 +96,7 @@ class MonitorStatus {
$sqlStatus = " AND tagente_estado.estado = 1 AND utimestamp > 0"; $sqlStatus = " AND tagente_estado.estado = 1 AND utimestamp > 0";
} }
elseif ($status == 1) { //Warning elseif ($status == 1) { //Warning
$sqlStatus = " AND tagente_estado.estado = 2 AND utimestamp > 0"; $sqlStatus = " AND tagente_estado.estado = 2 AND utimestamp > 0";
} }
elseif ($status == 4) { //Not normal elseif ($status == 4) { //Not normal
$sqlStatus = " AND tagente_estado.estado <> 0"; $sqlStatus = " AND tagente_estado.estado <> 0";
@ -105,7 +105,8 @@ class MonitorStatus {
$sqlStatus = " AND tagente_estado.estado = 3"; $sqlStatus = " AND tagente_estado.estado = 3";
} }
elseif ($status == 5) { //Not init elseif ($status == 5) { //Not init
$sqlStatus = " AND tagente_estado.utimestamp = 0 AND tagente_modulo.id_tipo_modulo NOT IN (21,22,23,100)"; $sqlStatus = " AND tagente_estado.utimestamp = 0
AND tagente_modulo.id_tipo_modulo NOT IN (21,22,23,100)";
} }
@ -160,16 +161,16 @@ class MonitorStatus {
$set['limit'] = $this->system->getPageSize(); $set['limit'] = $this->system->getPageSize();
$set['offset'] = $this->offset; $set['offset'] = $this->offset;
$rows = oracle_recode_query ($selectSQL . $sql, $set, 'AND', true); $rows = oracle_recode_query ($selectSQL . $sql, $set, 'AND', true);
break; break;
} }
if ($rows === false) $rows = array(); if ($rows === false) $rows = array();
if ($config["dbtype"] == 'oracle') { if ($config["dbtype"] == 'oracle') {
for ($i=0; $i < count($rows); $i++) { for ($i=0; $i < count($rows); $i++) {
unset($rows[$i]['rnum']); unset($rows[$i]['rnum']);
} }
} }
$table = null; $table = null;
$table->width = '100%'; $table->width = '100%';
@ -225,7 +226,7 @@ class MonitorStatus {
else else
$data[] = "<span title='".$row['datos']."' style='white-space: nowrap;'>" . $data[] = "<span title='".$row['datos']."' style='white-space: nowrap;'>" .
substr(io_safe_output($row["datos"]),0,12)."</span>"; substr(io_safe_output($row["datos"]),0,12)."</span>";
$data[] = ui_print_timestamp ($row["utimestamp"], true, array('units' => 'tiny')); $data[] = ui_print_timestamp ($row["utimestamp"], true, array('units' => 'tiny'));
$table->data[] = $data; $table->data[] = $data;
@ -236,13 +237,13 @@ class MonitorStatus {
$pagination = pagination ($total, $pagination = pagination ($total,
ui_get_url_refresh (array ()), ui_get_url_refresh (array ()),
0, 0, true); 0, 0, true);
$pagination = str_replace('images/go_first.png', '../images/go_first.png', $pagination); $pagination = str_replace('images/go_first.png', '../images/go_first.png', $pagination);
$pagination = str_replace('images/go_previous.png', '../images/go_previous.png', $pagination); $pagination = str_replace('images/go_previous.png', '../images/go_previous.png', $pagination);
$pagination = str_replace('images/go_next.png', '../images/go_next.png', $pagination); $pagination = str_replace('images/go_next.png', '../images/go_next.png', $pagination);
$pagination = str_replace('images/go_last.png', '../images/go_last.png', $pagination); $pagination = str_replace('images/go_last.png', '../images/go_last.png', $pagination);
echo $pagination; echo $pagination;
} }
} }
?> ?>

View File

@ -475,13 +475,13 @@ class viewGraph {
} }
$result = db_get_all_rows_sql ($sql); $result = db_get_all_rows_sql ($sql);
if (($config["dbtype"] == 'oracle') && ($result !== false)) { if (($config["dbtype"] == 'oracle') && ($result !== false)) {
// Delete rnum row generated by oracle_recode_query() function // Delete rnum row generated by oracle_recode_query() function
for ($i=0; $i < count($result); $i++) { for ($i=0; $i < count($result); $i++) {
unset($result[$i]['rnum']); unset($result[$i]['rnum']);
} }
} }
$table = null; $table = null;
$table->width = '100%'; $table->width = '100%';
@ -495,7 +495,7 @@ class viewGraph {
if (isset($attr["width"])) if (isset($attr["width"]))
$table->size[$index] = $attr["width"]; $table->size[$index] = $attr["width"];
$index++; $index++;
} }
@ -511,7 +511,7 @@ class viewGraph {
$iterator++; $iterator++;
$data = array (); $data = array ();
foreach($columns as $col => $attr) { foreach($columns as $col => $attr) {
$data[] = $attr[1] ($row[$attr[0]]); $data[] = $attr[1] ($row[$attr[0]]);
} }

View File

@ -294,7 +294,7 @@ if ($count < 1) {
$table->data = array (); $table->data = array ();
$table->size = array (); $table->size = array ();
$table->align = array (); $table->align = array ();
$table->head[0] = __('ID'); $table->head[0] = __('ID');
$table->head[1] = __('Status'); $table->head[1] = __('Status');
$table->head[2] = __('Incident'); $table->head[2] = __('Incident');
@ -324,7 +324,7 @@ if ($count < 1) {
$iterator++; $iterator++;
$data = array(); $data = array();
$data[0] = '<a href="index.php?sec=workspace&amp;sec2=operation/incidents/incident_detail&amp;id='.$row["id_incidencia"].'">'.$row["id_incidencia"].'</a>'; $data[0] = '<a href="index.php?sec=workspace&amp;sec2=operation/incidents/incident_detail&amp;id='.$row["id_incidencia"].'">'.$row["id_incidencia"].'</a>';
$attach = incidents_get_attach ($row["id_incidencia"]); $attach = incidents_get_attach ($row["id_incidencia"]);

File diff suppressed because it is too large Load Diff