当前位置: 首页>>代码示例>>PHP>>正文


PHP CRM_Contact_BAO_GroupContact::getGroupId方法代码示例

本文整理汇总了PHP中CRM_Contact_BAO_GroupContact::getGroupId方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Contact_BAO_GroupContact::getGroupId方法的具体用法?PHP CRM_Contact_BAO_GroupContact::getGroupId怎么用?PHP CRM_Contact_BAO_GroupContact::getGroupId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CRM_Contact_BAO_GroupContact的用法示例。


在下文中一共展示了CRM_Contact_BAO_GroupContact::getGroupId方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: del

 /**
  * function to remove/ rejoin the group
  *
  * @param int $groupContactId id of crm_group_contact
  * @param string $status this is the status that should be updated.
  *
  * $access public
  */
 function del($groupContactId, $status, $contactID)
 {
     $groupId = CRM_Contact_BAO_GroupContact::getGroupId($groupContactId);
     switch ($status) {
         case 'i':
             $groupStatus = 'Added';
             break;
         case 'p':
             $groupStatus = 'Pending';
             break;
         case 'o':
             $groupStatus = 'Removed';
             break;
     }
     $groupNum = CRM_Contact_BAO_GroupContact::getContactGroup($this->_contactId, 'Added', null, true, true);
     if (defined('CIVICRM_MULTISITE') && CIVICRM_MULTISITE && $groupNum == 1 && $groupStatus == 'Removed') {
         CRM_Core_Session::setStatus('make sure at least one contact group association is maintained.');
         return false;
     }
     $ids = array($contactID);
     $method = 'Admin';
     $session =& CRM_Core_Session::singleton();
     $userID = $session->get('userID');
     if ($userID == $contactID) {
         $method = 'Web';
     }
     CRM_Contact_BAO_GroupContact::removeContactsFromGroup($ids, $groupId, $method, $groupStatus);
 }
开发者ID:bhirsch,项目名称:voipdev,代码行数:36,代码来源:GroupContact.php

示例2: del

 /**
  * function to remove/ rejoin the group
  *
  * @param int $groupContactId id of crm_group_contact
  * @param string $status this is the status that should be updated.
  *
  * $access public
  */
 function del($groupContactId, $status)
 {
     $groupContact =& new CRM_Contact_DAO_GroupContact();
     $groupId = CRM_Contact_BAO_GroupContact::getGroupId($groupContactId);
     switch ($status) {
         case 'i':
             $groupStatus = 'Added';
             break;
         case 'p':
             $groupStatus = 'Pending';
             break;
         case 'o':
             $groupStatus = 'Removed';
             break;
     }
     $contactID = array($this->_contactId);
     $method = 'Admin';
     CRM_Contact_BAO_GroupContact::removeContactsFromGroup($contactID, $groupId, $method, $groupStatus);
 }
开发者ID:bhirsch,项目名称:voipdrupal-4.7-1.0,代码行数:27,代码来源:GroupContact.php

示例3: del

 /**
  * function to remove/ rejoin the group
  *
  * @param int $groupContactId id of crm_group_contact
  * @param string $status this is the status that should be updated.
  *
  * $access public
  */
 static function del($groupContactId, $status, $contactID)
 {
     $groupId = CRM_Contact_BAO_GroupContact::getGroupId($groupContactId);
     switch ($status) {
         case 'i':
             $groupStatus = 'Added';
             break;
         case 'p':
             $groupStatus = 'Pending';
             break;
         case 'o':
             $groupStatus = 'Removed';
             break;
         case 'd':
             $groupStatus = 'Deleted';
             break;
     }
     $groupNum = CRM_Contact_BAO_GroupContact::getContactGroup($contactID, 'Added', NULL, TRUE, TRUE);
     if ($groupNum == 1 && $groupStatus == 'Removed' && CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::MULTISITE_PREFERENCES_NAME, 'is_enabled')) {
         CRM_Core_Session::setStatus(ts('Please ensure at least one contact group association is maintained.'), ts('Could Not Remove'));
         return FALSE;
     }
     $ids = array($contactID);
     $method = 'Admin';
     $session = CRM_Core_Session::singleton();
     $userID = $session->get('userID');
     if ($userID == $contactID) {
         $method = 'Web';
     }
     CRM_Contact_BAO_GroupContact::removeContactsFromGroup($ids, $groupId, $method, $groupStatus);
 }
开发者ID:archcidburnziso,项目名称:civicrm-core,代码行数:39,代码来源:GroupContact.php


注:本文中的CRM_Contact_BAO_GroupContact::getGroupId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。