Passed
Branch develop (66e4de)
by Laurent
33:03
created
recruitment/core/modules/recruitment/modules_recruitmentjobposition.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
 		global $langs;
93 93
 		$langs->load("admin");
94 94
 
95
-		if ($this->version == 'development') return $langs->trans("VersionDevelopment");
96
-		if ($this->version == 'experimental') return $langs->trans("VersionExperimental");
97
-		if ($this->version == 'dolibarr') return DOL_VERSION;
98
-		if ($this->version) return $this->version;
95
+		if ($this->version == 'development') {
96
+			return $langs->trans("VersionDevelopment");
97
+		}
98
+		if ($this->version == 'experimental') {
99
+			return $langs->trans("VersionExperimental");
100
+		}
101
+		if ($this->version == 'dolibarr') {
102
+			return DOL_VERSION;
103
+		}
104
+		if ($this->version) {
105
+			return $this->version;
106
+		}
99 107
 		return $langs->trans("NotAvailable");
100 108
 	}
101 109
 }
Please login to merge, or discard this patch.
core/modules/recruitment/mod_recruitmentjobposition_standard.php 1 patch
Braces   +12 added lines, -4 removed lines patch added patch discarded remove patch
@@ -136,8 +136,11 @@  discard block
 block discarded – undo
136 136
 		if ($resql)
