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

This commit is contained in:
mdtrooper 2014-12-10 17:15:48 +01:00
parent 6e22069eee
commit bdc2f4a64c
4 changed files with 42 additions and 3 deletions

View File

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

View File

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

View File

@ -521,6 +521,17 @@ function tags_get_module_tags ($id_agent_module) {
return $return; 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. * Select all tags of a policy module.
* *

View File

@ -19,6 +19,8 @@ global $config;
//Ajax tooltip to deploy modules's tag info. //Ajax tooltip to deploy modules's tag info.
if (is_ajax ()) { if (is_ajax ()) {
$get_tag_tooltip = (bool) get_parameter ('get_tag_tooltip', 0); $get_tag_tooltip = (bool) get_parameter ('get_tag_tooltip', 0);
$get_relations_tooltip = (bool) get_parameter ('get_relations_tooltip', 0);
if ($get_tag_tooltip) { if ($get_tag_tooltip) {
$id_agente_modulo = (int) get_parameter ('id_agente_modulo'); $id_agente_modulo = (int) get_parameter ('id_agente_modulo');
@ -26,18 +28,32 @@ if (is_ajax ()) {
return; return;
$tags = tags_get_module_tags($id_agente_modulo); $tags = tags_get_module_tags($id_agente_modulo);
if ($tags === false) if ($tags === false)
$tags = array(); $tags = array();
echo '<h3>' . __("Tag's information") . '</h3>'; echo '<h3>' . __("Tag's information") . '</h3>';
echo "<table border='0'>";
foreach ($tags as $tag) { 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; return;
} }
$get_relations_tooltip = (bool) get_parameter ('get_relations_tooltip', 0);
if ($get_relations_tooltip) { if ($get_relations_tooltip) {
$id_agente_modulo = (int) get_parameter ('id_agente_modulo'); $id_agente_modulo = (int) get_parameter ('id_agente_modulo');