mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-29 16:55:05 +02:00
[Tags performance] Fixed tags filter and removed unwanted code
This commit is contained in:
parent
052d888ac4
commit
28f9e152e7
@ -2146,7 +2146,9 @@ function tags_get_user_groups_and_tags ($id_user = false, $access = 'AR', $stric
|
|||||||
|
|
||||||
$return = array();
|
$return = array();
|
||||||
foreach ($acls as $acl) {
|
foreach ($acls as $acl) {
|
||||||
$return[$acl["id_grupo"]] = implode(",",$acl["tags"][get_acl_column($access)]);
|
$return[$acl["id_grupo"]] = isset($acl["tags"][get_acl_column($access)])
|
||||||
|
? implode(",",$acl["tags"][get_acl_column($access)])
|
||||||
|
: "";
|
||||||
}
|
}
|
||||||
|
|
||||||
return $return;
|
return $return;
|
||||||
|
@ -65,58 +65,6 @@ Array.prototype.in_array = function () {
|
|||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* Fill up select box with id "module" with modules after agent has been selected
|
|
||||||
*
|
|
||||||
* @param event that has been triggered
|
|
||||||
* @param id_agent Agent ID that has been selected
|
|
||||||
* @param selected Which module(s) have to be selected
|
|
||||||
*/
|
|
||||||
function agent_changed (event, id_agent, selected) {
|
|
||||||
if (id_agent == undefined)
|
|
||||||
id_agent = this.value;
|
|
||||||
$('#module').attr ('disabled', 1);
|
|
||||||
$('#module').empty ();
|
|
||||||
$('#module').append ($('<option></option>').html ("Loading...").attr ("value", 0));
|
|
||||||
jQuery.post ('ajax.php',
|
|
||||||
{"page": "operation/agentes/ver_agente",
|
|
||||||
"get_agent_modules_json": 1,
|
|
||||||
"id_agent": id_agent
|
|
||||||
},
|
|
||||||
function (data) {
|
|
||||||
|
|
||||||
$('#module').empty ();
|
|
||||||
|
|
||||||
if (typeof($(document).data('text_for_module')) != 'undefined') {
|
|
||||||
$('#module').append ($('<option></option>').html ($(document).data('text_for_module')).attr("value", 0).prop('selected', true));
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
if (typeof(data['any_text']) != 'undefined') {
|
|
||||||
$('#module').append ($('<option></option>').html (data['any_text']).attr ("value", 0).prop('selected', true));
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
var anyText = $("#any_text").html(); //Trick for catch the translate text.
|
|
||||||
|
|
||||||
if (anyText == null) {
|
|
||||||
anyText = 'Any';
|
|
||||||
}
|
|
||||||
|
|
||||||
$('#module').append ($('<option></option>').html (anyText).attr ("value", 0).prop('selected', true));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
jQuery.each (data, function (i, val) {
|
|
||||||
s = js_html_entity_decode (val['nombre']);
|
|
||||||
$('#module').append ($('<option></option>').html (s).attr ("value", val['id_agente_modulo']));
|
|
||||||
$('#module').fadeIn ('normal');
|
|
||||||
});
|
|
||||||
if (selected != undefined)
|
|
||||||
$('#module').attr ('value', selected);
|
|
||||||
$('#module').removeAttr('disabled');
|
|
||||||
},
|
|
||||||
"json"
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Util for check is empty object
|
* Util for check is empty object
|
||||||
*
|
*
|
||||||
|
@ -720,7 +720,6 @@ if (is_ajax ()) {
|
|||||||
$id_agent = array_keys(
|
$id_agent = array_keys(
|
||||||
agents_get_group_agents(
|
agents_get_group_agents(
|
||||||
array_keys (users_get_groups ()), $search, "none"));
|
array_keys (users_get_groups ()), $search, "none"));
|
||||||
// TODO TAGS agents_get_modules
|
|
||||||
$agent_modules = agents_get_modules ($id_agent, $fields, $filter, $indexed, true, false, $tags);
|
$agent_modules = agents_get_modules ($id_agent, $fields, $filter, $indexed, true, false, $tags);
|
||||||
}
|
}
|
||||||
// Restore db connection
|
// Restore db connection
|
||||||
|
Loading…
x
Reference in New Issue
Block a user