2010-06-28 Sergio Martin <sergio.martin@artica.es>

* include/functions_db.php: Fixed the get_agent_modules 
	function to avoid return the pending delete modules



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2929 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
zarzuelo 2010-06-28 11:49:07 +00:00
parent 17649b8c77
commit 38a66e7cfc
2 changed files with 15 additions and 7 deletions

View File

@ -1,3 +1,8 @@
2010-06-28 Sergio Martin <sergio.martin@artica.es>
* include/functions_db.php: Fixed the get_agent_modules
function to avoid return the pending delete modules
2010-06-25 Sergio Martin <sergio.martin@artica.es>
* include/functions_ui.php: Adding a parameter to

View File

@ -506,19 +506,22 @@ $modules = get_agent_modules ($id_agent, '*', 'disabled = 0 AND history_data = 0
*/
function get_agent_modules ($id_agent, $details = false, $filter = false, $indexed = true) {
$id_agent = safe_int ($id_agent, 1);
$where = '';
if (! empty ($id_agent)) {
$where = sprintf (' WHERE id_agente IN (%s)', implode (",", (array) $id_agent));
}
if ($where != '') {
$where .= ' AND ';
} else {
$where .= ' WHERE ';
}
$where .= 'delete_pending = 0 ';
if (! empty ($filter)) {
if ($where != '') {
$where .= ' AND ';
} else {
$where .= ' WHERE ';
}
$where .= ' AND ';
if (is_array ($filter)) {
$fields = array ();
foreach ($filter as $field => $value) {