Completed
Branch develop (c23a95)
by
unknown
18:46
created
htdocs/product/stock/stocktransfer/lib/stocktransfer_stocktransfer.lib.php 1 patch
Braces   +15 added lines, -5 removed lines patch added patch discarded remove patch
@@ -46,18 +46,26 @@  discard block
 block discarded – undo
46 46
 		$nbContact = count($object->liste_contact(-1, 'internal')) + count($object->liste_contact(-1, 'external'));
47 47
 		$head[$h][0] = dol_buildpath('/product/stock/stocktransfer/stocktransfer_contact.php', 1).'?id='.$object->id;
48 48
 		$head[$h][1] = $langs->trans('ContactsAddresses');
49
-		if ($nbContact > 0) $head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbContact.'</span>';
49
+		if ($nbContact > 0) {
50
+			$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbContact.'</span>';
51
+		}
50 52
 		$head[$h][2] = 'contact';
51 53
 		$h++;
52 54
 	}
53 55
 
54 56
 	if (isset($object->fields['note_public']) || isset($object->fields['note_private'])) {
55 57
 		$nbNote = 0;
56
-		if (!empty($object->note_private)) $nbNote++;
57
-		if (!empty($object->note_public)) $nbNote++;
58
+		if (!empty($object->note_private)) {
59
+			$nbNote++;
60
+		}
61
+		if (!empty($object->note_public)) {
62
+			$nbNote++;
63
+		}
58 64
 		$head[$h][0] = dol_buildpath('/product/stock/stocktransfer/stocktransfer_note.php', 1).'?id='.$object->id;
59 65
 		$head[$h][1] = $langs->trans('Notes');
60
-		if ($nbNote > 0) $head[$h][1] .= (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) ? '<span class="badge marginleftonlyshort">'.$nbNote.'</span>' : '');
66
+		if ($nbNote > 0) {
67
+			$head[$h][1] .= (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) ? '<span class="badge marginleftonlyshort">'.$nbNote.'</span>' : '');
68
+		}
61 69
 		$head[$h][2] = 'note';
62 70
 		$h++;
63 71
 	}
@@ -69,7 +77,9 @@  discard block
 block discarded – undo
69 77
 	$nbLinks = Link::count($db, $object->element, $object->id);
70 78
 	$head[$h][0] = dol_buildpath("/product/stock/stocktransfer/stocktransfer_document.php", 1).'?id='.$object->id;
71 79
 	$head[$h][1] = $langs->trans('Documents');
72
-	if (($nbFiles + $nbLinks) > 0) $head[$h][1] .= '<span class="badge marginleftonlyshort">'.($nbFiles + $nbLinks).'</span>';
80
+	if (($nbFiles + $nbLinks) > 0) {
81
+		$head[$h][1] .= '<span class="badge marginleftonlyshort">'.($nbFiles + $nbLinks).'</span>';
82
+	}
73 83
 	$head[$h][2] = 'document';
74 84
 	$h++;
75 85
 
Please login to merge, or discard this patch.
htdocs/core/modules/stocktransfer/mod_stocktransfer_standard.php 1 patch
Braces   +12 added lines, -4 removed lines patch added patch discarded remove patch
@@ -134,8 +134,11 @@  discard block
 block discarded – undo
134 134
 		$resql = $db->query($sql);
