本文整理汇总了PHP中CRM_Core_BAO_UFGroup::isProfileAddToGroupDoubleOptin方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Core_BAO_UFGroup::isProfileAddToGroupDoubleOptin方法的具体用法?PHP CRM_Core_BAO_UFGroup::isProfileAddToGroupDoubleOptin怎么用?PHP CRM_Core_BAO_UFGroup::isProfileAddToGroupDoubleOptin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Core_BAO_UFGroup
的用法示例。
在下文中一共展示了CRM_Core_BAO_UFGroup::isProfileAddToGroupDoubleOptin方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: postProcess
//.........这里部分代码省略.........
$contactGroups->status = 'Added';
$contactGroups->find();
$contactGroup = array();
while ($contactGroups->fetch()) {
$contactGroup[] = $contactGroups->group_id;
$groupSubscribed[$contactGroups->group_id] = 1;
}
}
foreach ($params['group'] as $key => $val) {
if (!$val) {
unset($params['group'][$key]);
continue;
}
$groupTypes = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Group', $key, 'group_type', 'id');
$groupType = explode(CRM_Core_DAO::VALUE_SEPARATOR, substr($groupTypes, 1, -1));
//filter group of mailing type and unset it from params
if (in_array(2, $groupType)) {
//if group is already subscribed , ignore it
$groupExist = CRM_Utils_Array::key($key, $contactGroup);
if (!isset($groupExist)) {
$mailingType[] = $key;
unset($params['group'][$key]);
}
}
}
}
}
$addToGroupId = CRM_Utils_Array::value('add_to_group_id', $this->_ufGroup);
if (!empty($addToGroupId)) {
//run same check whether group is a mailing list
$groupTypes = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Group', $addToGroupId, 'group_type', 'id');
$groupType = explode(CRM_Core_DAO::VALUE_SEPARATOR, substr($groupTypes, 1, -1));
//filter group of mailing type and unset it from params
if (in_array(2, $groupType) && !empty($result['email']) && CRM_Core_BAO_UFGroup::isProfileAddToGroupDoubleOptin()) {
if (!count($contactGroup)) {
//array of group id, subscribed by contact
$contactGroup = array();
if ($this->_id) {
$contactGroups = new CRM_Contact_DAO_GroupContact();
$contactGroups->contact_id = $this->_id;
$contactGroups->status = 'Added';
$contactGroups->find();
$contactGroup = array();
while ($contactGroups->fetch()) {
$contactGroup[] = $contactGroups->group_id;
$groupSubscribed[$contactGroups->group_id] = 1;
}
}
}
//if group is already subscribed , ignore it
$groupExist = CRM_Utils_Array::key($addToGroupId, $contactGroup);
if (!isset($groupExist)) {
$mailingType[] = $addToGroupId;
$addToGroupId = NULL;
}
} else {
// since we are directly adding contact to group lets unset it from mailing
if ($key = array_search($addToGroupId, $mailingType)) {
unset($mailingType[$key]);
}
}
}
if ($this->_grid) {
$params['group'] = $groupSubscribed;
}
// commenting below code, since we potentially