0aef79cab8cb21646d52fcb331e87d4bab3a2568
3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.4 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2013 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
10 | CiviCRM is free software; you can copy, modify, and distribute it |
11 | under the terms of the GNU Affero General Public License |
12 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
14 | CiviCRM is distributed in the hope that it will be useful, but |
15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
17 | See the GNU Affero General Public License for more details. |
19 | You should have received a copy of the GNU Affero General Public |
20 | License and the CiviCRM Licensing Exception along |
21 | with this program; if not, contact CiviCRM LLC |
22 | at info[AT]civicrm[DOT]org. If you have questions about the |
23 | GNU Affero General Public License or the licensing of CiviCRM, |
24 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
25 +--------------------------------------------------------------------+
31 * @copyright CiviCRM LLC (c) 2004-2013
35 class CRM_Group_Page_Group
extends CRM_Core_Page_Basic
{
36 protected $_sortByCharacter;
38 function getBAOName() {
39 return 'CRM_Contact_BAO_Group';
43 * Function to define action links
45 * @return array self::$_links array of action links
51 * return class name of edit form
57 return 'CRM_Group_Form_Edit';
61 * return name of edit form
67 return ts('Edit Group');
71 * return name of delete form
76 function deleteName() {
77 return 'Delete Group';
81 * return user context uri to return to
86 function userContext($mode = NULL) {
87 return 'civicrm/group';
91 * return user context uri params
96 function userContextParams($mode = NULL) {
97 return 'reset=1&action=browse';
101 * make sure that the user has permission to access this group
103 * @param int $id the id of the object
104 * @param int $name the name or title of the object
106 * @return string the permission that the user has (or null)
109 function checkPermission($id, $title) {
110 return CRM_Contact_BAO_Group
::checkPermission($id, $title);
114 * We need to do slightly different things for groups vs saved search groups, hence we
115 * reimplement browse from Page_Basic
122 function browse($action = NULL) {
123 $groupPermission = CRM_Core_Permission
::check('edit groups') ? CRM_Core_Permission
::EDIT
: CRM_Core_Permission
::VIEW
;
124 $this->assign('groupPermission', $groupPermission);
126 $showOrgInfo = FALSE;
129 $reservedPermission = CRM_Core_Permission
::check('administer reserved groups') ? CRM_Core_Permission
::EDIT
: CRM_Core_Permission
::VIEW
;
130 $this->assign('reservedPermission', $reservedPermission);
132 if (CRM_Core_Permission
::check('administer Multiple Organizations') &&
133 CRM_Core_Permission
::isMultisiteEnabled()
137 $this->assign('showOrgInfo', $showOrgInfo);
144 (CRM_Core_Action
::ADD |
145 CRM_Core_Action
::UPDATE |
146 CRM_Core_Action
::DELETE
152 $form = new CRM_Core_Controller_Simple('CRM_Group_Form_Search', ts('Search Groups'), CRM_Core_Action
::ADD
);
153 $form->setEmbedded(TRUE);
154 $form->setParent($this);