2013-07-17 Sergio Martin <sergio.martin@artica.es>
* include/functions_users.php include/functions_groups.php operation/events/events_list.php: Fixed the visibility of the users in the events view filter. Now the user can only filter by the users of the groups where the user belongs git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8539 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
d7f6584ffa
commit
c4ad9890b6
|
@ -1,3 +1,12 @@
|
|||
2013-07-17 Sergio Martin <sergio.martin@artica.es>
|
||||
|
||||
* include/functions_users.php
|
||||
include/functions_groups.php
|
||||
operation/events/events_list.php: Fixed the visibility
|
||||
of the users in the events view filter. Now the user
|
||||
can only filter by the users of the groups where the
|
||||
user belongs
|
||||
|
||||
2013-07-17 Sergio Martin <sergio.martin@artica.es>
|
||||
|
||||
* operation/menu.php
|
||||
|
|
|
@ -592,10 +592,12 @@ function groups_get_id ($group_name, $returnAllGroup = false) {
|
|||
* Get all the users belonging to a group.
|
||||
*
|
||||
* @param int $id_group The group id to look for
|
||||
* @param mixed filter array
|
||||
* @param bool True if users with all permissions in the group are retrieved
|
||||
*
|
||||
* @return array An array with all the users or an empty array
|
||||
*/
|
||||
function groups_get_users ($id_group, $filter = false) {
|
||||
function groups_get_users ($id_group, $filter = false, $return_user_all = false) {
|
||||
global $config;
|
||||
|
||||
if (! is_array ($filter))
|
||||
|
|
|
@ -808,4 +808,26 @@ function users_can_manage_group_all($id_group = 0) {
|
|||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the users that belongs to the same groups of the current user
|
||||
*
|
||||
* @return mixed Array with id_user as index and value
|
||||
*/
|
||||
function users_get_user_users() {
|
||||
global $config;
|
||||
|
||||
$user_groups = users_get_groups();
|
||||
|
||||
$user_users = array();
|
||||
foreach($user_groups as $id_user_group => $name_user_group) {
|
||||
$group_users = groups_get_users($id_user_group, false, true);
|
||||
|
||||
foreach($group_users as $gu) {
|
||||
$user_users[$gu['id_user']] = $gu['id_user'];
|
||||
}
|
||||
}
|
||||
|
||||
return $user_users;
|
||||
}
|
||||
?>
|
||||
|
|
|
@ -387,8 +387,10 @@ $table_advanced->rowclass[] = '';
|
|||
|
||||
$data = array();
|
||||
$data[0] = __('User ack.') . '<br>';
|
||||
$users = users_get_info ();
|
||||
$data[0] .= html_print_select($users, "id_user_ack", $id_user_ack, '',
|
||||
|
||||
$user_users = users_get_user_users();
|
||||
|
||||
$data[0] .= html_print_select($user_users, "id_user_ack", $id_user_ack, '',
|
||||
__('Any'), 0, true);
|
||||
$data[1] = '';
|
||||
$table_advanced->data[] = $data;
|
||||
|
|
Loading…
Reference in New Issue