add a condition to check if the value is 1
This commit is contained in:
parent
ab5d0906d7
commit
4432060d05
1 changed files with 4 additions and 0 deletions
|
@ -533,6 +533,7 @@ function civicrm_api3_twingle_donation_Submit($params) {
|
||||||
if (
|
if (
|
||||||
(bool) $profile->getAttribute('newsletter_double_opt_in')
|
(bool) $profile->getAttribute('newsletter_double_opt_in')
|
||||||
&& isset($params['newsletter'])
|
&& isset($params['newsletter'])
|
||||||
|
&& 1 == $params['newsletter']
|
||||||
&& is_array($groups = $profile->getAttribute('newsletter_groups'))
|
&& is_array($groups = $profile->getAttribute('newsletter_groups'))
|
||||||
) {
|
) {
|
||||||
$group_memberships = array_column(
|
$group_memberships = array_column(
|
||||||
|
@ -573,6 +574,7 @@ function civicrm_api3_twingle_donation_Submit($params) {
|
||||||
}
|
}
|
||||||
elseif (
|
elseif (
|
||||||
isset($params['newsletter'])
|
isset($params['newsletter'])
|
||||||
|
&& 1 == $params['newsletter']
|
||||||
&& is_array($groups = $profile->getAttribute('newsletter_groups'))
|
&& is_array($groups = $profile->getAttribute('newsletter_groups'))
|
||||||
) {
|
) {
|
||||||
foreach ($groups as $group_id) {
|
foreach ($groups as $group_id) {
|
||||||
|
@ -592,6 +594,7 @@ function civicrm_api3_twingle_donation_Submit($params) {
|
||||||
// If requested, add contact to postinfo groups defined in the profile.
|
// If requested, add contact to postinfo groups defined in the profile.
|
||||||
if (
|
if (
|
||||||
isset($params['postinfo'])
|
isset($params['postinfo'])
|
||||||
|
&& 1 == $params['postinfo']
|
||||||
&& is_array($groups = $profile->getAttribute('postinfo_groups'))
|
&& is_array($groups = $profile->getAttribute('postinfo_groups'))
|
||||||
) {
|
) {
|
||||||
foreach ($groups as $group_id) {
|
foreach ($groups as $group_id) {
|
||||||
|
@ -609,6 +612,7 @@ function civicrm_api3_twingle_donation_Submit($params) {
|
||||||
// (see issue #83)
|
// (see issue #83)
|
||||||
if (
|
if (
|
||||||
isset($params['donation_receipt'])
|
isset($params['donation_receipt'])
|
||||||
|
&& 1 == $params['donation_receipt']
|
||||||
&& is_array($groups = $profile->getAttribute('donation_receipt_groups'))
|
&& is_array($groups = $profile->getAttribute('donation_receipt_groups'))
|
||||||
) {
|
) {
|
||||||
foreach ($groups as $group_id) {
|
foreach ($groups as $group_id) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue