Update SMS providers form for 4.5
[civicrm-core.git] / CRM / SMS / Form / Provider.php
index b6dd2230cac6b93ea3af957f62f6af37cba9f52f..6ec36832fb64c08715ce0246aa84068bcc0572a2 100644 (file)
@@ -70,42 +70,29 @@ class CRM_SMS_Form_Provider extends CRM_Core_Form {
   public function buildQuickForm() {
     parent::buildQuickForm();
 
+    $this->addButtons(array(
+        array(
+          'type' => 'next',
+          'name' => $this->_action & CRM_Core_Action::DELETE ? ts('Delete') : ts('Save'),
+          'isDefault' => TRUE,
+        ),
+        array(
+          'type' => 'cancel',
+          'name' => ts('Cancel'),
+        ),
+      )
+    );
+
     if ($this->_action & CRM_Core_Action::DELETE) {
-      $this->addButtons(array(
-          array(
-            'type' => 'next',
-            'name' => ts('Delete'),
-            'isDefault' => TRUE,
-          ),
-          array(
-            'type' => 'cancel',
-            'name' => ts('Cancel'),
-          ),
-        )
-      );
       return;
     }
-    else {
-      $this->addButtons(array(
-          array(
-            'type' => 'next',
-            'name' => ts('Save'),
-            'isDefault' => TRUE,
-          ),
-          array(
-            'type' => 'cancel',
-            'name' => ts('Cancel'),
-          ),
-        )
-      );
-    }
 
     $attributes = CRM_Core_DAO::getAttribute('CRM_SMS_DAO_Provider');
 
     $providerNames = CRM_Core_OptionGroup::values('sms_provider_name', FALSE, FALSE, FALSE, NULL, 'label');
     $apiTypes = CRM_Core_OptionGroup::values('sms_api_type', FALSE, FALSE, FALSE, NULL, 'label');
 
-    $this->add('select', 'name', ts('Name'), array('' => '- select -') + $providerNames, TRUE, array('onchange' => "reload(true)"));
+    $this->add('select', 'name', ts('Name'), array('' => '- select -') + $providerNames, TRUE);
 
     $this->add('text', 'title', ts('Title'),
       $attributes['title'], TRUE