123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355 |
- This file describes changes made on external libraries after being included
- in Dolibarr root.
- ALL:
- ----
- Check "@CHANGE"
- PrestaShopWebservice:
- ---------------------
- Replace
- $params = array('filter', 'display', 'sort', 'limit', 'id_shop', 'id_group_shop');
- With
- $params = array('filter', 'display', 'sort', 'limit', 'id_shop', 'id_group_shop', 'date');
- CKEDITOR (4.6.2):
- -----------------
- * In ckeditor/ckeditor/contents.css
- Replace:
- body { ... margin: 20px;
- With
- body { ... margin: 5px;
- ESCPOS:
- -------
- Replace
- private $connector;
- With
- protected $connector;
- NUSOAP:
- -------
- * In file nusoap.php, to avoid a warning,
- Replace
- if (isset($this->methodreturn) && ((get_class($this->methodreturn) == 'soap_fault') || (get_class($this->methodreturn) == 'nusoap_fault'))) {
- By
- if (! is_array($this->methodreturn) && isset($this->methodreturn) && ((get_class($this->methodreturn) == 'soap_fault') || (get_class($this->methodreturn) == 'nusoap_fault'))) {
- * In file nusoap.php, to avoid a warning,
- Replace call to serialize_val with no bugged value
- * In all files, replace constructor names into __construct. Replace also parent::constructor_name with parent::__construct
- * Line 4222 of file nusoap.php
- $rev = array();
- preg_match('/\$Revision: ([^ ]+)/', $this->revision, $rev);
- $this->outgoing_headers[] = "X-SOAP-Server: $this->title/$this->version (".(isset($rev[1]) ? $rev[1] : '').")";
- TCPDF:
- ------
- * Replace in tcpdf.php:
- if (isset($this->imagekeys)) {
- foreach($this->imagekeys as $file) {
- unlink($file);
- }
- }
- with
- if (isset($this->imagekeys)) {
- foreach($this->imagekeys as $file) {
- // DOL CHANGE If we keep this, source image files are physically destroyed
- // unlink($file);
- }
- }
- * Replace in tcpdf.php
- $preserve = array(
- 'file_id',
- 'internal_encoding',
- 'state',
- 'bufferlen',
- 'buffer',
- 'cached_files',
- with
- $preserve = array(
- 'file_id',
- 'internal_encoding',
- 'state',
- 'bufferlen',
- 'buffer',
- 'cached_files',
- // @CHANGE DOL
- 'imagekeys',
- * Replace in tcpdf.php
- if (!@TCPDF_STATIC::file_exists($file)) {
- return false;
- }
- with
- if (!@TCPDF_STATIC::file_exists($file)) {
- // DOL CHANGE If we keep this, the image is not visible on pages after the first one.
- //var_dump($file.' '.(!@TCPDF_STATIC::file_exists($file)));
- //return false;
- $tfile = str_replace(' ', '%20', $file);
- if (@TCPDF_STATIC::file_exists($tfile)) {
- $file = $tfile;
- }
- }
-
- * Replace in tcpdf.php
- if (($imgsrc[0] === '/') AND !empty($_SERVER['DOCUMENT_ROOT']) AND ($_SERVER['DOCUMENT_ROOT'] != '/')) {
- with
- // @CHANGE LDR Add support for src="file://..." links
- if (strpos($imgsrc, 'file://') === 0) {
- $imgsrc = str_replace('file://', '/', $imgsrc);
- $imgsrc = urldecode($imgsrc);
- $testscrtype = @parse_url($imgsrc);
- if (empty($testscrtype['query'])) {
- // convert URL to server path
- $imgsrc = str_replace(K_PATH_URL, K_PATH_MAIN, $imgsrc);
- } elseif (preg_match('|^https?://|', $imgsrc) !== 1) {
- // convert URL to server path
- $imgsrc = str_replace(K_PATH_MAIN, K_PATH_URL, $imgsrc);
- }
- }
- elseif (($imgsrc[0] === '/') AND !empty($_SERVER['DOCUMENT_ROOT']) AND ($_SERVER['DOCUMENT_ROOT'] != '/')) {
- * In tecnickcom/tcpdf/include/tcpdf_static.php, in function fopenLocal, replace
- if (strpos($filename, '://') === false) {
- with
- if (strpos($filename, '//') === 0) {
- // Share folder on a (windows) server
- // e.g.: "//[MyServerName]/[MySharedFolder]/"
- //
- // nothing to change
- }
- elseif (strpos($filename, '://') === false)
- * To avoid to have QRcode changed because generated with a random mask, replace
- define('QR_FIND_FROM_RANDOM', 2);
- with
- define('QR_FIND_FROM_RANDOM', false);
- * Removed useless directories ("examples", "tools")
- * Optionnaly, removed all fonts except
- dejavusans* (used by greek, arab, persan, romanian, turkish),
- freemono* (russian),
- cid*+msungstdlight+stsongstdlight+uni2cid* (chinese),
- helvetica* (all other languages),
- zapfdingbats.php (for special chars like form checkboxes)
- * Optionnaly, made freemono the default monotype font if we removed courier
- In htdocs/includes/tecnickcom/tcpdf/tcpdf.php
- - protected $default_monospaced_font = 'courier';
- + protected $default_monospaced_font = 'freemono';
- * In tecnickcom/tcpdf/include/tcpdf_static, in function intToRoman, right at the beginning
- of the function, replace:
- $roman = '';
- with:
- $roman = '';
- if ($number >= 4000) {
- // do not represent numbers above 4000 in Roman numerals
- return strval($number);
- }
- TCPDI:
- ------
- Add file fpdf_tpl.php 1.2
- Add file tcpdi.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');
- * 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)) {
- * Fix php fatal error on php 8.0 on tcpdi.php
- while (list($k, $v) = each($value[1])) {
- with
- foreach ($value[1] as $k => $v) {
- JSGANTT:
- --------
- * Replace in function JSGantt.taskLink
- 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
- * Replace
- 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());
-
- * Replace '% Comp.' to have a smaller text column header
- 'comp':'% Comp.'
- with
- 'comp':'%'
- JCROP:
- ------
- * Remove analytics tag into file index.html
- JQUERYFILETREE:
- ---------------
- * Remove directory htdocs/includes/jquery/plugins/jqueryFileTree/connectors
- RESTLER:
- --------
- * Add line into Util.php to complete function
- public static function getShortName($className)
- {
- // @CHANGE LDR
- if (!is_string($className)) return;
- //var_dump($className);
- * Add line into Data/Text.php to complete function
- public static function endsWith($haystack, $needle)
- {
- $length = strlen($needle);
- if ($length == 0) {
- return true;
- }
- // @CHANGE LDR
- if (!is_string($haystack)) return false;
- * Replace
- $loaders = array_unique(static::$rogueLoaders);
-
- with
-
- $loaders = array_unique(static::$rogueLoaders, SORT_REGULAR);
- +With swagger 2 provided into /explorer:
- ----------------------------------------
- Change content of file htdocs/includes/restler/framework/Luracast/Restler/explorer/index.html
- PARSEDOWN
- ---------
- * Add support of css by adding in Parsedown.php:
- // @CHANGE LDR
- 'class' => $Link['element']['attributes']['class']
- ...
-
- // @CHANGE LDR
- if (preg_match('/{([^}]+)}/', $remainder, $matches2))
- {
- $Element['attributes']['class'] = $matches2[1];
- $remainder = preg_replace('/{'.preg_quote($matches2[1],'/').'}/', '', $remainder);
- }
- // @CHANGE LDR
- //$markup .= $this->{$Element['handler']}($Element['text']);
- $markup .= preg_replace('/>{[^}]+}/', '>', $this->{$Element['handler']}($Element['text']));
- * Fix to avoid fatal error when mb_strlen not available:
- // @CHANGE LDR Fix when mb_strlen is not available
- //$shortage = 4 - mb_strlen($line, 'utf-8') % 4;
- if (function_exists('mb_strlen')) $len = mb_strlen($line, 'utf-8');
- else $len = strlen($line);
- $shortage = 4 - $len % 4;
- OAUTH
- -----
- Add into Class Google of file OAuth2/Service/Google:
- // 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"
- public $approvalPrompt='auto';
- public function setApprouvalPrompt($prompt)
- {
- if (!in_array($prompt, array('auto', 'force'), true)) {
- // @todo Maybe could we rename this exception
- throw new InvalidAccessTypeException('Invalid approuvalPrompt, expected either auto or force.');
- }
- $this->approvalPrompt = $prompt;
- }
-
- JEDITABLE.JS
- ------------
- * <button type="submit" /> => <button class="button" type="submit" />
- * <button type="cancel" /> => <button class="button" type="cancel" />
- SELECT2
- -------
- 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
- .select2-hidden-accessible {
- margin: -10000px !important; /* line to restore */
- }
|