From 285e231ea1115599a7f62cea94d694e47d4fe41a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 29 Aug 2018 23:08:13 +0200 Subject: [PATCH 1/8] Update blockedlog.lang --- htdocs/langs/en_US/blockedlog.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/blockedlog.lang b/htdocs/langs/en_US/blockedlog.lang index 9f6a49a5146..7f71a6cbfc0 100644 --- a/htdocs/langs/en_US/blockedlog.lang +++ b/htdocs/langs/en_US/blockedlog.lang @@ -50,4 +50,4 @@ BlockedLogActivatedBecauseRequiredByYourCountryLegislation=Unalterable Logs modu BlockedLogDisableNotAllowedForCountry=List of countries where usage of this module is mandatory (just to prevent to disable the module by error, if your country is in this list, disable of module is not possible without editing this list first. Note also that enabling/disabling this module will keep a track into the unalterable log). OnlyNonValid=Non valid TooManyRecordToScanRestrictFilters=Too many record to scan/analyze. Please restrict list with more restrictive filters. -RestrictYearToExport=Restrict year to export \ No newline at end of file +RestrictYearToExport=Restrict year to export From f8fef6107555ac6ad45976da8222a658357fb235 Mon Sep 17 00:00:00 2001 From: atm-greg Date: Thu, 30 Aug 2018 09:19:44 +0200 Subject: [PATCH 2/8] remove useless db begin --- htdocs/product/class/product.class.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 0b40f815816..f33029d368a 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -4456,8 +4456,6 @@ class Product extends CommonObject $langs->load('products'); - $this->db->begin(); - $label_type = 'label'; if ($type == 'short') From 9c44f80746a075e37326eb9e0d23f759ec50c444 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 30 Aug 2018 23:03:03 +0200 Subject: [PATCH 3/8] Update card.php --- htdocs/adherents/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index ffe84da6cf0..0284155ddc1 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -212,7 +212,7 @@ if (empty($reshook)) } else { - setEventMessages($object->errors, $object->error, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } } From f61450ffa86102bb99e1af6d294c389a840903ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 30 Aug 2018 23:04:32 +0200 Subject: [PATCH 4/8] Update ldap.php --- htdocs/adherents/ldap.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/adherents/ldap.php b/htdocs/adherents/ldap.php index ff0bad063bd..1f9f348d564 100644 --- a/htdocs/adherents/ldap.php +++ b/htdocs/adherents/ldap.php @@ -75,7 +75,7 @@ if ($action == 'dolibarr2ldap') setEventMessages($langs->trans("MemberSynchronized"), null, 'mesgs'); } else { - setEventMessages($ldap->errors, $ldap->error, 'errors'); + setEventMessages($ldap->error, $ldap->errors, 'errors'); } } From 2eade6ea6861c60451da7faec00d6fd7a616380a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 30 Aug 2018 23:22:06 +0200 Subject: [PATCH 5/8] Update modSociete.class.php --- htdocs/core/modules/modSociete.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/modSociete.class.php b/htdocs/core/modules/modSociete.class.php index c41c2d391cc..0498e37bdfc 100644 --- a/htdocs/core/modules/modSociete.class.php +++ b/htdocs/core/modules/modSociete.class.php @@ -291,7 +291,7 @@ class modSociete extends DolibarrModules $this->export_sql_end[$r] .=' AND (sc.fk_user = '.$user->id.' '; if (! empty($conf->global->SOCIETE_EXPORT_SUBORDINATES_CHILDS)) { $subordinatesids = $user->getAllChildIds(); - $this->export_sql_end[$r] .=count($subronidatesids)>0 ? ' OR (sc.fk_user IN ('.implode(',',$subronidatesids).')' : ''; + $this->export_sql_end[$r] .=count($subordinatesids)>0 ? ' OR (sc.fk_user IN ('.implode(',',$subordinatesids).')' : ''; } $this->export_sql_end[$r] .=')'; } @@ -328,7 +328,7 @@ class modSociete extends DolibarrModules $this->export_sql_end[$r] .=' AND (sc.fk_user = '.$user->id.' '; if (! empty($conf->global->SOCIETE_EXPORT_SUBORDINATES_CHILDS)) { $subordinatesids = $user->getAllChildIds(); - $this->export_sql_end[$r] .=count($subronidatesids)>0 ? ' OR (sc.fk_user IN ('.implode(',',$subronidatesids).')' : ''; + $this->export_sql_end[$r] .=count($subordinatesids)>0 ? ' OR (sc.fk_user IN ('.implode(',',$subordinatesids).')' : ''; } $this->export_sql_end[$r] .=')'; } From 07d5bd143afb698c7974771eb59c0839e9ed3856 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 31 Aug 2018 11:26:53 +0200 Subject: [PATCH 6/8] Fix entity --- htdocs/societe/class/societe.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 1cf2f33980e..acb33f83c26 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -1351,7 +1351,7 @@ class Societe extends CommonObject // Generation requete recherche $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."societe"; - $sql.= " WHERE entity IN (".getEntity('category').")"; + $sql.= " WHERE entity IN (".getEntity('societe').")"; if (! empty($type)) { if ($type == 1 || $type == 2) From 81c4e6a7647b4b536b3ebfbda708c791e41935e2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 1 Sep 2018 12:01:01 +0200 Subject: [PATCH 7/8] FIX Force stripe api version to avoid trouble if we update stripe api Conflicts: htdocs/stripe/config.php --- htdocs/stripe/config.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/stripe/config.php b/htdocs/stripe/config.php index 9f5f0e4de96..be7109b0165 100644 --- a/htdocs/stripe/config.php +++ b/htdocs/stripe/config.php @@ -52,3 +52,5 @@ require_once DOL_DOCUMENT_ROOT."/includes/stripe/lib/Stripe.php"; require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php'; \Stripe\Stripe::setApiKey($stripe['secret_key']); +\Stripe\Stripe::setAppInfo("Stripe", DOL_VERSION, "https://www.dolibarr.org"); // add dolibarr version +\Stripe\Stripe::setApiVersion("2018-07-27"); // force version API From bfaf7ae473b86dd01de244ce4623a126358260ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josep=20Llu=C3=ADs?= Date: Thu, 30 Aug 2018 18:12:02 +0200 Subject: [PATCH 8/8] Fix: undefined rights_class on modules When a module has the permission variable rights_class undefined, on unactivate the module are deleted all rows in cronjobs and menu tables with module=''. --- htdocs/core/modules/DolibarrModules.class.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php index ef129a421ce..0140f850e34 100644 --- a/htdocs/core/modules/DolibarrModules.class.php +++ b/htdocs/core/modules/DolibarrModules.class.php @@ -6,6 +6,7 @@ * Copyright (C) 2005-2013 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2014 Raphaël Doursenaud + * Copyright (C) 2018 Josep Lluís Amador * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -1330,7 +1331,7 @@ class DolibarrModules // Can not be abstract, because we need to insta // Search if boxes def already present $sql = "SELECT count(*) as nb FROM ".MAIN_DB_PREFIX."cronjob"; - $sql.= " WHERE module_name = '".$this->db->escape($this->rights_class)."'"; + $sql.= " WHERE module_name = '".$this->db->escape(empty($this->rights_class)?strtolower($this->name):$this->rights_class)."'"; if ($class) $sql.= " AND classesname = '".$this->db->escape($class)."'"; if ($objectname) $sql.= " AND objectname = '".$this->db->escape($objectname)."'"; if ($method) $sql.= " AND methodename = '".$this->db->escape($method)."'"; @@ -1357,7 +1358,7 @@ class DolibarrModules // Can not be abstract, because we need to insta if(is_int($status)){ $sql.= ' status,'; } $sql.= " entity, test)"; $sql.= " VALUES ("; - $sql.= "'".$this->db->escape($this->rights_class)."', "; + $sql.= "'".$this->db->escape(empty($this->rights_class)?strtolower($this->name):$this->rights_class)."', "; $sql.= "'".$this->db->idate($now)."', "; $sql.= "'".$this->db->idate($now)."', "; $sql.= "'".$this->db->escape($label)."', "; @@ -1420,7 +1421,7 @@ class DolibarrModules // Can not be abstract, because we need to insta if (is_array($this->cronjobs)) { $sql = "DELETE FROM ".MAIN_DB_PREFIX."cronjob"; - $sql.= " WHERE module_name = '".$this->db->escape($this->rights_class)."'"; + $sql.= " WHERE module_name = '".$this->db->escape(empty($this->rights_class)?strtolower($this->name):$this->rights_class)."'"; $sql.= " AND entity = ".$conf->entity; dol_syslog(get_class($this)."::delete_cronjobs", LOG_DEBUG); @@ -1783,7 +1784,7 @@ class DolibarrModules // Can not be abstract, because we need to insta $err=0; $sql = "DELETE FROM ".MAIN_DB_PREFIX."rights_def"; - $sql.= " WHERE module = '".$this->db->escape($this->rights_class)."'"; + $sql.= " WHERE module = '".$this->db->escape(empty($this->rights_class)?strtolower($this->name):$this->rights_class)."'"; $sql.= " AND entity = ".$conf->entity; dol_syslog(get_class($this)."::delete_permissions", LOG_DEBUG); if (! $this->db->query($sql)) @@ -1819,7 +1820,7 @@ class DolibarrModules // Can not be abstract, because we need to insta $menu->menu_handler='all'; //$menu->module=strtolower($this->name); TODO When right_class will be same than module name - $menu->module=$this->rights_class; + $menu->module=empty($this->rights_class)?strtolower($this->name):$this->rights_class; if (! $this->menu[$key]['fk_menu']) { @@ -1915,7 +1916,7 @@ class DolibarrModules // Can not be abstract, because we need to insta $err=0; //$module=strtolower($this->name); TODO When right_class will be same than module name - $module=$this->rights_class; + $module=empty($this->rights_class)?strtolower($this->name):$this->rights_class; $sql = "DELETE FROM ".MAIN_DB_PREFIX."menu"; $sql.= " WHERE module = '".$this->db->escape($module)."'";