From 6159703116612a73dfdd0c65e7551aacf7872bbe Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 15 Jan 2019 11:14:01 +0100 Subject: [PATCH 1/6] Fix warning and date --- htdocs/website/index.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/website/index.php b/htdocs/website/index.php index f0e97b22a13..6824ae80360 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -2516,6 +2516,7 @@ if ($action == 'editmeta' || $action == 'createcontainer') $type_container = 'page'; $pagedatecreation=dol_now(); $pageauthorid=$user->id; + $pageusermodifid=0; } if (GETPOST('WEBSITE_TITLE','alpha')) $pagetitle=GETPOST('WEBSITE_TITLE','alpha'); if (GETPOST('WEBSITE_PAGENAME','alpha')) $pageurl=GETPOST('WEBSITE_PAGENAME','alpha'); @@ -2669,7 +2670,7 @@ if ($action == 'editmeta' || $action == 'createcontainer') print ''; print $langs->trans('DateModification'); print ''; - print dol_print_date($pagedatemodification, 'dayhour'); + print dol_print_date($pagedatemodification, 'dayhour', 'tzuser'); print ''; } From 1f87b8bb188bfb90faf8c8ead0fb8545bf4fef8e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 16 Jan 2019 01:54:08 +0100 Subject: [PATCH 2/6] FIX Position of price symbol (before) for nl_NL --- htdocs/admin/company.php | 3 ++- htdocs/core/lib/functions.lib.php | 8 ++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php index 96a7b533095..bfbeb5cbb6a 100644 --- a/htdocs/admin/company.php +++ b/htdocs/admin/company.php @@ -773,10 +773,11 @@ else print ''.$langs->trans("CompanyCurrency").''; - print currency_name($conf->currency,1); + print currency_name($conf->currency,0); print ' ('.$conf->currency; print ($conf->currency != $langs->getCurrencySymbol($conf->currency) ? ' - '.$langs->getCurrencySymbol($conf->currency) : ''); print ')'; + print ' - '.$langs->trans("PriceFormatInCurrentLanguage", $langs->defaultlang).' : '.price(price2num('99.333333333','MT'), 1, $langs, 1, -1, -1, $conf->currency); print ''; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 5ce4f370976..984279dd6a0 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -4350,7 +4350,7 @@ function vatrate($rate, $addpercent=false, $info_bits=0, $usestarfornpr=0) * @param string $currency_code To add currency symbol (''=add nothing, 'auto'=Use default currency, 'XXX'=add currency symbols for XXX currency) * @return string Chaine avec montant formate * - * @see price2num Revert function of price + * @see price2num() Revert function of price */ function price($amount, $form=0, $outlangs='', $trunc=1, $rounding=-1, $forcerounding=-1, $currency_code='') { @@ -4413,7 +4413,11 @@ function price($amount, $form=0, $outlangs='', $trunc=1, $rounding=-1, $forcerou if ($currency_code == 'auto') $currency_code=$conf->currency; $listofcurrenciesbefore=array('USD','GBP','AUD','MXN','PEN','CNY'); - if (in_array($currency_code,$listofcurrenciesbefore)) $cursymbolbefore.=$outlangs->getCurrencySymbol($currency_code); + $listoflanguagesbefore=array('nl_NL'); + if (in_array($currency_code, $listofcurrenciesbefore) || in_array($outlangs->defaultlang, $listoflanguagesbefore)) + { + $cursymbolbefore.=$outlangs->getCurrencySymbol($currency_code); + } else { $tmpcur=$outlangs->getCurrencySymbol($currency_code); From 6b808acfbb803b219523a057b74c49763df3d64c Mon Sep 17 00:00:00 2001 From: Abbes Bahfir Date: Wed, 9 Jan 2019 18:12:06 +0100 Subject: [PATCH 3/6] linl back to list if cancelled on create --- htdocs/modulebuilder/template/myobject_card.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/htdocs/modulebuilder/template/myobject_card.php b/htdocs/modulebuilder/template/myobject_card.php index 84a23ab979d..bd47da705ce 100644 --- a/htdocs/modulebuilder/template/myobject_card.php +++ b/htdocs/modulebuilder/template/myobject_card.php @@ -118,8 +118,11 @@ if (empty($reshook)) $error=0; $permissiontoadd = $user->rights->mymodule->write; - $permissiontodelete = $user->rights->mymodule->delete || ($permissiontoadd && $object->status == 0); - if (empty($backtopage)) $backtopage = dol_buildpath('/mymodule/myobject_card.php',1).'?id='.($id > 0 ? $id : '__ID__'); + $permissiontodelete = $user->rights->mymodule->delete; + if (empty($backtopage)) { + if (empty($id)) $backtopage = dol_buildpath('/mymodule/myobject_list.php',1); + else $backtopage = dol_buildpath('/mymodule/myobject_card.php',1).($id > 0 ? $id : '__ID__'); + } $backurlforlist = dol_buildpath('/mymodule/myobject_list.php',1); $triggermodname = 'MYMODULE_MYOBJECT_MODIFY'; // Name of trigger action code to execute when we modify record From 66f17ac4224277025b626b2696165f838ef7c75b Mon Sep 17 00:00:00 2001 From: Bahfir Abbes Date: Wed, 9 Jan 2019 18:47:43 +0100 Subject: [PATCH 4/6] simplification --- htdocs/modulebuilder/template/myobject_card.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/modulebuilder/template/myobject_card.php b/htdocs/modulebuilder/template/myobject_card.php index bd47da705ce..60c03ee2326 100644 --- a/htdocs/modulebuilder/template/myobject_card.php +++ b/htdocs/modulebuilder/template/myobject_card.php @@ -119,11 +119,11 @@ if (empty($reshook)) $permissiontoadd = $user->rights->mymodule->write; $permissiontodelete = $user->rights->mymodule->delete; + $backurlforlist = dol_buildpath('/mymodule/myobject_list.php',1); if (empty($backtopage)) { - if (empty($id)) $backtopage = dol_buildpath('/mymodule/myobject_list.php',1); + if (empty($id)) $backtopage = $backurlforlist; else $backtopage = dol_buildpath('/mymodule/myobject_card.php',1).($id > 0 ? $id : '__ID__'); - } - $backurlforlist = dol_buildpath('/mymodule/myobject_list.php',1); + } $triggermodname = 'MYMODULE_MYOBJECT_MODIFY'; // Name of trigger action code to execute when we modify record // Actions cancel, add, update, delete or clone From f4dd8a4e506f1188c14dd15180cf6eddda2443e2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 16 Jan 2019 12:46:14 +0100 Subject: [PATCH 5/6] Update myobject_card.php --- htdocs/modulebuilder/template/myobject_card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/modulebuilder/template/myobject_card.php b/htdocs/modulebuilder/template/myobject_card.php index 60c03ee2326..dc9ac647fe8 100644 --- a/htdocs/modulebuilder/template/myobject_card.php +++ b/htdocs/modulebuilder/template/myobject_card.php @@ -118,7 +118,7 @@ if (empty($reshook)) $error=0; $permissiontoadd = $user->rights->mymodule->write; - $permissiontodelete = $user->rights->mymodule->delete; + $permissiontodelete = $user->rights->mymodule->delete || ($permissiontoadd && $object->status == 0); $backurlforlist = dol_buildpath('/mymodule/myobject_list.php',1); if (empty($backtopage)) { if (empty($id)) $backtopage = $backurlforlist; From 638be67f96dd004b8edf02200b8c9a520d3ed842 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 16 Jan 2019 13:56:13 +0100 Subject: [PATCH 6/6] Fix tooltip --- htdocs/core/lib/functions.lib.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 984279dd6a0..5d1a977d049 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -5867,7 +5867,7 @@ function getCommonSubstitutionArray($outputlangs, $onlykey=0, $exclude=null, $ob $substitutionarray['__THIRDPARTY_NAME_ALIAS__'] = '__THIRDPARTY_NAME_ALIAS__'; $substitutionarray['__THIRDPARTY_EMAIL__'] = '__THIRDPARTY_EMAIL__'; - if (is_object($object) && $object->element == 'member') + if (! empty($conf->adherent->enabled)) { $substitutionarray['__MEMBER_ID__'] = '__MEMBER_ID__'; $substitutionarray['__MEMBER_CIVILITY__'] = '__MEMBER_CIVILITY__'; @@ -5895,9 +5895,9 @@ function getCommonSubstitutionArray($outputlangs, $onlykey=0, $exclude=null, $ob $substitutionarray['__DIRECTDOWNLOAD_URL_ORDER__'] = 'Direct download url of an order'; $substitutionarray['__DIRECTDOWNLOAD_URL_INVOICE__'] = 'Direct download url of an invoice'; - if (is_object($object) && $object->element == 'shipping') + if (! empty($conf->expedition->enabled)) { - $substitutionarray['__SHIPPINGTRACKNUM__']='Shipping tacking number'; + $substitutionarray['__SHIPPINGTRACKNUM__']='Shipping tacking number'; $substitutionarray['__SHIPPINGTRACKNUMURL__']='Shipping tracking url'; } }