diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index e57c860571..e6e6a69fb5 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,21 @@ +2011-01-19 Miguel de Dios + + * godmode/agentes/module_manager.php: added to call to enterprise functions + to delete "pseudo code" of local module when delete in multiple delete + action. + + Fixes: #3161621 + + * include/functions_filemanager.php: cleaned source code old unused + comments. + + * include/functions_ui.php: in function "printTruncateText" fixed when pass + 0 character to trunk, now return all text. And in function + "print_agent_name" cleaned source code style. + + * operation/agentes/estado_agente.php: fixed order of params in the call + of function "print_agent_name". + 2011-01-19 Miguel de Dios * include/functions_visual_map.php, diff --git a/pandora_console/godmode/agentes/module_manager.php b/pandora_console/godmode/agentes/module_manager.php index 31a6841acb..20525c8f78 100644 --- a/pandora_console/godmode/agentes/module_manager.php +++ b/pandora_console/godmode/agentes/module_manager.php @@ -91,6 +91,9 @@ if ($multiple_delete) { exit; } + enterprise_include_once('include/functions_config_agents.php'); + enterprise_hook('deleteLocalModuleInConf', array(get_agentmodule_agent($id_agent_module_del), get_agentmodule_name($id_agent_module_del))); + //Init transaction $error = 0; process_sql_begin (); diff --git a/pandora_console/include/functions_filemanager.php b/pandora_console/include/functions_filemanager.php index a6ff707a17..7afbc1d00d 100644 --- a/pandora_console/include/functions_filemanager.php +++ b/pandora_console/include/functions_filemanager.php @@ -392,18 +392,12 @@ function read_recursive_dir($dir, $relative_path = '') { { while (false !== ($entry = readdir($handle))) { if (($entry != ".") && ($entry != "..")) { - -// debugPrint($entry); -// debugPrint($return); - if (is_dir($dir . $entry)) { -// debugPrint('dir'); $return = array_merge($return, read_recursive_dir($dir . $entry . '/', $relative_path . $entry . '/' )); } else { -// debugPrint('file'); $return[] = array('relative' => $relative_path . $entry, 'absolute' => $dir . $entry); } } diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php index 3633fb5434..98a0a58eb3 100644 --- a/pandora_console/include/functions_ui.php +++ b/pandora_console/include/functions_ui.php @@ -31,13 +31,22 @@ * @param string $suffix String at the end of a strimmed string. */ function printTruncateText($text, $numChars = 25, $showTextInAToopTip = true, $return = true, $showTextInTitle = true, $suffix = '[…]') { + if ($numChars == 0) { + if ($return == true) { + return $text; + } + else { + echo $text; + } + } + $text = safe_output_html($text); if ((strlen($text)) > ($numChars)) { - $l=intval(($numChars-3)/2); // '/2' because [...] is in the middle of the word. - $truncateText2 = mb_strimwidth($text, (strlen($text)-$l), strlen($text)); + $half_lenght = intval(($numChars - 3) / 2); // '/2' because [...] is in the middle of the word. + $truncateText2 = mb_strimwidth($text, (strlen($text) - $half_lenght), strlen($text)); // In case $numChars were an odd number. - $l=$numChars-$l-3; - $truncateText = mb_strimwidth($text, 0, $l) . $suffix; + $half_lenght = $numChars - $half_lenght - 3; + $truncateText = mb_strimwidth($text, 0, $half_lenght) . $suffix; $truncateText=$truncateText . $truncateText2; if ($showTextInTitle) { @@ -350,7 +359,7 @@ function print_os_icon ($id_os, $name = true, $return = false) { function print_agent_name ($id_agent, $return = false, $cutoff = 0, $style = '', $cutname = false) { $agent_name = (string) get_agent_name ($id_agent); $agent_name_full = $agent_name; - if($cutname) { + if ($cutname) { $agent_name = printTruncateText($agent_name, $cutoff); } $output = ''.$agent_name.''; diff --git a/pandora_console/operation/agentes/estado_agente.php b/pandora_console/operation/agentes/estado_agente.php index 7dd8a5222f..f24ead40c3 100644 --- a/pandora_console/operation/agentes/estado_agente.php +++ b/pandora_console/operation/agentes/estado_agente.php @@ -297,7 +297,7 @@ foreach ($agents as $agent) { $data[0] .= ' '; } - $data[0] .= print_agent_name ($agent["id_agente"], true, "none", '', 23); + $data[0] .= print_agent_name($agent["id_agente"], true, 0, 'none', true); $data[1] = print_os_icon ($agent["id_os"], false, true);