Passed
Branch develop (66e4de)
by Laurent
33:03
created
htdocs/core/tpl/document_actions_post_headers.tpl.php 1 patch
Braces   +12 added lines, -4 removed lines patch added patch discarded remove patch
@@ -38,17 +38,25 @@
 block discarded – undo
38 38
 
39 39
 
40 40
 $langs->load("link");
41
-if (empty($relativepathwithnofile)) $relativepathwithnofile = '';
41
+if (empty($relativepathwithnofile)) {
42
+	$relativepathwithnofile = '';
43
+}
42 44
 
43
-if (!isset($permission)) $permission = $permissiontoadd;
44
-if (!isset($permtoedit)) $permtoedit = $permissiontoadd;
45
+if (!isset($permission)) {
46
+	$permission = $permissiontoadd;
47
+}
48
+if (!isset($permtoedit)) {
49
+	$permtoedit = $permissiontoadd;
50
+}
45 51
 
46 52
 // Drag and drop for up and down allowed on product, thirdparty, ...
47 53
 // The drag and drop call the page core/ajax/row.php
48 54
 // If you enable the move up/down of files here, check that page that include template set its sortorder on 'position_name' instead of 'name'
49 55
 // Also the object->fk_element must be defined.
50 56
 $disablemove = 1;
51
-if (in_array($modulepart, array('product', 'produit', 'societe', 'user', 'ticket', 'holiday', 'expensereport'))) $disablemove = 0;
57
+if (in_array($modulepart, array('product', 'produit', 'societe', 'user', 'ticket', 'holiday', 'expensereport'))) {
58
+	$disablemove = 0;
59
+}
52 60
 
53 61
 
54 62
 
Please login to merge, or discard this patch.
htdocs/core/tpl/bloc_showhide.tpl.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -25,8 +25,12 @@
 block discarded – undo
25 25
 }
26 26
 
27 27
 $hide = true; // Hide by default
28
-if (isset($parameters['showblocbydefault'])) $hide = (empty($parameters['showblocbydefault']) ? true : false);
29
-if (isset($object->extraparams[$blocname]['showhide'])) $hide = (empty($object->extraparams[$blocname]['showhide']) ? true : false);
28
+if (isset($parameters['showblocbydefault'])) {
29
+	$hide = (empty($parameters['showblocbydefault']) ? true : false);
30
+}
31
+if (isset($object->extraparams[$blocname]['showhide'])) {
32
+	$hide = (empty($object->extraparams[$blocname]['showhide']) ? true : false);
33
+}
30 34
 
31 35
 ?>
32 36
 <!-- BEGIN PHP TEMPLATE bloc_showhide.tpl.php -->
Please login to merge, or discard this patch.
htdocs/core/tpl/objectline_title.tpl.php 1 patch
Braces   +15 added lines, -5 removed lines patch added patch discarded remove patch
@@ -48,7 +48,9 @@  discard block
 block discarded – undo
48 48
 print '<tr class="liste_titre nodrag nodrop">';
49 49
 
50 50
 // Adds a line numbering column
51
-if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER)) print '<td class="linecolnum center">&nbsp;</td>';
51
+if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER)) {
52
+	print '<td class="linecolnum center">&nbsp;</td>';
53
+}
52 54
 
53 55
 // Description
54 56
 print '<td class="linecoldescription">'.$langs->trans('Description').'</td>';
@@ -65,9 +67,13 @@  discard block
 block discarded – undo
65 67
 print '<td class="linecoluht right" style="width: 80px">'.$langs->trans('PriceUHT').'</td>';
66 68
 
67 69
 // Multicurrency
68
-if (!empty($conf->multicurrency->enabled) && $this->multicurrency_code != $conf->currency) print '<td class="linecoluht_currency right" style="width: 80px">'.$langs->trans('PriceUHTCurrency', $this->multicurrency_code).'</td>';
70
+if (!empty($conf->multicurrency->enabled) && $this->multicurrency_code != $conf->currency) {
71
+	print '<td class="linecoluht_currency right" style="width: 80px">'.$langs->trans('PriceUHTCurrency', $this->multicurrency_code).'</td>';
72
+}
69 73
 
70
-if ($inputalsopricewithtax) print '<td class="right" style="width: 80px">'.$langs->trans('PriceUTTC').'</td>';
74
+if ($inputalsopricewithtax) {
75
+	print '<td class="right" style="width: 80px">'.$langs->trans('PriceUTTC').'</td>';
76
+}
71 77
 
72 78
 // Qty
73 79
 print '<td class="linecolqty right">'.$langs->trans('Qty').'</td>';
