本文整理匯總了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);
}
}