diff --git a/dev/skeletons/modMyModule.class.php b/dev/skeletons/modMyModule.class.php index 60bc466a907..f9901feb7bd 100644 --- a/dev/skeletons/modMyModule.class.php +++ b/dev/skeletons/modMyModule.class.php @@ -87,10 +87,6 @@ class modMyModule extends DolibarrModules // Data directories to create when module is enabled. // Example: this->dirs = array("/mymodule/temp"); $this->dirs = array(); - $r=0; - - // Relative path to module style sheet if exists. Example: '/mymodule/css/mycss.css'. - //$this->style_sheet = '/mymodule/mymodule.css.php'; // Config pages. Put here list of php page, stored into mymodule/admin directory, to use to setup module. $this->config_page_url = array("mysetuppage.php@mymodule"); diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index 3883ca30144..32ce43f473e 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -813,7 +813,6 @@ function unActivateModule($value, $requiredby=1) // TODO Cannot instantiate abstract class //$genericMod = new DolibarrModul($db); //$genericMod->name=preg_replace('/^mod/i','',$modName); - //$genericMod->style_sheet=1; //$genericMod->rights_class=strtolower(preg_replace('/^mod/i','',$modName)); //$genericMod->const_name='MAIN_MODULE_'.strtoupper(preg_replace('/^mod/i','',$modName)); dol_syslog("modules::unActivateModule Failed to find module file, we use generic function with name " . $modName); diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php index 9fcb2a89f69..3ff00325bff 100644 --- a/htdocs/core/modules/DolibarrModules.class.php +++ b/htdocs/core/modules/DolibarrModules.class.php @@ -1293,7 +1293,7 @@ abstract class DolibarrModules { global $conf; - $err=0; + $error=0; $entity=$conf->entity; if (is_array($this->module_parts) && ! empty($this->module_parts)) @@ -1335,15 +1335,23 @@ abstract class DolibarrModules $sql.= ")"; dol_syslog(get_class($this)."::insert_const_".$key." sql=".$sql); - $resql=$this->db->query($sql); + $resql=$this->db->query($sql,1); if (! $resql) { - $this->error=$this->db->lasterror(); - dol_syslog(get_class($this)."::insert_const_".$key." ".$this->error); + if ($this->db->lasterrno() != 'DB_ERROR_RECORD_ALREADY_EXISTS') + { + $error++; + $this->error=$this->db->lasterror(); + dol_syslog(get_class($this)."::insert_const_".$key." ".$this->error, LOG_ERR); + } + else + { + dol_syslog(get_class($this)."::insert_const_".$key." Record already exists.", LOG_WARNING); + } } } } - return $err; + return $error; } /** diff --git a/htdocs/core/modules/modCashDesk.class.php b/htdocs/core/modules/modCashDesk.class.php index 422379b9292..0abf4fd46de 100644 --- a/htdocs/core/modules/modCashDesk.class.php +++ b/htdocs/core/modules/modCashDesk.class.php @@ -61,9 +61,6 @@ class modCashDesk extends DolibarrModules // Data directories to create when module is enabled $this->dirs = array(); - // Relative path to module style sheet if exists. Example: '/mymodule/mycss.css'. - $this->style_sheet = ''; - // Config pages. Put here list of php page names stored in admmin directory used to setup module. $this->config_page_url = array("cashdesk.php@cashdesk"); diff --git a/htdocs/core/modules/modGravatar.class.php b/htdocs/core/modules/modGravatar.class.php index 80b83577058..2b3bbd2d561 100644 --- a/htdocs/core/modules/modGravatar.class.php +++ b/htdocs/core/modules/modGravatar.class.php @@ -69,9 +69,6 @@ class modGravatar extends DolibarrModules $this->dirs = array(); $r=0; - // Relative path to module style sheet if exists. Example: '/mymodule/mycss.css'. - $this->style_sheet = ''; - // Config pages. Put here list of php page names stored in admmin directory used to setup module. $this->config_page_url = array(); diff --git a/htdocs/core/modules/modPaybox.class.php b/htdocs/core/modules/modPaybox.class.php index f59d9841629..9ddc35b1475 100644 --- a/htdocs/core/modules/modPaybox.class.php +++ b/htdocs/core/modules/modPaybox.class.php @@ -67,9 +67,6 @@ class modPayBox extends DolibarrModules // Data directories to create when module is enabled. $this->dirs = array('/paybox/temp'); - // Relative path to module style sheet if exists. Example: '/mymodule/mycss.css'. - $this->style_sheet = ''; - // Config pages. Put here list of php page names stored in admmin directory used to setup module. $this->config_page_url = array("paybox.php@paybox"); diff --git a/htdocs/core/modules/modPaypal.class.php b/htdocs/core/modules/modPaypal.class.php index 94d2b81865e..40bcd0ca96b 100644 --- a/htdocs/core/modules/modPaypal.class.php +++ b/htdocs/core/modules/modPaypal.class.php @@ -68,9 +68,6 @@ class modPaypal extends DolibarrModules // Data directories to create when module is enabled. $this->dirs = array('/paypal/temp'); - // Relative path to module style sheet if exists. Example: '/mymodule/mycss.css'. - $this->style_sheet = ''; - // Config pages. Put here list of php page names stored in admmin directory used to setup module. $this->config_page_url = array("paypal.php@paypal");