Passed
Branch develop (66e4de)
by Laurent
33:03
created
htdocs/core/modules/member/modules_cards.php 1 patch
Braces   +12 added lines, -4 removed lines patch added patch discarded remove patch
@@ -102,7 +102,9 @@  discard block
 block discarded – undo
102 102
 		} else {
103 103
 			$code = $modele;
104 104
 		}
105
-	} else $code = $modele;
105
+	} else {
106
+		$code = $modele;
107
+	}
106 108
 
107 109
 	// If selected modele is a filename template (then $modele="modelname:filename")
108 110
 	$tmp = explode(':', $template, 2);
@@ -110,12 +112,16 @@  discard block
 block discarded – undo
110 112
 	{
111 113
 		$template = $tmp[0];
112 114
 		$srctemplatepath = $tmp[1];
113
-	} else $srctemplatepath = $code;
115
+	} else {
116
+		$srctemplatepath = $code;
117
+	}
114 118
 
115 119
 	// Search template files
116 120
 	$file = ''; $classname = ''; $filefound = 0;
117 121
 	$dirmodels = array('/');
118
-	if (is_array($conf->modules_parts['models'])) $dirmodels = array_merge($dirmodels, $conf->modules_parts['models']);
122
+	if (is_array($conf->modules_parts['models'])) {
123
+		$dirmodels = array_merge($dirmodels, $conf->modules_parts['models']);
124
+	}
119 125
 	foreach ($dirmodels as $reldir)
120 126
 	{
121 127
 		foreach (array('doc', 'pdf') as $prefix)
@@ -131,7 +137,9 @@  discard block
 block discarded – undo
131 137
 				break;
132 138
 			}
133 139
 		}
134
-		if ($filefound) break;
140
+		if ($filefound) {
141
+			break;
142
+		}
135 143
 	}
136 144
 
137 145
 
Please login to merge, or discard this patch.
htdocs/core/modules/contract/mod_contract_serpis.php 1 patch
Braces   +12 added lines, -4 removed lines patch added patch discarded remove patch
@@ -136,8 +136,11 @@  discard block
 block discarded – undo
136 136
 		if ($resql)
137 137
 		{
138 138
 			$obj = $db->fetch_object($resql);
139
-			if ($obj) $max = intval($obj->max);
140
-			else $max = 0;
139
+			if ($obj) {
140
+				$max = intval($obj->max);
141
+			} else {
142
+				$max = 0;
143
+			}
141 144
 		} else {
142 145
 			dol_syslog("mod_contract_serpis::getNextValue", LOG_DEBUG);
143 146
 			return -1;
@@ -146,8 +149,13 @@  discard block
 block discarded – undo
146 149
 		$date = $contract->date_contrat;
147 150
 		$yymm = strftime("%y%m", $date);
148 151
 
149
-		if ($max >= (pow(10, 4) - 1)) $num = $max + 1; // If counter > 9999, we do not format on 4 chars, we take number as it is
150
-		else $num = sprintf("%04s", $max + 1);
152
+		if ($max >= (pow(10, 4) - 1)) {
153
+			$num = $max + 1;
154
+		}
155
+		// If counter > 9999, we do not format on 4 chars, we take number as it is
156
+		else {
157
+			$num = sprintf("%04s", $max + 1);
158
+		}
151 159
 
152 160
 		dol_syslog("mod_contract_serpis::getNextValue return ".$this->prefix.$yymm."-".$num);
153 161
 		return $this->prefix.$yymm."-".$num;
Please login to merge, or discard this patch.
htdocs/core/actions_printing.inc.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -82,7 +82,9 @@
 block discarded – undo
82 82
 				}
83 83
 			}
84 84
 		}
85
-		if ($printerfound == 0) setEventMessages($langs->trans("NoActivePrintingModuleFound", $langs->transnoentities("Module64000Name")), null, 'warnings');
85
+		if ($printerfound == 0) {
86
+			setEventMessages($langs->trans("NoActivePrintingModuleFound", $langs->transnoentities("Module64000Name")), null, 'warnings');
87
+		}
86 88
 	} else {
87 89
 		setEventMessages($langs->trans("NoModuleFound"), null, 'warnings');
88 90
 	}
Please login to merge, or discard this patch.
htdocs/core/boxes/box_birthdays_members.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -130,7 +130,9 @@
 block discarded – undo
130 130
 					$line++;
131 131
 				}
132 132
 
