From f1c23f25f0c15a7f8ebc985393cb4a491d123762 Mon Sep 17 00:00:00 2001 From: phf Date: Thu, 13 Jul 2017 16:49:58 +0200 Subject: [PATCH 1/9] Fix updateline extrafields contrat fail --- htdocs/contrat/class/contrat.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index e4bee39c39e..65ea14219d1 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -1601,8 +1601,8 @@ class Contrat extends CommonObject if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && is_array($array_options) && count($array_options)>0) // For avoid conflicts if trigger used { $contractline = new ContratLigne($this->db); - $contractline->array_options=$array_option; - $contractline->id= $this->db->last_insert_id(MAIN_DB_PREFIX.$contractline->table_element); + $contractline->array_options=$array_options; + $contractline->id= $rowid; $result=$contractline->insertExtraFields(); if ($result < 0) { From 2166b3d467f38e401690a3f5400431dc99962f2e Mon Sep 17 00:00:00 2001 From: hguibourgdev Date: Sat, 15 Jul 2017 12:04:59 +0200 Subject: [PATCH 2/9] Update card.php FIX "!" is missing on test : empty($object->date_livraison) --- htdocs/commande/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index d99aa6a4f46..c4bb0ace2f2 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -2084,7 +2084,7 @@ if ($action == 'create' && $user->rights->commande->creer) print ''; } else { print $object->date ? dol_print_date($object->date, 'day') : ' '; - if ($object->hasDelay() && empty($object->date_livraison)) { + if ($object->hasDelay() && ! empty($object->date_livraison)) { print ' '.img_picto($langs->trans("Late").' : '.$object->showDelay(), "warning"); } } From 2c5bdaf4ad6c447d33d6d27d85f211d69bb62cd3 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sun, 16 Jul 2017 08:23:27 +0200 Subject: [PATCH 3/9] Fix: Trusty become default linux the July 18th 2017 --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 6eced4be075..010f5c8ca18 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,6 +2,7 @@ # from Dolibarr GitHub repository. # For syntax, see http://about.travis-ci.org/docs/user/languages/php/ +dist: precise sudo: required language: php From 885fc3c5b74a03e0762f22e913f54234c4196179 Mon Sep 17 00:00:00 2001 From: phf Date: Mon, 17 Jul 2017 11:04:48 +0200 Subject: [PATCH 4/9] Fix lost search value in list if come from thirdparty card --- htdocs/comm/propal/list.php | 1 + htdocs/commande/list.php | 1 + htdocs/compta/facture/list.php | 1 + htdocs/contrat/list.php | 7 +++++++ htdocs/fichinter/list.php | 9 ++++++++- htdocs/fourn/facture/list.php | 1 + 6 files changed, 19 insertions(+), 1 deletion(-) diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 93c93850652..0fd9ddb4c7c 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -353,6 +353,7 @@ if ($resql) $soc = new Societe($db); $soc->fetch($socid); $title = $langs->trans('ListOfProposals') . ' - '.$soc->name; + if (empty($search_societe)) $search_societe = $soc->name; } else { diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index e62ae11d5cd..d91d1737281 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -578,6 +578,7 @@ if ($resql) $soc = new Societe($db); $soc->fetch($socid); $title = $langs->trans('ListOfOrders') . ' - '.$soc->name; + if (empty($search_company)) $search_company = $soc->name; } else { diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 982f61f5067..5a05c7c43ac 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -423,6 +423,7 @@ if ($resql) { $soc = new Societe($db); $soc->fetch($socid); + if (empty($search_societe)) $search_societe = $soc->name; } $param='&socid='.$socid; diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php index 8a22f7ee324..1f23c9aad0a 100644 --- a/htdocs/contrat/list.php +++ b/htdocs/contrat/list.php @@ -306,6 +306,13 @@ if ($resql) $arrayofselected=is_array($toselect)?$toselect:array(); + if ($socid) + { + $soc = new Societe($db); + $soc->fetch($socid); + if (empty($search_name)) $search_name = $soc->name; + } + $param=''; if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; diff --git a/htdocs/fichinter/list.php b/htdocs/fichinter/list.php index bafafb40dd1..373cb9b99cf 100644 --- a/htdocs/fichinter/list.php +++ b/htdocs/fichinter/list.php @@ -211,7 +211,14 @@ $result=$db->query($sql); if ($result) { $num = $db->num_rows($result); - + + if ($socid) + { + $soc = new Societe($db); + $soc->fetch($socid); + if (empty($search_company)) $search_company = $soc->name; + } + $param=''; if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index 77064191d24..8022eb7ef17 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -394,6 +394,7 @@ if ($resql) { $soc = new Societe($db); $soc->fetch($socid); + if (empty($search_societe)) $search_societe = $soc->name; } $param='&socid='.$socid; From 76eac7ce6a387d9fcfdf5be017169e3e69cecd56 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Tue, 18 Jul 2017 10:13:10 +0200 Subject: [PATCH 5/9] Fix : creating user from member was failing due to column size difference --- htdocs/install/mysql/migration/3.9.0-4.0.0.sql | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/install/mysql/migration/3.9.0-4.0.0.sql b/htdocs/install/mysql/migration/3.9.0-4.0.0.sql index f1c94f346cf..e09d364a0e2 100644 --- a/htdocs/install/mysql/migration/3.9.0-4.0.0.sql +++ b/htdocs/install/mysql/migration/3.9.0-4.0.0.sql @@ -544,4 +544,6 @@ INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle, active) VALUES (178, -- VMYSQL4.1 ALTER TABLE llx_establishment CHANGE COLUMN fk_user_mod fk_user_mod integer NULL; -- VPGSQL8.2 ALTER TABLE llx_establishment ALTER COLUMN fk_user_mod DROP NOT NULL; -ALTER TABLE llx_multicurrency_rate ADD COLUMN entity integer DEFAULT 1; \ No newline at end of file +ALTER TABLE llx_multicurrency_rate ADD COLUMN entity integer DEFAULT 1; + +ALTER TABLE llx_user MODIFY COLUMN login varchar(50); \ No newline at end of file From d35dbdea923ce3115631d289784a03e53d030353 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Tue, 18 Jul 2017 10:16:59 +0200 Subject: [PATCH 6/9] Change column size in sql table creation also --- htdocs/install/mysql/tables/llx_user.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/mysql/tables/llx_user.sql b/htdocs/install/mysql/tables/llx_user.sql index 6b3c5b83f6d..84d74fa52d9 100644 --- a/htdocs/install/mysql/tables/llx_user.sql +++ b/htdocs/install/mysql/tables/llx_user.sql @@ -33,7 +33,7 @@ create table llx_user tms timestamp, fk_user_creat integer, fk_user_modif integer, - login varchar(24) NOT NULL, + login varchar(50) NOT NULL, pass varchar(128), pass_crypted varchar(128), pass_temp varchar(128), -- temporary password when asked for forget password From 97fe41d60319348e77dafd7297f56bce7f62bf7d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 18 Jul 2017 12:49:19 +0200 Subject: [PATCH 7/9] A info int smtp header --- htdocs/core/class/smtps.class.php | 49 ++++++++++++++++--------------- 1 file changed, 26 insertions(+), 23 deletions(-) diff --git a/htdocs/core/class/smtps.class.php b/htdocs/core/class/smtps.class.php index c99ca2c4850..3859f0de2b0 100644 --- a/htdocs/core/class/smtps.class.php +++ b/htdocs/core/class/smtps.class.php @@ -271,7 +271,7 @@ class SMTPs { $this->_moreinheader = $_val; } - + /** * get trackid * @@ -291,7 +291,7 @@ class SMTPs { return $this->_moreinheader; } - + /** * Set errors to * @@ -411,7 +411,7 @@ class SMTPs function _server_authenticate() { global $conf; - + // Send the RFC2554 specified EHLO. // This improvment as provided by 'SirSir' to // accomodate both SMTP AND ESMTP capable servers @@ -441,7 +441,7 @@ class SMTPs { $this->_setErr(126, '"' . $host . '" does not support authenticated connections.'); return $_retVal; - } + } } // Send Authentication to Server // Check for errors along the way @@ -882,7 +882,7 @@ class SMTPs if ( $_strReplyTo ) $this->_msgReplyTo = $this->_strip_email($_strReplyTo); } - + /** * Retrieves the Address from which mail will be the reply-to * @@ -892,15 +892,15 @@ class SMTPs function getReplyTo($_part = true) { $_retValue = ''; - + if ( $_part === true ) $_retValue = $this->_msgReplyTo; else $_retValue = $this->_msgReplyTo[$_part]; - + return $_retValue; } - + /** * Inserts given addresses into structured format. * This method takes a list of given addresses, via an array @@ -1196,6 +1196,8 @@ class SMTPs */ function getHeader() { + global $conf; + $_header = 'From: ' . $this->getFrom('org') . "\r\n" . 'To: ' . $this->getTO() . "\r\n"; @@ -1212,13 +1214,13 @@ class SMTPs if ( $this->getBCC() ) $_header .= 'Bcc: ' . $this->getBCC() . "\r\n"; */ - + $host=$this->getHost(); $host=preg_replace('@tcp://@i','',$host); // Remove prefix $host=preg_replace('@ssl://@i','',$host); // Remove prefix $host=dol_getprefix('email'); - + //NOTE: Message-ID should probably contain the username of the user who sent the msg $_header .= 'Subject: ' . $this->getSubject() . "\r\n"; $_header .= 'Date: ' . date("r") . "\r\n"; @@ -1237,7 +1239,7 @@ class SMTPs } if ( $this->getMoreInHeader() ) $_header .= $this->getMoreInHeader(); // Value must include the "\r\n"; - + //$_header .= // 'Read-Receipt-To: ' . $this->getFrom( 'org' ) . "\r\n" // 'Return-Receipt-To: ' . $this->getFrom( 'org' ) . "\r\n"; @@ -1258,9 +1260,10 @@ class SMTPs $_header .= "Reply-To: ".$this->getReplyTo('addr') ."\r\n"; $_header .= 'X-Mailer: Dolibarr version ' . DOL_VERSION .' (using SMTPs Mailer)' . "\r\n"; + $_header .= 'X-Dolibarr-Option: '.($conf->global->MAIN_MAIL_USE_MULTI_PART?'MAIN_MAIL_USE_MULTI_PART':'No MAIN_MAIL_USE_MULTI_PART') . "\r\n"; $_header .= 'Mime-Version: 1.0' . "\r\n"; - + return $_header; } @@ -1289,17 +1292,17 @@ class SMTPs $strContentAltText = html_entity_decode(strip_tags($strContent)); $strContentAltText = rtrim(wordwrap($strContentAltText, 75, "\r\n")); } - + // Make RFC2045 Compliant //$strContent = rtrim(chunk_split($strContent)); // Function chunck_split seems ko if not used on a base64 content $strContent = rtrim(wordwrap($strContent, 75, "\r\n")); // TODO Using this method creates unexpected line break on text/plain content. - + $this->_msgContent[$strType] = array(); $this->_msgContent[$strType]['mimeType'] = $strMimeType; $this->_msgContent[$strType]['data'] = $strContent; $this->_msgContent[$strType]['dataText'] = $strContentAltText; - + if ( $this->getMD5flag() ) $this->_msgContent[$strType]['md5'] = dol_hash($strContent, 3); //} @@ -1313,7 +1316,7 @@ class SMTPs function getBodyContent() { global $conf; - + // Generate a new Boundary string $this->_setBoundary(); @@ -1361,7 +1364,7 @@ class SMTPs $content .= "\r\n"; $content .= "--" . $this->_getBoundary('mixed') . "\r\n"; - + if (key_exists('image', $this->_msgContent)) // If inline image found { $content.= 'Content-Type: multipart/alternative; boundary="'.$this->_getBoundary('alternative').'"' . "\r\n"; @@ -1369,7 +1372,7 @@ class SMTPs $content .= "--" . $this->_getBoundary('alternative') . "\r\n"; } - + // $this->_msgContent must be sorted with key 'text' or 'html' first then 'image' then 'attachment' @@ -1429,18 +1432,18 @@ class SMTPs $content.= "\r\n"; $content.= "--" . $this->_getBoundary('related') . "\r\n"; } - + if (! key_exists('image', $this->_msgContent) && $_content['dataText'] && ! empty($conf->global->MAIN_MAIL_USE_MULTI_PART)) // Add plain text message part before html part { $content.= 'Content-Type: multipart/alternative; boundary="'.$this->_getBoundary('alternative').'"' . "\r\n"; $content .= "\r\n"; $content .= "--" . $this->_getBoundary('alternative') . "\r\n"; - + $content.= "Content-Type: text/plain; charset=" . $this->getCharSet() . "\r\n"; $content.= "\r\n". $_content['dataText'] . "\r\n"; $content.= "--" . $this->_getBoundary('alternative') . "\r\n"; - } - + } + $content .= 'Content-Type: ' . $_content['mimeType'] . '; ' // . 'charset="' . $this->getCharSet() . '"'; . 'charset=' . $this->getCharSet() . ''; @@ -1462,7 +1465,7 @@ class SMTPs { $content.= "--" . $this->_getBoundary('alternative') . "--". "\r\n"; } - + $content .= "\r\n"; } } From 7ac5054df8c9a1b00f0f48bf7533e164ce9eb55d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 18 Jul 2017 14:47:44 +0200 Subject: [PATCH 8/9] Update list.php --- htdocs/fichinter/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fichinter/list.php b/htdocs/fichinter/list.php index 373cb9b99cf..1e508b4f7e8 100644 --- a/htdocs/fichinter/list.php +++ b/htdocs/fichinter/list.php @@ -212,7 +212,7 @@ if ($result) { $num = $db->num_rows($result); - if ($socid) + if ($socid > 0) { $soc = new Societe($db); $soc->fetch($socid); From f6060b976dc3a4f58c41034280d66b7be13b10c0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 18 Jul 2017 14:48:18 +0200 Subject: [PATCH 9/9] Update list.php --- htdocs/contrat/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php index 1f23c9aad0a..6c28dbe631e 100644 --- a/htdocs/contrat/list.php +++ b/htdocs/contrat/list.php @@ -306,7 +306,7 @@ if ($resql) $arrayofselected=is_array($toselect)?$toselect:array(); - if ($socid) + if ($socid > 0) { $soc = new Societe($db); $soc->fetch($socid);