From d9f32f7ae132b118868cb3c7dfeb07ad7c81b8a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Doursenaud?= Date: Wed, 15 Feb 2017 13:18:24 +0100 Subject: [PATCH 1/3] Fix: [Multicurrency] properly display API error --- htdocs/admin/multicurrency.php | 4 ++-- htdocs/langs/en_US/multicurrency.lang | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/admin/multicurrency.php b/htdocs/admin/multicurrency.php index de3c2f3965a..b03872a8fbd 100644 --- a/htdocs/admin/multicurrency.php +++ b/htdocs/admin/multicurrency.php @@ -131,7 +131,7 @@ elseif ($action == 'synchronize') } else { - setEventMessages($langs->trans('multicurrency_syncronize_error', $reponse->error->info), null, 'errors'); + setEventMessages($langs->trans('multicurrency_syncronize_error', $response->error->info), null, 'errors'); } } @@ -377,4 +377,4 @@ print ' llxFooter(); -$db->close(); \ No newline at end of file +$db->close(); diff --git a/htdocs/langs/en_US/multicurrency.lang b/htdocs/langs/en_US/multicurrency.lang index 805356a2e46..222583c5516 100644 --- a/htdocs/langs/en_US/multicurrency.lang +++ b/htdocs/langs/en_US/multicurrency.lang @@ -3,7 +3,7 @@ MultiCurrency=Multi currency ErrorAddRateFail=Error in added rate ErrorAddCurrencyFail=Error in added currency ErrorDeleteCurrencyFail=Error delete fail -multicurrency_syncronize_error=Error in synchronization +multicurrency_syncronize_error=Synchronisation error: %s multicurrency_useOriginTx=When an object is created from another, keep the original rate of source object (otherwise use the new known rate) CurrencyLayerAccount=CurrencyLayer API CurrencyLayerAccount_help_to_synchronize=You sould create an account on their website to use this functionnality
Get your API key
If you use a free account you can't change the currency source (USD by default)
But if your main currency isn't USD you can use the alternate currency source to force you main currency

You are limited at 1000 synchronizations per month @@ -15,4 +15,4 @@ CurrenciesUsed_help_to_add=Add the differents currencies and rates you need to u rate=rate MulticurrencyReceived=Received, original currency MulticurrencyRemainderToTake=Remaining amout, original currency -MulticurrencyPaymentAmount=Payment amount, original currency \ No newline at end of file +MulticurrencyPaymentAmount=Payment amount, original currency From 979a5e70bf105a4894c07f0b89de0c3227ee0b1c Mon Sep 17 00:00:00 2001 From: De Coninck Laurent Date: Thu, 16 Feb 2017 07:51:46 +0100 Subject: [PATCH 2/3] allow the drag and drop of an event only for allowed users The drag and drop of the event didn't take into account the user rights. --- htdocs/comm/action/index.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index f63bbd7ab79..f8b50fb588a 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -1328,7 +1328,16 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa $cssclass.= " unmovable"; } } - else $cssclass.= " movable"; + else{ + if ($user->rights->agenda->allactions->create || + (($event->authorid == $user->id || $event->userownerid == $user->id) && $user->rights->agenda->myactions->create)) + { + $cssclass.= " movable"; + }else{ + $cssclass.= " unmovable"; + } + + } $h=''; $nowrapontd=1; if ($action == 'show_day') { $h='height: 100%; '; $nowrapontd=0; } From fd6c4fd4d0704a74a47cdf893670b49b38d953d6 Mon Sep 17 00:00:00 2001 From: De Coninck Laurent Date: Thu, 16 Feb 2017 09:26:18 +0100 Subject: [PATCH 3/3] fix the enabling of a dependency module already ON If a depency module is already activated and we try to activate the parent, we got an error because the entry is already existing in the database. --- htdocs/core/lib/admin.lib.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index 8b5bb4839a2..288082296f3 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -763,6 +763,11 @@ function activateModule($value,$withdeps=1) return $ret; } + $const_name = $objMod->const_name; + if(!empty($conf->global->$const_name)){ + return $ret; + } + $result=$objMod->init(); if ($result <= 0) { @@ -784,7 +789,13 @@ function activateModule($value,$withdeps=1) if (file_exists($dir.$objMod->depends[$i].".class.php")) { $resarray = activateModule($objMod->depends[$i]); - if (empty($resarray['errors'])) $activate = true; + if (empty($resarray['errors'])){ + $activate = true; + }else{ + foreach ($resarray['errors'] as $errorMessage){ + dol_syslog($errorMessage, LOG_ERR); + } + } break; } }