tbrehm
2011-01-20 22147612539ed72540cfb979c6767a4a7cbba177
Added global currency format settings in $conf array.
4 files modified
17 ■■■■ changed files
install/tpl/config.inc.php.master 5 ●●●●● patch | view | raw | blame | history
interface/lib/classes/listform.inc.php 2 ●●● patch | view | raw | blame | history
interface/lib/classes/tform.inc.php 5 ●●●●● patch | view | raw | blame | history
interface/lib/config.inc.php 5 ●●●●● patch | view | raw | blame | history
install/tpl/config.inc.php.master
@@ -148,6 +148,11 @@
$conf['language'] = '{language}';
$conf['debug_language'] = false;
//** Currency format
$conf['number_format_decimals'] = 2;
$conf['number_format_dec_point'] = ',';
$conf['number_format_thousands_sep'] = '';
//** Misc.
$conf['interface_logout_url'] = ''; // example: http://www.domain.tld/
interface/lib/classes/listform.inc.php
@@ -329,7 +329,7 @@
                        break;
                    case 'CURRENCY':
                        $record[$key] = number_format($record[$key], 2, ',', '');
                        $record[$key] = number_format($record[$key], $conf['number_format_decimals'], $conf['number_format_dec_point'], $conf['number_format_thousands_sep']);
                        break;
                    default:
interface/lib/classes/tform.inc.php
@@ -163,7 +163,8 @@
        * @return record
        */
        function decode($record,$tab) {
                if(!is_array($this->formDef['tabs'][$tab])) $app->error("Tab does not exist or the tab is empty (TAB: $tab).");
                global $conf;
                if(!is_array($this->formDef['tabs'][$tab])) $app->error("Tab does not exist or the tab is empty (TAB: $tab).");
                $new_record = '';
                if(is_array($record)) {
                        foreach($this->formDef['tabs'][$tab]['fields'] as $key => $field) {
@@ -198,7 +199,7 @@
                                break;
                                case 'CURRENCY':
                                        $new_record[$key] = number_format((double)$record[$key], 2, ',', '');
                                        $new_record[$key] = number_format((double)$record[$key], $conf['number_format_decimals'], $conf['number_format_dec_point'], $conf['number_format_thousands_sep']);
                                break;
                                default:
interface/lib/config.inc.php
@@ -133,6 +133,11 @@
$conf['language'] = 'en';
$conf['debug_language'] = false;
//** Currency formatting
$conf['number_format_decimals'] = 2;
$conf['number_format_dec_point'] = ',';
$conf['number_format_thousands_sep'] = '';
//** Misc.
$conf['interface_logout_url'] = ''; // example: http://www.domain.tld/