From 0d121de1a631a140817b5ef04cf597d35083d4d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Fri, 23 May 2014 02:48:24 +0200 Subject: [PATCH 1/3] Fix: [ bug #1388 ] Wrong date when invoicing several orders --- ChangeLog | 1 + htdocs/commande/orderstoinvoice.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 3bb088b99f3..9832c1c7bfc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -113,6 +113,7 @@ Fix: [ bug #1306 ] Fatal error when adding an external calendar. New: Added es_CL language Fix: Margin tabs bad data show Fix: [ bug #1318 ] Problem with enter key when adding an existing product to a customer invoice. +Fix: [ bug #1388 ] Wrong date when invoicing several orders ***** ChangeLog for 3.5 compared to 3.4.* ***** For users: diff --git a/htdocs/commande/orderstoinvoice.php b/htdocs/commande/orderstoinvoice.php index aa2883ccb96..7b79a16bec1 100644 --- a/htdocs/commande/orderstoinvoice.php +++ b/htdocs/commande/orderstoinvoice.php @@ -413,7 +413,7 @@ if ($action == 'create' && empty($mesgs)) // Date invoice print ''.$langs->trans('Date').''; - $html->select_date(0,'','','','',"add",1,1); + $html->select_date('','','','','',"add",1,1); print ''; // Payment term print ''.$langs->trans('PaymentConditionsShort').''; From 7acecadc797e5c22caccb263da384afa1fd9ad82 Mon Sep 17 00:00:00 2001 From: Philippe Grand Date: Fri, 23 May 2014 11:37:57 +0200 Subject: [PATCH 2/3] avoid warning in commande.class.php if extrafields is used avoid warning in commande.class.php if extrafields is used --- htdocs/commande/class/commande.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 146d9e777c2..b96ea931f21 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -1362,7 +1362,7 @@ class Commande extends CommonOrder $extralabels=$extrafields->fetch_name_optionals_label($this->table_element,true); $this->fetch_optionals($this->id,$extralabels); - $this->db->free(); + $this->db->free($result); /* * Lines From 300e430024a83069f0bbd45030f0de89688b95de Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 23 May 2014 16:13:00 +0200 Subject: [PATCH 3/3] Fix: If user already exists but permissions not set, it was not possible to install Dolibarr. --- htdocs/core/db/mysql.class.php | 12 ++++++++++-- htdocs/core/db/mysqli.class.php | 12 ++++++++++-- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/htdocs/core/db/mysql.class.php b/htdocs/core/db/mysql.class.php index 227a70a020f..50ef7ac4151 100644 --- a/htdocs/core/db/mysql.class.php +++ b/htdocs/core/db/mysql.class.php @@ -1079,8 +1079,16 @@ class DoliDBMysql extends DoliDB $resql=$this->query($sql); if (! $resql) { - dol_syslog(get_class($this)."::DDLCreateUser sql=".$sql, LOG_ERR); - return -1; + if ($this->lasterrno != 'DB_ERROR_USER_ALREADY_EXISTS') + { + dol_syslog(get_class($this)."::DDLCreateUser sql=".$sql, LOG_ERR); + return -1; + } + else + { + // If user already exists, we continue to set permissions + dol_syslog(get_class($this)."::DDLCreateUser sql=".$sql, LOG_WARNING); + } } $sql = "GRANT ALL PRIVILEGES ON ".$this->escape($dolibarr_main_db_name).".* TO '".$this->escape($dolibarr_main_db_user)."'@'".$this->escape($dolibarr_main_db_host)."' IDENTIFIED BY '".$this->escape($dolibarr_main_db_pass)."'"; dol_syslog(get_class($this)."::DDLCreateUser", LOG_DEBUG); // No sql to avoid password in log diff --git a/htdocs/core/db/mysqli.class.php b/htdocs/core/db/mysqli.class.php index c2400a43b7e..96b85633e7a 100644 --- a/htdocs/core/db/mysqli.class.php +++ b/htdocs/core/db/mysqli.class.php @@ -1073,8 +1073,16 @@ class DoliDBMysqli extends DoliDB $resql=$this->query($sql); if (! $resql) { - dol_syslog(get_class($this)."::DDLCreateUser sql=".$sql, LOG_ERR); - return -1; + if ($this->lasterrno != 'DB_ERROR_USER_ALREADY_EXISTS') + { + dol_syslog(get_class($this)."::DDLCreateUser sql=".$sql, LOG_ERR); + return -1; + } + else + { + // If user already exists, we continue to set permissions + dol_syslog(get_class($this)."::DDLCreateUser sql=".$sql, LOG_WARNING); + } } $sql = "GRANT ALL PRIVILEGES ON ".$this->escape($dolibarr_main_db_name).".* TO '".$this->escape($dolibarr_main_db_user)."'@'".$this->escape($dolibarr_main_db_host)."' IDENTIFIED BY '".$this->escape($dolibarr_main_db_pass)."'"; dol_syslog(get_class($this)."::DDLCreateUser", LOG_DEBUG); // No sql to avoid password in log