/**
  * Adds elements from the model to the bridge that creates the form.
  *
  * Overrule this function to add different elements to the browse table, without
  * having to recode the core table building code.
  *
  * @param \MUtil_Model_Bridge_FormBridgeInterface $bridge
  * @param \MUtil_Model_ModelAbstract $model
  */
 protected function addFormElements(\MUtil_Model_Bridge_FormBridgeInterface $bridge, \MUtil_Model_ModelAbstract $model)
 {
     $bridge->addHtml('to', 'label', $this->_('To'));
     $bridge->addExhibitor('track', array('label' => $this->_('Track')));
     $bridge->addExhibitor('round', array('label' => $this->_('Round')));
     $bridge->addExhibitor('survey', array('label' => $this->_('Survey')));
     $bridge->addExhibitor('last_contact', array('label' => $this->_('Last contact'), 'formatFunction' => $this->util->getTranslated()->formatDateNever));
     parent::addFormElements($bridge, $model);
 }
 /**
  * Adds elements from the model to the bridge that creates the form.
  *
  * Overrule this function to add different elements to the browse table, without
  * having to recode the core table building code.
  *
  * @param \MUtil_Model_Bridge_FormBridgeInterface $bridge
  * @param \MUtil_Model_ModelAbstract $model
  */
 protected function addFormElements(\MUtil_Model_Bridge_FormBridgeInterface $bridge, \MUtil_Model_ModelAbstract $model)
 {
     $bridge->addHtml('to', 'label', $this->_('To'));
     $bridge->addHtml('prefered_language', 'label', $this->_('Prefered Language'));
     $bridge->addElement($this->mailElements->createTemplateSelectElement('select_template', $this->_('Template'), $this->mailTarget, $this->templateOnly, true));
     if ($this->templateOnly) {
         $bridge->addHidden('subject');
     } else {
         $bridge->addText('subject', 'label', $this->_('Subject'), 'size', 50);
     }
     $mailBody = $bridge->addElement($this->mailElements->createBodyElement('mailBody', $this->_('Message'), $model->get('gctt_body', 'required'), $this->templateOnly));
     if ($mailBody instanceof \Gems_Form_Element_CKEditor) {
         $mailBody->config['availablefields'] = $this->mailer->getMailFields();
         $mailBody->config['availablefieldsLabel'] = $this->_('Fields');
         $mailBody->config['extraPlugins'] .= ',availablefields';
         $mailBody->config['toolbar'][] = array('availablefields');
     }
     if (!$this->templateOnly) {
         $bridge->addFakeSubmit('preview', array('label' => $this->_('Preview')));
     }
     $bridge->addElement($this->createFromSelect('from', $this->_('From')));
     $bridge->addElement($this->mailElements->createSubmitButton('send', $this->_('Send')));
     $bridge->addElement($this->mailElements->createPreviewHtmlElement('Preview HTML'));
     $bridge->addElement($this->mailElements->createPreviewTextElement('Preview Text'));
     if (!$this->templateOnly) {
         $bridge->addHtml('available_fields', array('label' => $this->_('Available fields')));
     }
 }