dolibarr_changes.txt 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370
  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.6.2):
  13. -----------------
  14. * In ckeditor/ckeditor/contents.css
  15. Replace:
  16. body { ... margin: 20px;
  17. With
  18. body { ... margin: 5px;
  19. ESCPOS:
  20. -------
  21. Replace
  22. private $connector;
  23. With
  24. protected $connector;
  25. NUSOAP:
  26. -------
  27. * In file nusoap.php, to avoid a warning,
  28. Replace
  29. if (isset($this->methodreturn) && ((get_class($this->methodreturn) == 'soap_fault') || (get_class($this->methodreturn) == 'nusoap_fault'))) {
  30. By
  31. if (! is_array($this->methodreturn) && isset($this->methodreturn) && ((get_class($this->methodreturn) == 'soap_fault') || (get_class($this->methodreturn) == 'nusoap_fault'))) {
  32. * In file nusoap.php, to avoid a warning,
  33. Replace call to serialize_val with no bugged value
  34. * In all files, replace constructor names into __construct. Replace also parent::constructor_name with parent::__construct
  35. * Line 4222 of file nusoap.php
  36. $rev = array();
  37. preg_match('/\$Revision: ([^ ]+)/', $this->revision, $rev);
  38. $this->outgoing_headers[] = "X-SOAP-Server: $this->title/$this->version (".(isset($rev[1]) ? $rev[1] : '').")";
  39. TCPDF:
  40. ------
  41. * Replace in tcpdf.php:
  42. if (isset($this->imagekeys)) {
  43. foreach($this->imagekeys as $file) {
  44. unlink($file);
  45. }
  46. }
  47. with
  48. if (isset($this->imagekeys)) {
  49. foreach($this->imagekeys as $file) {
  50. // DOL CHANGE If we keep this, source image files are physically destroyed
  51. // unlink($file);
  52. }
  53. }
  54. * Replace in tcpdf.php
  55. $preserve = array(
  56. 'file_id',
  57. 'internal_encoding',
  58. 'state',
  59. 'bufferlen',
  60. 'buffer',
  61. 'cached_files',
  62. with
  63. $preserve = array(
  64. 'file_id',
  65. 'internal_encoding',
  66. 'state',
  67. 'bufferlen',
  68. 'buffer',
  69. 'cached_files',
  70. // @CHANGE DOL
  71. 'imagekeys',
  72. * Replace in tcpdf.php
  73. if (!@TCPDF_STATIC::file_exists($file)) {
  74. return false;
  75. }
  76. with
  77. if (!@TCPDF_STATIC::file_exists($file)) {
  78. // DOL CHANGE If we keep this, the image is not visible on pages after the first one.
  79. //var_dump($file.' '.(!@TCPDF_STATIC::file_exists($file)));
  80. //return false;
  81. $tfile = str_replace(' ', '%20', $file);
  82. if (@TCPDF_STATIC::file_exists($tfile)) {
  83. $file = $tfile;
  84. }
  85. }
  86. * Replace in tcpdf.php
  87. if (($imgsrc[0] === '/') AND !empty($_SERVER['DOCUMENT_ROOT']) AND ($_SERVER['DOCUMENT_ROOT'] != '/')) {
  88. with
  89. // @CHANGE LDR Add support for src="file://..." links
  90. if (strpos($imgsrc, 'file://') === 0) {
  91. $imgsrc = str_replace('file://', '/', $imgsrc);
  92. $imgsrc = urldecode($imgsrc);
  93. $testscrtype = @parse_url($imgsrc);
  94. if (empty($testscrtype['query'])) {
  95. // convert URL to server path
  96. $imgsrc = str_replace(K_PATH_URL, K_PATH_MAIN, $imgsrc);
  97. } elseif (preg_match('|^https?://|', $imgsrc) !== 1) {
  98. // convert URL to server path
  99. $imgsrc = str_replace(K_PATH_MAIN, K_PATH_URL, $imgsrc);
  100. }
  101. }
  102. elseif (($imgsrc[0] === '/') AND !empty($_SERVER['DOCUMENT_ROOT']) AND ($_SERVER['DOCUMENT_ROOT'] != '/')) {
  103. * In tecnickcom/tcpdf/include/tcpdf_static.php, in function fopenLocal, replace
  104. if (strpos($filename, '://') === false) {
  105. with
  106. if (strpos($filename, '//') === 0) {
  107. // Share folder on a (windows) server
  108. // e.g.: "//[MyServerName]/[MySharedFolder]/"
  109. //
  110. // nothing to change
  111. }
  112. elseif (strpos($filename, '://') === false)
  113. * To avoid to have QRcode changed because generated with a random mask, replace
  114. define('QR_FIND_FROM_RANDOM', 2);
  115. with
  116. define('QR_FIND_FROM_RANDOM', false);
  117. * Removed useless directories ("examples", "tools")
  118. * Optionnaly, removed all fonts except
  119. dejavusans* (used by greek, arab, persan, romanian, turkish),
  120. freemono* (russian),
  121. cid*+msungstdlight+stsongstdlight+uni2cid* (chinese),
  122. helvetica* (all other languages),
  123. zapfdingbats.php (for special chars like form checkboxes)
  124. * Optionnaly, made freemono the default monotype font if we removed courier
  125. In htdocs/includes/tecnickcom/tcpdf/tcpdf.php
  126. - protected $default_monospaced_font = 'courier';
  127. + protected $default_monospaced_font = 'freemono';
  128. * In tecnickcom/tcpdf/include/tcpdf_static, in function intToRoman, right at the beginning
  129. of the function, replace:
  130. $roman = '';
  131. with:
  132. $roman = '';
  133. if ($number >= 4000) {
  134. // do not represent numbers above 4000 in Roman numerals
  135. return strval($number);
  136. }
  137. TCPDI:
  138. ------
  139. Add file fpdf_tpl.php 1.2
  140. Add file tcpdi.php
  141. Add file tcpdi_parser.php and replace:
  142. require_once(dirname(__FILE__).'/include/tcpdf_filters.php');
  143. with:
  144. require_once(dirname(__FILE__).'/../tecnickcom/tcpdf/include/tcpdf_filters.php');
  145. * Fix syntax error by replacing
  146. } elseif (($key == '/Index') AND ($v[0] == PDF_TYPE_ARRAY AND count($v[1] >= 2))) {
  147. with
  148. } elseif (($key == '/Index') AND ($v[0] == PDF_TYPE_ARRAY AND count($v[1]) >= 2)) {
  149. * Fix php fatal error on php 8.0 on tcpdi.php
  150. while (list($k, $v) = each($value[1])) {
  151. with
  152. foreach ($value[1] as $k => $v) {
  153. * Fix by replacing
  154. if ($res[0] == PDF_TYPE_OBJECT)
  155. with
  156. if (isset($res[0]) && $res[0] == PDF_TYPE_OBJECT)
  157. JSGANTT:
  158. --------
  159. * Replace in function JSGantt.taskLink
  160. var OpenWindow=window.open(pRef, "newwin", "height="+vHeight+",width="+vWidth);
  161. with
  162. // LDR To open in same window
  163. //var OpenWindow=window.open(pRef, "newwin", "height="+vHeight+",width="+vWidth);
  164. window.location.href=pRef
  165. * Replace
  166. vTmpDiv=this.newNode(vTmpCell, 'div', null, null, vTaskList[i].getResource());
  167. with
  168. var vTmpNode=this.newNode(vTmpCell, 'div', null, '');
  169. vTmpNode=this.newNode(vTmpNode, 'a', null, '', vLangs[vLang]['moreinfo']);
  170. vTmpNode.setAttribute('href',vTaskList[i].getLink());
  171. * Replace '% Comp.' to have a smaller text column header
  172. 'comp':'% Comp.'
  173. with
  174. 'comp':'%'
  175. JCROP:
  176. ------
  177. * Remove analytics tag into file index.html
  178. JQUERYFILETREE:
  179. ---------------
  180. * Remove directory htdocs/includes/jquery/plugins/jqueryFileTree/connectors
  181. RESTLER:
  182. --------
  183. * Add line into Util.php to complete function
  184. public static function getShortName($className)
  185. {
  186. // @CHANGE LDR
  187. if (!is_string($className)) return;
  188. //var_dump($className);
  189. * Add line into Data/Text.php to complete function
  190. public static function endsWith($haystack, $needle)
  191. {
  192. $length = strlen($needle);
  193. if ($length == 0) {
  194. return true;
  195. }
  196. // @CHANGE LDR
  197. if (!is_string($haystack)) return false;
  198. * Replace
  199. $loaders = array_unique(static::$rogueLoaders);
  200. with
  201. $loaders = array_unique(static::$rogueLoaders, SORT_REGULAR);
  202. * Replace CommentParser.php line 423
  203. elseif (count($value) && is_numeric($value[0]))
  204. with
  205. elseif (count($value) && isset($value[0]) && is_numeric($value[0]))
  206. * Add CommentParser.php line 406 & 407 to remove a warning on api request in php 8.1
  207. empty($value[0]) ? null :
  208. empty($value[1]) ? null :
  209. +With swagger 2 provided into /explorer:
  210. ----------------------------------------
  211. Change content of file htdocs/includes/restler/framework/Luracast/Restler/explorer/index.html
  212. PARSEDOWN
  213. ---------
  214. * Add support of css by adding in Parsedown.php:
  215. // @CHANGE LDR
  216. 'class' => $Link['element']['attributes']['class']
  217. ...
  218. // @CHANGE LDR
  219. if (preg_match('/{([^}]+)}/', $remainder, $matches2))
  220. {
  221. $Element['attributes']['class'] = $matches2[1];
  222. $remainder = preg_replace('/{'.preg_quote($matches2[1],'/').'}/', '', $remainder);
  223. }
  224. // @CHANGE LDR
  225. //$markup .= $this->{$Element['handler']}($Element['text']);
  226. $markup .= preg_replace('/>{[^}]+}/', '>', $this->{$Element['handler']}($Element['text']));
  227. * Fix to avoid fatal error when mb_strlen not available:
  228. // @CHANGE LDR Fix when mb_strlen is not available
  229. //$shortage = 4 - mb_strlen($line, 'utf-8') % 4;
  230. if (function_exists('mb_strlen')) $len = mb_strlen($line, 'utf-8');
  231. else $len = strlen($line);
  232. $shortage = 4 - $len % 4;
  233. OAUTH
  234. -----
  235. Add into Class Google of file OAuth2/Service/Google:
  236. // 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"
  237. public $approvalPrompt='auto';
  238. public function setApprouvalPrompt($prompt)
  239. {
  240. if (!in_array($prompt, array('auto', 'force'), true)) {
  241. // @todo Maybe could we rename this exception
  242. throw new InvalidAccessTypeException('Invalid approuvalPrompt, expected either auto or force.');
  243. }
  244. $this->approvalPrompt = $prompt;
  245. }
  246. JEDITABLE.JS
  247. ------------
  248. * <button type="submit" /> => <button class="button" type="submit" />
  249. * <button type="cancel" /> => <button class="button" type="cancel" />
  250. SELECT2
  251. -------
  252. 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
  253. .select2-hidden-accessible {
  254. margin: -10000px !important; /* line to restore */
  255. }