diff --git a/htdocs/admin/multicurrency.php b/htdocs/admin/multicurrency.php index b1ad347d8b7..afb396a0217 100644 --- a/htdocs/admin/multicurrency.php +++ b/htdocs/admin/multicurrency.php @@ -31,6 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/multicurrency.lib.php'; require_once DOL_DOCUMENT_ROOT.'/multicurrency/class/multicurrency.class.php'; + // Translations $langs->load("multicurrency"); @@ -41,10 +42,17 @@ if (! $user->admin) { // Parameters $action = GETPOST('action', 'alpha'); - +$sync_response = GETPOST('sync_response'); /* * Actions */ +if (!empty($sync_response)) +{ + $sync_response = json_decode($sync_response); + MultiCurrency::syncRates($sync_response); + exit; +} + if (preg_match('/set_(.*)/',$action,$reg)) { $code=$reg[1]; @@ -64,7 +72,7 @@ if (preg_match('/del_(.*)/',$action,$reg)) $code=$reg[1]; if (dolibarr_del_const($db, $code, 0) > 0) { - Header("Location: ".$_SERVER["PHP_SELF"]); + header("Location: ".$_SERVER["PHP_SELF"]); exit; } else @@ -224,8 +232,8 @@ print '
| '.$langs->trans("Currencies").' | '."\n"; print ''; -print ' | '.$langs->trans("Rate").' | '."\n"; +print ''.$langs->trans("Rate").' | '."\n"; $var=!$var; print '