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


PHP CRM_Contact_BAO_GroupContact::getGroupList方法代码示例

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


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

示例1: buildQuickForm

 function buildQuickForm()
 {
     // Contact
     $this->add('hidden', 'contact_id', ts('Contact id'), '', true);
     // get the list of all the groups
     $allGroups = CRM_Core_PseudoConstant::group();
     // Arrange groups into hierarchical listing (child groups follow their parents and have indentation spacing in title)
     $groupHierarchy = CRM_Contact_BAO_Group::getGroupsHierarchy($allGroups, NULL, '  ', TRUE);
     // get the list of groups contact is currently in ("Added") or unsubscribed ("Removed").
     $currentGroups = CRM_Contact_BAO_GroupContact::getGroupList($this->_contactId);
     // Remove current groups from drowdown options ($groupSelect)
     if (is_array($currentGroups)) {
         // Compare array keys, since the array values (group title) in $groupList may have extra spaces for indenting child groups
         $groupSelect = array_diff_key($groupHierarchy, $currentGroups);
     } else {
         $groupSelect = $groupHierarchy;
     }
     $groupSelect = array('' => ts('- select group -')) + $groupSelect;
     if (count($groupSelect) > 1) {
         $session = CRM_Core_Session::singleton();
         $msg = ts('Add to a group');
         $this->add('select', 'group_id', $msg, $groupSelect, false);
         $this->addButtons(array(array('type' => 'submit', 'name' => ts('Opslaan / Volgende'), 'isDefault' => TRUE)));
         // export form elements
         $this->assign('elementNames', $this->getRenderableElementNames());
     }
     parent::buildQuickForm();
 }
开发者ID:jvos,项目名称:nl.vnv.lidmaatschapwijziging_old,代码行数:28,代码来源:LidmaatschapWijzigingGroup.php

示例2: buildQuickForm

 /**
  * Build the form object.
  *
  * @return void
  */
 public function buildQuickForm()
 {
     // get the list of all the groups
     if ($this->_context == 'user') {
         $onlyPublicGroups = CRM_Utils_Request::retrieve('onlyPublicGroups', 'Boolean', $this, FALSE);
         $allGroups = CRM_Core_PseudoConstant::staticGroup($onlyPublicGroups);
     } else {
         $allGroups = CRM_Core_PseudoConstant::group();
     }
     // Arrange groups into hierarchical listing (child groups follow their parents and have indentation spacing in title)
     $groupHierarchy = CRM_Contact_BAO_Group::getGroupsHierarchy($allGroups, NULL, '  ', TRUE);
     // get the list of groups contact is currently in ("Added") or unsubscribed ("Removed").
     $currentGroups = CRM_Contact_BAO_GroupContact::getGroupList($this->_contactId);
     // Remove current groups from drowdown options ($groupSelect)
     if (is_array($currentGroups)) {
         // Compare array keys, since the array values (group title) in $groupList may have extra spaces for indenting child groups
         $groupSelect = array_diff_key($groupHierarchy, $currentGroups);
     } else {
         $groupSelect = $groupHierarchy;
     }
     $groupSelect = array('' => ts('- select group -')) + $groupSelect;
     if (count($groupSelect) > 1) {
         $session = CRM_Core_Session::singleton();
         // user dashboard
         if (strstr($session->readUserContext(), 'user')) {
             $msg = ts('Join a Group');
         } else {
             $msg = ts('Add to a group');
         }
         $this->add('select', 'group_id', '', $groupSelect, TRUE, array('class' => 'crm-select2 crm-action-menu action-icon-plus', 'placeholder' => $msg));
         $this->addButtons(array(array('type' => 'next', 'name' => ts('Add'), 'isDefault' => TRUE)));
     }
 }
开发者ID:kidaa30,项目名称:yes,代码行数:38,代码来源:GroupContact.php

