Merge pull request #67 from dpradeep/merge-20140827
[civicrm-core.git] / CRM / Financial / Form / Search.php
index 61806a546ef6bf30364aa7785eef172af7de9f56..557713df2e306717f6a7bd642a58c2125f6cf8a7 100644 (file)
@@ -1,9 +1,9 @@
 <?php
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.4                                                |
+ | CiviCRM version 4.5                                                |
  +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2013                                |
+ | Copyright CiviCRM LLC (c) 2004-2014                                |
  +--------------------------------------------------------------------+
  | This file is a part of CiviCRM.                                    |
  |                                                                    |
@@ -28,7 +28,7 @@
 /**
  *
  * @package CRM
- * @copyright CiviCRM LLC (c) 2004-2013
+ * @copyright CiviCRM LLC (c) 2004-2014
  * $Id$
  *
  */
@@ -41,6 +41,9 @@ class CRM_Financial_Form_Search extends CRM_Core_Form {
     $this->assign('batchStatus', $this->_batchStatus);
   }
 
+  /**
+   * @return array
+   */
   function setDefaultValues() {
     $defaults = array();
     $status = CRM_Utils_Request::retrieve('status', 'Positive', CRM_Core_DAO::$_nullObject, FALSE, 1);
@@ -52,10 +55,11 @@ 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');
     $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',
@@ -99,7 +103,7 @@ class CRM_Financial_Form_Search extends CRM_Core_Form {
 
     $this->add('submit','submit', ts('Go'),
       array(
-        'class' => 'form-submit',
+        'class' => 'crm-form-submit',
         'id' => 'Go',
       ));
 
@@ -123,7 +127,7 @@ class CRM_Financial_Form_Search extends CRM_Core_Form {
         $batchIds[] = $batch[1];
       }
     }
-    if (CRM_Utils_Array::value('batch_update', $_POST)) {
+    if (!empty($_POST['batch_update'])) {
       CRM_Batch_BAO_Batch::closeReOpen($batchIds, $_POST['batch_update']);
     }
   }