Passed
Branch develop (3f4b05)
by Laurent
95:01
created
htdocs/hrm/class/job.class.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -612,7 +612,9 @@
 block discarded – undo
612 612
 		$j = new Job($db);
613 613
 		$Tab = $j->getForUser($fk_user);
614 614
 
615
-		if (empty($Tab)) return '';
615
+		if (empty($Tab)) {
616
+			return '';
617
+		}
616 618
 
617 619
 		$job = array_shift($Tab);
618 620
 
Please login to merge, or discard this patch.
htdocs/hrm/class/evaluation.class.php 1 patch
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -240,7 +240,9 @@  discard block
 block discarded – undo
240 240
 					$line->fk_rank = 0;
241 241
 
242 242
 					$res = $line->create($user, $notrigger);
243
-					if ($res > 0) $this->lines[] = $line;
243
+					if ($res > 0) {
244
+						$this->lines[] = $line;
245
+					}
244 246
 				}
245 247
 			}
246 248
 		}
@@ -637,8 +639,9 @@  discard block
 block discarded – undo
637 639
 
638 640
 		$Tab = $this->db->fetch_object($res);
639 641
 
640
-		if (empty($Tab)) return null;
641
-		else {
642
+		if (empty($Tab)) {
643
+			return null;
644
+		} else {
642 645
 			$evaluation = new Evaluation($this->db);
643 646
 			$evaluation->fetch($Tab->rowid);
644 647
 
Please login to merge, or discard this patch.
htdocs/hrm/job_card.php 1 patch
Braces   +12 added lines, -5 removed lines patch added patch discarded remove patch
@@ -139,8 +139,12 @@  discard block
 block discarded – undo
139 139
 //if ($user->socid > 0) $socid = $user->socid;
140 140
 //$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
141 141
 //restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft);
142
-if (empty($conf->hrm->enabled)) accessforbidden();
143
-if (!$permissiontoread || ($action === 'create' && !$permissiontoadd)) accessforbidden();
142
+if (empty($conf->hrm->enabled)) {
143
+	accessforbidden();
144
+}
145
+if (!$permissiontoread || ($action === 'create' && !$permissiontoadd)) {
146
+	accessforbidden();
147
+}
144 148
 
145 149
 
146 150
 /*
@@ -435,9 +439,12 @@  discard block
 block discarded – undo
435 439
 
436 440
 				$parameters = array();
437 441
 				$reshook = $hookmanager->executeHooks('formAddObjectLine', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
438
-				if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
439
-				if (empty($reshook))
440
-					$object->formAddObjectLine(1, $mysoc, $soc);
442
+				if ($reshook < 0) {
443
+					setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
444
+				}
445
+				if (empty($reshook)) {
446
+									$object->formAddObjectLine(1, $mysoc, $soc);
447
+				}
441 448
 			}
442 449
 		}
443 450
 
Please login to merge, or discard this patch.
htdocs/hrm/position.php 1 patch
Braces   +9 added lines, -3 removed lines patch added patch discarded remove patch
@@ -141,8 +141,12 @@  discard block
 block discarded – undo
141 141
 //if ($user->socid > 0) $socid = $user->socid;
142 142
 //$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
143 143
 //restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft);
144
-if (empty($conf->hrm->enabled)) accessforbidden();
145
-if (!$permissiontoread || ($action === 'create' && !$permissiontoadd)) accessforbidden();
144
+if (empty($conf->hrm->enabled)) {
145
+	accessforbidden();
146
+}
147
+if (!$permissiontoread || ($action === 'create' && !$permissiontoadd)) {
148
+	accessforbidden();
149
+}
146 150
 
147 151
 
148 152
 /*
@@ -380,7 +384,9 @@  discard block
 block discarded – undo
380 384
 	}
381 385
 
382 386
 	// Security check (enable the most restrictive one)
383
-	if ($user->socid > 0) accessforbidden();
387
+	if ($user->socid > 0) {
388
+		accessforbidden();
389
+	}
384 390
 	//if ($user->socid > 0) accessforbidden();
385 391
 	//$socid = 0; if ($user->socid > 0) $socid = $user->socid;
386 392
 	//$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
Please login to merge, or discard this patch.
htdocs/hrm/position_card.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -113,8 +113,12 @@
 block discarded – undo
113 113
 //if ($user->socid > 0) $socid = $user->socid;
114 114
 //$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
115 115
 //restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft);
116
-if (empty($conf->hrm->enabled)) accessforbidden();
117
-if (!$permissiontoread || ($action === 'create' && !$permissiontoadd)) accessforbidden();
116
+if (empty($conf->hrm->enabled)) {
117
+	accessforbidden();
118
+}
119
+if (!$permissiontoread || ($action === 'create' && !$permissiontoadd)) {
120
+	accessforbidden();
121
+}
118 122
 
119 123
 $langs->loadLangs(array("hrm", "other"));
120 124
 
Please login to merge, or discard this patch.
htdocs/core/class/commonobject.class.php 1 patch
Braces   +18 added lines, -6 removed lines patch added patch discarded remove patch
@@ -3647,7 +3647,9 @@  discard block
 block discarded – undo
3647 3647
 		// Hook for explicitly set the targettype if it must be differtent than $this->element
3648 3648
 		$reshook = $hookmanager->executeHooks('setLinkedObjectSourceTargetType', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
3649 3649
 		if ($reshook > 0) {
3650
-			if (!empty($hookmanager->resArray['targettype'])) $targettype = $hookmanager->resArray['targettype'];
3650
+			if (!empty($hookmanager->resArray['targettype'])) {
3651
+				$targettype = $hookmanager->resArray['targettype'];
3652
+			}
3651 3653
 		}
3652 3654
 
3653 3655
 		$this->db->begin();
@@ -3729,10 +3731,18 @@  discard block
 block discarded – undo
3729 3731
 		// Hook for explicitly set the targettype if it must be differtent than $this->element
3730 3732
 		$reshook = $hookmanager->executeHooks('setLinkedObjectSourceTargetType', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
3731 3733
 		if ($reshook > 0) {
3732
-			if (!empty($hookmanager->resArray['sourcetype'])) $sourcetype = $hookmanager->resArray['sourcetype'];
3733
-			if (!empty($hookmanager->resArray['sourceid'])) $sourceid = $hookmanager->resArray['sourceid'];
3734
-			if (!empty($hookmanager->resArray['targettype'])) $targettype = $hookmanager->resArray['targettype'];
3735
-			if (!empty($hookmanager->resArray['targetid'])) $targetid = $hookmanager->resArray['targetid'];
3734
+			if (!empty($hookmanager->resArray['sourcetype'])) {
3735
+				$sourcetype = $hookmanager->resArray['sourcetype'];
3736
+			}
3737
+			if (!empty($hookmanager->resArray['sourceid'])) {
3738
+				$sourceid = $hookmanager->resArray['sourceid'];
3739
+			}
3740
+			if (!empty($hookmanager->resArray['targettype'])) {
3741
+				$targettype = $hookmanager->resArray['targettype'];
3742
+			}
3743
+			if (!empty($hookmanager->resArray['targetid'])) {
3744
+				$targetid = $hookmanager->resArray['targetid'];
3745
+			}
3736 3746
 		}
3737 3747
 
3738 3748
 		if (!empty($sourceid) && !empty($sourcetype) && empty($targetid)) {
@@ -6600,7 +6610,9 @@  discard block
 block discarded – undo
6600 6610
 			$showtime = 1;
6601 6611
 
6602 6612
 			// Do not show current date when field not required (see selectDate() method)
6603
-			if (!$required && $value == '') $value = '-1';
6613
+			if (!$required && $value == '') {
6614
+				$value = '-1';
6615
+			}
6604 6616
 
6605 6617
 			// TODO Must also support $moreparam
6606 6618
 			$out = $form->selectDate($value, $keyprefix.$key.$keysuffix, $showtime, $showtime, $required, '', 1, (($keyprefix != 'search_' && $keyprefix != 'search_options_') ? 1 : 0), 0, 1, '', '', '', 1, '', '', 'tzuserrel');
Please login to merge, or discard this patch.
htdocs/hrm/skill_agenda.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -136,8 +136,12 @@
 block discarded – undo
136 136
 //if ($user->socid > 0) $socid = $user->socid;
137 137
 //$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
138 138
 //restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft);
139
-if (empty($conf->hrm->enabled)) accessforbidden();
140
-if (!$permissiontoread) accessforbidden();
139
+if (empty($conf->hrm->enabled)) {
140
+	accessforbidden();
141
+}
142
+if (!$permissiontoread) {
143
+	accessforbidden();
144
+}
141 145
 
142 146
 
143 147
 /*
Please login to merge, or discard this patch.
htdocs/hrm/evaluation_document.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -136,8 +136,12 @@
 block discarded – undo
136 136
 //if ($user->socid > 0) $socid = $user->socid;
137 137
 //$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
138 138
 //restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft);
139
-if (empty($conf->hrm->enabled)) accessforbidden();
140
-if (!$permissiontoread) accessforbidden();
139
+if (empty($conf->hrm->enabled)) {
140
+	accessforbidden();
141
+}
142
+if (!$permissiontoread) {
143
+	accessforbidden();
144
+}
141 145
 
142 146
 
143 147
 /*
Please login to merge, or discard this patch.
htdocs/hrm/evaluation_agenda.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -136,8 +136,12 @@
 block discarded – undo
136 136
 //if ($user->socid > 0) $socid = $user->socid;
137 137
 //$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
138 138
 //restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft);
139
-if (empty($conf->hrm->enabled)) accessforbidden();
140
-if (!$permissiontoread) accessforbidden();
139
+if (empty($conf->hrm->enabled)) {
140
+	accessforbidden();
141
+}
142
+if (!$permissiontoread) {
143
+	accessforbidden();
144
+}
141 145
 
142 146
 
143 147
 /*
Please login to merge, or discard this patch.