3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
6 | This work is published under the GNU AGPLv3 license with some |
7 | permitted exceptions and without any warranty. For full license |
8 | and copyright information, see https://civicrm.org/licensing |
9 +--------------------------------------------------------------------+
15 * @copyright CiviCRM LLC https://civicrm.org/licensing
17 class CRM_Group_Page_Group
extends CRM_Core_Page_Basic
{
18 protected $_sortByCharacter;
25 public function getBAOName() {
26 return 'CRM_Contact_BAO_Group';
30 * Define action links.
32 * self::$_links array of action links
34 public function &links() {
38 * Return class name of edit form.
42 public function editForm() {
43 return 'CRM_Group_Form_Edit';
47 * Return name of edit form.
51 public function editName() {
52 return ts('Edit Group');
56 * Return name of delete form.
60 public function deleteName() {
61 return 'Delete Group';
65 * Return user context uri to return to.
71 public function userContext($mode = NULL) {
72 return 'civicrm/group';
76 * Return user context uri params.
82 public function userContextParams($mode = NULL) {
83 return 'reset=1&action=browse';
87 * Re-implement browse.
89 * We need to do slightly different things for groups vs saved search groups, hence we
90 * re-implement browse from Page_Basic.
94 public function browse($action = NULL) {
95 $groupPermission = CRM_Core_Permission
::check('edit groups') ? CRM_Core_Permission
::EDIT
: CRM_Core_Permission
::VIEW
;
96 $this->assign('groupPermission', $groupPermission);
101 $reservedPermission = CRM_Core_Permission
::check('administer reserved groups') ? CRM_Core_Permission
::EDIT
: CRM_Core_Permission
::VIEW
;
102 $this->assign('reservedPermission', $reservedPermission);
104 if (CRM_Core_Permission
::check('administer Multiple Organizations') &&
105 CRM_Core_Permission
::isMultisiteEnabled()
109 $this->assign('showOrgInfo', $showOrgInfo);
111 // Refresh smart group cache
112 if (!empty($_GET['update_smart_groups'])) {
113 CRM_Contact_BAO_GroupContactCache
::loadAll();
115 elseif (!CRM_Core_DAO
::singleValueQuery("SELECT contact_id FROM civicrm_group_contact_cache LIMIT 1")) {
116 CRM_Core_Session
::setStatus(ts('Count data for smart groups is not currently calculated. You may click Update Smart Groups to generate it. Be aware this can cause significant server load'));
125 public function search() {
126 if ($this->_action
& (CRM_Core_Action
::ADD |
127 CRM_Core_Action
::UPDATE |
128 CRM_Core_Action
::DELETE
134 $form = new CRM_Core_Controller_Simple('CRM_Group_Form_Search', ts('Search Groups'), CRM_Core_Action
::ADD
);
135 $form->setEmbedded(TRUE);
136 $form->setParent($this);