if (!empty($groups)) {
foreach ($groups as $id => $value) {
$groupList[$id]['group_id'] = $value['id'];
- $groupList[$id]['members'] = $value['members'];
+ $groupList[$id]['count'] = $value['count'];
$groupList[$id]['group_name'] = $value['title'];
// append parent names if in search mode
}
$query = "
- SELECT groups.*, createdBy.sort_name as created_by, IF(groups.saved_search_id, COUNT(smart_members.id), COUNT(members.id)) as members {$select}
+ SELECT groups.*, createdBy.sort_name as created_by, IF(groups.saved_search_id, COUNT(smart_contacts.id), COUNT(contacts.id)) as `count` {$select}
FROM civicrm_group groups
- LEFT JOIN civicrm_group_contact members
- ON members.group_id = groups.id AND members.status = 'Added'
- LEFT JOIN civicrm_group_contact_cache smart_members
- ON smart_members.group_id = groups.id
+ LEFT JOIN civicrm_group_contact contacts
+ ON contacts.group_id = groups.id AND contacts.status = 'Added'
+ LEFT JOIN civicrm_group_contact_cache smart_contacts
+ ON smart_contacts.group_id = groups.id
LEFT JOIN civicrm_contact createdBy
ON createdBy.id = groups.created_id
{$from}
$values[$object->id]['visibility'] = $visibility[$values[$object->id]['visibility']];
- $values[$object->id]['members'] = $object->members;
+ $values[$object->id]['count'] = $object->count;
if (isset($values[$object->id]['group_type'])) {
$groupTypes = explode(CRM_Core_DAO::VALUE_SEPARATOR,
}
else {
$sortMapper = array(
- 0 => 'groups.title', 1 => 'groups.id', 2 => 'createdBy.sort_name', 3 => '',
+ 0 => 'groups.title', 1 => 'count', 2 => 'createdBy.sort_name', 3 => '',
4 => 'groups.group_type', 5 => 'groups.visibility',
);
$iFilteredTotal = $iTotal = $params['total'];
$selectorElements = array(
- 'group_name', 'members', 'created_by', 'group_description',
+ 'group_name', 'count', 'created_by', 'group_description',
'group_type', 'visibility', 'org_info', 'links', 'class',
);
<thead>
<tr>
<th class='crm-group-name'>{ts}Name{/ts}</th>
- <th class='crm-group-members'>{ts}Members{/ts}</th>
+ <th class='crm-group-count'>{ts}Count{/ts}</th>
<th class='crm-group-created_by'>{ts}Created By{/ts}</th>
<th class='crm-group-description'>{ts}Description{/ts}</th>
<th class='crm-group-group_type'>{ts}Group Type{/ts}</th>
"aaSorting" : [],
"aoColumns" : [
{sClass:'crm-group-name'},
- {sClass:'crm-group-members'},
+ {sClass:'crm-group-count'},
{sClass:'crm-group-created_by'},
{sClass:'crm-group-description', bSortable:false},
{sClass:'crm-group-group_type'},
else {
appendHTML += '<td class="crm-group-name ' + levelClass + '"><span class="crm-no-children"></span><span class="crm-editable crmf-title">' + val.group_name + '</span></td>';
}
- appendHTML += "<td>" + val.members + "</td>";
+ appendHTML += "<td>" + val.count + "</td>";
appendHTML += "<td>" + val.created_by + "</td>";
appendHTML += '<td><span class="crm-editable crmf-description" data-type="textarea">' + (val.group_description || '') + "</span></td>";
appendHTML += "<td>" + val.group_type + "</td>";