示例3: create

 /**
  * Takes an associative array and creates / removes
  * contacts from the groups
  *
  *
  * @param array $params
  *   (reference ) an assoc array of name/value pairs.
  * @param array $contactId
  *   Contact id.
  *
  * @param bool $visibility
  * @param string $method
  *
  * @return void
  */
 public static function create(&$params, $contactId, $visibility = FALSE, $method = 'Admin')
 {
     $contactIds = array();
     $contactIds[] = $contactId;
     //if $visibility is true we are coming in via profile mean $method = 'Web'
     $ignorePermission = FALSE;
     if ($visibility) {
         $ignorePermission = TRUE;
     }
     if ($contactId) {
         $contactGroupList =& CRM_Contact_BAO_GroupContact::getContactGroup($contactId, 'Added', NULL, FALSE, $ignorePermission);
         if (is_array($contactGroupList)) {
             foreach ($contactGroupList as $key) {
                 $groupId = $key['group_id'];
                 $contactGroup[$groupId] = $groupId;
             }
         }
     }
     // get the list of all the groups
     $allGroup = CRM_Contact_BAO_GroupContact::getGroupList(0, $visibility);
     // this fix is done to prevent warning generated by array_key_exits incase of empty array is given as input
     if (!is_array($params)) {
         $params = array();
     }
     // this fix is done to prevent warning generated by array_key_exits incase of empty array is given as input
     if (!isset($contactGroup) || !is_array($contactGroup)) {
         $contactGroup = array();
     }
     // check which values has to be add/remove contact from group
     foreach ($allGroup as $key => $varValue) {
         if (!empty($params[$key]) && !array_key_exists($key, $contactGroup)) {
             // add contact to group
             CRM_Contact_BAO_GroupContact::addContactsToGroup($contactIds, $key, $method);
         } elseif (empty($params[$key]) && array_key_exists($key, $contactGroup)) {
             // remove contact from group
             CRM_Contact_BAO_GroupContact::removeContactsFromGroup($contactIds, $key, $method);
         }
     }
 }
开发者ID:BorislavZlatanov,项目名称:civicrm-core,代码行数:54,代码来源:GroupContact.php

示例4: getGroups

 /**
  * Method to get groups
  *
  * @return array
  * @access protected
  */
 protected function getGroups()
 {
     return array('' => ts('-- please select --')) + CRM_Contact_BAO_GroupContact::getGroupList();
 }
开发者ID:alejandro-ixiam,项目名称:org.civicoop.civirules,代码行数:10,代码来源:GroupId.php

示例5: displayProfile


