From dec4e1f6a675745e4b2e64fde2441bf468bfe134 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Sun, 30 Dec 2018 16:49:54 +0100 Subject: [PATCH] New option use currency on document + toggle - change with toogle - new option use currency on document for online payment --- htdocs/admin/multicurrency.php | 62 ++++++++++++++++++++++++---------- 1 file changed, 44 insertions(+), 18 deletions(-) diff --git a/htdocs/admin/multicurrency.php b/htdocs/admin/multicurrency.php index 9843c6a4fb0..7995b2957af 100644 --- a/htdocs/admin/multicurrency.php +++ b/htdocs/admin/multicurrency.php @@ -61,10 +61,9 @@ if (preg_match('/set_([a-z0-9_\-]+)/i',$action,$reg)) } } -if (preg_match('/del_([a-z0-9_\-]+)/i',$action,$reg)) +if ($action == 'setobject') { - $code=$reg[1]; - if (dolibarr_del_const($db, $code, 0) > 0) + if (dolibarr_set_const($db, GETPOST('value', 'alpha'), GETPOST('status', 'alpha'),'chaine',0,'',$conf->entity) > 0) { header("Location: ".$_SERVER["PHP_SELF"]); exit; @@ -181,30 +180,57 @@ dol_fiche_head($head, 'settings', $langs->trans("ModuleSetup"), -1, "multicurren print ''; print ''; print ''."\n"; -print ''."\n"; +print ''."\n"; print ''; print ''; print ''; -print ''; print ''; print ''; -print ''; + +//Online payment with currency on document +print ''; +print ''; +print ''; /* TODO uncomment when the functionality will integrated
'.$langs->trans("Parameters").''.$langs->trans("Value").''.$langs->trans("Status").'
'.$langs->transnoentitiesnoconv("MULTICURRENCY_USE_RATE_ON_DOCUMENT_DATE").''; -print '
'; -print ''; -print ''; -print $form->selectyesno("MULTICURRENCY_USE_RATE_ON_DOCUMENT_DATE",$conf->global->MULTICURRENCY_USE_RATE_ON_DOCUMENT_DATE,1); -print ''; -print '
'; +print '
'; +if (!empty($conf->global->MULTICURRENCY_USE_RATE_ON_DOCUMENT_DATE)) +{ + print ''; + print img_picto($langs->trans("Activated"),'switch_on'); +} +else +{ + print ''; + print img_picto($langs->trans("Disabled"),'switch_off'); +} +print ''; print '
'.$langs->transnoentitiesnoconv("multicurrency_useOriginTx").''; -print '
'; -print ''; -print ''; -print $form->selectyesno("MULTICURRENCY_USE_ORIGIN_TX",$conf->global->MULTICURRENCY_USE_ORIGIN_TX,1); -print ''; -print '
'; +print '
'; +if (!empty($conf->global->MULTICURRENCY_USE_ORIGIN_TX)) +{ + print ''; + print img_picto($langs->trans("Activated"),'switch_on'); +} +else +{ + print ''; + print img_picto($langs->trans("Disabled"),'switch_off'); +} +print ''; +print '
'.$langs->transnoentitiesnoconv("multicurrency_useCurrency").''; +if (!empty($conf->global->MULTICURRENCY_USE_CURRENCY_ON_DOCUMENT)) +{ + print ''; + print img_picto($langs->trans("Activated"),'switch_on'); +} +else +{ + print ''; + print img_picto($langs->trans("Disabled"),'switch_off'); +} +print ''; print '