@@ -29,32 +29,32 @@ discard block |
||
29 | 29 | //define('TEST_DB_FORCE_TYPE','mysql'); // This is to force using mysql driver |
30 | 30 | //require_once 'PHPUnit/Autoload.php'; |
31 | 31 | |
32 | -if (! defined('NOREQUIRESOC')) { |
|
32 | +if (!defined('NOREQUIRESOC')) { |
|
33 | 33 | define('NOREQUIRESOC', '1'); |
34 | 34 | } |
35 | -if (! defined('NOCSRFCHECK')) { |
|
35 | +if (!defined('NOCSRFCHECK')) { |
|
36 | 36 | define('NOCSRFCHECK', '1'); |
37 | 37 | } |
38 | -if (! defined('NOTOKENRENEWAL')) { |
|
38 | +if (!defined('NOTOKENRENEWAL')) { |
|
39 | 39 | define('NOTOKENRENEWAL', '1'); |
40 | 40 | } |
41 | -if (! defined('NOREQUIREMENU')) { |
|
41 | +if (!defined('NOREQUIREMENU')) { |
|
42 | 42 | define('NOREQUIREMENU', '1'); // If there is no menu to show |
43 | 43 | } |
44 | -if (! defined('NOREQUIREHTML')) { |
|
44 | +if (!defined('NOREQUIREHTML')) { |
|
45 | 45 | define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php |
46 | 46 | } |
47 | -if (! defined('NOREQUIREAJAX')) { |
|
47 | +if (!defined('NOREQUIREAJAX')) { |
|
48 | 48 | define('NOREQUIREAJAX', '1'); |
49 | 49 | } |
50 | -if (! defined("NOLOGIN")) { |
|
51 | - define("NOLOGIN", '1'); // If this page is public (can be called outside logged session) |
|
50 | +if (!defined("NOLOGIN")) { |
|
51 | + define("NOLOGIN", '1'); // If this page is public (can be called outside logged session) |
|
52 | 52 | } |
53 | -if (! defined("NOSESSION")) { |
|
53 | +if (!defined("NOSESSION")) { |
|
54 | 54 | define("NOSESSION", '1'); |
55 | 55 | } |
56 | 56 | |
57 | -require_once dirname(__FILE__).'/../../htdocs/main.inc.php'; // We force include of main.inc.php instead of master.inc.php even if we are in CLI mode because it contains a lot of security components we want to test. |
|
57 | +require_once dirname(__FILE__).'/../../htdocs/main.inc.php'; // We force include of main.inc.php instead of master.inc.php even if we are in CLI mode because it contains a lot of security components we want to test. |
|
58 | 58 | require_once dirname(__FILE__).'/../../htdocs/core/lib/security.lib.php'; |
59 | 59 | require_once dirname(__FILE__).'/../../htdocs/core/lib/security2.lib.php'; |
60 | 60 | require_once dirname(__FILE__).'/CommonClassTest.class.php'; |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | |
69 | 69 | |
70 | 70 | print "PHP Version: ".phpversion()."\n"; |
71 | -print "Memory limit: ". ini_get('memory_limit')."\n"; |
|
71 | +print "Memory limit: ".ini_get('memory_limit')."\n"; |
|
72 | 72 | |
73 | 73 | |
74 | 74 | /** |
@@ -206,11 +206,11 @@ discard block |
||
206 | 206 | $result = testSqlAndScriptInject($test, 0); |
207 | 207 | $this->assertGreaterThanOrEqual($expectedresult, $result, 'Error on testSqlAndScriptInject bbb'); |
208 | 208 | |
209 | - $test='<marquee onbeforeintput="alert(1)">'; |
|
210 | - $result=testSqlAndScriptInject($test, 0); |
|
209 | + $test = '<marquee onbeforeintput="alert(1)">'; |
|
210 | + $result = testSqlAndScriptInject($test, 0); |
|
211 | 211 | $this->assertGreaterThanOrEqual($expectedresult, $result, 'Error on testSqlAndScriptInject onbeforeintput'); |
212 | - $test='<marquee onbounce="alert(1)">'; |
|
213 | - $result=testSqlAndScriptInject($test, 0); |
|
212 | + $test = '<marquee onbounce="alert(1)">'; |
|
213 | + $result = testSqlAndScriptInject($test, 0); |
|
214 | 214 | $this->assertGreaterThanOrEqual($expectedresult, $result, 'Error on testSqlAndScriptInject onbounce'); |
215 | 215 | |
216 | 216 | $test = '<SCRIPT SRC=http://xss.rocks/xss.js></SCRIPT>'; |
@@ -239,8 +239,8 @@ discard block |
||
239 | 239 | $result = testSqlAndScriptInject($test, 0); |
240 | 240 | $this->assertGreaterThanOrEqual($expectedresult, $result, 'Error on testSqlAndScriptInject eee'); |
241 | 241 | |
242 | - $test = "<IMG SRC=\"jav\tascript:alert('XSS');\">"; // Is locked by some browser like chrome because the default directive no-referrer-when-downgrade is sent when requesting the SRC and then refused because of browser protection on img src load without referrer. |
|
243 | - $test = "<IMG SRC=\"jav
ascript:alert('XSS');\">"; // Same |
|
242 | + $test = "<IMG SRC=\"jav\tascript:alert('XSS');\">"; // Is locked by some browser like chrome because the default directive no-referrer-when-downgrade is sent when requesting the SRC and then refused because of browser protection on img src load without referrer. |
|
243 | + $test = "<IMG SRC=\"jav
ascript:alert('XSS');\">"; // Same |
|
244 | 244 | |
245 | 245 | $test = '<SCRIPT/XSS SRC="http://xss.rocks/xss.js"></SCRIPT>'; |
246 | 246 | $result = testSqlAndScriptInject($test, 0); |
@@ -274,21 +274,21 @@ discard block |
||
274 | 274 | $result = testSqlAndScriptInject($test, 0); |
275 | 275 | $this->assertGreaterThanOrEqual($expectedresult, $result, 'Error on testSqlAndScriptInject lll'); |
276 | 276 | |
277 | - $test = '<a onscrollend=alert(1) style="display:block;overflow:auto;border:1px+dashed;width:500px;height:100px;"><br><br><br><br><br><span+id=x>test</span></a>'; // Add the char %F6 into the variable |
|
277 | + $test = '<a onscrollend=alert(1) style="display:block;overflow:auto;border:1px+dashed;width:500px;height:100px;"><br><br><br><br><br><span+id=x>test</span></a>'; // Add the char %F6 into the variable |
|
278 | 278 | $result = testSqlAndScriptInject($test, 0); |
279 | 279 | //print "test=".$test." result=".$result."\n"; |
280 | 280 | $this->assertGreaterThanOrEqual($expectedresult, $result, 'Error on testSqlAndScriptInject mmm'); |
281 | 281 | |
282 | 282 | |
283 | 283 | $test = "Text with ' encoded with the numeric html entity converted into text entity ' (like when submitted by CKEditor)"; |
284 | - $result = testSqlAndScriptInject($test, 0); // result must be 0 |
|
284 | + $result = testSqlAndScriptInject($test, 0); // result must be 0 |
|
285 | 285 | $this->assertEquals(0, $result, 'Error on testSqlAndScriptInject mmm, result should be 0 and is not'); |
286 | 286 | |
287 | 287 | $test = '<a href="j	a	v	asc
ri	pt:(a	l	e	r	t	(document.cookie))">XSS</a>'; |
288 | 288 | $result = testSqlAndScriptInject($test, 0); |
289 | 289 | $this->assertGreaterThanOrEqual($expectedresult, $result, 'Error on testSqlAndScriptInject nnn, result should be >= 1 and is not'); |
290 | 290 | |
291 | - $test = "/dolibarr/htdocs/index.php/".chr('246')."abc"; // Add the char %F6 into the variable |
|
291 | + $test = "/dolibarr/htdocs/index.php/".chr('246')."abc"; // Add the char %F6 into the variable |
|
292 | 292 | $result = testSqlAndScriptInject($test, 2); |
293 | 293 | //print "test=".$test." result=".$result."\n"; |
294 | 294 | $this->assertGreaterThanOrEqual($expectedresult, $result, 'Error on testSqlAndScriptInject with a non valid UTF8 char'); |
@@ -400,21 +400,21 @@ discard block |
||
400 | 400 | { |
401 | 401 | global $conf; |
402 | 402 | |
403 | - $genpass1 = getRandomPassword(true); // Should be a string return by dol_hash (if no option set, will be md5) |
|
403 | + $genpass1 = getRandomPassword(true); // Should be a string return by dol_hash (if no option set, will be md5) |
|
404 | 404 | print __METHOD__." genpass1=".$genpass1."\n"; |
405 | 405 | $this->assertEquals(strlen($genpass1), 32); |
406 | 406 | |
407 | - $genpass1 = getRandomPassword(true, array('I')); // Should be a string return by dol_hash (if no option set, will be md5) |
|
407 | + $genpass1 = getRandomPassword(true, array('I')); // Should be a string return by dol_hash (if no option set, will be md5) |
|
408 | 408 | print __METHOD__." genpass1=".$genpass1."\n"; |
409 | 409 | $this->assertEquals(strlen($genpass1), 32); |
410 | 410 | |
411 | 411 | $conf->global->USER_PASSWORD_GENERATED = 'None'; |
412 | - $genpass2 = getRandomPassword(false); // Should return an empty string |
|
412 | + $genpass2 = getRandomPassword(false); // Should return an empty string |
|
413 | 413 | print __METHOD__." genpass2=".$genpass2."\n"; |
414 | 414 | $this->assertEquals($genpass2, ''); |
415 | 415 | |
416 | 416 | $conf->global->USER_PASSWORD_GENERATED = 'Standard'; |
417 | - $genpass3 = getRandomPassword(false); // Should return a password of 12 chars |
|
417 | + $genpass3 = getRandomPassword(false); // Should return a password of 12 chars |
|
418 | 418 | print __METHOD__." genpass3=".$genpass3."\n"; |
419 | 419 | $this->assertEquals(strlen($genpass3), 12); |
420 | 420 | |
@@ -428,7 +428,7 @@ discard block |
||
428 | 428 | */ |
429 | 429 | public function testRestrictedArea() |
430 | 430 | { |
431 | - global $conf,$user,$langs,$db; |
|
431 | + global $conf, $user, $langs, $db; |
|
432 | 432 | $conf = $this->savconf; |
433 | 433 | $user = $this->savuser; |
434 | 434 | $langs = $this->savlangs; |
@@ -459,40 +459,40 @@ discard block |
||
459 | 459 | $tmpvar = preg_match('/not supported/', $tmp['curl_error_msg']); |
460 | 460 | $this->assertEquals(1, $tmpvar, "Did not find the /not supported/ in getURLContent error message. We should."); |
461 | 461 | |
462 | - $url = 'https://www.dolibarr.fr'; // This is a redirect 301 page |
|
463 | - $tmp = getURLContent($url, 'GET', '', 0); // We do NOT follow |
|
462 | + $url = 'https://www.dolibarr.fr'; // This is a redirect 301 page |
|
463 | + $tmp = getURLContent($url, 'GET', '', 0); // We do NOT follow |
|
464 | 464 | print __METHOD__." url=".$url."\n"; |
465 | 465 | $this->assertEquals(301, (empty($tmp['http_code']) ? 0 : $tmp['http_code']), 'Should GET url 301 response'); |
466 | 466 | |
467 | - $url = 'https://www.dolibarr.fr'; // This is a redirect 301 page |
|
468 | - $tmp = getURLContent($url); // We DO follow a page with return 300 so result should be 200 |
|
467 | + $url = 'https://www.dolibarr.fr'; // This is a redirect 301 page |
|
468 | + $tmp = getURLContent($url); // We DO follow a page with return 300 so result should be 200 |
|
469 | 469 | print __METHOD__." url=".$url."\n"; |
470 | 470 | $this->assertEquals(200, (empty($tmp['http_code']) ? 0 : $tmp['http_code']), 'Should GET url 301 with a follow -> 200 but we get '.(empty($tmp['http_code']) ? 0 : $tmp['http_code'])); |
471 | 471 | |
472 | 472 | $url = 'http://localhost'; |
473 | - $tmp = getURLContent($url, 'GET', '', 0, array(), array('http', 'https'), 0); // Only external URL |
|
473 | + $tmp = getURLContent($url, 'GET', '', 0, array(), array('http', 'https'), 0); // Only external URL |
|
474 | 474 | print __METHOD__." url=".$url."\n"; |
475 | - $this->assertEquals(400, (empty($tmp['http_code']) ? 0 : $tmp['http_code']), 'Should GET url to '.$url.' that resolves to a local URL'); // Test we receive an error because localtest.me is not an external URL |
|
475 | + $this->assertEquals(400, (empty($tmp['http_code']) ? 0 : $tmp['http_code']), 'Should GET url to '.$url.' that resolves to a local URL'); // Test we receive an error because localtest.me is not an external URL |
|
476 | 476 | |
477 | 477 | $url = 'http://127.0.0.1'; |
478 | - $tmp = getURLContent($url, 'GET', '', 0, array(), array('http', 'https'), 0); // Only external URL |
|
478 | + $tmp = getURLContent($url, 'GET', '', 0, array(), array('http', 'https'), 0); // Only external URL |
|
479 | 479 | print __METHOD__." url=".$url."\n"; |
480 | - $this->assertEquals(400, (empty($tmp['http_code']) ? 0 : $tmp['http_code']), 'Should GET url to '.$url.' that is a local URL'); // Test we receive an error because 127.0.0.1 is not an external URL |
|
480 | + $this->assertEquals(400, (empty($tmp['http_code']) ? 0 : $tmp['http_code']), 'Should GET url to '.$url.' that is a local URL'); // Test we receive an error because 127.0.0.1 is not an external URL |
|
481 | 481 | |
482 | 482 | $url = 'http://127.0.2.1'; |
483 | - $tmp = getURLContent($url, 'GET', '', 0, array(), array('http', 'https'), 0); // Only external URL |
|
483 | + $tmp = getURLContent($url, 'GET', '', 0, array(), array('http', 'https'), 0); // Only external URL |
|
484 | 484 | print __METHOD__." url=".$url."\n"; |
485 | - $this->assertEquals(400, (empty($tmp['http_code']) ? 0 : $tmp['http_code']), 'Should GET url to '.$url.' that is a local URL'); // Test we receive an error because 127.0.2.1 is not an external URL |
|
485 | + $this->assertEquals(400, (empty($tmp['http_code']) ? 0 : $tmp['http_code']), 'Should GET url to '.$url.' that is a local URL'); // Test we receive an error because 127.0.2.1 is not an external URL |
|
486 | 486 | |
487 | 487 | $url = 'https://169.254.0.1'; |
488 | - $tmp = getURLContent($url, 'GET', '', 0, array(), array('http', 'https'), 0); // Only external URL |
|
488 | + $tmp = getURLContent($url, 'GET', '', 0, array(), array('http', 'https'), 0); // Only external URL |
|
489 | 489 | print __METHOD__." url=".$url."\n"; |
490 | - $this->assertEquals(400, (empty($tmp['http_code']) ? 0 : $tmp['http_code']), 'Should GET url to '.$url.' that is a local URL'); // Test we receive an error because 169.254.0.1 is not an external URL |
|
490 | + $this->assertEquals(400, (empty($tmp['http_code']) ? 0 : $tmp['http_code']), 'Should GET url to '.$url.' that is a local URL'); // Test we receive an error because 169.254.0.1 is not an external URL |
|
491 | 491 | |
492 | 492 | $url = 'http://[::1]'; |
493 | - $tmp = getURLContent($url, 'GET', '', 0, array(), array('http', 'https'), 0); // Only external URL |
|
493 | + $tmp = getURLContent($url, 'GET', '', 0, array(), array('http', 'https'), 0); // Only external URL |
|
494 | 494 | print __METHOD__." url=".$url."\n"; |
495 | - $this->assertEquals(400, (empty($tmp['http_code']) ? 0 : $tmp['http_code']), 'Should GET url to '.$url.' that is a local URL'); // Test we receive an error because [::1] is not an external URL |
|
495 | + $this->assertEquals(400, (empty($tmp['http_code']) ? 0 : $tmp['http_code']), 'Should GET url to '.$url.' that is a local URL'); // Test we receive an error because [::1] is not an external URL |
|
496 | 496 | |
497 | 497 | /*$url = 'localtest.me'; |
498 | 498 | $tmp = getURLContent($url, 'GET', '', 0, array(), array('http', 'https'), 0); // Only external URL |
@@ -501,9 +501,9 @@ discard block |
||
501 | 501 | */ |
502 | 502 | |
503 | 503 | $url = 'http://192.0.0.192'; |
504 | - $tmp = getURLContent($url, 'GET', '', 0, array(), array('http', 'https'), 0); // Only external URL but on an IP in blacklist |
|
504 | + $tmp = getURLContent($url, 'GET', '', 0, array(), array('http', 'https'), 0); // Only external URL but on an IP in blacklist |
|
505 | 505 | print __METHOD__." url=".$url." tmp['http_code'] = ".(empty($tmp['http_code']) ? 0 : $tmp['http_code'])."\n"; |
506 | - $this->assertEquals(400, (empty($tmp['http_code']) ? 0 : $tmp['http_code']), 'Access should be refused and was not'); // Test we receive an error because ip is in blacklist |
|
506 | + $this->assertEquals(400, (empty($tmp['http_code']) ? 0 : $tmp['http_code']), 'Access should be refused and was not'); // Test we receive an error because ip is in blacklist |
|
507 | 507 | |
508 | 508 | return 0; |
509 | 509 | } |
@@ -515,7 +515,7 @@ discard block |
||
515 | 515 | */ |
516 | 516 | public function testDolSanitizeUrl() |
517 | 517 | { |
518 | - global $conf,$user,$langs,$db; |
|
518 | + global $conf, $user, $langs, $db; |
|
519 | 519 | $conf = $this->savconf; |
520 | 520 | $user = $this->savuser; |
521 | 521 | $langs = $this->savlangs; |
@@ -541,7 +541,7 @@ discard block |
||
541 | 541 | */ |
542 | 542 | public function testDolSanitizeEmail() |
543 | 543 | { |
544 | - global $conf,$user,$langs,$db; |
|
544 | + global $conf, $user, $langs, $db; |
|
545 | 545 | $conf = $this->savconf; |
546 | 546 | $user = $this->savuser; |
547 | 547 | $langs = $this->savlangs; |
@@ -571,7 +571,7 @@ discard block |
||
571 | 571 | */ |
572 | 572 | public function testDolSanitizeFileName() |
573 | 573 | { |
574 | - global $conf,$user,$langs,$db; |
|
574 | + global $conf, $user, $langs, $db; |
|
575 | 575 | $conf = $this->savconf; |
576 | 576 | $user = $this->savuser; |
577 | 577 | $langs = $this->savlangs; |
@@ -594,7 +594,7 @@ discard block |
||
594 | 594 | */ |
595 | 595 | public function testDolEval() |
596 | 596 | { |
597 | - global $conf,$user,$langs,$db; |
|
597 | + global $conf, $user, $langs, $db; |
|
598 | 598 | $conf = $this->savconf; |
599 | 599 | $user = $this->savuser; |
600 | 600 | $langs = $this->savlangs; |
@@ -604,7 +604,7 @@ discard block |
||
604 | 604 | include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; |
605 | 605 | include_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php'; |
606 | 606 | |
607 | - $result = dol_eval('1==\x01', 1, 0); // Check that we can't make dol_eval on string containing \ char. |
|
607 | + $result = dol_eval('1==\x01', 1, 0); // Check that we can't make dol_eval on string containing \ char. |
|
608 | 608 | print "result0 = ".$result."\n"; |
609 | 609 | $this->assertStringContainsString('Bad string syntax to evaluate', $result); |
610 | 610 | |
@@ -651,12 +651,12 @@ discard block |
||
651 | 651 | // Now string not allowed |
652 | 652 | |
653 | 653 | $s = '4 <5'; |
654 | - $result = (string) dol_eval($s, 1, 1, '2'); // in mode 2, char < is allowed only if followed by a space |
|
654 | + $result = (string) dol_eval($s, 1, 1, '2'); // in mode 2, char < is allowed only if followed by a space |
|
655 | 655 | print "result = ".$result."\n"; |
656 | 656 | $this->assertStringContainsString('Bad string syntax to evaluate', $result, 'Test 4 <5 - The string was not detected as evil'); |
657 | 657 | |
658 | 658 | $s = '4 < 5'; |
659 | - $result = (string) dol_eval($s, 1, 1, '1'); // in mode 1, char < is always forbidden |
|
659 | + $result = (string) dol_eval($s, 1, 1, '1'); // in mode 1, char < is always forbidden |
|
660 | 660 | print "result = ".$result."\n"; |
661 | 661 | $this->assertStringContainsString('Bad string syntax to evaluate', $result, 'Test 4 < 5 - The string was not detected as evil'); |
662 | 662 | |
@@ -670,7 +670,7 @@ discard block |
||
670 | 670 | print "result = ".$result."\n"; |
671 | 671 | $this->assertStringContainsString('Bad string syntax to evaluate', $result, 'The string was not detected as evil'); |
672 | 672 | |
673 | - $result = dol_eval('$a=function() { }; $a', 1, 1, '0'); // result of dol_eval may be an object Closure |
|
673 | + $result = dol_eval('$a=function() { }; $a', 1, 1, '0'); // result of dol_eval may be an object Closure |
|
674 | 674 | print "result5 = ".json_encode($result)."\n"; |
675 | 675 | $this->assertStringContainsString('Bad string syntax to evaluate', json_encode($result), 'The string was not detected as evil'); |
676 | 676 | |
@@ -712,7 +712,7 @@ discard block |
||
712 | 712 | |
713 | 713 | // Must be allowed |
714 | 714 | |
715 | - global $leftmenu; // Used into strings to eval |
|
715 | + global $leftmenu; // Used into strings to eval |
|
716 | 716 | $conf->global->MAIN_FEATURES_LEVEL = 1; |
717 | 717 | |
718 | 718 | $leftmenu = 'AAA'; |
@@ -737,13 +737,13 @@ discard block |
||
737 | 737 | $this->assertFalse($result); |
738 | 738 | |
739 | 739 | $leftmenu = 'XXX'; |
740 | - $conf->global->MAIN_FEATURES_LEVEL = 1; // Force for the case option is -1 |
|
740 | + $conf->global->MAIN_FEATURES_LEVEL = 1; // Force for the case option is -1 |
|
741 | 741 | $string = '(isModEnabled("user") || isModEnabled("resource")) && getDolGlobalInt("MAIN_FEATURES_LEVEL") >= 0 && preg_match(\'/^(admintools|all|XXX)/\', $leftmenu)'; |
742 | 742 | $result = dol_eval($string, 1, 1, '1'); |
743 | 743 | print "result17 = ".$result."\n"; |
744 | 744 | $this->assertTrue($result); |
745 | 745 | |
746 | - $result = dol_eval('1 && getDolGlobalInt("doesnotexist1") && $conf->global->MAIN_FEATURES_LEVEL', 1, 0); // Should return false and not a 'Bad string syntax to evaluate ...' |
|
746 | + $result = dol_eval('1 && getDolGlobalInt("doesnotexist1") && $conf->global->MAIN_FEATURES_LEVEL', 1, 0); // Should return false and not a 'Bad string syntax to evaluate ...' |
|
747 | 747 | print "result18 = ".$result."\n"; |
748 | 748 | $this->assertFalse($result); |
749 | 749 | |
@@ -788,11 +788,11 @@ discard block |
||
788 | 788 | $this->assertEquals('a', $result); |
789 | 789 | |
790 | 790 | // Test that testRealCharforNumericEntities return an emoji utf8 char when code is inside Emoji range |
791 | - $arraytmp = array(0 => '✅', 1 => '9989;'); // Encoded as decimal |
|
791 | + $arraytmp = array(0 => '✅', 1 => '9989;'); // Encoded as decimal |
|
792 | 792 | $result = realCharForNumericEntities($arraytmp); |
793 | 793 | $this->assertEquals('✅', $result); |
794 | 794 | |
795 | - $arraytmp = array(0 => '✅', 1 => 'x2705;'); // Encoded as hexadecimal |
|
795 | + $arraytmp = array(0 => '✅', 1 => 'x2705;'); // Encoded as hexadecimal |
|
796 | 796 | $result = realCharForNumericEntities($arraytmp); |
797 | 797 | $this->assertEquals('✅', $result); |
798 | 798 | |
@@ -811,7 +811,7 @@ discard block |
||
811 | 811 | global $conf; |
812 | 812 | |
813 | 813 | // Set options for cleaning data |
814 | - $conf->global->MAIN_RESTRICTHTML_ONLY_VALID_HTML = 0; // disabled, does not work on HTML5 and some libxml versions |
|
814 | + $conf->global->MAIN_RESTRICTHTML_ONLY_VALID_HTML = 0; // disabled, does not work on HTML5 and some libxml versions |
|
815 | 815 | // Enable option MAIN_RESTRICTHTML_ONLY_VALID_HTML_TIDY if possible |
816 | 816 | if (extension_loaded('tidy') && class_exists("tidy")) { |
817 | 817 | $conf->global->MAIN_RESTRICTHTML_ONLY_VALID_HTML_TIDY = 1; |
@@ -819,7 +819,7 @@ discard block |
||
819 | 819 | $conf->global->MAIN_RESTRICTHTML_ONLY_VALID_HTML_TIDY = 0; |
820 | 820 | print "WARNING !!! php-tidy is not available !!!"; |
821 | 821 | } |
822 | - $conf->global->MAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES = 0; // disabled, does not work on HTML5 and some libxml versions |
|
822 | + $conf->global->MAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES = 0; // disabled, does not work on HTML5 and some libxml versions |
|
823 | 823 | |
824 | 824 | |
825 | 825 | // dolPrintHTML - With dolPrintHTML(), only content not already in HTML is encoded with HTML. |
@@ -832,7 +832,7 @@ discard block |
||
832 | 832 | //$result = dol_escape_htmltag(dol_htmlwithnojs(dol_string_onlythesehtmltags(dol_htmlentitiesbr($stringtotest), 1, 1, 1, 0, array())), 1, 1, 'common', 0, 1); |
833 | 833 | $result = dolPrintHTML($stringtotest); |
834 | 834 | print __METHOD__." result=".$result."\n"; |
835 | - $this->assertEquals($stringfixed, $result, 'Error in dolPrintHTML test 1'); // Expected '' because should failed because login 'auto' does not exists |
|
835 | + $this->assertEquals($stringfixed, $result, 'Error in dolPrintHTML test 1'); // Expected '' because should failed because login 'auto' does not exists |
|
836 | 836 | |
837 | 837 | // For a string that is already HTML (contains HTML tags) with special tags but badly formatted |
838 | 838 | $stringtotest = "" > < <b>bold</b>"; |
@@ -843,7 +843,7 @@ discard block |
||
843 | 843 | //$result = dol_escape_htmltag(dol_htmlwithnojs(dol_string_onlythesehtmltags(dol_htmlentitiesbr($stringtotest), 1, 1, 1, 0, array())), 1, 1, 'common', 0, 1); |
844 | 844 | $result = dolPrintHTML($stringtotest); |
845 | 845 | print __METHOD__." result=".$result."\n"; |
846 | - $this->assertEquals($stringfixed, $result, 'Error in dolPrintHTML test 2'); // Expected '' because should failed because login 'auto' does not exists |
|
846 | + $this->assertEquals($stringfixed, $result, 'Error in dolPrintHTML test 2'); // Expected '' because should failed because login 'auto' does not exists |
|
847 | 847 | |
848 | 848 | |
849 | 849 | // dolPrintHTMLForAttribute - With dolPrintHTMLForAttribute(), the content is HTML encode, even if it is already HTML content. |
@@ -856,7 +856,7 @@ discard block |
||
856 | 856 | //$result = dol_escape_htmltag(dol_htmlwithnojs(dol_string_onlythesehtmltags(dol_htmlentitiesbr($stringtotest), 1, 1, 1, 0, array())), 1, 1, 'common', 0, 1); |
857 | 857 | $result = dolPrintHTMLForAttribute($stringtotest); |
858 | 858 | print __METHOD__." result=".$result."\n"; |
859 | - $this->assertEquals($stringfixed, $result, 'Error in dolPrintHTMLForAttribute test 1'); // Expected '' because should failed because login 'auto' does not exists |
|
859 | + $this->assertEquals($stringfixed, $result, 'Error in dolPrintHTMLForAttribute test 1'); // Expected '' because should failed because login 'auto' does not exists |
|
860 | 860 | |
861 | 861 | // For a string that is already HTML (contains HTML tags) with special tags but badly formatted |
862 | 862 | $stringtotest = "" > < <b>bold</b>"; |
@@ -867,7 +867,7 @@ discard block |
||
867 | 867 | //$result = dol_escape_htmltag(dol_htmlwithnojs(dol_string_onlythesehtmltags(dol_htmlentitiesbr($stringtotest), 1, 1, 1, 0, array())), 1, 1, 'common', 0, 1); |
868 | 868 | $result = dolPrintHTMLForAttribute($stringtotest); |
869 | 869 | print __METHOD__." result=".$result."\n"; |
870 | - $this->assertEquals($stringfixed, $result, 'Error in dolPrintHTMLForAttribute test 2'); // Expected '' because should failed because login 'auto' does not exists |
|
870 | + $this->assertEquals($stringfixed, $result, 'Error in dolPrintHTMLForAttribute test 2'); // Expected '' because should failed because login 'auto' does not exists |
|
871 | 871 | |
872 | 872 | |
873 | 873 | // dolPrintHTMLForAttributeUrl - With dolPrintHTMLForAttributeUrl(), the param should already be and HTML URL encoded |
@@ -877,7 +877,7 @@ discard block |
||
877 | 877 | // $result = dol_escape_htmltag(dol_string_onlythesehtmltags($s, 1, 1, 1, 0, array()), 0, 0, '', $escapeonlyhtmltags, 1); |
878 | 878 | $result = dolPrintHTMLForAttributeUrl($stringtotest); |
879 | 879 | print __METHOD__." result=".$result."\n"; |
880 | - $this->assertEquals($stringfixed, $result, 'Error in dolPrintHTMLForAttributeUrl test 1'); // Expected '' because should failed because login 'auto' does not exists |
|
880 | + $this->assertEquals($stringfixed, $result, 'Error in dolPrintHTMLForAttributeUrl test 1'); // Expected '' because should failed because login 'auto' does not exists |
|
881 | 881 | |
882 | 882 | // For a string that is already HTML (contains HTML tags) with special tags but badly formatted |
883 | 883 | $stringtotest = "aa & & a=%10"; |
@@ -885,7 +885,7 @@ discard block |
||
885 | 885 | // $result = dol_escape_htmltag(dol_string_onlythesehtmltags($s, 1, 1, 1, 0, array()), 0, 0, '', $escapeonlyhtmltags, 1); |
886 | 886 | $result = dolPrintHTMLForAttributeUrl($stringtotest); |
887 | 887 | print __METHOD__." result=".$result."\n"; |
888 | - $this->assertEquals($stringfixed, $result, 'Error in dolPrintHTMLForAttributeUrl test 2'); // Expected '' because should failed because login 'auto' does not exists |
|
888 | + $this->assertEquals($stringfixed, $result, 'Error in dolPrintHTMLForAttributeUrl test 2'); // Expected '' because should failed because login 'auto' does not exists |
|
889 | 889 | |
890 | 890 | |
891 | 891 | // dolPrintHTML |
@@ -1016,7 +1016,7 @@ discard block |
||
1016 | 1016 | global $conf; |
1017 | 1017 | |
1018 | 1018 | // Set options for cleaning data |
1019 | - $conf->global->MAIN_RESTRICTHTML_ONLY_VALID_HTML = 0; // disabled, does not work on HTML5 and some libxml versions |
|
1019 | + $conf->global->MAIN_RESTRICTHTML_ONLY_VALID_HTML = 0; // disabled, does not work on HTML5 and some libxml versions |
|
1020 | 1020 | // Enable option MAIN_RESTRICTHTML_ONLY_VALID_HTML_TIDY if possible |
1021 | 1021 | if (extension_loaded('tidy') && class_exists("tidy")) { |
1022 | 1022 | $conf->global->MAIN_RESTRICTHTML_ONLY_VALID_HTML_TIDY = 1; |
@@ -1025,22 +1025,22 @@ discard block |
||
1025 | 1025 | print "WARNING !!! php-tidy is not available !!!"; |
1026 | 1026 | } |
1027 | 1027 | |
1028 | - $libXmlIsOkForMAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES = 0; // Ok with 2.9.14, not ok on HTML5 and some libxmlversion like the one of travis |
|
1028 | + $libXmlIsOkForMAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES = 0; // Ok with 2.9.14, not ok on HTML5 and some libxmlversion like the one of travis |
|
1029 | 1029 | |
1030 | 1030 | |
1031 | 1031 | // With no clean option |
1032 | 1032 | $conf->global->MAIN_RESTRICTHTML_ONLY_VALID_HTML = 0; |
1033 | - $conf->global->MAIN_RESTRICTHTML_ONLY_VALID_HTML_TIDY = 0; // |
|
1034 | - $conf->global->MAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES = 0; // 1 = Replaces & alone into & and replaces ' into ' |
|
1033 | + $conf->global->MAIN_RESTRICTHTML_ONLY_VALID_HTML_TIDY = 0; // |
|
1034 | + $conf->global->MAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES = 0; // 1 = Replaces & alone into & and replaces ' into ' |
|
1035 | 1035 | |
1036 | 1036 | // For a string with a simple & inside and already encoded |
1037 | - $s = 'List of char+their entities: & & é é < < " " \' ' <a href="aaa?aaa=1&bbb=2&ccc=3">a</a> <zzz>z</zzz>'; // Detected as already HTML |
|
1037 | + $s = 'List of char+their entities: & & é é < < " " \' ' <a href="aaa?aaa=1&bbb=2&ccc=3">a</a> <zzz>z</zzz>'; // Detected as already HTML |
|
1038 | 1038 | $expectedresult = 'List of char+their entities: & & é é < < " " \' ' <a href="aaa?aaa=1&bbb=2&ccc=3">a</a> z'; |
1039 | 1039 | $result = dolPrintHTML($s); |
1040 | 1040 | $this->assertEquals($expectedresult, $result, 'Error on test dolPrintHTML'); |
1041 | 1041 | |
1042 | 1042 | // For a string that is not an already HTML content |
1043 | - $s = 'List: & é < " \''; // Detected as non already HTML |
|
1043 | + $s = 'List: & é < " \''; // Detected as non already HTML |
|
1044 | 1044 | $expectedresult = 'List: & é < " \''; |
1045 | 1045 | $result = dolPrintHTML($s); |
1046 | 1046 | $this->assertEquals($expectedresult, $result, 'Error on test dolPrintHTML'); |
@@ -1049,17 +1049,17 @@ discard block |
||
1049 | 1049 | if (extension_loaded('tidy') && class_exists("tidy")) { |
1050 | 1050 | // With clean TIDY only |
1051 | 1051 | $conf->global->MAIN_RESTRICTHTML_ONLY_VALID_HTML = 0; |
1052 | - $conf->global->MAIN_RESTRICTHTML_ONLY_VALID_HTML_TIDY = 1; // |
|
1053 | - $conf->global->MAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES = 0; // 1 = Replaces & alone into & and replaces ' into ' |
|
1052 | + $conf->global->MAIN_RESTRICTHTML_ONLY_VALID_HTML_TIDY = 1; // |
|
1053 | + $conf->global->MAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES = 0; // 1 = Replaces & alone into & and replaces ' into ' |
|
1054 | 1054 | |
1055 | 1055 | // For a string with a simple & inside and already encoded |
1056 | - $s = 'List of char+their entities: & & é é < < " " \' ' <a href="aaa?aaa=1&bbb=2&ccc=3">a</a> <zzz>z</zzz>'; // Detected as already HTML |
|
1056 | + $s = 'List of char+their entities: & & é é < < " " \' ' <a href="aaa?aaa=1&bbb=2&ccc=3">a</a> <zzz>z</zzz>'; // Detected as already HTML |
|
1057 | 1057 | $expectedresult = 'List of char+their entities: & & é é < < " " \' ' <a href="aaa?aaa=1&bbb=2&ccc=3">a</a> z'; |
1058 | 1058 | $result = dolPrintHTML($s); |
1059 | 1059 | $this->assertEquals($expectedresult, $result, 'Error on test dolPrintHTML'); |
1060 | 1060 | |
1061 | 1061 | // For a string that is not an already HTML content |
1062 | - $s = 'List: & é < " \''; // Detected as non already HTML |
|
1062 | + $s = 'List: & é < " \''; // Detected as non already HTML |
|
1063 | 1063 | $expectedresult = 'List: & é < " \''; |
1064 | 1064 | $result = dolPrintHTML($s); |
1065 | 1065 | $this->assertEquals($expectedresult, $result, 'Error on test dolPrintHTML'); |
@@ -1067,17 +1067,17 @@ discard block |
||
1067 | 1067 | if ($libXmlIsOkForMAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES) { |
1068 | 1068 | // With clean TIDY and remove Bad attributes option |
1069 | 1069 | $conf->global->MAIN_RESTRICTHTML_ONLY_VALID_HTML = 0; |
1070 | - $conf->global->MAIN_RESTRICTHTML_ONLY_VALID_HTML_TIDY = 1; // |
|
1071 | - $conf->global->MAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES = 1; // 1 = Replaces & alone into & and replaces ' into ' |
|
1070 | + $conf->global->MAIN_RESTRICTHTML_ONLY_VALID_HTML_TIDY = 1; // |
|
1071 | + $conf->global->MAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES = 1; // 1 = Replaces & alone into & and replaces ' into ' |
|
1072 | 1072 | |
1073 | 1073 | // For a string with a simple & inside and already encoded |
1074 | - $s = 'List of char+their entities: & & é é < < " " \' ' <a href="aaa?aaa=1&bbb=2&ccc=3">a</a> <zzz>z</zzz>'; // Detected as already HTML |
|
1074 | + $s = 'List of char+their entities: & & é é < < " " \' ' <a href="aaa?aaa=1&bbb=2&ccc=3">a</a> <zzz>z</zzz>'; // Detected as already HTML |
|
1075 | 1075 | $expectedresult = 'List of char+their entities: & & é é < < " " \' \' <a href="aaa?aaa=1&bbb=2&ccc=3">a</a> z'; |
1076 | 1076 | $result = dolPrintHTML($s); |
1077 | 1077 | $this->assertEquals($expectedresult, $result, 'Error on test dolPrintHTML'); |
1078 | 1078 | |
1079 | 1079 | // For a string that is not an already HTML content |
1080 | - $s = 'List: & é < " \''; // Detected as non already HTML |
|
1080 | + $s = 'List: & é < " \''; // Detected as non already HTML |
|
1081 | 1081 | $expectedresult = 'List: & é < " \''; |
1082 | 1082 | $result = dolPrintHTML($s); |
1083 | 1083 | $this->assertEquals($expectedresult, $result, 'Error on test dolPrintHTML'); |
@@ -1087,17 +1087,17 @@ discard block |
||
1087 | 1087 | if ($libXmlIsOkForMAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES) { |
1088 | 1088 | // With remove Bad attributes option only |
1089 | 1089 | $conf->global->MAIN_RESTRICTHTML_ONLY_VALID_HTML = 0; |
1090 | - $conf->global->MAIN_RESTRICTHTML_ONLY_VALID_HTML_TIDY = 0; // |
|
1091 | - $conf->global->MAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES = 1; // 1 = Replaces & alone into & and replaces ' into ' |
|
1090 | + $conf->global->MAIN_RESTRICTHTML_ONLY_VALID_HTML_TIDY = 0; // |
|
1091 | + $conf->global->MAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES = 1; // 1 = Replaces & alone into & and replaces ' into ' |
|
1092 | 1092 | |
1093 | 1093 | // For a string with a simple & inside and already encoded |
1094 | - $s = 'List of char+their entities: & & é é < < " " \' ' <a href="aaa?aaa=1&bbb=2&ccc=3">a</a> <zzz>z</zzz>'; // Detected as already HTML |
|
1094 | + $s = 'List of char+their entities: & & é é < < " " \' ' <a href="aaa?aaa=1&bbb=2&ccc=3">a</a> <zzz>z</zzz>'; // Detected as already HTML |
|
1095 | 1095 | $expectedresult = 'List of char+their entities: & & é é < < " " \' \' <a href="aaa?aaa=1&bbb=2&ccc=3">a</a> z'; |
1096 | 1096 | $result = dolPrintHTML($s); |
1097 | 1097 | $this->assertEquals($expectedresult, $result, 'Error on test dolPrintHTML'); |
1098 | 1098 | |
1099 | 1099 | // For a string that is not an already HTML content |
1100 | - $s = 'List: & é < " \''; // Detected as non already HTML |
|
1100 | + $s = 'List: & é < " \''; // Detected as non already HTML |
|
1101 | 1101 | $expectedresult = 'List: & é < " \''; |
1102 | 1102 | $result = dolPrintHTML($s); |
1103 | 1103 | $this->assertEquals($expectedresult, $result, 'Error on test dolPrintHTML'); |
@@ -1118,7 +1118,7 @@ discard block |
||
1118 | 1118 | global $conf; |
1119 | 1119 | |
1120 | 1120 | // Set options for cleaning data |
1121 | - $conf->global->MAIN_RESTRICTHTML_ONLY_VALID_HTML = 0; // disabled, does not work on HTML5 and some libxml versions |
|
1121 | + $conf->global->MAIN_RESTRICTHTML_ONLY_VALID_HTML = 0; // disabled, does not work on HTML5 and some libxml versions |
|
1122 | 1122 | // Enable option MAIN_RESTRICTHTML_ONLY_VALID_HTML_TIDY if possible |
1123 | 1123 | if (extension_loaded('tidy') && class_exists("tidy")) { |
1124 | 1124 | $conf->global->MAIN_RESTRICTHTML_ONLY_VALID_HTML_TIDY = 1; |
@@ -1127,22 +1127,22 @@ discard block |
||
1127 | 1127 | print "WARNING !!! php-tidy is not available !!!"; |
1128 | 1128 | } |
1129 | 1129 | |
1130 | - $libXmlIsOkForMAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES = 0; // Ok with 2.9.14, not ok on HTML5 and some libxmlversion like the one of travis |
|
1130 | + $libXmlIsOkForMAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES = 0; // Ok with 2.9.14, not ok on HTML5 and some libxmlversion like the one of travis |
|
1131 | 1131 | |
1132 | 1132 | |
1133 | 1133 | // With no clean option |
1134 | 1134 | $conf->global->MAIN_RESTRICTHTML_ONLY_VALID_HTML = 0; |
1135 | - $conf->global->MAIN_RESTRICTHTML_ONLY_VALID_HTML_TIDY = 0; // |
|
1136 | - $conf->global->MAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES = 0; // 1 = Replaces & alone into & and replaces ' into ' |
|
1135 | + $conf->global->MAIN_RESTRICTHTML_ONLY_VALID_HTML_TIDY = 0; // |
|
1136 | + $conf->global->MAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES = 0; // 1 = Replaces & alone into & and replaces ' into ' |
|
1137 | 1137 | |
1138 | 1138 | // For a string with a simple & inside and already encoded |
1139 | - $s = 'List of char+their entities: & & é é < < " " \' ' <a href="aaa?aaa=1&bbb=2&ccc=3">a</a> <zzz>z</zzz>'; // Detected as already HTML |
|
1139 | + $s = 'List of char+their entities: & & é é < < " " \' ' <a href="aaa?aaa=1&bbb=2&ccc=3">a</a> <zzz>z</zzz>'; // Detected as already HTML |
|
1140 | 1140 | $expectedresult = 'List of char+their entities: & &amp; é é < &lt; " &quot; \' &apos; a z'; |
1141 | 1141 | $result = dolPrintHTMLForAttribute($s); |
1142 | 1142 | $this->assertEquals($expectedresult, $result, 'Error on test dolPrintHTML'); |
1143 | 1143 | |
1144 | 1144 | // For a string that is not an already HTML content |
1145 | - $s = 'List: & é < " \''; // Detected as non already HTML |
|
1145 | + $s = 'List: & é < " \''; // Detected as non already HTML |
|
1146 | 1146 | $expectedresult = 'List: &amp; é &lt; &quot; \''; |
1147 | 1147 | $result = dolPrintHTMLForAttribute($s); |
1148 | 1148 | $this->assertEquals($expectedresult, $result, 'Error on test dolPrintHTML'); |
@@ -1151,17 +1151,17 @@ discard block |
||
1151 | 1151 | if (extension_loaded('tidy') && class_exists("tidy")) { |
1152 | 1152 | // With clean TIDY only |
1153 | 1153 | $conf->global->MAIN_RESTRICTHTML_ONLY_VALID_HTML = 0; |
1154 | - $conf->global->MAIN_RESTRICTHTML_ONLY_VALID_HTML_TIDY = 1; // |
|
1155 | - $conf->global->MAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES = 0; // 1 = Replaces & alone into & and replaces ' into ' |
|
1154 | + $conf->global->MAIN_RESTRICTHTML_ONLY_VALID_HTML_TIDY = 1; // |
|
1155 | + $conf->global->MAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES = 0; // 1 = Replaces & alone into & and replaces ' into ' |
|
1156 | 1156 | |
1157 | 1157 | // For a string with a simple & inside and already encoded |
1158 | - $s = 'List of char+their entities: & & é é < < " " \' ' <a href="aaa?aaa=1&bbb=2&ccc=3">a</a> <zzz>z</zzz>'; // Detected as already HTML |
|
1158 | + $s = 'List of char+their entities: & & é é < < " " \' ' <a href="aaa?aaa=1&bbb=2&ccc=3">a</a> <zzz>z</zzz>'; // Detected as already HTML |
|
1159 | 1159 | $expectedresult = 'List of char+their entities: & &amp; é é < &lt; " &quot; \' &apos; a z'; |
1160 | 1160 | $result = dolPrintHTMLForAttribute($s); |
1161 | 1161 | $this->assertEquals($expectedresult, $result, 'Error on test dolPrintHTML'); |
1162 | 1162 | |
1163 | 1163 | // For a string that is not an already HTML content |
1164 | - $s = 'List: & é < " \''; // Detected as non already HTML |
|
1164 | + $s = 'List: & é < " \''; // Detected as non already HTML |
|
1165 | 1165 | $expectedresult = 'List: &amp; é &lt; &quot; \''; |
1166 | 1166 | $result = dolPrintHTMLForAttribute($s); |
1167 | 1167 | $this->assertEquals($expectedresult, $result, 'Error on test dolPrintHTML'); |
@@ -1170,17 +1170,17 @@ discard block |
||
1170 | 1170 | if ($libXmlIsOkForMAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES) { |
1171 | 1171 | // With clean TIDY and remove Bad attributes option |
1172 | 1172 | $conf->global->MAIN_RESTRICTHTML_ONLY_VALID_HTML = 0; |
1173 | - $conf->global->MAIN_RESTRICTHTML_ONLY_VALID_HTML_TIDY = 1; // |
|
1174 | - $conf->global->MAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES = 1; // 1 = Replaces & alone into & and replaces ' into ' |
|
1173 | + $conf->global->MAIN_RESTRICTHTML_ONLY_VALID_HTML_TIDY = 1; // |
|
1174 | + $conf->global->MAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES = 1; // 1 = Replaces & alone into & and replaces ' into ' |
|
1175 | 1175 | |
1176 | 1176 | // For a string with a simple & inside and already encoded |
1177 | - $s = 'List of char+their entities: & & é é < < " " \' ' <a href="aaa?aaa=1&bbb=2&ccc=3">a</a> <zzz>z</zzz>'; // Detected as already HTML |
|
1177 | + $s = 'List of char+their entities: & & é é < < " " \' ' <a href="aaa?aaa=1&bbb=2&ccc=3">a</a> <zzz>z</zzz>'; // Detected as already HTML |
|
1178 | 1178 | $expectedresult = 'List of char+their entities: & &amp; é é < &lt; " &quot; \' &apos; a z'; |
1179 | 1179 | $result = dolPrintHTMLForAttribute($s); |
1180 | 1180 | $this->assertEquals($expectedresult, $result, 'Error on test dolPrintHTML'); |
1181 | 1181 | |
1182 | 1182 | // For a string that is not an already HTML content |
1183 | - $s = 'List: & é < " \''; // Detected as non already HTML |
|
1183 | + $s = 'List: & é < " \''; // Detected as non already HTML |
|
1184 | 1184 | $expectedresult = 'List: &amp; é &lt; &quot; \''; |
1185 | 1185 | $result = dolPrintHTMLForAttribute($s); |
1186 | 1186 | $this->assertEquals($expectedresult, $result, 'Error on test dolPrintHTML'); |
@@ -1190,17 +1190,17 @@ discard block |
||
1190 | 1190 | if ($libXmlIsOkForMAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES) { |
1191 | 1191 | // With remove Bad attributes option only |
1192 | 1192 | $conf->global->MAIN_RESTRICTHTML_ONLY_VALID_HTML = 0; |
1193 | - $conf->global->MAIN_RESTRICTHTML_ONLY_VALID_HTML_TIDY = 0; // |
|
1194 | - $conf->global->MAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES = 1; // 1 = Replaces & alone into & and replaces ' into ' |
|
1193 | + $conf->global->MAIN_RESTRICTHTML_ONLY_VALID_HTML_TIDY = 0; // |
|
1194 | + $conf->global->MAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES = 1; // 1 = Replaces & alone into & and replaces ' into ' |
|
1195 | 1195 | |
1196 | 1196 | // For a string with a simple & inside and already encoded |
1197 | - $s = 'List of char+their entities: & & é é < < " " \' ' <a href="aaa?aaa=1&bbb=2&ccc=3">a</a> <zzz>z</zzz>'; // Detected as already HTML |
|
1197 | + $s = 'List of char+their entities: & & é é < < " " \' ' <a href="aaa?aaa=1&bbb=2&ccc=3">a</a> <zzz>z</zzz>'; // Detected as already HTML |
|
1198 | 1198 | $expectedresult = 'List of char+their entities: & &amp; é é < &lt; " &quot; \' &apos; a z'; |
1199 | 1199 | $result = dolPrintHTMLForAttribute($s); |
1200 | 1200 | $this->assertEquals($expectedresult, $result, 'Error on test dolPrintHTML'); |
1201 | 1201 | |
1202 | 1202 | // For a string that is not an already HTML content |
1203 | - $s = 'List: & é < " \''; // Detected as non already HTML |
|
1203 | + $s = 'List: & é < " \''; // Detected as non already HTML |
|
1204 | 1204 | $expectedresult = 'List: &amp; é &lt; &quot; \''; |
1205 | 1205 | $result = dolPrintHTMLForAttribute($s); |
1206 | 1206 | $this->assertEquals($expectedresult, $result, 'Error on test dolPrintHTML'); |
@@ -1292,7 +1292,7 @@ discard block |
||
1292 | 1292 | // For a string with js and link with restricthtmlallowlinkscript |
1293 | 1293 | $conf->global->MAIN_RESTRICTHTML_ONLY_VALID_HTML = 0; |
1294 | 1294 | $conf->global->MAIN_RESTRICTHTML_ONLY_VALID_HTML_TIDY = 0; |
1295 | - $s='<link rel="stylesheet" id="google-fonts-css" href="//fonts.googleapis.com/css?family=Open+Sans:300,400,700"> |
|
1295 | + $s = '<link rel="stylesheet" id="google-fonts-css" href="//fonts.googleapis.com/css?family=Open+Sans:300,400,700"> |
|
1296 | 1296 | <link rel="stylesheet" id="font-wasesome-css" href="//cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"> |
1297 | 1297 | <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> |
1298 | 1298 | <script src="//cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script>'; |
@@ -1305,7 +1305,7 @@ discard block |
||
1305 | 1305 | // For a string with js and link with restricthtmlallowlinkscript |
1306 | 1306 | $conf->global->MAIN_RESTRICTHTML_ONLY_VALID_HTML = 0; |
1307 | 1307 | $conf->global->MAIN_RESTRICTHTML_ONLY_VALID_HTML_TIDY = 1; |
1308 | - $s='<link rel="stylesheet" id="google-fonts-css" href="//fonts.googleapis.com/css?family=Open+Sans:300,400,700"> |
|
1308 | + $s = '<link rel="stylesheet" id="google-fonts-css" href="//fonts.googleapis.com/css?family=Open+Sans:300,400,700"> |
|
1309 | 1309 | <link rel="stylesheet" id="font-wasesome-css" href="//cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"> |
1310 | 1310 | <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> |
1311 | 1311 | <script src="//cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script>'; |
@@ -1318,7 +1318,7 @@ discard block |
||
1318 | 1318 | // For a string with js and link with restricthtmlallowlinkscript |
1319 | 1319 | $conf->global->MAIN_RESTRICTHTML_ONLY_VALID_HTML = 1; |
1320 | 1320 | $conf->global->MAIN_RESTRICTHTML_ONLY_VALID_HTML_TIDY = 0; |
1321 | - $s='<link rel="stylesheet" id="google-fonts-css" href="//fonts.googleapis.com/css?family=Open+Sans:300,400,700"> |
|
1321 | + $s = '<link rel="stylesheet" id="google-fonts-css" href="//fonts.googleapis.com/css?family=Open+Sans:300,400,700"> |
|
1322 | 1322 | <link rel="stylesheet" id="font-wasesome-css" href="//cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"> |
1323 | 1323 | <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> |
1324 | 1324 | <script src="//cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script>'; |
@@ -563,7 +563,7 @@ discard block |
||
563 | 563 | $value = $_ENV['DOLIBARR_'.$key]; |
564 | 564 | } |
565 | 565 | |
566 | - $this->global->$key = dolDecrypt($value); // decrypt data excrypted with dolibarr_set_const($db, $name, $value) |
|
566 | + $this->global->$key = dolDecrypt($value); // decrypt data excrypted with dolibarr_set_const($db, $name, $value) |
|
567 | 567 | |
568 | 568 | if ($value && strpos($key, 'MAIN_MODULE_') === 0) { |
569 | 569 | $reg = array(); |
@@ -623,9 +623,9 @@ discard block |
||
623 | 623 | // deprecated in php 8.2 |
624 | 624 | //if (version_compare(phpversion(), '8.2') < 0) { |
625 | 625 | if (!isset($this->$modulename) || !is_object($this->$modulename)) { |
626 | - $this->$modulename = new stdClass(); // We need this to use the ->enabled and the ->multidir, ->dir... |
|
626 | + $this->$modulename = new stdClass(); // We need this to use the ->enabled and the ->multidir, ->dir... |
|
627 | 627 | } |
628 | - $this->$modulename->enabled = true; // TODO Remove this |
|
628 | + $this->$modulename->enabled = true; // TODO Remove this |
|
629 | 629 | |
630 | 630 | // Duplicate entry with the new name |
631 | 631 | /* |
@@ -847,8 +847,8 @@ discard block |
||
847 | 847 | |
848 | 848 | // Module compta |
849 | 849 | $this->compta->payment = new stdClass(); |
850 | - $this->compta->payment->dir_output = $rootfordata."/compta/payment"; |
|
851 | - $this->compta->payment->dir_temp = $rootfortemp."/compta/payment/temp"; |
|
850 | + $this->compta->payment->dir_output = $rootfordata."/compta/payment"; |
|
851 | + $this->compta->payment->dir_temp = $rootfortemp."/compta/payment/temp"; |
|
852 | 852 | |
853 | 853 | // Module product/service |
854 | 854 | $this->product->multidir_output = array($this->entity => $rootfordata."/produit"); |
@@ -974,7 +974,7 @@ discard block |
||
974 | 974 | } |
975 | 975 | |
976 | 976 | if (!isset($this->global->MAIN_ENABLE_AJAX_TOOLTIP)) { |
977 | - $this->global->MAIN_ENABLE_AJAX_TOOLTIP = 1; // Try to have it enabled by default with v21+ |
|
977 | + $this->global->MAIN_ENABLE_AJAX_TOOLTIP = 1; // Try to have it enabled by default with v21+ |
|
978 | 978 | } |
979 | 979 | |
980 | 980 | // By default, suppliers objects can be linked to all projects |
@@ -1291,7 +1291,7 @@ discard block |
||
1291 | 1291 | } |
1292 | 1292 | |
1293 | 1293 | if (!isset($this->global->MAIL_SMTP_USE_FROM_FOR_HELO)) { |
1294 | - $this->global->MAIL_SMTP_USE_FROM_FOR_HELO = 2; // Use the domain in $dolibarr_main_url_root (mydomain.com) |
|
1294 | + $this->global->MAIL_SMTP_USE_FROM_FOR_HELO = 2; // Use the domain in $dolibarr_main_url_root (mydomain.com) |
|
1295 | 1295 | } |
1296 | 1296 | |
1297 | 1297 | // Security |
@@ -1329,7 +1329,7 @@ discard block |
||
1329 | 1329 | } |
1330 | 1330 | |
1331 | 1331 | if (!empty($this->global->MAIN_TZUSERINPUTKEY)) { |
1332 | - $this->tzuserinputkey = $this->global->MAIN_TZUSERINPUTKEY; // 'tzserver' or 'tzuserrel' |
|
1332 | + $this->tzuserinputkey = $this->global->MAIN_TZUSERINPUTKEY; // 'tzserver' or 'tzuserrel' |
|
1333 | 1333 | } |
1334 | 1334 | |
1335 | 1335 | if (!empty($this->global->PRODUIT_AUTOFILL_DESC)) { |
@@ -81,14 +81,14 @@ discard block |
||
81 | 81 | if ($massaction == 'preclonetasks') { |
82 | 82 | $selected = ''; |
83 | 83 | foreach (GETPOST('toselect') as $tmpselected) { |
84 | - $selected .= '&selected[]=' . $tmpselected; |
|
84 | + $selected .= '&selected[]='.$tmpselected; |
|
85 | 85 | } |
86 | 86 | $formquestion = array( |
87 | 87 | // TODO If list of project is long and project is not on a thirdparty, the combo may be very long. |
88 | 88 | // Solution: Allow only sameproject for cloning tasks ? |
89 | - array('type' => 'other', 'name' => 'projectid', 'label' => $langs->trans('Project') .': ', 'value' => $form->selectProjects($object->id, 'projectid', '', 0, 1, '', 0, array(), $object->socid, '1', 1, '', array(), 1)), |
|
89 | + array('type' => 'other', 'name' => 'projectid', 'label' => $langs->trans('Project').': ', 'value' => $form->selectProjects($object->id, 'projectid', '', 0, 1, '', 0, array(), $object->socid, '1', 1, '', array(), 1)), |
|
90 | 90 | ); |
91 | - print $form->formconfirm($_SERVER['PHP_SELF'] . '?id=' . $object->id . $selected, $langs->trans('ConfirmMassClone'), '', 'clonetasks', $formquestion, '', 1, 300, 590); |
|
91 | + print $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id.$selected, $langs->trans('ConfirmMassClone'), '', 'clonetasks', $formquestion, '', 1, 300, 590); |
|
92 | 92 | } |
93 | 93 | |
94 | 94 | if ($massaction == 'preaffecttag' && isModEnabled('category')) { |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | |
155 | 155 | $descConfirmPreUpdatePrice = $langs->trans("ConfirmUpdatePriceQuestion", count($toselect)); |
156 | 156 | if (getDolGlobalString('PRODUIT_MULTIPRICES')) { |
157 | - $descConfirmPreUpdatePrice = $langs->trans("ConfirmUpdatePriceQuestion", count($toselect) * getDolGlobalInt('PRODUIT_MULTIPRICES_LIMIT') .' ('.$langs->transnoentities('PricingRule').', '.$langs->transnoentities('MultiPricesNumPrices').')'); |
|
157 | + $descConfirmPreUpdatePrice = $langs->trans("ConfirmUpdatePriceQuestion", count($toselect) * getDolGlobalInt('PRODUIT_MULTIPRICES_LIMIT').' ('.$langs->transnoentities('PricingRule').', '.$langs->transnoentities('MultiPricesNumPrices').')'); |
|
158 | 158 | } |
159 | 159 | |
160 | 160 | print $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans("ConfirmUpdatePrice"), $descConfirmPreUpdatePrice, "updateprice", $formquestion, 1, 0, 200, 500, 1); |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | $result = $objecttmp->fetch($toselectid); |
230 | 230 | if ($result > 0) { |
231 | 231 | $listofselectedid[$toselectid] = $toselectid; |
232 | - $thirdpartyid = ($objecttmp->fk_soc ? $objecttmp->fk_soc : $objecttmp->socid); // For proposal, order, invoice, conferenceorbooth, ... |
|
232 | + $thirdpartyid = ($objecttmp->fk_soc ? $objecttmp->fk_soc : $objecttmp->socid); // For proposal, order, invoice, conferenceorbooth, ... |
|
233 | 233 | if (in_array($objecttmp->element, array('societe', 'conferenceorboothattendee'))) { |
234 | 234 | $thirdpartyid = $objecttmp->id; |
235 | 235 | } elseif ($objecttmp->element == 'contact') { |
@@ -310,14 +310,14 @@ discard block |
||
310 | 310 | $formmail->withfile = 0; |
311 | 311 | $formmail->withmaindocfile = 0; // Add a checkbox "Attach also main document" |
312 | 312 | } else { |
313 | - $formmail->withfile = 1; // $formmail->withfile = 2 to allow to upload files is not yet supported in mass action |
|
313 | + $formmail->withfile = 1; // $formmail->withfile = 2 to allow to upload files is not yet supported in mass action |
|
314 | 314 | // Add a checkbox "Attach also main document" |
315 | 315 | if (isset($withmaindocfilemail)) { |
316 | 316 | $formmail->withmaindocfile = $withmaindocfilemail; |
317 | 317 | } else { // Do an automatic definition of $formmail->withmaindocfile |
318 | 318 | $formmail->withmaindocfile = 1; |
319 | 319 | if ($objecttmp->element != 'societe') { |
320 | - $formmail->withfile = '<span class="hideonsmartphone opacitymedium">' . $langs->trans("OnlyPDFattachmentSupported") . '</span>'; |
|
320 | + $formmail->withfile = '<span class="hideonsmartphone opacitymedium">'.$langs->trans("OnlyPDFattachmentSupported").'</span>'; |
|
321 | 321 | $formmail->withmaindocfile = -1; // Add a checkbox "Attach also main document" but not checked by default |
322 | 322 | } |
323 | 323 | } |
@@ -347,7 +347,7 @@ discard block |
||
347 | 347 | |
348 | 348 | // Tableau des parameters complementaires du post |
349 | 349 | $formmail->param['action'] = $action; |
350 | - $formmail->param['models'] = $modelmail; // the filter to know which kind of template emails to show. 'none' means no template suggested. |
|
350 | + $formmail->param['models'] = $modelmail; // the filter to know which kind of template emails to show. 'none' means no template suggested. |
|
351 | 351 | $formmail->param['models_id'] = GETPOSTINT('modelmailselected') ? GETPOSTINT('modelmailselected') : '-1'; |
352 | 352 | $formmail->param['id'] = implode(',', $arrayofselected); |
353 | 353 | // $formmail->param['returnurl']=$_SERVER["PHP_SELF"].'?id='.$object->id; |
@@ -391,7 +391,7 @@ discard block |
||
391 | 391 | |
392 | 392 | foreach ($extrafields_list as $extraKey => $extraLabel) { |
393 | 393 | $outputShowOutputFields .= '<div class="mass-action-extrafield" data-extrafield="'.$extraKey.'" style="display:none;" >'; |
394 | - $outputShowOutputFields .= '<br><span>'. $langs->trans('NewValue').'</span>'; |
|
394 | + $outputShowOutputFields .= '<br><span>'.$langs->trans('NewValue').'</span>'; |
|
395 | 395 | $outputShowOutputFields .= $extrafields->showInputField($extraKey, '', '', $keysuffix, '', 0, $objecttmp, $objecttmp->table_element); |
396 | 396 | $outputShowOutputFields .= '</div>'; |
397 | 397 | } |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | $search_doc_type = GETPOST("search_doc_type", 'alpha'); |
68 | 68 | $search_doc_ref = GETPOST("search_doc_ref", 'alpha'); |
69 | 69 | |
70 | -$search_doc_date = GETPOSTDATE('doc_date', 'getpost'); // deprecated. Can use 'search_date_start/end' |
|
70 | +$search_doc_date = GETPOSTDATE('doc_date', 'getpost'); // deprecated. Can use 'search_date_start/end' |
|
71 | 71 | |
72 | 72 | $search_date_start = GETPOSTDATE('search_date_start', 'getpost', 'auto', 'search_date_start_accountancy'); |
73 | 73 | $search_date_end = GETPOSTDATE('search_date_end', 'getpostend', 'auto', 'search_date_end_accountancy'); |
@@ -159,9 +159,9 @@ discard block |
||
159 | 159 | $sql = "SELECT date_start, date_end"; |
160 | 160 | $sql .= " FROM ".MAIN_DB_PREFIX."accounting_fiscalyear "; |
161 | 161 | if (getDolGlobalInt('ACCOUNTANCY_FISCALYEAR_DEFAULT')) { |
162 | - $sql .= " WHERE rowid = " . getDolGlobalInt('ACCOUNTANCY_FISCALYEAR_DEFAULT'); |
|
162 | + $sql .= " WHERE rowid = ".getDolGlobalInt('ACCOUNTANCY_FISCALYEAR_DEFAULT'); |
|
163 | 163 | } else { |
164 | - $sql .= " WHERE date_start < '" . $db->idate(dol_now()) . "' and date_end > '" . $db->idate(dol_now()) . "'"; |
|
164 | + $sql .= " WHERE date_start < '".$db->idate(dol_now())."' and date_end > '".$db->idate(dol_now())."'"; |
|
165 | 165 | } |
166 | 166 | $sql .= $db->plimit(1); |
167 | 167 | $res = $db->query($sql); |
@@ -282,7 +282,7 @@ discard block |
||
282 | 282 | $search_date_due_start = ''; |
283 | 283 | // Due date end |
284 | 284 | $search_date_due_end_day = ''; |
285 | - $search_date_due_end_month = ''; |
|
285 | + $search_date_due_end_month = ''; |
|
286 | 286 | $search_date_due_end_year = ''; |
287 | 287 | $search_date_due_end = ''; |
288 | 288 | $search_debit = ''; |
@@ -539,7 +539,7 @@ discard block |
||
539 | 539 | } |
540 | 540 | |
541 | 541 | if (!$error) { |
542 | - header('Location: ' . $_SERVER['PHP_SELF'] . '?noreset=1' . $param); |
|
542 | + header('Location: '.$_SERVER['PHP_SELF'].'?noreset=1'.$param); |
|
543 | 543 | exit(); |
544 | 544 | } |
545 | 545 | } elseif ($massaction == 'letteringmanual' && $permissiontoadd) { |
@@ -549,7 +549,7 @@ discard block |
||
549 | 549 | setEventMessages('', $lettering->errors, 'errors'); |
550 | 550 | } else { |
551 | 551 | setEventMessages($langs->trans('AccountancyOneLetteringModifiedSuccessfully'), array(), 'mesgs'); |
552 | - header('Location: ' . $_SERVER['PHP_SELF'] . '?noreset=1' . $param); |
|
552 | + header('Location: '.$_SERVER['PHP_SELF'].'?noreset=1'.$param); |
|
553 | 553 | exit(); |
554 | 554 | } |
555 | 555 | } elseif ($action == 'unletteringauto' && $confirm == "yes" && $permissiontoadd) { |
@@ -570,7 +570,7 @@ discard block |
||
570 | 570 | } |
571 | 571 | |
572 | 572 | if (!$error) { |
573 | - header('Location: ' . $_SERVER['PHP_SELF'] . '?noreset=1' . $param); |
|
573 | + header('Location: '.$_SERVER['PHP_SELF'].'?noreset=1'.$param); |
|
574 | 574 | exit(); |
575 | 575 | } |
576 | 576 | } elseif ($action == 'unletteringmanual' && $confirm == "yes" && $permissiontoadd) { |
@@ -580,7 +580,7 @@ discard block |
||
580 | 580 | setEventMessages('', $lettering->errors, 'errors'); |
581 | 581 | } else { |
582 | 582 | setEventMessages($langs->trans('AccountancyOneUnletteringModifiedSuccessfully'), array(), 'mesgs'); |
583 | - header('Location: ' . $_SERVER['PHP_SELF'] . '?noreset=1' . $param); |
|
583 | + header('Location: '.$_SERVER['PHP_SELF'].'?noreset=1'.$param); |
|
584 | 584 | exit(); |
585 | 585 | } |
586 | 586 | } |
@@ -763,10 +763,10 @@ discard block |
||
763 | 763 | // List of mass actions available |
764 | 764 | $arrayofmassactions = array(); |
765 | 765 | if (getDolGlobalInt('ACCOUNTING_ENABLE_LETTERING') && $user->hasRight('accounting', 'mouvements', 'creer')) { |
766 | - $arrayofmassactions['letteringauto'] = img_picto('', 'check', 'class="pictofixedwidth"') . $langs->trans('LetteringAuto'); |
|
767 | - $arrayofmassactions['preunletteringauto'] = img_picto('', 'uncheck', 'class="pictofixedwidth"') . $langs->trans('UnletteringAuto'); |
|
768 | - $arrayofmassactions['letteringmanual'] = img_picto('', 'check', 'class="pictofixedwidth"') . $langs->trans('LetteringManual'); |
|
769 | - $arrayofmassactions['preunletteringmanual'] = img_picto('', 'uncheck', 'class="pictofixedwidth"') . $langs->trans('UnletteringManual'); |
|
766 | + $arrayofmassactions['letteringauto'] = img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans('LetteringAuto'); |
|
767 | + $arrayofmassactions['preunletteringauto'] = img_picto('', 'uncheck', 'class="pictofixedwidth"').$langs->trans('UnletteringAuto'); |
|
768 | + $arrayofmassactions['letteringmanual'] = img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans('LetteringManual'); |
|
769 | + $arrayofmassactions['preunletteringmanual'] = img_picto('', 'uncheck', 'class="pictofixedwidth"').$langs->trans('UnletteringManual'); |
|
770 | 770 | } |
771 | 771 | if ($user->hasRight('accounting', 'mouvements', 'supprimer')) { |
772 | 772 | $arrayofmassactions['predeletebookkeepingwriting'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); |
@@ -1187,7 +1187,7 @@ discard block |
||
1187 | 1187 | } |
1188 | 1188 | |
1189 | 1189 | // Document ref |
1190 | - $modulepart = ''; // may be used by include*.tpl.php |
|
1190 | + $modulepart = ''; // may be used by include*.tpl.php |
|
1191 | 1191 | if (!empty($arrayfields['t.doc_ref']['checked'])) { |
1192 | 1192 | $objectstatic = null; |
1193 | 1193 | |
@@ -1255,8 +1255,8 @@ discard block |
||
1255 | 1255 | $labeltoshow .= $objectstatic->getNomUrl(1); |
1256 | 1256 | $labeltoshowalt .= $objectstatic->ref; |
1257 | 1257 | $bank_ref = strstr($line->doc_ref, '-'); |
1258 | - $labeltoshow .= " " . $bank_ref; |
|
1259 | - $labeltoshowalt .= " " . $bank_ref; |
|
1258 | + $labeltoshow .= " ".$bank_ref; |
|
1259 | + $labeltoshowalt .= " ".$bank_ref; |
|
1260 | 1260 | } else { |
1261 | 1261 | $labeltoshow .= $line->doc_ref; |
1262 | 1262 | $labeltoshowalt .= $line->doc_ref; |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | } |
65 | 65 | $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : $context_default; |
66 | 66 | |
67 | -$search_doc_date = GETPOSTDATE('doc_date', 'getpost'); // deprecated. Can use 'search_date_start/end' |
|
67 | +$search_doc_date = GETPOSTDATE('doc_date', 'getpost'); // deprecated. Can use 'search_date_start/end' |
|
68 | 68 | |
69 | 69 | $search_date_startyear = GETPOSTINT('search_date_startyear'); |
70 | 70 | $search_date_startmonth = GETPOSTINT('search_date_startmonth'); |
@@ -165,9 +165,9 @@ discard block |
||
165 | 165 | $sql = "SELECT date_start, date_end"; |
166 | 166 | $sql .= " FROM ".MAIN_DB_PREFIX."accounting_fiscalyear "; |
167 | 167 | if (getDolGlobalInt('ACCOUNTANCY_FISCALYEAR_DEFAULT')) { |
168 | - $sql .= " WHERE rowid = " . getDolGlobalInt('ACCOUNTANCY_FISCALYEAR_DEFAULT'); |
|
168 | + $sql .= " WHERE rowid = ".getDolGlobalInt('ACCOUNTANCY_FISCALYEAR_DEFAULT'); |
|
169 | 169 | } else { |
170 | - $sql .= " WHERE date_start < '" . $db->idate(dol_now()) . "' and date_end > '" . $db->idate(dol_now()) . "'"; |
|
170 | + $sql .= " WHERE date_start < '".$db->idate(dol_now())."' and date_end > '".$db->idate(dol_now())."'"; |
|
171 | 171 | } |
172 | 172 | $sql .= $db->plimit(1); |
173 | 173 | $res = $db->query($sql); |
@@ -311,7 +311,7 @@ discard block |
||
311 | 311 | $search_date_due_start = ''; |
312 | 312 | // Due date end |
313 | 313 | $search_date_due_end_day = ''; |
314 | - $search_date_due_end_month = ''; |
|
314 | + $search_date_due_end_month = ''; |
|
315 | 315 | $search_date_due_end_year = ''; |
316 | 316 | $search_date_due_end = ''; |
317 | 317 | $search_lettering_code = ''; |
@@ -363,7 +363,7 @@ discard block |
||
363 | 363 | } else { |
364 | 364 | $filter['t.numero_compte>='] = $search_accountancy_code_start; |
365 | 365 | } |
366 | - $param .= '&search_accountancy_code_start=' . urlencode($search_accountancy_code_start); |
|
366 | + $param .= '&search_accountancy_code_start='.urlencode($search_accountancy_code_start); |
|
367 | 367 | } |
368 | 368 | if (!empty($search_accountancy_code_end)) { |
369 | 369 | if ($type == 'sub') { |
@@ -371,7 +371,7 @@ discard block |
||
371 | 371 | } else { |
372 | 372 | $filter['t.numero_compte<='] = $search_accountancy_code_end; |
373 | 373 | } |
374 | - $param .= '&search_accountancy_code_end=' . urlencode($search_accountancy_code_end); |
|
374 | + $param .= '&search_accountancy_code_end='.urlencode($search_accountancy_code_end); |
|
375 | 375 | } |
376 | 376 | if (!empty($search_label_account)) { |
377 | 377 | $filter['t.label_compte'] = $search_label_account; |
@@ -538,7 +538,7 @@ discard block |
||
538 | 538 | } |
539 | 539 | |
540 | 540 | if (!$error) { |
541 | - header('Location: ' . $_SERVER['PHP_SELF'] . '?noreset=1' . $param); |
|
541 | + header('Location: '.$_SERVER['PHP_SELF'].'?noreset=1'.$param); |
|
542 | 542 | exit(); |
543 | 543 | } |
544 | 544 | } elseif ($massaction == 'letteringmanual' && $permissiontoadd) { |
@@ -548,7 +548,7 @@ discard block |
||
548 | 548 | setEventMessages('', $lettering->errors, 'errors'); |
549 | 549 | } else { |
550 | 550 | setEventMessages($langs->trans($result == 0 ? 'AccountancyNoLetteringModified' : 'AccountancyOneLetteringModifiedSuccessfully'), array(), 'mesgs'); |
551 | - header('Location: ' . $_SERVER['PHP_SELF'] . '?noreset=1' . $param); |
|
551 | + header('Location: '.$_SERVER['PHP_SELF'].'?noreset=1'.$param); |
|
552 | 552 | exit(); |
553 | 553 | } |
554 | 554 | } elseif ($type == 'sub' && $massaction == 'letteringpartial') { |
@@ -558,7 +558,7 @@ discard block |
||
558 | 558 | setEventMessages('', $lettering->errors, 'errors'); |
559 | 559 | } else { |
560 | 560 | setEventMessages($langs->trans($result == 0 ? 'AccountancyNoLetteringModified' : 'AccountancyOneLetteringModifiedSuccessfully'), array(), 'mesgs'); |
561 | - header('Location: ' . $_SERVER['PHP_SELF'] . '?noreset=1' . $param); |
|
561 | + header('Location: '.$_SERVER['PHP_SELF'].'?noreset=1'.$param); |
|
562 | 562 | exit(); |
563 | 563 | } |
564 | 564 | } elseif ($action == 'unletteringauto' && $confirm == "yes" && $permissiontoadd) { |
@@ -579,7 +579,7 @@ discard block |
||
579 | 579 | } |
580 | 580 | |
581 | 581 | if (!$error) { |
582 | - header('Location: ' . $_SERVER['PHP_SELF'] . '?noreset=1' . $param); |
|
582 | + header('Location: '.$_SERVER['PHP_SELF'].'?noreset=1'.$param); |
|
583 | 583 | exit(); |
584 | 584 | } |
585 | 585 | } elseif ($action == 'unletteringmanual' && $confirm == "yes" && $permissiontoadd) { |
@@ -589,7 +589,7 @@ discard block |
||
589 | 589 | setEventMessages('', $lettering->errors, 'errors'); |
590 | 590 | } else { |
591 | 591 | setEventMessages($langs->trans($result == 0 ? 'AccountancyNoUnletteringModified' : 'AccountancyOneUnletteringModifiedSuccessfully'), array(), 'mesgs'); |
592 | - header('Location: ' . $_SERVER['PHP_SELF'] . '?noreset=1' . $param); |
|
592 | + header('Location: '.$_SERVER['PHP_SELF'].'?noreset=1'.$param); |
|
593 | 593 | exit(); |
594 | 594 | } |
595 | 595 | } |
@@ -684,7 +684,7 @@ discard block |
||
684 | 684 | } else { |
685 | 685 | $subledger_start_account = $subledger_end_account = ''; |
686 | 686 | } |
687 | - print '<a class="a-mesure-disabled marginleftonly marginrightonly reposition" href="' . $_SERVER["PHP_SELF"] . '?mode=customer&socid='.$socid.'&type=sub&search_accountancy_code_start='.$subledger_start_account.'&search_accountancy_code_end='.$subledger_end_account.'">'; |
|
687 | + print '<a class="a-mesure-disabled marginleftonly marginrightonly reposition" href="'.$_SERVER["PHP_SELF"].'?mode=customer&socid='.$socid.'&type=sub&search_accountancy_code_start='.$subledger_start_account.'&search_accountancy_code_end='.$subledger_end_account.'">'; |
|
688 | 688 | } else { |
689 | 689 | print '<span class="a-mesure marginleftonly marginrightonly">'; |
690 | 690 | } |
@@ -704,7 +704,7 @@ discard block |
||
704 | 704 | } else { |
705 | 705 | $subledger_start_account = $subledger_end_account = ''; |
706 | 706 | } |
707 | - print '<a class="a-mesure-disabled marginleftonly marginrightonly reposition" href="' . $_SERVER["PHP_SELF"] . '?mode=supplier&socid='.$socid.'&type=sub&search_accountancy_code_start='.$subledger_start_account.'&search_accountancy_code_end='.$subledger_end_account.'">'; |
|
707 | + print '<a class="a-mesure-disabled marginleftonly marginrightonly reposition" href="'.$_SERVER["PHP_SELF"].'?mode=supplier&socid='.$socid.'&type=sub&search_accountancy_code_start='.$subledger_start_account.'&search_accountancy_code_end='.$subledger_end_account.'">'; |
|
708 | 708 | } else { |
709 | 709 | print '<span class="a-mesure marginleftonly marginrightonly">'; |
710 | 710 | } |
@@ -749,7 +749,7 @@ discard block |
||
749 | 749 | $result = $object->fetchAllByAccount($sortorder, $sortfield, $limit, $offset, $filter, 'AND', 0); |
750 | 750 | } |
751 | 751 | //$num = count($object->lines); |
752 | - $num = $result; // $result is total nb of lines, or limit + 1, but $object->lines is always limited to $limit |
|
752 | + $num = $result; // $result is total nb of lines, or limit + 1, but $object->lines is always limited to $limit |
|
753 | 753 | |
754 | 754 | if ($result < 0) { |
755 | 755 | setEventMessages($object->error, $object->errors, 'errors'); |
@@ -765,13 +765,13 @@ discard block |
||
765 | 765 | // List of mass actions available |
766 | 766 | $arrayofmassactions = array(); |
767 | 767 | if (getDolGlobalInt('ACCOUNTING_ENABLE_LETTERING') && $user->hasRight('accounting', 'mouvements', 'creer')) { |
768 | - $arrayofmassactions['letteringauto'] = img_picto('', 'check', 'class="pictofixedwidth"') . $langs->trans('LetteringAuto'); |
|
769 | - $arrayofmassactions['preunletteringauto'] = img_picto('', 'uncheck', 'class="pictofixedwidth"') . $langs->trans('UnletteringAuto'); |
|
770 | - $arrayofmassactions['letteringmanual'] = img_picto('', 'check', 'class="pictofixedwidth"') . $langs->trans('LetteringManual'); |
|
768 | + $arrayofmassactions['letteringauto'] = img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans('LetteringAuto'); |
|
769 | + $arrayofmassactions['preunletteringauto'] = img_picto('', 'uncheck', 'class="pictofixedwidth"').$langs->trans('UnletteringAuto'); |
|
770 | + $arrayofmassactions['letteringmanual'] = img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans('LetteringManual'); |
|
771 | 771 | if ($type == 'sub') { |
772 | - $arrayofmassactions['letteringpartial'] = img_picto('', 'check', 'class="pictofixedwidth"') . $langs->trans('LetteringPartial'); |
|
772 | + $arrayofmassactions['letteringpartial'] = img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans('LetteringPartial'); |
|
773 | 773 | } |
774 | - $arrayofmassactions['preunletteringmanual'] = img_picto('', 'uncheck', 'class="pictofixedwidth"') . $langs->trans('UnletteringManual'); |
|
774 | + $arrayofmassactions['preunletteringmanual'] = img_picto('', 'uncheck', 'class="pictofixedwidth"').$langs->trans('UnletteringManual'); |
|
775 | 775 | } |
776 | 776 | if ($user->hasRight('accounting', 'mouvements', 'supprimer')) { |
777 | 777 | $arrayofmassactions['predeletebookkeepingwriting'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); |
@@ -790,7 +790,7 @@ discard block |
||
790 | 790 | print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">'; |
791 | 791 | print '<input type="hidden" name="type" value="'.$type.'">'; |
792 | 792 | if (!empty($socid)) { |
793 | - print '<input type="hidden" name="socid" value="' . $socid . '">'; |
|
793 | + print '<input type="hidden" name="socid" value="'.$socid.'">'; |
|
794 | 794 | } |
795 | 795 | print '<input type="hidden" name="sortfield" value="'.$sortfield.'">'; |
796 | 796 | print '<input type="hidden" name="sortorder" value="'.$sortorder.'">'; |
@@ -807,13 +807,13 @@ discard block |
||
807 | 807 | if (empty($reshook)) { |
808 | 808 | // Remove button navigation if in thirdparty tab mode |
809 | 809 | if (empty($socid)) { |
810 | - $newcardbutton = dolGetButtonTitle($langs->trans('ViewFlatList'), '', 'fa fa-list paddingleft imgforviewmode', DOL_URL_ROOT . '/accountancy/bookkeeping/list.php?' . $param); |
|
810 | + $newcardbutton = dolGetButtonTitle($langs->trans('ViewFlatList'), '', 'fa fa-list paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/list.php?'.$param); |
|
811 | 811 | if ($type == 'sub') { |
812 | - $newcardbutton .= dolGetButtonTitle($langs->trans('GroupByAccountAccounting'), '', 'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT . '/accountancy/bookkeeping/listbyaccount.php?' . $url_param, '', 1, array('morecss' => 'marginleftonly')); |
|
813 | - $newcardbutton .= dolGetButtonTitle($langs->trans('GroupBySubAccountAccounting'), '', 'fa fa-align-left vmirror paddingleft imgforviewmode', DOL_URL_ROOT . '/accountancy/bookkeeping/listbyaccount.php?type=sub&' . $url_param, '', 1, array('morecss' => 'marginleftonly btnTitleSelected')); |
|
812 | + $newcardbutton .= dolGetButtonTitle($langs->trans('GroupByAccountAccounting'), '', 'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/listbyaccount.php?'.$url_param, '', 1, array('morecss' => 'marginleftonly')); |
|
813 | + $newcardbutton .= dolGetButtonTitle($langs->trans('GroupBySubAccountAccounting'), '', 'fa fa-align-left vmirror paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/listbyaccount.php?type=sub&'.$url_param, '', 1, array('morecss' => 'marginleftonly btnTitleSelected')); |
|
814 | 814 | } else { |
815 | - $newcardbutton .= dolGetButtonTitle($langs->trans('GroupByAccountAccounting'), '', 'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT . '/accountancy/bookkeeping/listbyaccount.php?' . $url_param, '', 1, array('morecss' => 'marginleftonly btnTitleSelected')); |
|
816 | - $newcardbutton .= dolGetButtonTitle($langs->trans('GroupBySubAccountAccounting'), '', 'fa fa-align-left vmirror paddingleft imgforviewmode', DOL_URL_ROOT . '/accountancy/bookkeeping/listbyaccount.php?type=sub&' . $url_param, '', 1, array('morecss' => 'marginleftonly')); |
|
815 | + $newcardbutton .= dolGetButtonTitle($langs->trans('GroupByAccountAccounting'), '', 'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/listbyaccount.php?'.$url_param, '', 1, array('morecss' => 'marginleftonly btnTitleSelected')); |
|
816 | + $newcardbutton .= dolGetButtonTitle($langs->trans('GroupBySubAccountAccounting'), '', 'fa fa-align-left vmirror paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/listbyaccount.php?type=sub&'.$url_param, '', 1, array('morecss' => 'marginleftonly')); |
|
817 | 817 | } |
818 | 818 | $newcardbutton .= dolGetButtonTitleSeparator(); |
819 | 819 | } |
@@ -885,8 +885,8 @@ discard block |
||
885 | 885 | } else { |
886 | 886 | $stringforfirstkey .= ' CTL +'; |
887 | 887 | } |
888 | - $moreforfilter .= ' <a id="previous_account" accesskey="p" title="' . $stringforfirstkey . ' p" class="classfortooltip" href="#"><i class="fa fa-chevron-left"></i></a>'; |
|
889 | - $moreforfilter .= ' <a id="next_account" accesskey="n" title="' . $stringforfirstkey . ' n" class="classfortooltip" href="#"><i class="fa fa-chevron-right"></i></a>'; |
|
888 | + $moreforfilter .= ' <a id="previous_account" accesskey="p" title="'.$stringforfirstkey.' p" class="classfortooltip" href="#"><i class="fa fa-chevron-left"></i></a>'; |
|
889 | + $moreforfilter .= ' <a id="next_account" accesskey="n" title="'.$stringforfirstkey.' n" class="classfortooltip" href="#"><i class="fa fa-chevron-right"></i></a>'; |
|
890 | 890 | $moreforfilter .= <<<SCRIPT |
891 | 891 | <script type="text/javascript"> |
892 | 892 | jQuery(document).ready(function() { |
@@ -917,7 +917,7 @@ discard block |
||
917 | 917 | |
918 | 918 | if (empty($socid)) { |
919 | 919 | $moreforfilter .= '<div class="divsearchfield">'; |
920 | - $moreforfilter .= $langs->trans('AccountingCategory') . ': '; |
|
920 | + $moreforfilter .= $langs->trans('AccountingCategory').': '; |
|
921 | 921 | $moreforfilter .= '<div class="nowrap inline-block">'; |
922 | 922 | $moreforfilter .= $formaccounting->select_accounting_category($search_account_category, 'search_account_category', 1, 0, 0, 0); |
923 | 923 | $moreforfilter .= '</div>'; |
@@ -1104,9 +1104,9 @@ discard block |
||
1104 | 1104 | |
1105 | 1105 | $displayed_account_number = null; // Start with undefined to be able to distinguish with empty |
1106 | 1106 | |
1107 | -$objectstatic = null; // Init for static analysis |
|
1108 | -$objectlink = ''; // Init for static analysis |
|
1109 | -$result = -1; // Init for static analysis |
|
1107 | +$objectstatic = null; // Init for static analysis |
|
1108 | +$objectlink = ''; // Init for static analysis |
|
1109 | +$result = -1; // Init for static analysis |
|
1110 | 1110 | |
1111 | 1111 | // Loop on record |
1112 | 1112 | // -------------------------------------------------------------------- |
@@ -1122,8 +1122,8 @@ discard block |
||
1122 | 1122 | $totalarray['val']['totalbalance'] = 0; |
1123 | 1123 | |
1124 | 1124 | // Init for static analysis |
1125 | -$colspan = 0; // colspan before field 'label of operation' |
|
1126 | -$colspanend = 0; // colspan after debit/credit |
|
1125 | +$colspan = 0; // colspan before field 'label of operation' |
|
1126 | +$colspanend = 0; // colspan after debit/credit |
|
1127 | 1127 | $accountg = '-'; |
1128 | 1128 | |
1129 | 1129 | while ($i < min($num, $limit)) { |
@@ -1136,8 +1136,8 @@ discard block |
||
1136 | 1136 | } |
1137 | 1137 | //if (empty($accountg)) $accountg = '-'; |
1138 | 1138 | |
1139 | - $colspan = 0; // colspan before field 'label of operation' |
|
1140 | - $colspanend = 0; // colspan after debit/credit |
|
1139 | + $colspan = 0; // colspan before field 'label of operation' |
|
1140 | + $colspanend = 0; // colspan after debit/credit |
|
1141 | 1141 | if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { |
1142 | 1142 | $colspan++; |
1143 | 1143 | } |
@@ -1190,9 +1190,9 @@ discard block |
||
1190 | 1190 | if (isset($displayed_account_number)) { |
1191 | 1191 | print '<tr class="liste_total">'; |
1192 | 1192 | if ($type == 'sub') { |
1193 | - print '<td class="right" colspan="' . $colspan . '">' . $langs->trans("TotalForAccount") . ' ' . length_accounta($displayed_account_number) . ':</td>'; |
|
1193 | + print '<td class="right" colspan="'.$colspan.'">'.$langs->trans("TotalForAccount").' '.length_accounta($displayed_account_number).':</td>'; |
|
1194 | 1194 | } else { |
1195 | - print '<td class="right" colspan="' . $colspan . '">' . $langs->trans("TotalForAccount") . ' ' . length_accountg($displayed_account_number) . ':</td>'; |
|
1195 | + print '<td class="right" colspan="'.$colspan.'">'.$langs->trans("TotalForAccount").' '.length_accountg($displayed_account_number).':</td>'; |
|
1196 | 1196 | } |
1197 | 1197 | print '<td class="nowrap right">'.price(price2num($sous_total_debit, 'MT')).'</td>'; |
1198 | 1198 | print '<td class="nowrap right">'.price(price2num($sous_total_credit, 'MT')).'</td>'; |
@@ -1231,9 +1231,9 @@ discard block |
||
1231 | 1231 | print length_accounta($line->subledger_account); |
1232 | 1232 | } else { |
1233 | 1233 | // Should not happen: subledger account must be null or a non empty value |
1234 | - print '<span class="error">' . $langs->trans("Unknown"); |
|
1234 | + print '<span class="error">'.$langs->trans("Unknown"); |
|
1235 | 1235 | if ($line->subledger_label) { |
1236 | - print ' (' . $line->subledger_label . ')'; |
|
1236 | + print ' ('.$line->subledger_label.')'; |
|
1237 | 1237 | $htmltext = 'EmptyStringForSubledgerAccountButSubledgerLabelDefined'; |
1238 | 1238 | } else { |
1239 | 1239 | $htmltext = 'EmptyStringForSubledgerAccountAndSubledgerLabel'; |
@@ -1243,9 +1243,9 @@ discard block |
||
1243 | 1243 | } |
1244 | 1244 | } else { |
1245 | 1245 | if ($line->numero_compte != "" && $line->numero_compte != '-1') { |
1246 | - print length_accountg($line->numero_compte) . ' : ' . $object->get_compte_desc($line->numero_compte); |
|
1246 | + print length_accountg($line->numero_compte).' : '.$object->get_compte_desc($line->numero_compte); |
|
1247 | 1247 | } else { |
1248 | - print '<span class="error">' . $langs->trans("Unknown") . '</span>'; |
|
1248 | + print '<span class="error">'.$langs->trans("Unknown").'</span>'; |
|
1249 | 1249 | } |
1250 | 1250 | } |
1251 | 1251 | print '</td>'; |
@@ -1268,7 +1268,7 @@ discard block |
||
1268 | 1268 | if (in_array($line->id, $arrayofselected)) { |
1269 | 1269 | $selected = 1; |
1270 | 1270 | } |
1271 | - print '<input id="cb' . $line->id . '" class="flat checkforselect" type="checkbox" name="toselect[]" value="' . $line->id . '"' . ($selected ? ' checked="checked"' : '') . ' />'; |
|
1271 | + print '<input id="cb'.$line->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$line->id.'"'.($selected ? ' checked="checked"' : '').' />'; |
|
1272 | 1272 | } |
1273 | 1273 | print '</td>'; |
1274 | 1274 | if (!$i) { |
@@ -1362,7 +1362,7 @@ discard block |
||
1362 | 1362 | } elseif ($line->doc_type == 'bank') { |
1363 | 1363 | print $objectstatic->getNomUrl(1); |
1364 | 1364 | $bank_ref = strstr($line->doc_ref, '-'); |
1365 | - print " " . $bank_ref; |
|
1365 | + print " ".$bank_ref; |
|
1366 | 1366 | } else { |
1367 | 1367 | print $line->doc_ref; |
1368 | 1368 | } |
@@ -1475,7 +1475,7 @@ discard block |
||
1475 | 1475 | if (in_array($line->id, $arrayofselected)) { |
1476 | 1476 | $selected = 1; |
1477 | 1477 | } |
1478 | - print '<input id="cb' . $line->id . '" class="flat checkforselect" type="checkbox" name="toselect[]" value="' . $line->id . '"' . ($selected ? ' checked="checked"' : '') . ' />'; |
|
1478 | + print '<input id="cb'.$line->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$line->id.'"'.($selected ? ' checked="checked"' : '').' />'; |
|
1479 | 1479 | } |
1480 | 1480 | print '</td>'; |
1481 | 1481 | if (!$i) { |
@@ -1536,7 +1536,7 @@ discard block |
||
1536 | 1536 | } |
1537 | 1537 | |
1538 | 1538 | // Show total line |
1539 | -$trforbreaknobg = 1; // used in list_print_total.tpl.php |
|
1539 | +$trforbreaknobg = 1; // used in list_print_total.tpl.php |
|
1540 | 1540 | include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php'; |
1541 | 1541 | |
1542 | 1542 | // If no record found |
@@ -173,9 +173,9 @@ discard block |
||
173 | 173 | $sql = "SELECT date_start, date_end"; |
174 | 174 | $sql .= " FROM ".MAIN_DB_PREFIX."accounting_fiscalyear "; |
175 | 175 | if (getDolGlobalInt('ACCOUNTANCY_FISCALYEAR_DEFAULT')) { |
176 | - $sql .= " WHERE rowid = " . getDolGlobalInt('ACCOUNTANCY_FISCALYEAR_DEFAULT'); |
|
176 | + $sql .= " WHERE rowid = ".getDolGlobalInt('ACCOUNTANCY_FISCALYEAR_DEFAULT'); |
|
177 | 177 | } else { |
178 | - $sql .= " WHERE date_start < '" . $db->idate(dol_now()) . "' and date_end > '" . $db->idate(dol_now()) . "'"; |
|
178 | + $sql .= " WHERE date_start < '".$db->idate(dol_now())."' and date_end > '".$db->idate(dol_now())."'"; |
|
179 | 179 | } |
180 | 180 | $sql .= $db->plimit(1); |
181 | 181 | $res = $db->query($sql); |
@@ -692,7 +692,7 @@ discard block |
||
692 | 692 | |
693 | 693 | if ($setfields) { |
694 | 694 | $sql = " UPDATE ".MAIN_DB_PREFIX."accounting_bookkeeping"; |
695 | - $sql .= " SET ".$setfields; // $setfields is already a sanitized SQL string |
|
695 | + $sql .= " SET ".$setfields; // $setfields is already a sanitized SQL string |
|
696 | 696 | $sql .= " WHERE rowid = ".((int) $movement->id); |
697 | 697 | |
698 | 698 | $result = $db->query($sql); |
@@ -732,7 +732,7 @@ discard block |
||
732 | 732 | // Ajout directives pour resoudre bug IE |
733 | 733 | header('Cache-Control: Public, must-revalidate'); |
734 | 734 | header('Pragma: public'); |
735 | - header('Content-Length: ' . dol_filesize($downloadFilePath)); |
|
735 | + header('Content-Length: '.dol_filesize($downloadFilePath)); |
|
736 | 736 | |
737 | 737 | readfileLowMemory($downloadFilePath); |
738 | 738 | } else { |
@@ -805,7 +805,7 @@ discard block |
||
805 | 805 | $form_question['formatexport'] = array( |
806 | 806 | 'name' => 'formatexport', |
807 | 807 | 'type' => 'select', |
808 | - 'label' => $langs->trans('Modelcsv'), // TODO Use Selectmodelcsv and show a select combo |
|
808 | + 'label' => $langs->trans('Modelcsv'), // TODO Use Selectmodelcsv and show a select combo |
|
809 | 809 | 'values' => $listofformat, |
810 | 810 | 'default' => $formatexportset, |
811 | 811 | 'morecss' => 'minwidth200 maxwidth200' |
@@ -1328,7 +1328,7 @@ discard block |
||
1328 | 1328 | |
1329 | 1329 | $labeltoshowhtml = ''; |
1330 | 1330 | $labeltoshowalt = ''; |
1331 | - if (($objectstatic instanceof CommonObject) && in_array($line->doc_type, array('customer_invoice', 'supplier_invoice', 'expense_report'))) { |
|
1331 | + if (($objectstatic instanceof CommonObject) && in_array($line->doc_type, array('customer_invoice', 'supplier_invoice', 'expense_report'))) { |
|
1332 | 1332 | if ($objectstatic->id > 0) { |
1333 | 1333 | $labeltoshowhtml .= $objectstatic->getNomUrl(1, '', 0, 0, '', 0, -1, 1); |
1334 | 1334 | $labeltoshowhtml .= $documentlink; |
@@ -1340,8 +1340,8 @@ discard block |
||
1340 | 1340 | $labeltoshowhtml .= $objectstatic->getNomUrl(1); |
1341 | 1341 | $labeltoshowalt .= $objectstatic->ref; |
1342 | 1342 | $bank_ref = strstr($line->doc_ref, '-'); |
1343 | - $labeltoshowhtml .= " " . $bank_ref; |
|
1344 | - $labeltoshowalt .= " " . $bank_ref; |
|
1343 | + $labeltoshowhtml .= " ".$bank_ref; |
|
1344 | + $labeltoshowalt .= " ".$bank_ref; |
|
1345 | 1345 | } else { |
1346 | 1346 | $labeltoshowhtml .= $line->doc_ref; |
1347 | 1347 | $labeltoshowalt .= $line->doc_ref; |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | |
63 | 63 | $id = GETPOSTINT('id'); // id of record |
64 | 64 | $mode = GETPOST('mode', 'aZ09'); // '' or '_tmp' |
65 | -$piece_num = GETPOSTINT("piece_num") ? GETPOSTINT("piece_num") : GETPOST('ref'); // id of transaction (several lines share the same transaction id) |
|
65 | +$piece_num = GETPOSTINT("piece_num") ? GETPOSTINT("piece_num") : GETPOST('ref'); // id of transaction (several lines share the same transaction id) |
|
66 | 66 | |
67 | 67 | $accountingaccount = new AccountingAccount($db); |
68 | 68 | $accountingjournal = new AccountingJournal($db); |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | $error = 0; |
128 | 128 | |
129 | 129 | if ($cancel) { |
130 | - header("Location: ". $backtopage . (!empty($type) ? '?type=sub' : '')); |
|
130 | + header("Location: ".$backtopage.(!empty($type) ? '?type=sub' : '')); |
|
131 | 131 | exit; |
132 | 132 | } |
133 | 133 | |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | if (GETPOSTINT('doc_datemonth') && GETPOSTINT('doc_dateday') && GETPOSTINT('doc_dateyear')) { |
202 | 202 | $datedoc = dol_mktime(0, 0, 0, GETPOSTINT('doc_datemonth'), GETPOSTINT('doc_dateday'), GETPOSTINT('doc_dateyear')); |
203 | 203 | } else { |
204 | - $datedoc = (int) GETPOSTINT('doc_date'); // TODO Use instead the mode day-month-year |
|
204 | + $datedoc = (int) GETPOSTINT('doc_date'); // TODO Use instead the mode day-month-year |
|
205 | 205 | } |
206 | 206 | |
207 | 207 | $object = new BookKeeping($db); |
@@ -360,7 +360,7 @@ discard block |
||
360 | 360 | if ($result < 0) { |
361 | 361 | setEventMessages($object->error, $object->errors, 'errors'); |
362 | 362 | } else { |
363 | - header("Location: " . $backtopage . "?sortfield=t.piece_num&sortorder=asc" . ($type ? '&type='.$type : '')); |
|
363 | + header("Location: ".$backtopage."?sortfield=t.piece_num&sortorder=asc".($type ? '&type='.$type : '')); |
|
364 | 364 | exit; |
365 | 365 | } |
366 | 366 | } |
@@ -689,7 +689,7 @@ discard block |
||
689 | 689 | // Due date (if invoice) |
690 | 690 | //if (in_array($object->doc_type, array('customer_invoice', 'supplier_invoice'))) { |
691 | 691 | print '<tr>'; |
692 | - print '<td class="titlefield">' . $form->textwithpicto($langs->trans('DateDue'), $langs->trans("IfTransactionHasDueDate")) . '</td>'; |
|
692 | + print '<td class="titlefield">'.$form->textwithpicto($langs->trans('DateDue'), $langs->trans("IfTransactionHasDueDate")).'</td>'; |
|
693 | 693 | print '<td>'; |
694 | 694 | print $object->date_lim_reglement ? dol_print_date($object->date_lim_reglement, 'day') : ' '; |
695 | 695 | print '</td>'; |
@@ -700,7 +700,7 @@ discard block |
||
700 | 700 | if ($mode != "_tmp") { |
701 | 701 | // Date document export |
702 | 702 | print '<tr>'; |
703 | - print '<td class="titlefield">' . $langs->trans("DateExport") . '</td>'; |
|
703 | + print '<td class="titlefield">'.$langs->trans("DateExport").'</td>'; |
|
704 | 704 | print '<td>'; |
705 | 705 | print $object->date_export ? dol_print_date($object->date_export, 'dayhour') : ' '; |
706 | 706 | print '</td>'; |
@@ -708,7 +708,7 @@ discard block |
||
708 | 708 | |
709 | 709 | // Date document validation |
710 | 710 | print '<tr>'; |
711 | - print '<td class="titlefield">' . $langs->trans("DateValidation") . '</td>'; |
|
711 | + print '<td class="titlefield">'.$langs->trans("DateValidation").'</td>'; |
|
712 | 712 | print '<td>'; |
713 | 713 | print $object->date_validation ? dol_print_date($object->date_validation, 'dayhour') : ' '; |
714 | 714 | print '</td>'; |
@@ -717,7 +717,7 @@ discard block |
||
717 | 717 | // Id_import |
718 | 718 | if (!empty($object->import_key)) { |
719 | 719 | print '<tr>'; |
720 | - print '<td class="titlefield">' . $langs->trans("ImportId") . '</td>'; |
|
720 | + print '<td class="titlefield">'.$langs->trans("ImportId").'</td>'; |
|
721 | 721 | print '<td>'; |
722 | 722 | print $object->import_key; |
723 | 723 | print '</td>'; |
@@ -776,7 +776,7 @@ discard block |
||
776 | 776 | print dol_get_fiche_end(); |
777 | 777 | |
778 | 778 | |
779 | - $result = $object->fetchAllPerMvt($piece_num, $mode); // This load $object->linesmvt |
|
779 | + $result = $object->fetchAllPerMvt($piece_num, $mode); // This load $object->linesmvt |
|
780 | 780 | |
781 | 781 | if ($result < 0) { |
782 | 782 | setEventMessages($object->error, $object->errors, 'errors'); |
@@ -906,14 +906,14 @@ discard block |
||
906 | 906 | if (getDolGlobalString('ACCOUNTANCY_COMBO_FOR_AUX')) { |
907 | 907 | print $formaccounting->select_auxaccount('', 'subledger_account', 1, 'maxwidth250', '', 'subledger_label'); |
908 | 908 | } else { |
909 | - print '<input type="text" class="maxwidth150" name="subledger_account" value="" placeholder="' . dol_escape_htmltag($langs->trans("SubledgerAccount")) . '">'; |
|
909 | + print '<input type="text" class="maxwidth150" name="subledger_account" value="" placeholder="'.dol_escape_htmltag($langs->trans("SubledgerAccount")).'">'; |
|
910 | 910 | } |
911 | - print '<br><input type="text" class="maxwidth150" name="subledger_label" value="" placeholder="' . dol_escape_htmltag($langs->trans("SubledgerAccountLabel")) . '">'; |
|
911 | + print '<br><input type="text" class="maxwidth150" name="subledger_label" value="" placeholder="'.dol_escape_htmltag($langs->trans("SubledgerAccountLabel")).'">'; |
|
912 | 912 | print '</td>'; |
913 | - print '<td><input type="text" class="minwidth200" name="label_operation" value="' . dol_escape_htmltag($label_operation) . '"/></td>'; |
|
913 | + print '<td><input type="text" class="minwidth200" name="label_operation" value="'.dol_escape_htmltag($label_operation).'"/></td>'; |
|
914 | 914 | print '<td class="right"><input type="text" class="right width50" name="debit" value=""/></td>'; |
915 | 915 | print '<td class="right"><input type="text" class="right width50" name="credit" value=""/></td>'; |
916 | - print '<td class="center"><input type="submit" class="button small" name="save" value="' . $langs->trans("Add") . '"></td>'; |
|
916 | + print '<td class="center"><input type="submit" class="button small" name="save" value="'.$langs->trans("Add").'"></td>'; |
|
917 | 917 | print "</tr>\n"; |
918 | 918 | } |
919 | 919 | } else { |
@@ -939,7 +939,7 @@ discard block |
||
939 | 939 | print '<td class="center nowraponall">'; |
940 | 940 | if ($permissiontoadd) { |
941 | 941 | if (empty($line->date_export) && empty($line->date_validation)) { |
942 | - print '<a class="editfielda reposition" href="' . $_SERVER["PHP_SELF"] . '?action=update&id=' . $line->id . '&piece_num=' . ((int) $line->piece_num) . '&mode=' . urlencode((string) $mode) . '&token=' . urlencode(newToken()) . '">'; |
|
942 | + print '<a class="editfielda reposition" href="'.$_SERVER["PHP_SELF"].'?action=update&id='.$line->id.'&piece_num='.((int) $line->piece_num).'&mode='.urlencode((string) $mode).'&token='.urlencode(newToken()).'">'; |
|
943 | 943 | print img_edit('', 0, 'class="marginrightonly"'); |
944 | 944 | print '</a> '; |
945 | 945 | } else { |
@@ -954,7 +954,7 @@ discard block |
||
954 | 954 | $actiontodelete = 'confirm_delete'; |
955 | 955 | } |
956 | 956 | |
957 | - print '<a href="' . $_SERVER["PHP_SELF"] . '?action=' . $actiontodelete . '&id=' . $line->id . '&piece_num=' . ((int) $line->piece_num) . '&mode=' . urlencode((string) $mode) . '&token=' . urlencode(newToken()) . '">'; |
|
957 | + print '<a href="'.$_SERVER["PHP_SELF"].'?action='.$actiontodelete.'&id='.$line->id.'&piece_num='.((int) $line->piece_num).'&mode='.urlencode((string) $mode).'&token='.urlencode(newToken()).'">'; |
|
958 | 958 | print img_delete(); |
959 | 959 | print '</a>'; |
960 | 960 | } else { |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | if ($fiscal_period_id == $fiscal_period['id'] || (empty($fiscal_period_id) && $fiscal_period['date_start'] <= $now && $now <= $fiscal_period['date_end'])) { |
98 | 98 | $current_fiscal_period = $fiscal_period; |
99 | 99 | } else { |
100 | - $last_fiscal_period = $fiscal_period; // $last_fiscal_period is in fact $previous_fiscal_period |
|
100 | + $last_fiscal_period = $fiscal_period; // $last_fiscal_period is in fact $previous_fiscal_period |
|
101 | 101 | } |
102 | 102 | } |
103 | 103 | } |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | if ($result > 0) { |
147 | 147 | setEventMessages($langs->trans("AllMovementsWereRecordedAsValidated"), null, 'mesgs'); |
148 | 148 | |
149 | - header("Location: " . $_SERVER['PHP_SELF'] . (isset($current_fiscal_period) ? '?fiscal_period_id=' . $current_fiscal_period['id'] : '')); |
|
149 | + header("Location: ".$_SERVER['PHP_SELF'].(isset($current_fiscal_period) ? '?fiscal_period_id='.$current_fiscal_period['id'] : '')); |
|
150 | 150 | exit; |
151 | 151 | } else { |
152 | 152 | setEventMessages($langs->trans("NotAllMovementsCouldBeRecordedAsValidated"), null, 'errors'); |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | } else { |
177 | 177 | setEventMessages($langs->trans("AccountancyClosureCloseSuccessfully"), null, 'mesgs'); |
178 | 178 | |
179 | - header("Location: " . $_SERVER['PHP_SELF'] . (isset($current_fiscal_period) ? '?fiscal_period_id=' . $current_fiscal_period['id'] : '')); |
|
179 | + header("Location: ".$_SERVER['PHP_SELF'].(isset($current_fiscal_period) ? '?fiscal_period_id='.$current_fiscal_period['id'] : '')); |
|
180 | 180 | exit; |
181 | 181 | } |
182 | 182 | } |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | } else { |
193 | 193 | setEventMessages($langs->trans("AccountancyClosureInsertAccountingReversalSuccessfully"), null, 'mesgs'); |
194 | 194 | |
195 | - header("Location: " . $_SERVER['PHP_SELF'] . (isset($current_fiscal_period) ? '?fiscal_period_id=' . $current_fiscal_period['id'] : '')); |
|
195 | + header("Location: ".$_SERVER['PHP_SELF'].(isset($current_fiscal_period) ? '?fiscal_period_id='.$current_fiscal_period['id'] : '')); |
|
196 | 196 | exit; |
197 | 197 | } |
198 | 198 | } |
@@ -233,7 +233,7 @@ discard block |
||
233 | 233 | ); |
234 | 234 | |
235 | 235 | $formconfirm = $form->formconfirm( |
236 | - $_SERVER["PHP_SELF"] . '?fiscal_period_id=' . $current_fiscal_period['id'], |
|
236 | + $_SERVER["PHP_SELF"].'?fiscal_period_id='.$current_fiscal_period['id'], |
|
237 | 237 | $langs->trans('ValidateMovements'), |
238 | 238 | $langs->trans('DescValidateMovements', $langs->transnoentitiesnoconv("RegistrationInAccounting")), |
239 | 239 | 'confirm_step_1', |
@@ -271,7 +271,7 @@ discard block |
||
271 | 271 | ); |
272 | 272 | |
273 | 273 | $formconfirm = $form->formconfirm( |
274 | - $_SERVER["PHP_SELF"] . '?fiscal_period_id=' . $current_fiscal_period['id'], |
|
274 | + $_SERVER["PHP_SELF"].'?fiscal_period_id='.$current_fiscal_period['id'], |
|
275 | 275 | $langs->trans('AccountancyClosureClose'), |
276 | 276 | $langs->trans('AccountancyClosureConfirmClose'), |
277 | 277 | 'confirm_step_2', |
@@ -315,7 +315,7 @@ discard block |
||
315 | 315 | ); |
316 | 316 | |
317 | 317 | $formconfirm = $form->formconfirm( |
318 | - $_SERVER["PHP_SELF"] . '?fiscal_period_id=' . $current_fiscal_period['id'], |
|
318 | + $_SERVER["PHP_SELF"].'?fiscal_period_id='.$current_fiscal_period['id'], |
|
319 | 319 | $langs->trans('AccountancyClosureAccountingReversal'), |
320 | 320 | $langs->trans('AccountancyClosureConfirmAccountingReversal'), |
321 | 321 | 'confirm_step_3', |
@@ -342,13 +342,13 @@ discard block |
||
342 | 342 | |
343 | 343 | $fiscal_period_nav_text = $langs->trans("FiscalPeriod"); |
344 | 344 | |
345 | -$fiscal_period_nav_text .= ' <a href="' . (isset($last_fiscal_period) ? $_SERVER["PHP_SELF"] . '?fiscal_period_id=' . $last_fiscal_period['id'] : '#" class="disabled') . '">' . img_previous() . '</a>'; |
|
346 | -$fiscal_period_nav_text .= ' <a href="' . (isset($next_fiscal_period) ? $_SERVER["PHP_SELF"] . '?fiscal_period_id=' . $next_fiscal_period['id'] : '#" class="disabled') . '">' . img_next() . '</a>'; |
|
345 | +$fiscal_period_nav_text .= ' <a href="'.(isset($last_fiscal_period) ? $_SERVER["PHP_SELF"].'?fiscal_period_id='.$last_fiscal_period['id'] : '#" class="disabled').'">'.img_previous().'</a>'; |
|
346 | +$fiscal_period_nav_text .= ' <a href="'.(isset($next_fiscal_period) ? $_SERVER["PHP_SELF"].'?fiscal_period_id='.$next_fiscal_period['id'] : '#" class="disabled').'">'.img_next().'</a>'; |
|
347 | 347 | if (!empty($current_fiscal_period)) { |
348 | - $fiscal_period_nav_text .= $current_fiscal_period['label'].' (' . (isset($current_fiscal_period) ? dol_print_date($current_fiscal_period['date_start'], 'day') . ' - ' . dol_print_date($current_fiscal_period['date_end'], 'day') . ')' : ''); |
|
348 | + $fiscal_period_nav_text .= $current_fiscal_period['label'].' ('.(isset($current_fiscal_period) ? dol_print_date($current_fiscal_period['date_start'], 'day').' - '.dol_print_date($current_fiscal_period['date_end'], 'day').')' : ''); |
|
349 | 349 | } |
350 | 350 | |
351 | -print load_fiche_titre($langs->trans("Closure") . " - " . $fiscal_period_nav_text, '', 'title_accountancy'); |
|
351 | +print load_fiche_titre($langs->trans("Closure")." - ".$fiscal_period_nav_text, '', 'title_accountancy'); |
|
352 | 352 | |
353 | 353 | if (empty($current_fiscal_period)) { |
354 | 354 | print $langs->trans('ErrorNoFiscalPeriodActiveFound', $langs->transnoentitiesnoconv("Accounting"), $langs->transnoentitiesnoconv("Setup"), $langs->transnoentitiesnoconv("FiscalPeriod")); |
@@ -356,12 +356,12 @@ discard block |
||
356 | 356 | if (!getDolGlobalString("ACCOUNTANCY_DISABLE_CLOSURE_LINE_BY_LINE")) { |
357 | 357 | // Step 1 |
358 | 358 | $head = array(); |
359 | - $head[0][0] = DOL_URL_ROOT . '/accountancy/closure/index.php?fiscal_period_id=' . $current_fiscal_period['id']; |
|
359 | + $head[0][0] = DOL_URL_ROOT.'/accountancy/closure/index.php?fiscal_period_id='.$current_fiscal_period['id']; |
|
360 | 360 | $head[0][1] = $langs->trans("Step").' 1 - '.$langs->trans("AccountancyClosureStep1"); |
361 | 361 | $head[0][2] = 'step1'; |
362 | 362 | print dol_get_fiche_head($head, 'step1', '', -1, ''); |
363 | 363 | |
364 | - print '<span class="opacitymedium">' . $langs->trans("AccountancyClosureStep1Desc") . '</span><br>'; |
|
364 | + print '<span class="opacitymedium">'.$langs->trans("AccountancyClosureStep1Desc").'</span><br>'; |
|
365 | 365 | |
366 | 366 | $count_by_month = $object->getCountByMonthForFiscalPeriod((int) $current_fiscal_period['date_start'], (int) $current_fiscal_period['date_end']); |
367 | 367 | |
@@ -370,9 +370,9 @@ discard block |
||
370 | 370 | } |
371 | 371 | |
372 | 372 | if (empty($count_by_month['total'])) { |
373 | - $buttonvalidate = '<a class="butActionRefused classfortooltip" href="#">' . $langs->trans("ValidateMovements") . '</a>'; |
|
373 | + $buttonvalidate = '<a class="butActionRefused classfortooltip" href="#">'.$langs->trans("ValidateMovements").'</a>'; |
|
374 | 374 | } else { |
375 | - $buttonvalidate = '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?action=step_1&token='.newToken().'&fiscal_period_id=' . $current_fiscal_period['id'] . '">' . $langs->trans("ValidateMovements") . '</a>'; |
|
375 | + $buttonvalidate = '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=step_1&token='.newToken().'&fiscal_period_id='.$current_fiscal_period['id'].'">'.$langs->trans("ValidateMovements").'</a>'; |
|
376 | 376 | } |
377 | 377 | print_barre_liste($langs->trans("OverviewOfMovementsNotValidated"), 0, '', '', '', '', '', -1, '', '', 0, $buttonvalidate, '', 0, 1, 0); |
378 | 378 | |
@@ -382,24 +382,24 @@ discard block |
||
382 | 382 | print '<tr class="liste_titre">'; |
383 | 383 | $nb_years = is_array($count_by_month['list']) ? count($count_by_month['list']) : 0; |
384 | 384 | if ($nb_years > 1) { |
385 | - print '<td class="right">' . $langs->trans("Year") . '</td>'; |
|
385 | + print '<td class="right">'.$langs->trans("Year").'</td>'; |
|
386 | 386 | } |
387 | 387 | for ($i = 1; $i <= 12; $i++) { |
388 | - print '<td class="right">' . $langs->trans('MonthShort' . str_pad((string) $i, 2, '0', STR_PAD_LEFT)) . '</td>'; |
|
388 | + print '<td class="right">'.$langs->trans('MonthShort'.str_pad((string) $i, 2, '0', STR_PAD_LEFT)).'</td>'; |
|
389 | 389 | } |
390 | - print '<td class="right"><b>' . $langs->trans("Total") . '</b></td>'; |
|
390 | + print '<td class="right"><b>'.$langs->trans("Total").'</b></td>'; |
|
391 | 391 | print '</tr>'; |
392 | 392 | |
393 | 393 | if (is_array($count_by_month['list'])) { |
394 | 394 | foreach ($count_by_month['list'] as $info) { |
395 | 395 | print '<tr class="oddeven">'; |
396 | 396 | if ($nb_years > 1) { |
397 | - print '<td class="right">' . $info['year'] . '</td>'; |
|
397 | + print '<td class="right">'.$info['year'].'</td>'; |
|
398 | 398 | } |
399 | 399 | for ($i = 1; $i <= 12; $i++) { |
400 | - print '<td class="right">' . ((int) $info['count'][$i]) . '</td>'; |
|
400 | + print '<td class="right">'.((int) $info['count'][$i]).'</td>'; |
|
401 | 401 | } |
402 | - print '<td class="right"><b>' . $info['total'] . '</b></td></tr>'; |
|
402 | + print '<td class="right"><b>'.$info['total'].'</b></td></tr>'; |
|
403 | 403 | } |
404 | 404 | } |
405 | 405 | |
@@ -411,8 +411,8 @@ discard block |
||
411 | 411 | |
412 | 412 | // Step 2 |
413 | 413 | $head = array(); |
414 | - $head[0][0] = DOL_URL_ROOT . '/accountancy/closure/index.php?fiscal_period_id=' . $current_fiscal_period['id']; |
|
415 | - $head[0][1] = $langs->trans("Step"). ' ' . (getDolGlobalString("ACCOUNTANCY_DISABLE_CLOSURE_LINE_BY_LINE") ? '1' : '2').' - '.$langs->trans("AccountancyClosureStep2"); |
|
414 | + $head[0][0] = DOL_URL_ROOT.'/accountancy/closure/index.php?fiscal_period_id='.$current_fiscal_period['id']; |
|
415 | + $head[0][1] = $langs->trans("Step").' '.(getDolGlobalString("ACCOUNTANCY_DISABLE_CLOSURE_LINE_BY_LINE") ? '1' : '2').' - '.$langs->trans("AccountancyClosureStep2"); |
|
416 | 416 | $head[0][2] = 'step2'; |
417 | 417 | print dol_get_fiche_head($head, 'step2', '', -1, ''); |
418 | 418 | |
@@ -420,12 +420,12 @@ discard block |
||
420 | 420 | // print '<span class="opacitymedium">' . $langs->trans("AccountancyClosureStep2Desc") . '</span><br>'; |
421 | 421 | if ((empty($count_by_month['total']) || getDolGlobalString("ACCOUNTANCY_DISABLE_CLOSURE_LINE_BY_LINE")) && empty($current_fiscal_period['status'])) { |
422 | 422 | // If no unlocked record and period still open |
423 | - $button = '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?action=step_2&token='.newToken().'&fiscal_period_id=' . $current_fiscal_period['id'] . '">' . $langs->trans("AccountancyClosureClose") . '</a>'; |
|
423 | + $button = '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=step_2&token='.newToken().'&fiscal_period_id='.$current_fiscal_period['id'].'">'.$langs->trans("AccountancyClosureClose").'</a>'; |
|
424 | 424 | } else { |
425 | 425 | if (!empty($current_fiscal_period['status'])) { |
426 | - $button = '<a class="butActionRefused classfortooltip" href="#" title="The period is already closed. Feature disabled.">' . $langs->trans("AccountancyClosureClose") . '</a>'; |
|
426 | + $button = '<a class="butActionRefused classfortooltip" href="#" title="The period is already closed. Feature disabled.">'.$langs->trans("AccountancyClosureClose").'</a>'; |
|
427 | 427 | } elseif (!empty($count_by_month['total'])) { |
428 | - $button = '<a class="butActionRefused classfortooltip" href="#" title="There is some lines not yet locked. Feature disabled.">' . $langs->trans("AccountancyClosureClose") . '</a>'; |
|
428 | + $button = '<a class="butActionRefused classfortooltip" href="#" title="There is some lines not yet locked. Feature disabled.">'.$langs->trans("AccountancyClosureClose").'</a>'; |
|
429 | 429 | } |
430 | 430 | } |
431 | 431 | print_barre_liste('', 0, '', '', '', '', '', -1, '', '', 0, $button, '', 0, 1, 0); |
@@ -434,17 +434,17 @@ discard block |
||
434 | 434 | |
435 | 435 | // Step 3 |
436 | 436 | $head = array(); |
437 | - $head[0][0] = DOL_URL_ROOT . '/accountancy/closure/index.php?fiscal_period_id=' . $current_fiscal_period['id']; |
|
438 | - $head[0][1] = $langs->trans("Step"). ' ' . (getDolGlobalString("ACCOUNTANCY_DISABLE_CLOSURE_LINE_BY_LINE") ? '2' : '3').' - '.$langs->trans("AccountancyClosureStep3"); |
|
437 | + $head[0][0] = DOL_URL_ROOT.'/accountancy/closure/index.php?fiscal_period_id='.$current_fiscal_period['id']; |
|
438 | + $head[0][1] = $langs->trans("Step").' '.(getDolGlobalString("ACCOUNTANCY_DISABLE_CLOSURE_LINE_BY_LINE") ? '2' : '3').' - '.$langs->trans("AccountancyClosureStep3"); |
|
439 | 439 | $head[0][2] = 'step3'; |
440 | 440 | print dol_get_fiche_head($head, 'step3', '', -1, ''); |
441 | 441 | |
442 | 442 | // print '<span class="opacitymedium">' . $langs->trans("AccountancyClosureStep3Desc") . '</span><br>'; |
443 | 443 | |
444 | 444 | if (empty($current_fiscal_period['status'])) { |
445 | - $button = '<a class="butActionRefused classfortooltip" href="#">' . $langs->trans("AccountancyClosureAccountingReversal") . '</a>'; |
|
445 | + $button = '<a class="butActionRefused classfortooltip" href="#">'.$langs->trans("AccountancyClosureAccountingReversal").'</a>'; |
|
446 | 446 | } else { |
447 | - $button = '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?action=step_3&token='.newToken().'&fiscal_period_id=' . $current_fiscal_period['id'] . '">' . $langs->trans("AccountancyClosureAccountingReversal") . '</a>'; |
|
447 | + $button = '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=step_3&token='.newToken().'&fiscal_period_id='.$current_fiscal_period['id'].'">'.$langs->trans("AccountancyClosureAccountingReversal").'</a>'; |
|
448 | 448 | } |
449 | 449 | print_barre_liste('', 0, '', '', '', '', '', -1, '', '', 0, $button, '', 0, 1, 0); |
450 | 450 | } |
@@ -366,7 +366,7 @@ discard block |
||
366 | 366 | if (getDolGlobalString('EXPEDITION_ADDON_NUMBER')) { |
367 | 367 | $mybool = false; |
368 | 368 | |
369 | - $file = getDolGlobalString('EXPEDITION_ADDON_NUMBER') . ".php"; |
|
369 | + $file = getDolGlobalString('EXPEDITION_ADDON_NUMBER').".php"; |
|
370 | 370 | $classname = getDolGlobalString('EXPEDITION_ADDON_NUMBER'); |
371 | 371 | |
372 | 372 | // Include file with class |
@@ -702,7 +702,7 @@ discard block |
||
702 | 702 | $this->ref_ext = $obj->ref_ext; |
703 | 703 | $this->status = $obj->fk_statut; |
704 | 704 | $this->statut = $this->status; // Deprecated |
705 | - $this->signed_status = $obj->signed_status; |
|
705 | + $this->signed_status = $obj->signed_status; |
|
706 | 706 | $this->user_author_id = $obj->fk_user_author; |
707 | 707 | $this->fk_user_author = $obj->fk_user_author; |
708 | 708 | $this->date_creation = $this->db->jdate($obj->date_creation); |
@@ -1040,7 +1040,7 @@ discard block |
||
1040 | 1040 | // If product need a batch number, we should not have called this function but addline_batch instead. |
1041 | 1041 | // If this happen, we may have a bug in card.php page |
1042 | 1042 | if (isModEnabled('productbatch') && !empty($orderline->fk_product) && !empty($orderline->product_tobatch)) { |
1043 | - $this->error = 'ADDLINE_WAS_CALLED_INSTEAD_OF_ADDLINEBATCH '.$orderline->id.' '.$orderline->fk_product; // |
|
1043 | + $this->error = 'ADDLINE_WAS_CALLED_INSTEAD_OF_ADDLINEBATCH '.$orderline->id.' '.$orderline->fk_product; // |
|
1044 | 1044 | return -4; |
1045 | 1045 | } |
1046 | 1046 | |
@@ -1636,8 +1636,8 @@ discard block |
||
1636 | 1636 | $this->db->commit(); |
1637 | 1637 | |
1638 | 1638 | // Delete record into ECM index (Note that delete is also done when deleting files with the dol_delete_dir_recursive |
1639 | - $this->deleteEcmFiles(0); // Deleting files physically is done later with the dol_delete_dir_recursive |
|
1640 | - $this->deleteEcmFiles(1); // Deleting files physically is done later with the dol_delete_dir_recursive |
|
1639 | + $this->deleteEcmFiles(0); // Deleting files physically is done later with the dol_delete_dir_recursive |
|
1640 | + $this->deleteEcmFiles(1); // Deleting files physically is done later with the dol_delete_dir_recursive |
|
1641 | 1641 | |
1642 | 1642 | // We delete PDFs |
1643 | 1643 | $ref = dol_sanitizeFileName($this->ref); |
@@ -1713,7 +1713,7 @@ discard block |
||
1713 | 1713 | $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON p.rowid = cd.fk_product"; |
1714 | 1714 | $sql .= " WHERE ed.fk_expedition = ".((int) $this->id); |
1715 | 1715 | $sql .= " AND ed.fk_elementdet = cd.rowid"; |
1716 | - $sql .= " ORDER BY cd.rang, ed.fk_elementdet"; // We need after a break on fk_elementdet but when there is no break on fk_elementdet, cd.rang is same so we can add it as first order criteria. |
|
1716 | + $sql .= " ORDER BY cd.rang, ed.fk_elementdet"; // We need after a break on fk_elementdet but when there is no break on fk_elementdet, cd.rang is same so we can add it as first order criteria. |
|
1717 | 1717 | |
1718 | 1718 | dol_syslog(get_class($this)."::fetch_lines", LOG_DEBUG); |
1719 | 1719 | $resql = $this->db->query($sql); |
@@ -1747,9 +1747,9 @@ discard block |
||
1747 | 1747 | $line->entrepot_id = 0; // entrepod_id in details_entrepot |
1748 | 1748 | $line->qty_shipped += $obj->qty_shipped; |
1749 | 1749 | } else { |
1750 | - $line = new ExpeditionLigne($this->db); // new group to start |
|
1751 | - $line->entrepot_id = $obj->fk_entrepot; // this is a property of a shipment line |
|
1752 | - $line->qty_shipped = $obj->qty_shipped; // this is a property of a shipment line |
|
1750 | + $line = new ExpeditionLigne($this->db); // new group to start |
|
1751 | + $line->entrepot_id = $obj->fk_entrepot; // this is a property of a shipment line |
|
1752 | + $line->qty_shipped = $obj->qty_shipped; // this is a property of a shipment line |
|
1753 | 1753 | } |
1754 | 1754 | |
1755 | 1755 | $detail_entrepot = new stdClass(); |
@@ -1762,13 +1762,13 @@ discard block |
||
1762 | 1762 | $line->rowid = $obj->line_id; // TODO deprecated |
1763 | 1763 | $line->id = $obj->line_id; |
1764 | 1764 | |
1765 | - $line->fk_origin = 'orderline'; // TODO deprecated, we already have element_type that can be use to guess type of line |
|
1765 | + $line->fk_origin = 'orderline'; // TODO deprecated, we already have element_type that can be use to guess type of line |
|
1766 | 1766 | |
1767 | - $line->fk_element = $obj->fk_element; |
|
1768 | - $line->origin_id = $obj->fk_element; |
|
1769 | - $line->fk_elementdet = $obj->fk_elementdet; |
|
1770 | - $line->origin_line_id = $obj->fk_elementdet; |
|
1771 | - $line->element_type = $obj->element_type; |
|
1767 | + $line->fk_element = $obj->fk_element; |
|
1768 | + $line->origin_id = $obj->fk_element; |
|
1769 | + $line->fk_elementdet = $obj->fk_elementdet; |
|
1770 | + $line->origin_line_id = $obj->fk_elementdet; |
|
1771 | + $line->element_type = $obj->element_type; |
|
1772 | 1772 | |
1773 | 1773 | $line->fk_expedition = $this->id; // id of parent |
1774 | 1774 | |
@@ -2033,7 +2033,7 @@ discard block |
||
2033 | 2033 | } |
2034 | 2034 | $result .= $linkend; |
2035 | 2035 | global $action; |
2036 | - $hookmanager->initHooks(array($this->element . 'dao')); |
|
2036 | + $hookmanager->initHooks(array($this->element.'dao')); |
|
2037 | 2037 | $parameters = array('id' => $this->id, 'getnomurl' => &$result); |
2038 | 2038 | $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks |
2039 | 2039 | if ($reshook > 0) { |
@@ -2082,9 +2082,9 @@ discard block |
||
2082 | 2082 | $statusType = 'status9'; |
2083 | 2083 | } |
2084 | 2084 | |
2085 | - $signed_label = ' (' . $this->getLibSignedStatus() . ')'; |
|
2086 | - $status_label = $this->signed_status ? $labelStatus . $signed_label : $labelStatus; |
|
2087 | - $status_label_short = $this->signed_status ? $labelStatusShort . $signed_label : $labelStatusShort; |
|
2085 | + $signed_label = ' ('.$this->getLibSignedStatus().')'; |
|
2086 | + $status_label = $this->signed_status ? $labelStatus.$signed_label : $labelStatus; |
|
2087 | + $status_label_short = $this->signed_status ? $labelStatusShort.$signed_label : $labelStatusShort; |
|
2088 | 2088 | |
2089 | 2089 | return dolGetStatus($status_label, $status_label_short, '', $statusType, $mode); |
2090 | 2090 | } |
@@ -2171,7 +2171,7 @@ discard block |
||
2171 | 2171 | $this->note_private = 'Private note'; |
2172 | 2172 | $this->note_public = 'Public note'; |
2173 | 2173 | |
2174 | - $nbp = min(1000, GETPOSTINT('nblines') ? GETPOSTINT('nblines') : 5); // We can force the nb of lines to test from command line (but not more than 1000) |
|
2174 | + $nbp = min(1000, GETPOSTINT('nblines') ? GETPOSTINT('nblines') : 5); // We can force the nb of lines to test from command line (but not more than 1000) |
|
2175 | 2175 | $xnbp = 0; |
2176 | 2176 | while ($xnbp < $nbp) { |
2177 | 2177 | $line = new ExpeditionLigne($this->db); |
@@ -2183,7 +2183,7 @@ discard block |
||
2183 | 2183 | $line->fk_product = $this->commande->lines[$xnbp]->fk_product; |
2184 | 2184 | |
2185 | 2185 | $line->weight = 1.123456; |
2186 | - $line->weight_units = 0; // kg |
|
2186 | + $line->weight_units = 0; // kg |
|
2187 | 2187 | |
2188 | 2188 | $line->volume = 2.34567; |
2189 | 2189 | $line->volume_unit = 0; |
@@ -2401,12 +2401,12 @@ discard block |
||
2401 | 2401 | if ($shipments_match_order) { |
2402 | 2402 | dol_syslog("Qty for the ".count($order->lines)." lines of the origin order is same than qty for lines in the shipment we close (shipments_match_order is true), with new status Expedition::STATUS_CLOSED=".self::STATUS_CLOSED.', so we close order'); |
2403 | 2403 | // We close the order |
2404 | - $order->cloture($user); // Note this may also create an invoice if module workflow ask it |
|
2404 | + $order->cloture($user); // Note this may also create an invoice if module workflow ask it |
|
2405 | 2405 | } |
2406 | 2406 | } |
2407 | 2407 | |
2408 | - $this->statut = self::STATUS_CLOSED; // Will be revert to STATUS_VALIDATED at end if there is a rollback |
|
2409 | - $this->status = self::STATUS_CLOSED; // Will be revert to STATUS_VALIDATED at end if there is a rollback |
|
2408 | + $this->statut = self::STATUS_CLOSED; // Will be revert to STATUS_VALIDATED at end if there is a rollback |
|
2409 | + $this->status = self::STATUS_CLOSED; // Will be revert to STATUS_VALIDATED at end if there is a rollback |
|
2410 | 2410 | |
2411 | 2411 | // If stock increment is done on closing |
2412 | 2412 | if (!$error && isModEnabled('stock') && getDolGlobalString('STOCK_CALCULATE_ON_SHIPMENT_CLOSE')) { |
@@ -2454,7 +2454,7 @@ discard block |
||
2454 | 2454 | |
2455 | 2455 | $error = 0; |
2456 | 2456 | |
2457 | - require_once DOL_DOCUMENT_ROOT . '/product/stock/class/mouvementstock.class.php'; |
|
2457 | + require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php'; |
|
2458 | 2458 | |
2459 | 2459 | $langs->load("agenda"); |
2460 | 2460 | |
@@ -2464,14 +2464,14 @@ discard block |
||
2464 | 2464 | $sql .= " e.ref,"; |
2465 | 2465 | $sql .= " edb.rowid as edbrowid, edb.eatby, edb.sellby, edb.batch, edb.qty as edbqty, edb.fk_origin_stock,"; |
2466 | 2466 | $sql .= " cd.rowid as cdid, ed.rowid as edid"; |
2467 | - $sql .= " FROM " . $this->db->prefix() . "commandedet as cd,"; |
|
2468 | - $sql .= " " . $this->db->prefix() . "expeditiondet as ed"; |
|
2469 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "expeditiondet_batch as edb on edb.fk_expeditiondet = ed.rowid"; |
|
2470 | - $sql .= " INNER JOIN " . $this->db->prefix() . "expedition as e ON ed.fk_expedition = e.rowid"; |
|
2471 | - $sql .= " WHERE ed.fk_expedition = " . ((int) $this->id); |
|
2467 | + $sql .= " FROM ".$this->db->prefix()."commandedet as cd,"; |
|
2468 | + $sql .= " ".$this->db->prefix()."expeditiondet as ed"; |
|
2469 | + $sql .= " LEFT JOIN ".$this->db->prefix()."expeditiondet_batch as edb on edb.fk_expeditiondet = ed.rowid"; |
|
2470 | + $sql .= " INNER JOIN ".$this->db->prefix()."expedition as e ON ed.fk_expedition = e.rowid"; |
|
2471 | + $sql .= " WHERE ed.fk_expedition = ".((int) $this->id); |
|
2472 | 2472 | $sql .= " AND cd.rowid = ed.fk_elementdet"; |
2473 | 2473 | |
2474 | - dol_syslog(get_class($this) . "::valid select details", LOG_DEBUG); |
|
2474 | + dol_syslog(get_class($this)."::valid select details", LOG_DEBUG); |
|
2475 | 2475 | $resql = $this->db->query($sql); |
2476 | 2476 | if ($resql) { |
2477 | 2477 | $cpt = $this->db->num_rows($resql); |
@@ -2485,7 +2485,7 @@ discard block |
||
2485 | 2485 | if ($qty <= 0 || ($qty < 0 && !getDolGlobalInt('SHIPMENT_ALLOW_NEGATIVE_QTY'))) { |
2486 | 2486 | continue; |
2487 | 2487 | } |
2488 | - dol_syslog(get_class($this) . "::valid movement index " . $i . " ed.rowid=" . $obj->rowid . " edb.rowid=" . $obj->edbrowid); |
|
2488 | + dol_syslog(get_class($this)."::valid movement index ".$i." ed.rowid=".$obj->rowid." edb.rowid=".$obj->edbrowid); |
|
2489 | 2489 | |
2490 | 2490 | $mouvS = new MouvementStock($this->db); |
2491 | 2491 | $mouvS->origin = &$this; |