Completed
Branch develop (c23a95)
by
unknown
18:46
created
htdocs/salaries/payment_salary/card.php 1 patch
Braces   +7 added lines, -3 removed lines patch added patch discarded remove patch
@@ -41,15 +41,19 @@
 block discarded – undo
41 41
 $id = GETPOST("id", 'int');
42 42
 $action = GETPOST('action', 'aZ09');
43 43
 $confirm = GETPOST('confirm');
44
-if ($user->socid) $socid = $user->socid;
44
+if ($user->socid) {
45
+	$socid = $user->socid;
46
+}
45 47
 
46 48
 $salary = new Salary($db);
47 49
 
48 50
 $object = new PaymentSalary($db);
49 51
 if ($id > 0) {
50 52
 	$result = $object->fetch($id);
51
-	if (!$result) dol_print_error($db, 'Failed to get payment id '.$id);
52
-}
53
+	if (!$result) {
54
+		dol_print_error($db, 'Failed to get payment id '.$id);
55
+	}
56
+	}
53 57
 restrictedArea($user, 'salaries', $object->fk_salary, 'salary', '');	// $object is payment of salary
54 58
 
55 59
 
Please login to merge, or discard this patch.
htdocs/core/lib/project.lib.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -2008,7 +2008,9 @@  discard block
 block discarded – undo
2008 2008
 				$modeinput = 'hours';
