Esempio n. 1
0
 /**
  * Function to process the form
  *
  * @access public
  * @return None
  */
 public function postProcess()
 {
     if ($this->_action == CRM_Core_Action::VIEW) {
         return;
     }
     $this->_params = $this->controller->exportValues($this->_name);
     $this->_config->editor_id = $this->_params['wysiwyg_editor'];
     // set default editor to session if changed
     $session =& CRM_Core_Session::singleton();
     $session->set('defaultWysiwygEditor', $this->_params['wysiwyg_editor']);
     parent::postProcess();
 }
Esempio n. 2
0
 public function postProcess()
 {
     // check if mailing tab is enabled, if not prompt user to enable the tab if "write_activity_record" is disabled
     $params = $this->controller->exportValues($this->_name);
     if (empty($params['write_activity_record'])) {
         $existingViewOptions = Civi::settings()->get('contact_view_options');
         $displayValue = CRM_Core_OptionGroup::getValue('contact_view_options', 'CiviMail', 'name');
         $viewOptions = explode(CRM_Core_DAO::VALUE_SEPARATOR, $existingViewOptions);
         if (!in_array($displayValue, $viewOptions)) {
             $existingViewOptions .= $displayValue . CRM_Core_DAO::VALUE_SEPARATOR;
             Civi::settings()->set('contact_view_options', $existingViewOptions);
             CRM_Core_Session::setStatus(ts('We have automatically enabled the Mailings tab for the Contact Summary screens
     so that you can view mailings sent to each contact.'), ts('Saved'), 'success');
         }
     }
     parent::postProcess();
 }
Esempio n. 3
0
 /**
  * Function to process the form
  *
  * @access public
  * @return None
  */
 public function postProcess()
 {
     if ($this->_action == CRM_Core_Action::VIEW) {
         return;
     }
     $this->_params = $this->controller->exportValues($this->_name);
     // trim the format and unify line endings to LF
     $format = array('address_format', 'mailing_format');
     foreach ($format as $f) {
         if (!empty($this->_params[$f])) {
             $this->_params[$f] = trim($this->_params[$f]);
             $this->_params[$f] = str_replace(array("\r\n", "\r"), "\n", $this->_params[$f]);
         }
     }
     $this->_config->copyValues($this->_params);
     parent::postProcess();
 }
Esempio n. 4
0
 /**
  * Function to process the form
  *
  * @access public
  * @return None
  */
 public function postProcess()
 {
     if ($this->_action == CRM_Core_Action::VIEW) {
         return;
     }
     $this->_params = $this->controller->exportValues($this->_name);
     if (CRM_Utils_Array::value('contact_edit_prefences', $this->_params)) {
         $preferenceWeights = explode(',', $this->_params['contact_edit_prefences']);
         foreach ($preferenceWeights as $key => $val) {
             if (!$val) {
                 unset($preferenceWeights[$key]);
             }
         }
         require_once 'CRM/Core/BAO/OptionValue.php';
         $opGroupId = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionGroup', 'contact_edit_options', 'id', 'name');
         CRM_Core_BAO_OptionValue::updateOptionWeights($opGroupId, array_flip($preferenceWeights));
     }
     $this->_config->editor_id = $this->_params['wysiwyg_editor'];
     $this->_config->display_name_format = $this->_params['display_name_format'];
     $this->_config->sort_name_format = $this->_params['sort_name_format'];
     // set default editor to session if changed
     $session = CRM_Core_Session::singleton();
     $session->set('defaultWysiwygEditor', $this->_params['wysiwyg_editor']);
     parent::postProcess();
 }