Merge branch 'pandora_5.1' of https://github.com/pandorafms/pandorafms into pandora_5.1

This commit is contained in:
m-lopez-f 2015-01-16 13:10:16 +01:00
commit a36b399b1f
3 changed files with 39 additions and 39 deletions

View File

@ -656,7 +656,7 @@ function process_upload_xml_component($xml) {
$tcp_send = $snmp_version; $tcp_send = $snmp_version;
$plugin_user = $auth_user; $plugin_user = $auth_user;
$plugin_pass = $auth_password; $plugin_pass = $auth_password;
$plugin_parameter = $auth_method; $plugin_parameters = $auth_method;
$custom_string_1 = $privacy_method; $custom_string_1 = $privacy_method;
$custom_string_2 = $privacy_pass; $custom_string_2 = $privacy_pass;
$custom_string_3 = $security_level; $custom_string_3 = $security_level;

View File

@ -527,23 +527,24 @@ function treeview_printTree($type) {
$first = true; $first = true;
foreach ($list as $item) { foreach ($list as $item) {
$lessBranchs = 0; $lessBranchs = 0;
$tree_img_id = "tree_image_" . $type . "__" . $item['_id_'];
if ($first) { if ($first) {
if ($item != end($list)) { if ($item != end($list)) {
$img = html_print_image ("operation/tree/first_closed.png", true, array ("style" => 'vertical-align: middle;', "id" => "tree_image_" . $type . "_" . $item['_id_'], "pos_tree" => "0")); $img = html_print_image ("operation/tree/first_closed.png", true, array ("style" => 'vertical-align: middle;', "id" => $tree_img_id, "pos_tree" => "0"));
$first = false; $first = false;
} }
else { else {
$lessBranchs = 1; $lessBranchs = 1;
$img = html_print_image ("operation/tree/one_closed.png", true, array ("style" => 'vertical-align: middle;', "id" => "tree_image_" . $type . "_" . $item['_id_'], "pos_tree" => "1")); $img = html_print_image ("operation/tree/one_closed.png", true, array ("style" => 'vertical-align: middle;', "id" => $tree_img_id, "pos_tree" => "1"));
} }
} }
else { else {
if ($item != end($list)) if ($item != end($list))
$img = html_print_image ("operation/tree/closed.png", true, array ("style" => 'vertical-align: middle;', "id" => "tree_image_" . $type . "_" . $item['_id_'], "pos_tree" => "2")); $img = html_print_image ("operation/tree/closed.png", true, array ("style" => 'vertical-align: middle;', "id" => $tree_img_id, "pos_tree" => "2"));
else else
{ {
$lessBranchs = 1; $lessBranchs = 1;
$img = html_print_image ("operation/tree/last_closed.png", true, array ("style" => 'vertical-align: middle;', "id" => "tree_image_" . $type . "_" . $item['_id_'], "pos_tree" => "3")); $img = html_print_image ("operation/tree/last_closed.png", true, array ("style" => 'vertical-align: middle;', "id" => $tree_img_id, "pos_tree" => "3"));
} }
} }
@ -580,7 +581,7 @@ function treeview_printTree($type) {
echo ') '. "</a>"; echo ') '. "</a>";
echo "<div hiddenDiv='1' loadDiv='0' style='margin: 0px; padding: 0px;' class='tree_view' id='tree_div_" . $type . "_" . $id . "'></div>"; echo "<div hiddenDiv='1' loadDiv='0' style='margin: 0px; padding: 0px;' class='tree_view' id='tree_div_" . $type . "__" . $id . "'></div>";
echo "</li>\n"; echo "</li>\n";
} }
echo "</ul>\n"; echo "</ul>\n";

View File

@ -224,11 +224,12 @@ if (is_ajax ()) {
} }
$less = $lessBranchs; $less = $lessBranchs;
$tree_img_id = "tree_image" . $id . "_agent_" . $type . "_" . $row["server_name"] . "_" . $row["id_agente"];
if ($count != $countRows) if ($count != $countRows)
$img = html_print_image ("operation/tree/closed.png", true, array ("style" => 'vertical-align: middle;', "id" => "tree_image" . $id . "_agent_" . $type . "_" . $row["id_agente"], "pos_tree" => "2")); $img = html_print_image ("operation/tree/closed.png", true, array ("style" => 'vertical-align: middle;', "id" => $tree_img_id, "pos_tree" => "2"));
else { else {
$less = $less + 2; // $less = $less or 0b10 $less = $less + 2; // $less = $less or 0b10
$img = html_print_image ("operation/tree/last_closed.png", true, array ("style" => 'vertical-align: middle;', "id" => "tree_image" . $id . "_agent_" . $type . "_" . $row["id_agente"], "pos_tree" => "3")); $img = html_print_image ("operation/tree/last_closed.png", true, array ("style" => 'vertical-align: middle;', "id" => $tree_img_id, "pos_tree" => "3"));
} }
echo "<li style='margin: 0; padding: 0;'>"; echo "<li style='margin: 0; padding: 0;'>";
echo "<a onfocus='JavaScript: this.blur()' echo "<a onfocus='JavaScript: this.blur()'
@ -262,7 +263,7 @@ if (is_ajax ()) {
html_print_image("images/dot_green.disabled.png", false, array("border" => '0', "title" => __('Quiet'), "alt" => "")); html_print_image("images/dot_green.disabled.png", false, array("border" => '0', "title" => __('Quiet'), "alt" => ""));
} }
echo "</a>"; echo "</a>";
echo "<div hiddenDiv='1' loadDiv='0' style='margin: 0px; padding: 0px;' class='tree_view' id='tree_div" . $id . "_agent_" . $type . "_" . $row["id_agente"] . "'></div>"; echo "<div hiddenDiv='1' loadDiv='0' style='margin: 0px; padding: 0px;' class='tree_view' id='tree_div" . $id . "_agent_" . $type . "_" . $row["server_name"] . "_" . $row["id_agente"] . "'></div>";
echo "</li>"; echo "</li>";
} }
@ -702,13 +703,11 @@ ui_require_jquery_file("ui.datepicker-" . get_user_language(), "include/javascri
* id_father int use in js and ajax php, its useful when you have a two subtrees with same agent for diferent each one * id_father int use in js and ajax php, its useful when you have a two subtrees with same agent for diferent each one
*/ */
function loadSubTree(type, div_id, less_branchs, id_father, server_name) { function loadSubTree(type, div_id, less_branchs, id_father, server_name) {
hiddenDiv = $('#tree_div' + id_father + '_' + type + '_' + div_id) var id = id_father + '_' + type + '_' + server_name + '_' + div_id;
.attr('hiddenDiv'); var hiddenDiv = $('#tree_div' + id).attr('hiddenDiv');
loadDiv = $('#tree_div' + id_father + '_' + type + '_' + div_id) var loadDiv = $('#tree_div' + id).attr('loadDiv');
.attr('loadDiv');
pos = parseInt($('#tree_image' + id_father + '_' + type + '_' + div_id) var pos = parseInt($('#tree_image' + id).attr('pos_tree'));
.attr('pos_tree'));
//If has yet ajax request running //If has yet ajax request running
if (loadDiv == 2) if (loadDiv == 2)
@ -717,12 +716,12 @@ ui_require_jquery_file("ui.datepicker-" . get_user_language(), "include/javascri
if (loadDiv == 0) { if (loadDiv == 0) {
//Put an spinner to simulate loading process //Put an spinner to simulate loading process
$('#tree_div' + id_father + '_' + type + '_' + div_id) $('#tree_div' + id)
.html("<img style='padding-top:10px;padding-bottom:10px;padding-left:20px;' src=images/spinner.gif>"); .html("<img style='padding-top:10px;padding-bottom:10px;padding-left:20px;' src=images/spinner.gif>");
$('#tree_div' + id_father + '_' + type + '_' + div_id) $('#tree_div' + id)
.show('normal'); .show('normal');
$('#tree_div'+id_father+'_'+type+'_'+div_id).attr('loadDiv', 2); $('#tree_div'+id).attr('loadDiv', 2);
$.ajax({ $.ajax({
type: "POST", type: "POST",
url: <?php echo '"' . ui_get_full_url("ajax.php", false, false, false) . '"'; ?>, url: <?php echo '"' . ui_get_full_url("ajax.php", false, false, false) . '"'; ?>,
@ -739,9 +738,9 @@ ui_require_jquery_file("ui.datepicker-" . get_user_language(), "include/javascri
}, },
success: function(msg) { success: function(msg) {
if (msg.length != 0) { if (msg.length != 0) {
$('#tree_div'+id_father+'_'+type+'_'+div_id).hide(); $('#tree_div'+id).hide();
$('#tree_div'+id_father+'_'+type+'_'+div_id).html(msg); $('#tree_div'+id).html(msg);
$('#tree_div'+id_father+'_'+type+'_'+div_id).show('normal'); $('#tree_div'+id).show('normal');
//change image of tree [+] to [-] //change image of tree [+] to [-]
<?php if (! defined ('METACONSOLE')) { <?php if (! defined ('METACONSOLE')) {
@ -753,20 +752,20 @@ ui_require_jquery_file("ui.datepicker-" . get_user_language(), "include/javascri
?> ?>
switch (pos) { switch (pos) {
case 0: case 0:
$('#tree_image'+id_father+'_'+type+'_'+div_id).attr('src',icon_path+'/first_expanded.png'); $('#tree_image'+id).attr('src',icon_path+'/first_expanded.png');
break; break;
case 1: case 1:
$('#tree_image'+id_father+'_'+type+'_'+div_id).attr('src',icon_path+'/one_expanded.png'); $('#tree_image'+id).attr('src',icon_path+'/one_expanded.png');
break; break;
case 2: case 2:
$('#tree_image'+id_father+'_'+type+'_'+div_id).attr('src',icon_path+'/expanded.png'); $('#tree_image'+id).attr('src',icon_path+'/expanded.png');
break; break;
case 3: case 3:
$('#tree_image'+id_father+'_'+type+'_'+div_id).attr('src',icon_path+'/last_expanded.png'); $('#tree_image'+id).attr('src',icon_path+'/last_expanded.png');
break; break;
} }
$('#tree_div'+id_father+'_'+type+'_'+div_id).attr('hiddendiv',0); $('#tree_div'+id).attr('hiddendiv',0);
$('#tree_div'+id_father+'_'+type+'_'+div_id).attr('loadDiv', 1); $('#tree_div'+id).attr('loadDiv', 1);
} }
// Refresh forced title callback to work with html code created dinamicly // Refresh forced title callback to work with html code created dinamicly
@ -784,22 +783,22 @@ ui_require_jquery_file("ui.datepicker-" . get_user_language(), "include/javascri
} }
?> ?>
if (hiddenDiv == 0) { if (hiddenDiv == 0) {
$('#tree_div'+id_father+'_'+type+'_'+div_id).hide('normal'); $('#tree_div'+id).hide('normal');
$('#tree_div'+id_father+'_'+type+'_'+div_id).attr('hiddenDiv',1); $('#tree_div'+id).attr('hiddenDiv',1);
//change image of tree [-] to [+] //change image of tree [-] to [+]
switch (pos) { switch (pos) {
case 0: case 0:
$('#tree_image'+id_father+'_'+type+'_'+div_id).attr('src',icon_path+'/first_closed.png'); $('#tree_image'+id).attr('src',icon_path+'/first_closed.png');
break; break;
case 1: case 1:
$('#tree_image'+id_father+'_'+type+'_'+div_id).attr('src',icon_path+'/one_closed.png'); $('#tree_image'+id).attr('src',icon_path+'/one_closed.png');
break; break;
case 2: case 2:
$('#tree_image'+id_father+'_'+type+'_'+div_id).attr('src',icon_path+'/closed.png'); $('#tree_image'+id).attr('src',icon_path+'/closed.png');
break; break;
case 3: case 3:
$('#tree_image'+id_father+'_'+type+'_'+div_id).attr('src',icon_path+'/last_closed.png'); $('#tree_image'+id).attr('src',icon_path+'/last_closed.png');
break; break;
} }
} }
@ -807,21 +806,21 @@ ui_require_jquery_file("ui.datepicker-" . get_user_language(), "include/javascri
//change image of tree [+] to [-] //change image of tree [+] to [-]
switch (pos) { switch (pos) {
case 0: case 0:
$('#tree_image'+id_father+'_'+type+'_'+div_id).attr('src',icon_path+'/first_expanded.png'); $('#tree_image'+id).attr('src',icon_path+'/first_expanded.png');
break; break;
case 1: case 1:
$('#tree_image'+id_father+'_'+type+'_'+div_id).attr('src',icon_path+'/one_expanded.png'); $('#tree_image'+id).attr('src',icon_path+'/one_expanded.png');
break; break;
case 2: case 2:
$('#tree_image'+id_father+'_'+type+'_'+div_id).attr('src',icon_path+'/expanded.png'); $('#tree_image'+id).attr('src',icon_path+'/expanded.png');
break; break;
case 3: case 3:
$('#tree_image'+id_father+'_'+type+'_'+div_id).attr('src',icon_path+'/last_expanded.png'); $('#tree_image'+id).attr('src',icon_path+'/last_expanded.png');
break; break;
} }
$('#tree_div'+id_father+'_'+type+'_'+div_id).show('normal'); $('#tree_div'+id).show('normal');
$('#tree_div'+id_father+'_'+type+'_'+div_id).attr('hiddenDiv',0); $('#tree_div'+id).attr('hiddenDiv',0);
} }
} }
} }