2013-04-30 Sergio Martin <sergio.martin@artica.es>
* godmode/agentes/agent_template.php: Add tags creation in module tamplates application for bug #3611909 git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8090 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
904af5befe
commit
3eb85c6408
|
@ -1,3 +1,8 @@
|
|||
2013-04-30 Sergio Martin <sergio.martin@artica.es>
|
||||
|
||||
* godmode/agentes/agent_template.php: Add tags creation
|
||||
in module tamplates application for bug #3611909
|
||||
|
||||
2013-04-30 Sergio Martin <sergio.martin@artica.es>
|
||||
|
||||
* godmode/reporting/reporting_builder.item_editor.php:
|
||||
|
|
|
@ -100,6 +100,14 @@ if (isset ($_POST["template_id"])) {
|
|||
|
||||
$name = $row2["name"];
|
||||
|
||||
// Put tags in array if the component has to add them later
|
||||
if(!empty($row2["tags"])) {
|
||||
$tags = explode(',', $row2["tags"]);
|
||||
}
|
||||
else {
|
||||
$tags = array();
|
||||
}
|
||||
|
||||
// Check if this module exists in the agent
|
||||
$module_name_check = db_get_value_filter('id_agente_modulo', 'tagente_modulo', array('delete_pending' => 0, 'nombre' => $name, 'id_agente' => $id_agente));
|
||||
|
||||
|
@ -114,6 +122,19 @@ if (isset ($_POST["template_id"])) {
|
|||
$error_count++;
|
||||
}
|
||||
else {
|
||||
if(!empty($tags)) {
|
||||
// Creating tags
|
||||
$tag_ids = array();
|
||||
foreach ($tags as $tag_name) {
|
||||
$tag_id = tags_get_id($tag_name);
|
||||
|
||||
//If tag exists in the system we store to create it
|
||||
$tag_ids[] = $tag_id;
|
||||
}
|
||||
|
||||
tags_insert_module_tag ($id_agente_modulo, $tag_ids);
|
||||
}
|
||||
|
||||
$success_count++;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue