Passed
Branch develop (fc1365)
by Laurent
84:32
created
htdocs/takepos/pay.php 1 patch
Braces   +9 added lines, -3 removed lines patch added patch discarded remove patch
@@ -231,7 +231,9 @@  discard block
 block discarded – undo
231 231
 			$arrayOfValidPaymentModes[] = $obj;
232 232
 		}
233 233
 		if (!isModEnabled('banque')) {
234
-			if ($paycode == 'CASH' || $paycode == 'CB') $arrayOfValidPaymentModes[] = $obj;
234
+			if ($paycode == 'CASH' || $paycode == 'CB') {
235
+				$arrayOfValidPaymentModes[] = $obj;
236
+			}
235 237
 		}
236 238
 	}
237 239
 }
@@ -338,7 +340,9 @@  discard block
 block discarded – undo
338 340
 	  const bodyContent = JSON.stringify({ amount : amount, invoiceid : invoiceid });
339 341
   <?php
340 342
 	$urlpaymentintent = DOL_URL_ROOT.'/stripe/ajax/ajax.php?action=createPaymentIntent&token='.newToken().'&servicestatus='.$servicestatus;
341
-	if (!empty($stripeacc)) $urlpaymentintent .= '&stripeacc='.$stripeacc;
343
+	if (!empty($stripeacc)) {
344
+		$urlpaymentintent .= '&stripeacc='.$stripeacc;
345
+	}
342 346
 	?>
