*
* @return array
*/
- public function &actionLinks() {
+ public static function &actionLinks() {
// check if variable _actionsLinks is populated
if (!self::$_actionLinks) {
// helper variable for nicer formatting
// assign vars to templates
$this->assign('action', $action);
+ $this->assign('selectedChild', CRM_Utils_Request::retrieve('selectedChild', 'String', $this));
$id = CRM_Utils_Request::retrieve('id', 'Positive',
$this, FALSE, 0
);
$ufGroup[$id]['is_reserved'] = $value['is_reserved'];
// form all action links
- $action = array_sum(array_keys($this->actionLinks()));
+ $action = array_sum(array_keys(self::actionLinks()));
// update enable/disable links depending on uf_group properties.
if ($value['is_active']) {
$groupTypes = self::extractGroupTypes($value['group_type']);
// drop Create, Edit and View mode links if profile group_type is one of the following:
- $groupComponents = array('Contribution', 'Membership', 'Activity', 'Participant', 'Case');
- $componentFound = array_intersect($groupComponents, array_keys($groupTypes));
- if (!empty($componentFound)) {
+ // Contribution, Membership, Activity, Participant, Case, Grant
+ $isMixedProfile = CRM_Core_BAO_UFField::checkProfileType($id);
+ if ($isMixedProfile) {
$action -= CRM_Core_Action::ADD;
+ $action -= CRM_Core_Action::ADVANCED;
+ $action -= CRM_Core_Action::BASIC;
+ $action -= CRM_Core_Action::PROFILE;
}
$ufGroup[$id]['group_type'] = self::formatGroupTypes($groupTypes);
* @param int $id
* Uf group id.
*
- * @param $action
- *
- * @return void
+ * @param int $action
*/
public function preview($id, $action) {
$controller = new CRM_Core_Controller_Simple('CRM_UF_Form_Preview', ts('CiviCRM Profile Group Preview'), NULL);