137 137
 		{
138 138
 			$obj = $db->fetch_object($resql);
139
-			if ($obj) $max = intval($obj->max);
140
-			else $max = 0;
139
+			if ($obj) {
140
+				$max = intval($obj->max);
141
+			} else {
142
+				$max = 0;
143
+			}
141 144
 		} else {
142 145
 			dol_syslog("mod_recruitmentjobposition_standard::getNextValue", LOG_DEBUG);
143 146
 			return -1;
@@ -147,8 +150,13 @@  discard block
 block discarded – undo
147 150
 		$date = $object->date_creation;
148 151
 		$yymm = strftime("%y%m", $date);
149 152
 
150
-		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
151
-		else $num = sprintf("%04s", $max + 1);
153
+		if ($max >= (pow(10, 4) - 1)) {
154
+			$num = $max + 1;
155
+		}
156
+		// If counter > 9999, we do not format on 4 chars, we take number as it is
157
+		else {
158
+			$num = sprintf("%04s", $max + 1);
159
+		}
152 160
 
153 161
 		dol_syslog("mod_recruitmentjobposition_standard::getNextValue return ".$this->prefix.$yymm."-".$num);
154 162
 		return $this->prefix.$yymm."-".$num;
Please login to merge, or discard this patch.
htdocs/compta/paymentbybanktransfer/index.php 1 patch
Braces   +12 added lines, -4 removed lines patch added patch discarded remove patch
@@ -38,7 +38,9 @@  discard block
 block discarded – undo
38 38
 
39 39
 // Security check
40 40
 $socid = GETPOST('socid', 'int');
41
-if ($user->socid) $socid = $user->socid;
41
+if ($user->socid) {
42
+	$socid = $user->socid;
43
+}
42 44
 $result = restrictedArea($user, 'paymentbybanktransfer', '', '');
43 45
 
44 46
 
@@ -97,7 +99,9 @@  discard block
 block discarded – undo
97 99
 $sql .= " s.nom as name, s.email, s.rowid as socid, s.tva_intra";
98 100
 $sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f,";
99 101
 $sql .= " ".MAIN_DB_PREFIX."societe as s";
100
-if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
102
+if (!$user->rights->societe->client->voir && !$socid) {
103
+	$sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
104
+}
101 105
 $sql .= ", ".MAIN_DB_PREFIX."prelevement_facture_demande as pfd";
102 106
 $sql .= " WHERE s.rowid = f.fk_soc";
103 107
 $sql .= " AND f.entity IN (".getEntity('supplier_invoice').")";
@@ -109,8 +113,12 @@  discard block
 block discarded – undo
109 113
 $sql .= " AND pfd.traite = 0";
110 114
 $sql .= " AND pfd.ext_payment_id IS NULL";
111 115
 $sql .= " AND pfd.fk_facture_fourn = f.rowid";
112
-if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
113
-if ($socid) $sql .= " AND f.fk_soc = ".$socid;
116
+if (!$user->rights->societe->client->voir && !$socid) {
117
+	$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
118
+}
119
+if ($socid) {
120
+	$sql .= " AND f.fk_soc = ".$socid;
121
+}
114 122
 
115 123
 $resql = $db->query($sql);
116 124
 if ($resql)
Please login to merge, or discard this patch.
htdocs/compta/prelevement/fiche-stat.php 1 patch
Braces   +18 added lines, -7 removed lines patch added patch discarded remove patch
@@ -33,7 +33,9 @@  discard block
 block discarded – undo
33 33
 $langs->loadLangs(array("banks", "categories", 'withdrawals', 'bills'));
34 34
 
35 35
 // Security check
36
-if ($user->socid > 0) accessforbidden();
36
+if ($user->socid > 0) {
37
+	accessforbidden();
38
+}
37 39
 
38 40
 // Get supervariables
39 41
 $prev_id = GETPOST('id', 'int');
@@ -122,22 +124,29 @@  discard block
 block discarded – undo
122 124
 
123 125
 		print '<tr><td class="titlefield">';
124 126
 		$labelofbankfield = "BankToReceiveWithdraw";
125
-		if ($object->type == 'bank-transfer') $labelofbankfield = 'BankToPayCreditTransfer';
127
+		if ($object->type == 'bank-transfer') {
128
+			$labelofbankfield = 'BankToPayCreditTransfer';
129
+		}
126 130
 		print $langs->trans($labelofbankfield);
127 131
 		print '</td>';
128 132
 		print '<td>';
129
-		if ($acc->id > 0)
130
-			print $acc->getNomUrl(1);
133
+		if ($acc->id > 0) {
134
+					print $acc->getNomUrl(1);
135
+		}
131 136
 		print '</td>';
132 137
 		print '</tr>';
133 138
 
134 139
 		print '<tr><td class="titlefield">';
135 140
 		$labelfororderfield = 'WithdrawalFile';
136
-		if ($object->type == 'bank-transfer') $labelfororderfield = 'CreditTransferFile';
141
+		if ($object->type == 'bank-transfer') {
142
+			$labelfororderfield = 'CreditTransferFile';
143
+		}
137 144
 		print $langs->trans($labelfororderfield).'</td><td>';
138 145
 		$relativepath = 'receipts/'.$object->ref.'.xml';
139 146
 		$modulepart = 'prelevement';
140
-		if ($object->type == 'bank-transfer') $modulepart = 'paymentbybanktransfer';
147
+		if ($object->type == 'bank-transfer') {
148
+			$modulepart = 'paymentbybanktransfer';
149
+		}
141 150
 		print '<a data-ajax="false" href="'.DOL_URL_ROOT.'/document.php?type=text/plain&amp;modulepart='.$modulepart.'&amp;file='.urlencode($relativepath).'">'.$relativepath.'</a>';
142 151
 		print '</td></tr></table>';
143 152
 
@@ -183,7 +192,9 @@  discard block
 block discarded – undo
183 192
 			print price($row[0]);
184 193
 
185 194
 			print '</td><td class="right">';
186
-			if ($object->amount) print round($row[0] / $object->amount * 100, 2)." %";
195
+			if ($object->amount) {
196
+				print round($row[0] / $object->amount * 100, 2)." %";
197
+			}
187 198
 			print '</td>';
188 199
 
189 200
 			print "</tr>\n";
Please login to merge, or discard this patch.
htdocs/compta/prelevement/fiche-rejet.php 1 patch
Braces   +21 added lines, -8 removed lines patch added patch discarded remove patch
@@ -35,7 +35,9 @@  discard block
 block discarded – undo
35 35
 $langs->loadLangs(array("banks", "categories", 'withdrawals', 'bills'));
36 36
 
37 37
 // Security check
38
-if ($user->socid > 0) accessforbidden();
38
+if ($user->socid > 0) {
39
+	accessforbidden();
40
+}
39 41
 
40 42
 // Get supervariables
41 43
 $prev_id = GETPOST('id', 'int');
@@ -123,22 +125,29 @@  discard block
 block discarded – undo
123 125
 
124 126
 		print '<tr><td class="titlefield">';
125 127
 		$labelofbankfield = "BankToReceiveWithdraw";
126
-		if ($object->type == 'bank-transfer') $labelofbankfield = 'BankToPayCreditTransfer';
128
+		if ($object->type == 'bank-transfer') {
129
+			$labelofbankfield = 'BankToPayCreditTransfer';
130
+		}
127 131
 		print $langs->trans($labelofbankfield);
128 132
 		print '</td>';
129 133
 		print '<td>';
130
-		if ($acc->id > 0)
131
-			print $acc->getNomUrl(1);
134
+		if ($acc->id > 0) {
135
+					print $acc->getNomUrl(1);
136
+		}
132 137
 		print '</td>';
133 138
 		print '</tr>';
134 139
 
135 140
 		print '<tr><td class="titlefield">';
136 141
 		$labelfororderfield = 'WithdrawalFile';
137
-		if ($object->type == 'bank-transfer') $labelfororderfield = 'CreditTransferFile';
142
+		if ($object->type == 'bank-transfer') {
143
+			$labelfororderfield = 'CreditTransferFile';
144
+		}
138 145
 		print $langs->trans($labelfororderfield).'</td><td>';
139 146
 		$relativepath = 'receipts/'.$object->ref.'.xml';
140 147
 		$modulepart = 'prelevement';
141
-		if ($object->type == 'bank-transfer') $modulepart = 'paymentbybanktransfer';
148
+		if ($object->type == 'bank-transfer') {
149
+			$modulepart = 'paymentbybanktransfer';
150
+		}
142 151
 		print '<a data-ajax="false" href="'.DOL_URL_ROOT.'/document.php?type=text/plain&amp;modulepart='.$modulepart.'&amp;file='.urlencode($relativepath).'">'.$relativepath.'</a>';
143 152
 		print '</td></tr></table>';
144 153
 
@@ -169,7 +178,9 @@  discard block
 block discarded – undo
169 178
 $sql .= " AND pl.fk_soc = s.rowid";
170 179
 $sql .= " AND pl.statut = 3 ";
171 180
 $sql .= " AND pr.fk_prelevement_lignes = pl.rowid";
172
-if ($socid) $sql .= " AND s.rowid = ".$socid;
181
+if ($socid) {
182
+	$sql .= " AND s.rowid = ".$socid;
183
+}
173 184
 $sql .= " ORDER BY pl.amount DESC";
174 185
 
175 186
 // Count total nb of records
@@ -178,9 +189,11 @@  discard block
 block discarded – undo
178 189
 {
179 190
 	$result = $db->query($sql);
180 191
 	$nbtotalofrecords = $db->num_rows($result);
181
-	if (($page * $limit) > $nbtotalofrecords)	// if total resultset is smaller then paging size (filtering), goto and load page 0
192
+	if (($page * $limit) > $nbtotalofrecords) {
193
+		// if total resultset is smaller then paging size (filtering), goto and load page 0
182 194
 	{
183 195
 		$page = 0;
196
+	}
184 197
 		$offset = 0;
185 198
 	}
186 199
 }
Please login to merge, or discard this patch.
htdocs/recruitment/lib/recruitment_recruitmentjobposition.lib.php 1 patch
Braces   +19 added lines, -6 removed lines patch added patch discarded remove patch
@@ -49,11 +49,17 @@  discard block
 block discarded – undo
49 49
 	if (isset($object->fields['note_public']) || isset($object->fields['note_private']))
50 50
 	{
51 51
 		$nbNote = 0;
52
-		if (!empty($object->note_private)) $nbNote++;
53
-		if (!empty($object->note_public)) $nbNote++;
52
+		if (!empty($object->note_private)) {
53
+			$nbNote++;
54
+		}
55
+		if (!empty($object->note_public)) {
56
+			$nbNote++;
57
+		}
54 58
 		$head[$h][0] = dol_buildpath('/recruitment/recruitmentjobposition_note.php', 1).'?id='.$object->id;
55 59
 		$head[$h][1] = $langs->trans('Notes');
56
-		if ($nbNote > 0) $head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbNote.'</span>';
60
+		if ($nbNote > 0) {
61
+			$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbNote.'</span>';
62
+		}
57 63
 		$head[$h][2] = 'note';
58 64
 		$h++;
59 65
 	}
@@ -65,7 +71,9 @@  discard block
 block discarded – undo
65 71
 	$nbLinks = Link::count($db, $object->element, $object->id);
66 72
 	$head[$h][0] = dol_buildpath("/recruitment/recruitmentjobposition_document.php", 1).'?id='.$object->id;
67 73
 	$head[$h][1] = $langs->trans('Documents');
68
-	if (($nbFiles + $nbLinks) > 0) $head[$h][1] .= '<span class="badge marginleftonlyshort">'.($nbFiles + $nbLinks).'</span>';
74
+	if (($nbFiles + $nbLinks) > 0) {
75
+		$head[$h][1] .= '<span class="badge marginleftonlyshort">'.($nbFiles + $nbLinks).'</span>';
76
+	}
69 77
 	$head[$h][2] = 'document';
70 78
 	$h++;
71 79
 
@@ -111,7 +119,9 @@  discard block
 block discarded – undo
111 119
 	//$urlwithroot=DOL_MAIN_URL_ROOT;					// This is to use same domain name than current
112 120
 
113 121
 	$urltouse = DOL_MAIN_URL_ROOT;
114
-	if ($localorexternal) $urltouse = $urlwithroot;
122
+	if ($localorexternal) {
123
+		$urltouse = $urlwithroot;
124
+	}
115 125
 
116 126
 	$out = $urltouse.'/public/recruitment/view.php?ref='.($mode ? '<font color="#666666">' : '').$ref.($mode ? '</font>' : '');
117 127
 	/*if (!empty($conf->global->RECRUITMENT_SECURITY_TOKEN))
@@ -121,7 +131,10 @@  discard block
 block discarded – undo
121 131
 	}*/
122 132
 
123 133
 	// For multicompany
124
-	if (!empty($out) && !empty($conf->multicompany->enabled)) $out .= "&entity=".$conf->entity; // Check the entity because we may have the same reference in several entities
134
+	if (!empty($out) && !empty($conf->multicompany->enabled)) {
135
+		$out .= "&entity=".$conf->entity;
136
+	}
137
+	// Check the entity because we may have the same reference in several entities
125 138
 
126 139
 	return $out;
127 140
 }
