当前位置: 首页>>代码示例>>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;未经允许,请勿转载。