Completed
Branch develop (d02c61)
by
unknown
18:56
created
htdocs/partnership/class/partnershiputils.class.php 1 patch
Braces   +35 added lines, -12 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);
@@ -192,7 +199,9 @@  discard block
 block discarded – undo
192 199
 							if (!$result || !empty($cmail->error) || !empty($cmail->errors)) {
193 200
 								$erroremail .= ($erroremail ? ', ' : '').$cmail->error;
194 201
 								$this->errors[] = $cmail->error;
195
-								if (is_array($cmail->errors) && count($cmail->errors) > 0) $this->errors += $cmail->errors;
202
+								if (is_array($cmail->errors) && count($cmail->errors) > 0) {
203
+									$this->errors += $cmail->errors;
204
+								}
196 205
 							} else {
197 206
 								// Initialisation of datas of object to call trigger
198 207
 								if (is_object($object)) {
@@ -241,12 +250,16 @@  discard block
 block discarded – undo
241 250
 		if (!$error) {
242 251
 			$this->db->commit();
243 252
 			$this->output = $numofexpiredmembers.' expired partnership members found'."\n";
244
-			if ($erroremail) $this->output .= '. Got errors when sending some email : '.$erroremail;
253
+			if ($erroremail) {
254
+				$this->output .= '. Got errors when sending some email : '.$erroremail;
255
+			}
245 256
 		} else {
246 257
 			$this->db->rollback();
247 258
 			$this->output = "Rollback after error\n";
248 259
 			$this->output .= $numofexpiredmembers.' expired partnership members found'."\n";
249
-			if ($erroremail) $this->output .= '. Got errors when sending some email : '.$erroremail;
260
+			if ($erroremail) {
261
+				$this->output .= '. Got errors when sending some email : '.$erroremail;
262
+			}
250 263
 		}
251 264
 
252 265
 		return ($error ? 1 : 0);
@@ -375,7 +388,9 @@  discard block
 block discarded – undo
375 388
 									// Define output language
376 389
 									$outputlangs = $langs;
377 390
 									$newlang = '';
378
-									if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) $newlang = GETPOST('lang_id', 'aZ09');
391
+									if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
392
+										$newlang = GETPOST('lang_id', 'aZ09');
393
+									}
379 394
 									if (!empty($newlang)) {
380 395
 										$outputlangs = new Translate("", $conf);
381 396
 										$outputlangs->setDefaultLang($newlang);
@@ -403,7 +418,9 @@  discard block
 block discarded – undo
403 418
 									if (!$result || !empty($cmail->error) || !empty($cmail->errors)) {
404 419
 										$erroremail .= ($erroremail ? ', ' : '').$cmail->error;
405 420
 										$this->errors[] = $cmail->error;
406
-										if (is_array($cmail->errors) && count($cmail->errors) > 0) $this->errors += $cmail->errors;
421
+										if (is_array($cmail->errors) && count($cmail->errors) > 0) {
422
+											$this->errors += $cmail->errors;
423
+										}
407 424
 									} else {
408 425
 										// Initialisation of datas of object to call trigger
409 426
 										if (is_object($object)) {
@@ -476,9 +493,15 @@  discard block
 block discarded – undo
476 493
 			$this->output = "Rollback after error\n";
477 494
 		}
478 495
 		$this->output .= $numofexpiredmembers.' partnership checked'."\n";
479
-		if ($erroremail) $this->output .= '. Got errors when sending some email : '.$erroremail."\n";
480
-		if ($emailnotfound) $this->output .= '. Email not found for some partner : '.$emailnotfound."\n";
481
-		if ($websitenotfound) $this->output .= '. Website not found for some partner : '.$websitenotfound."\n";
496
+		if ($erroremail) {
497
+			$this->output .= '. Got errors when sending some email : '.$erroremail."\n";
498
+		}
499
+		if ($emailnotfound) {
500
+			$this->output .= '. Email not found for some partner : '.$emailnotfound."\n";
501
+		}
502
+		if ($websitenotfound) {
503
+			$this->output .= '. Website not found for some partner : '.$websitenotfound."\n";
504
+		}
482 505
 		$this->output .= "\nSQL used to find partnerships to scan: ".$sql;
483 506
 
484 507
 		return ($error ? 1 : 0);
Please login to merge, or discard this patch.