_caseId = CRM_Utils_Request::retrieve('caseid', 'String', $this, FALSE); $this->_context = CRM_Utils_Request::retrieve('context', 'String', $this); $cid = CRM_Utils_Request::retrieve('cid', 'String', $this, FALSE); if ($cid){ $cid = explode(',',$cid); foreach ($cid as $key => $val) { $displayName[] = CRM_Contact_BAO_Contact::displayName($val); } CRM_Utils_System::setTitle(implode(',',$displayName) . ' - ' . ts('Email')); } else{ CRM_Utils_System::setTitle(ts('New Email')); } CRM_Contact_Form_Task_EmailCommon::preProcessFromAddress($this); if (!$cid && $this->_context != 'standalone') { parent::preProcess(); } //early prevent, CRM-6209 if (count($this->_contactIds) > CRM_Contact_Form_Task_EmailCommon::MAX_EMAILS_KILL_SWITCH) { CRM_Core_Error::statusBounce(ts('Please do not use this task to send a lot of emails (greater than %1). We recommend using CiviMail instead.', array(1 => CRM_Contact_Form_Task_EmailCommon::MAX_EMAILS_KILL_SWITCH))); } $this->assign('single', $this->_single); if (CRM_Core_Permission::check('administer CiviCRM')) { $this->assign('isAdmin', 1); } } /** * Build the form * * @access public * * @return void */ public function buildQuickForm() { //enable form element $this->assign('suppressForm', FALSE); $this->assign('emailTask', TRUE); CRM_Contact_Form_Task_EmailCommon::buildQuickForm($this); } /** * process the form after the input has been submitted and validated * * @access public * * @return void */ public function postProcess() { CRM_Contact_Form_Task_EmailCommon::postProcess($this); } }