";
echo "";
+
$cluster_agents_in = agents_get_cluster_agents($id_cluster);
- // $cluster_modules_all = db_get_all_rows_sql('SELECT DISTINCT nombre, id_agente_modulo
- // FROM tagente_modulo t1
- // WHERE t1.delete_pending = 0
- // AND t1.id_agente IN ()
- // AND (
- // SELECT count(nombre)
- // FROM tagente_modulo t2
- // t1.nombre = t2.nombre
- // AND t2.id_agente IN () = (' . count($cluster_agents_in) . ')
- // ORDER BY nombre');
-
+ $serialize_agents = '';
- html_print_select ($cluster_modules_all, 'id_modules[]', 0, false, '', '', false, true, true, '', false, 'width: 100%;', $option_style);
+ foreach ($cluster_agents_in as $value) {
+
+ if ($value === end($cluster_agents_in)) {
+ $serialize_agents .= $value;
+ }
+ else{
+ $serialize_agents .= $value.',';
+ }
+
+ }
+
+ $cluster_modules_in = items_get_cluster_items_name($id_cluster);
+
+ $cluster_modules_all = db_get_all_rows_sql('select count(nombre) as total ,nombre, id_agente_modulo,id_agente FROM
+ tagente_modulo where id_agente in (3,4) group by nombre having total = '.count($cluster_agents_in));
+
+ foreach ($cluster_modules_all as $key => $value) {
+ $cluster_modules_all_name[$value['nombre']] = $value['nombre'];
+ }
+
+ $cluster_modules_all_diff = array_diff($cluster_modules_all_name,$cluster_modules_in);
+
+ html_print_select ($cluster_modules_all_diff, 'name_modules[]', 0, false, '', '', false, true, true, '', false, 'width: 100%;', $option_style);
echo " | ";
echo "";
echo " ";
- html_print_image ('images/darrowright.png', false, array ('id' => 'right', 'title' => __('Add modules to cluster')));
+ html_print_image ('images/darrowright.png', false, array ('id' => 'module_right', 'title' => __('Add modules to cluster')));
echo "
";
- html_print_image ('images/darrowleft.png', false, array ('id' => 'left', 'title' => __('Drop modules to cluster')));
+ html_print_image ('images/darrowleft.png', false, array ('id' => 'module_left', 'title' => __('Drop modules to cluster')));
echo "
";
echo " | ";
echo "";
- html_print_select ($cluster_modules_in, 'id_agents2[]', 0, false, '', '', false, true, true, '', false, 'width: 100%;', $option_style);
+ html_print_select ($cluster_modules_in, 'name_modules2[]', 0, false, '', '', false, true, true, '', false, 'width: 100%;', $option_style);
echo " | ";
echo "
";
@@ -204,6 +217,7 @@ elseif ($step == 3) {
}
elseif (condition) {
html_debug('paso 4');
+ echo "