2011-06-06 Juan Manuel Ramon <juanmanuel.ramon@artica.es>

* include/functions_modules.php: Some mofications over update_tag
	function.
	* include/functions_alerts.php: Added new function 
	alerts_get_alerts_module_name() to retrieve alerts of a module
	in html select tag format.



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4405 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
juanmanuelr 2011-06-06 12:04:14 +00:00
parent 3ed7d89aee
commit 47357cf862
3 changed files with 33 additions and 4 deletions

View File

@ -1,3 +1,11 @@
2011-06-06 Juan Manuel Ramon <juanmanuel.ramon@artica.es>
* include/functions_modules.php: Some mofications over update_tag
function.
* include/functions_alerts.php: Added new function
alerts_get_alerts_module_name() to retrieve alerts of a module
in html select tag format.
2011-06-06 Juan Manuel Ramon <juanmanuel.ramon@artica.es>
* include/functions_tags.php: Added new parameters to function

View File

@ -934,6 +934,26 @@ function alerts_get_alerts_agent_module ($id_agent_module, $disabled = false, $f
$filter, $fields);
}
/**
* Get alert associated to a module (only id and name fields).
*
* @param int Id of an alert template.
* @param bool Disabled or not.
*
* @return mixed Affected rows or false if something goes wrong.
*/
function alerts_get_alerts_module_name ($id_agent_module, $disabled = false) {
$id_alert_agent_module = safe_int ($id_agent_module, 0);
$sql = sprintf ('SELECT a.id, b.name
FROM talert_template_modules as a, talert_templates as b
WHERE a.id=b.id AND a.id_agent_module = %d AND a.disabled = %d',
$id_agent_module, (int)$disabled);
return db_process_sql($sql);
}
/**
* Get disabled field of talert_template_modules table.
*

View File

@ -185,11 +185,12 @@ function modules_update_agent_module ($id, $values, $onlyNoDeletePending = false
if (isset ($values['nombre']) && empty ($values['nombre']))
return false;
$return_tag = tags_update_module_tag ($id, $tags);
if ($tags !== false)
$return_tag = tags_update_module_tag ($id, $tags);
if ($return_tag === false){
return false;
}
// if ($return_tag === false){
// return false;
// }
if ($onlyNoDeletePending) {
return (@db_process_sql_update ('tagente_modulo', $values,