2009 2009
 				for ($idw = 0; $idw < 7; $idw++) {
2010 2010
 					$tmpday = dol_time_plus_duree($firstdaytoshow, $idw, 'd');
2011
-					if (!isset($totalforeachday[$tmpday])) $totalforeachday[$tmpday] = 0;
2011
+					if (!isset($totalforeachday[$tmpday])) {
2012
+						$totalforeachday[$tmpday] = 0;
2013
+					}
2012 2014
 					$cssonholiday = '';
2013 2015
 					if (!$isavailable[$tmpday]['morning'] && !$isavailable[$tmpday]['afternoon']) {
2014 2016
 						$cssonholiday .= 'onholidayallday ';
@@ -2307,7 +2309,9 @@  discard block
 block discarded – undo
2307 2309
 				$month = $firstdaytoshowarray['mon'];
2308 2310
 				foreach ($TWeek as $weekIndex => $weekNb) {
2309 2311
 					$weekWorkLoad = !empty($projectstatic->monthWorkLoadPerTask[$weekNb][$lines[$i]->id]) ? $projectstatic->monthWorkLoadPerTask[$weekNb][$lines[$i]->id] : 0 ;
2310
-					if (!isset($totalforeachweek[$weekNb])) $totalforeachweek[$weekNb] = 0;
2312
+					if (!isset($totalforeachweek[$weekNb])) {
2313
+						$totalforeachweek[$weekNb] = 0;
2314
+					}
2311 2315
 					$totalforeachweek[$weekNb] += $weekWorkLoad;
2312 2316
 
2313 2317
 					$alreadyspent = '';
Please login to merge, or discard this patch.
htdocs/hrm/class/job.class.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -609,7 +609,9 @@
 block discarded – undo
609 609
 	{
610 610
 		$Tab = $this->getForUser($fk_user);
611 611
 
612
-		if (empty($Tab)) return '';
612
+		if (empty($Tab)) {
613
+			return '';
614
+		}
613 615
 
614 616
 		$lastpos = array_shift($Tab);
615 617
 
Please login to merge, or discard this patch.
htdocs/hrm/compare.php 1 patch
Braces   +46 added lines, -17 removed lines patch added patch discarded remove patch
@@ -51,8 +51,12 @@  discard block
 block discarded – undo
51 51
 $permissiontoread = $user->rights->hrm->evaluation->read || $user->rights->hrm->compare_advance->read;
52 52
 $permissiontoadd = 0;
53 53
 
54
-if (empty($conf->hrm->enabled)) accessforbidden();
55
-if (!$permissiontoread || ($action === 'create' && !$permissiontoadd)) accessforbidden();
54
+if (empty($conf->hrm->enabled)) {
55
+	accessforbidden();
56
+}
57
+if (!$permissiontoread || ($action === 'create' && !$permissiontoadd)) {
58
+	accessforbidden();
59
+}
56 60
 
57 61
 
58 62
 /*
@@ -113,7 +117,9 @@  discard block
 block discarded – undo
113 117
 
114 118
 $fk_usergroup2 = 0;
115 119
 $fk_job = (int) GETPOST('fk_job');
116
-if ($fk_job <= 0) $fk_usergroup2 = GETPOST('fk_usergroup2');
120
+if ($fk_job <= 0) {
121
+	$fk_usergroup2 = GETPOST('fk_usergroup2');
122
+}
117 123
 
118 124
 $fk_usergroup1 = GETPOST('fk_usergroup1');
119 125
 
@@ -290,11 +296,17 @@  discard block
 block discarded – undo
290 296
 	foreach ($TMergedSkills as $id => &$sk) {
291 297
 		$class = 'diffnote';
292 298
 
293
-		if (empty($sk->rate2)) $class .= ' toohappy';
294
-		elseif (empty($sk->rate1)) $class .= ' toosad';
295
-		elseif ($sk->rate1 == $sk->rate2) $class .= ' happy';
296
-		elseif ($sk->rate2 < $sk->rate1) $class .= ' veryhappy';
297
-		elseif ($sk->rate2 > $sk->rate1) $class .= ' sad';
299
+		if (empty($sk->rate2)) {
300
+			$class .= ' toohappy';
301
+		} elseif (empty($sk->rate1)) {
302
+			$class .= ' toosad';
303
+		} elseif ($sk->rate1 == $sk->rate2) {
304
+			$class .= ' happy';
305
+		} elseif ($sk->rate2 < $sk->rate1) {
306
+			$class .= ' veryhappy';
307
+		} elseif ($sk->rate2 > $sk->rate1) {
308
+			$class .= ' sad';
309
+		}
298 310
 
299 311
 		$out .= '<li fk_skill="' . $id . '" class="' . $class . '" style="text-align:center;">
300 312
 	      <span class="' . $class . '">&nbsp;</span>
@@ -329,8 +341,11 @@  discard block
 block discarded – undo
329 341
 			$how_many = ($field === 'rate1') ? $sk->how_many_max1 : $sk->how_many_max2;
330 342
 		}
331 343
 
332
-		if ($field === 'rate2' && $fk_job > 0) $trad = $langs->trans('RequiredRank');
333
-		else $trad = $langs->trans('HighestRank');
344
+		if ($field === 'rate2' && $fk_job > 0) {
345
+			$trad = $langs->trans('RequiredRank');
346
+		} else {
347
+			$trad = $langs->trans('HighestRank');
348
+		}
334 349
 
335 350
 		$out .= '<li fk_skill="' . $id . '" style="text-align:center;">
336 351
 	      <p><span class="' . $class . ' classfortooltip" title="' . $trad . '">' . $note . '</span>' . ($how_many > 0 ? '<span class="bubble classfortooltip" title="' . $langs->trans('HowManyUserWithThisMaxNote') . '">' . $how_many . '</span>' : '') . '</p>
@@ -378,7 +393,9 @@  discard block
 block discarded – undo
378 393
 	$Tab = array();
379 394
 
380 395
 	foreach ($TSkill1 as &$sk) {
381
-			if (empty($Tab[$sk->fk_skill])) $Tab[$sk->fk_skill] = new stdClass;
396
+			if (empty($Tab[$sk->fk_skill])) {
397
+				$Tab[$sk->fk_skill] = new stdClass;
398
+			}
382 399
 
383 400
 			$Tab[$sk->fk_skill]->rate1 = $sk->rankorder;
384 401
 			$Tab[$sk->fk_skill]->how_many_max1 = $sk->how_many_max;
@@ -387,7 +404,9 @@  discard block
 block discarded – undo
387 404
 	}
388 405
 
389 406
 	foreach ($TSkill2 as &$sk) {
390
-			if (empty($Tab[$sk->fk_skill])) $Tab[$sk->fk_skill] = new stdClass;
407
+			if (empty($Tab[$sk->fk_skill])) {
408
+				$Tab[$sk->fk_skill] = new stdClass;
409
+			}
391 410
 			$Tab[$sk->fk_skill]->rate2 = $sk->rankorder;
392 411
 			$Tab[$sk->fk_skill]->label = $sk->label;
393 412
 			$Tab[$sk->fk_skill]->description = $sk->description;
@@ -436,12 +455,16 @@  discard block
 block discarded – undo
436 455
 			$user->fetch($obj->rowid);
437 456
 
438 457
 			$name = $user->getFullName($langs);
439
-			if (empty($name)) $name = $user->login;
458
+			if (empty($name)) {
459
+				$name = $user->login;
460
+			}
440 461
 
441 462
 			if (in_array($user->id, $TExcludedId)) {
442 463
 				$class .= ' disabled';
443 464
 			} else {
444
-				if (!in_array($user->id, $TUser)) $TUser[] = $user->id;
465
+				if (!in_array($user->id, $TUser)) {
466
+					$TUser[] = $user->id;
467
+				}
445 468
 			}
446 469
 
447 470
 			$desc = '';
@@ -458,7 +481,9 @@  discard block
 block discarded – undo
458 481
 				$desc .= $langs->trans('NoEval');
459 482
 			}
460 483
 
461
-			if (!empty($user->array_options['options_DDA'])) $desc .= '<br>' . $langs->trans('Anciennete') . ' : ' . dol_print_date(strtotime($user->array_options['options_DDA']));
484
+			if (!empty($user->array_options['options_DDA'])) {
485
+				$desc .= '<br>' . $langs->trans('Anciennete') . ' : ' . dol_print_date(strtotime($user->array_options['options_DDA']));
486
+			}
462 487
 
463 488
 			$out .= '<li fk_user="' . $user->id . '" class="' . $class . '">
464 489
 		      ' . $form->showphoto('userphoto', $user, 0, 0, 0, 'photoref', 'small', 1, 0, 1) . '
@@ -486,7 +511,9 @@  discard block
 block discarded – undo
486 511
 	global $db;
487 512
 
488 513
 	//I go back to the user with the highest score in a given group for all the skills assessed in that group
489
-	if (empty($TUser)) return array();
514
+	if (empty($TUser)) {
515
+		return array();
516
+	}
490 517
 
491 518
 	$sql = 'SELECT sk.rowid, sk.label, sk.description, sk.skill_type, sr.fk_object, sr.objecttype, sr.fk_skill, ';
492 519
 	$sql.= ' MAX(sr.rankorder) as rankorder';
@@ -541,7 +568,9 @@  discard block
 block discarded – undo
541 568
 {
542 569
 	global $db;
543 570
 
544
-	if (empty($fk_job)) return array();
571
+	if (empty($fk_job)) {
572
+		return array();
573
+	}
545 574
 
546 575
 	$sql = 'SELECT sk.rowid, sk.label, sk.description, sk.skill_type, sr.fk_object, sr.objecttype, sr.fk_skill,';
547 576
 	$sql.= " MAX(sr.rankorder) as rankorder";
Please login to merge, or discard this patch.
htdocs/product/admin/product_lot.php 1 patch
Braces   +40 added lines, -17 removed lines patch added patch discarded remove patch
@@ -31,8 +31,9 @@  discard block
 block discarded – undo
31 31
 $langs->loadLangs(array("admin", "products", "productbatch"));
32 32
 
33 33
 // Security check
34
-if (!$user->admin || (empty($conf->productbatch->enabled)))
34
+if (!$user->admin || (empty($conf->productbatch->enabled))) {
35 35
 	accessforbidden();
36
+}
36 37
 
37 38
 $action = GETPOST('action', 'alpha');
38 39
 $value = GETPOST('value', 'alpha');
@@ -52,7 +53,9 @@  discard block
 block discarded – undo
52 53
 
53 54
 	if ($maskconstbatch && preg_match('/_MASK$/', $maskconstbatch)) {
54 55
 		$res = dolibarr_set_const($db, $maskconstbatch, $maskbatch, 'chaine', 0, '', $conf->entity);
55
-		if ($res <= 0) $error++;
56
+		if ($res <= 0) {
57
+			$error++;
58
+		}
56 59
 	}
57 60
 
58 61
 	if (!$error) {
@@ -66,7 +69,9 @@  discard block
 block discarded – undo
66 69
 
67 70
 	if ($maskconstbatch && preg_match('/_MASK$/', $maskconstbatch)) {
68 71
 		$res = dolibarr_set_const($db, $maskconstbatch, $maskbatch, 'chaine', 0, '', $conf->entity);
69
-		if ($res <= 0) $error++;
72
+		if ($res <= 0) {
73
+			$error++;
74
+		}
70 75
 	}
71 76
 
72 77
 	if (!$error) {
@@ -147,8 +152,12 @@  discard block
 block discarded – undo
147 152
 						$module = new $file($db);
148 153
 
149 154
 						// Show modules according to features level
150
-						if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue;
151
-						if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue;
155
+						if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
156
+							continue;
157
+						}
158
+						if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
159
+							continue;
160
+						}
152 161
 
153 162
 						if ($module->isEnabled()) {
154 163
 							print '<tr class="oddeven"><td>'.$module->name."</td><td>\n";
@@ -158,9 +167,13 @@  discard block
 block discarded – undo
158 167
 							// Show example of numbering model
159 168
 							print '<td class="nowrap">';
160 169
 							$tmp = $module->getExample();
161
-							if (preg_match('/^Error/', $tmp)) print '<div class="error">'.$langs->trans($tmp).'</div>';
162
-							elseif ($tmp == 'NotConfigured') print $langs->trans($tmp);
163
-							else print $tmp;
170
+							if (preg_match('/^Error/', $tmp)) {
171
+								print '<div class="error">'.$langs->trans($tmp).'</div>';
172
+							} elseif ($tmp == 'NotConfigured') {
173
+								print $langs->trans($tmp);
174
+							} else {
175
+								print $tmp;
176
+							}
164 177
 							print '</td>'."\n";
165 178
 
166 179
 							print '<td class="center">';
@@ -183,8 +196,9 @@  discard block
 block discarded – undo
183 196
 							if ("$nextval" != $langs->trans("NotAvailable")) {  // Keep " on nextval
184 197
 								$htmltooltip .= ''.$langs->trans("NextValue").': ';
185 198
 								if ($nextval) {
186
-									if (preg_match('/^Error/', $nextval) || $nextval == 'NotConfigured')
187
-										$nextval = $langs->trans($nextval);
199
+									if (preg_match('/^Error/', $nextval) || $nextval == 'NotConfigured') {
200
+																			$nextval = $langs->trans($nextval);
201
+									}
188 202
 									$htmltooltip .= $nextval.'<br>';
189 203
 								} else {
190 204
 									$htmltooltip .= $langs->trans($module->error).'<br>';
@@ -239,8 +253,12 @@  discard block
 block discarded – undo
239 253
 						$module = new $file($db);
240 254
 
241 255
 						// Show modules according to features level
242
-						if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue;
243
-						if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue;
256
+						if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
257
+							continue;
258
+						}
259
+						if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
260
+							continue;
261
+						}
244 262
 
245 263
 						if ($module->isEnabled()) {
246 264
 							print '<tr class="oddeven"><td>'.$module->name."</td><td>\n";
@@ -250,9 +268,13 @@  discard block
 block discarded – undo
250 268
 							// Show example of numbering model
251 269
 							print '<td class="nowrap">';
252 270
 							$tmp = $module->getExample();
253
-							if (preg_match('/^Error/', $tmp)) print '<div class="error">'.$langs->trans($tmp).'</div>';
254
-							elseif ($tmp == 'NotConfigured') print $langs->trans($tmp);
255
-							else print $tmp;
271
+							if (preg_match('/^Error/', $tmp)) {
272
+								print '<div class="error">'.$langs->trans($tmp).'</div>';
273
+							} elseif ($tmp == 'NotConfigured') {
274
+								print $langs->trans($tmp);
275
+							} else {
276
+								print $tmp;
277
+							}
256 278
 							print '</td>'."\n";
257 279
 
258 280
 							print '<td class="center">';
@@ -275,8 +297,9 @@  discard block
 block discarded – undo
275 297
 							if ("$nextval" != $langs->trans("NotAvailable")) {  // Keep " on nextval
276 298
 								$htmltooltip .= ''.$langs->trans("NextValue").': ';
277 299
 								if ($nextval) {
278
-									if (preg_match('/^Error/', $nextval) || $nextval == 'NotConfigured')
279
-										$nextval = $langs->trans($nextval);
300
+									if (preg_match('/^Error/', $nextval) || $nextval == 'NotConfigured') {
301
+																			$nextval = $langs->trans($nextval);
302
+									}
280 303
 									$htmltooltip .= $nextval.'<br>';
281 304
 								} else {
282 305
 									$htmltooltip .= $langs->trans($module->error).'<br>';
Please login to merge, or discard this patch.
htdocs/compta/sociales/list.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -727,7 +727,9 @@
 block discarded – undo
727 727
 				print $bankstatic->getNomUrl(1);
728 728
 			}
729 729
 			print '</td>';
730
-			if (!$i) $totalarray['nbfield']++;
730
+			if (!$i) {
731
+				$totalarray['nbfield']++;
732
+			}
731 733
 		}
732 734
 
733 735
 		// Amount
Please login to merge, or discard this patch.
htdocs/compta/tva/list.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -535,7 +535,9 @@  discard block
 block discarded – undo
535 535
 		// Type
536 536
 		if (!empty($arrayfields['t.fk_typepayment']['checked'])) {
537 537
 			print '<td>';
538
-			if (!empty($obj->payment_code)) print $langs->trans("PaymentTypeShort".$obj->payment_code);
538
+			if (!empty($obj->payment_code)) {
539
+				print $langs->trans("PaymentTypeShort".$obj->payment_code);
540
+			}
539 541
 			print '</td>';
540 542
 			if (!$i) {
541 543
 				$totalarray['nbfield']++;
@@ -562,7 +564,9 @@  discard block
 block discarded – undo
562 564
 				print $bankstatic->getNomUrl(1);
563 565
 			}
564 566
 			print '</td>';
565
-			if (!$i) $totalarray['nbfield']++;
567
+			if (!$i) {
568
+				$totalarray['nbfield']++;
569
+			}
566 570
 		}
567 571
 
568 572
 		// Amount
Please login to merge, or discard this patch.
htdocs/core/tpl/card_presend.tpl.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -40,7 +40,9 @@
 block discarded – undo
40 40
 	$titreform = 'SendMail';
41 41
 
42 42
 	$object->fetch_projet();
43
-	if (!isset($file)) $file = null;
43
+	if (!isset($file)) {
44
+		$file = null;
45
+	}
44 46
 	$ref = dol_sanitizeFileName($object->ref);
45 47
 	if (!in_array($object->element, array('user', 'member'))) {
46 48
 		//$fileparams['fullname'] can be filled from the card
Please login to merge, or discard this patch.
htdocs/mrp/mo_list.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -663,7 +663,9 @@
 block discarded – undo
663 663
 					print $object->getLibStatut(5);
664 664
 				} elseif ($key == 'fk_parent_line') {
665 665
 					$moparent = $object->getMoParent();
666
-					if (is_object($moparent)) print $moparent->getNomUrl(1);
666
+					if (is_object($moparent)) {
667
+						print $moparent->getNomUrl(1);
668
+					}
667 669
 				} elseif ($key == 'rowid') {
668 670
 					print $object->showOutputField($val, $key, $object->id, '');
669 671
 				} else {
Please login to merge, or discard this patch.