/** * Implementation of hook_civicrm_uninstall */ function clickatell_civicrm_uninstall() { $optionID = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionValue', 'clickatell', 'id', 'name'); if ($optionID) { CRM_Core_BAO_OptionValue::del($optionID); } $filter = array('name' => 'org.civicrm.sms.clickatell'); $Providers = CRM_SMS_BAO_Provider::getProviders(False, $filter, False); if ($Providers) { foreach ($Providers as $key => $value) { CRM_SMS_BAO_Provider::del($value['id']); } } return _clickatell_civix_civicrm_uninstall(); }
/** * 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); } }