343 347
   return fetch('<?php echo $urlpaymentintent; ?>', {
344 348
 	method: "POST",
@@ -668,7 +672,9 @@  discard block
 block discarded – undo
668 672
 
669 673
 $parameters = array();
670 674
 $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $invoice, $action); // Note that $action and $object may have been modified by hook
671
-if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
675
+if ($reshook < 0) {
676
+	setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
677
+}
672 678
 
673 679
 $class = ($i == 3) ? "calcbutton3" : "calcbutton2";
674 680
 foreach ($action_buttons as $button) {
Please login to merge, or discard this patch.
htdocs/partnership/partnership_document.php 1 patch
Braces   +12 added lines, -4 removed lines patch added patch discarded remove patch
@@ -83,10 +83,18 @@
 block discarded – undo
83 83
 //if ($user->socid > 0) accessforbidden();
84 84
 //if ($user->socid > 0) $socid = $user->socid;
85 85
 //$result = restrictedArea($user, 'partnership', $object->id);
86
-if (empty($conf->partnership->enabled)) accessforbidden();
87
-if (empty($permissiontoread)) accessforbidden();
88
-if ($object->id > 0 && !($object->fk_member > 0) && $managedfor == 'member') accessforbidden();
89
-if ($object->id > 0 && !($object->fk_soc > 0) && $managedfor == 'thirdparty') accessforbidden();
86
+if (empty($conf->partnership->enabled)) {
87
+	accessforbidden();
88
+}
89
+if (empty($permissiontoread)) {
90
+	accessforbidden();
91
+}
92
+if ($object->id > 0 && !($object->fk_member > 0) && $managedfor == 'member') {
93
+	accessforbidden();
94
+}
95
+if ($object->id > 0 && !($object->fk_soc > 0) && $managedfor == 'thirdparty') {
96
+	accessforbidden();
97
+}
90 98
 
91 99
 
92 100
 
Please login to merge, or discard this patch.
htdocs/partnership/partnership_contact.php 1 patch
Braces   +12 added lines, -4 removed lines patch added patch discarded remove patch
@@ -59,10 +59,18 @@
 block discarded – undo
59 59
 //if ($user->socid > 0) accessforbidden();
60 60
 //if ($user->socid > 0) $socid = $user->socid;
61 61
 //$result = restrictedArea($user, 'partnership', $object->id);
62
-if (empty($conf->partnership->enabled)) accessforbidden();
63
-if (empty($permissiontoread)) accessforbidden();
64
-if ($object->id > 0 && !($object->fk_member > 0) && $managedfor == 'member') accessforbidden();
65
-if ($object->id > 0 && !($object->fk_soc > 0) && $managedfor == 'thirdparty') accessforbidden();
62
+if (empty($conf->partnership->enabled)) {
63
+	accessforbidden();
64
+}
65
+if (empty($permissiontoread)) {
66
+	accessforbidden();
67
+}
68
+if ($object->id > 0 && !($object->fk_member > 0) && $managedfor == 'member') {
69
+	accessforbidden();
70
+}
71
+if ($object->id > 0 && !($object->fk_soc > 0) && $managedfor == 'thirdparty') {
72
+	accessforbidden();
73
+}
66 74
 
67 75
 
68 76
 
Please login to merge, or discard this patch.
htdocs/partnership/partnership_note.php 1 patch
Braces   +12 added lines, -4 removed lines patch added patch discarded remove patch
@@ -66,10 +66,18 @@
 block discarded – undo
66 66
 //if ($user->socid > 0) accessforbidden();
67 67
 //if ($user->socid > 0) $socid = $user->socid;
68 68
 //$result = restrictedArea($user, 'partnership', $object->id);
69
-if (empty($conf->partnership->enabled)) accessforbidden();
70
-if (empty($permissiontoread)) accessforbidden();
71
-if ($object->id > 0 && !($object->fk_member > 0) && $managedfor == 'member') accessforbidden();
72
-if ($object->id > 0 && !($object->fk_soc > 0) && $managedfor == 'thirdparty') accessforbidden();
69
+if (empty($conf->partnership->enabled)) {
70
+	accessforbidden();
71
+}
72
+if (empty($permissiontoread)) {
73
+	accessforbidden();
74
+}
75
+if ($object->id > 0 && !($object->fk_member > 0) && $managedfor == 'member') {
76
+	accessforbidden();
77
+}
78
+if ($object->id > 0 && !($object->fk_soc > 0) && $managedfor == 'thirdparty') {
79
+	accessforbidden();
80
+}
73 81
 
74 82
 
75 83
 /*
Please login to merge, or discard this patch.
htdocs/partnership/partnership_list.php 1 patch
Braces   +23 added lines, -7 removed lines patch added patch discarded remove patch
@@ -89,7 +89,9 @@  discard block
 block discarded – undo
89 89
 
90 90
 $managedfor	= getDolGlobalString('PARTNERSHIP_IS_MANAGED_FOR', 'thirdparty');
91 91
 
92
-if ($managedfor != 'member' && $sortfield == 'd.datefin') $sortfield = '';
92
+if ($managedfor != 'member' && $sortfield == 'd.datefin') {
93
+	$sortfield = '';
94
+}
93 95
 
94 96
 // Default sort order (if not yet defined by previous GETPOST)
95 97
 if (!$sortfield) {
@@ -155,10 +157,18 @@  discard block
 block discarded – undo
155 157
 //if ($user->socid > 0) accessforbidden();
156 158
 //if ($user->socid > 0) $socid = $user->socid;
157 159
 //$result = restrictedArea($user, 'partnership', $object->id);
158
-if (empty($conf->partnership->enabled)) accessforbidden();
159
-if (empty($permissiontoread)) accessforbidden();
160
-if ($object->id > 0 && !($object->fk_member > 0) && $managedfor == 'member') accessforbidden();
161
-if ($object->id > 0 && !($object->fk_soc > 0) && $managedfor == 'thirdparty') accessforbidden();
160
+if (empty($conf->partnership->enabled)) {
161
+	accessforbidden();
162
+}
163
+if (empty($permissiontoread)) {
164
+	accessforbidden();
165
+}
166
+if ($object->id > 0 && !($object->fk_member > 0) && $managedfor == 'member') {
167
+	accessforbidden();
168
+}
169
+if ($object->id > 0 && !($object->fk_soc > 0) && $managedfor == 'thirdparty') {
170
+	accessforbidden();
171
+}
162 172
 
163 173
 
164 174
 /*
@@ -970,7 +980,10 @@  discard block
 block discarded – undo
970 980
 
971 981
 	$i++;
972 982
 }
973
-if ($managedfor != 'member') $totalarray['nbfield']++; // End of subscription date
983
+if ($managedfor != 'member') {
984
+	$totalarray['nbfield']++;
985
+}
986
+// End of subscription date
974 987
 
975 988
 // Show total line
976 989
 include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php';
@@ -983,7 +996,10 @@  discard block
 block discarded – undo
983 996
 			$colspan++;
984 997
 		}
985 998
 	}
986
-	if ($managedfor != 'member') $colspan++; // End of subscription date
999
+	if ($managedfor != 'member') {
1000
+		$colspan++;
1001
+	}
1002
+	// End of subscription date
987 1003
 	print '<tr><td colspan="'.$colspan.'"><span class="opacitymedium">'.$langs->trans("NoRecordFound").'</span></td></tr>';
988 1004
 }
989 1005
 
Please login to merge, or discard this patch.
htdocs/partnership/partnership_agenda.php 1 patch
Braces   +12 added lines, -4 removed lines patch added patch discarded remove patch
@@ -92,10 +92,18 @@
 block discarded – undo
92 92
 //if ($user->socid > 0) accessforbidden();
93 93
 //if ($user->socid > 0) $socid = $user->socid;
94 94
 //$result = restrictedArea($user, 'partnership', $object->id);
95
-if (empty($conf->partnership->enabled)) accessforbidden();
96
-if (empty($permissiontoread)) accessforbidden();
97
-if ($object->id > 0 && !($object->fk_member > 0) && $managedfor == 'member') accessforbidden();
98
-if ($object->id > 0 && !($object->fk_soc > 0) && $managedfor == 'thirdparty') accessforbidden();
95
+if (empty($conf->partnership->enabled)) {
96
+	accessforbidden();
97
+}
98
+if (empty($permissiontoread)) {
99
+	accessforbidden();
100
+}
101
+if ($object->id > 0 && !($object->fk_member > 0) && $managedfor == 'member') {
102
+	accessforbidden();
103
+}
104
+if ($object->id > 0 && !($object->fk_soc > 0) && $managedfor == 'thirdparty') {
105
+	accessforbidden();
106
+}
99 107
 
100 108
 
101 109
 
Please login to merge, or discard this patch.
htdocs/partnership/partnership_card.php 1 patch
Braces   +26 added lines, -9 removed lines patch added patch discarded remove patch
@@ -85,10 +85,18 @@  discard block
 block discarded – undo
85 85
 //if ($user->socid > 0) accessforbidden();
86 86
 //if ($user->socid > 0) $socid = $user->socid;
87 87
 //$result = restrictedArea($user, 'partnership', $object->id);
88
-if (empty($conf->partnership->enabled)) accessforbidden();
89
-if (empty($permissiontoread)) accessforbidden();
90
-if ($object->id > 0 && !($object->fk_member > 0) && $managedfor == 'member') accessforbidden();
91
-if ($object->id > 0 && !($object->fk_soc > 0) && $managedfor == 'thirdparty') accessforbidden();
88
+if (empty($conf->partnership->enabled)) {
89
+	accessforbidden();
90
+}
91
+if (empty($permissiontoread)) {
92
+	accessforbidden();
93
+}
94
+if ($object->id > 0 && !($object->fk_member > 0) && $managedfor == 'member') {
95
+	accessforbidden();
96
+}
97
+if ($object->id > 0 && !($object->fk_soc > 0) && $managedfor == 'thirdparty') {
98
+	accessforbidden();
99
+}
92 100
 
93 101
 
94 102
 /*
@@ -246,7 +254,9 @@  discard block
 block discarded – undo
246 254
 	}
247 255
 }
248 256
 
249
-if ($object->id > 0 && $object->status == $object::STATUS_REFUSED) $object->fields['reason_decline_or_cancel']['visible'] = 3;
257
+if ($object->id > 0 && $object->status == $object::STATUS_REFUSED) {
258
+	$object->fields['reason_decline_or_cancel']['visible'] = 3;
259
+}
250 260
 
251 261
 
252 262
 
@@ -442,7 +452,11 @@  discard block
 block discarded – undo
442 452
 		$npfilter = "";
443 453
 	}
444 454
 
445
-	if ($managedfor == 'member') $npfilter .= " AND te.fk_member > 0 "; else $npfilter .= " AND te.fk_soc > 0 ";
455
+	if ($managedfor == 'member') {
456
+		$npfilter .= " AND te.fk_member > 0 ";
457
+	} else {
458
+		$npfilter .= " AND te.fk_soc > 0 ";
459
+	}
446 460
 	$object->next_prev_filter = $npfilter;
447 461
 
448 462
 	dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
@@ -533,9 +547,12 @@  discard block
 block discarded – undo
533 547
 
534 548
 				$parameters = array();
535 549
 				$reshook = $hookmanager->executeHooks('formAddObjectLine', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
536
-				if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
537
-				if (empty($reshook))
538
-					$object->formAddObjectLine(1, $mysoc, $soc);
550
+				if ($reshook < 0) {
551
+					setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
552
+				}
553
+				if (empty($reshook)) {
554
+									$object->formAddObjectLine(1, $mysoc, $soc);
555
+				}
539 556
 			}
540 557
 		}
541 558
 
Please login to merge, or discard this patch.
htdocs/partnership/class/partnershiputils.class.php 1 patch
Braces   +47 added lines, -16 removed lines patch added patch discarded remove patch
@@ -118,7 +118,9 @@  discard block
 block discarded – undo
118 118
 
119 119
 				$obj = $this->db->fetch_object($resql);
120 120
 				if ($obj) {
121
-					if (!empty($partnershipsprocessed[$obj->rowid])) continue;
121
+					if (!empty($partnershipsprocessed[$obj->rowid])) {
122
+						continue;
123
+					}
122 124
 
123 125
 					if ($somethingdoneonpartnership >= $MAXPERCALL) {
124 126
 						dol_syslog("We reach the limit of ".$MAXPERCALL." partnership processed, so we quit loop for this batch doCancelStatusOfMemberPartnership to avoid to reach email quota.", LOG_WARNING);
@@ -140,8 +142,11 @@  discard block
 block discarded – undo
140 142
 							$error++;
141 143
 							$this->error = $object->error;
142 144
 							if (is_array($object->errors) && count($object->errors)) {
143
-								if (is_array($this->errors)) $this->errors = array_merge($this->errors, $object->errors);
144
-								else $this->errors = $object->errors;
145
+								if (is_array($this->errors)) {
146
+									$this->errors = array_merge($this->errors, $object->errors);
147
+								} else {
148
+									$this->errors = $object->errors;
149
+								}
145 150
 							}
146 151
 						} else {
147 152
 							$partnershipsprocessed[$object->id] = $object->ref;
@@ -159,7 +164,9 @@  discard block
 block discarded – undo
159 164
 							// Define output language
160 165
 							$outputlangs = $langs;
161 166
 							$newlang = '';
162
-							if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) $newlang = GETPOST('lang_id', 'aZ09');
167
+							if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
168
+								$newlang = GETPOST('lang_id', 'aZ09');
169
+							}
163 170
 							if (!empty($newlang)) {
164 171
 								$outputlangs = new Translate("", $conf);
165 172
 								$outputlangs->setDefaultLang($newlang);
@@ -184,7 +191,9 @@  discard block
 block discarded – undo
184 191
 							if (!$result || $cmail->error) {
185 192
 								$erroremail .= ($erroremail ? ', ' : '').$cmail->error;
186 193
 								$this->errors[] = $cmail->error;
187
-								if (is_array($cmail->errors) && count($cmail->errors) > 0) $this->errors += $cmail->errors;
194
+								if (is_array($cmail->errors) && count($cmail->errors) > 0) {
195
+									$this->errors += $cmail->errors;
196
+								}
188 197
 							}
189 198
 						}
190 199
 					}
@@ -198,12 +207,16 @@  discard block
 block discarded – undo
198 207
 		if (!$error) {
199 208
 			$this->db->commit();
200 209
 			$this->output = $numofexpiredmembers.' expired partnership members found'."\n";
201
-			if ($erroremail) $this->output .= '. Got errors when sending some email : '.$erroremail;
210
+			if ($erroremail) {
211
+				$this->output .= '. Got errors when sending some email : '.$erroremail;
212
+			}
202 213
 		} else {
203 214
 			$this->db->rollback();
204 215
 			$this->output = "Rollback after error\n";
205 216
 			$this->output .= $numofexpiredmembers.' expired partnership members found'."\n";
206
-			if ($erroremail) $this->output .= '. Got errors when sending some email : '.$erroremail;
217
+			if ($erroremail) {
218
+				$this->output .= '. Got errors when sending some email : '.$erroremail;
219
+			}
207 220
 		}
208 221
 
209 222
 		return ($error ? 1 : 0);
@@ -280,7 +293,9 @@  discard block
 block discarded – undo
280 293
 
281 294
 				$obj = $this->db->fetch_object($resql);
282 295
 				if ($obj) {
283
-					if (!empty($partnershipsprocessed[$obj->rowid])) continue;
296
+					if (!empty($partnershipsprocessed[$obj->rowid])) {
297
+						continue;
298
+					}
284 299
 
285 300
 					if ($somethingdoneonpartnership >= $MAXPERCALL) {
286 301
 						dol_syslog("We reach the limit of ".$MAXPERCALL." partnership processed, so we quit loop for this batch doWarningOfPartnershipIfDolibarrBacklinkNotfound to avoid to reach email quota.", LOG_WARNING);
@@ -325,7 +340,9 @@  discard block
 block discarded – undo
325 340
 								// Define output language
326 341
 								$outputlangs = $langs;
327 342
 								$newlang = '';
328
-								if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) $newlang = GETPOST('lang_id', 'aZ09');
343
+								if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
344
+									$newlang = GETPOST('lang_id', 'aZ09');
345
+								}
329 346
 								if (!empty($newlang)) {
330 347
 									$outputlangs = new Translate("", $conf);
331 348
 									$outputlangs->setDefaultLang($newlang);
@@ -348,7 +365,9 @@  discard block
 block discarded – undo
348 365
 								if (!$result || $cmail->error) {
349 366
 									$erroremail .= ($erroremail ? ', ' : '').$cmail->error;
350 367
 									$this->errors[] = $cmail->error;
351
-									if (is_array($cmail->errors) && count($cmail->errors) > 0) $this->errors += $cmail->errors;
368
+									if (is_array($cmail->errors) && count($cmail->errors) > 0) {
369
+										$this->errors += $cmail->errors;
370
+									}
352 371
 								}
353 372
 							}
354 373
 						} elseif ($tmpcount > 4) { // Cancel Partnership
@@ -377,16 +396,28 @@  discard block
 block discarded – undo
377 396
 		if (!$error) {
378 397
 			$this->db->commit();
379 398
 			$this->output = $numofexpiredmembers.' partnership checked'."\n";
380
-			if ($erroremail) $this->output .= '. Got errors when sending some email : '.$erroremail."\n";
381
-			if ($emailnotfound) $this->output .= '. Email not found for some partner : '.$emailnotfound."\n";
382
-			if ($websitenotfound) $this->output .= '. Website not found for some partner : '.$websitenotfound."\n";
399
+			if ($erroremail) {
400
+				$this->output .= '. Got errors when sending some email : '.$erroremail."\n";
401
+			}
402
+			if ($emailnotfound) {
403
+				$this->output .= '. Email not found for some partner : '.$emailnotfound."\n";
404
+			}
405
+			if ($websitenotfound) {
406
+				$this->output .= '. Website not found for some partner : '.$websitenotfound."\n";
407
+			}
383 408
 		} else {
384 409
 			$this->db->rollback();
385 410
 			$this->output = "Rollback after error\n";
386 411
 			$this->output .= $numofexpiredmembers.' partnership checked'."\n";
387
-			if ($erroremail) $this->output .= '. Got errors when sending some email : '.$erroremail."\n";
388
-			if ($emailnotfound) $this->output .= '. Email not found for some partner : '.$emailnotfound."\n";
389
-			if ($websitenotfound) $this->output .= '. Website not found for some partner : '.$websitenotfound."\n";
412
+			if ($erroremail) {
413
+				$this->output .= '. Got errors when sending some email : '.$erroremail."\n";
414
+			}
415
+			if ($emailnotfound) {
416
+				$this->output .= '. Email not found for some partner : '.$emailnotfound."\n";
417
+			}
418
+			if ($websitenotfound) {
419
+				$this->output .= '. Website not found for some partner : '.$websitenotfound."\n";
420
+			}
390 421
 		}
391 422
 
392 423
 		return ($error ? 1 : 0);
Please login to merge, or discard this patch.
htdocs/expedition/list.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1029,7 +1029,9 @@
 block discarded – undo
1029 1029
 			// Get code using getLabelFromKey
1030 1030
 			$code=$langs->getLabelFromKey($db, $shipment->shipping_method_id, 'c_shipment_mode', 'rowid', 'code');
1031 1031
 			print '<td class="center tdoverflowmax150" title="'.dol_escape_htmltag($langs->trans("SendingMethod".strtoupper($code))).'">';
1032
-			if ($shipment->shipping_method_id > 0) print $langs->trans("SendingMethod".strtoupper($code));
1032
+			if ($shipment->shipping_method_id > 0) {
1033
+				print $langs->trans("SendingMethod".strtoupper($code));
1034
+			}
1033 1035
 			print '</td>';
1034 1036
 		}
1035 1037
 		// Tracking number
Please login to merge, or discard this patch.