2013-03-11 Miguel de Dios <miguel.dedios@artica.es>

* godmode/agentes/module_manager_editor_common.php: show only the
	tags that the user has.
	
	Fixes: #3607617
	
	* include/functions_tags.php: cleaned source code style.




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7825 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2013-03-11 13:01:42 +00:00
parent 86fb89169f
commit d31783a8ff
3 changed files with 142 additions and 99 deletions

View File

@ -1,3 +1,12 @@
2013-03-11 Miguel de Dios <miguel.dedios@artica.es>
* godmode/agentes/module_manager_editor_common.php: show only the
tags that the user has.
Fixes: #3607617
* include/functions_tags.php: cleaned source code style.
2013-03-11 Kikuchi Koichiro <koichiro@rworks.jp>
* extensions/update_manager/lib/libupdate_manager_client.php,

View File

@ -348,6 +348,7 @@ else {
$__id = $__id_pol_mod;
}
if (!tags_has_user_acl_tags($config["id_user"])) {
$table_advanced->data[6][1] = html_print_select_from_sql (
"SELECT id_tag, name
FROM ttag
@ -357,6 +358,35 @@ $table_advanced->data[6][1] = html_print_select_from_sql (
WHERE a.id_tag = b.id_tag AND $__id_where = $__id )
ORDER BY name", 'id_tag_available[]', '', '','','',
true, true, false, false, 'width: 200px', '5');
}
else {
$user_tags = tags_get_user_tags($config["id_user"], "AW");
if (!empty($user_tags)) {
$id_user_tags = array_keys($user_tags);
$table_advanced->data[6][1] = html_print_select_from_sql (
"SELECT id_tag, name
FROM ttag
WHERE id_tag IN (" . implode(',', $id_user_tags) . ") AND
id_tag NOT IN (
SELECT a.id_tag
FROM ttag a, $__table_modules b
WHERE a.id_tag = b.id_tag AND $__id_where = $__id )
ORDER BY name", 'id_tag_available[]', '', '','','',
true, true, false, false, 'width: 200px', '5');
}
else {
$table_advanced->data[6][1] = html_print_select_from_sql (
"SELECT id_tag, name
FROM ttag
WHERE id_tag NOT IN (
SELECT a.id_tag
FROM ttag a, $__table_modules b
WHERE a.id_tag = b.id_tag AND $__id_where = $__id )
ORDER BY name", 'id_tag_available[]', '', '','','',
true, true, false, false, 'width: 200px', '5');
}
}
$table_advanced->data[6][2] = html_print_image('images/darrowright.png', true, array('id' => 'right', 'title' => __('Add tags to module'))); //html_print_input_image ('add', 'images/darrowright.png', 1, '', true, array ('title' => __('Add tags to module')));
$table_advanced->data[6][2] .= '<br><br><br><br>' . html_print_image('images/darrowleft.png', true, array('id' => 'left', 'title' => __('Delete tags to module'))); //html_print_input_image ('add', 'images/darrowleft.png', 1, '', true, array ('title' => __('Delete tags to module')));

View File

@ -28,7 +28,8 @@
*/
function tags_agent_critical ($id_tag) {
return db_get_sql ("SELECT COUNT(*) FROM tagente, tagente_modulo, ttag_module
return db_get_sql ("SELECT COUNT(*)
FROM tagente, tagente_modulo, ttag_module
WHERE tagente.id_agente = tagente_modulo.id_agente
AND tagente.disabled=0
AND tagente_modulo.id_agente_modulo = ttag_module.id_agente_modulo
@ -45,7 +46,8 @@ function tags_agent_critical ($id_tag) {
*/
function tags_agent_unknown ($id_tag) {
return db_get_sql ("SELECT COUNT(*) FROM tagente, tagente_modulo, ttag_module
return db_get_sql ("SELECT COUNT(*)
FROM tagente, tagente_modulo, ttag_module
WHERE tagente.id_agente = tagente_modulo.id_agente
AND tagente.disabled=0
AND tagente_modulo.id_agente_modulo = ttag_module.id_agente_modulo
@ -84,7 +86,8 @@ function tags_total_agents ($id_tag) {
*/
function tags_agent_ok ($id_tag) {
return db_get_sql ("SELECT COUNT(*) FROM tagente, tagente_modulo, ttag_module
return db_get_sql ("SELECT COUNT(*)
FROM tagente, tagente_modulo, ttag_module
WHERE tagente.id_agente = tagente_modulo.id_agente
AND tagente.disabled=0
AND tagente_modulo.id_agente_modulo = ttag_module.id_agente_modulo
@ -101,7 +104,8 @@ function tags_agent_ok ($id_tag) {
*/
function tags_agent_warning ($id_tag) {
return db_get_sql ("SELECT COUNT(*) FROM tagente, tagente_modulo, ttag_module
return db_get_sql ("SELECT COUNT(*)
FROM tagente, tagente_modulo, ttag_module
WHERE tagente.id_agente = tagente_modulo.id_agente
AND tagente.disabled=0
AND tagente_modulo.id_agente_modulo = ttag_module.id_agente_modulo