-- CRM-15188, fixed code to provide line item ref to correct component id
[civicrm-core.git] / CRM / Price / Page / Option.php
index 8f7220e393e045468a4eb710af0ded92ef32fcb1..78a0bb7c59b7bc54ddc7b850f038c31f7810971e 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$
  *
  */
@@ -43,6 +43,8 @@
  */
 class CRM_Price_Page_Option extends CRM_Core_Page {
 
+  public $useLivePageJS = TRUE;
+
   /**
    * The field id of the option
    *
@@ -127,14 +129,13 @@ class CRM_Price_Page_Option extends CRM_Core_Page {
    * @access public
    */
   function browse() {
-    CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'js/crm.livePage.js');
     $customOption = array();
     CRM_Price_BAO_PriceFieldValue::getValues($this->_fid, $customOption);
     $config = CRM_Core_Config::singleton();
     $financialType = CRM_Contribute_PseudoConstant::financialType();
     foreach ($customOption as $id => $values) {
       $action = array_sum(array_keys($this->actionLinks()));
-      if( CRM_Utils_Array::value('financial_type_id', $values)){
+      if (!empty($values['financial_type_id'])){
         $customOption[$id]['financial_type_id'] = $financialType[$values['financial_type_id']];
       }
       // update enable/disable links depending on price_field properties.
@@ -149,7 +150,7 @@ class CRM_Price_Page_Option extends CRM_Core_Page {
           $action -= CRM_Core_Action::DISABLE;
         }
       }
-      if (CRM_Utils_Array::value('is_default', $customOption[$id])) {
+      if (!empty($customOption[$id]['is_default'])) {
         $customOption[$id]['is_default'] = '<img src="' . $config->resourceBase . 'i/check.gif" />';
       }
       else {