@@ -109,9 +115,13 @@  discard block
 block discarded – undo
109 115
 print '<td class="linecolht right">'.$langs->trans('TotalHTShort').'</td>';
110 116
 
111 117
 // Multicurrency
112
-if (!empty($conf->multicurrency->enabled) && $this->multicurrency_code != $conf->currency) print '<td class="linecoltotalht_currency right">'.$langs->trans('TotalHTShortCurrency', $this->multicurrency_code).'</td>';
118
+if (!empty($conf->multicurrency->enabled) && $this->multicurrency_code != $conf->currency) {
119
+	print '<td class="linecoltotalht_currency right">'.$langs->trans('TotalHTShortCurrency', $this->multicurrency_code).'</td>';
120
+}
113 121
 
114
-if ($outputalsopricetotalwithtax) print '<td class="right" style="width: 80px">'.$langs->trans('TotalTTCShort').'</td>';
122
+if ($outputalsopricetotalwithtax) {
123
+	print '<td class="right" style="width: 80px">'.$langs->trans('TotalTTCShort').'</td>';
124
+}
115 125
 
116 126
 print '<td class="linecoledit"></td>'; // No width to allow autodim
117 127
 
Please login to merge, or discard this patch.
htdocs/core/boxes/box_comptes.php 1 patch
Braces   +4 added lines, -1 removed lines patch added patch discarded remove patch
@@ -64,7 +64,10 @@
 block discarded – undo
64 64
 
65 65
 		// disable module for such cases
66 66
 		$listofmodulesforexternal = explode(',', $conf->global->MAIN_MODULES_FOR_EXTERNAL);
67
-		if (!in_array('banque', $listofmodulesforexternal) && !empty($user->socid)) $this->enabled = 0; // disabled for external users
67
+		if (!in_array('banque', $listofmodulesforexternal) && !empty($user->socid)) {
68
+			$this->enabled = 0;
69
+		}
70
+		// disabled for external users
68 71
 
69 72
 		$this->hidden = !($user->rights->banque->lire);
70 73
 	}
Please login to merge, or discard this patch.
htdocs/core/actions_lineupdown.inc.php 1 patch
Braces   +12 added lines, -4 removed lines patch added patch discarded remove patch
@@ -35,8 +35,12 @@  discard block
 block discarded – undo
35 35
 	// Define output language
36 36
 	$outputlangs = $langs;
37 37
 	$newlang = '';
