Merge branch 'develop' into dev_change_notetaskivoice

This commit is contained in:
HENRY Florian 2023-09-10 17:26:17 +02:00 committed by GitHub
commit 90203cf346
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 75 additions and 28 deletions

View file

@ -627,11 +627,11 @@ if ($nboftargetok) {
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/sabre/sabre/*/tests`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/stripe/tests`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/stripe/LICENSE`;
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/examples`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/fonts/dejavu-fonts-ttf-*`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/fonts/freefont-*`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/fonts/ae_fonts_*`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/fonts/utils`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/examples`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/tools`;
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/vendor`;
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/webmozart`;

View file

@ -185,6 +185,23 @@ with:
return strval($number);
}
* Add this at begin of tcpdf_autoconfig.php
// @CHANGE LDR DOCUMENT_ROOT fix for IIS Webserver
if ((!isset($_SERVER['DOCUMENT_ROOT'])) OR (empty($_SERVER['DOCUMENT_ROOT']))) {
if (isset($_SERVER['SCRIPT_FILENAME']) && isset($_SERVER['PHP_SELF'])) {
$_SERVER['DOCUMENT_ROOT'] = str_replace( '\\', '/', substr($_SERVER['SCRIPT_FILENAME'], 0, 0-strlen($_SERVER['PHP_SELF'])));
} elseif(isset($_SERVER['PATH_TRANSLATED'])) {
$_SERVER['DOCUMENT_ROOT'] = str_replace( '\\', '/', substr(str_replace('\\\\', '\\', $_SERVER['PATH_TRANSLATED']), 0, 0-strlen($_SERVER['PHP_SELF'])));
} else {
// define here your DOCUMENT_ROOT path if the previous fails (e.g. '/var/www')
$_SERVER['DOCUMENT_ROOT'] = '/';
}
}
$_SERVER['DOCUMENT_ROOT'] = str_replace('//', '/', $_SERVER['DOCUMENT_ROOT']);
if (substr($_SERVER['DOCUMENT_ROOT'], -1) != '/') {
$_SERVER['DOCUMENT_ROOT'] .= '/';
}
TCPDI:

View file

@ -1733,4 +1733,51 @@ abstract class CommonDocGenerator
return 1;
}
/**
* Define Array Column Field into $this->cols
* This method must be implemented by the module that generate the document with its own columns.
*
* @param Object $object Common object
* @param Translate $outputlangs Langs
* @param int $hidedetails Do not show line details
* @param int $hidedesc Do not show desc
* @param int $hideref Do not show ref
* @return void
*/
public function defineColumnField($object, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0)
{
// Default field style for content
$this->defaultContentsFieldsStyle = array(
'align' => 'R', // R,C,L
'padding' => array(1, 0.5, 1, 0.5), // Like css 0 => top , 1 => right, 2 => bottom, 3 => left
);
// Default field style for content
$this->defaultTitlesFieldsStyle = array(
'align' => 'C', // R,C,L
'padding' => array(0.5, 0, 0.5, 0), // Like css 0 => top , 1 => right, 2 => bottom, 3 => left
);
// Example
/*
$rank = 0; // do not use negative rank
$this->cols['desc'] = array(
'rank' => $rank,
'width' => false, // only for desc
'status' => true,
'title' => array(
'textkey' => 'Designation', // use lang key is usefull in somme case with module
'align' => 'L',
// 'textkey' => 'yourLangKey', // if there is no label, yourLangKey will be translated to replace label
// 'label' => ' ', // the final label
'padding' => array(0.5, 0.5, 0.5, 0.5), // Like css 0 => top , 1 => right, 2 => bottom, 3 => left
),
'content' => array(
'align' => 'L',
'padding' => array(1, 0.5, 1, 1.5), // Like css 0 => top , 1 => right, 2 => bottom, 3 => left
),
);
*/
}
}

View file

@ -9362,7 +9362,7 @@ function dol_eval($s, $returnvalue = 0, $hideerrors = 1, $onlysimplestring = '1'
} catch (Error $e) {
$error = 'dol_eval try/catch error : ';
$error .= $e->getMessage();
dol_syslog($error);
dol_syslog($error, LOG_WARNING);
}
}