135 135
 		if ($resql) {
136 136
 			$obj = $db->fetch_object($resql);
137
-			if ($obj) $max = intval($obj->max);
138
-			else $max = 0;
137
+			if ($obj) {
138
+				$max = intval($obj->max);
139
+			} else {
140
+				$max = 0;
141
+			}
139 142
 		} else {
140 143
 			dol_syslog("mod_stocktransfer_standard::getNextValue", LOG_DEBUG);
141 144
 			return -1;
@@ -145,8 +148,13 @@  discard block
 block discarded – undo
145 148
 		$date = $object->date_creation;
146 149
 		$yymm = strftime("%y%m", $date);
147 150
 
148
-		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
149
-		else $num = sprintf("%04s", $max + 1);
151
+		if ($max >= (pow(10, 4) - 1)) {
152
+			$num = $max + 1;
153
+		}
154
+		// If counter > 9999, we do not format on 4 chars, we take number as it is
155
+		else {
156
+			$num = sprintf("%04s", $max + 1);
157
+		}
150 158
 
151 159
 		dol_syslog("mod_stocktransfer_standard::getNextValue return ".$this->prefix.$yymm."-".$num);
152 160
 		return $this->prefix.$yymm."-".$num;
Please login to merge, or discard this patch.
htdocs/intracommreport/card.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -77,8 +77,12 @@
 block discarded – undo
77 77
 //if ($user->socid > 0) $socid = $user->socid;
78 78
 //$isdraft = (isset($object->status) && ($object->status == $object::STATUS_DRAFT) ? 1 : 0);
79 79
 //restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft);
80
-if (empty($conf->intracommreport->enabled)) accessforbidden();
81
-if (!$permissiontoread) accessforbidden();
80
+if (empty($conf->intracommreport->enabled)) {
81
+	accessforbidden();
82
+}
83
+if (!$permissiontoread) {
84
+	accessforbidden();
85
+}
82 86
 
83 87
 
84 88
 
Please login to merge, or discard this patch.
htdocs/compta/prelevement/card.php 1 patch
Braces   +15 added lines, -6 removed lines patch added patch discarded remove patch
@@ -315,16 +315,25 @@
 block discarded – undo
315 315
 		$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
316 316
 		if (empty($reshook)) {
317 317
 			if (empty($object->date_trans)) {
318
-				if ($object->type == 'bank-transfer') print dolGetButtonAction($langs->trans("SetToStatusSent"), '', 'default', 'card.php?action=settransmitted&token='.newToken().'&id='.$object->id, '', $user->rights->paymentbybanktransfer->send);
319
-				else print dolGetButtonAction($langs->trans("SetToStatusSent"), '', 'default', 'card.php?action=settransmitted&token='.newToken().'&id='.$object->id, '', $user->rights->prelevement->bons->send);
318
+				if ($object->type == 'bank-transfer') {
319
+					print dolGetButtonAction($langs->trans("SetToStatusSent"), '', 'default', 'card.php?action=settransmitted&token='.newToken().'&id='.$object->id, '', $user->rights->paymentbybanktransfer->send);
320
+				} else {
321
+					print dolGetButtonAction($langs->trans("SetToStatusSent"), '', 'default', 'card.php?action=settransmitted&token='.newToken().'&id='.$object->id, '', $user->rights->prelevement->bons->send);
322
+				}
320 323
 			}
321 324
 			if (!empty($object->date_trans) && empty($object->date_credit)) {
322
-				if ($object->type == 'bank-transfer') print dolGetButtonAction($langs->trans("ClassDebited"), '', 'default', 'card.php?action=setcredited&token='.newToken().'&id='.$object->id, '', $user->rights->paymentbybanktransfer->debit);
323
-				else print dolGetButtonAction($langs->trans("ClassCredited"), '', 'default', 'card.php?action=setcredited&token='.newToken().'&id='.$object->id, '', $user->rights->prelevement->bons->credit);
325
+				if ($object->type == 'bank-transfer') {
326
+					print dolGetButtonAction($langs->trans("ClassDebited"), '', 'default', 'card.php?action=setcredited&token='.newToken().'&id='.$object->id, '', $user->rights->paymentbybanktransfer->debit);
327
+				} else {
328
+					print dolGetButtonAction($langs->trans("ClassCredited"), '', 'default', 'card.php?action=setcredited&token='.newToken().'&id='.$object->id, '', $user->rights->prelevement->bons->credit);
329
+				}
324 330
 			}
325 331
 
326
-			if ($object->type == 'bank-transfer') print dolGetButtonAction($langs->trans("Delete"), '', 'delete', 'card.php?action=delete&token='.newToken().'&id='.$object->id, '', $user->rights->paymentbybanktransfer->create);
327
-			else print dolGetButtonAction($langs->trans("Delete"), '', 'delete', 'card.php?action=delete&token='.newToken().'&id='.$object->id, '', $user->rights->prelevement->bons->creer);
332
+			if ($object->type == 'bank-transfer') {
333
+				print dolGetButtonAction($langs->trans("Delete"), '', 'delete', 'card.php?action=delete&token='.newToken().'&id='.$object->id, '', $user->rights->paymentbybanktransfer->create);
334
+			} else {
335
+				print dolGetButtonAction($langs->trans("Delete"), '', 'delete', 'card.php?action=delete&token='.newToken().'&id='.$object->id, '', $user->rights->prelevement->bons->creer);
336
+			}
328 337
 		}
329 338
 		print '</div>';
330 339
 	}
Please login to merge, or discard this patch.
htdocs/accountancy/journal/bankjournal.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -314,7 +314,9 @@
 block discarded – undo
314 314
 			}
315 315
 			// Now loop on each link of record in bank (code similar to bankentries_list.php)
