Merge pull request #4916 from totten/master-casetypetest-cleanup
[civicrm-core.git] / CRM / Financial / Form / Export.php
index 8d3caf7d8aeb696121239d2a9c56fa4e219a9f3d..e459d0cf38a046da0d11ee8f64410e2efecda805 100644 (file)
@@ -71,12 +71,12 @@ class CRM_Financial_Form_Export extends CRM_Core_Form {
     $this->_id = CRM_Utils_Request::retrieve('id', 'Positive', $this);
 
     // this mean it's a batch action
-    if (!$this->_id ) {
+    if (!$this->_id) {
       if (!empty($_GET['batch_id'])) {
         //validate batch ids
         $batchIds = explode(',', $_GET['batch_id']);
-        foreach($batchIds as $batchId) {
-          CRM_Utils_Type::validate($batchId,'Positive');
+        foreach ($batchIds as $batchId) {
+          CRM_Utils_Type::validate($batchId, 'Positive');
         }
 
         $this->_batchIds = $_GET['batch_id'];
@@ -99,9 +99,9 @@ class CRM_Financial_Form_Export extends CRM_Core_Form {
     //check if batch status is valid, do not allow exported batches to export again
     $batchStatus = CRM_Batch_BAO_Batch::getBatchStatuses($this->_batchIds);
 
-    foreach( $batchStatus as $batchStatusId ) {
+    foreach ($batchStatus as $batchStatusId) {
       if ($batchStatusId == $this->_exportStatusId) {
-       CRM_Core_Error::fatal(ts('You cannot exported the batches which were exported earlier.'));
+        CRM_Core_Error::fatal(ts('You cannot exported the batches which were exported earlier.'));
       }
     }
 
@@ -154,7 +154,7 @@ class CRM_Financial_Form_Export extends CRM_Core_Form {
    *
    * @return void
    */
-  public function postProcess( ) {
+  public function postProcess() {
     if (!$this->_exportFormat) {
       $params = $this->exportValues();
       $this->_exportFormat = $params['export_format'];
@@ -163,7 +163,7 @@ class CRM_Financial_Form_Export extends CRM_Core_Form {
     if ($this->_id) {
       $batchIds = array($this->_id);
     }
-    else if (!empty($this->_batchIds)) {
+    elseif (!empty($this->_batchIds)) {
       $batchIds = explode(',', $this->_batchIds);
     }
     // Recalculate totals
@@ -176,7 +176,7 @@ class CRM_Financial_Form_Export extends CRM_Core_Form {
     $batchParams['status_id'] = $this->_exportStatusId;
 
     $ids = array();
-    foreach($batchIds as $batchId) {
+    foreach ($batchIds as $batchId) {
       $batchParams['id'] = $ids['batchID'] = $batchId;
       // Update totals
       $batchParams = array_merge($batchParams, $totals[$batchId]);