本文整理汇总了PHP中CRM_Core_PseudoConstant::groupIterator方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Core_PseudoConstant::groupIterator方法的具体用法?PHP CRM_Core_PseudoConstant::groupIterator怎么用?PHP CRM_Core_PseudoConstant::groupIterator使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Core_PseudoConstant
的用法示例。
在下文中一共展示了CRM_Core_PseudoConstant::groupIterator方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: preProcess
/**
* Processing needed for buildForm and later.
*/
public function preProcess()
{
// set the various class variables
$this->_group = CRM_Core_PseudoConstant::group();
$this->_groupIterator = CRM_Core_PseudoConstant::groupIterator();
$this->_tag = CRM_Core_BAO_Tag::getTags();
$this->_done = FALSE;
/*
* we allow the controller to set force/reset externally, useful when we are being
* driven by the wizard framework
*/
$this->_reset = CRM_Utils_Request::retrieve('reset', 'Boolean', CRM_Core_DAO::$_nullObject);
$this->_force = CRM_Utils_Request::retrieve('force', 'Boolean', CRM_Core_DAO::$_nullObject);
$this->_groupID = CRM_Utils_Request::retrieve('gid', 'Positive', $this);
$this->_amtgID = CRM_Utils_Request::retrieve('amtgID', 'Positive', $this);
$this->_ssID = CRM_Utils_Request::retrieve('ssID', 'Positive', $this);
$this->_sortByCharacter = CRM_Utils_Request::retrieve('sortByCharacter', 'String', $this);
$this->_ufGroupID = CRM_Utils_Request::retrieve('id', 'Positive', $this);
$this->_componentMode = CRM_Utils_Request::retrieve('component_mode', 'Positive', $this, FALSE, 1, $_REQUEST);
$this->_operator = CRM_Utils_Request::retrieve('operator', 'String', $this, FALSE, 1, $_REQUEST, 'AND');
/**
* set the button names
*/
$this->_searchButtonName = $this->getButtonName('refresh');
$this->_actionButtonName = $this->getButtonName('next', 'action');
$this->assign('actionButtonName', $this->_actionButtonName);
// reset from session, CRM-3526
$session = CRM_Core_Session::singleton();
if ($this->_force && $session->get('selectedSearchContactIds')) {
$session->resetScope('selectedSearchContactIds');
}
// if we dont get this from the url, use default if one exsts
$config = CRM_Core_Config::singleton();
if ($this->_ufGroupID == NULL && $config->defaultSearchProfileID != NULL) {
$this->_ufGroupID = $config->defaultSearchProfileID;
}
// assign context to drive the template display, make sure context is valid
$this->_context = CRM_Utils_Request::retrieve('context', 'String', $this, FALSE, 'search');
if (!CRM_Utils_Array::value($this->_context, self::validContext())) {
$this->_context = 'search';
}
$this->set('context', $this->_context);
$this->assign('context', $this->_context);
$this->_modeValue = self::getModeValue($this->_componentMode);
$this->assign($this->_modeValue);
$this->set('selectorName', self::$_selectorName);
// get user submitted values
// get it from controller only if form has been submitted, else preProcess has set this
// $this->controller->isModal( ) returns TRUE if page is
// valid, i.e all the validations are TRUE
if (!empty($_POST) && !$this->controller->isModal()) {
$this->_formValues = $this->controller->exportValues($this->_name);
$this->normalizeFormValues();
$this->_params = CRM_Contact_BAO_Query::convertFormValues($this->_formValues);
$this->_returnProperties =& $this->returnProperties();
// also get the uf group id directly from the post value
$this->_ufGroupID = CRM_Utils_Array::value('uf_group_id', $_POST, $this->_ufGroupID);
$this->_formValues['uf_group_id'] = $this->_ufGroupID;
$this->set('id', $this->_ufGroupID);
// also get the object mode directly from the post value
$this->_componentMode = CRM_Utils_Array::value('component_mode', $_POST, $this->_componentMode);
// also get the operator from the post value if set
$this->_operator = CRM_Utils_Array::value('operator', $_POST, $this->_operator);
$this->_formValues['operator'] = $this->_operator;
$this->set('operator', $this->_operator);
} else {
$this->_formValues = $this->get('formValues');
$this->_params = CRM_Contact_BAO_Query::convertFormValues($this->_formValues);
$this->_returnProperties =& $this->returnProperties();
if (!empty($this->_ufGroupID)) {
$this->set('id', $this->_ufGroupID);
}
}
if (empty($this->_formValues)) {
//check if group is a smart group (fix for CRM-1255)
if ($this->_groupID) {
if ($ssId = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Group', $this->_groupID, 'saved_search_id')) {
$this->_ssID = $ssId;
}
}
// fix for CRM-1907
if (isset($this->_ssID) && $this->_context != 'smog') {
// we only retrieve the saved search values if out current values are null
$this->_formValues = CRM_Contact_BAO_SavedSearch::getFormValues($this->_ssID);
//fix for CRM-1505
if (CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_SavedSearch', $this->_ssID, 'mapping_id')) {
$this->_params = CRM_Contact_BAO_SavedSearch::getSearchParams($this->_ssID);
} else {
$this->_params = CRM_Contact_BAO_Query::convertFormValues($this->_formValues);
}
$this->_returnProperties =& $this->returnProperties();
} else {
if (isset($this->_ufGroupID)) {
// also set the uf group id if not already present
$this->_formValues['uf_group_id'] = $this->_ufGroupID;
}
if (isset($this->_componentMode)) {
//.........这里部分代码省略.........
示例2:
/**
* Create or get groups iterator (iterates over nested groups in a
* logical fashion)
*
* The GroupNesting instance is returned; it's created if this is being
* called for the first time
*
*
* @access public
* @static
*
* @return mixed - instance of CRM_Contact_BAO_GroupNesting
*
*/
public static function &groupIterator($styledLabels = FALSE)
{
if (!self::$groupIterator) {
/*
When used as an object, GroupNesting implements Iterator
and iterates nested groups in a logical manner for us
*/
self::$groupIterator = new CRM_Contact_BAO_GroupNesting($styledLabels);
}
return self::$groupIterator;
}
示例3: preProcess
/**
* processing needed for buildForm and later
*
* @return void
* @access public
*/
function preProcess()
{
/**
* set the varios class variables
*/
$this->_group =& CRM_Core_PseudoConstant::group();
$this->_groupIterator =& CRM_Core_PseudoConstant::groupIterator();
$this->_tag =& CRM_Core_PseudoConstant::tag();
$this->_done = false;
/**
* set the button names
*/
$this->_searchButtonName = $this->getButtonName('refresh');
$this->_printButtonName = $this->getButtonName('next', 'print');
$this->_actionButtonName = $this->getButtonName('next', 'action');
/*
* we allow the controller to set force/reset externally, useful when we are being
* driven by the wizard framework
*/
$this->_reset = CRM_Utils_Request::retrieve('reset', 'Boolean', CRM_Core_DAO::$_nullObject);
$this->_force = CRM_Utils_Request::retrieve('force', 'Boolean', CRM_Core_DAO::$_nullObject);
$this->_groupID = CRM_Utils_Request::retrieve('gid', 'Positive', $this);
$this->_amtgID = CRM_Utils_Request::retrieve('amtgID', 'Positive', $this);
$this->_ssID = CRM_Utils_Request::retrieve('ssID', 'Positive', $this);
$this->_sortByCharacter = CRM_Utils_Request::retrieve('sortByCharacter', 'String', $this);
$this->_ufGroupID = CRM_Utils_Request::retrieve('id', 'Positive', $this);
// reset from session, CRM-3526
$session =& CRM_Core_Session::singleton();
if ($this->_force && $session->get('selectedSearchContactIds')) {
$session->resetScope('selectedSearchContactIds');
}
// if we dont get this from the url, use default if one exsts
$config =& CRM_Core_Config::singleton();
if ($this->_ufGroupID == null && $config->defaultSearchProfileID != null) {
$this->_ufGroupID = $config->defaultSearchProfileID;
}
/*
* assign context to drive the template display, make sure context is valid
*/
$this->_context = CRM_Utils_Request::retrieve('context', 'String', $this, false, 'search');
if (!CRM_Utils_Array::value($this->_context, self::validContext())) {
$this->_context = 'search';
$this->set('context', $this->_context);
}
$this->assign('context', $this->_context);
$this->set('selectorName', $this->_selectorName);
// get user submitted values
// get it from controller only if form has been submitted, else preProcess has set this
// $this->controller->isModal( ) returns true if page is
// valid, i.e all the validations are true
if (!empty($_POST) && !$this->controller->isModal()) {
$this->_formValues = $this->controller->exportValues($this->_name);
$this->normalizeFormValues();
$this->_params =& CRM_Contact_BAO_Query::convertFormValues($this->_formValues);
$this->_returnProperties =& $this->returnProperties();
// also get the uf group id directly from the post value
$this->_ufGroupID = CRM_Utils_Array::value('uf_group_id', $_POST, $this->_ufGroupID);
$this->_formValues['uf_group_id'] = $this->_ufGroupID;
$this->set('id', $this->_ufGroupID);
} else {
$this->_formValues = $this->get('formValues');
$this->_params =& CRM_Contact_BAO_Query::convertFormValues($this->_formValues);
$this->_returnProperties =& $this->returnProperties();
}
if (empty($this->_formValues)) {
//check if group is a smart group (fix for CRM-1255)
if ($this->_groupID) {
if ($ssId = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Group', $this->_groupID, 'saved_search_id')) {
$this->_ssID = $ssId;
}
}
// fix for CRM-1907
if (isset($this->_ssID) && $this->_context != 'smog') {
// we only retrieve the saved search values if out current values are null
$this->_formValues = CRM_Contact_BAO_SavedSearch::getFormValues($this->_ssID);
//fix for CRM-1505
if (CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_SavedSearch', $this->_ssID, 'mapping_id')) {
$this->_params =& CRM_Contact_BAO_SavedSearch::getSearchParams($this->_ssID);
} else {
$this->_params =& CRM_Contact_BAO_Query::convertFormValues($this->_formValues);
}
$this->_returnProperties =& $this->returnProperties();
} else {
if (isset($this->_ufGroupID)) {
// also set the uf group id if not already present
$this->_formValues['uf_group_id'] = $this->_ufGroupID;
}
}
}
$this->assign('id', CRM_Utils_Array::value('uf_group_id', $this->_formValues));
require_once 'CRM/Contact/BAO/Contact.php';
$menuItems = CRM_Contact_BAO_Contact::contextMenu();
$primaryActions = CRM_Utils_Array::value('primaryActions', $menuItems, array());
$this->_contextMenu = CRM_Utils_Array::value('moreActions', $menuItems, array());
//.........这里部分代码省略.........
示例4:
/**
* Create or get groups iterator (iterates over nested groups in a
* logical fashion)
*
* The GroupNesting instance is returned; it's created if this is being
* called for the first time
*
*
* @access public
* @static
*
* @return mixed - instance of CRM_Contact_BAO_GroupNesting
*
*/
public static function &groupIterator($styledLabels = false)
{
if (!self::$groupIterator) {
/*
When used as an object, GroupNesting implements Iterator
and iterates nested groups in a logical manner for us
*/
require_once 'CRM/Contact/BAO/GroupNesting.php';
self::$groupIterator = new CRM_Contact_BAO_GroupNesting($styledLabels);
}
return self::$groupIterator;
}