本文整理汇总了PHP中CRM_Contact_BAO_Contact_Utils::checkContactType方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Contact_BAO_Contact_Utils::checkContactType方法的具体用法?PHP CRM_Contact_BAO_Contact_Utils::checkContactType怎么用?PHP CRM_Contact_BAO_Contact_Utils::checkContactType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Contact_BAO_Contact_Utils
的用法示例。
在下文中一共展示了CRM_Contact_BAO_Contact_Utils::checkContactType方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: preProcess
/**
* Build all the data structures needed to build the form.
*
* @return void
*/
public function preProcess()
{
// initialize the task and row fields
parent::preProcess();
$session = CRM_Core_Session::singleton();
$this->_userContext = $session->readUserContext();
$validate = FALSE;
//validations
if (count($this->_contactIds) > $this->_maxContacts) {
CRM_Core_Session::setStatus(ts("The maximum number of contacts you can select for Batch Update is %1. You have selected %2. Please select fewer contacts from your search results and try again.", array(1 => $this->_maxContacts, 2 => count($this->_contactIds))), ts('Maximum Exceeded'), 'error');
$validate = TRUE;
}
if (CRM_Contact_BAO_Contact_Utils::checkContactType($this->_contactIds)) {
CRM_Core_Session::setStatus(ts("Batch update requires that all selected contacts be the same basic type (e.g. all Individuals OR all Organizations...). Please modify your selection and try again."), ts('Contact Type Mismatch'), 'error');
$validate = TRUE;
}
// than redirect
if ($validate) {
CRM_Utils_System::redirect($this->_userContext);
}
}
示例2: preProcess
/**
* build all the data structures needed to build the form
*
* @return void
* @access public
*/
function preProcess()
{
/*
* initialize the task and row fields
*/
parent::preProcess();
$session = CRM_Core_Session::singleton();
$this->_userContext = $session->readUserContext();
$validate = FALSE;
//validations
if (count($this->_contactIds) > $this->_maxContacts) {
CRM_Core_Session::setStatus("The maximum number of contacts you can select for Batch Update is {$this->_maxContacts}. You have selected " . count($this->_contactIds) . ". Please select fewer contacts from your search results and try again.");
$validate = TRUE;
}
if (CRM_Contact_BAO_Contact_Utils::checkContactType($this->_contactIds)) {
CRM_Core_Session::setStatus("Batch update requires that all selected contacts be the same type (e.g. all Individuals OR all Organizations...). Please modify your selected contacts and try again.");
$validate = TRUE;
}
// than redirect
if ($validate) {
CRM_Utils_System::redirect($this->_userContext);
}
}