38
-	if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09')) $newlang = GETPOST('lang_id', 'aZ09');
39
-	if ($conf->global->MAIN_MULTILANGS && empty($newlang))	$newlang = $object->thirdparty->default_lang;
38
+	if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
39
+		$newlang = GETPOST('lang_id', 'aZ09');
40
+	}
41
+	if ($conf->global->MAIN_MULTILANGS && empty($newlang)) {
42
+		$newlang = $object->thirdparty->default_lang;
43
+	}
40 44
 	if (!empty($newlang)) {
41 45
 		$outputlangs = new Translate("", $conf);
42 46
 		$outputlangs->setDefaultLang($newlang);
@@ -57,8 +61,12 @@  discard block
 block discarded – undo
57 61
 	// Define output language
58 62
 	$outputlangs = $langs;
59 63
 	$newlang = '';
60
-	if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09')) $newlang = GETPOST('lang_id', 'aZ09');
61
-	if ($conf->global->MAIN_MULTILANGS && empty($newlang))	$newlang = $object->thirdparty->default_lang;
64
+	if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
65
+		$newlang = GETPOST('lang_id', 'aZ09');
66
+	}
67
+	if ($conf->global->MAIN_MULTILANGS && empty($newlang)) {
68
+		$newlang = $object->thirdparty->default_lang;
69
+	}
62 70
 	if (!empty($newlang)) {
63 71
 		$outputlangs = new Translate("", $conf);
64 72
 		$outputlangs->setDefaultLang($newlang);
Please login to merge, or discard this patch.
htdocs/core/filemanagerdol/connectors/php/upload.php 1 patch
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -41,8 +41,9 @@  discard block
 block discarded – undo
41 41
 
42 42
 
43 43
 // Check if this uploader has been enabled.
44
-if (!$Config['Enabled'])
44
+if (!$Config['Enabled']) {
45 45
 	SendUploadResults('1', '', '', 'This file uploader is disabled. Please check the "filemanagerdol/connectors/php/config.php" file');
46
+}
46 47
 
47 48
 $sCommand = 'QuickUpload';
48 49
 
@@ -52,12 +53,14 @@  discard block
 block discarded – undo
52 53
 $sCurrentFolder = "/";
53 54
 
54 55
 // Is enabled the upload?
55
-if (!IsAllowedCommand($sCommand))
56
+if (!IsAllowedCommand($sCommand)) {
56 57
 	SendUploadResults('1', '', '', 'The ""'.$sCommand.'"" command isn\'t allowed');
58
+}
57 59
 
58 60
 // Check if it is an allowed type.
59
-if (!IsAllowedType($sType))
61
+if (!IsAllowedType($sType)) {
60 62
 	SendUploadResults(1, '', '', 'Invalid type specified');
63
+}
61 64
 
62 65
 
63 66
 // @CHANGE
Please login to merge, or discard this patch.
htdocs/core/filemanagerdol/connectors/php/config.php 1 patch
Braces   +10 added lines, -3 removed lines patch added patch discarded remove patch
@@ -34,7 +34,10 @@  discard block
 block discarded – undo
34 34
 require_once '../../../../main.inc.php';
35 35
 $uri = preg_replace('/^http(s?):\/\//i', '', $dolibarr_main_url_root);
36 36
 $pos = strstr($uri, '/'); // $pos contient alors url sans nom domaine
37
-if ($pos == '/') $pos = ''; // si $pos vaut /, on le met a ''
37
+if ($pos == '/') {
38
+	$pos = '';
39
+}
40
+// si $pos vaut /, on le met a ''
38 41
 define('DOL_URL_ROOT', $pos);
39 42
 $entity = ((!empty($_SESSION['dol_entity']) && $_SESSION['dol_entity'] > 1) ? $_SESSION['dol_entity'] : null);
40 43
 
@@ -81,14 +84,18 @@  discard block
 block discarded – undo
81 84
 // Set to 0 to disable this feature.
82 85
 // Note: not needed on Windows-based servers.
83 86
 $newmask = '0644';
84
-if (!empty($conf->global->MAIN_UMASK)) $newmask = $conf->global->MAIN_UMASK;
87
+if (!empty($conf->global->MAIN_UMASK)) {
88
+	$newmask = $conf->global->MAIN_UMASK;
89
+}
85 90
 $Config['ChmodOnUpload'] = $newmask;
86 91
 
87 92
 // See comments above.
88 93
 // Used when creating folders that does not exist.
89 94
 $newmask = '0755';
90 95
 $dirmaskdec = octdec($newmask);
91
-if (!empty($conf->global->MAIN_UMASK)) $dirmaskdec = octdec($conf->global->MAIN_UMASK);
96
+if (!empty($conf->global->MAIN_UMASK)) {
97
+	$dirmaskdec = octdec($conf->global->MAIN_UMASK);
98
+}
92 99
 $dirmaskdec |= octdec('0200'); // Set w bit required to be able to create content for recursive subdirs files
93 100
 $newmask = decoct($dirmaskdec);
94 101
 
Please login to merge, or discard this patch.
htdocs/core/js/lib_gravatar.js.php 1 patch
Braces   +26 added lines, -9 removed lines patch added patch discarded remove patch
@@ -24,14 +24,28 @@  discard block
 block discarded – undo
24 24
 
25 25
 //if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1');	// Not disabled cause need to load personalized language
26 26
 //if (! defined('NOREQUIREDB'))   define('NOREQUIREDB', '1');
27
-if (!defined('NOREQUIRESOC'))    define('NOREQUIRESOC', '1');
27
+if (!defined('NOREQUIRESOC')) {
28
+	define('NOREQUIRESOC', '1');
29
+}
28 30
 //if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1');	// Not disabled cause need to do translations
29
-if (!defined('NOCSRFCHECK'))     define('NOCSRFCHECK', 1);
30
-if (!defined('NOTOKENRENEWAL'))  define('NOTOKENRENEWAL', 1);
31
-if (!defined('NOLOGIN'))         define('NOLOGIN', 1);
32
-if (!defined('NOREQUIREMENU'))   define('NOREQUIREMENU', 1);
33
-if (!defined('NOREQUIREHTML'))   define('NOREQUIREHTML', 1);
34
-if (!defined('NOREQUIREAJAX'))   define('NOREQUIREAJAX', '1');
31
+if (!defined('NOCSRFCHECK')) {
32
+	define('NOCSRFCHECK', 1);
33
+}
34
+if (!defined('NOTOKENRENEWAL')) {
35
+	define('NOTOKENRENEWAL', 1);
36
+}
37
+if (!defined('NOLOGIN')) {
38
+	define('NOLOGIN', 1);
39
+}
40
+if (!defined('NOREQUIREMENU')) {
41
+	define('NOREQUIREMENU', 1);
42
+}
43
+if (!defined('NOREQUIREHTML')) {
44
+	define('NOREQUIREHTML', 1);
45
+}
46
+if (!defined('NOREQUIREAJAX')) {
47
+	define('NOREQUIREAJAX', '1');
48
+}
35 49
 
36 50
 session_cache_limiter('public');
37 51
 
@@ -40,8 +54,11 @@  discard block
 block discarded – undo
40 54
 // Define javascript type
41 55
 top_httphead('text/javascript; charset=UTF-8');
42 56
 // Important: Following code is to avoid page request by browser and PHP CPU at each Dolibarr page access.
43
-if (empty($dolibarr_nocache)) header('Cache-Control: max-age=10800, public, must-revalidate');
44
-else header('Cache-Control: no-cache');
57
+if (empty($dolibarr_nocache)) {
58
+	header('Cache-Control: max-age=10800, public, must-revalidate');
59
+} else {
60
+	header('Cache-Control: no-cache');
61
+}
45 62
 
46 63
 ?>
47 64
 
Please login to merge, or discard this patch.
htdocs/core/js/lib_head.js.php 1 patch
Braces   +29 added lines, -10 removed lines patch added patch discarded remove patch
@@ -24,13 +24,27 @@  discard block
 block discarded – undo
24 24
  * 				JQuery (providing object $) and JQuery-UI (providing $datepicker) libraries must be loaded before this file.
25 25
  */
26 26
 
27
-if (!defined('NOREQUIRESOC'))    define('NOREQUIRESOC', '1');
28
-if (!defined('NOCSRFCHECK'))     define('NOCSRFCHECK', 1);
29
-if (!defined('NOTOKENRENEWAL'))  define('NOTOKENRENEWAL', 1);
30
-if (!defined('NOLOGIN'))         define('NOLOGIN', 1);
31
-if (!defined('NOREQUIREMENU'))   define('NOREQUIREMENU', 1);
32
-if (!defined('NOREQUIREHTML'))   define('NOREQUIREHTML', 1);
33
-if (!defined('NOREQUIREAJAX'))   define('NOREQUIREAJAX', '1');
27
+if (!defined('NOREQUIRESOC')) {
28
+	define('NOREQUIRESOC', '1');
29
+}
30
+if (!defined('NOCSRFCHECK')) {
31
+	define('NOCSRFCHECK', 1);
32
+}
33
+if (!defined('NOTOKENRENEWAL')) {
34
+	define('NOTOKENRENEWAL', 1);
35
+}
36
+if (!defined('NOLOGIN')) {
37
+	define('NOLOGIN', 1);
38
+}
39
+if (!defined('NOREQUIREMENU')) {
40
+	define('NOREQUIREMENU', 1);
41
+}
42
+if (!defined('NOREQUIREHTML')) {
43
+	define('NOREQUIREHTML', 1);
44
+}
45
+if (!defined('NOREQUIREAJAX')) {
46
+	define('NOREQUIREAJAX', '1');
47
+}
34 48
 
35 49
 session_cache_limiter('public');
36 50
 
@@ -39,8 +53,11 @@  discard block
 block discarded – undo
39 53
 // Define javascript type
40 54
 top_httphead('text/javascript; charset=UTF-8');
41 55
 // Important: Following code is to avoid page request by browser and PHP CPU at each Dolibarr page access.
42
-if (empty($dolibarr_nocache)) header('Cache-Control: max-age=10800, public, must-revalidate');
43
-else header('Cache-Control: no-cache');
56
+if (empty($dolibarr_nocache)) {
57
+	header('Cache-Control: max-age=10800, public, must-revalidate');
58
+} else {
59
+	header('Cache-Control: no-cache');
60
+}
44 61
 
45 62
 
46 63
 
@@ -1060,7 +1077,9 @@  discard block
 block discarded – undo
1060 1077
 	if ($langs->transnoentitiesnoconv("SeparatorThousand") != "SeparatorThousand") {
1061 1078
 		$thousand = $langs->transnoentitiesnoconv("SeparatorThousand");
1062 1079
 	}
1063
-	if ($thousand == 'Space') $thousand = ' ';
1080
+	if ($thousand == 'Space') {
1081
+		$thousand = ' ';
1082
+	}
1064 1083
 	print "var dec='".dol_escape_js($dec)."'; var thousand='".dol_escape_js($thousand)."';\n"; // Set var in javascript
1065 1084
 	?>
1066 1085
 
Please login to merge, or discard this patch.