dolibarr_changes.txt 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312
  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. TCPDF:
  35. ------
  36. * Replace in tcpdf.php:
  37. if (isset($this->imagekeys)) {
  38. foreach($this->imagekeys as $file) {
  39. unlink($file);
  40. }
  41. }
  42. with
  43. if (isset($this->imagekeys)) {
  44. foreach($this->imagekeys as $file) {
  45. // DOL CHANGE If we keep this, source image files are physically destroyed
  46. // unlink($file);
  47. }
  48. }
  49. * Replace in tcpdf.php
  50. $preserve = array(
  51. 'file_id',
  52. 'internal_encoding',
  53. 'state',
  54. 'bufferlen',
  55. 'buffer',
  56. 'cached_files',
  57. with
  58. $preserve = array(
  59. 'file_id',
  60. 'internal_encoding',
  61. 'state',
  62. 'bufferlen',
  63. 'buffer',
  64. 'cached_files',
  65. // @CHANGE DOL
  66. 'imagekeys',
  67. * Replace in tcpdf.php
  68. if (!@TCPDF_STATIC::file_exists($file)) {
  69. return false;
  70. }
  71. with
  72. if (!@TCPDF_STATIC::file_exists($file)) {
  73. // DOL CHANGE If we keep this, the image is not visible on pages after the first one.
  74. //var_dump($file.' '.(!@TCPDF_STATIC::file_exists($file)));
  75. //return false;
  76. }
  77. * Replace in tcpdf.php
  78. if (($imgsrc[0] === '/') AND !empty($_SERVER['DOCUMENT_ROOT']) AND ($_SERVER['DOCUMENT_ROOT'] != '/')) {
  79. with
  80. // @CHANGE LDR Add support for src="file://..." links
  81. if (strpos($imgsrc, 'file://') === 0) {
  82. $imgsrc = str_replace('file://', '/', $imgsrc);
  83. $imgsrc = urldecode($imgsrc);
  84. $testscrtype = @parse_url($imgsrc);
  85. if (empty($testscrtype['query'])) {
  86. // convert URL to server path
  87. $imgsrc = str_replace(K_PATH_URL, K_PATH_MAIN, $imgsrc);
  88. } elseif (preg_match('|^https?://|', $imgsrc) !== 1) {
  89. // convert URL to server path
  90. $imgsrc = str_replace(K_PATH_MAIN, K_PATH_URL, $imgsrc);
  91. }
  92. }
  93. elseif (($imgsrc[0] === '/') AND !empty($_SERVER['DOCUMENT_ROOT']) AND ($_SERVER['DOCUMENT_ROOT'] != '/')) {
  94. * In tecnickcom/tcpdf/include/tcpdf_static, in function fopenLocal, replace
  95. if (strpos($filename, '://') === false) {
  96. with
  97. if (strpos($filename, '//') === 0)
  98. {
  99. // Share folder on a (windows) server
  100. // e.g.: "//[MyServerName]/[MySharedFolder]/"
  101. //
  102. // nothing to change
  103. }
  104. elseif (strpos($filename, '://') === false)
  105. * To avoid to have QRcode changed because generated with a random mask, replace
  106. define('QR_FIND_FROM_RANDOM', 2);
  107. with
  108. define('QR_FIND_FROM_RANDOM', false);
  109. * Removed useless directories ("examples", "tools")
  110. * Optionnaly, removed all fonts except
  111. dejavusans* (used by greek, arab, persan, romanian, turkish),
  112. freemono* (russian),
  113. cid*+msungstdlight+stsongstdlight+uni2cid* (chinese),
  114. helvetica* (all other languages),
  115. zapfdingbats.php (for special chars like form checkboxes)
  116. * Optionnaly, made freemono the default monotype font if we removed courier
  117. In htdocs/includes/tecnickcom/tcpdf/tcpdf.php
  118. - protected $default_monospaced_font = 'courier';
  119. + protected $default_monospaced_font = 'freemono';
  120. TCPDI:
  121. ------
  122. Add fpdf_tpl.php 1.2
  123. Add tcpdi.php
  124. Add tcpdi_parser.php and replace:
  125. require_once(dirname(__FILE__).'/include/tcpdf_filters.php');
  126. with:
  127. require_once(dirname(__FILE__).'/../tecnickcom/tcpdf/include/tcpdf_filters.php');
  128. * Fix by replacing
  129. } elseif (($key == '/Index') AND ($v[0] == PDF_TYPE_ARRAY AND count($v[1] >= 2))) {
  130. with
  131. } elseif (($key == '/Index') AND ($v[0] == PDF_TYPE_ARRAY AND count($v[1]) >= 2)) {
  132. JSGANTT:
  133. --------
  134. * Replace in function JSGantt.taskLink
  135. var OpenWindow=window.open(pRef, "newwin", "height="+vHeight+",width="+vWidth);
  136. with
  137. // LDR To open in same window
  138. //var OpenWindow=window.open(pRef, "newwin", "height="+vHeight+",width="+vWidth);
  139. window.location.href=pRef
  140. * Replace
  141. vTmpDiv=this.newNode(vTmpCell, 'div', null, null, vTaskList[i].getResource());
  142. with
  143. var vTmpNode=this.newNode(vTmpCell, 'div', null, '');
  144. vTmpNode=this.newNode(vTmpNode, 'a', null, '', vLangs[vLang]['moreinfo']);
  145. vTmpNode.setAttribute('href',vTaskList[i].getLink());
  146. * Replace '% Comp.' to have a smaller text column header
  147. 'comp':'% Comp.'
  148. with
  149. 'comp':'%'
  150. JCROP:
  151. ------
  152. * Remove analytics tag into file index.html
  153. JQUERYFILETREE:
  154. ---------------
  155. * Remove directory htdocs/includes/jquery/plugins/jqueryFileTree/connectors
  156. PHPEXCEL:
  157. ---------
  158. * Replace in htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/Shared/OLE.php
  159. continue;
  160. with:
  161. continue 2;
  162. RESTLER:
  163. --------
  164. Change content of file htdocs/includes/restler/framework/Luracast/Restler/explorer/index.html
  165. +With swagger 2:
  166. * Add line into Util.php to complete function
  167. public static function getShortName($className)
  168. {
  169. // @CHANGE LDR
  170. if (! is_string($className)) return;
  171. //var_dump($className);
  172. PARSEDOWN
  173. ---------
  174. * Add support of css by adding in Parsedown.php:
  175. // @CHANGE LDR
  176. 'class' => $Link['element']['attributes']['class']
  177. ...
  178. // @CHANGE LDR
  179. if (preg_match('/{([^}]+)}/', $remainder, $matches2))
  180. {
  181. $Element['attributes']['class'] = $matches2[1];
  182. $remainder = preg_replace('/{'.preg_quote($matches2[1],'/').'}/', '', $remainder);
  183. }
  184. // @CHANGE LDR
  185. //$markup .= $this->{$Element['handler']}($Element['text']);
  186. $markup .= preg_replace('/>{[^}]+}/', '>', $this->{$Element['handler']}($Element['text']));
  187. * Fix to avoid fatal error when mb_strlen not available:
  188. // @CHANGE LDR Fix when mb_strlen is not available
  189. //$shortage = 4 - mb_strlen($line, 'utf-8') % 4;
  190. if (function_exists('mb_strlen')) $len = mb_strlen($line, 'utf-8');
  191. else $len = strlen($line);
  192. $shortage = 4 - $len % 4;
  193. OAUTH
  194. -----
  195. Add into Class Google of file OAuth2/Service/Google:
  196. // 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"
  197. public $approvalPrompt='auto';
  198. public function setApprouvalPrompt($prompt)
  199. {
  200. if (!in_array($prompt, array('auto', 'force'), true)) {
  201. // @todo Maybe could we rename this exception
  202. throw new InvalidAccessTypeException('Invalid approuvalPrompt, expected either auto or force.');
  203. }
  204. $this->approvalPrompt = $prompt;
  205. }
  206. JEDITABLE.JS
  207. ------------
  208. * <button type="submit" /> => <button class="button" type="submit" />
  209. * <button type="cancel" /> => <button class="button" type="cancel" />
  210. SELECT2
  211. -------
  212. 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
  213. .select2-hidden-accessible {
  214. margin: -1px !important; /* line to restore */
  215. }