Add group membership filter widget in contact list

This commit is contained in:
Hypolite Petovan 2020-01-23 17:49:55 -05:00
parent ed3ac36621
commit 4da90b9378
2 changed files with 45 additions and 6 deletions

View file

@ -326,6 +326,12 @@ class Contact extends BaseModule
$follow_widget = '';
$networks_widget = '';
$rel_widget = '';
if ($contact['uid'] != 0) {
$groups_widget = Model\Group::sidebarWidget('contact', 'group', 'full', 'everyone', $contact_id);
} else {
$groups_widget = '';
}
} else {
$vcard_widget = '';
$findpeople_widget = Widget::findPeople();
@ -337,12 +343,7 @@ class Contact extends BaseModule
$networks_widget = Widget::networks($_SERVER['REQUEST_URI'], $nets);
$rel_widget = Widget::contactRels($_SERVER['REQUEST_URI'], $rel);
}
if ($contact['uid'] != 0) {
$groups_widget = Model\Group::sidebarWidget('contact', 'group', 'full', 'everyone', $contact_id);
} else {
$groups_widget = null;
$groups_widget = Widget::groups($_SERVER['REQUEST_URI'], $group);
}
DI::page()['aside'] .= $vcard_widget . $findpeople_widget . $follow_widget . $groups_widget . $networks_widget . $rel_widget;
@ -710,6 +711,11 @@ class Contact extends BaseModule
break;
}
if ($group) {
$sql_extra = " AND EXISTS(SELECT `id` FROM `group_member` WHERE `gid` = ? AND `contact`.`id` = `contact-id`)";
$sql_values[] = $group;
}
$sql_extra .= Widget::unavailableNetworks();
$total = 0;