//.........这里部分代码省略.........
                         if ('gender' == substr($name, 0, 6)) {
                             $gender = CRM_Core_PseudoConstant::gender();
                             $values[$index] = $gender[$params[$name]];
                         } else {
                             if ('individual_prefix' == substr($name, 0, 17)) {
                                 $prefix = CRM_Core_PseudoConstant::individualPrefix();
                                 $values[$index] = $prefix[$params[$name]];
                             } else {
                                 if ('individual_suffix' == substr($name, 0, 17)) {
                                     $suffix = CRM_Core_PseudoConstant::individualSuffix();
                                     $values[$index] = $suffix[$params[$name]];
                                 } else {
                                     if (in_array($name, array('addressee', 'email_greeting', 'postal_greeting'))) {
                                         $filterCondition = array('greeting_type' => $name);
                                         $greeting =& CRM_Core_PseudoConstant::greeting($filterCondition);
                                         $values[$index] = $greeting[$params[$name]];
                                     } else {
                                         if ($name === 'preferred_communication_method') {
                                             $communicationFields = CRM_Core_PseudoConstant::pcm();
                                             $pref = array();
                                             $compref = array();
                                             $pref = $params[$name];
                                             if (is_array($pref)) {
                                                 foreach ($pref as $k => $v) {
                                                     if ($v) {
                                                         $compref[] = $communicationFields[$k];
                                                     }
                                                 }
                                             }
                                             $values[$index] = implode(",", $compref);
                                         } else {
                                             if ($name == 'group') {
                                                 require_once 'CRM/Contact/BAO/GroupContact.php';
                                                 $groups = CRM_Contact_BAO_GroupContact::getGroupList();
                                                 $title = array();
                                                 foreach ($params[$name] as $gId => $dontCare) {
                                                     if ($dontCare) {
                                                         $title[] = $groups[$gId];
                                                     }
                                                 }
                                                 $values[$index] = implode(', ', $title);
                                             } else {
                                                 if ($name == 'tag') {
                                                     require_once 'CRM/Core/BAO/EntityTag.php';
                                                     $entityTags = $params[$name];
                                                     $allTags =& CRM_Core_PseudoConstant::tag();
                                                     $title = array();
                                                     if (is_array($entityTags)) {
                                                         foreach ($entityTags as $tagId => $dontCare) {
                                                             $title[] = $allTags[$tagId];
                                                         }
                                                     }
                                                     $values[$index] = implode(', ', $title);
                                                 } else {
                                                     if ('participant_role_id' == $name) {
                                                         $roles = CRM_Event_PseudoConstant::participantRole();
                                                         $values[$index] = $roles[$params[$name]];
                                                     } else {
                                                         if ('participant_status_id' == $name) {
                                                             $status = CRM_Event_PseudoConstant::participantStatus();
                                                             $values[$index] = $status[$params[$name]];
                                                         } else {
                                                             if (strpos($name, '-') !== false) {
                                                                 list($fieldName, $id) = CRM_Utils_System::explode('-', $name, 2);
                                                                 $detailName = str_replace(' ', '_', $name);
                                                                 if (in_array($fieldName, array('state_province', 'country', 'county'))) {
开发者ID:hampelm,项目名称:Ginsberg-CiviDemo,代码行数:67,代码来源:Event.php

示例6: buildQuickForm

 /**
  * Function to build the form
  *
  * @return None
  * @access public
  */
 public function buildQuickForm()
 {
     // get the list of all the groups
     if ($this->_context == 'user') {
         $onlyPublicGroups = CRM_Utils_Request::retrieve('onlyPublicGroups', 'Boolean', $this, false);
         $allGroups = CRM_Core_PseudoConstant::staticGroup($onlyPublicGroups);
     } else {
         $allGroups = CRM_Core_PseudoConstant::group();
     }
     // get the list of groups for the contact
     $currentGroups = CRM_Contact_BAO_GroupContact::getGroupList($this->_contactId);
     if (is_array($currentGroups)) {
         $groupList = array_diff($allGroups, $currentGroups);
     } else {
         $groupList = $allGroups;
     }
     $groupList[''] = ts('- select group -');
     asort($groupList);
     if (count($groupList) > 1) {
         $session = CRM_Core_Session::singleton();
         // user dashboard
         if (strstr($session->readUserContext(), 'user')) {
             $msg = ts('Join a Group');
         } else {
             $msg = ts('Add to a group');
         }
         $this->add('select', 'group_id', $msg, $groupList, true);
         $this->addButtons(array(array('type' => 'next', 'name' => ts('Add'), 'isDefault' => true)));
     }
 }
开发者ID:hampelm,项目名称:Ginsberg-CiviDemo,代码行数:36,代码来源:GroupContact.php

示例7: create

 /**
  * takes an associative array and creates / removes
  * contacts from the groups
  *
  *
  * @param array $params (reference ) an assoc array of name/value pairs
  * @param array $contactId    contact id
  *
  * @return none
  * @access public
  * @static
  */
 static function create(&$params, $contactId, $visibility = false, $method = 'Admin')
 {
     $contactIds = array();
     $contactIds[] = $contactId;
     if ($contactId) {
         $contactGroupList =& CRM_Contact_BAO_GroupContact::getContactGroup($contactId, 'Added');
         if (is_array($contactGroupList)) {
             foreach ($contactGroupList as $key) {
                 $groupId = $key['group_id'];
                 $contactGroup[$groupId] = $groupId;
             }
         }
     }
     // get the list of all the groups
     $allGroup =& CRM_Contact_BAO_GroupContact::getGroupList(0, $visibility);
     // this fix is done to prevent warning generated by array_key_exits incase of empty array is given as input
     if (!is_array($params)) {
         $params = array();
     }
     // this fix is done to prevent warning generated by array_key_exits incase of empty array is given as input
     if (!isset($contactGroup) || !is_array($contactGroup)) {
         $contactGroup = array();
     }
     // check which values has to be add/remove contact from group
     foreach ($allGroup as $key => $varValue) {
         if (CRM_Utils_Array::value($key, $params) && !array_key_exists($key, $contactGroup)) {
             // add contact to group
             CRM_Contact_BAO_GroupContact::addContactsToGroup($contactIds, $key, $method);
         } else {
             if (!CRM_Utils_Array::value($key, $params) && array_key_exists($key, $contactGroup)) {
                 // remove contact from group
                 CRM_Contact_BAO_GroupContact::removeContactsFromGroup($contactIds, $key, $method);
             }
         }
     }
 }
开发者ID:ksecor,项目名称:civicrm,代码行数:48,代码来源:GroupContact.php

示例8: displayProfile

 /**
  * Function to build the array for display the profile fields
  *
  * @param array $params key value.
  * @param int $gid profile Id
  * @param array $groupTitle Profile Group Title.
  * @param array $values formatted array of key value
  *
  * @param array $profileFields
  *
  * @return void
  * @access public
  * @static
  */
 static function displayProfile(&$params, $gid, &$groupTitle, &$values, &$profileFields = array())
 {
     if ($gid) {
         $config = CRM_Core_Config::singleton();
         $session = CRM_Core_Session::singleton();
         $contactID = $session->get('userID');
         if ($contactID) {
             if (CRM_Core_BAO_UFGroup::filterUFGroups($gid, $contactID)) {
                 $fields = CRM_Core_BAO_UFGroup::getFields($gid, FALSE, CRM_Core_Action::VIEW);
             }
         } else {
             $fields = CRM_Core_BAO_UFGroup::getFields($gid, FALSE, CRM_Core_Action::ADD);
         }
         foreach ($fields as $v) {
             if (!empty($v['groupTitle'])) {
                 $groupTitle['groupTitle'] = $v['groupTitle'];
                 break;
             }
         }
         $customVal = '';
         $imProviders = CRM_Core_PseudoConstant::get('CRM_Core_DAO_IM', 'provider_id');
         //start of code to set the default values
         foreach ($fields as $name => $field) {
             $skip = FALSE;
             // skip fields that should not be displayed separately
             if ($field['skipDisplay']) {
                 continue;
             }
             $index = $field['title'];
             if ($name === 'organization_name') {
                 $values[$index] = $params[$name];
             }
             if ('state_province' == substr($name, 0, 14)) {
                 if ($params[$name]) {
                     $values[$index] = CRM_Core_PseudoConstant::stateProvince($params[$name]);
                 } else {
                     $values[$index] = '';
                 }
             } elseif ('date' == substr($name, -4)) {
                 $values[$index] = CRM_Utils_Date::customFormat(CRM_Utils_Date::processDate($params[$name]), $config->dateformatFull);
             } elseif ('country' == substr($name, 0, 7)) {
                 if ($params[$name]) {
                     $values[$index] = CRM_Core_PseudoConstant::country($params[$name]);
                 } else {
                     $values[$index] = '';
                 }
             } elseif ('county' == substr($name, 0, 6)) {
                 if ($params[$name]) {
                     $values[$index] = CRM_Core_PseudoConstant::county($params[$name]);
                 } else {
                     $values[$index] = '';
                 }
             } elseif (in_array(substr($name, 0, -3), array('gender', 'prefix', 'suffix', 'communication_style'))) {
                 $values[$index] = CRM_Core_PseudoConstant::getLabel('CRM_Contact_DAO_Contact', $name, $params[$name]);
             } elseif (in_array($name, array('addressee', 'email_greeting', 'postal_greeting'))) {
                 $filterCondition = array('greeting_type' => $name);
                 $greeting = CRM_Core_PseudoConstant::greeting($filterCondition);
                 $values[$index] = $greeting[$params[$name]];
             } elseif ($name === 'preferred_communication_method') {
                 $communicationFields = CRM_Core_PseudoConstant::get('CRM_Contact_DAO_Contact', 'preferred_communication_method');
                 $compref = array();
                 $pref = $params[$name];
                 if (is_array($pref)) {
                     foreach ($pref as $k => $v) {
                         if ($v) {
                             $compref[] = $communicationFields[$k];
                         }
                     }
                 }
                 $values[$index] = implode(',', $compref);
             } elseif ($name == 'contact_sub_type') {
                 $values[$index] = implode(', ', $params[$name]);
             } elseif ($name == 'group') {
                 $groups = CRM_Contact_BAO_GroupContact::getGroupList();
                 $title = array();
                 foreach ($params[$name] as $gId => $dontCare) {
                     if ($dontCare) {
                         $title[] = $groups[$gId];
                     }
                 }
                 $values[$index] = implode(', ', $title);
             } elseif ($name == 'tag') {
                 $entityTags = $params[$name];
                 $allTags = CRM_Core_PseudoConstant::get('CRM_Core_DAO_EntityTag', 'tag_id', array('onlyActive' => FALSE));
                 $title = array();
                 if (is_array($entityTags)) {
//.........这里部分代码省略.........
开发者ID:prashantgajare,项目名称:civicrm-core,代码行数:101,代码来源:Event.php

示例9: mailchimp_civicrm_post

/**
 * Implementation of hook_civicrm_post
 *
 * @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_post
 */
function mailchimp_civicrm_post($op, $objectName, $objectId, &$objectRef)
{
    /***** NO BULK EMAILS (User Opt Out) *****/
    if ($objectName == 'Individual' || $objectName == 'Organization' || $objectName == 'Household') {
        // Contact Edited
        if ($op == 'edit' || $op == 'create') {
            if ($objectRef->is_opt_out == 1) {
                $action = 'unsubscribe';
            } else {
                $action = 'subscribe';
            }
            // Get all groups, the contact is subscribed to
            $civiGroups = CRM_Contact_BAO_GroupContact::getGroupList($objectId);
            $civiGroups = array_keys($civiGroups);
            if (empty($civiGroups)) {
                return;
            }
            // Get mailchimp details
            $groups = CRM_Mailchimp_Utils::getGroupsToSync($civiGroups);
            if (!empty($groups)) {
                // Loop through all groups and unsubscribe the email address from mailchimp
                foreach ($groups as $groupId => $groupDetails) {
                    CRM_Mailchimp_Utils::subscribeOrUnsubsribeToMailchimpList($groupDetails, $objectId, $action);
                }
            }
        }
    }
    /***** Contacts added/removed/deleted from CiviCRM group *****/
    if ($objectName == 'GroupContact') {
        // FIXME: Dirty hack to skip hook
        require_once 'CRM/Core/Session.php';
        $session = CRM_Core_Session::singleton();
        $skipPostHook = $session->get('skipPostHook');
        // Added/Removed/Deleted - This works for both bulk action and individual add/remove/delete
        if (($op == 'create' || $op == 'edit' || $op == 'delete') && empty($skipPostHook)) {
            // Decide mailchimp action based on $op
            // Add / Rejoin Group
            if ($op == 'create' || $op == 'edit') {
                $action = 'subscribe';
            } elseif ($op == 'delete') {
                $action = 'unsubscribe';
            }
            // Get mailchimp details for the group
            $groups = CRM_Mailchimp_Utils::getGroupsToSync(array($objectId));
            // Proceed only if the group is configured with mailing list/groups
            if (!empty($groups[$objectId])) {
                // Loop through all contacts added/removed from the group
                foreach ($objectRef as $contactId) {
                    // Subscribe/Unsubscribe in Mailchimp
                    CRM_Mailchimp_Utils::subscribeOrUnsubsribeToMailchimpList($groups[$objectId], $contactId, $action);
                }
            }
        }
    }
}
开发者ID:stevekessler,项目名称:uk.co.vedaconsulting.mailchimp,代码行数:60,代码来源:mailchimp.php

示例10: mailchimp_civicrm_post

/**
 * Implementation of hook_civicrm_post
 *
 * @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_post
 */
function mailchimp_civicrm_post($op, $objectName, $objectId, &$objectRef)
{
    if (!CRM_Mailchimp_Utils::$post_hook_enabled) {
        // Post hook is disabled at this point in the running.
        return;
    }
    /***** NO BULK EMAILS (User Opt Out) *****/
    if ($objectName == 'Individual' || $objectName == 'Organization' || $objectName == 'Household') {
        // Contact Edited
        // @todo artfulrobot: I don't understand the cases this is dealing with.
        //                    Perhaps it was trying to check that if someone's been
        //                    marked as 'opt out' then they're unsubscribed from all
        //                    mailings. I could not follow the logic though -
        //                    without tests in place I thought it was better
        //                    disabled.
        if (FALSE) {
            if ($op == 'edit' || $op == 'create') {
                if ($objectRef->is_opt_out == 1) {
                    $action = 'unsubscribe';
                } else {
                    $action = 'subscribe';
                }
                // Get all groups, the contact is subscribed to
                $civiGroups = CRM_Contact_BAO_GroupContact::getGroupList($objectId);
                $civiGroups = array_keys($civiGroups);
                if (empty($civiGroups)) {
                    return;
                }
                // Get mailchimp details
                $groups = CRM_Mailchimp_Utils::getGroupsToSync($civiGroups);
                if (!empty($groups)) {
                    // Loop through all groups and unsubscribe the email address from mailchimp
                    foreach ($groups as $groupId => $groupDetails) {
                        // method removed. CRM_Mailchimp_Utils::subscribeOrUnsubsribeToMailchimpList($groupDetails, $objectId, $action);
                    }
                }
            }
        }
    }
    /***** Contacts added/removed/deleted from CiviCRM group *****/
    if ($objectName == 'GroupContact') {
        // Determine if the action being taken needs to affect Mailchimp at all.
        if ($op == 'view') {
            // Nothing changed; nothing to do.
            return;
        }
        // Get mailchimp details for the group.
        // $objectId here means CiviCRM group Id.
        $groups = CRM_Mailchimp_Utils::getGroupsToSync(array($objectId));
        if (empty($groups[$objectId])) {
            // This group has nothing to do with Mailchimp.
            return;
        }
        // The updates we need to make can be complex.
        // If someone left/joined a group synced as the membership group for a
        // Mailchimp list, then that's a subscribe/unsubscribe option.
        // If however it was a group synced to an interest in Mailchimp, then
        // the join/leave on the CiviCRM side only means updating interests on the
        // Mailchimp side, not a subscribe/unsubscribe.
        // There is also the case that somone's been put into an interest group, but
        // is not in the membership group, which should not result in them being
        // subscribed at MC.
        if ($groups[$objectId]['interest_id']) {
            // This is a change to an interest grouping.
            // We only need update Mailchimp about this if the contact is in the
            // membership group.
            $list_id = $groups[$objectId]['list_id'];
            // find membership group, then find out if the contact is in that group.
            $membership_group_details = CRM_Mailchimp_Utils::getGroupsToSync(array(), $list_id, TRUE);
            $result = civicrm_api3('Contact', 'getsingle', ['return' => 'group', 'contact_id' => $objectRef[0]]);
            if (!CRM_Mailchimp_Utils::getGroupIds($result['groups'], $membership_group_details)) {
                // This contact is not in the membership group, so don't bother telling
                // Mailchimp about a change in their interests.
                return;
            }
        }
        // Finally this hook is useful for small changes only; if you just added
        // thousands of people to a group then this is NOT the way to tell Mailchimp
        // about it as it would require thousands of separate API calls. This would
        // probably cause big problems (like hitting the API rate limits, or
        // crashing CiviCRM due to PHP max execution times etc.). Such updates must
        // happen in the more controlled bulk update (push).
        if (count($objectRef) > 1) {
            // Limit application to one contact only.
            CRM_Core_Session::setStatus(ts('You have made a bulk update that means CiviCRM contacts and Mailchimp are no longer in sync. You should do an "Update Mailchimp from CiviCRM" sync to ensure the changes you have made are applied at Mailchimp.'), ts('Update Mailchimp from CiviCRM required.'));
            return;
        }
        // Trigger mini sync for this person and this list.
        $sync = new CRM_Mailchimp_Sync($groups[$objectId]['list_id']);
        $sync->updateMailchimpFromCiviSingleContact($objectRef[0]);
    }
}
开发者ID:sunilpawar,项目名称:uk.co.vedaconsulting.mailchimp,代码行数:97,代码来源:mailchimp.php

示例11: buildQuickForm

 /**
  * Function to build the form
  *
  * @return None
  * @access public
  */
 function buildQuickForm()
 {
     // get the list of all the groups
     $allGroups = CRM_Core_PseudoConstant::group();
     // get the list of groups for the contact
     $currentGroups = CRM_Contact_BAO_GroupContact::getGroupList($this->_contactId);
     if (is_array($currentGroups)) {
         $groupList = array_diff($allGroups, $currentGroups);
     } else {
         $groupList = $allGroups;
     }
     $groupList[''] = ts('- select group -');
     asort($groupList);
     if (count($groupList) > 1) {
         $this->addElement('select', 'group_id', ts('Add to a group'), $groupList);
         $this->addRule('group_id', ts('Please select the group.'), 'required');
         $this->addButtons(array(array('type' => 'next', 'name' => ts('Add'), 'isDefault' => true)));
     }
 }
开发者ID:bhirsch,项目名称:voipdrupal-4.7-1.0,代码行数:25,代码来源:GroupContact.php

示例12: getGroups

 /**
  * Method to get groups
  *
  * @return array
  * @access protected
  */
 protected function getGroups()
 {
     return CRM_Contact_BAO_GroupContact::getGroupList();
 }
开发者ID:JMAConsulting,项目名称:org.civicoop.civirules,代码行数:10,代码来源:GroupMembership.php


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