* @param $permission
*/
public function setPermissionAndRequest($permission) {
- CRM_Core_Config::singleton()->userPermissionClass->permissions = (array) $permission;
- CRM_Contact_BAO_Group::getPermissionClause(TRUE);
+ $this->setPermissions((array) $permission);
global $_REQUEST;
$_REQUEST = $this->_params;
}
$params = $this->_params;
$groups = CRM_Contact_BAO_Group::getGroupListSelector($params);
$this->assertEquals(2, $groups['recordsTotal']);
- $this->assertEquals('<span><a href="' . CIVICRM_UF_BASEURL . 'index.php?q=civicrm/group/search&reset=1&force=1&context=smog&gid=4" class="action-item crm-hover-button" title=\'Group Contacts\' >Contacts</a></span>', $groups['data'][0]['links']);
- $this->assertEquals('<span><a href="' . CIVICRM_UF_BASEURL . 'index.php?q=civicrm/group/search&reset=1&force=1&context=smog&gid=2" class="action-item crm-hover-button" title=\'Group Contacts\' >Contacts</a></span>', $groups['data'][1]['links']);
+ $this->assertEquals('<span><a href="' . CIVICRM_UF_BASEURL . '/index.php?q=civicrm/group/search&reset=1&force=1&context=smog&gid=4" class="action-item crm-hover-button" title=\'Group Contacts\' >Contacts</a></span>', $groups['data'][0]['links']);
+ $this->assertEquals('<span><a href="' . CIVICRM_UF_BASEURL . '/index.php?q=civicrm/group/search&reset=1&force=1&context=smog&gid=2" class="action-item crm-hover-button" title=\'Group Contacts\' >Contacts</a></span>', $groups['data'][1]['links']);
// as per changes made in PR-6822
$this->setPermissionAndRequest(array('view all contacts', 'edit groups'));
$params = $this->_params;
$groups = CRM_Contact_BAO_Group::getGroupListSelector($params);
$this->assertEquals(2, $groups['recordsTotal']);
- $this->assertEquals('<span><a href="' . CIVICRM_UF_BASEURL . 'index.php?q=civicrm/group/search&reset=1&force=1&context=smog&gid=4" class="action-item crm-hover-button" title=\'Group Contacts\' >Contacts</a><a href="' . CIVICRM_UF_BASEURL . 'index.php?q=civicrm/group&reset=1&action=update&id=4" class="action-item crm-hover-button" title=\'Edit Group\' >Settings</a></span><span class=\'btn-slide crm-hover-button\'>more<ul class=\'panel\'><li><a href="#" class="action-item crm-hover-button crm-enable-disable" title=\'Disable Group\' >Disable</a></li><li><a href="' . CIVICRM_UF_BASEURL . 'index.php?q=civicrm/group&reset=1&action=delete&id=4" class="action-item crm-hover-button small-popup" title=\'Delete Group\' >Delete</a></li></ul></span>', $groups['data'][0]['links']);
- $this->assertEquals('<span><a href="' . CIVICRM_UF_BASEURL . 'index.php?q=civicrm/group/search&reset=1&force=1&context=smog&gid=2" class="action-item crm-hover-button" title=\'Group Contacts\' >Contacts</a><a href="' . CIVICRM_UF_BASEURL . 'index.php?q=civicrm/group&reset=1&action=update&id=2" class="action-item crm-hover-button" title=\'Edit Group\' >Settings</a></span><span class=\'btn-slide crm-hover-button\'>more<ul class=\'panel\'><li><a href="#" class="action-item crm-hover-button crm-enable-disable" title=\'Disable Group\' >Disable</a></li><li><a href="' . CIVICRM_UF_BASEURL . 'index.php?q=civicrm/group&reset=1&action=delete&id=2" class="action-item crm-hover-button small-popup" title=\'Delete Group\' >Delete</a></li></ul></span>', $groups['data'][1]['links']);
+ $this->assertEquals('<span><a href="'
+ . CIVICRM_UF_BASEURL . '/index.php?q=civicrm/group/search&reset=1&force=1&context=smog&gid=4" class="action-item crm-hover-button" title=\'Group Contacts\' >Contacts</a><a href="'
+ . CIVICRM_UF_BASEURL . '/index.php?q=civicrm/group&reset=1&action=update&id=4" class="action-item crm-hover-button" title=\'Edit Group\' >Settings</a></span><span class=\'btn-slide crm-hover-button\'>more<ul class=\'panel\'><li><a href="#" class="action-item crm-hover-button crm-enable-disable" title=\'Disable Group\' >Disable</a></li><li><a href="'
+ . CIVICRM_UF_BASEURL . '/index.php?q=civicrm/group&reset=1&action=delete&id=4" class="action-item crm-hover-button small-popup" title=\'Delete Group\' >Delete</a></li></ul></span>', $groups['data'][0]['links']);
+ $this->assertEquals('<span><a href="'
+ . CIVICRM_UF_BASEURL . '/index.php?q=civicrm/group/search&reset=1&force=1&context=smog&gid=2" class="action-item crm-hover-button" title=\'Group Contacts\' >Contacts</a><a href="'
+ . CIVICRM_UF_BASEURL . '/index.php?q=civicrm/group&reset=1&action=update&id=2" class="action-item crm-hover-button" title=\'Edit Group\' >Settings</a></span><span class=\'btn-slide crm-hover-button\'>more<ul class=\'panel\'><li><a href="#" class="action-item crm-hover-button crm-enable-disable" title=\'Disable Group\' >Disable</a></li><li><a href="'
+ . CIVICRM_UF_BASEURL . '/index.php?q=civicrm/group&reset=1&action=delete&id=2" class="action-item crm-hover-button small-popup" title=\'Delete Group\' >Delete</a></li></ul></span>', $groups['data'][1]['links']);
}
/**