예제 #1
0
 /**
  * Function to process the form
  *
  * @access public
  * @return None
  */
 public function postProcess()
 {
     if (!($this->_action & CRM_Core_Action::UPDATE)) {
         CRM_Core_Session::setStatus(ts('Preferences Date Options can only be updated'));
         return;
     }
     // store the submitted values in an array
     $params = $this->controller->exportValues($this->_name);
     // action is taken depending upon the mode
     $dao = new CRM_Core_DAO_PreferencesDate();
     $dao->id = $this->_id;
     $dao->description = $params['description'];
     $dao->start = $params['start'];
     $dao->end = $params['end'];
     $dao->date_format = $params['date_format'];
     $dao->time_format = $params['time_format'];
     $dao->save();
     CRM_Core_Session::setStatus(ts('The date type \'%1\' has been saved.', array(1 => $params['name'])));
 }
예제 #2
0
 /**
  * Process the form submission.
  *
  *
  * @return void
  */
 public function postProcess()
 {
     if (!($this->_action & CRM_Core_Action::UPDATE)) {
         CRM_Core_Session::setStatus(ts('Preferences Date Options can only be updated'), ts('Sorry'), 'error');
         return;
     }
     // store the submitted values in an array
     $params = $this->controller->exportValues($this->_name);
     // action is taken depending upon the mode
     $dao = new CRM_Core_DAO_PreferencesDate();
     $dao->id = $this->_id;
     $dao->description = $params['description'];
     $dao->start = $params['start'];
     $dao->end = $params['end'];
     $dao->date_format = $params['date_format'];
     $dao->time_format = $params['time_format'];
     $dao->save();
     // Update dynamic js to reflect new date settings
     CRM_Core_Resources::singleton()->resetCacheCode();
     CRM_Core_Session::setStatus(ts("The date type '%1' has been saved.", array(1 => $params['name'])), ts('Saved'), 'success');
 }