0, '`tagente_modulo`.disabled' => 0), array ('tagente.id_agente', 'tagente.nombre')); echo json_encode (index_array ($agents_modules, 'id_agente', 'nombre')); return; } return; } echo '

'.__('Massive modules deletion').'

'; function process_manage_delete ($module_name, $id_agents) { if (empty ($module_name)) { echo '

'.__('No module selected').'

'; return false; } if (empty ($id_agents)) { echo '

'.__('No agents selected').'

'; return false; } process_sql_begin (); $modules = get_agent_modules ($id_agents, 'id_agente_modulo', array ('nombre' => $module_name), true); $success = delete_agent_module ($modules); if (! $success) { echo '

'.__('There was an error deleting the modules, the operation has been cancelled').'

'; echo '

'.__('Could not delete modules').'

'; process_sql_rollback (); } else { echo '

'.__('Successfully deleted').'

'; process_sql_commit (); } } $id_group = (int) get_parameter ('id_group'); $id_agents = (array) get_parameter ('id_agents'); $module_name = (string) get_parameter ('module_name'); $delete = (bool) get_parameter_post ('delete'); if ($delete) { process_manage_delete ($module_name, $id_agents); } $groups = get_user_groups (); $table->id = 'delete_table'; $table->width = '95%'; $table->data = array (); $table->style = array (); $table->style[0] = 'font-weight: bold; vertical-align:top'; $table->style[2] = 'font-weight: bold'; $table->size = array (); $table->size[0] = '15%'; $table->size[1] = '85%'; $table->data = array (); $table->data[0][0] = __('Modules'); $modules = array (); $modules = get_db_all_rows_filter ('tagente_modulo', false, 'DISTINCT(nombre)'); $table->data[0][1] = print_select (index_array ($modules, 'nombre', 'nombre'), 'module_name', $module_name, false, __('Select'), '', true); $table->data[1][0] = __('Group'); $table->data[1][1] = print_select ($groups, 'id_group', $id_group, false, '', '', true, false, true, '', empty ($module_name)); $table->data[2][0] = __('Agent'); $table->data[2][0] .= ''; $agents = get_agents_with_module_name ($module_name, $id_group, array ('delete_pending' => 0, '`tagente_modulo`.disabled' => 0), array ('tagente.id_agente', 'tagente.nombre')); $table->data[2][1] = print_select (index_array ($agents, 'id_agente', 'nombre'), 'id_agents[]', 0, false, __('None'), 0, true, true, true, '', empty ($module_name)); echo '
'; print_table ($table); echo '
'; print_input_hidden ('delete', 1); print_submit_button (__('Delete'), 'go', false, 'class="sub delete"'); echo '
'; echo '
'; echo ''; require_jquery_file ('form'); require_jquery_file ('pandora.controls'); ?>