Merge pull request #4916 from totten/master-casetypetest-cleanup
[civicrm-core.git] / CRM / Financial / Form / Search.php
index c1b163726b9773c11b880536430fab57a4d4f704..d56c502170efc0425156203cc848bbf9dbc30118 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.5                                                |
+ | CiviCRM version 4.6                                                |
  +--------------------------------------------------------------------+
  | Copyright CiviCRM LLC (c) 2004-2014                                |
  +--------------------------------------------------------------------+
@@ -36,12 +36,15 @@ class CRM_Financial_Form_Search extends CRM_Core_Form {
 
   public $_batchStatus;
 
-  function preProcess() {
+  public function preProcess() {
     $this->_batchStatus = CRM_Utils_Request::retrieve('batchStatus', 'Positive', CRM_Core_DAO::$_nullObject, FALSE, NULL);
     $this->assign('batchStatus', $this->_batchStatus);
   }
 
-  function setDefaultValues() {
+  /**
+   * @return array
+   */
+  public function setDefaultValues() {
     $defaults = array();
     $status = CRM_Utils_Request::retrieve('status', 'Positive', CRM_Core_DAO::$_nullObject, FALSE, 1);
     $defaults['batch_update'] = $status;
@@ -52,31 +55,32 @@ 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']);
-    
+
     $batchStatus = CRM_Core_PseudoConstant::get('CRM_Batch_DAO_Batch', 'status_id', array('labelColumn' => 'name'));
     $this->add(
       'select',
       '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']);
@@ -95,12 +99,12 @@ 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' => 'form-submit',
+        'class' => 'crm-form-submit',
         'id' => 'Go',
       ));
 
@@ -110,17 +114,17 @@ class CRM_Financial_Form_Search extends CRM_Core_Form {
           'type' => 'refresh',
           'name' => ts('Search'),
           'isDefault' => TRUE,
-        )
+        ),
       )
     );
     parent::buildQuickForm();
   }
 
-  function postProcess() {
+  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];
       }
     }
@@ -129,4 +133,3 @@ class CRM_Financial_Form_Search extends CRM_Core_Form {
     }
   }
 }
-