Please login to merge, or discard this patch.
htdocs/compta/prelevement/class/bonprelevement.class.php 1 patch
Braces   +101 added lines, -35 removed lines patch added patch discarded remove patch
@@ -291,8 +291,11 @@  discard block
 block discarded – undo
291 291
 		$sql .= ", p.statut as status";
292 292
 		$sql .= " FROM ".MAIN_DB_PREFIX."prelevement_bons as p";
293 293
 		$sql .= " WHERE p.entity IN (".getEntity('invoice').")";
294
-		if ($rowid > 0) $sql .= " AND p.rowid = ".$rowid;
295
-		else $sql .= " AND p.ref = '".$this->db->escape($ref)."'";
294
+		if ($rowid > 0) {
295
+			$sql .= " AND p.rowid = ".$rowid;
296
+		} else {
297
+			$sql .= " AND p.ref = '".$this->db->escape($ref)."'";
298
+		}
296 299
 
297 300
 		dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
298 301
 		$result = $this->db->query($sql);
@@ -657,7 +660,9 @@  discard block
 block discarded – undo
657 660
 		} else {
658 661
 			$sql .= " pf.fk_facture";
659 662
 		}
660
-		if ($amounts) $sql .= ", SUM(pl.amount)";
663
+		if ($amounts) {
664
+			$sql .= ", SUM(pl.amount)";
665
+		}
661 666
 		$sql .= " FROM ".MAIN_DB_PREFIX."prelevement_bons as p";
