示例#1
0
 /**
  * Function to process the form
  *
  * @access public
  *
  * @return void
  */
 public function postProcess()
 {
     CRM_Utils_System::flushCache('CRM_SMS_DAO_Provider');
     if ($this->_action & CRM_Core_Action::DELETE) {
         CRM_SMS_BAO_Provider::del($this->_id);
         CRM_Core_Session::setStatus(ts('Selected Provider has been deleted.'), ts('Deleted'), 'success');
         return;
     }
     $recData = $values = $this->controller->exportValues($this->_name);
     $recData['is_active'] = CRM_Utils_Array::value('is_active', $recData, 0);
     $recData['is_default'] = CRM_Utils_Array::value('is_default', $recData, 0);
     if ($this->_action & CRM_Core_Action::UPDATE) {
         CRM_SMS_BAO_Provider::updateRecord($recData, $this->_id);
     } elseif ($this->_action & CRM_Core_Action::ADD) {
         CRM_SMS_BAO_Provider::saveRecord($recData);
     }
 }