2011-01-19 Miguel de Dios <miguel.dedios@artica.es>

* 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".



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3751 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2011-01-20 13:47:27 +00:00
parent 3a02320e3f
commit 7c6b945524
5 changed files with 36 additions and 12 deletions

View File

@ -1,3 +1,21 @@
2011-01-19 Miguel de Dios <miguel.dedios@artica.es>
* 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 <miguel.dedios@artica.es> 2011-01-19 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_visual_map.php, * include/functions_visual_map.php,

View File

@ -91,6 +91,9 @@ if ($multiple_delete) {
exit; 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 //Init transaction
$error = 0; $error = 0;
process_sql_begin (); process_sql_begin ();

View File

@ -392,18 +392,12 @@ function read_recursive_dir($dir, $relative_path = '') {
{ {
while (false !== ($entry = readdir($handle))) { while (false !== ($entry = readdir($handle))) {
if (($entry != ".") && ($entry != "..")) { if (($entry != ".") && ($entry != "..")) {
// debugPrint($entry);
// debugPrint($return);
if (is_dir($dir . $entry)) if (is_dir($dir . $entry))
{ {
// debugPrint('dir');
$return = array_merge($return, read_recursive_dir($dir . $entry . '/', $relative_path . $entry . '/' )); $return = array_merge($return, read_recursive_dir($dir . $entry . '/', $relative_path . $entry . '/' ));
} }
else else
{ {
// debugPrint('file');
$return[] = array('relative' => $relative_path . $entry, 'absolute' => $dir . $entry); $return[] = array('relative' => $relative_path . $entry, 'absolute' => $dir . $entry);
} }
} }

View File

@ -31,13 +31,22 @@
* @param string $suffix String at the end of a strimmed string. * @param string $suffix String at the end of a strimmed string.
*/ */
function printTruncateText($text, $numChars = 25, $showTextInAToopTip = true, $return = true, $showTextInTitle = true, $suffix = '[&hellip;]') { function printTruncateText($text, $numChars = 25, $showTextInAToopTip = true, $return = true, $showTextInTitle = true, $suffix = '[&hellip;]') {
if ($numChars == 0) {
if ($return == true) {
return $text;
}
else {
echo $text;
}
}
$text = safe_output_html($text); $text = safe_output_html($text);
if ((strlen($text)) > ($numChars)) { if ((strlen($text)) > ($numChars)) {
$l=intval(($numChars-3)/2); // '/2' because [...] is in the middle of the word. $half_lenght = intval(($numChars - 3) / 2); // '/2' because [...] is in the middle of the word.
$truncateText2 = mb_strimwidth($text, (strlen($text)-$l), strlen($text)); $truncateText2 = mb_strimwidth($text, (strlen($text) - $half_lenght), strlen($text));
// In case $numChars were an odd number. // In case $numChars were an odd number.
$l=$numChars-$l-3; $half_lenght = $numChars - $half_lenght - 3;
$truncateText = mb_strimwidth($text, 0, $l) . $suffix; $truncateText = mb_strimwidth($text, 0, $half_lenght) . $suffix;
$truncateText=$truncateText . $truncateText2; $truncateText=$truncateText . $truncateText2;
if ($showTextInTitle) { if ($showTextInTitle) {

View File

@ -297,7 +297,7 @@ foreach ($agents as $agent) {
$data[0] .= '</a>&nbsp;'; $data[0] .= '</a>&nbsp;';
} }
$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); $data[1] = print_os_icon ($agent["id_os"], false, true);