mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-30 01:05:39 +02:00
Fixed bug #1679.
This commit is contained in:
parent
02fddf5f6f
commit
dc4a6188a6
@ -2768,4 +2768,28 @@ function events_get_count_events_validated ($filter, $period, $date,
|
|||||||
|
|
||||||
return $return;
|
return $return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function events_checks_event_tags($event_data, $acltags) {
|
||||||
|
global $config;
|
||||||
|
|
||||||
|
if (empty($acltags[$event_data['id_grupo']])) {
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
$tags_arr_acl = explode(',',$acltags[$event_data['id_grupo']]);
|
||||||
|
$tags_arr_event = explode(',',$event_data['tags']);
|
||||||
|
|
||||||
|
foreach ($tags_arr_acl as $tag) {
|
||||||
|
$tag_name = tags_get_name($tag);
|
||||||
|
if (in_array($tag_name, $tags_arr_event)) {
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
$has_tag = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!$has_tag) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
?>
|
?>
|
||||||
|
@ -991,7 +991,8 @@ function tags_get_acl_tags_event_condition($acltags, $meta = false, $force_group
|
|||||||
|
|
||||||
if ($force_group_and_tag) {
|
if ($force_group_and_tag) {
|
||||||
if (!empty($all_tags[$tag])) {
|
if (!empty($all_tags[$tag])) {
|
||||||
$tags_condition .= sprintf('(tags = "%s"',io_safe_input($all_tags[$tag]));
|
//~ $tags_condition .= sprintf('(tags = "%s"',io_safe_input($all_tags[$tag]));
|
||||||
|
$tags_condition .= "(tags LIKE '%".io_safe_input($all_tags[$tag])."%'";
|
||||||
$childrens = groups_get_childrens($group_id, null, true);
|
$childrens = groups_get_childrens($group_id, null, true);
|
||||||
|
|
||||||
if (empty($childrens)) {
|
if (empty($childrens)) {
|
||||||
@ -1009,7 +1010,8 @@ function tags_get_acl_tags_event_condition($acltags, $meta = false, $force_group
|
|||||||
$tags_condition .= "id_grupo = ".$group_id;
|
$tags_condition .= "id_grupo = ".$group_id;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$tags_condition .= sprintf('tags = "%s"',io_safe_input($all_tags[$tag]));
|
//~ $tags_condition .= sprintf('tags = "%s"',io_safe_input($all_tags[$tag]));
|
||||||
|
$tags_condition .= "tags LIKE '%".io_safe_input($all_tags[$tag])."%'";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -564,6 +564,18 @@ else {
|
|||||||
$history);
|
$history);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!empty($result)) {
|
||||||
|
//~ Checking the event tags exactly. The event query filters approximated tags to keep events
|
||||||
|
//~ with several tags
|
||||||
|
$acltags = tags_get_user_module_and_tags ($config['id_user'],'ER', true);
|
||||||
|
|
||||||
|
foreach ($result as $key=>$event_data) {
|
||||||
|
$has_tags = events_checks_event_tags($event_data, $acltags);
|
||||||
|
if (!$has_tags) {
|
||||||
|
unset($result[$key]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!empty($result)) {
|
if (!empty($result)) {
|
||||||
$graph = '<div style="width: 350px; margin: 0 auto;">' .
|
$graph = '<div style="width: 350px; margin: 0 auto;">' .
|
||||||
|
Loading…
x
Reference in New Issue
Block a user