dolibarr_changes.txt 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421
  1. This file describes changes made on external libraries after being included
  2. in Dolibarr root.
  3. ALL:
  4. ----
  5. Check "@CHANGE"
  6. PrestaShopWebservice:
  7. ---------------------
  8. Replace
  9. $params = array('filter', 'display', 'sort', 'limit', 'id_shop', 'id_group_shop');
  10. With
  11. $params = array('filter', 'display', 'sort', 'limit', 'id_shop', 'id_group_shop', 'date');
  12. CKEDITOR (4.22.1):
  13. -----------------
  14. * In ckeditor/ckeditor/contents.css
  15. Replace:
  16. body { ... margin: 20px;
  17. With
  18. body { ... margin: 5px;
  19. * In ckeditor/ckeditor/ckeditor.js
  20. Replace:
  21. d.items&&
  22. With
  23. d&&d.items&&
  24. ESCPOS:
  25. -------
  26. Replace
  27. private $connector;
  28. With
  29. protected $connector;
  30. SABRE:
  31. ------
  32. rm -fr ./htdocs/includes/sabre/sabre/bin;
  33. rm -fr ./htdocs/includes/sabre/sabre/*/bin;
  34. rm -fr ./htdocs/includes/sabre/sabre/*/*/bin;
  35. rm -fr ./htdocs/includes/sabre/sabre/*/*/*/bin;
  36. rm -fr ./htdocs/includes/sabre/sabre/*/*/*/*/bin;
  37. NUSOAP:
  38. -------
  39. * Line 1257 of file nusoap.php. Add:
  40. libxml_disable_entity_loader(true); // Avoid load of external entities (security problem). Required only for libxml < 2.
  41. * Line 4346 of file nusoap.php
  42. $rev = array();
  43. preg_match('/\$Revision: ([^ ]+)/', $this->revision, $rev);
  44. $this->outgoing_headers[] = "X-SOAP-Server: $this->title/$this->version (".(isset($rev[1]) ? $rev[1] : '').")";
  45. * Line 6566 of file nusoap.php, replace
  46. if (count($attrs) > 0) {
  47. with
  48. if (is_array($attrs) && count($attrs) > 0) {
  49. TCPDF:
  50. ------
  51. * Modify in tcpdf.php: make TCPDF::_out public.
  52. (htdocs/core/lib/pdf.lib.php uses it as a public method)
  53. Change:
  54. protected function _out($s)
  55. to
  56. public function _out($s)
  57. Change in method's _out phpdoc:
  58. * @protected
  59. to
  60. * @public
  61. * Replace in tcpdf.php:
  62. if (isset($this->imagekeys)) {
  63. foreach($this->imagekeys as $file) {
  64. unlink($file);
  65. }
  66. }
  67. with
  68. if (isset($this->imagekeys)) {
  69. foreach($this->imagekeys as $file) {
  70. // DOL CHANGE If we keep this, source image files are physically destroyed
  71. // unlink($file);
  72. }
  73. }
  74. * Replace in tcpdf.php:
  75. $preserve = array(
  76. 'file_id',
  77. 'internal_encoding',
  78. 'state',
  79. 'bufferlen',
  80. 'buffer',
  81. 'cached_files',
  82. with
  83. $preserve = array(
  84. 'file_id',
  85. 'internal_encoding',
  86. 'state',
  87. 'bufferlen',
  88. 'buffer',
  89. 'cached_files',
  90. // @CHANGE DOL
  91. 'imagekeys',
  92. * Replace in tcpdf.php:
  93. if (!@TCPDF_STATIC::file_exists($file)) {
  94. return false;
  95. }
  96. with
  97. if (!@TCPDF_STATIC::file_exists($file)) {
  98. // DOL CHANGE If we keep this, the image is not visible on pages after the first one.
  99. //var_dump($file.' '.(!@TCPDF_STATIC::file_exists($file)));
  100. //return false;
  101. $tfile = str_replace(' ', '%20', $file);
  102. if (@TCPDF_STATIC::file_exists($tfile)) {
  103. $file = $tfile;
  104. }
  105. }
  106. * Replace in tcpdf.php:
  107. if (($imgsrc[0] === '/') AND !empty($_SERVER['DOCUMENT_ROOT']) AND ($_SERVER['DOCUMENT_ROOT'] != '/')) {
  108. with
  109. // @CHANGE LDR Add support for src="file://..." links
  110. if (strpos($imgsrc, 'file://') === 0) {
  111. $imgsrc = str_replace('file://', '/', $imgsrc);
  112. $imgsrc = urldecode($imgsrc);
  113. $testscrtype = @parse_url($imgsrc);
  114. if (empty($testscrtype['query'])) {
  115. // convert URL to server path
  116. $imgsrc = str_replace(K_PATH_URL, K_PATH_MAIN, $imgsrc);
  117. } elseif (preg_match('|^https?://|', $imgsrc) !== 1) {
  118. // convert URL to server path
  119. $imgsrc = str_replace(K_PATH_MAIN, K_PATH_URL, $imgsrc);
  120. }
  121. }
  122. elseif (($imgsrc[0] === '/') AND !empty($_SERVER['DOCUMENT_ROOT']) AND ($_SERVER['DOCUMENT_ROOT'] != '/')) {
  123. * In tecnickcom/tcpdf/include/tcpdf_static.php, in function fopenLocal, replace:
  124. if (strpos($filename, '://') === false) {
  125. with
  126. if (strpos($filename, '//') === 0) {
  127. // Share folder on a (windows) server
  128. // e.g.: "//[MyServerName]/[MySharedFolder]/"
  129. //
  130. // nothing to change
  131. }
  132. elseif (strpos($filename, '://') === false)
  133. * To avoid to have QRcode changed because generated with a random mask, replace:
  134. define('QR_FIND_FROM_RANDOM', 2);
  135. with
  136. define('QR_FIND_FROM_RANDOM', false);
  137. * Change line:
  138. imagesetpixel($imgalpha, $xpx, $ypx, $alpha);
  139. into
  140. imagesetpixel($imgalpha, $xpx, $ypx, (int) $alpha);
  141. * Removed useless directories ("examples", "tools")
  142. * Optionnaly, removed all fonts except
  143. dejavusans* (used by greek, arab, persan, romanian, turkish),
  144. freemono* (russian),
  145. cid*+msungstdlight+stsongstdlight+uni2cid* (chinese),
  146. helvetica* (all other languages),
  147. zapfdingbats.php (for special chars like form checkboxes)
  148. * Optionnaly, made freemono the default monotype font if we removed courier
  149. In htdocs/includes/tecnickcom/tcpdf/tcpdf.php
  150. - protected $default_monospaced_font = 'courier';
  151. + protected $default_monospaced_font = 'freemono';
  152. * In tecnickcom/tcpdf/include/tcpdf_static, in function intToRoman, right at the beginning
  153. of the function, replace:
  154. $roman = '';
  155. with:
  156. $roman = '';
  157. if ($number >= 4000) {
  158. // do not represent numbers above 4000 in Roman numerals
  159. return strval($number);
  160. }
  161. * Add this at begin of tcpdf_autoconfig.php
  162. // @CHANGE LDR DOCUMENT_ROOT fix for IIS Webserver
  163. if ((!isset($_SERVER['DOCUMENT_ROOT'])) OR (empty($_SERVER['DOCUMENT_ROOT']))) {
  164. if (isset($_SERVER['SCRIPT_FILENAME']) && isset($_SERVER['PHP_SELF'])) {
  165. $_SERVER['DOCUMENT_ROOT'] = str_replace( '\\', '/', substr($_SERVER['SCRIPT_FILENAME'], 0, 0-strlen($_SERVER['PHP_SELF'])));
  166. } elseif(isset($_SERVER['PATH_TRANSLATED'])) {
  167. $_SERVER['DOCUMENT_ROOT'] = str_replace( '\\', '/', substr(str_replace('\\\\', '\\', $_SERVER['PATH_TRANSLATED']), 0, 0-strlen($_SERVER['PHP_SELF'])));
  168. } else {
  169. // define here your DOCUMENT_ROOT path if the previous fails (e.g. '/var/www')
  170. $_SERVER['DOCUMENT_ROOT'] = '/';
  171. }
  172. }
  173. $_SERVER['DOCUMENT_ROOT'] = str_replace('//', '/', $_SERVER['DOCUMENT_ROOT']);
  174. if (substr($_SERVER['DOCUMENT_ROOT'], -1) != '/') {
  175. $_SERVER['DOCUMENT_ROOT'] .= '/';
  176. }
  177. TCPDI:
  178. ------
  179. Add file fpdf_tpl.php 1.2
  180. Add file tcpdi.php
  181. Add file tcpdi_parser.php and replace:
  182. require_once(dirname(__FILE__).'/include/tcpdf_filters.php');
  183. with:
  184. require_once(dirname(__FILE__).'/../tecnickcom/tcpdf/include/tcpdf_filters.php');
  185. * Fix syntax error by replacing
  186. } elseif (($key == '/Index') AND ($v[0] == PDF_TYPE_ARRAY AND count($v[1] >= 2))) {
  187. with
  188. } elseif (($key == '/Index') AND ($v[0] == PDF_TYPE_ARRAY AND count($v[1]) >= 2)) {
  189. * Fix php fatal error on php 8.0 on tcpdi.php
  190. while (list($k, $v) = each($value[1])) {
  191. with
  192. foreach ($value[1] as $k => $v) {
  193. * Fix by replacing
  194. if ($res[0] == PDF_TYPE_OBJECT)
  195. with
  196. if (isset($res[0]) && $res[0] == PDF_TYPE_OBJECT)
  197. JSGANTT:
  198. --------
  199. * Replace in function JSGantt.taskLink
  200. var OpenWindow=window.open(pRef, "newwin", "height="+vHeight+",width="+vWidth);
  201. with
  202. // LDR To open in same window
  203. //var OpenWindow=window.open(pRef, "newwin", "height="+vHeight+",width="+vWidth);
  204. window.location.href=pRef
  205. * Replace
  206. vTmpDiv=this.newNode(vTmpCell, 'div', null, null, vTaskList[i].getResource());
  207. with
  208. var vTmpNode=this.newNode(vTmpCell, 'div', null, '');
  209. vTmpNode=this.newNode(vTmpNode, 'a', null, '', vLangs[vLang]['moreinfo']);
  210. vTmpNode.setAttribute('href',vTaskList[i].getLink());
  211. * Replace '% Comp.' to have a smaller text column header
  212. 'comp':'% Comp.'
  213. with
  214. 'comp':'%'
  215. JCROP:
  216. ------
  217. * Remove analytics tag into file index.html
  218. JQUERYFILETREE:
  219. ---------------
  220. * Remove directory htdocs/includes/jquery/plugins/jqueryFileTree/connectors
  221. RESTLER:
  222. --------
  223. * Add line into Util.php to complete function
  224. public static function getShortName($className)
  225. {
  226. // @CHANGE LDR
  227. if (!is_string($className)) return;
  228. //var_dump($className);
  229. * Add line into Data/Text.php to complete function
  230. public static function endsWith($haystack, $needle)
  231. {
  232. $length = strlen($needle);
  233. if ($length == 0) {
  234. return true;
  235. }
  236. // @CHANGE LDR
  237. if (!is_string($haystack)) return false;
  238. * Replace
  239. $loaders = array_unique(static::$rogueLoaders);
  240. with
  241. $loaders = array_unique(static::$rogueLoaders, SORT_REGULAR);
  242. * Replace CommentParser.php line 423
  243. elseif (count($value) && is_numeric($value[0]))
  244. with
  245. elseif (count($value) && isset($value[0]) && is_numeric($value[0]))
  246. * Add CommentParser.php line 406 & 407 to remove a warning on api request in php 8.1
  247. empty($value[0]) ? null :
  248. empty($value[1]) ? null :
  249. * Add a test into AutoLoader.php to complete function loadThisLoader and test if property exists before calling it. For this replace code
  250. if (false !== $file = $b::$loader[1]($className) && $this->exists($className, $b::$loader[1])) {
  251. return $file;
  252. }
  253. with:
  254. //avoid PHP Fatal error: Uncaught Error: Access to undeclared static property: Composer\\Autoload\\ClassLoader::$loader
  255. //in case of multiple autoloader systems
  256. if(property_exists($b, $loader[1])) {
  257. if (false !== $file = $b::$loader[1]($className)
  258. && $this->exists($className, $b::$loader[1])) {
  259. return $file;
  260. }
  261. }
  262. +With swagger 2 provided into /explorer:
  263. ----------------------------------------
  264. Change content of file htdocs/includes/restler/framework/Luracast/Restler/explorer/index.html
  265. PARSEDOWN
  266. ---------
  267. * Add support of css by adding in Parsedown.php:
  268. // @CHANGE LDR
  269. 'class' => $Link['element']['attributes']['class']
  270. ...
  271. // @CHANGE LDR
  272. if (preg_match('/{([^}]+)}/', $remainder, $matches2)) {
  273. $Element['attributes']['class'] = $matches2[1];
  274. $remainder = preg_replace('/{'.preg_quote($matches2[1],'/').'}/', '', $remainder);
  275. }
  276. // @CHANGE LDR
  277. //$markup .= $this->{$Element['handler']}($Element['text']);
  278. $markup .= preg_replace('/>{[^}]+}/', '>', $this->{$Element['handler']}($Element['text']));
  279. * Fix to avoid fatal error when mb_strlen not available:
  280. // @CHANGE LDR Fix when mb_strlen is not available
  281. //$shortage = 4 - mb_strlen($line, 'utf-8') % 4;
  282. if (function_exists('mb_strlen')) $len = mb_strlen($line, 'utf-8');
  283. else $len = strlen($line);
  284. $shortage = 4 - $len % 4;
  285. OAUTH
  286. -----
  287. Add into Class Google of file OAuth2/Service/Google:
  288. // LDR CHANGE Add approval_prompt to force the prompt if value is set to 'force' so it force return of a "refresh token" in addition to "standard token"
  289. public $approvalPrompt='auto';
  290. public function setApprouvalPrompt($prompt)
  291. {
  292. if (!in_array($prompt, array('auto', 'force'), true)) {
  293. // @todo Maybe could we rename this exception
  294. throw new InvalidAccessTypeException('Invalid approuvalPrompt, expected either auto or force.');
  295. }
  296. $this->approvalPrompt = $prompt;
  297. }
  298. JEDITABLE.JS
  299. ------------
  300. * <button type="submit" /> => <button class="button" type="submit" />
  301. * <button type="cancel" /> => <button class="button" type="cancel" />
  302. SELECT2
  303. -------
  304. Edit CSS to restore line removed between 4.0.5 and 4.0.6. It generates this bug: https://github.com/select2/select2/issues/5832
  305. .select2-hidden-accessible {
  306. margin: -10000px !important; /* line to restore */
  307. }