Merge pull request #15833 from yashodha/participant_edit
[civicrm-core.git] / CRM / Mailing / Form / Approve.php
index 47fa701b272e1af3fa6dc1a7246a6875974b0d24..08b511105e87d591048576da5ac2317ac4115d81 100644 (file)
@@ -3,7 +3,7 @@
   +--------------------------------------------------------------------+
   | CiviCRM version 5                                                  |
   +--------------------------------------------------------------------+
-  | Copyright CiviCRM LLC (c) 2004-2018                                |
+  | Copyright CiviCRM LLC (c) 2004-2020                                |
   +--------------------------------------------------------------------+
   | This file is a part of CiviCRM.                                    |
   |                                                                    |
@@ -28,7 +28,7 @@
 /**
  *
  * @package CRM
- * @copyright CiviCRM LLC (c) 2004-2018
+ * @copyright CiviCRM LLC (c) 2004-2020
  */
 class CRM_Mailing_Form_Approve extends CRM_Core_Form {
 
@@ -75,7 +75,7 @@ class CRM_Mailing_Form_Approve extends CRM_Core_Form {
    * Set default values for the form.
    */
   public function setDefaultValues() {
-    $defaults = array();
+    $defaults = [];
     if ($this->_mailingID) {
       $defaults['approval_status_id'] = $this->_mailing->approval_status_id;
       $defaults['approval_note'] = $this->_mailing->approval_note;
@@ -101,25 +101,25 @@ class CRM_Mailing_Form_Approve extends CRM_Core_Form {
       unset($mailApprovalStatus[$noneOptionID]);
     }
 
-    $this->addRadio('approval_status_id', ts('Approval Status'), $mailApprovalStatus, array(), NULL, TRUE);
+    $this->addRadio('approval_status_id', ts('Approval Status'), $mailApprovalStatus, [], NULL, TRUE);
 
-    $buttons = array(
-      array(
+    $buttons = [
+      [
         'type' => 'next',
         'name' => ts('Save'),
         'spacing' => '                 ',
         'isDefault' => TRUE,
-      ),
-      array(
+      ],
+      [
         'type' => 'cancel',
         'name' => ts('Cancel'),
-      ),
-    );
+      ],
+    ];
 
     $this->addButtons($buttons);
 
     // add the preview elements
-    $preview = array();
+    $preview = [];
 
     $preview['subject'] = CRM_Core_DAO::getFieldValue('CRM_Mailing_DAO_Mailing',
       $this->_mailingID,
@@ -145,7 +145,7 @@ class CRM_Mailing_Form_Approve extends CRM_Core_Form {
     // get the submitted form values.
     $params = $this->controller->exportValues($this->_name);
 
-    $ids = array();
+    $ids = [];
     if (isset($this->_mailingID)) {
       $ids['mailing_id'] = $this->_mailingID;
     }
@@ -154,7 +154,7 @@ class CRM_Mailing_Form_Approve extends CRM_Core_Form {
     }
 
     if (!$ids['mailing_id']) {
-      CRM_Core_Error::fatal();
+      CRM_Core_Error::statusBounce(ts('No mailing id has been able to be determined'));
     }
 
     $params['approver_id'] = $this->_contactID;