$ssID = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Group', $this->_groupID, 'saved_search_id');
$this->assign('ssID', $ssID);
- //get the saved search mapping id
+ //get the saved search edit link
if ($ssID) {
$this->_ssID = $ssID;
- $ssMappingId = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_SavedSearch', $ssID, 'mapping_id');
- $this->assign('ssMappingID', $ssMappingId);
+ $this->assign('editSmartGroupURL', CRM_Contact_BAO_SavedSearch::getEditSearchUrl($ssID));
}
// Set dynamic page title for 'Show Members of Group'
'group_contact_status', ts('Group Status')
);
+ $this->assign('permissionEditSmartGroup', CRM_Core_Permission::check('edit groups'));
$this->assign('permissionedForGroup', $permissionForGroup);
}
$this->_componentMode = CRM_Utils_Request::retrieve('component_mode', 'Positive', $this, FALSE, CRM_Contact_BAO_Query::MODE_CONTACTS, $_REQUEST);
$this->_operator = CRM_Utils_Request::retrieve('operator', 'String', $this, FALSE, CRM_Contact_BAO_Query::SEARCH_OPERATOR_AND, 'REQUEST');
+ if (!empty($this->_ssID) && !CRM_Core_Permission::check('edit groups')) {
+ CRM_Core_Error::statusBounce(ts('You do not have permission to modify smart groups'));
+ }
+
/**
* set the button names
*/