Passed
Branch develop (66e4de)
by Laurent
33:03
created
htdocs/core/antispamimage.php 1 patch
Braces   +18 added lines, -6 removed lines patch added patch discarded remove patch
@@ -23,12 +23,24 @@
 block discarded – undo
23 23
 
24 24
 define('NOLOGIN', 1);
25 25
 
26
-if (!defined('NOREQUIREUSER'))   define('NOREQUIREUSER', 1);
27
-if (!defined('NOREQUIREDB'))     define('NOREQUIREDB', 1);
28
-if (!defined('NOREQUIRETRAN'))   define('NOREQUIRETRAN', 1);
29
-if (!defined('NOREQUIREMENU'))   define('NOREQUIREMENU', 1);
30
-if (!defined('NOREQUIRESOC'))    define('NOREQUIRESOC', 1);
31
-if (!defined('NOTOKENRENEWAL'))  define('NOTOKENRENEWAL', 1);
26
+if (!defined('NOREQUIREUSER')) {
27
+	define('NOREQUIREUSER', 1);
28
+}
29
+if (!defined('NOREQUIREDB')) {
30
+	define('NOREQUIREDB', 1);
31
+}
32
+if (!defined('NOREQUIRETRAN')) {
33
+	define('NOREQUIRETRAN', 1);
34
+}
35
+if (!defined('NOREQUIREMENU')) {
36
+	define('NOREQUIREMENU', 1);
37
+}
38
+if (!defined('NOREQUIRESOC')) {
39
+	define('NOREQUIRESOC', 1);
40
+}
41
+if (!defined('NOTOKENRENEWAL')) {
42
+	define('NOTOKENRENEWAL', 1);
43
+}
32 44
 
33 45
 require_once '../main.inc.php';
34 46
 
Please login to merge, or discard this patch.
htdocs/core/login/functions_forceuser.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -40,9 +40,13 @@
 block discarded – undo
40 40
 	dol_syslog("functions_forceuser::check_user_password_forceuser");
41 41
 
42 42
 	$login = $dolibarr_auto_user;
43
-	if (empty($login)) $login = 'auto';
43
+	if (empty($login)) {
44
+		$login = 'auto';
45
+	}
44 46
 
45
-	if ($_SESSION["dol_loginmesg"]) $login = '';
47
+	if ($_SESSION["dol_loginmesg"]) {
48
+		$login = '';
49
+	}
46 50
 
47 51
 	dol_syslog("functions_forceuser::check_user_password_forceuser ok. forced user = ".$login);
48 52
 	return $login;
Please login to merge, or discard this patch.
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.