當前位置: 首頁>>代碼示例>>PHP>>正文


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怎麽用?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);
     }
 }
開發者ID:kidaa30,項目名稱:yes,代碼行數:26,代碼來源:PickProfile.php

示例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);
     }
 }
開發者ID:peteainsworth,項目名稱:civicrm-4.2.9-drupal,代碼行數:29,代碼來源:PickProfile.php


注:本文中的CRM_Contact_BAO_Contact_Utils::checkContactType方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。