diff --git a/CRM/Admin/Form/Preferences/Mailing.php b/CRM/Admin/Form/Preferences/Mailing.php index e26a56a57fe1..28bb409a38b5 100644 --- a/CRM/Admin/Form/Preferences/Mailing.php +++ b/CRM/Admin/Form/Preferences/Mailing.php @@ -70,7 +70,7 @@ public function preProcess() { 'html_type' => 'checkbox', 'title' => ts('Enable multiple bulk email address for a contact.'), 'weight' => 5, - 'description' => ts('CiviMail will deliver a copy of the email to each bulk email listed for the contact.'), + 'description' => ts('CiviMail will deliver a copy of the email to each bulk email listed for the contact. Enabling this setting will also change the options for the "Email on Hold" field in Advanced Search.'), ), 'civimail_server_wide_lock' => array( 'html_type' => 'checkbox', diff --git a/CRM/Contact/BAO/Query.php b/CRM/Contact/BAO/Query.php index 027d8165dfdf..ccbbafb72383 100644 --- a/CRM/Contact/BAO/Query.php +++ b/CRM/Contact/BAO/Query.php @@ -1635,8 +1635,9 @@ public static function convertFormValues(&$formValues, $wildcard = 0, $useEquals } } elseif ($id == 'email_on_hold') { - if ($formValues['email_on_hold']['on_hold']) { - $params[] = array('on_hold', '=', $formValues['email_on_hold']['on_hold'], 0, 0); + if ($onHoldValue = CRM_Utils_Array::value('email_on_hold', $formValues)) { + $onHoldValue = (array) $onHoldValue; + $params[] = array('on_hold', 'IN', $onHoldValue, 0, 0); } } elseif (substr($id, 0, 7) == 'custom_' diff --git a/CRM/Contact/Form/Search/Criteria.php b/CRM/Contact/Form/Search/Criteria.php index 845ab7c9a541..012500df3a47 100644 --- a/CRM/Contact/Form/Search/Criteria.php +++ b/CRM/Contact/Form/Search/Criteria.php @@ -231,9 +231,13 @@ public static function basic(&$form) { $form->addRadio('privacy_toggle', ts('Privacy Options'), $options, array('allowClear' => FALSE)); // preferred communication method - - $onHold[] = $form->createElement('advcheckbox', 'on_hold', NULL, ''); - $form->addGroup($onHold, 'email_on_hold', ts('Email On Hold')); + if (Civi::settings()->get('civimail_multiple_bulk_emails')) { + $form->addSelect('email_on_hold', + array('entity' => 'email', 'multiple' => 'multiple', 'label' => ts('Email On Hold'), 'options' => CRM_Core_PseudoConstant::emailOnHoldOptions())); + } + else { + $form->add('advcheckbox', 'email_on_hold', ts('Email On Hold')); + } $form->addSelect('preferred_communication_method', array('entity' => 'contact', 'multiple' => 'multiple', 'label' => ts('Preferred Communication Method'), 'option_url' => NULL, 'placeholder' => ts('- any -'))); diff --git a/CRM/Upgrade/Incremental/php/FiveNine.php b/CRM/Upgrade/Incremental/php/FiveNine.php new file mode 100644 index 000000000000..e1f51b5441d4 --- /dev/null +++ b/CRM/Upgrade/Incremental/php/FiveNine.php @@ -0,0 +1,94 @@ +' . ts('A new permission, "%1", has been added. This permission is now used to control access to the Manage Tags screen.', array(1 => ts('manage tags'))) . '
'; + // } + } + + /** + * Compute any messages which should be displayed after upgrade. + * + * @param string $postUpgradeMessage + * alterable. + * @param string $rev + * an intermediate version; note that setPostUpgradeMessage is called repeatedly with different $revs. + */ + public function setPostUpgradeMessage(&$postUpgradeMessage, $rev) { + if ($rev == '5.9.0') { + $args = array( + 1 => ts('Enable multiple bulk email address for a contact'), + 2 => ts('Email on Hold'), + ); + $postUpgradeMessage .= '' . ts('If the setting "%1" is enabled, you should update any smart groups based on the "%2" field.', $args) . '
'; + } + // Example: Generate a post-upgrade message. + // if ($rev == '5.12.34') { + // $postUpgradeMessage .= '