662 667
 		$sql .= " , ".MAIN_DB_PREFIX."prelevement_lignes as pl";
663 668
 		$sql .= " , ".MAIN_DB_PREFIX."prelevement_facture as pf";
@@ -684,8 +689,9 @@  discard block
 block discarded – undo
684 689
 				while ($i < $num)
685 690
 				{
686 691
 					$row = $this->db->fetch_row($resql);
687
-					if (!$amounts) $arr[$i] = $row[0];
688
-					else {
692
+					if (!$amounts) {
693
+						$arr[$i] = $row[0];
694
+					} else {
689 695
 						$arr[$i] = array(
690 696
 							$row[0],
691 697
 							$row[1]
@@ -849,7 +855,9 @@  discard block
 block discarded – undo
849 855
 
850 856
 		$datetimeprev = time();
851 857
 		//Choice the date of the execution direct debit
852
-		if (!empty($executiondate)) $datetimeprev = $executiondate;
858
+		if (!empty($executiondate)) {
859
+			$datetimeprev = $executiondate;
860
+		}
853 861
 
854 862
 		$month = strftime("%m", $datetimeprev);
855 863
 		$year = strftime("%Y", $datetimeprev);
@@ -937,11 +945,13 @@  discard block
 block discarded – undo
937 945
 						$tmpinvoice = new FactureFournisseur($this->db);
938 946
 					}
939 947
 					$resfetch = $tmpinvoice->fetch($fac[0]);
940
-					if ($resfetch >= 0)		// Field 0 of $fac is rowid of invoice
948
+					if ($resfetch >= 0) {
949
+						// Field 0 of $fac is rowid of invoice
941 950
 					{
942 951
 						if ($soc->fetch($tmpinvoice->socid) >= 0)
943 952
 						{
944 953
 							$bac = new CompanyBankAccount($this->db);
954
+					}
945 955
 							$bac->fetch(0, $soc->id);
946 956
 
947 957
 							if ($type != 'bank-transfer') {
@@ -1040,7 +1050,9 @@  discard block
 block discarded – undo
1040 1050
 					} else {
1041 1051
 						$dir = $conf->paymentbybanktransfer->dir_output.'/receipts';
1042 1052
 					}
1043
-					if (!is_dir($dir)) dol_mkdir($dir);
1053
+					if (!is_dir($dir)) {
1054
+						dol_mkdir($dir);
1055
+					}
1044 1056
 
1045 1057
 					$this->filename = $dir.'/'.$ref.'.xml';
1046 1058
 
@@ -1083,10 +1095,12 @@  discard block
 block discarded – undo
1083 1095
 				 */
1084 1096
 				if (count($factures_prev) > 0)
1085 1097
 				{
1086
-					foreach ($factures_prev as $fac)	// Add a link in database for each invoice
1098
+					foreach ($factures_prev as $fac) {
1099
+						// Add a link in database for each invoice
1087 1100
 					{
1088 1101
 						// Fetch invoice
1089 1102
 						$result = $fact->fetch($fac[0]);
1103
+					}
1090 1104
 						if ($result < 0) {
1091 1105
 							$this->error = 'ERRORBONPRELEVEMENT Failed to load invoice with id '.$fac[0];
1092 1106
 							break;
@@ -1202,7 +1216,9 @@  discard block
 block discarded – undo
1202 1216
 
1203 1217
 				// Call trigger
1204 1218
 				$result = $this->call_trigger($triggername, $user);
1205
-				if ($result < 0) $error++;
1219
+				if ($result < 0) {
1220
+					$error++;
1221
+				}
1206 1222
 				// End call triggers
1207 1223
 			}
1208 1224
 
@@ -1242,7 +1258,9 @@  discard block
 block discarded – undo
1242 1258
 			}
1243 1259
 			// Call trigger
1244 1260
 			$result = $this->call_trigger($triggername, $user);
1245
-			if ($result < 0) $error++;
1261
+			if ($result < 0) {
1262
+				$error++;
1263
+			}
1246 1264
 			// End call triggers
1247 1265
 		}
1248 1266
 
@@ -1250,28 +1268,36 @@  discard block
 block discarded – undo
1250 1268
 		{
1251 1269
 			$sql = "DELETE FROM ".MAIN_DB_PREFIX."prelevement_facture WHERE fk_prelevement_lignes IN (SELECT rowid FROM ".MAIN_DB_PREFIX."prelevement_lignes WHERE fk_prelevement_bons = ".$this->id.")";
1252 1270
 			$resql1 = $this->db->query($sql);
1253
-			if (!$resql1) dol_print_error($this->db);
1271
+			if (!$resql1) {
1272
+				dol_print_error($this->db);
1273
+			}
1254 1274
 		}
1255 1275
 
1256 1276
 		if (!$error)
1257 1277
 		{
1258 1278
 			$sql = "DELETE FROM ".MAIN_DB_PREFIX."prelevement_lignes WHERE fk_prelevement_bons = ".$this->id;
1259 1279
 			$resql2 = $this->db->query($sql);
1260
-			if (!$resql2) dol_print_error($this->db);
1280
+			if (!$resql2) {
1281
+				dol_print_error($this->db);
1282
+			}
1261 1283
 		}
1262 1284
 
1263 1285
 		if (!$error)
1264 1286
 		{
1265 1287
 			$sql = "DELETE FROM ".MAIN_DB_PREFIX."prelevement_bons WHERE rowid = ".$this->id;
1266 1288
 			$resql3 = $this->db->query($sql);
1267
-			if (!$resql3) dol_print_error($this->db);
1289
+			if (!$resql3) {
1290
+				dol_print_error($this->db);
1291
+			}
1268 1292
 		}
1269 1293
 
1270 1294
 		if (!$error)
1271 1295
 		{
1272 1296
 			$sql = "UPDATE ".MAIN_DB_PREFIX."prelevement_facture_demande SET fk_prelevement_bons = NULL, traite = 0 WHERE fk_prelevement_bons = ".$this->id;
1273 1297
 			$resql4 = $this->db->query($sql);
1274
-			if (!$resql4) dol_print_error($this->db);
1298
+			if (!$resql4) {
1299
+				dol_print_error($this->db);
1300
+			}
1275 1301
 		}
1276 1302
 
1277 1303
 		if ($resql1 && $resql2 && $resql3 && $resql4 && !$error)
@@ -1299,7 +1325,10 @@  discard block
 block discarded – undo
1299 1325
 	{
1300 1326
 		global $conf, $langs, $hookmanager;
1301 1327
 
1302
-		if (!empty($conf->dol_no_mouse_hover)) $notooltip = 1; // Force disable tooltips
1328
+		if (!empty($conf->dol_no_mouse_hover)) {
1329
+			$notooltip = 1;
1330
+		}
1331
+		// Force disable tooltips
1303 1332
 
1304 1333
 		$result = '';
1305 1334
 
@@ -1324,8 +1353,12 @@  discard block
 block discarded – undo
1324 1353
 		{
1325 1354
 			// Add param to save lastsearch_values or not
1326 1355
 			$add_save_lastsearch_values = ($save_lastsearch_value == 1 ? 1 : 0);
1327
-			if ($save_lastsearch_value == -1 && preg_match('/list\.php/', $_SERVER["PHP_SELF"])) $add_save_lastsearch_values = 1;
1328
-			if ($add_save_lastsearch_values) $url .= '&save_lastsearch_values=1';
1356
+			if ($save_lastsearch_value == -1 && preg_match('/list\.php/', $_SERVER["PHP_SELF"])) {
1357
+				$add_save_lastsearch_values = 1;
1358
+			}
1359
+			if ($add_save_lastsearch_values) {
1360
+				$url .= '&save_lastsearch_values=1';
1361
+			}
1329 1362
 		}
1330 1363
 
1331 1364
 		$linkclose = '';
@@ -1345,15 +1378,21 @@  discard block
 block discarded – undo
1345 1378
 			 $reshook=$hookmanager->executeHooks('getnomurltooltip',$parameters,$this,$action);    // Note that $action and $object may have been modified by some hooks
1346 1379
 			 if ($reshook > 0) $linkclose = $hookmanager->resPrint;
1347 1380
 			 */
1348
-		} else $linkclose = ($morecss ? ' class="'.$morecss.'"' : '');
1381
+		} else {
1382
+			$linkclose = ($morecss ? ' class="'.$morecss.'"' : '');
1383
+		}
1349 1384
 
1350 1385
 		$linkstart = '<a href="'.$url.'"';
1351 1386
 		$linkstart .= $linkclose.'>';
1352 1387
 		$linkend = '</a>';
1353 1388
 
1354 1389
 		$result .= $linkstart;
1355
-		if ($withpicto) $result .= img_object(($notooltip ? '' : $label), ($this->picto ? $this->picto : 'generic'), ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip ? 0 : 1);
1356
-		if ($withpicto != 2) $result .= $this->ref;
1390
+		if ($withpicto) {
1391
+			$result .= img_object(($notooltip ? '' : $label), ($this->picto ? $this->picto : 'generic'), ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip ? 0 : 1);
1392
+		}
1393
+		if ($withpicto != 2) {
1394
+			$result .= $this->ref;
1395
+		}
1357 1396
 		$result .= $linkend;
1358 1397
 		//if ($withpicto != 2) $result.=(($addlabel && $this->label) ? $sep . dol_trunc($this->label, ($addlabel > 1 ? $addlabel : 0)) : '');
1359 1398
 
@@ -1361,8 +1400,11 @@  discard block
 block discarded – undo
1361 1400
 		$hookmanager->initHooks(array('banktransferdao'));
1362 1401
 		$parameters = array('id'=>$this->id, 'getnomurl'=>$result);
1363 1402
 		$reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
1364
-		if ($reshook > 0) $result = $hookmanager->resPrint;
1365
-		else $result .= $hookmanager->resPrint;
1403
+		if ($reshook > 0) {
1404
+			$result = $hookmanager->resPrint;
1405
+		} else {
1406
+			$result .= $hookmanager->resPrint;
1407
+		}
1366 1408
 
1367 1409
 		return $result;
1368 1410
 	}
@@ -1499,7 +1541,9 @@  discard block
 block discarded – undo
1499 1541
 				$dateTime_ECMA = dol_print_date($now, '%Y-%m-%dT%H:%M:%S');
1500 1542
 
1501 1543
 				$date_actu = $now;
1502
-				if (!empty($executiondate)) $date_actu = $executiondate;
1544
+				if (!empty($executiondate)) {
1545
+					$date_actu = $executiondate;
1546
+				}
1503 1547
 
1504 1548
 				$dateTime_YMD = dol_print_date($date_actu, '%Y%m%d');
1505 1549
 				$dateTime_YMDHMS = dol_print_date($date_actu, '%Y%m%d%H%M%S');
@@ -1614,7 +1658,9 @@  discard block
 block discarded – undo
1614 1658
 				$dateTime_ECMA = dol_print_date($now, '%Y-%m-%dT%H:%M:%S');
1615 1659
 
1616 1660
 				$date_actu = $now;
1617
-				if (!empty($executiondate)) $date_actu = $executiondate;
1661
+				if (!empty($executiondate)) {
1662
+					$date_actu = $executiondate;
1663
+				}
1618 1664
 
1619 1665
 				$dateTime_YMD = dol_print_date($date_actu, '%Y%m%d');
1620 1666
 				$dateTime_YMDHMS = dol_print_date($date_actu, '%Y%m%d%H%M%S');
@@ -1954,8 +2000,12 @@  discard block
 block discarded – undo
1954 2000
 			$XML_DEBITOR .= '						<Ctry>'.$row_country_code.'</Ctry>'.$CrLf;
1955 2001
 			$addressline1 = dol_string_unaccent(strtr($row_address, array(CHR(13) => ", ", CHR(10) => "")));
1956 2002
 			$addressline2 = dol_string_unaccent(strtr($row_zip.(($row_zip && $row_town) ? ' ' : ''.$row_town), array(CHR(13) => ", ", CHR(10) => "")));
1957
-			if (trim($addressline1)) 	$XML_DEBITOR .= '						<AdrLine>'.dolEscapeXML(dol_trunc($addressline1, 70, 'right', 'UTF-8', true)).'</AdrLine>'.$CrLf;
1958
-			if (trim($addressline2))	$XML_DEBITOR .= '						<AdrLine>'.dolEscapeXML(dol_trunc($addressline2, 70, 'right', 'UTF-8', true)).'</AdrLine>'.$CrLf;
2003
+			if (trim($addressline1)) {
2004
+				$XML_DEBITOR .= '						<AdrLine>'.dolEscapeXML(dol_trunc($addressline1, 70, 'right', 'UTF-8', true)).'</AdrLine>'.$CrLf;
2005
+			}
2006
+			if (trim($addressline2)) {
2007
+				$XML_DEBITOR .= '						<AdrLine>'.dolEscapeXML(dol_trunc($addressline2, 70, 'right', 'UTF-8', true)).'</AdrLine>'.$CrLf;
2008
+			}
1959 2009
 			$XML_DEBITOR .= '					</PstlAdr>'.$CrLf;
1960 2010
 			$XML_DEBITOR .= '				</Dbtr>'.$CrLf;
1961 2011
 			$XML_DEBITOR .= '				<DbtrAcct>'.$CrLf;
@@ -2001,8 +2051,12 @@  discard block
 block discarded – undo
2001 2051
 			$XML_CREDITOR .= '						<Ctry>'.$row_country_code.'</Ctry>'.$CrLf;
2002 2052
 			$addressline1 = dol_string_unaccent(strtr($row_address, array(CHR(13) => ", ", CHR(10) => "")));
2003 2053
 			$addressline2 = dol_string_unaccent(strtr($row_zip.(($row_zip && $row_town) ? ' ' : ''.$row_town), array(CHR(13) => ", ", CHR(10) => "")));
2004
-			if (trim($addressline1)) 	$XML_CREDITOR .= '						<AdrLine>'.dolEscapeXML(dol_trunc($addressline1, 70, 'right', 'UTF-8', true)).'</AdrLine>'.$CrLf;
2005
-			if (trim($addressline2))	$XML_CREDITOR .= '						<AdrLine>'.dolEscapeXML(dol_trunc($addressline2, 70, 'right', 'UTF-8', true)).'</AdrLine>'.$CrLf;
2054
+			if (trim($addressline1)) {
2055
+				$XML_CREDITOR .= '						<AdrLine>'.dolEscapeXML(dol_trunc($addressline1, 70, 'right', 'UTF-8', true)).'</AdrLine>'.$CrLf;
2056
+			}
2057
+			if (trim($addressline2)) {
2058
+				$XML_CREDITOR .= '						<AdrLine>'.dolEscapeXML(dol_trunc($addressline2, 70, 'right', 'UTF-8', true)).'</AdrLine>'.$CrLf;
2059
+			}
2006 2060
 			$XML_CREDITOR .= '					</PstlAdr>'.$CrLf;
2007 2061
 			$XML_CREDITOR .= '				</Cdtr>'.$CrLf;
2008 2062
 			$XML_CREDITOR .= '				<CdtrAcct>'.$CrLf;
@@ -2170,8 +2224,12 @@  discard block
 block discarded – undo
2170 2224
 				$XML_SEPA_INFO .= '					<Ctry>'.$country[1].'</Ctry>'.$CrLf;
2171 2225
 				$addressline1 = dol_string_unaccent(strtr($configuration->global->MAIN_INFO_SOCIETE_ADDRESS, array(CHR(13) => ", ", CHR(10) => "")));
2172 2226
 				$addressline2 = dol_string_unaccent(strtr($configuration->global->MAIN_INFO_SOCIETE_ZIP.(($configuration->global->MAIN_INFO_SOCIETE_ZIP || ' '.$configuration->global->MAIN_INFO_SOCIETE_TOWN) ? ' ' : '').$configuration->global->MAIN_INFO_SOCIETE_TOWN, array(CHR(13) => ", ", CHR(10) => "")));
2173
-				if ($addressline1)		$XML_SEPA_INFO .= '					<AdrLine>'.$addressline1.'</AdrLine>'.$CrLf;
2174
-				if ($addressline2)		$XML_SEPA_INFO .= '					<AdrLine>'.$addressline2.'</AdrLine>'.$CrLf;
2227
+				if ($addressline1) {
2228
+					$XML_SEPA_INFO .= '					<AdrLine>'.$addressline1.'</AdrLine>'.$CrLf;
2229
+				}
2230
+				if ($addressline2) {
2231
+					$XML_SEPA_INFO .= '					<AdrLine>'.$addressline2.'</AdrLine>'.$CrLf;
2232
+				}
2175 2233
 				$XML_SEPA_INFO .= '				</PstlAdr>'.$CrLf;
2176 2234
 				$XML_SEPA_INFO .= '			</Cdtr>'.$CrLf;
2177 2235
 				$XML_SEPA_INFO .= '			<CdtrAcct>'.$CrLf;
@@ -2232,8 +2290,12 @@  discard block
 block discarded – undo
2232 2290
 				$XML_SEPA_INFO .= '					<Ctry>'.$country[1].'</Ctry>'.$CrLf;
2233 2291
 				$addressline1 = dol_string_unaccent(strtr($configuration->global->MAIN_INFO_SOCIETE_ADDRESS, array(CHR(13) => ", ", CHR(10) => "")));
2234 2292
 				$addressline2 = dol_string_unaccent(strtr($configuration->global->MAIN_INFO_SOCIETE_ZIP.(($configuration->global->MAIN_INFO_SOCIETE_ZIP || ' '.$configuration->global->MAIN_INFO_SOCIETE_TOWN) ? ' ' : '').$configuration->global->MAIN_INFO_SOCIETE_TOWN, array(CHR(13) => ", ", CHR(10) => "")));
2235
-				if ($addressline1)		$XML_SEPA_INFO .= '					<AdrLine>'.$addressline1.'</AdrLine>'.$CrLf;
2236
-				if ($addressline2)		$XML_SEPA_INFO .= '					<AdrLine>'.$addressline2.'</AdrLine>'.$CrLf;
2293
+				if ($addressline1) {
2294
+					$XML_SEPA_INFO .= '					<AdrLine>'.$addressline1.'</AdrLine>'.$CrLf;
2295
+				}
2296
+				if ($addressline2) {
2297
+					$XML_SEPA_INFO .= '					<AdrLine>'.$addressline2.'</AdrLine>'.$CrLf;
2298
+				}
2237 2299
 				$XML_SEPA_INFO .= '				</PstlAdr>'.$CrLf;
2238 2300
 				$XML_SEPA_INFO .= '			</Dbtr>'.$CrLf;
2239 2301
 				$XML_SEPA_INFO .= '			<DbtrAcct>'.$CrLf;
@@ -2372,8 +2434,12 @@  discard block
 block discarded – undo
2372 2434
 		}
2373 2435
 
2374 2436
 		$statusType = 'status1';
2375
-		if ($status == self::STATUS_TRANSFERED) $statusType = 'status3';
2376
-		if ($status == self::STATUS_CREDITED) $statusType = 'status6';
2437
+		if ($status == self::STATUS_TRANSFERED) {
2438
+			$statusType = 'status3';
2439
+		}
2440
+		if ($status == self::STATUS_CREDITED) {
2441
+			$statusType = 'status6';
2442
+		}
2377 2443
 
2378 2444
 		return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status], '', $statusType, $mode);
