From 111f65f4229b8c59f0a3a3e85e17f68b085a2369 Mon Sep 17 00:00:00 2001 From: eileen Date: Sun, 4 Aug 2013 20:02:06 +1200 Subject: [PATCH] CRM-13148 basic tidy up - use 'recommended' functions / tpl js separation --- CRM/Batch/Form/Batch.php | 4 +--- CRM/Batch/Form/Entry.php | 5 ++++- templates/CRM/Batch/Form/Entry.tpl | 4 ++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/CRM/Batch/Form/Batch.php b/CRM/Batch/Form/Batch.php index 3af565e66a..48df091486 100644 --- a/CRM/Batch/Form/Batch.php +++ b/CRM/Batch/Form/Batch.php @@ -63,7 +63,7 @@ class CRM_Batch_Form_Batch extends CRM_Admin_Form { $attributes = CRM_Core_DAO::getAttribute('CRM_Batch_DAO_Batch'); $this->add('text', 'title', ts('Batch Name'), $attributes['name'], TRUE); - $batchTypes = CRM_Core_PseudoConstant::get('CRM_Batch_DAO_Batch', 'type_id'); + $batchTypes = CRM_Batch_DAO_Batch::buildOptions('type_id'); // unset non-related types unset($batchTypes[3]); @@ -96,8 +96,6 @@ class CRM_Batch_Form_Batch extends CRM_Admin_Form { else { $defaults = $this->_values; } - - return $defaults; } diff --git a/CRM/Batch/Form/Entry.php b/CRM/Batch/Form/Entry.php index 8c5efd085b..a4b137f762 100644 --- a/CRM/Batch/Form/Entry.php +++ b/CRM/Batch/Form/Entry.php @@ -107,7 +107,10 @@ class CRM_Batch_Form_Entry extends CRM_Core_Form { $this->_profileId = CRM_Batch_BAO_Batch::getProfileId($this->_batchInfo['type_id']); } CRM_Core_Resources::singleton() - ->addSetting(array('batch' => array('type_id' => $this->_batchInfo['type_id']))); + ->addSetting(array('batch' => array('type_id' => $this->_batchInfo['type_id']))) + ->addSetting(array('setting' => array('monetaryThousandSeparator' => CRM_Core_Config::singleton()->monetaryThousandSeparator))) + ->addSetting(array('setting' => array('monetaryDecimalPoint' => CRM_Core_Config::singleton()->monetaryDecimalPoint))); + } /** diff --git a/templates/CRM/Batch/Form/Entry.tpl b/templates/CRM/Batch/Form/Entry.tpl index 29c8527e05..7cfbfeb742 100644 --- a/templates/CRM/Batch/Form/Entry.tpl +++ b/templates/CRM/Batch/Form/Entry.tpl @@ -270,8 +270,8 @@ function calculateActualTotal() { //money formatting/localization function formatMoney(amount) { var c = 2; - var t = '{/literal}{$config->monetaryThousandSeparator}{literal}'; - var d = '{/literal}{$config->monetaryDecimalPoint}{literal}'; + var t = CRM.setting.monetaryThousandSeparator; + var d = CRM.setting.monetaryDecimalPoint; var n = amount, c = isNaN(c = Math.abs(c)) ? 2 : c, -- 2.25.1