Merge remote-tracking branch 'upstream/4.6' into 4.6-master-2015-08-03-11-26-36
[civicrm-core.git] / CRM / Financial / Form / Search.php
index 909c2fcc0a0245dfdd76429f0d2e2cd7385f30aa..1dfcc15e0c2a40b8c98935471dad4500196b37b2 100644 (file)
@@ -3,7 +3,7 @@
  +--------------------------------------------------------------------+
  | CiviCRM version 4.6                                                |
  +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2014                                |
+ | Copyright CiviCRM LLC (c) 2004-2015                                |
  +--------------------------------------------------------------------+
  | This file is a part of CiviCRM.                                    |
  |                                                                    |
@@ -28,7 +28,7 @@
 /**
  *
  * @package CRM
- * @copyright CiviCRM LLC (c) 2004-2014
+ * @copyright CiviCRM LLC (c) 2004-2015
  * $Id$
  *
  */
@@ -55,7 +55,8 @@ class CRM_Financial_Form_Search extends CRM_Core_Form {
   }
 
   public function buildQuickForm() {
-    CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'packages/jquery/plugins/jquery.redirect.min.js', 0, 'html-header');
+    CRM_Core_Resources::singleton()
+      ->addScriptFile('civicrm', 'packages/jquery/plugins/jquery.redirect.min.js', 0, 'html-header');
     $attributes = CRM_Core_DAO::getAttribute('CRM_Batch_DAO_Batch');
     $attributes['total']['class'] = $attributes['item_count']['class'] = 'number';
     $this->add('text', 'title', ts('Batch Name'), $attributes['title']);
@@ -66,20 +67,20 @@ class CRM_Financial_Form_Search extends CRM_Core_Form {
       'status_id',
       ts('Batch Status'),
       array(
-        '' => ts('- any -' ),
+        '' => ts('- any -'),
         array_search('Open', $batchStatus) => ts('Open'),
         array_search('Closed', $batchStatus) => ts('Closed'),
         array_search('Exported', $batchStatus) => ts('Exported'),
       ),
-      false
+      FALSE
     );
 
     $this->add(
       'select',
       'payment_instrument_id',
       ts('Payment Instrument'),
-      array('' => ts('- any -' )) + CRM_Contribute_PseudoConstant::paymentInstrument(),
-      false
+      array('' => ts('- any -')) + CRM_Contribute_PseudoConstant::paymentInstrument(),
+      FALSE
     );
 
     $this->add('text', 'total', ts('Total Amount'), $attributes['total']);
@@ -98,10 +99,10 @@ class CRM_Financial_Form_Search extends CRM_Core_Form {
 
     $this->add('select',
       'batch_update',
-      ts('Task' ),
+      ts('Task'),
       array('' => ts('- actions -')) + $batchAction);
 
-    $this->add('submit','submit', ts('Go'),
+    $this->add('submit', 'submit', ts('Go'),
       array(
         'class' => 'crm-form-submit',
         'id' => 'Go',
@@ -113,7 +114,7 @@ class CRM_Financial_Form_Search extends CRM_Core_Form {
           'type' => 'refresh',
           'name' => ts('Search'),
           'isDefault' => TRUE,
-        )
+        ),
       )
     );
     parent::buildQuickForm();
@@ -122,8 +123,8 @@ class CRM_Financial_Form_Search extends CRM_Core_Form {
   public function postProcess() {
     $batchIds = array();
     foreach ($_POST as $key => $value) {
-      if (substr($key,0,6) == "check_") {
-        $batch = explode("_",$key);
+      if (substr($key, 0, 6) == "check_") {
+        $batch = explode("_", $key);
         $batchIds[] = $batch[1];
       }
     }
@@ -131,4 +132,5 @@ class CRM_Financial_Form_Search extends CRM_Core_Form {
       CRM_Batch_BAO_Batch::closeReOpen($batchIds, $_POST['batch_update']);
     }
   }
+
 }