Merge branch 'develop' of https://github.com/pandorafms/pandorafms into develop
This commit is contained in:
commit
1a20a5b025
|
@ -209,7 +209,7 @@ function mainInsertData() {
|
||||||
|
|
||||||
var inputs = [];
|
var inputs = [];
|
||||||
inputs.push ("agent_name=" + agent_name);
|
inputs.push ("agent_name=" + agent_name);
|
||||||
inputs.push ('filter=delete_pending = 0');
|
inputs.push ("delete_pending=0");
|
||||||
inputs.push ("get_agent_modules_json=1");
|
inputs.push ("get_agent_modules_json=1");
|
||||||
inputs.push ("page=operation/agentes/ver_agente");
|
inputs.push ("page=operation/agentes/ver_agente");
|
||||||
jQuery.ajax ({
|
jQuery.ajax ({
|
||||||
|
|
|
@ -316,8 +316,8 @@ $(document).ready (function () {
|
||||||
{"page" : "operation/agentes/ver_agente",
|
{"page" : "operation/agentes/ver_agente",
|
||||||
"get_agent_modules_json" : 1,
|
"get_agent_modules_json" : 1,
|
||||||
"id_agent" : this.value,
|
"id_agent" : this.value,
|
||||||
"filter" : "disabled = 0",
|
"disabled" : 0,
|
||||||
"fields" : "id_agente_modulo,nombre"
|
"get_id_and_name" : 1
|
||||||
},
|
},
|
||||||
function (data, status) {
|
function (data, status) {
|
||||||
if (data.length == 0) {
|
if (data.length == 0) {
|
||||||
|
|
|
@ -412,25 +412,23 @@ $(document).ready (function () {
|
||||||
$("tr#delete_table-edit1, tr#delete_table-edit2, tr#delete_table-edit3, tr#delete_table-edit35, tr#delete_table-edit4, tr#delete_table-edit5, tr#delete_table-edit6, tr#delete_table-edit7, tr#delete_table-edit8")
|
$("tr#delete_table-edit1, tr#delete_table-edit2, tr#delete_table-edit3, tr#delete_table-edit35, tr#delete_table-edit4, tr#delete_table-edit5, tr#delete_table-edit6, tr#delete_table-edit7, tr#delete_table-edit8")
|
||||||
.hide ();
|
.hide ();
|
||||||
|
|
||||||
if (this.value == '0') {
|
var params = {
|
||||||
filter = '';
|
"page" : "operation/agentes/ver_agente",
|
||||||
}
|
"get_agent_modules_json" : 1,
|
||||||
else {
|
"get_distinct_name" : 1,
|
||||||
filter = "id_tipo_modulo="+this.value;
|
"indexed" : 0,
|
||||||
}
|
"privilege" : "AW"
|
||||||
|
};
|
||||||
|
|
||||||
|
if (this.value != '0')
|
||||||
|
params['id_tipo_modulo'] = this.value;
|
||||||
|
|
||||||
$("#module_loading").show ();
|
$("#module_loading").show ();
|
||||||
$("tr#delete_table-edit1, tr#delete_table-edit2").hide ();
|
$("tr#delete_table-edit1, tr#delete_table-edit2").hide ();
|
||||||
$("#module_name").attr ("disabled", "disabled")
|
$("#module_name").attr ("disabled", "disabled")
|
||||||
$("#module_name option[value!=0]").remove ();
|
$("#module_name option[value!=0]").remove ();
|
||||||
jQuery.post ("ajax.php",
|
jQuery.post ("ajax.php",
|
||||||
{"page" : "operation/agentes/ver_agente",
|
params,
|
||||||
"get_agent_modules_json" : 1,
|
|
||||||
"filter" : filter,
|
|
||||||
"fields" : "DISTINCT(nombre)",
|
|
||||||
"indexed" : 0,
|
|
||||||
"privilege" : "AW"
|
|
||||||
},
|
|
||||||
function (data, status) {
|
function (data, status) {
|
||||||
jQuery.each (data, function (id, value) {
|
jQuery.each (data, function (id, value) {
|
||||||
option = $("<option></option>")
|
option = $("<option></option>")
|
||||||
|
|
|
@ -675,24 +675,22 @@ $(document).ready (function () {
|
||||||
"tr#delete_table-edit13, " +
|
"tr#delete_table-edit13, " +
|
||||||
"tr#delete_table-edit14").hide ();
|
"tr#delete_table-edit14").hide ();
|
||||||
|
|
||||||
if (this.value == '0') {
|
var params = {
|
||||||
filter = '';
|
"page" : "operation/agentes/ver_agente",
|
||||||
}
|
"get_agent_modules_json" : 1,
|
||||||
else {
|
"get_distinct_name" : 1,
|
||||||
filter = "id_tipo_modulo="+this.value;
|
"indexed" : 0
|
||||||
}
|
};
|
||||||
|
|
||||||
|
if (this.value != '0')
|
||||||
|
params['id_tipo_modulo'] = this.value;
|
||||||
|
|
||||||
$("#module_loading").show ();
|
$("#module_loading").show ();
|
||||||
$("tr#delete_table-edit1, tr#delete_table-edit2").hide ();
|
$("tr#delete_table-edit1, tr#delete_table-edit2").hide ();
|
||||||
$("#module_name").attr ("disabled", "disabled")
|
$("#module_name").attr ("disabled", "disabled")
|
||||||
$("#module_name option[value!=0]").remove ();
|
$("#module_name option[value!=0]").remove ();
|
||||||
jQuery.post ("ajax.php",
|
jQuery.post ("ajax.php",
|
||||||
{"page" : "operation/agentes/ver_agente",
|
params,
|
||||||
"get_agent_modules_json" : 1,
|
|
||||||
"filter" : filter,
|
|
||||||
"fields" : "DISTINCT(nombre)",
|
|
||||||
"indexed" : 0
|
|
||||||
},
|
|
||||||
function (data, status) {
|
function (data, status) {
|
||||||
jQuery.each (data, function (id, value) {
|
jQuery.each (data, function (id, value) {
|
||||||
option = $("<option></option>").attr ("value", value["nombre"]).html (value["nombre"]);
|
option = $("<option></option>").attr ("value", value["nombre"]).html (value["nombre"]);
|
||||||
|
|
|
@ -2951,7 +2951,7 @@ function ui_print_agent_autocomplete_input($parameters) {
|
||||||
|
|
||||||
var inputs = [];
|
var inputs = [];
|
||||||
inputs.push ("agent_name=" + agent_name);
|
inputs.push ("agent_name=" + agent_name);
|
||||||
inputs.push ("filter=delete_pending = 0");
|
inputs.push ("delete_pending=0");
|
||||||
inputs.push ("get_agent_modules_json=1");
|
inputs.push ("get_agent_modules_json=1");
|
||||||
inputs.push ("page=operation/agentes/ver_agente");
|
inputs.push ("page=operation/agentes/ver_agente");
|
||||||
|
|
||||||
|
|
|
@ -89,7 +89,10 @@
|
||||||
callbackPre: dummyFunc,
|
callbackPre: dummyFunc,
|
||||||
callbackPost: dummyFunc,
|
callbackPost: dummyFunc,
|
||||||
callbackAfter: dummyFunc,
|
callbackAfter: dummyFunc,
|
||||||
moduleFilter: 'disabled=0 AND delete_pending=0',
|
moduleFilter: {
|
||||||
|
disabled: 0,
|
||||||
|
deletePending: 0
|
||||||
|
},
|
||||||
debug: false
|
debug: false
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -107,12 +110,14 @@
|
||||||
$("option[value!=0]", $select).remove ();
|
$("option[value!=0]", $select).remove ();
|
||||||
if (! config.callbackBefore (this))
|
if (! config.callbackBefore (this))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
jQuery.post ('ajax.php',
|
jQuery.post ('ajax.php',
|
||||||
{"page": "operation/agentes/ver_agente",
|
{
|
||||||
|
"page": "operation/agentes/ver_agente",
|
||||||
"get_agent_modules_json": 1,
|
"get_agent_modules_json": 1,
|
||||||
"id_agent": this.value,
|
"id_agent": this.value,
|
||||||
"filter" : config.moduleFilter,
|
"disabled": config.moduleFilter.disabled,
|
||||||
"fields" : "id_agente_modulo,nombre"
|
"delete_pending": config.moduleFilter.deletePending
|
||||||
},
|
},
|
||||||
function (data) {
|
function (data) {
|
||||||
jQuery.each (data, function (i, value) {
|
jQuery.each (data, function (i, value) {
|
||||||
|
|
|
@ -415,8 +415,34 @@ if (is_ajax ()) {
|
||||||
|
|
||||||
if ($get_agent_modules_json) {
|
if ($get_agent_modules_json) {
|
||||||
$id_agent = (int) get_parameter ('id_agent');
|
$id_agent = (int) get_parameter ('id_agent');
|
||||||
$filter = io_safe_output((string) get_parameter ('filter'));
|
|
||||||
$fields = io_safe_output((string) get_parameter ('fields'));
|
// Use -1 as not received
|
||||||
|
$disabled = (int) get_parameter ('disabled', -1);
|
||||||
|
$delete_pending = (int) get_parameter ('delete_pending', -1);
|
||||||
|
// Use 0 as not received
|
||||||
|
$id_tipo_modulo = (int) get_parameter ('id_tipo_modulo', 0);
|
||||||
|
|
||||||
|
// Filter
|
||||||
|
$filter = array();
|
||||||
|
if ($disabled !== -1)
|
||||||
|
$filter['disabled'] = $disabled;
|
||||||
|
if ($delete_pending !== -1)
|
||||||
|
$filter['delete_pending'] = $delete_pending;
|
||||||
|
if (!empty($id_tipo_modulo))
|
||||||
|
$filter['id_tipo_modulo'] = $id_tipo_modulo;
|
||||||
|
if (empty($filter))
|
||||||
|
$filter = false;
|
||||||
|
|
||||||
|
$get_id_and_name = (bool) get_parameter ('get_id_and_name');
|
||||||
|
$get_distinct_name = (bool) get_parameter ('get_distinct_name');
|
||||||
|
|
||||||
|
// Fields
|
||||||
|
$fields = '*';
|
||||||
|
if ($get_id_and_name)
|
||||||
|
$fields = array('id_agente_modulo', 'nombre');
|
||||||
|
if ($get_distinct_name)
|
||||||
|
$fields = array('DISTINCT(nombre)');
|
||||||
|
|
||||||
$indexed = (bool) get_parameter ('indexed', true);
|
$indexed = (bool) get_parameter ('indexed', true);
|
||||||
$agentName = (string) get_parameter ('agent_name', null);
|
$agentName = (string) get_parameter ('agent_name', null);
|
||||||
$server_name = (string) get_parameter ('server_name', null);
|
$server_name = (string) get_parameter ('server_name', null);
|
||||||
|
@ -431,7 +457,7 @@ if (is_ajax ()) {
|
||||||
else
|
else
|
||||||
$search = false;
|
$search = false;
|
||||||
|
|
||||||
if ($config ['metaconsole'] == 1 and !$force_local_modules and defined('METACONSOLE')) {
|
if (is_metaconsole() && !$force_local_modules) {
|
||||||
if (enterprise_include_once ('include/functions_metaconsole.php') !== ENTERPRISE_NOT_HOOK) {
|
if (enterprise_include_once ('include/functions_metaconsole.php') !== ENTERPRISE_NOT_HOOK) {
|
||||||
$connection = metaconsole_get_connection($server_name);
|
$connection = metaconsole_get_connection($server_name);
|
||||||
|
|
||||||
|
@ -448,9 +474,7 @@ if (is_ajax ()) {
|
||||||
agents_get_group_agents(
|
agents_get_group_agents(
|
||||||
array_keys (users_get_groups ()), $search, "none"));
|
array_keys (users_get_groups ()), $search, "none"));
|
||||||
|
|
||||||
$agent_modules = agents_get_modules ($id_agent,
|
$agent_modules = agents_get_modules ($id_agent, $fields, $filter, $indexed);
|
||||||
($fields != '' ? explode (',', $fields) : "*"),
|
|
||||||
($filter != '' ? $filter : false), $indexed);
|
|
||||||
}
|
}
|
||||||
// Restore db connection
|
// Restore db connection
|
||||||
metaconsole_restore_db();
|
metaconsole_restore_db();
|
||||||
|
@ -463,9 +487,7 @@ if (is_ajax ()) {
|
||||||
agents_get_group_agents(
|
agents_get_group_agents(
|
||||||
array_keys(users_get_groups ()), $search, "none"));
|
array_keys(users_get_groups ()), $search, "none"));
|
||||||
|
|
||||||
$agent_modules = agents_get_modules ($id_agent,
|
$agent_modules = agents_get_modules ($id_agent, $fields, $filter, $indexed);
|
||||||
($fields != '' ? explode (',', $fields) : "*"),
|
|
||||||
($filter != '' ? $filter : false), $indexed);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($agent_modules))
|
if (empty($agent_modules))
|
||||||
|
|
Loading…
Reference in New Issue