View file

@ -1446,7 +1446,7 @@ class pdf_zenith extends ModelePDFSupplierProposal
/**
* Define Array Column Field
*
* @param object $object common object
* @param Object $object common object
* @param Translate $outputlangs langs
* @param int $hidedetails Do not show line details
* @param int $hidedesc Do not show desc
@ -1469,24 +1469,6 @@ class pdf_zenith extends ModelePDFSupplierProposal
'padding' => array(0.5, 0, 0.5, 0), // Like css 0 => top , 1 => right, 2 => bottom, 3 => left
);
/*
* For exemple
$this->cols['theColKey'] = array(
'rank' => $rank, // int : use for ordering columns
'width' => 20, // the column width in mm
'title' => array(
'textkey' => 'yourLangKey', // if there is no label, yourLangKey will be translated to replace label
'label' => ' ', // the final label : used fore final generated text
'align' => 'L', // text alignement : R,C,L
'padding' => array(0.5,0.5,0.5,0.5), // Like css 0 => top , 1 => right, 2 => bottom, 3 => left
),
'content' => array(
'align' => 'L', // text alignement : R,C,L
'padding' => array(0.5,0.5,0.5,0.5), // Like css 0 => top , 1 => right, 2 => bottom, 3 => left
),
);
*/
$rank = 0; // do not use negative rank
$this->cols['desc'] = array(
'rank' => $rank,

View file

@ -40,11 +40,11 @@
* @version 1.1.1
*/
// DOCUMENT_ROOT fix for IIS Webserver
// @CHANGE LDR DOCUMENT_ROOT fix for IIS Webserver
if ((!isset($_SERVER['DOCUMENT_ROOT'])) OR (empty($_SERVER['DOCUMENT_ROOT']))) {
if(isset($_SERVER['SCRIPT_FILENAME'])) {
if (isset($_SERVER['SCRIPT_FILENAME']) && isset($_SERVER['PHP_SELF'])) {
$_SERVER['DOCUMENT_ROOT'] = str_replace( '\\', '/', substr($_SERVER['SCRIPT_FILENAME'], 0, 0-strlen($_SERVER['PHP_SELF'])));
} elseif(isset($_SERVER['PATH_TRANSLATED'])) {
} elseif (isset($_SERVER['PATH_TRANSLATED']) && isset($_SERVER['PHP_SELF'])) {
$_SERVER['DOCUMENT_ROOT'] = str_replace( '\\', '/', substr(str_replace('\\\\', '\\', $_SERVER['PATH_TRANSLATED']), 0, 0-strlen($_SERVER['PHP_SELF'])));
} else {
// define here your DOCUMENT_ROOT path if the previous fails (e.g. '/var/www')

View file

@ -1117,12 +1117,12 @@ class FunctionsLibTest extends PHPUnit\Framework\TestCase
{
$s=img_picto('title', 'user');
print __METHOD__." s=".$s."\n";
$this->assertContains('fa-user', $s, 'testImgPicto1');
$this->assertStringContainsStringIgnoringCase('fa-user', $s, 'testImgPicto1');
$s=img_picto('title', 'img.png', 'style="float: right"', 0);
print __METHOD__." s=".$s."\n";
$this->assertContains('theme', $s, 'testImgPicto2');
$this->assertContains('style="float: right"', $s, 'testImgPicto2');
$this->assertStringContainsStringIgnoringCase('theme', $s, 'testImgPicto2');
$this->assertStringContainsStringIgnoringCase('style="float: right"', $s, 'testImgPicto2');
$s=img_picto('title', '/fullpath/img.png', '', 1);
print __METHOD__." s=".$s."\n";

View file

@ -1031,7 +1031,8 @@ class SecurityTest extends PHPUnit\Framework\TestCase
print "result18 = ".$result."\n";
$this->assertFalse($result);
$result = (string) dol_eval("(\$a.'aa')", 1, 0);
$a='ab';
$result = (string) dol_eval("(\$a.'s')", 1, 0);
print "result19 = ".$result."\n";
$this->assertStringContainsString('Bad string syntax to evaluate', $result);