2 class CRM_Contact_Form_Task_Unhold
extends CRM_Contact_Form_Task
{
5 * Function to set variables up before form is built
10 function preProcess() {
14 function buildQuickForm() {
15 $this->addDefaultButtons(ts('Unhold Email'), 'done');
18 public function postProcess() {
19 // Query to unhold emails of selected contacts
20 $num = count($this->_contactIds
);
23 UPDATE civicrm_email SET on_hold = 0, hold_date = null
24 WHERE on_hold = 1 AND hold_date is not null AND contact_id in (" . implode(",", $this->_contactIds
) . ")";
25 CRM_Core_DAO
::executeQuery($queryString);
26 $sql = "SELECT ROW_COUNT( )";
27 $result = CRM_Core_DAO
::singleValueQuery($sql);
29 CRM_Core_Session
::setStatus(ts('%count email was found on hold and updated.', array('count' => $result, 'plural' => '%count emails were found on hold and updated.')), ts('Emails Restored'), 'success');
32 CRM_Core_Session
::setStatus(ts('The selected contact does not have an email on hold.', array('count' => $result, 'plural' => 'None of the selected contacts have an email on hold.')), ts('No Emails to Restore'), 'info');
36 CRM_Core_Session
::setStatus(ts('Please select one or more contact for this action'), ts('No Contacts Selected'), 'error');