Working in the tags out the policies. Ticket: #1577

This commit is contained in:
mdtrooper 2014-12-10 17:15:48 +01:00
parent 8c3a5cedb7
commit 5d485e16ef
4 changed files with 42 additions and 3 deletions

View File

@ -234,7 +234,8 @@ ui_require_jquery_file ('cluetip');
arrows: true,
attribute: 'href',
cluetipClass: 'default'
}).click (function () {
})
.click (function () {
return false;
});
/* ]]> */

View File

@ -1065,6 +1065,16 @@ if ($list_modules) {
?>
<script type="text/javascript">
/* <![CDATA[ */
$("a.tag_details").cluetip ({
arrows: true,
attribute: 'href',
cluetipClass: 'default'
})
.click (function () {
return false;
});
function toggle_full_value(id) {
text = $("#hidden_value_module_" + id).html();
old_text = $("#value_module_text_" + id).html();
@ -1073,6 +1083,7 @@ if ($list_modules) {
$("#value_module_text_" + id).html(text);
}
/* ]]> */
</script>
<?php
if (empty ($table->data)) {

View File

@ -521,6 +521,17 @@ function tags_get_module_tags ($id_agent_module) {
return $return;
}
function tags_get_module_policy_tags($id_tag, $id_module) {
if (empty($id_tag))
return false;
$id_module_policy = db_get_value_filter('id_policy_module',
'ttag_module',
array('id_tag' => $id_tag, 'id_agente_modulo' => $id_module));
return $id_module_policy;
}
/**
* Select all tags of a policy module.
*

View File

@ -19,6 +19,8 @@ global $config;
//Ajax tooltip to deploy modules's tag info.
if (is_ajax ()) {
$get_tag_tooltip = (bool) get_parameter ('get_tag_tooltip', 0);
$get_relations_tooltip = (bool) get_parameter ('get_relations_tooltip', 0);
if ($get_tag_tooltip) {
$id_agente_modulo = (int) get_parameter ('id_agente_modulo');
@ -26,18 +28,32 @@ if (is_ajax ()) {
return;
$tags = tags_get_module_tags($id_agente_modulo);
if ($tags === false)
$tags = array();
echo '<h3>' . __("Tag's information") . '</h3>';
echo "<table border='0'>";
foreach ($tags as $tag) {
echo tags_get_name($tag).'<br>';
echo "<tr>";
echo "<td>";
if (tags_get_module_policy_tags($tag, $id_agente_modulo)) {
html_print_image('images/policies.png', false, array('style' => 'vertical-align: middle;'));
}
echo "</td>";
echo "<td>";
echo tags_get_name($tag);
echo "</td>";
echo "</tr>";
}
echo "</table>";
return;
}
$get_relations_tooltip = (bool) get_parameter ('get_relations_tooltip', 0);
if ($get_relations_tooltip) {
$id_agente_modulo = (int) get_parameter ('id_agente_modulo');