diff --git a/.travis.yml b/.travis.yml
index 3009ff69c01..c1bed319447 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -406,8 +406,9 @@ script:
php step5.php 13.0.0 14.0.0 > $TRAVIS_BUILD_DIR/upgrade13001400-3.log
# Enable modules not enabled into original dump
- php upgrade2.php 0.0.0 0.0.0 MAIN_MODULE_API,MAIN_MODULE_PRODUCTBATCH,MAIN_MODULE_SUPPLIERPROPOSAL,MAIN_MODULE_WEBSITE,MAIN_MODULE_TICKET,MAIN_MODULE_ACCOUNTING,MAIN_MODULE_MRP > $TRAVIS_BUILD_DIR/enablemodule.log
- php upgrade2.php 0.0.0 0.0.0 MAIN_MODULE_RECEPTION,MAIN_MODULE_RECRUITMENT > $TRAVIS_BUILD_DIR/enablemodule.log
+ php upgrade2.php 0.0.0 0.0.0 MAIN_MODULE_API,MAIN_MODULE_PRODUCTBATCH,MAIN_MODULE_SUPPLIERPROPOSAL,MAIN_MODULE_STRIPE > $TRAVIS_BUILD_DIR/enablemodule.log
+ php upgrade2.php 0.0.0 0.0.0 MAIN_MODULE_WEBSITE,MAIN_MODULE_TICKET,MAIN_MODULE_ACCOUNTING,MAIN_MODULE_MRP >> $TRAVIS_BUILD_DIR/enablemodule.log
+ php upgrade2.php 0.0.0 0.0.0 MAIN_MODULE_RECEPTION,MAIN_MODULE_RECRUITMENT >> $TRAVIS_BUILD_DIR/enablemodule.log
echo $?
cd -
set +e
diff --git a/COPYRIGHT b/COPYRIGHT
index 4f4bc3dff6d..21e37f39f1d 100644
--- a/COPYRIGHT
+++ b/COPYRIGHT
@@ -32,7 +32,7 @@ PSR/simple-cache ? Library for cache (used by PHPSp
Restler 3.1.1 LGPL-3+ Yes Library to develop REST Web services (+ swagger-ui js lib into dir explorer)
Sabre 3.2.2 BSD Yes DAV support
Swift Mailer 5.4.2-DEV MIT license Yes Comprehensive mailing tools for PHP
-Stripe 6.43.1 MIT licence Yes Library for Stripe module
+Stripe 7.67.0 MIT licence Yes Library for Stripe module
TCPDF 6.3.2 LGPL-3+ Yes PDF generation
TCPDI 1.0.0 LGPL-3+ / Apache 2.0 Yes FPDI replacement
diff --git a/ChangeLog b/ChangeLog
index 4877363e6be..ecf20be261f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -57,7 +57,6 @@ NEW: add option TAKEPOS_CAN_FORCE_BANK_ACCOUNT_DURING_PAYMENT
NEW: add option to define a default warehouse at user level
NEW: add option to include products without alert in replenish
NEW: add order by lastname and firstname by default in get sales representatives
-NEW: add param to not show links when output tags
NEW: add PDF document templates for warehouses (list of stock)
NEW: add a prospect status for the contact with managment of custom icon
NEW: add public note on products ; this also partially fix the #14342
@@ -80,7 +79,7 @@ NEW: appearance tab in TakePOS with more visual parameters
NEW: better currency rate editor
NEW: can build vendor invoice from vendor orders
NEW: can change a product in lines of a recurring invoice or contract
-NEW: can change size of logo on PDF documents
+NEW: can set the size of the logo on PDF documents
NEW: can change VAT rate of all lines of a draft object in one step
NEW: can define date range of validity of a login during creation
NEW: can disable, from edit page, the whole web site
@@ -189,7 +188,7 @@ NEW: show line number on intervention card (via MAIN_VIEW_LINE_NUMBER)
NEW: Add some fields to link website page to an other object
NEW: fill ECM src object fields in dol_add_file_process
NEW: conf to allow to show the full tree in warehouse popup
-NEW: can use THEME_DARKMODEENABLED=2 for a preview of theme in dark mode
+NEW: can use parameter ?THEME_DARKMODEENABLED=2 for a preview of theme in dark mode
NEW: can force the antivirus from conf file or autoprepend ini setup
NEW: can add event to log into blockedlog module with a constant
NEW: add property cssview when declaring fields of an object
@@ -208,6 +207,7 @@ NEW: add a message in error_log after detection of SQL or script injection
NEW: add validation of MX domain for emails
NEW: calculate the virtual stock in transverse mode ( not on getEntity('commande'), ... but on getEntity('stock') )
NEW: Graphics can be horizontal bars
+NEW: add param to not show links when output tags
APIs
NEW: API get contacts list of a given order
diff --git a/dev/dolibarr_changes.txt b/dev/dolibarr_changes.txt
index f3374c43234..e207afa5658 100644
--- a/dev/dolibarr_changes.txt
+++ b/dev/dolibarr_changes.txt
@@ -133,17 +133,15 @@ with
}
}
elseif (($imgsrc[0] === '/') AND !empty($_SERVER['DOCUMENT_ROOT']) AND ($_SERVER['DOCUMENT_ROOT'] != '/')) {
-
-* In tecnickcom/tcpdf/include/tcpdf_static, in function fopenLocal, replace
+* In tecnickcom/tcpdf/include/tcpdf_static.php, in function fopenLocal, replace
if (strpos($filename, '://') === false) {
with
- if (strpos($filename, '//') === 0)
- {
+ if (strpos($filename, '//') === 0) {
// Share folder on a (windows) server
// e.g.: "//[MyServerName]/[MySharedFolder]/"
//
@@ -175,17 +173,17 @@ In htdocs/includes/tecnickcom/tcpdf/tcpdf.php
TCPDI:
------
-Add fpdf_tpl.php 1.2
+Add file fpdf_tpl.php 1.2
-Add tcpdi.php
+Add file tcpdi.php
-Add tcpdi_parser.php and replace:
-require_once(dirname(__FILE__).'/include/tcpdf_filters.php');
+Add file tcpdi_parser.php and replace:
+ require_once(dirname(__FILE__).'/include/tcpdf_filters.php');
with:
-require_once(dirname(__FILE__).'/../tecnickcom/tcpdf/include/tcpdf_filters.php');
+ require_once(dirname(__FILE__).'/../tecnickcom/tcpdf/include/tcpdf_filters.php');
-* Fix by replacing
+* Fix syntax error by replacing
} elseif (($key == '/Index') AND ($v[0] == PDF_TYPE_ARRAY AND count($v[1] >= 2))) {
with
} elseif (($key == '/Index') AND ($v[0] == PDF_TYPE_ARRAY AND count($v[1]) >= 2)) {
@@ -195,23 +193,23 @@ with
JSGANTT:
--------
* Replace in function JSGantt.taskLink
-var OpenWindow=window.open(pRef, "newwin", "height="+vHeight+",width="+vWidth);
+ var OpenWindow=window.open(pRef, "newwin", "height="+vHeight+",width="+vWidth);
with
-// LDR To open in same window
-//var OpenWindow=window.open(pRef, "newwin", "height="+vHeight+",width="+vWidth);
-window.location.href=pRef
+ // LDR To open in same window
+ //var OpenWindow=window.open(pRef, "newwin", "height="+vHeight+",width="+vWidth);
+ window.location.href=pRef
* Replace
-vTmpDiv=this.newNode(vTmpCell, 'div', null, null, vTaskList[i].getResource());
+ vTmpDiv=this.newNode(vTmpCell, 'div', null, null, vTaskList[i].getResource());
with
-var vTmpNode=this.newNode(vTmpCell, 'div', null, '');
-vTmpNode=this.newNode(vTmpNode, 'a', null, '', vLangs[vLang]['moreinfo']);
-vTmpNode.setAttribute('href',vTaskList[i].getLink());
+ var vTmpNode=this.newNode(vTmpCell, 'div', null, '');
+ vTmpNode=this.newNode(vTmpNode, 'a', null, '', vLangs[vLang]['moreinfo']);
+ vTmpNode.setAttribute('href',vTaskList[i].getLink());
* Replace '% Comp.' to have a smaller text column header
-'comp':'% Comp.'
+ 'comp':'% Comp.'
with
-'comp':'%'
+ 'comp':'%'
diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php
index 124b8dcf1dd..6499db671cb 100644
--- a/htdocs/comm/action/card.php
+++ b/htdocs/comm/action/card.php
@@ -462,10 +462,10 @@ if (empty($reshook) && $action == 'update')
if (empty($cancel))
{
$fulldayevent = GETPOST('fullday');
- $aphour = GETPOST('aphour');
- $apmin = GETPOST('apmin');
- $p2hour = GETPOST('p2hour');
- $p2min = GETPOST('p2min');
+ $aphour = GETPOST('aphour', 'int');
+ $apmin = GETPOST('apmin', 'int');
+ $p2hour = GETPOST('p2hour', 'int');
+ $p2min = GETPOST('p2min', 'int');
$percentage = in_array(GETPOST('status'), array(-1, 100)) ?GETPOST('status') : (in_array(GETPOST('complete'), array(-1, 100)) ?GETPOST('complete') : GETPOST("percentage")); // If status is -1 or 100, percentage is not defined and we must use status
// Clean parameters
@@ -479,8 +479,8 @@ if (empty($reshook) && $action == 'update')
$object->fetch_userassigned();
$object->oldcopy = clone $object;
- $datep = dol_mktime($fulldayevent ? '00' : $aphour, $fulldayevent ? '00' : $apmin, 0, $_POST["apmonth"], $_POST["apday"], $_POST["apyear"]);
- $datef = dol_mktime($fulldayevent ? '23' : $p2hour, $fulldayevent ? '59' : $p2min, $fulldayevent ? '59' : '0', $_POST["p2month"], $_POST["p2day"], $_POST["p2year"]);
+ $datep = dol_mktime($fulldayevent ? '00' : $aphour, $fulldayevent ? '00' : $apmin, 0, GETPOST("apmonth", 'int'), GETPOST("apday", 'int'), GETPOST("apyear", 'int'));
+ $datef = dol_mktime($fulldayevent ? '23' : $p2hour, $fulldayevent ? '59' : $p2min, $fulldayevent ? '59' : '0', GETPOST("p2month", 'int'), GETPOST("p2day", 'int'), GETPOST("p2year", 'int'));
$object->type_id = dol_getIdFromCode($db, GETPOST("actioncode", 'aZ09'), 'c_actioncomm');
$object->label = GETPOST("label", "alphanohtml");
@@ -1324,8 +1324,8 @@ if ($id > 0)
{
$percentage = in_array(GETPOST('status'), array(-1, 100)) ?GETPOST('status') : (in_array(GETPOST('complete'), array(-1, 100)) ?GETPOST('complete') : GETPOST("percentage")); // If status is -1 or 100, percentage is not defined and we must use status
- $datep = dol_mktime($fulldayevent ? '00' : $aphour, $fulldayevent ? '00' : $apmin, 0, $_POST["apmonth"], $_POST["apday"], $_POST["apyear"]);
- $datef = dol_mktime($fulldayevent ? '23' : $p2hour, $fulldayevent ? '59' : $p2min, $fulldayevent ? '59' : '0', $_POST["p2month"], $_POST["p2day"], $_POST["p2year"]);
+ $datep = dol_mktime($fulldayevent ? '00' : $aphour, $fulldayevent ? '00' : $apmin, 0, GETPOST("apmonth", 'int'), GETPOST("apday", 'int'), GETPOST("apyear", 'int'));
+ $datef = dol_mktime($fulldayevent ? '23' : $p2hour, $fulldayevent ? '59' : $p2min, $fulldayevent ? '59' : '0', GETPOST("p2month", 'int'), GETPOST("p2day", 'int'), GETPOST("p2year", 'int'));
$object->type_id = dol_getIdFromCode($db, GETPOST("actioncode", 'aZ09'), 'c_actioncomm');
$object->label = GETPOST("label", "alphanohtml");
@@ -1431,7 +1431,7 @@ if ($id > 0)
// Full day event
print '
";
}
diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php
index c942127aab3..e96adea7531 100644
--- a/htdocs/core/class/CMailFile.class.php
+++ b/htdocs/core/class/CMailFile.class.php
@@ -6,7 +6,7 @@
* Copyright (C) 2003 Jean-Louis Bergamo
* Copyright (C) 2004-2015 Laurent Destailleur
* Copyright (C) 2005-2012 Regis Houssin
- * Copyright (C) 2019 Frédéric France
+ * Copyright (C) 2019-2020 Frédéric France
*
* 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
@@ -950,15 +950,14 @@ class CMailFile
* Read a file on disk and return encoded content for emails (mode = 'mail')
*
* @param string $sourcefile Path to file to encode
- * @return int <0 if KO, encoded string if OK
+ * @return int|string <0 if KO, encoded string if OK
*/
private function _encode_file($sourcefile)
{
// phpcs:enable
$newsourcefile = dol_osencode($sourcefile);
- if (is_readable($newsourcefile))
- {
+ if (is_readable($newsourcefile)) {
$contents = file_get_contents($newsourcefile); // Need PHP 4.3
$encoded = chunk_split(base64_encode($contents), 76, $this->eol); // 76 max is defined into http://tools.ietf.org/html/rfc2047
return $encoded;
@@ -983,27 +982,24 @@ class CMailFile
// phpcs:enable
global $conf, $dolibarr_main_data_root;
- if (@is_writeable($dolibarr_main_data_root)) // Avoid fatal error on fopen with open_basedir
- {
+ if (@is_writeable($dolibarr_main_data_root)) { // Avoid fatal error on fopen with open_basedir
$outputfile = $dolibarr_main_data_root."/dolibarr_mail.log";
$fp = fopen($outputfile, "w");
- if ($this->sendmode == 'mail')
- {
+ if ($this->sendmode == 'mail') {
fputs($fp, $this->headers);
fputs($fp, $this->eol); // This eol is added by the mail function, so we add it in log
fputs($fp, $this->message);
- } elseif ($this->sendmode == 'smtps')
- {
+ } elseif ($this->sendmode == 'smtps') {
fputs($fp, $this->smtps->log); // this->smtps->log is filled only if MAIN_MAIL_DEBUG was set to on
- } elseif ($this->sendmode == 'swiftmailer')
- {
+ } elseif ($this->sendmode == 'swiftmailer') {
fputs($fp, $this->logger->dump()); // this->logger is filled only if MAIN_MAIL_DEBUG was set to on
}
fclose($fp);
- if (!empty($conf->global->MAIN_UMASK))
+ if (!empty($conf->global->MAIN_UMASK)) {
@chmod($outputfile, octdec($conf->global->MAIN_UMASK));
+ }
}
}
@@ -1016,8 +1012,7 @@ class CMailFile
*/
public function checkIfHTML($msg)
{
- if (!preg_match('/^[\s\t]*";
if (!empty($this->styleCSS)) $out .= $this->styleCSS;
$out .= "css))
- {
+ if (!empty($this->css)) {
// Style CSS
$this->styleCSS = '