Merge pull request #4916 from totten/master-casetypetest-cleanup
[civicrm-core.git] / CRM / Financial / Form / Export.php
index e185156184a0161754005033c9cc86f98b7ed81a..e459d0cf38a046da0d11ee8f64410e2efecda805 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.5                                                |
+ | CiviCRM version 4.6                                                |
  +--------------------------------------------------------------------+
  | Copyright CiviCRM LLC (c) 2004-2014                                |
  +--------------------------------------------------------------------+
@@ -44,7 +44,6 @@ class CRM_Financial_Form_Export extends CRM_Core_Form {
    * The financial batch id, used when editing the field
    *
    * @var int
-   * @access protected
    */
   protected $_id;
 
@@ -67,18 +66,17 @@ class CRM_Financial_Form_Export extends CRM_Core_Form {
    * Build all the data structures needed to build the form
    *
    * @return void
-   * @access public
    */
-  function preProcess() {
+  public function preProcess() {
     $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'];
@@ -101,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.'));
       }
     }
 
@@ -115,10 +113,9 @@ class CRM_Financial_Form_Export extends CRM_Core_Form {
   /**
    * Build the form object
    *
-   * @access public
    * @return void
    */
-  function buildQuickForm() {
+  public function buildQuickForm() {
     // this mean it's a batch action
     if (!empty($this->_batchIds)) {
       $batchNames = CRM_Batch_BAO_Batch::getBatchNames($this->_batchIds);
@@ -155,10 +152,9 @@ class CRM_Financial_Form_Export extends CRM_Core_Form {
   /**
    * Process the form after the input has been submitted and validated
    *
-   * @access public
    * @return void
    */
-  public function postProcess( ) {
+  public function postProcess() {
     if (!$this->_exportFormat) {
       $params = $this->exportValues();
       $this->_exportFormat = $params['export_format'];
@@ -167,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
@@ -180,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]);