diff --git a/htdocs/blockedlog/admin/blockedlog.php b/htdocs/blockedlog/admin/blockedlog.php
index b3822a9acb7..399ace64ad9 100644
--- a/htdocs/blockedlog/admin/blockedlog.php
+++ b/htdocs/blockedlog/admin/blockedlog.php
@@ -41,7 +41,10 @@ $action = GETPOST('action','alpha');
if (preg_match('/set_(.*)/',$action,$reg))
{
$code=$reg[1];
- if (dolibarr_set_const($db, $code, GETPOST($code), 'chaine', 0, '', $conf->entity) > 0)
+ $values = GETPOST($code);
+ if(is_array($values))$values = implode(',', $values);
+
+ if (dolibarr_set_const($db, $code, $values, 'chaine', 0, '', $conf->entity) > 0)
{
header("Location: ".$_SERVER["PHP_SELF"]);
exit;
@@ -115,6 +118,35 @@ if (!empty($conf->global->BLOCKEDLOG_USE_REMOTE_AUTHORITY)) {
print '';
}
+$var=!$var;
+print '
';
+print '| '.$langs->trans("BlockedLogDisableNotAllowedForCountry").' | ';
+print '';
+print '';
+print ' |
';
+
print '';
dol_fiche_end();
diff --git a/htdocs/core/modules/modBlockedLog.class.php b/htdocs/core/modules/modBlockedLog.class.php
index 493c0ad513a..5056bdd7a36 100644
--- a/htdocs/core/modules/modBlockedLog.class.php
+++ b/htdocs/core/modules/modBlockedLog.class.php
@@ -36,7 +36,7 @@ class modBlockedLog extends DolibarrModules
*/
function __construct($db)
{
- global $langs,$conf;
+ global $langs,$conf,$mysoc;
$this->db = $db;
$this->numero = 3200;
@@ -88,6 +88,9 @@ class modBlockedLog extends DolibarrModules
// Main menu entries
//------------------
$this->menu = array();
+
+ $this->always_enabled = !empty($conf->blockedlog->enabled) && !empty($conf->global->BLOCKEDLOG_DISABLE_NOT_ALLOWED_FOR_COUNTRY) && in_array($mysoc->country_code, explode(',', $conf->global->BLOCKEDLOG_DISABLE_NOT_ALLOWED_FOR_COUNTRY));
+
}
/**
diff --git a/htdocs/langs/en_US/blockedlog.lang b/htdocs/langs/en_US/blockedlog.lang
index 5c4c84eb2ab..46e63f3e6c7 100644
--- a/htdocs/langs/en_US/blockedlog.lang
+++ b/htdocs/langs/en_US/blockedlog.lang
@@ -27,4 +27,5 @@ logDOC_PREVIEW=Preview of a validated document in order to print or download
logDOC_DOWNLOAD=Download of a validated document in order to print or send
DataOfArchivedEvent=Full datas of archived event
ImpossibleToReloadObject=Object (type %s, id %s) removed
-BlockedLogAreRequiredByYourCountryLegislation=Unalterable logs are required by the legislation of your country. Disabling this module may render any future transactions invalid with respect to the law and the use of non-legal software as it can not be validated by a tax audit.
\ No newline at end of file
+BlockedLogAreRequiredByYourCountryLegislation=Unalterable logs are required by the legislation of your country. Disabling this module may render any future transactions invalid with respect to the law and the use of non-legal software as it can not be validated by a tax audit.
+BlockedLogDisableNotAllowedForCountry=Disable not allowed for this countries
\ No newline at end of file