Merge pull request #5686 from josephlacey/bower-adds
[civicrm-core.git] / CRM / Event / Form / EventFees.php
index e5628f00e75cbbdc7ac8455fa3ddc22274c19037..6eb0b51ad7066630d64a4726a988afe75f7d983b 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.                                    |
  |                                                                    |
  | GNU Affero General Public License or the licensing of CiviCRM,     |
  | see the CiviCRM license FAQ at http://civicrm.org/licensing        |
  +--------------------------------------------------------------------+
-*/
+ */
 
 /**
  *
  *
  * @package CRM
- * @copyright CiviCRM LLC (c) 2004-2014
+ * @copyright CiviCRM LLC (c) 2004-2015
  * $Id$
  *
  */
@@ -40,7 +40,7 @@
 class CRM_Event_Form_EventFees {
 
   /**
-   * Set variables up before form is built
+   * Set variables up before form is built.
    *
    * @param CRM_Core_Form $form
    *
@@ -61,8 +61,7 @@ class CRM_Event_Form_EventFees {
     if ($form->_eventId &&
       ($currency = CRM_Core_DAO::getFieldValue('CRM_Event_DAO_Event', $form->_eventId, 'currency'))
     ) {
-      $config = CRM_Core_Config::singleton();
-      $config->defaultCurrency = $currency;
+      CRM_Core_Config::singleton()->defaultCurrency = $currency;
     }
   }
 
@@ -239,7 +238,7 @@ class CRM_Event_Form_EventFees {
                  'payment_instrument_id',
                  'contribution_status_id',
                  'receive_date',
-                 'total_amount'
+                 'total_amount',
                ) as $f) {
         if ($f == 'receive_date') {
           list($defaults[$form->_pId]['receive_date']) = CRM_Utils_Date::setDateDefaults($contribution->$f);
@@ -340,7 +339,7 @@ SELECT  id, html_type
   }
 
   /**
-   * Build the form object
+   * Build the form object.
    *
    * @param CRM_Core_Form $form
    *
@@ -401,10 +400,10 @@ SELECT  id, html_type
         $element = $form->add('select', 'discount_id',
           ts('Discount Set'),
           array(
-            0 => ts('- select -')
+            0 => ts('- select -'),
           ) + $discounts,
           FALSE,
-          array('onchange' => "buildFeeBlock( {$form->_eventId}, this.value );")
+          array('class' => "crm-select2")
         );
 
         if ($form->_online) {
@@ -507,4 +506,5 @@ SELECT  id, html_type
     $form->assign('outBound_option', $mailingInfo['outBound_option']);
     $form->assign('hasPayment', $form->_paymentId);
   }
+
 }