133
-				if ($num == 0) $this->info_box_contents[$line][0] = array('td' => 'class="center opacitymedium"', 'text'=>$langs->trans("None"));
133
+				if ($num == 0) {
134
+					$this->info_box_contents[$line][0] = array('td' => 'class="center opacitymedium"', 'text'=>$langs->trans("None"));
135
+				}
134 136
 
135 137
 				$this->db->free($result);
136 138
 			} else {
Please login to merge, or discard this patch.
htdocs/core/boxes/box_graph_invoices_permonth.php 1 patch
Braces   +25 added lines, -8 removed lines patch added patch discarded remove patch
@@ -75,7 +75,9 @@  discard block
 block discarded – undo
75 75
 		//$facturestatic=new Facture($this->db);
76 76
 
77 77
 		$startmonth = $conf->global->SOCIETE_FISCAL_MONTH_START ? ($conf->global->SOCIETE_FISCAL_MONTH_START) : 1;
78
-		if (empty($conf->global->GRAPH_USE_FISCAL_YEAR)) $startmonth = 1;
78
+		if (empty($conf->global->GRAPH_USE_FISCAL_YEAR)) {
79
+			$startmonth = 1;
80
+		}
79 81
 
80 82
 		$text = $langs->trans("BoxCustomersInvoicesPerMonth", $max);
81 83
 		$this->info_box_head = array(
@@ -92,8 +94,13 @@  discard block
 block discarded – undo
92 94
 		$dir = ''; // We don't need a path because image file will not be saved into disk
93 95
 		$prefix = '';
94 96
 		$socid = 0;
95
-		if ($user->socid) $socid = $user->socid;
96
-		if (!$user->rights->societe->client->voir || $socid) $prefix .= 'private-'.$user->id.'-'; // If user has no permission to see all, output dir is specific to user
97
+		if ($user->socid) {
98
+			$socid = $user->socid;
99
+		}
100
+		if (!$user->rights->societe->client->voir || $socid) {
101
+			$prefix .= 'private-'.$user->id.'-';
102
+		}
103
+		// If user has no permission to see all, output dir is specific to user
97 104
 
98 105
 		if ($user->rights->facture->lire)
99 106
 		{
@@ -119,7 +126,9 @@  discard block
 block discarded – undo
119 126
 			}
120 127
 			if (empty($shownb) && empty($showtot)) { $shownb = 1; $showtot = 1; }
121 128
 			$nowarray = dol_getdate(dol_now(), true);
122
-			if (empty($endyear)) $endyear = $nowarray['year'];
129
+			if (empty($endyear)) {
130
+				$endyear = $nowarray['year'];
131
+			}
123 132
 			$startyear = $endyear - 1;
124 133
 			$mode = 'customer';
125 134
 			$WIDTH = (($shownb && $showtot) || !empty($conf->dol_optimize_smallscreen)) ? '256' : '320';
@@ -135,7 +144,9 @@  discard block
 block discarded – undo
135 144
 				$filenamenb = $dir."/".$prefix."invoicesnbinyear-".$endyear.".png";
136 145
 				// default value for customer mode
137 146
 				$fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstats&file=invoicesnbinyear-'.$endyear.'.png';
138
-				if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstatssupplier&file=invoicessuppliernbinyear-'.$endyear.'.png';
147
+				if ($mode == 'supplier') {
148
+					$fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstatssupplier&file=invoicessuppliernbinyear-'.$endyear.'.png';
149
+				}
139 150
 
140 151
 				$px1 = new DolGraph();
141 152
 				$mesg = $px1->isGraphKo();
@@ -180,7 +191,9 @@  discard block
 block discarded – undo
180 191
 				$filenamenb = $dir."/".$prefix."invoicesamountinyear-".$endyear.".png";
181 192
 				// default value for customer mode
182 193
 				$fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstats&file=invoicesamountinyear-'.$endyear.'.png';
183
-				if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstatssupplier&file=invoicessupplieramountinyear-'.$endyear.'.png';
194
+				if ($mode == 'supplier') {
195
+					$fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstatssupplier&file=invoicessupplieramountinyear-'.$endyear.'.png';
196
+				}
184 197
 
185 198
 				$px2 = new DolGraph();
186 199
 				$mesg = $px2->isGraphKo();
@@ -251,13 +264,17 @@  discard block
 block discarded – undo
251 264
 					$stringtoshow .= '<div class="fichecenter">';
252 265
 					$stringtoshow .= '<div class="fichehalfleft">';
253 266
 				}
254
-				if ($shownb) $stringtoshow .= $px1->show();
267
+				if ($shownb) {
268
+					$stringtoshow .= $px1->show();
269
+				}
255 270
 				if ($shownb && $showtot)
256 271
 				{
257 272
 					$stringtoshow .= '</div>';
258 273
 					$stringtoshow .= '<div class="fichehalfright">';
259 274
 				}
260
-				if ($showtot) $stringtoshow .= $px2->show();
275
+				if ($showtot) {
276
+					$stringtoshow .= $px2->show();
277
+				}
261 278
 				if ($shownb && $showtot)
262 279
 				{
263 280
 					$stringtoshow .= '</div>';
Please login to merge, or discard this patch.
htdocs/core/boxes/box_graph_orders_supplier_permonth.php 1 patch
Braces   +25 added lines, -8 removed lines patch added patch discarded remove patch
@@ -74,7 +74,9 @@  discard block
 block discarded – undo
74 74
 		include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php';
75 75
 
76 76
 		$startmonth = $conf->global->SOCIETE_FISCAL_MONTH_START ? ($conf->global->SOCIETE_FISCAL_MONTH_START) : 1;
77
-		if (empty($conf->global->GRAPH_USE_FISCAL_YEAR)) $startmonth = 1;
77
+		if (empty($conf->global->GRAPH_USE_FISCAL_YEAR)) {
78
+			$startmonth = 1;
79
+		}
78 80
 
79 81
 		$text = $langs->trans("BoxSuppliersOrdersPerMonth", $max);
80 82
 		$this->info_box_head = array(
@@ -91,8 +93,13 @@  discard block
 block discarded – undo
91 93
 		$dir = ''; // We don't need a path because image file will not be saved into disk
92 94
 		$prefix = '';
93 95
 		$socid = 0;
94
-		if ($user->socid) $socid = $user->socid;
95
-		if (!$user->rights->societe->client->voir || $socid) $prefix .= 'private-'.$user->id.'-'; // If user has no permission to see all, output dir is specific to user
96
+		if ($user->socid) {
97
+			$socid = $user->socid;
98
+		}
99
+		if (!$user->rights->societe->client->voir || $socid) {
100
+			$prefix .= 'private-'.$user->id.'-';
101
+		}
102
+		// If user has no permission to see all, output dir is specific to user
96 103
 
97 104
 		if ($user->rights->fournisseur->commande->lire)
98 105
 		{
@@ -118,7 +125,9 @@  discard block
 block discarded – undo
118 125
 			}
119 126
 			if (empty($shownb) && empty($showtot)) { $shownb = 1; $showtot = 1; }
120 127
 			$nowarray = dol_getdate(dol_now(), true);
121
-			if (empty($endyear)) $endyear = $nowarray['year'];
128
+			if (empty($endyear)) {
129
+				$endyear = $nowarray['year'];
130
+			}
122 131
 			$startyear = $endyear - 1;
123 132
 			$mode = 'supplier';
124 133
 			$WIDTH = (($shownb && $showtot) || !empty($conf->dol_optimize_smallscreen)) ? '256' : '320';
@@ -134,7 +143,9 @@  discard block
 block discarded – undo
134 143
 				$filenamenb = $dir."/".$prefix."orderssuppliernbinyear-".$endyear.".png";
135 144
 				// default value for customer mode
136 145
 				$fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&amp;file=ordersnbinyear-'.$endyear.'.png';
137
-				if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstatssupplier&amp;file=orderssuppliernbinyear-'.$endyear.'.png';
146
+				if ($mode == 'supplier') {
147
+					$fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstatssupplier&amp;file=orderssuppliernbinyear-'.$endyear.'.png';
148
+				}
138 149
 
139 150
 				$px1 = new DolGraph();
140 151
 				$mesg = $px1->isGraphKo();
@@ -177,7 +188,9 @@  discard block
 block discarded – undo
177 188
 				$filenamenb = $dir."/".$prefix."orderssupplieramountinyear-".$endyear.".png";
178 189
 				// default value for customer mode
179 190
 				$fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&amp;file=ordersamountinyear-'.$endyear.'.png';
180
-				if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstatssupplier&amp;file=orderssupplieramountinyear-'.$endyear.'.png';
191
+				if ($mode == 'supplier') {
192
+					$fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstatssupplier&amp;file=orderssupplieramountinyear-'.$endyear.'.png';
193
+				}
181 194
 
182 195
 				$px2 = new DolGraph();
183 196
 				$mesg = $px2->isGraphKo();
@@ -246,13 +259,17 @@  discard block
 block discarded – undo
246 259
 					$stringtoshow .= '<div class="fichecenter">';
247 260
 					$stringtoshow .= '<div class="fichehalfleft">';
248 261
 				}
249
-				if ($shownb) $stringtoshow .= $px1->show();
262
+				if ($shownb) {
263
+					$stringtoshow .= $px1->show();
264
+				}
250 265
 				if ($shownb && $showtot)
251 266
 				{
252 267
 					$stringtoshow .= '</div>';
253 268
 					$stringtoshow .= '<div class="fichehalfright">';
254 269
 				}
255
-				if ($showtot) $stringtoshow .= $px2->show();
270
+				if ($showtot) {
271
+					$stringtoshow .= $px2->show();
272
+				}
256 273
 				if ($shownb && $showtot)
257 274
 				{
258 275
 					$stringtoshow .= '</div>';
Please login to merge, or discard this patch.
htdocs/core/boxes/box_goodcustomers.php 1 patch
Braces   +11 added lines, -3 removed lines patch added patch discarded remove patch
@@ -62,8 +62,14 @@  discard block
 block discarded – undo
62 62
 		$this->db = $db;
63 63
 
64 64
 		// disable box for such cases
65
-		if (!empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) $this->enabled = 0; // disabled by this option
66
-		if (empty($conf->global->MAIN_BOX_ENABLE_BEST_CUSTOMERS)) $this->enabled = 0; // not enabled by default. Very slow on large database
65
+		if (!empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) {
66
+			$this->enabled = 0;
67
+		}
68
+		// disabled by this option
69
+		if (empty($conf->global->MAIN_BOX_ENABLE_BEST_CUSTOMERS)) {
70
+			$this->enabled = 0;
71
+		}
72
+		// not enabled by default. Very slow on large database
67 73
 
68 74
 		$this->hidden = !($user->rights->societe->lire);
69 75
 	}
@@ -142,10 +148,12 @@  discard block
 block discarded – undo
142 148
 					$line++;
143 149
 				}
144 150
 
145
-				if ($num == 0) $this->info_box_contents[$line][0] = array(
151
+				if ($num == 0) {
152
+					$this->info_box_contents[$line][0] = array(
146 153
 					'td' => 'class="center opacitymedium"',
147 154
 					'text'=>$langs->trans("NoRecordedCustomers")
148 155
 				);
156
+				}
149 157
 
150 158
 				$this->db->free($result);
151 159
 			} else {
Please login to merge, or discard this patch.
htdocs/core/boxes/box_graph_propales_permonth.php 1 patch
Braces   +25 added lines, -8 removed lines patch added patch discarded remove patch
@@ -75,7 +75,9 @@  discard block
 block discarded – undo
75 75
 		//$propalstatic=new Propal($this->db);
76 76
 
77 77
 		$startmonth = $conf->global->SOCIETE_FISCAL_MONTH_START ? ($conf->global->SOCIETE_FISCAL_MONTH_START) : 1;
78
-		if (empty($conf->global->GRAPH_USE_FISCAL_YEAR)) $startmonth = 1;
78
+		if (empty($conf->global->GRAPH_USE_FISCAL_YEAR)) {
79
+			$startmonth = 1;
80
+		}
79 81
 
80 82
 		$langs->load("propal");
81 83
 
@@ -94,8 +96,13 @@  discard block
 block discarded – undo
94 96
 		$dir = ''; // We don't need a path because image file will not be saved into disk
95 97
 		$prefix = '';
96 98
 		$socid = 0;
97
-		if ($user->socid) $socid = $user->socid;
98
-		if (!$user->rights->societe->client->voir || $socid) $prefix .= 'private-'.$user->id.'-'; // If user has no permission to see all, output dir is specific to user
99
+		if ($user->socid) {
100
+			$socid = $user->socid;
101
+		}
102
+		if (!$user->rights->societe->client->voir || $socid) {
103
+			$prefix .= 'private-'.$user->id.'-';
104
+		}
105
+		// If user has no permission to see all, output dir is specific to user
99 106
 
100 107
 		if ($user->rights->propale->lire)
101 108
 		{
@@ -119,7 +126,9 @@  discard block
 block discarded – undo
119 126
 			}
120 127
 			if (empty($shownb) && empty($showtot)) { $shownb = 1; $showtot = 1; }
121 128
 			$nowarray = dol_getdate(dol_now(), true);
122
-			if (empty($endyear)) $endyear = $nowarray['year'];
129
+			if (empty($endyear)) {
130
+				$endyear = $nowarray['year'];
131
+			}
123 132
 			$startyear = $endyear - 1;
124 133
 			$WIDTH = (($shownb && $showtot) || !empty($conf->dol_optimize_smallscreen)) ? '256' : '320';
125 134
 			$HEIGHT = '192';
@@ -176,8 +185,12 @@  discard block
 block discarded – undo
176 185
 				//$datatype2 = array('lines','bars');
177 186
 
178 187
 				$filenamenb = $dir."/".$prefix."propalsamountinyear-".$endyear.".png";
179
-				if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=propalstats&amp;file=propalsamountinyear-'.$endyear.'.png';
180
-				if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=propalstatssupplier&amp;file=propalsamountinyear-'.$endyear.'.png';
188
+				if ($mode == 'customer') {
189
+					$fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=propalstats&amp;file=propalsamountinyear-'.$endyear.'.png';
190
+				}
191
+				if ($mode == 'supplier') {
192
+					$fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=propalstatssupplier&amp;file=propalsamountinyear-'.$endyear.'.png';
193
+				}
181 194
 
182 195
 				$px2 = new DolGraph();
183 196
 				$mesg = $px2->isGraphKo();
@@ -247,13 +260,17 @@  discard block
 block discarded – undo
247 260
 					$stringtoshow .= '<div class="fichecenter">';
248 261
 					$stringtoshow .= '<div class="fichehalfleft">';
249 262
 				}
250
-				if ($shownb) $stringtoshow .= $px1->show();
263
+				if ($shownb) {
264
+					$stringtoshow .= $px1->show();
265
+				}
251 266
 				if ($shownb && $showtot)
252 267
 				{
253 268
 					$stringtoshow .= '</div>';
254 269
 					$stringtoshow .= '<div class="fichehalfright">';
255 270
 				}
256
-				if ($showtot) $stringtoshow .= $px2->show();
271
+				if ($showtot) {
272
+					$stringtoshow .= $px2->show();
273
+				}
257 274
 				if ($shownb && $showtot)
258 275
 				{
259 276
 					$stringtoshow .= '</div>';
Please login to merge, or discard this patch.
htdocs/core/search.php 1 patch
Braces   +24 added lines, -8 removed lines patch added patch discarded remove patch
@@ -23,14 +23,30 @@
 block discarded – undo
23 23
  *       \brief      Wrapper that receive any search. Depending on input field, make a redirect to correct URL.
24 24
  */
25 25
 
26
-if (!defined('NOREQUIREUSER'))   define('NOREQUIREUSER', '1');
27
-if (!defined('NOREQUIREDB'))   define('NOREQUIREDB', '1');
28
-if (!defined('NOREQUIRESOC'))    define('NOREQUIRESOC', '1');
29
-if (!defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1');
30
-if (!defined('NOCSRFCHECK'))     define('NOCSRFCHECK', 1);
31
-if (!defined('NOTOKENRENEWAL'))  define('NOTOKENRENEWAL', 1);
32
-if (!defined('NOLOGIN')) define('NOLOGIN', 1);
33
-if (!defined('NOREQUIREMENU'))  define('NOREQUIREMENU', 1);
26
+if (!defined('NOREQUIREUSER')) {
27
+	define('NOREQUIREUSER', '1');
28
+}
29
+if (!defined('NOREQUIREDB')) {
30
+	define('NOREQUIREDB', '1');
31
+}
32
+if (!defined('NOREQUIRESOC')) {
33
+	define('NOREQUIRESOC', '1');
34
+}
35
+if (!defined('NOREQUIRETRAN')) {
36
+	define('NOREQUIRETRAN', '1');
37
+}
38
+if (!defined('NOCSRFCHECK')) {
39
+	define('NOCSRFCHECK', 1);
40
+}
41
+if (!defined('NOTOKENRENEWAL')) {
42
+	define('NOTOKENRENEWAL', 1);
43
+}
44
+if (!defined('NOLOGIN')) {
45
+	define('NOLOGIN', 1);
46
+}
47
+if (!defined('NOREQUIREMENU')) {
48
+	define('NOREQUIREMENU', 1);
49
+}
34 50
 
35 51
 require_once '../main.inc.php';
36 52
 
Please login to merge, or discard this patch.