|
|
|
|
@ -291,6 +291,13 @@ class GroupPortalManager |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Gets the group's members |
|
|
|
|
* @param int group id |
|
|
|
|
* @param bool show image or not of the group |
|
|
|
|
* @param array list of relation type use constants |
|
|
|
|
* @param int from value |
|
|
|
|
* @param int limit |
|
|
|
|
* @param array image configuration, i.e array('height'=>'20px', 'size'=> '20px') |
|
|
|
|
* @return array list of users in a group |
|
|
|
|
*/ |
|
|
|
|
public static function get_users_by_group($group_id, $with_image = false, $relation_type = array(), $from = 0, $limit = 15, $image_conf = array('size'=>USER_IMAGE_SIZE_MEDIUM,'height'=>80)) |
|
|
|
|
{ |
|
|
|
|
@ -321,13 +328,14 @@ class GroupPortalManager |
|
|
|
|
$new_relation_type[] ="'$rel'"; |
|
|
|
|
} |
|
|
|
|
$relation_type = implode(',', $new_relation_type); |
|
|
|
|
$where_relation_condition = "AND gu.relation_type IN ($relation_type) "; |
|
|
|
|
if (!empty($relation_type)) |
|
|
|
|
$where_relation_condition = "AND gu.relation_type IN ($relation_type) "; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$sql="SELECT picture_uri as image, u.user_id, u.firstname, u.lastname, relation_type FROM $tbl_user u |
|
|
|
|
INNER JOIN $table_group_rel_user gu |
|
|
|
|
ON (gu.user_id = u.user_id) WHERE gu.group_id= $group_id $where_relation_condition ORDER BY relation_type, firstname LIMIT $from, $limit"; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$result=Database::query($sql); |
|
|
|
|
$array = array(); |
|
|
|
|
while ($row = Database::fetch_array($result, 'ASSOC')) { |
|
|
|
|
|