}
if ($allGroups == NULL) {
- $allGroups = CRM_Core_PseudoConstant::allGroup();
+ $allGroups = CRM_Contact_BAO_Contact::buildOptions('group_id', NULL, ['onlyActive' => FALSE]);
}
$acls = CRM_ACL_BAO_Cache::build($contactID);
}
$values[$object->id]['group_type'] = implode(', ', $types);
}
- $values[$object->id]['action'] = CRM_Core_Action::formLink($newLinks,
- $action,
- array(
- 'id' => $object->id,
- 'ssid' => $object->saved_search_id,
- ),
- ts('more'),
- FALSE,
- 'group.selector.row',
- 'Group',
- $object->id
- );
+ if ($action) {
+ $values[$object->id]['action'] = CRM_Core_Action::formLink($newLinks,
+ $action,
+ array(
+ 'id' => $object->id,
+ 'ssid' => $object->saved_search_id,
+ ),
+ ts('more'),
+ FALSE,
+ 'group.selector.row',
+ 'Group',
+ $object->id
+ );
+ }
// If group has children, add class for link to view children
$values[$object->id]['is_parent'] = FALSE;
* @return array|bool
*/
public static function buildOptions($fieldName, $context = NULL, $props = array()) {
- $params = array();
- $options = CRM_Core_PseudoConstant::get(__CLASS__, $fieldName, $params, $context);
+ $options = CRM_Core_PseudoConstant::get(__CLASS__, $fieldName, $props, $context);
// Sort group list by hierarchy
// TODO: This will only work when api.entity is "group_contact". What about others?
}
/**
- * DEPRECATED generic populate method.
+ * @deprecated generic populate method.
* All pseudoconstant functions that use this method are also @deprecated
*
* The static array $var is populated from the db