dolibarr_changes.txt 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355
  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. JSGANTT:
  154. --------
  155. * Replace in function JSGantt.taskLink
  156. var OpenWindow=window.open(pRef, "newwin", "height="+vHeight+",width="+vWidth);
  157. with
  158. // LDR To open in same window
  159. //var OpenWindow=window.open(pRef, "newwin", "height="+vHeight+",width="+vWidth);
  160. window.location.href=pRef
  161. * Replace
  162. vTmpDiv=this.newNode(vTmpCell, 'div', null, null, vTaskList[i].getResource());
  163. with
  164. var vTmpNode=this.newNode(vTmpCell, 'div', null, '');
  165. vTmpNode=this.newNode(vTmpNode, 'a', null, '', vLangs[vLang]['moreinfo']);
  166. vTmpNode.setAttribute('href',vTaskList[i].getLink());
  167. * Replace '% Comp.' to have a smaller text column header
  168. 'comp':'% Comp.'
  169. with
  170. 'comp':'%'
  171. JCROP:
  172. ------
  173. * Remove analytics tag into file index.html
  174. JQUERYFILETREE:
  175. ---------------
  176. * Remove directory htdocs/includes/jquery/plugins/jqueryFileTree/connectors
  177. RESTLER:
  178. --------
  179. * Add line into Util.php to complete function
  180. public static function getShortName($className)
  181. {
  182. // @CHANGE LDR
  183. if (!is_string($className)) return;
  184. //var_dump($className);
  185. * Add line into Data/Text.php to complete function
  186. public static function endsWith($haystack, $needle)
  187. {
  188. $length = strlen($needle);
  189. if ($length == 0) {
  190. return true;
  191. }
  192. // @CHANGE LDR
  193. if (!is_string($haystack)) return false;
  194. * Replace
  195. $loaders = array_unique(static::$rogueLoaders);
  196. with
  197. $loaders = array_unique(static::$rogueLoaders, SORT_REGULAR);
  198. +With swagger 2 provided into /explorer:
  199. ----------------------------------------
  200. Change content of file htdocs/includes/restler/framework/Luracast/Restler/explorer/index.html
  201. PARSEDOWN
  202. ---------
  203. * Add support of css by adding in Parsedown.php:
  204. // @CHANGE LDR
  205. 'class' => $Link['element']['attributes']['class']
  206. ...
  207. // @CHANGE LDR
  208. if (preg_match('/{([^}]+)}/', $remainder, $matches2))
  209. {
  210. $Element['attributes']['class'] = $matches2[1];
  211. $remainder = preg_replace('/{'.preg_quote($matches2[1],'/').'}/', '', $remainder);
  212. }
  213. // @CHANGE LDR
  214. //$markup .= $this->{$Element['handler']}($Element['text']);
  215. $markup .= preg_replace('/>{[^}]+}/', '>', $this->{$Element['handler']}($Element['text']));
  216. * Fix to avoid fatal error when mb_strlen not available:
  217. // @CHANGE LDR Fix when mb_strlen is not available
  218. //$shortage = 4 - mb_strlen($line, 'utf-8') % 4;
  219. if (function_exists('mb_strlen')) $len = mb_strlen($line, 'utf-8');
  220. else $len = strlen($line);
  221. $shortage = 4 - $len % 4;
  222. OAUTH
  223. -----
  224. Add into Class Google of file OAuth2/Service/Google:
  225. // 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"
  226. public $approvalPrompt='auto';
  227. public function setApprouvalPrompt($prompt)
  228. {
  229. if (!in_array($prompt, array('auto', 'force'), true)) {
  230. // @todo Maybe could we rename this exception
  231. throw new InvalidAccessTypeException('Invalid approuvalPrompt, expected either auto or force.');
  232. }
  233. $this->approvalPrompt = $prompt;
  234. }
  235. JEDITABLE.JS
  236. ------------
  237. * <button type="submit" /> => <button class="button" type="submit" />
  238. * <button type="cancel" /> => <button class="button" type="cancel" />
  239. SELECT2
  240. -------
  241. 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
  242. .select2-hidden-accessible {
  243. margin: -10000px !important; /* line to restore */
  244. }