/** * build the form elements for an email object * * @return void * @access public */ public function buildQuickForm() { parent::buildQuickForm(); $totalBlocks = $this->_blockCount; $actualBlockCount = 1; if (count($this->_emails) > 1) { $actualBlockCount = $totalBlocks = count($this->_emails); if ($totalBlocks < $this->_blockCount) { $additionalBlocks = $this->_blockCount - $totalBlocks; $totalBlocks += $additionalBlocks; } else { $actualBlockCount++; $totalBlocks++; } } $this->assign('actualBlockCount', $actualBlockCount); $this->assign('totalBlocks', $totalBlocks); $this->applyFilter('__ALL__', 'trim'); for ($blockId = 1; $blockId < $totalBlocks; $blockId++) { CRM_Contact_Form_Edit_Email::buildQuickForm($this, $blockId, TRUE); } $this->addFormRule(array('CRM_Contact_Form_Inline_Email', 'formRule')); }
/** * build the form elements for an email object * * @return void * @access public */ public function buildQuickForm() { $totalBlocks = $this->_blockCount; $actualBlockCount = 1; if (count($this->_emails) > 1) { $actualBlockCount = $totalBlocks = count($this->_emails); if ($totalBlocks < $this->_blockCount) { $additionalBlocks = $this->_blockCount - $totalBlocks; $totalBlocks += $additionalBlocks; } else { $actualBlockCount++; $totalBlocks++; } } $this->assign('actualBlockCount', $actualBlockCount); $this->assign('totalBlocks', $totalBlocks); $this->applyFilter('__ALL__', 'trim'); for ($blockId = 1; $blockId < $totalBlocks; $blockId++) { CRM_Contact_Form_Edit_Email::buildQuickForm($this, $blockId, TRUE); } $buttons = array(array('type' => 'upload', 'name' => ts('Save'), 'isDefault' => TRUE), array('type' => 'cancel', 'name' => ts('Cancel'))); $this->addButtons($buttons); $this->addFormRule(array('CRM_Contact_Form_Inline_Email', 'formRule')); }