diff --git a/pandora_console/include/functions_treeview.php b/pandora_console/include/functions_treeview.php index 17f0ea5bfe..03c36ccfa8 100755 --- a/pandora_console/include/functions_treeview.php +++ b/pandora_console/include/functions_treeview.php @@ -527,23 +527,24 @@ function treeview_printTree($type) { $first = true; foreach ($list as $item) { $lessBranchs = 0; + $tree_img_id = "tree_image_" . $type . "_" . $item['_id_']; if ($first) { 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_image_id, "pos_tree" => "0")); $first = false; } else { $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 { 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 { $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")); } } diff --git a/pandora_console/operation/tree.php b/pandora_console/operation/tree.php index d941324600..5dba1169ad 100755 --- a/pandora_console/operation/tree.php +++ b/pandora_console/operation/tree.php @@ -224,11 +224,12 @@ if (is_ajax ()) { } $less = $lessBranchs; + $tree_img_id = "tree_image" . $id . "_agent_" . $type . "_" . $row["id_agente"]; 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 { $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 "
  • "; echo ""); - $('#tree_div' + id_father + '_' + type + '_' + div_id) + $('#tree_div' + id) .show('normal'); - $('#tree_div'+id_father+'_'+type+'_'+div_id).attr('loadDiv', 2); + $('#tree_div'+id).attr('loadDiv', 2); $.ajax({ type: "POST", url: , @@ -739,9 +738,9 @@ ui_require_jquery_file("ui.datepicker-" . get_user_language(), "include/javascri }, success: function(msg) { if (msg.length != 0) { - $('#tree_div'+id_father+'_'+type+'_'+div_id).hide(); - $('#tree_div'+id_father+'_'+type+'_'+div_id).html(msg); - $('#tree_div'+id_father+'_'+type+'_'+div_id).show('normal'); + $('#tree_div'+id).hide(); + $('#tree_div'+id).html(msg); + $('#tree_div'+id).show('normal'); //change image of tree [+] to [-] switch (pos) { 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; 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; 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; 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; } - $('#tree_div'+id_father+'_'+type+'_'+div_id).attr('hiddendiv',0); - $('#tree_div'+id_father+'_'+type+'_'+div_id).attr('loadDiv', 1); + $('#tree_div'+id).attr('hiddendiv',0); + $('#tree_div'+id).attr('loadDiv', 1); } // 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) { - $('#tree_div'+id_father+'_'+type+'_'+div_id).hide('normal'); - $('#tree_div'+id_father+'_'+type+'_'+div_id).attr('hiddenDiv',1); + $('#tree_div'+id).hide('normal'); + $('#tree_div'+id).attr('hiddenDiv',1); //change image of tree [-] to [+] switch (pos) { 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; 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; 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; 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; } } @@ -807,21 +806,21 @@ ui_require_jquery_file("ui.datepicker-" . get_user_language(), "include/javascri //change image of tree [+] to [-] switch (pos) { 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; 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; 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; 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; } - $('#tree_div'+id_father+'_'+type+'_'+div_id).show('normal'); - $('#tree_div'+id_father+'_'+type+'_'+div_id).attr('hiddenDiv',0); + $('#tree_div'+id).show('normal'); + $('#tree_div'+id).attr('hiddenDiv',0); } } }