316 316
 			foreach ($links as $key => $val) {
317
-				if ($links[$key]['type'] == 'user' && !$is_sc) continue;
317
+				if ($links[$key]['type'] == 'user' && !$is_sc) {
318
+					continue;
319
+				}
318 320
 				if (in_array($links[$key]['type'], array('sc', 'payment_sc', 'payment', 'payment_supplier', 'payment_vat', 'payment_expensereport', 'banktransfert', 'payment_donation', 'member', 'payment_loan', 'payment_salary', 'payment_various'))) {
319 321
 					// So we excluded 'company' and 'user' here. We want only payment lines
320 322
 
Please login to merge, or discard this patch.
htdocs/webhook/target_list.php 1 patch
Braces   +9 added lines, -3 removed lines patch added patch discarded remove patch
@@ -192,13 +192,19 @@
 block discarded – undo
192 192
 }
193 193
 
194 194
 // Security check (enable the most restrictive one)
195
-if ($user->socid > 0) accessforbidden();
195
+if ($user->socid > 0) {
196
+	accessforbidden();
197
+}
196 198
 //if ($user->socid > 0) accessforbidden();
197 199
 //$socid = 0; if ($user->socid > 0) $socid = $user->socid;
198 200
 //$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
199 201
 //restrictedArea($user, $object->element, 0, $object->table_element, '', 'fk_soc', 'rowid', $isdraft);
200
-if (empty($conf->webhook->enabled)) accessforbidden('Module not enabled');
201
-if (!$permissiontoread) accessforbidden();
202
+if (empty($conf->webhook->enabled)) {
203
+	accessforbidden('Module not enabled');
204
+}
205
+if (!$permissiontoread) {
206
+	accessforbidden();
207
+}
202 208
 
203 209
 
204 210
 /*
Please login to merge, or discard this patch.
htdocs/fichinter/index.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -114,7 +114,9 @@
 block discarded – undo
114 114
 	print '<table class="noborder nohover centpercent">';
115 115
 	print '<tr class="liste_titre"><th colspan="2">'.$langs->trans("Statistics").' - '.$langs->trans("Interventions").'</th></tr>'."\n";
116 116
 	$listofstatus = array(Fichinter::STATUS_DRAFT, Fichinter::STATUS_VALIDATED);
117
-	if (!empty($conf->global->FICHINTER_CLASSIFY_BILLED)) $listofstatus[] = Fichinter::STATUS_BILLED;
117
+	if (!empty($conf->global->FICHINTER_CLASSIFY_BILLED)) {
118
+		$listofstatus[] = Fichinter::STATUS_BILLED;
119
+	}
118 120
 
119 121
 	foreach ($listofstatus as $status) {
120 122
 		$dataseries[] = array($fichinterstatic->LibStatut($status, 1), (isset($vals[$status]) ? (int) $vals[$status] : 0));
Please login to merge, or discard this patch.
htdocs/core/lib/files.lib.php 1 patch
Braces   +12 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1003,7 +1003,9 @@  discard block
 block discarded – undo
1003 1003
 				$files = dol_dir_list($newpathofdestdir);
1004 1004
 				if (!empty($files) && is_array($files)) {
1005 1005
 					foreach ($files as $key => $file) {
1006
-						if (!file_exists($file["fullname"])) continue;
1006
+						if (!file_exists($file["fullname"])) {
1007
+							continue;
1008
+						}
1007 1009
 						$filepath = $file["path"];
1008 1010
 						$oldname = $file["name"];
1009 1011
 
@@ -1718,7 +1720,9 @@  discard block
 block discarded – undo
1718 1720
 					// Update index table of files (llx_ecm_files)
1719 1721
 					if ($donotupdatesession == 1) {
1720 1722
 						$sharefile = 0;
1721
-						if ($TFile['type'][$i] == 'application/pdf' && strpos($_SERVER["REQUEST_URI"], 'product') !== false && !empty($conf->global->PRODUCT_ALLOW_EXTERNAL_DOWNLOAD)) $sharefile = 1;
1723
+						if ($TFile['type'][$i] == 'application/pdf' && strpos($_SERVER["REQUEST_URI"], 'product') !== false && !empty($conf->global->PRODUCT_ALLOW_EXTERNAL_DOWNLOAD)) {
1724
+							$sharefile = 1;
1725
+						}
1722 1726
 						$result = addFileIntoDatabaseIndex($upload_dir, basename($destfile).($resupload == 2 ? '.noexe' : ''), $TFile['name'][$i], 'uploaded', $sharefile, $object);
1723 1727
 						if ($result < 0) {
1724 1728
 							if ($allowoverwrite) {
@@ -1873,8 +1877,12 @@  discard block
 block discarded – undo
1873 1877
 				dol_syslog('Error: object ' . get_class($object) . ' has no table_element attribute.');
1874 1878
 				return -1;
1875 1879
 			}
1876
-			if (isset($object->src_object_description)) $ecmfile->description = $object->src_object_description;
1877
-			if (isset($object->src_object_keywords)) $ecmfile->keywords = $object->src_object_keywords;
1880
+			if (isset($object->src_object_description)) {
1881
+				$ecmfile->description = $object->src_object_description;
1882
+			}
1883
+			if (isset($object->src_object_keywords)) {
1884
+				$ecmfile->keywords = $object->src_object_keywords;
1885
+			}
1878 1886
 		}
1879 1887
 
1880 1888
 		if (!empty($conf->global->MAIN_FORCE_SHARING_ON_ANY_UPLOADED_FILE)) {
Please login to merge, or discard this patch.
htdocs/holiday/card_group.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -335,7 +335,9 @@
 block discarded – undo
335 335
 								if ($AutoSendMail && !$error) {
336 336
 									// send a mail to the user
337 337
 									$returnSendMail = sendMail($result, $cancreate, $now, $autoValidation);
338
-									if (!empty($returnSendMail->msg))  setEventMessage($returnSendMail->msg, $returnSendMail->style);
338
+									if (!empty($returnSendMail->msg)) {
339
+										setEventMessage($returnSendMail->msg, $returnSendMail->style);
340
+									}
339 341
 								}
340 342
 							}
341 343
 						}
Please login to merge, or discard this patch.