2379 2445
 	}
Please login to merge, or discard this patch.
htdocs/product/stock/tpl/stockcorrection.tpl.php 1 patch
Braces   +9 added lines, -3 removed lines patch added patch discarded remove patch
@@ -30,12 +30,16 @@  discard block
 block discarded – undo
30 30
 <!-- BEGIN PHP TEMPLATE STOCKCORRECTION.TPL.PHP -->
31 31
 <?php
32 32
 $productref = '';
33
-if ($object->element == 'product') $productref = $object->ref;
33
+if ($object->element == 'product') {
34
+	$productref = $object->ref;
35
+}
34 36
 
35 37
 $langs->load("productbatch");
36 38
 
37 39
 
38
-if (empty($id)) $id = $object->id;
40
+if (empty($id)) {
41
+	$id = $object->id;
42
+}
39 43
 
40 44
 print '<script type="text/javascript" language="javascript">
41 45
 		jQuery(document).ready(function() {
@@ -69,7 +73,9 @@  discard block
 block discarded – undo
69 73
 	print '<td class="fieldrequired">'.$langs->trans("Warehouse").'</td>';
70 74
 	print '<td>';
71 75
 	$ident = (GETPOST("dwid") ?GETPOST("dwid", 'int') : (GETPOST('id_entrepot') ? GETPOST('id_entrepot', 'int') : ($object->element == 'product' && $object->fk_default_warehouse ? $object->fk_default_warehouse : 'ifone')));
72
-	if (empty($ident) && !empty($conf->global->MAIN_DEFAULT_WAREHOUSE)) $ident = $conf->global->MAIN_DEFAULT_WAREHOUSE;
76
+	if (empty($ident) && !empty($conf->global->MAIN_DEFAULT_WAREHOUSE)) {
77
+		$ident = $conf->global->MAIN_DEFAULT_WAREHOUSE;
78
+	}
73 79
 	print $formproduct->selectWarehouses($ident, 'id_entrepot', 'warehouseopen,warehouseinternal', 1, 0, 0, '', 0, 0, null, 'minwidth100');
74 80
 	print ' &nbsp; <select class="button buttongen" name="mouvement" id="mouvement">';
75 81
 	print '<option value="0">'.$langs->trans("Add").'</option>';
Please login to merge, or discard this patch.
htdocs/product/stock/tpl/stocktransfer.tpl.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -30,11 +30,15 @@
 block discarded – undo
30 30
 <!-- BEGIN PHP TEMPLATE STOCKCORRECTION.TPL.PHP -->
31 31
 <?php
32 32
 $productref = '';
33
-if ($object->element == 'product') $productref = $object->ref;
33
+if ($object->element == 'product') {
34
+	$productref = $object->ref;
35
+}
34 36
 
35 37
 $langs->load("productbatch");
36 38
 
37
-if (empty($id)) $id = $object->id;
39
+if (empty($id)) {
40
+	$id = $object->id;
41
+}
38 42
 
39 43
 $pdluoid = GETPOST('pdluoid', 'int');
40 44
 
Please login to merge, or discard this patch.