|
@@ -81,7 +81,7 @@ discard block |
|
|
block discarded – undo |
|
81
|
81
|
"; |
|
82
|
82
|
$result = Database::query($sql); |
|
83
|
83
|
if (Database::num_rows($result)) { |
|
84
|
|
- $row = Database::fetch_array($result); |
|
|
84
|
+ $row = Database::fetch_array($result); |
|
85
|
85
|
|
|
86
|
86
|
return $row['count']; |
|
87
|
87
|
} |
|
@@ -101,7 +101,7 @@ discard block |
|
|
block discarded – undo |
|
101
|
101
|
"; |
|
102
|
102
|
$result = Database::query($sql); |
|
103
|
103
|
if (Database::num_rows($result)) { |
|
104
|
|
- $row = Database::fetch_array($result); |
|
|
104
|
+ $row = Database::fetch_array($result); |
|
105
|
105
|
return $row['count']; |
|
106
|
106
|
} |
|
107
|
107
|
} |
|
@@ -126,7 +126,7 @@ discard block |
|
|
block discarded – undo |
|
126
|
126
|
"; |
|
127
|
127
|
$result = Database::query($sql); |
|
128
|
128
|
if (Database::num_rows($result)) { |
|
129
|
|
- $row = Database::fetch_array($result); |
|
|
129
|
+ $row = Database::fetch_array($result); |
|
130
|
130
|
return $row['count']; |
|
131
|
131
|
} |
|
132
|
132
|
|
|
@@ -147,7 +147,7 @@ discard block |
|
|
block discarded – undo |
|
147
|
147
|
"; |
|
148
|
148
|
$result = Database::query($sql); |
|
149
|
149
|
if (Database::num_rows($result)) { |
|
150
|
|
- $row = Database::fetch_array($result); |
|
|
150
|
+ $row = Database::fetch_array($result); |
|
151
|
151
|
return $row['count']; |
|
152
|
152
|
} |
|
153
|
153
|
|
|
@@ -528,13 +528,13 @@ discard block |
|
|
block discarded – undo |
|
528
|
528
|
INNER JOIN {$this->table} g |
|
529
|
529
|
ON (u.usergroup_id = g.id) |
|
530
|
530
|
"; |
|
531
|
|
- $where = array('where' => array('user_id = ? AND access_url_id = ? ' => array($userId, $urlId))); |
|
|
531
|
+ $where = array('where' => array('user_id = ? AND access_url_id = ? ' => array($userId, $urlId))); |
|
532
|
532
|
} else { |
|
533
|
533
|
$from = $this->usergroup_rel_user_table." u |
|
534
|
534
|
INNER JOIN {$this->table} g |
|
535
|
535
|
ON (u.usergroup_id = g.id) |
|
536
|
536
|
"; |
|
537
|
|
- $where = array('where' => array('user_id = ?' => $userId)); |
|
|
537
|
+ $where = array('where' => array('user_id = ?' => $userId)); |
|
538
|
538
|
} |
|
539
|
539
|
|
|
540
|
540
|
if ($filterByType !== null) { |
|
@@ -567,10 +567,10 @@ discard block |
|
|
block discarded – undo |
|
567
|
567
|
$urlId = api_get_current_access_url_id(); |
|
568
|
568
|
$from = $this->usergroup_rel_user_table." u |
|
569
|
569
|
INNER JOIN {$this->access_url_rel_usergroup} a ON (a.usergroup_id AND u.usergroup_id)"; |
|
570
|
|
- $where = array('where' => array('user_id = ? AND access_url_id = ? ' => array($userId, $urlId))); |
|
|
570
|
+ $where = array('where' => array('user_id = ? AND access_url_id = ? ' => array($userId, $urlId))); |
|
571
|
571
|
} else { |
|
572
|
572
|
$from = $this->usergroup_rel_user_table." u "; |
|
573
|
|
- $where = array('where' => array('user_id = ?' => $userId)); |
|
|
573
|
+ $where = array('where' => array('user_id = ?' => $userId)); |
|
574
|
574
|
} |
|
575
|
575
|
|
|
576
|
576
|
$results = Database::select( |
|
@@ -856,7 +856,7 @@ discard block |
|
|
block discarded – undo |
|
856
|
856
|
} |
|
857
|
857
|
$result = $new_result; |
|
858
|
858
|
} |
|
859
|
|
- $columns = array('name', 'users', 'courses','sessions', 'group_type'); |
|
|
859
|
+ $columns = array('name', 'users', 'courses', 'sessions', 'group_type'); |
|
860
|
860
|
|
|
861
|
861
|
if (!in_array($sidx, $columns)) { |
|
862
|
862
|
$sidx = 'name'; |
|
@@ -1260,7 +1260,7 @@ discard block |
|
|
block discarded – undo |
|
1260
|
1260
|
} |
|
1261
|
1261
|
} |
|
1262
|
1262
|
} |
|
1263
|
|
- $response->addAssign('ajax_list_courses','innerHTML', api_utf8_encode($return)); |
|
|
1263
|
+ $response->addAssign('ajax_list_courses', 'innerHTML', api_utf8_encode($return)); |
|
1264
|
1264
|
|
|
1265
|
1265
|
return $response; |
|
1266
|
1266
|
} |
|
@@ -1367,7 +1367,7 @@ discard block |
|
|
block discarded – undo |
|
1367
|
1367
|
* @param string style css |
|
1368
|
1368
|
* @return array with the file and the style of an image i.e $array['file'] $array['style'] |
|
1369
|
1369
|
*/ |
|
1370
|
|
- public function get_picture_group($id, $picture_file, $height, $size_picture = GROUP_IMAGE_SIZE_MEDIUM , $style = '') |
|
|
1370
|
+ public function get_picture_group($id, $picture_file, $height, $size_picture = GROUP_IMAGE_SIZE_MEDIUM, $style = '') |
|
1371
|
1371
|
{ |
|
1372
|
1372
|
$picture = array(); |
|
1373
|
1373
|
$picture['style'] = $style; |
|
@@ -1480,7 +1480,7 @@ discard block |
|
|
block discarded – undo |
|
1480
|
1480
|
*/ |
|
1481
|
1481
|
public function getAllowedPictureExtensions() |
|
1482
|
1482
|
{ |
|
1483
|
|
- return $allowed_picture_types = array ('jpg', 'jpeg', 'png', 'gif'); |
|
|
1483
|
+ return $allowed_picture_types = array('jpg', 'jpeg', 'png', 'gif'); |
|
1484
|
1484
|
} |
|
1485
|
1485
|
|
|
1486
|
1486
|
/** |
|
@@ -1514,7 +1514,7 @@ discard block |
|
|
block discarded – undo |
|
1514
|
1514
|
if (empty($user_id)) { |
|
1515
|
1515
|
$user_id = api_get_user_id(); |
|
1516
|
1516
|
} |
|
1517
|
|
- $user_role = $this->get_user_group_role($user_id, $group_id); |
|
|
1517
|
+ $user_role = $this->get_user_group_role($user_id, $group_id); |
|
1518
|
1518
|
if (in_array($user_role, array(GROUP_USER_PERMISSION_ADMIN))) { |
|
1519
|
1519
|
return true; |
|
1520
|
1520
|
} else { |
|
@@ -1532,7 +1532,7 @@ discard block |
|
|
block discarded – undo |
|
1532
|
1532
|
if (empty($user_id)) { |
|
1533
|
1533
|
$user_id = api_get_user_id(); |
|
1534
|
1534
|
} |
|
1535
|
|
- $user_role = $this->get_user_group_role($user_id, $group_id); |
|
|
1535
|
+ $user_role = $this->get_user_group_role($user_id, $group_id); |
|
1536
|
1536
|
if (in_array($user_role, array(GROUP_USER_PERMISSION_ADMIN, GROUP_USER_PERMISSION_MODERATOR))) { |
|
1537
|
1537
|
return true; |
|
1538
|
1538
|
} else { |
|
@@ -1559,7 +1559,7 @@ discard block |
|
|
block discarded – undo |
|
1559
|
1559
|
GROUP_USER_PERMISSION_READER, |
|
1560
|
1560
|
GROUP_USER_PERMISSION_HRM, |
|
1561
|
1561
|
); |
|
1562
|
|
- $user_role = self::get_user_group_role($user_id, $group_id); |
|
|
1562
|
+ $user_role = self::get_user_group_role($user_id, $group_id); |
|
1563
|
1563
|
if (in_array($user_role, $roles)) { |
|
1564
|
1564
|
return true; |
|
1565
|
1565
|
} else { |
|
@@ -1576,7 +1576,7 @@ discard block |
|
|
block discarded – undo |
|
1576
|
1576
|
* */ |
|
1577
|
1577
|
public function get_user_group_role($user_id, $group_id) |
|
1578
|
1578
|
{ |
|
1579
|
|
- $table_group_rel_user= $this->usergroup_rel_user_table; |
|
|
1579
|
+ $table_group_rel_user = $this->usergroup_rel_user_table; |
|
1580
|
1580
|
$return_value = 0; |
|
1581
|
1581
|
if (!empty($user_id) && !empty($group_id)) { |
|
1582
|
1582
|
$sql = "SELECT relation_type FROM $table_group_rel_user |
|
@@ -1584,8 +1584,8 @@ discard block |
|
|
block discarded – undo |
|
1584
|
1584
|
usergroup_id = ".intval($group_id)." AND |
|
1585
|
1585
|
user_id = ".intval($user_id)." "; |
|
1586
|
1586
|
$result = Database::query($sql); |
|
1587
|
|
- if (Database::num_rows($result)>0) { |
|
1588
|
|
- $row = Database::fetch_array($result,'ASSOC'); |
|
|
1587
|
+ if (Database::num_rows($result) > 0) { |
|
|
1588
|
+ $row = Database::fetch_array($result, 'ASSOC'); |
|
1589
|
1589
|
$return_value = $row['relation_type']; |
|
1590
|
1590
|
} |
|
1591
|
1591
|
} |
|
@@ -1640,7 +1640,7 @@ discard block |
|
|
block discarded – undo |
|
1640
|
1640
|
if (is_array($user_list) && is_array($group_list)) { |
|
1641
|
1641
|
foreach ($group_list as $group_id) { |
|
1642
|
1642
|
foreach ($user_list as $user_id) { |
|
1643
|
|
- $role = self::get_user_group_role($user_id,$group_id); |
|
|
1643
|
+ $role = self::get_user_group_role($user_id, $group_id); |
|
1644
|
1644
|
if ($role == 0) { |
|
1645
|
1645
|
$sql = "INSERT INTO $table_url_rel_group |
|
1646
|
1646
|
SET |
|
@@ -1671,7 +1671,7 @@ discard block |
|
|
block discarded – undo |
|
1671
|
1671
|
public function delete_user_rel_group($user_id, $group_id) |
|
1672
|
1672
|
{ |
|
1673
|
1673
|
$table = $this->usergroup_rel_user_table; |
|
1674
|
|
- $sql= "DELETE FROM $table |
|
|
1674
|
+ $sql = "DELETE FROM $table |
|
1675
|
1675
|
WHERE |
|
1676
|
1676
|
user_id = ".intval($user_id)." AND |
|
1677
|
1677
|
usergroup_id = ".intval($group_id)." "; |
|
@@ -1727,7 +1727,7 @@ discard block |
|
|
block discarded – undo |
|
1727
|
1727
|
|
|
1728
|
1728
|
$sql = "UPDATE $table_group_rel_user |
|
1729
|
1729
|
SET relation_type = ".intval($relation_type)." |
|
1730
|
|
- WHERE user_id = $user_id AND usergroup_id = $group_id" ; |
|
|
1730
|
+ WHERE user_id = $user_id AND usergroup_id = $group_id"; |
|
1731
|
1731
|
Database::query($sql); |
|
1732
|
1732
|
} |
|
1733
|
1733
|
|
|
@@ -1769,7 +1769,7 @@ discard block |
|
|
block discarded – undo |
|
1769
|
1769
|
if (Database::num_rows($result) > 0) { |
|
1770
|
1770
|
while ($row = Database::fetch_array($result, 'ASSOC')) { |
|
1771
|
1771
|
if ($with_image) { |
|
1772
|
|
- $picture = self::get_picture_group($row['id'], $row['picture'],80); |
|
|
1772
|
+ $picture = self::get_picture_group($row['id'], $row['picture'], 80); |
|
1773
|
1773
|
$img = '<img src="'.$picture['file'].'" />'; |
|
1774
|
1774
|
$row['picture'] = $img; |
|
1775
|
1775
|
} |
|
@@ -1805,11 +1805,11 @@ discard block |
|
|
block discarded – undo |
|
1805
|
1805
|
ORDER BY count DESC |
|
1806
|
1806
|
LIMIT $num"; |
|
1807
|
1807
|
|
|
1808
|
|
- $result=Database::query($sql); |
|
|
1808
|
+ $result = Database::query($sql); |
|
1809
|
1809
|
$array = array(); |
|
1810
|
1810
|
while ($row = Database::fetch_array($result, 'ASSOC')) { |
|
1811
|
1811
|
if ($with_image) { |
|
1812
|
|
- $picture = self::get_picture_group($row['id'], $row['picture'],80); |
|
|
1812
|
+ $picture = self::get_picture_group($row['id'], $row['picture'], 80); |
|
1813
|
1813
|
$img = '<img src="'.$picture['file'].'" />'; |
|
1814
|
1814
|
$row['picture'] = $img; |
|
1815
|
1815
|
} |
|
@@ -1854,11 +1854,11 @@ discard block |
|
|
block discarded – undo |
|
1854
|
1854
|
ORDER BY created_at DESC |
|
1855
|
1855
|
LIMIT $num "; |
|
1856
|
1856
|
|
|
1857
|
|
- $result=Database::query($sql); |
|
|
1857
|
+ $result = Database::query($sql); |
|
1858
|
1858
|
$array = array(); |
|
1859
|
1859
|
while ($row = Database::fetch_array($result, 'ASSOC')) { |
|
1860
|
1860
|
if ($with_image) { |
|
1861
|
|
- $picture = self::get_picture_group($row['id'], $row['picture'],80); |
|
|
1861
|
+ $picture = self::get_picture_group($row['id'], $row['picture'], 80); |
|
1862
|
1862
|
$img = '<img src="'.$picture['file'].'" />'; |
|
1863
|
1863
|
$row['picture'] = $img; |
|
1864
|
1864
|
} |
|
@@ -1892,7 +1892,7 @@ discard block |
|
|
block discarded – undo |
|
1892
|
1892
|
$tbl_user = Database::get_main_table(TABLE_MAIN_USER); |
|
1893
|
1893
|
$group_id = intval($group_id); |
|
1894
|
1894
|
|
|
1895
|
|
- if (empty($group_id)){ |
|
|
1895
|
+ if (empty($group_id)) { |
|
1896
|
1896
|
return array(); |
|
1897
|
1897
|
} |
|
1898
|
1898
|
|
|
@@ -1907,9 +1907,9 @@ discard block |
|
|
block discarded – undo |
|
1907
|
1907
|
$where_relation_condition = ''; |
|
1908
|
1908
|
} else { |
|
1909
|
1909
|
$new_relation_type = array(); |
|
1910
|
|
- foreach($relation_type as $rel) { |
|
|
1910
|
+ foreach ($relation_type as $rel) { |
|
1911
|
1911
|
$rel = intval($rel); |
|
1912
|
|
- $new_relation_type[] ="'$rel'"; |
|
|
1912
|
+ $new_relation_type[] = "'$rel'"; |
|
1913
|
1913
|
} |
|
1914
|
1914
|
$relation_type = implode(',', $new_relation_type); |
|
1915
|
1915
|
if (!empty($relation_type)) |
|
@@ -1953,7 +1953,7 @@ discard block |
|
|
block discarded – undo |
|
1953
|
1953
|
$tbl_user = Database::get_main_table(TABLE_MAIN_USER); |
|
1954
|
1954
|
$group_id = intval($group_id); |
|
1955
|
1955
|
|
|
1956
|
|
- if (empty($group_id)){ |
|
|
1956
|
+ if (empty($group_id)) { |
|
1957
|
1957
|
return array(); |
|
1958
|
1958
|
} |
|
1959
|
1959
|
|
|
@@ -1964,7 +1964,7 @@ discard block |
|
|
block discarded – undo |
|
1964
|
1964
|
WHERE gu.usergroup_id= $group_id |
|
1965
|
1965
|
ORDER BY relation_type, firstname"; |
|
1966
|
1966
|
|
|
1967
|
|
- $result=Database::query($sql); |
|
|
1967
|
+ $result = Database::query($sql); |
|
1968
|
1968
|
$array = array(); |
|
1969
|
1969
|
while ($row = Database::fetch_array($result, 'ASSOC')) { |
|
1970
|
1970
|
$array[$row['id']] = $row; |
|
@@ -1993,27 +1993,27 @@ discard block |
|
|
block discarded – undo |
|
1993
|
1993
|
case GROUP_USER_PERMISSION_READER: |
|
1994
|
1994
|
// I'm just a reader |
|
1995
|
1995
|
$relation_group_title = get_lang('IAmAReader'); |
|
1996
|
|
- $links .= '<li><a href="group_invitation.php?id='.$group_id.'">'. |
|
1997
|
|
- Display::return_icon('invitation_friend.png', get_lang('InviteFriends'), array('hspace'=>'6')).'<span class="'.($show=='invite_friends'?'social-menu-text-active':'social-menu-text4').'" >'.get_lang('InviteFriends').'</span></a></li>'; |
|
1998
|
|
- $links .= '<li><a href="group_view.php?id='.$group_id.'&action=leave&u='.api_get_user_id().'">'. |
|
|
1996
|
+ $links .= '<li><a href="group_invitation.php?id='.$group_id.'">'. |
|
|
1997
|
+ Display::return_icon('invitation_friend.png', get_lang('InviteFriends'), array('hspace'=>'6')).'<span class="'.($show == 'invite_friends' ? 'social-menu-text-active' : 'social-menu-text4').'" >'.get_lang('InviteFriends').'</span></a></li>'; |
|
|
1998
|
+ $links .= '<li><a href="group_view.php?id='.$group_id.'&action=leave&u='.api_get_user_id().'">'. |
|
1999
|
1999
|
Display::return_icon('group_leave.png', get_lang('LeaveGroup'), array('hspace'=>'6')).'<span class="social-menu-text4" >'.get_lang('LeaveGroup').'</span></a></li>'; |
|
2000
|
2000
|
break; |
|
2001
|
2001
|
case GROUP_USER_PERMISSION_ADMIN: |
|
2002
|
2002
|
$relation_group_title = get_lang('IAmAnAdmin'); |
|
2003
|
|
- $links .= '<li><a href="group_edit.php?id='.$group_id.'">'. |
|
2004
|
|
- Display::return_icon('group_edit.png', get_lang('EditGroup'), array('hspace'=>'6')).'<span class="'.($show=='group_edit'?'social-menu-text-active':'social-menu-text4').'" >'.get_lang('EditGroup').'</span></a></li>'; |
|
2005
|
|
- $links .= '<li><a href="group_waiting_list.php?id='.$group_id.'">'. |
|
2006
|
|
- Display::return_icon('waiting_list.png', get_lang('WaitingList'), array('hspace'=>'6')).'<span class="'.($show=='waiting_list'?'social-menu-text-active':'social-menu-text4').'" >'.get_lang('WaitingList').'</span></a></li>'; |
|
2007
|
|
- $links .= '<li><a href="group_invitation.php?id='.$group_id.'">'. |
|
2008
|
|
- Display::return_icon('invitation_friend.png', get_lang('InviteFriends'), array('hspace'=>'6')).'<span class="'.($show=='invite_friends'?'social-menu-text-active':'social-menu-text4').'" >'.get_lang('InviteFriends').'</span></a></li>'; |
|
2009
|
|
- $links .= '<li><a href="group_view.php?id='.$group_id.'&action=leave&u='.api_get_user_id().'">'. |
|
|
2003
|
+ $links .= '<li><a href="group_edit.php?id='.$group_id.'">'. |
|
|
2004
|
+ Display::return_icon('group_edit.png', get_lang('EditGroup'), array('hspace'=>'6')).'<span class="'.($show == 'group_edit' ? 'social-menu-text-active' : 'social-menu-text4').'" >'.get_lang('EditGroup').'</span></a></li>'; |
|
|
2005
|
+ $links .= '<li><a href="group_waiting_list.php?id='.$group_id.'">'. |
|
|
2006
|
+ Display::return_icon('waiting_list.png', get_lang('WaitingList'), array('hspace'=>'6')).'<span class="'.($show == 'waiting_list' ? 'social-menu-text-active' : 'social-menu-text4').'" >'.get_lang('WaitingList').'</span></a></li>'; |
|
|
2007
|
+ $links .= '<li><a href="group_invitation.php?id='.$group_id.'">'. |
|
|
2008
|
+ Display::return_icon('invitation_friend.png', get_lang('InviteFriends'), array('hspace'=>'6')).'<span class="'.($show == 'invite_friends' ? 'social-menu-text-active' : 'social-menu-text4').'" >'.get_lang('InviteFriends').'</span></a></li>'; |
|
|
2009
|
+ $links .= '<li><a href="group_view.php?id='.$group_id.'&action=leave&u='.api_get_user_id().'">'. |
|
2010
|
2010
|
Display::return_icon('group_leave.png', get_lang('LeaveGroup'), array('hspace'=>'6')).'<span class="social-menu-text4" >'.get_lang('LeaveGroup').'</span></a></li>'; |
|
2011
|
2011
|
break; |
|
2012
|
2012
|
case GROUP_USER_PERMISSION_PENDING_INVITATION: |
|
2013
|
2013
|
// $links .= '<li><a href="groups.php?id='.$group_id.'&action=join&u='.api_get_user_id().'">'.Display::return_icon('addd.gif', get_lang('YouHaveBeenInvitedJoinNow'), array('hspace'=>'6')).'<span class="social-menu-text4" >'.get_lang('YouHaveBeenInvitedJoinNow').'</span></a></li>'; |
|
2014
|
2014
|
break; |
|
2015
|
2015
|
case GROUP_USER_PERMISSION_PENDING_INVITATION_SENT_BY_USER: |
|
2016
|
|
- $relation_group_title = get_lang('WaitingForAdminResponse'); |
|
|
2016
|
+ $relation_group_title = get_lang('WaitingForAdminResponse'); |
|
2017
|
2017
|
break; |
|
2018
|
2018
|
case GROUP_USER_PERMISSION_MODERATOR: |
|
2019
|
2019
|
$relation_group_title = get_lang('IAmAModerator'); |
|
@@ -2021,25 +2021,25 @@ discard block |
|
|
block discarded – undo |
|
2021
|
2021
|
//$links .= '<li><a href="groups.php?id='.$group_id.'">'. Display::return_icon('message_list.png', get_lang('MessageList'), array('hspace'=>'6')).'<span class="'.($show=='messages_list'?'social-menu-text-active':'social-menu-text4').'" >'.get_lang('MessageList').'</span></a></li>'; |
|
2022
|
2022
|
//$links .= '<li><a href="group_members.php?id='.$group_id.'">'. Display::return_icon('member_list.png', get_lang('MemberList'), array('hspace'=>'6')).'<span class="'.($show=='member_list'?'social-menu-text-active':'social-menu-text4').'" >'.get_lang('MemberList').'</span></a></li>'; |
|
2023
|
2023
|
if ($group_info['visibility'] == GROUP_PERMISSION_CLOSED) { |
|
2024
|
|
- $links .= '<li><a href="group_waiting_list.php?id='.$group_id.'">'. |
|
2025
|
|
- Display::return_icon('waiting_list.png', get_lang('WaitingList'), array('hspace'=>'6')).'<span class="'.($show=='waiting_list'?'social-menu-text-active':'social-menu-text4').'" >'.get_lang('WaitingList').'</span></a></li>'; |
|
|
2024
|
+ $links .= '<li><a href="group_waiting_list.php?id='.$group_id.'">'. |
|
|
2025
|
+ Display::return_icon('waiting_list.png', get_lang('WaitingList'), array('hspace'=>'6')).'<span class="'.($show == 'waiting_list' ? 'social-menu-text-active' : 'social-menu-text4').'" >'.get_lang('WaitingList').'</span></a></li>'; |
|
2026
|
2026
|
} |
|
2027
|
|
- $links .= '<li><a href="group_invitation.php?id='.$group_id.'">'. |
|
2028
|
|
- Display::return_icon('invitation_friend.png', get_lang('InviteFriends'), array('hspace'=>'6')).'<span class="'.($show=='invite_friends'?'social-menu-text-active':'social-menu-text4').'" >'.get_lang('InviteFriends').'</span></a></li>'; |
|
2029
|
|
- $links .= '<li><a href="group_view.php?id='.$group_id.'&action=leave&u='.api_get_user_id().'">'. |
|
|
2027
|
+ $links .= '<li><a href="group_invitation.php?id='.$group_id.'">'. |
|
|
2028
|
+ Display::return_icon('invitation_friend.png', get_lang('InviteFriends'), array('hspace'=>'6')).'<span class="'.($show == 'invite_friends' ? 'social-menu-text-active' : 'social-menu-text4').'" >'.get_lang('InviteFriends').'</span></a></li>'; |
|
|
2029
|
+ $links .= '<li><a href="group_view.php?id='.$group_id.'&action=leave&u='.api_get_user_id().'">'. |
|
2030
|
2030
|
Display::return_icon('group_leave.png', get_lang('LeaveGroup'), array('hspace'=>'6')).'<span class="social-menu-text4" >'.get_lang('LeaveGroup').'</span></a></li>'; |
|
2031
|
2031
|
break; |
|
2032
|
2032
|
case GROUP_USER_PERMISSION_HRM: |
|
2033
|
2033
|
$relation_group_title = get_lang('IAmAHRM'); |
|
2034
|
2034
|
$links .= '<li><a href="'.api_get_path(WEB_CODE_PATH).'social/message_for_group_form.inc.php?view_panel=1&height=400&width=610&&user_friend='.api_get_user_id().'&group_id='.$group_id.'&action=add_message_group" class="ajax" title="'.get_lang('ComposeMessage').'" data-size="lg" data-title="'.get_lang('ComposeMessage').'">'. |
|
2035
|
2035
|
Display::return_icon('new-message.png', get_lang('NewTopic'), array('hspace'=>'6')).'<span class="social-menu-text4" >'.get_lang('NewTopic').'</span></a></li>'; |
|
2036
|
|
- $links .= '<li><a href="group_view.php?id='.$group_id.'">'. |
|
2037
|
|
- Display::return_icon('message_list.png', get_lang('MessageList'), array('hspace'=>'6')).'<span class="'.($show=='messages_list'?'social-menu-text-active':'social-menu-text4').'" >'.get_lang('MessageList').'</span></a></li>'; |
|
2038
|
|
- $links .= '<li><a href="group_invitation.php?id='.$group_id.'">'. |
|
2039
|
|
- Display::return_icon('invitation_friend.png', get_lang('InviteFriends'), array('hspace'=>'6')).'<span class="'.($show=='invite_friends'?'social-menu-text-active':'social-menu-text4').'" >'.get_lang('InviteFriends').'</span></a></li>'; |
|
2040
|
|
- $links .= '<li><a href="group_members.php?id='.$group_id.'">'. |
|
2041
|
|
- Display::return_icon('member_list.png', get_lang('MemberList'), array('hspace'=>'6')).'<span class="'.($show=='member_list'?'social-menu-text-active':'social-menu-text4').'" >'.get_lang('MemberList').'</span></a></li>'; |
|
2042
|
|
- $links .= '<li><a href="group_view.php?id='.$group_id.'&action=leave&u='.api_get_user_id().'">'. |
|
|
2036
|
+ $links .= '<li><a href="group_view.php?id='.$group_id.'">'. |
|
|
2037
|
+ Display::return_icon('message_list.png', get_lang('MessageList'), array('hspace'=>'6')).'<span class="'.($show == 'messages_list' ? 'social-menu-text-active' : 'social-menu-text4').'" >'.get_lang('MessageList').'</span></a></li>'; |
|
|
2038
|
+ $links .= '<li><a href="group_invitation.php?id='.$group_id.'">'. |
|
|
2039
|
+ Display::return_icon('invitation_friend.png', get_lang('InviteFriends'), array('hspace'=>'6')).'<span class="'.($show == 'invite_friends' ? 'social-menu-text-active' : 'social-menu-text4').'" >'.get_lang('InviteFriends').'</span></a></li>'; |
|
|
2040
|
+ $links .= '<li><a href="group_members.php?id='.$group_id.'">'. |
|
|
2041
|
+ Display::return_icon('member_list.png', get_lang('MemberList'), array('hspace'=>'6')).'<span class="'.($show == 'member_list' ? 'social-menu-text-active' : 'social-menu-text4').'" >'.get_lang('MemberList').'</span></a></li>'; |
|
|
2042
|
+ $links .= '<li><a href="group_view.php?id='.$group_id.'&action=leave&u='.api_get_user_id().'">'. |
|
2043
|
2043
|
Display::return_icon('delete_data.gif', get_lang('LeaveGroup'), array('hspace'=>'6')).'<span class="social-menu-text4" >'.get_lang('LeaveGroup').'</span></a></li>'; |
|
2044
|
2044
|
break; |
|
2045
|
2045
|
default: |
|
@@ -2082,14 +2082,14 @@ discard block |
|
|
block discarded – undo |
|
2082
|
2082
|
*/ |
|
2083
|
2083
|
public function get_groups_by_user_count($user_id = '', $relation_type = GROUP_USER_PERMISSION_READER, $with_image = false) |
|
2084
|
2084
|
{ |
|
2085
|
|
- $table_group_rel_user = $this->usergroup_rel_user_table; |
|
2086
|
|
- $tbl_group = $this->table; |
|
2087
|
|
- $user_id = intval($user_id); |
|
|
2085
|
+ $table_group_rel_user = $this->usergroup_rel_user_table; |
|
|
2086
|
+ $tbl_group = $this->table; |
|
|
2087
|
+ $user_id = intval($user_id); |
|
2088
|
2088
|
|
|
2089
|
2089
|
if ($relation_type == 0) { |
|
2090
|
2090
|
$where_relation_condition = ''; |
|
2091
|
2091
|
} else { |
|
2092
|
|
- $relation_type = intval($relation_type); |
|
|
2092
|
+ $relation_type = intval($relation_type); |
|
2093
|
2093
|
$where_relation_condition = "AND gu.relation_type = $relation_type "; |
|
2094
|
2094
|
} |
|
2095
|
2095
|
|
|
@@ -2162,7 +2162,7 @@ discard block |
|
|
block discarded – undo |
|
2162
|
2162
|
} |
|
2163
|
2163
|
|
|
2164
|
2164
|
$direction = 'ASC'; |
|
2165
|
|
- if (!in_array($direction, array('ASC','DESC'))) { |
|
|
2165
|
+ if (!in_array($direction, array('ASC', 'DESC'))) { |
|
2166
|
2166
|
$direction = 'ASC'; |
|
2167
|
2167
|
} |
|
2168
|
2168
|
|
|
@@ -2173,8 +2173,8 @@ discard block |
|
|
block discarded – undo |
|
2173
|
2173
|
$sql .= " LIMIT $from,$number_of_items"; |
|
2174
|
2174
|
|
|
2175
|
2175
|
$res = Database::query($sql); |
|
2176
|
|
- if (Database::num_rows($res)> 0) { |
|
2177
|
|
- while ($row = Database::fetch_array($res,'ASSOC')) { |
|
|
2176
|
+ if (Database::num_rows($res) > 0) { |
|
|
2177
|
+ while ($row = Database::fetch_array($res, 'ASSOC')) { |
|
2178
|
2178
|
if (!in_array($row['id'], $return)) { |
|
2179
|
2179
|
$return[$row['id']] = $row; |
|
2180
|
2180
|
} |
|
@@ -2199,7 +2199,7 @@ discard block |
|
|
block discarded – undo |
|
2199
|
2199
|
if ($i == $max_level) { |
|
2200
|
2200
|
$select_part .= "rg$rg_number.group_id as id_$rg_number "; |
|
2201
|
2201
|
} else { |
|
2202
|
|
- $select_part .="rg$rg_number.group_id as id_$rg_number, "; |
|
|
2202
|
+ $select_part .= "rg$rg_number.group_id as id_$rg_number, "; |
|
2203
|
2203
|
} |
|
2204
|
2204
|
if ($i == 1) { |
|
2205
|
2205
|
$cond_part .= "FROM $t_rel_group rg0 LEFT JOIN $t_rel_group rg$i on rg$rg_number.group_id = rg$i.subgroup_id "; |
|
@@ -2387,7 +2387,7 @@ discard block |
|
|
block discarded – undo |
|
2387
|
2387
|
$nameList = '<ul class="list-unstyled">'; |
|
2388
|
2388
|
|
|
2389
|
2389
|
foreach ($groupsNameListParsed as $name) { |
|
2390
|
|
- $nameList .= '<li>' . Display::span($name, ['class' => 'label label-info']) . '</li>'; |
|
|
2390
|
+ $nameList .= '<li>'.Display::span($name, ['class' => 'label label-info']).'</li>'; |
|
2391
|
2391
|
} |
|
2392
|
2392
|
|
|
2393
|
2393
|
$nameList .= '</ul>'; |