Completed
Branch develop (9e9720)
by
unknown
21:32
created
htdocs/commande/class/orderline.class.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
 			$objp = $this->db->fetch_object($result);
185 185
 
186 186
 			if (!$objp) {
187
-				$this->error = 'OrderLine with id '. $rowid .' not found sql='.$sql;
187
+				$this->error = 'OrderLine with id '.$rowid.' not found sql='.$sql;
188 188
 				return 0;
189 189
 			}
190 190
 
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
 			$this->product_desc     = $objp->product_desc;
230 230
 			$this->product_tobatch  = $objp->product_tobatch;
231 231
 			$this->fk_unit          = $objp->fk_unit;
232
-			$this->packaging      	= $objp->packaging;
232
+			$this->packaging = $objp->packaging;
233 233
 
234 234
 			$this->date_start       = $this->db->jdate($objp->date_start);
235 235
 			$this->date_end         = $this->db->jdate($objp->date_end);
@@ -272,8 +272,8 @@  discard block
 block discarded – undo
272 272
 		// check if order line is not in a shipment line before deleting
273 273
 		$sqlCheckShipmentLine = "SELECT";
274 274
 		$sqlCheckShipmentLine .= " ed.rowid";
275
-		$sqlCheckShipmentLine .= " FROM " . MAIN_DB_PREFIX . "expeditiondet ed";
276
-		$sqlCheckShipmentLine .= " WHERE ed.fk_elementdet = " . ((int) $this->id);
275
+		$sqlCheckShipmentLine .= " FROM ".MAIN_DB_PREFIX."expeditiondet ed";
276
+		$sqlCheckShipmentLine .= " WHERE ed.fk_elementdet = ".((int) $this->id);
277 277
 
278 278
 		$resqlCheckShipmentLine = $this->db->query($sqlCheckShipmentLine);
279 279
 		if (!$resqlCheckShipmentLine) {
@@ -286,13 +286,13 @@  discard block
 block discarded – undo
286 286
 			if ($num > 0) {
287 287
 				$error++;
288 288
 				$objCheckShipmentLine = $this->db->fetch_object($resqlCheckShipmentLine);
289
-				$this->error = $langs->trans('ErrorRecordAlreadyExists') . ' : ' . $langs->trans('ShipmentLine') . ' ' . $objCheckShipmentLine->rowid;
289
+				$this->error = $langs->trans('ErrorRecordAlreadyExists').' : '.$langs->trans('ShipmentLine').' '.$objCheckShipmentLine->rowid;
290 290
 				$this->errors[] = $this->error;
291 291
 			}
292 292
 			$this->db->free($resqlCheckShipmentLine);
293 293
 		}
294 294
 		if ($error) {
295
-			dol_syslog(__METHOD__ . 'Error ; ' . $this->error, LOG_ERR);
295
+			dol_syslog(__METHOD__.'Error ; '.$this->error, LOG_ERR);
296 296
 			return -1;
297 297
 		}
298 298
 
@@ -308,7 +308,7 @@  discard block
 block discarded – undo
308 308
 		}
309 309
 
310 310
 		if (!$error) {
311
-			$sql = 'DELETE FROM ' . MAIN_DB_PREFIX . "commandedet WHERE rowid = " . ((int) $this->id);
311
+			$sql = 'DELETE FROM '.MAIN_DB_PREFIX."commandedet WHERE rowid = ".((int) $this->id);
312 312
 
313 313
 			dol_syslog("OrderLine::delete", LOG_DEBUG);
314 314
 			$resql = $this->db->query($sql);
@@ -323,7 +323,7 @@  discard block
 block discarded – undo
323 323
 			$result = $this->deleteExtraFields();
324 324
 			if ($result < 0) {
325 325
 				$error++;
326
-				dol_syslog(get_class($this) . "::delete error -4 " . $this->error, LOG_ERR);
326
+				dol_syslog(get_class($this)."::delete error -4 ".$this->error, LOG_ERR);
327 327
 			}
328 328
 		}
329 329
 
@@ -333,8 +333,8 @@  discard block
 block discarded – undo
333 333
 		}
334 334
 
335 335
 		foreach ($this->errors as $errmsg) {
336
-			dol_syslog(get_class($this) . "::delete " . $errmsg, LOG_ERR);
337
-			$this->error .= ($this->error ? ', ' . $errmsg : $errmsg);
336
+			dol_syslog(get_class($this)."::delete ".$errmsg, LOG_ERR);
337
+			$this->error .= ($this->error ? ', '.$errmsg : $errmsg);
338 338
 		}
339 339
 		$this->db->rollback();
340 340
 		return -1 * $error;
Please login to merge, or discard this patch.
htdocs/commande/class/commande.class.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -381,7 +381,7 @@  discard block
 block discarded – undo
381 381
 	/**
382 382
 	 * Shipment on process
383 383
 	 */
384
-	const STATUS_SHIPMENTONPROCESS = 2;		// We set this status when a shipment is validated
384
+	const STATUS_SHIPMENTONPROCESS = 2; // We set this status when a shipment is validated
385 385
 
386 386
 	/**
387 387
 	 * For backward compatibility. Use key STATUS_SHIPMENTONPROCESS instead.
@@ -397,12 +397,12 @@  discard block
 block discarded – undo
397 397
 	/*
398 398
 	 * No signature
399 399
 	 */
400
-	const STATUS_NO_SIGNATURE    = 0;
400
+	const STATUS_NO_SIGNATURE = 0;
401 401
 
402 402
 	/*
403 403
 	 * Signed by sender
404 404
 	 */
405
-	const STATUS_SIGNED_SENDER   = 1;
405
+	const STATUS_SIGNED_SENDER = 1;
406 406
 
407 407
 	/*
408 408
 	 * Signed by receiver
@@ -412,7 +412,7 @@  discard block
 block discarded – undo
412 412
 	/*
413 413
 	 * Signed by all
414 414
 	 */
415
-	const STATUS_SIGNED_ALL      = 9; // To handle future kind of signature (ex: tripartite contract)
415
+	const STATUS_SIGNED_ALL = 9; // To handle future kind of signature (ex: tripartite contract)
416 416
 
417 417
 
418 418
 	/**
@@ -445,7 +445,7 @@  discard block
 block discarded – undo
445 445
 		if (getDolGlobalString('COMMANDE_ADDON')) {
446 446
 			$mybool = false;
447 447
 
448
-			$file = getDolGlobalString('COMMANDE_ADDON') . ".php";
448
+			$file = getDolGlobalString('COMMANDE_ADDON').".php";
449 449
 			$classname = getDolGlobalString('COMMANDE_ADDON');
450 450
 
451 451
 			// Include file with class
@@ -631,7 +631,7 @@  discard block
 block discarded – undo
631 631
 		// Set new ref and current status
632 632
 		if (!$error) {
633 633
 			$this->ref = $num;
634
-			$this->statut = self::STATUS_VALIDATED;	// deprecated
634
+			$this->statut = self::STATUS_VALIDATED; // deprecated
635 635
 			$this->status = self::STATUS_VALIDATED;
636 636
 		}
637 637
 
@@ -1255,7 +1255,7 @@  discard block
 block discarded – undo
1255 1255
 			if ($objsoc->fetch($socid) > 0) {
1256 1256
 				$this->socid = $objsoc->id;
1257 1257
 				$this->cond_reglement_id	= (!empty($objsoc->cond_reglement_id) ? $objsoc->cond_reglement_id : 0);
1258
-				$this->deposit_percent		= (!empty($objsoc->deposit_percent) ? $objsoc->deposit_percent : 0);
1258
+				$this->deposit_percent = (!empty($objsoc->deposit_percent) ? $objsoc->deposit_percent : 0);
1259 1259
 				$this->mode_reglement_id	= (!empty($objsoc->mode_reglement_id) ? $objsoc->mode_reglement_id : 0);
1260 1260
 				$this->fk_project = 0;
1261 1261
 				$this->fk_delivery_address = 0;
@@ -1346,8 +1346,8 @@  discard block
 block discarded – undo
1346 1346
 	{
1347 1347
 		global $conf, $hookmanager;
1348 1348
 
1349
-		require_once DOL_DOCUMENT_ROOT . '/multicurrency/class/multicurrency.class.php';
1350
-		require_once DOL_DOCUMENT_ROOT . '/core/class/extrafields.class.php';
1349
+		require_once DOL_DOCUMENT_ROOT.'/multicurrency/class/multicurrency.class.php';
1350
+		require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
1351 1351
 
1352 1352
 		$error = 0;
1353 1353
 
@@ -1379,7 +1379,7 @@  discard block
 block discarded – undo
1379 1379
 			$line->fk_parent_line    = $object->lines[$i]->fk_parent_line;
1380 1380
 			$line->fk_unit = $object->lines[$i]->fk_unit;
1381 1381
 
1382
-			$line->date_start 		= $object->lines[$i]->date_start;
1382
+			$line->date_start = $object->lines[$i]->date_start;
1383 1383
 			$line->date_end    		= $object->lines[$i]->date_end;
1384 1384
 
1385 1385
 			$line->fk_fournprice	= $object->lines[$i]->fk_fournprice;
@@ -1734,7 +1734,7 @@  discard block
 block discarded – undo
1734 1734
 			$this->line->date_end = $date_end;
1735 1735
 
1736 1736
 			$this->line->fk_fournprice = $fk_fournprice;
1737
-			$this->line->pa_ht = $pa_ht;	// Can be '' when not defined or 0 if defined to 0 or a price value
1737
+			$this->line->pa_ht = $pa_ht; // Can be '' when not defined or 0 if defined to 0 or a price value
1738 1738
 
1739 1739
 			// Multicurrency
1740 1740
 			$this->line->fk_multicurrency = $this->fk_multicurrency;
@@ -2205,7 +2205,7 @@  discard block
 block discarded – undo
2205 2205
 				$line->weight_units     = $objp->weight_units;
2206 2206
 				$line->volume           = $objp->volume;
2207 2207
 				$line->volume_units     = $objp->volume_units;
2208
-				$line->packaging 		= $objp->packaging;
2208
+				$line->packaging = $objp->packaging;
2209 2209
 
2210 2210
 				$line->date_start       = $this->db->jdate($objp->date_start);
2211 2211
 				$line->date_end         = $this->db->jdate($objp->date_end);
@@ -3528,15 +3528,15 @@  discard block
 block discarded – undo
3528 3528
 		//$sql.= " AND c.fk_statut IN (1,2,3) AND c.facture = 0";
3529 3529
 		if ($mode == 'toship') {
3530 3530
 			// An order to ship is an open order (validated or in progress)
3531
-			$sql .= " AND c.fk_statut IN (" . self::STATUS_VALIDATED . "," . self::STATUS_SHIPMENTONPROCESS . ")";
3531
+			$sql .= " AND c.fk_statut IN (".self::STATUS_VALIDATED.",".self::STATUS_SHIPMENTONPROCESS.")";
3532 3532
 		}
3533 3533
 		if ($mode == 'tobill') {
3534 3534
 			// An order to bill is an order not already billed
3535
-			$sql .= " AND c.fk_statut IN (" . self::STATUS_VALIDATED . "," . self::STATUS_SHIPMENTONPROCESS . ", " . self::STATUS_CLOSED . ") AND c.facture = 0";
3535
+			$sql .= " AND c.fk_statut IN (".self::STATUS_VALIDATED.",".self::STATUS_SHIPMENTONPROCESS.", ".self::STATUS_CLOSED.") AND c.facture = 0";
3536 3536
 		}
3537 3537
 		if ($mode == 'shippedtobill') {
3538 3538
 			// An order shipped and to bill is a delivered order not already billed
3539
-			$sql .= " AND c.fk_statut IN (" . self::STATUS_CLOSED . ") AND c.facture = 0";
3539
+			$sql .= " AND c.fk_statut IN (".self::STATUS_CLOSED.") AND c.facture = 0";
3540 3540
 		}
3541 3541
 		if ($user->socid) {
3542 3542
 			$sql .= " AND c.fk_soc = ".((int) $user->socid);
@@ -3865,7 +3865,7 @@  discard block
 block discarded – undo
3865 3865
 		}
3866 3866
 
3867 3867
 		global $action;
3868
-		$hookmanager->initHooks(array($this->element . 'dao'));
3868
+		$hookmanager->initHooks(array($this->element.'dao'));
3869 3869
 		$parameters = array('id' => $this->id, 'getnomurl' => &$result);
3870 3870
 		$reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
3871 3871
 		if ($reshook > 0) {
@@ -3973,7 +3973,7 @@  discard block
 block discarded – undo
3973 3973
 		$this->status = $this::STATUS_DRAFT;
3974 3974
 
3975 3975
 		// Lines
3976
-		$nbp = min(1000, GETPOSTINT('nblines') ? GETPOSTINT('nblines') : 5);	// We can force the nb of lines to test from command line (but not more than 1000)
3976
+		$nbp = min(1000, GETPOSTINT('nblines') ? GETPOSTINT('nblines') : 5); // We can force the nb of lines to test from command line (but not more than 1000)
3977 3977
 		$xnbp = 0;
3978 3978
 
3979 3979
 		while ($xnbp < $nbp) {
Please login to merge, or discard this patch.
htdocs/compta/facture/class/factureligne.class.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
 			$objp = $this->db->fetch_object($result);
227 227
 
228 228
 			if (!$objp) {
229
-				$this->error = 'InvoiceLine with id '. $rowid .' not found sql='.$sql;
229
+				$this->error = 'InvoiceLine with id '.$rowid.' not found sql='.$sql;
230 230
 				return 0;
231 231
 			}
232 232
 
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
 			$this->total_localtax1		= $objp->total_localtax1;
258 258
 			$this->total_localtax2		= $objp->total_localtax2;
259 259
 			$this->total_ttc			= $objp->total_ttc;
260
-			$this->fk_code_ventilation  = $objp->fk_code_ventilation;
260
+			$this->fk_code_ventilation = $objp->fk_code_ventilation;
261 261
 			$this->rang					= $objp->rang;
262 262
 			$this->fk_fournprice = $objp->fk_fournprice;
263 263
 			$marginInfos				= getMarginInfos($objp->subprice, $objp->remise_percent, $objp->tva_tx, $objp->localtax1_tx, $objp->localtax2_tx, $this->fk_fournprice, $objp->pa_ht);
@@ -283,7 +283,7 @@  discard block
 block discarded – undo
283 283
 			$this->multicurrency_total_tva = $objp->multicurrency_total_tva;
284 284
 			$this->multicurrency_total_ttc = $objp->multicurrency_total_ttc;
285 285
 
286
-			$this->packaging      = $objp->packaging;
286
+			$this->packaging = $objp->packaging;
287 287
 
288 288
 			$this->fetch_optionals();
289 289
 
@@ -651,7 +651,7 @@  discard block
 block discarded – undo
651 651
 		$sql .= ", date_end=".(!empty($this->date_end) ? "'".$this->db->idate($this->date_end)."'" : "null");
652 652
 		$sql .= ", product_type=".$this->product_type;
653 653
 		$sql .= ", info_bits='".$this->db->escape($this->info_bits)."'";
654
-		$sql .= ", special_code=" . (int) $this->special_code;
654
+		$sql .= ", special_code=".(int) $this->special_code;
655 655
 		if (empty($this->skip_update_total)) {
656 656
 			$sql .= ", total_ht=".price2num($this->total_ht);
657 657
 			$sql .= ", total_tva=".price2num($this->total_tva);
Please login to merge, or discard this patch.
htdocs/compta/facture/card.php 1 patch
Spacing   +49 added lines, -49 removed lines patch added patch discarded remove patch
@@ -90,14 +90,14 @@  discard block
 block discarded – undo
90 90
 }
91 91
 
92 92
 // General $Variables
93
-$id = (GETPOSTINT('id') ? GETPOSTINT('id') : GETPOSTINT('facid'));    // For backward compatibility
93
+$id = (GETPOSTINT('id') ? GETPOSTINT('id') : GETPOSTINT('facid')); // For backward compatibility
94 94
 $ref = GETPOST('ref', 'alpha');
95 95
 $socid = GETPOSTINT('socid');
96 96
 $action = GETPOST('action', 'aZ09');
97 97
 $confirm = GETPOST('confirm', 'alpha');
98 98
 $cancel = GETPOST('cancel', 'alpha');
99
-$backtopage = GETPOST('backtopage', 'alpha');					// if not set, a default page will be used
100
-$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha');	// if not set, $backtopage will be used
99
+$backtopage = GETPOST('backtopage', 'alpha'); // if not set, a default page will be used
100
+$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); // if not set, $backtopage will be used
101 101
 $lineid = GETPOSTINT('lineid');
102 102
 $userid = GETPOSTINT('userid');
103 103
 $search_ref = GETPOST('sf_ref', 'alpha') ? GETPOST('sf_ref', 'alpha') : GETPOST('search_ref', 'alpha');
@@ -266,7 +266,7 @@  discard block
 block discarded – undo
266 266
 					setEventMessages('', $warningMsgLineList, 'warnings');
267 267
 				}
268 268
 
269
-				header("Location: " . $_SERVER['PHP_SELF'] . '?facid=' . $result);
269
+				header("Location: ".$_SERVER['PHP_SELF'].'?facid='.$result);
270 270
 				exit();
271 271
 			} else {
272 272
 				$langs->load("errors");
@@ -357,7 +357,7 @@  discard block
 block discarded – undo
357 357
 		// Validation
358 358
 		$object->fetch($id);
359 359
 
360
-		if ((preg_match('/^[\(]?PROV/i', $object->ref) || empty($object->ref)) &&	// empty should not happened, but when it occurs, the test save life
360
+		if ((preg_match('/^[\(]?PROV/i', $object->ref) || empty($object->ref)) && // empty should not happened, but when it occurs, the test save life
361 361
 			getDolGlobalString('FAC_FORCE_DATE_VALIDATION')								// If option enabled, we force invoice date
362 362
 		) {
363 363
 			$object->date = dol_now();
@@ -892,27 +892,27 @@  discard block
 block discarded – undo
892 892
 					$keyforvatrate = $line->tva_tx.($line->vat_src_code ? ' ('.$line->vat_src_code.')' : '');
893 893
 
894 894
 					if (!isset($amount_ht[$keyforvatrate])) {
895
-						$amount_ht[$keyforvatrate]=0;
895
+						$amount_ht[$keyforvatrate] = 0;
896 896
 					}
897 897
 					$amount_ht[$keyforvatrate] += $line->total_ht;
898 898
 					if (!isset($amount_tva[$keyforvatrate])) {
899
-						$amount_tva[$keyforvatrate]=0;
899
+						$amount_tva[$keyforvatrate] = 0;
900 900
 					}
901 901
 					$amount_tva[$keyforvatrate] += $line->total_tva;
902 902
 					if (!isset($amount_ttc[$keyforvatrate])) {
903
-						$amount_ttc[$keyforvatrate]=0;
903
+						$amount_ttc[$keyforvatrate] = 0;
904 904
 					}
905 905
 					$amount_ttc[$keyforvatrate] += $line->total_ttc;
906 906
 					if (!isset($multicurrency_amount_ht[$keyforvatrate])) {
907
-						$multicurrency_amount_ht[$keyforvatrate]=0;
907
+						$multicurrency_amount_ht[$keyforvatrate] = 0;
908 908
 					}
909 909
 					$multicurrency_amount_ht[$keyforvatrate] += $line->multicurrency_total_ht;
910 910
 					if (!isset($multicurrency_amount_tva[$keyforvatrate])) {
911
-						$multicurrency_amount_tva[$keyforvatrate]=0;
911
+						$multicurrency_amount_tva[$keyforvatrate] = 0;
912 912
 					}
913 913
 					$multicurrency_amount_tva[$keyforvatrate] += $line->multicurrency_total_tva;
914 914
 					if (!isset($multicurrency_amount_ttc[$keyforvatrate])) {
915
-						$multicurrency_amount_ttc[$keyforvatrate]=0;
915
+						$multicurrency_amount_ttc[$keyforvatrate] = 0;
916 916
 					}
917 917
 					$multicurrency_amount_ttc[$keyforvatrate] += $line->multicurrency_total_ttc;
918 918
 					$i++;
@@ -1084,7 +1084,7 @@  discard block
 block discarded – undo
1084 1084
 			$error++;
1085 1085
 		}
1086 1086
 
1087
-		$dateinvoice = dol_mktime(0, 0, 0, GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear'), 'tzserver');	// If we enter the 02 january, we need to save the 02 january for server
1087
+		$dateinvoice = dol_mktime(0, 0, 0, GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear'), 'tzserver'); // If we enter the 02 january, we need to save the 02 january for server
1088 1088
 		$date_pointoftax = dol_mktime(0, 0, 0, GETPOSTINT('date_pointoftaxmonth'), GETPOSTINT('date_pointoftaxday'), GETPOSTINT('date_pointoftaxyear'), 'tzserver');
1089 1089
 
1090 1090
 		// Replacement invoice
@@ -1116,7 +1116,7 @@  discard block
 block discarded – undo
1116 1116
 				$object->note_private		= trim(GETPOST('note_private', 'restricthtml'));
1117 1117
 				$object->ref_client			= GETPOST('ref_client', 'alphanohtml');
1118 1118
 				$object->ref_customer		= GETPOST('ref_client', 'alphanohtml');
1119
-				$object->model_pdf          = GETPOST('model', 'alphanohtml');
1119
+				$object->model_pdf = GETPOST('model', 'alphanohtml');
1120 1120
 				$object->fk_project			= GETPOSTINT('projectid');
1121 1121
 				$object->cond_reglement_id	= GETPOSTINT('cond_reglement_id');
1122 1122
 				$object->mode_reglement_id	= GETPOSTINT('mode_reglement_id');
@@ -1177,9 +1177,9 @@  discard block
 block discarded – undo
1177 1177
 				$object->note_private		= trim(GETPOST('note_private', 'restricthtml'));
1178 1178
 				$object->ref_client			= GETPOST('ref_client', 'alphanohtml');
1179 1179
 				$object->ref_customer		= GETPOST('ref_client', 'alphanohtml');
1180
-				$object->model_pdf          = GETPOST('model');
1180
+				$object->model_pdf = GETPOST('model');
1181 1181
 				$object->fk_project			= GETPOSTINT('projectid');
1182
-				$object->cond_reglement_id	= 0;		// No payment term for a credit note
1182
+				$object->cond_reglement_id	= 0; // No payment term for a credit note
1183 1183
 				$object->mode_reglement_id	= GETPOSTINT('mode_reglement_id');
1184 1184
 				$object->fk_account         = GETPOSTINT('fk_account');
1185 1185
 				//$object->remise_absolue		= price2num(GETPOST('remise_absolue'), 'MU');
@@ -1501,7 +1501,7 @@  discard block
 block discarded – undo
1501 1501
 				$object->note_public		= trim(GETPOST('note_public', 'restricthtml'));
1502 1502
 				$object->note_private       = trim(GETPOST('note_private', 'restricthtml'));
1503 1503
 				$object->ref_client			= GETPOST('ref_client');
1504
-				$object->ref_customer		= GETPOST('ref_client');
1504
+				$object->ref_customer = GETPOST('ref_client');
1505 1505
 				$object->model_pdf          = GETPOST('model');
1506 1506
 				$object->fk_project			= GETPOSTINT('projectid');
1507 1507
 				$object->cond_reglement_id	= (GETPOSTINT('type') == 3 ? 1 : GETPOST('cond_reglement_id'));
@@ -1565,7 +1565,7 @@  discard block
 block discarded – undo
1565 1565
 						$element = $subelement = 'expedition';
1566 1566
 					}
1567 1567
 
1568
-					$object->origin = $origin;		// deprecated
1568
+					$object->origin = $origin; // deprecated
1569 1569
 					$object->origin_type = $origin;
1570 1570
 					$object->origin_id = $originid;
1571 1571
 
@@ -1600,7 +1600,7 @@  discard block
 block discarded – undo
1600 1600
 						dol_syslog("Try to find source object origin=".$object->origin." originid=".$object->origin_id." to add lines or deposit lines");
1601 1601
 						$result = $srcobject->fetch($object->origin_id);
1602 1602
 
1603
-						$i = -1;  // Ensure initialised for static analysis, but with invalid idx.
1603
+						$i = -1; // Ensure initialised for static analysis, but with invalid idx.
1604 1604
 						// If deposit invoice - down payment with 1 line (fixed amount or percent)
1605 1605
 						if (GETPOST('type') == Facture::TYPE_DEPOSIT && in_array($typeamount, array('amount', 'variable'))) {
1606 1606
 							// Define the array $amountdeposit
@@ -2003,7 +2003,7 @@  discard block
 block discarded – undo
2003 2003
 				if (!empty($origin) && !empty($originid)) {
2004 2004
 					include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php';
2005 2005
 
2006
-					$object->origin = $origin;		// deprecated
2006
+					$object->origin = $origin; // deprecated
2007 2007
 					$object->origin_type = $origin;
2008 2008
 					$object->origin_id = $originid;
2009 2009
 
@@ -2029,7 +2029,7 @@  discard block
 block discarded – undo
2029 2029
 						$line->fk_prev_id = $line->id;
2030 2030
 						$line->fetch_optionals();
2031 2031
 						if (getDolGlobalInt('INVOICE_USE_SITUATION') == 2) {
2032
-							$line->situation_percent = $line->getAllPrevProgress($object->id);  // get good progress including credit note
2032
+							$line->situation_percent = $line->getAllPrevProgress($object->id); // get good progress including credit note
2033 2033
 						} else {
2034 2034
 							$line->situation_percent = $line->get_prev_progress($object->id); // get good progress including credit note
2035 2035
 						}
@@ -2139,7 +2139,7 @@  discard block
 block discarded – undo
2139 2139
 		} else {
2140 2140
 			$db->rollback();
2141 2141
 			$action = 'create';
2142
-			$_GET["origin"] = $_POST["origin"];		// Keep GET and POST here ?
2142
+			$_GET["origin"] = $_POST["origin"]; // Keep GET and POST here ?
2143 2143
 			$_GET["originid"] = $_POST["originid"]; // Keep GET and POST here ?
2144 2144
 			setEventMessages($object->error, $object->errors, 'errors');
2145 2145
 		}
@@ -2697,7 +2697,7 @@  discard block
 block discarded – undo
2697 2697
 		// Define special_code for special lines
2698 2698
 		$special_code = GETPOSTINT('special_code');
2699 2699
 		if ($special_code == 3) {
2700
-			$special_code = 0;	// Options should not exists on invoices
2700
+			$special_code = 0; // Options should not exists on invoices
2701 2701
 		}
2702 2702
 
2703 2703
 		$line = new FactureLigne($db);
@@ -3261,7 +3261,7 @@  discard block
 block discarded – undo
3261 3261
 	$fk_account = GETPOSTINT('fk_account');
3262 3262
 
3263 3263
 	// Load objectsrc
3264
-	$objectsrc = null;  // Initialise
3264
+	$objectsrc = null; // Initialise
3265 3265
 	//$remise_absolue = 0;
3266 3266
 	if (!empty($origin) && !empty($originid)) {
3267 3267
 		// Parse element/subelement (ex: project_task)
@@ -3272,7 +3272,7 @@  discard block
 block discarded – undo
3272 3272
 			$subelement = $regs[2];
3273 3273
 		}
3274 3274
 
3275
-		$dateinvoice = dol_mktime(0, 0, 0, GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear'), 'tzserver');	// If we enter the 02 january, we need to save the 02 january for server
3275
+		$dateinvoice = dol_mktime(0, 0, 0, GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear'), 'tzserver'); // If we enter the 02 january, we need to save the 02 january for server
3276 3276
 		$date_pointoftax = dol_mktime(0, 0, 0, GETPOSTINT('date_pointoftaxmonth'), GETPOSTINT('date_pointoftaxday'), GETPOSTINT('date_pointoftaxyear'), 'tzserver');
3277 3277
 
3278 3278
 		if ($element == 'project') {
@@ -3346,8 +3346,8 @@  discard block
 block discarded – undo
3346 3346
 				$fk_account         = (!empty($expesrc->fk_account) ? $expesrc->fk_account : (!empty($soc->fk_account) ? $soc->fk_account : 0));
3347 3347
 
3348 3348
 				if (isModEnabled('multicurrency')) {
3349
-					$currency_code 	= (!empty($expesrc->multicurrency_code) ? $expesrc->multicurrency_code : (!empty($soc->multicurrency_code) ? $soc->multicurrency_code : $objectsrc->multicurrency_code));
3350
-					$currency_tx 	= (!empty($expesrc->multicurrency_tx) ? $expesrc->multicurrency_tx : (!empty($soc->multicurrency_tx) ? $soc->multicurrency_tx : $objectsrc->multicurrency_tx));
3349
+					$currency_code = (!empty($expesrc->multicurrency_code) ? $expesrc->multicurrency_code : (!empty($soc->multicurrency_code) ? $soc->multicurrency_code : $objectsrc->multicurrency_code));
3350
+					$currency_tx = (!empty($expesrc->multicurrency_tx) ? $expesrc->multicurrency_tx : (!empty($soc->multicurrency_tx) ? $soc->multicurrency_tx : $objectsrc->multicurrency_tx));
3351 3351
 				}
3352 3352
 
3353 3353
 				//Replicate extrafields
@@ -3440,7 +3440,7 @@  discard block
 block discarded – undo
3440 3440
 	print '<form name="add" action="'.$_SERVER["PHP_SELF"].'" method="POST" id="formtocreate" name="formtocreate">';
3441 3441
 	print '<input type="hidden" name="token" value="'.newToken().'">';
3442 3442
 	print '<input type="hidden" name="action" id="formtocreateaction" value="add">';
3443
-	print '<input type="hidden" name="changecompany" value="0">';	// will be set to 1 by javascript so we know post is done after a company change
3443
+	print '<input type="hidden" name="changecompany" value="0">'; // will be set to 1 by javascript so we know post is done after a company change
3444 3444
 	if ($soc->id > 0) {
3445 3445
 		print '<input type="hidden" name="socid" value="'.$soc->id.'">'."\n";
3446 3446
 	}
@@ -3961,8 +3961,8 @@  discard block
 block discarded – undo
3961 3961
 		if ($socid > 0) {
3962 3962
 			print '<tr><td>'.$langs->trans('DiscountStillRemaining').'</td><td colspan="2">';
3963 3963
 
3964
-			$thirdparty = $soc;	// used by object_discounts.tpl.php
3965
-			$discount_type = 0;	// used by object_discounts.tpl.php
3964
+			$thirdparty = $soc; // used by object_discounts.tpl.php
3965
+			$discount_type = 0; // used by object_discounts.tpl.php
3966 3966
 			$backtopage = $_SERVER["PHP_SELF"].'?socid='.$thirdparty->id.'&action='.$action.'&origin='.urlencode((string) (GETPOST('origin'))).'&originid='.urlencode((string) (GETPOSTINT('originid')));
3967 3967
 			include DOL_DOCUMENT_ROOT.'/core/tpl/object_discounts.tpl.php';
3968 3968
 
@@ -4003,7 +4003,7 @@  discard block
 block discarded – undo
4003 4003
 			if (empty($retained_warranty)) {
4004 4004
 				if ($objectsrc !== null && property_exists($objectsrc, 'retained_warranty') && !empty($objectsrc->retained_warranty)) { // use previous situation value
4005 4005
 					// Facture->retained_warranty  (does not exist on Expedition)
4006
-					$retained_warranty = $objectsrc->retained_warranty;  // @phan-suppress-current-line PhanUndeclaredProperty
4006
+					$retained_warranty = $objectsrc->retained_warranty; // @phan-suppress-current-line PhanUndeclaredProperty
4007 4007
 				}
4008 4008
 			}
4009 4009
 			$retained_warranty_js_default = !empty($retained_warranty) ? $retained_warranty : getDolGlobalString('INVOICE_SITUATION_DEFAULT_RETAINED_WARRANTY_PERCENT');
@@ -4482,7 +4482,7 @@  discard block
 block discarded – undo
4482 4482
 		$nbMandated = 0;
4483 4483
 		foreach ($object->lines as $line) {
4484 4484
 			$res = $line->fetch_product();
4485
-			if ($res  > 0) {
4485
+			if ($res > 0) {
4486 4486
 				if ($line->product->isService() && $line->product->isMandatoryPeriod() && (empty($line->date_start) || empty($line->date_end))) {
4487 4487
 					$nbMandated++;
4488 4488
 					break;
@@ -4694,7 +4694,7 @@  discard block
 block discarded – undo
4694 4694
 	}
4695 4695
 	// Ref customer
4696 4696
 	$morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_customer, $object, $usercancreate, 'string', '', 0, 1);
4697
-	$morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_customer, $object, $usercancreate, 'string'.(getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') ? ':' . getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') : ''), '', null, null, '', 1);
4697
+	$morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_customer, $object, $usercancreate, 'string'.(getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') ? ':'.getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') : ''), '', null, null, '', 1);
4698 4698
 	// Thirdparty
4699 4699
 	$morehtmlref .= '<br>'.$object->thirdparty->getNomUrl(1, 'customer');
4700 4700
 	if (!getDolGlobalString('MAIN_DISABLE_OTHER_LINK') && $object->thirdparty->id > 0) {
@@ -5088,45 +5088,45 @@  discard block
 block discarded – undo
5088 5088
 		}
5089 5089
 		print '<tr>';
5090 5090
 		// Amount HT
5091
-		print '<td class="titlefieldmiddle">' . $langs->trans('AmountHT') . '</td>';
5092
-		print '<td class="nowrap amountcard right">' . price($sign * $object->total_ht, 0, $langs, 0, -1, -1, $conf->currency) . '</td>';
5091
+		print '<td class="titlefieldmiddle">'.$langs->trans('AmountHT').'</td>';
5092
+		print '<td class="nowrap amountcard right">'.price($sign * $object->total_ht, 0, $langs, 0, -1, -1, $conf->currency).'</td>';
5093 5093
 		if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
5094 5094
 			// Multicurrency Amount HT
5095
-			print '<td class="nowrap amountcard right">' . price($sign * $object->multicurrency_total_ht, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>';
5095
+			print '<td class="nowrap amountcard right">'.price($sign * $object->multicurrency_total_ht, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>';
5096 5096
 		}
5097 5097
 		print '</tr>';
5098 5098
 
5099 5099
 		print '<tr>';
5100 5100
 		// Amount VAT
5101
-		print '<td>' . $langs->trans('AmountVAT') . '</td>';
5102
-		print '<td class="nowrap amountcard right">' . price($sign * $object->total_tva, 0, $langs, 0, -1, -1, $conf->currency) . '</td>';
5101
+		print '<td>'.$langs->trans('AmountVAT').'</td>';
5102
+		print '<td class="nowrap amountcard right">'.price($sign * $object->total_tva, 0, $langs, 0, -1, -1, $conf->currency).'</td>';
5103 5103
 		if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
5104 5104
 			// Multicurrency Amount VAT
5105
-			print '<td class="nowrap amountcard right">' . price($sign * $object->multicurrency_total_tva, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>';
5105
+			print '<td class="nowrap amountcard right">'.price($sign * $object->multicurrency_total_tva, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>';
5106 5106
 		}
5107 5107
 		print '</tr>';
5108 5108
 
5109 5109
 		// Amount Local Taxes
5110 5110
 		if (($mysoc->localtax1_assuj == "1" && $mysoc->useLocalTax(1)) || $object->total_localtax1 != 0) {
5111 5111
 			print '<tr>';
5112
-			print '<td class="titlefieldmiddle">' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '</td>';
5113
-			print '<td class="nowrap amountcard right">' . price($sign * $object->total_localtax1, 0, $langs, 0, -1, -1, $conf->currency) . '</td>';
5112
+			print '<td class="titlefieldmiddle">'.$langs->transcountry("AmountLT1", $mysoc->country_code).'</td>';
5113
+			print '<td class="nowrap amountcard right">'.price($sign * $object->total_localtax1, 0, $langs, 0, -1, -1, $conf->currency).'</td>';
5114 5114
 			if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
5115 5115
 				$object->multicurrency_total_localtax1 = (float) price2num($object->total_localtax1 * $object->multicurrency_tx, 'MT');
5116 5116
 
5117
-				print '<td class="nowrap amountcard right">' . price($sign * $object->multicurrency_total_localtax1, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>';
5117
+				print '<td class="nowrap amountcard right">'.price($sign * $object->multicurrency_total_localtax1, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>';
5118 5118
 			}
5119 5119
 			print '</tr>';
5120 5120
 		}
5121 5121
 
5122 5122
 		if (($mysoc->localtax2_assuj == "1" && $mysoc->useLocalTax(2)) || $object->total_localtax2 != 0) {
5123 5123
 			print '<tr>';
5124
-			print '<td>' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '</td>';
5125
-			print '<td class="nowrap amountcard right">' . price($sign * $object->total_localtax2, 0, $langs, 0, -1, -1, $conf->currency) . '</td>';
5124
+			print '<td>'.$langs->transcountry("AmountLT2", $mysoc->country_code).'</td>';
5125
+			print '<td class="nowrap amountcard right">'.price($sign * $object->total_localtax2, 0, $langs, 0, -1, -1, $conf->currency).'</td>';
5126 5126
 			if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
5127 5127
 				$object->multicurrency_total_localtax2 = (float) price2num($object->total_localtax2 * $object->multicurrency_tx, 'MT');
5128 5128
 
5129
-				print '<td class="nowrap amountcard right">' . price($sign * $object->multicurrency_total_localtax2, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>';
5129
+				print '<td class="nowrap amountcard right">'.price($sign * $object->multicurrency_total_localtax2, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>';
5130 5130
 			}
5131 5131
 			print '</tr>';
5132 5132
 		}
@@ -5186,11 +5186,11 @@  discard block
 block discarded – undo
5186 5186
 
5187 5187
 		print '<tr>';
5188 5188
 		// Amount TTC
5189
-		print '<td>' . $langs->trans('AmountTTC') . '</td>';
5190
-		print '<td class="nowrap amountcard right">' . price($sign * $object->total_ttc, 0, $langs, 0, -1, -1, $conf->currency) . '</td>';
5189
+		print '<td>'.$langs->trans('AmountTTC').'</td>';
5190
+		print '<td class="nowrap amountcard right">'.price($sign * $object->total_ttc, 0, $langs, 0, -1, -1, $conf->currency).'</td>';
5191 5191
 		if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
5192 5192
 			// Multicurrency Amount TTC
5193
-			print '<td class="nowrap amountcard right">' . price($sign * $object->multicurrency_total_ttc, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>';
5193
+			print '<td class="nowrap amountcard right">'.price($sign * $object->multicurrency_total_ttc, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>';
5194 5194
 		}
5195 5195
 		print '</tr>';
5196 5196
 
@@ -5861,7 +5861,7 @@  discard block
 block discarded – undo
5861 5861
 					$langs->load("contracts");
5862 5862
 
5863 5863
 					if ($usercancreatecontract) {
5864
-						print '<a class="butAction" href="' . DOL_URL_ROOT . '/contrat/card.php?action=create&amp;origin=' . $object->element . '&amp;originid=' . $object->id . '&amp;socid=' . $object->socid . '">' . $langs->trans('AddContract') . '</a>';
5864
+						print '<a class="butAction" href="'.DOL_URL_ROOT.'/contrat/card.php?action=create&amp;origin='.$object->element.'&amp;originid='.$object->id.'&amp;socid='.$object->socid.'">'.$langs->trans('AddContract').'</a>';
5865 5865
 					}
5866 5866
 				}
5867 5867
 			}
@@ -6087,7 +6087,7 @@  discard block
 block discarded – undo
6087 6087
 			if ($usercandelete || ($usercancreate && $isErasable == 1)) {	// isErasable = 1 means draft with temporary ref (draft can always be deleted with no need of permissions)
6088 6088
 				$enableDelete = false;
6089 6089
 				$deleteHref = '#';
6090
-				if ($isErasable > 0 && ! $objectidnext) {
6090
+				if ($isErasable > 0 && !$objectidnext) {
6091 6091
 					$deleteHref = $_SERVER["PHP_SELF"].'?facid='.$object->id.'&action=delete&token='.newToken();
6092 6092
 					$enableDelete = true;
6093 6093
 				}
Please login to merge, or discard this patch.
htdocs/product/class/product.class.php 1 patch
Spacing   +61 added lines, -61 removed lines patch added patch discarded remove patch
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
 	/**
151 151
 	 * @var string
152 152
 	 */
153
-	public $price_formated;			// used by takepos/ajax/ajax.php
153
+	public $price_formated; // used by takepos/ajax/ajax.php
154 154
 
155 155
 	/**
156 156
 	 * Selling price with tax
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
 	/**
163 163
 	 * @var string
164 164
 	 */
165
-	public $price_ttc_formated;		// used by takepos/ajax/ajax.php
165
+	public $price_ttc_formated; // used by takepos/ajax/ajax.php
166 166
 
167 167
 	/**
168 168
 	 * Minimum price net
@@ -511,7 +511,7 @@  discard block
 block discarded – undo
511 511
 	/**
512 512
 	 * @var int|string
513 513
 	 */
514
-	public $weight_units;	// scale -3, 0, 3, 6
514
+	public $weight_units; // scale -3, 0, 3, 6
515 515
 	/**
516 516
 	 * @var float|string
517 517
 	 */
@@ -519,7 +519,7 @@  discard block
 block discarded – undo
519 519
 	/**
520 520
 	 * @var int|string
521 521
 	 */
522
-	public $length_units;	// scale -3, 0, 3, 6
522
+	public $length_units; // scale -3, 0, 3, 6
523 523
 	/**
524 524
 	 * @var float|string
525 525
 	 */
@@ -527,7 +527,7 @@  discard block
 block discarded – undo
527 527
 	/**
528 528
 	 * @var int|string
529 529
 	 */
530
-	public $width_units;	// scale -3, 0, 3, 6
530
+	public $width_units; // scale -3, 0, 3, 6
531 531
 	/**
532 532
 	 * @var float|string|null
533 533
 	 */
@@ -535,7 +535,7 @@  discard block
 block discarded – undo
535 535
 	/**
536 536
 	 * @var int|string|null
537 537
 	 */
538
-	public $height_units;	// scale -3, 0, 3, 6
538
+	public $height_units; // scale -3, 0, 3, 6
539 539
 	/**
540 540
 	 * @var float|string|null
541 541
 	 */
@@ -543,7 +543,7 @@  discard block
 block discarded – undo
543 543
 	/**
544 544
 	 * @var int|string|null
545 545
 	 */
546
-	public $surface_units;	// scale -3, 0, 3, 6
546
+	public $surface_units; // scale -3, 0, 3, 6
547 547
 	/**
548 548
 	 * @var float|string|null
549 549
 	 */
@@ -551,7 +551,7 @@  discard block
 block discarded – undo
551 551
 	/**
552 552
 	 * @var int|string|null
553 553
 	 */
554
-	public $volume_units;	// scale -3, 0, 3, 6
554
+	public $volume_units; // scale -3, 0, 3, 6
555 555
 
556 556
 	/**
557 557
 	 * @var float|string|null
@@ -560,7 +560,7 @@  discard block
 block discarded – undo
560 560
 	/**
561 561
 	 * @var ?string
562 562
 	 */
563
-	public $net_measure_units;	// scale -3, 0, 3, 6
563
+	public $net_measure_units; // scale -3, 0, 3, 6
564 564
 
565 565
 	/**
566 566
 	 * @var string
@@ -875,7 +875,7 @@  discard block
 block discarded – undo
875 875
 		'import_key'    => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => 1, 'visible' => -2, 'notnull' => -1, 'index' => 0, 'position' => 1000),
876 876
 		//'tosell'       =>array('type'=>'integer',      'label'=>'Status',           'enabled'=>1, 'visible'=>1,  'notnull'=>1, 'default'=>'0', 'index'=>1,  'position'=>1000, 'arrayofkeyval'=>array(0=>'Draft', 1=>'Active', -1=>'Cancel')),
877 877
 		//'tobuy'        =>array('type'=>'integer',      'label'=>'Status',           'enabled'=>1, 'visible'=>1,  'notnull'=>1, 'default'=>'0', 'index'=>1,  'position'=>1000, 'arrayofkeyval'=>array(0=>'Draft', 1=>'Active', -1=>'Cancel')),
878
-		'mandatory_period' => array('type' => 'integer', 'label' => 'mandatoryperiod', 'enabled' => 1, 'visible' => -1,  'notnull' => 1, 'default' => '0', 'index' => 1,  'position' => 1000),
878
+		'mandatory_period' => array('type' => 'integer', 'label' => 'mandatoryperiod', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'default' => '0', 'index' => 1, 'position' => 1000),
879 879
 	);
880 880
 
881 881
 	/**
@@ -1179,9 +1179,9 @@  discard block
 block discarded – undo
1179 1179
 
1180 1180
 							// update accountancy for this entity
1181 1181
 							if (!$error && getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED')) {
1182
-								$this->db->query("DELETE FROM " . $this->db->prefix() . "product_perentity WHERE fk_product = " .((int) $this->id) . " AND entity = " . ((int) $conf->entity));
1182
+								$this->db->query("DELETE FROM ".$this->db->prefix()."product_perentity WHERE fk_product = ".((int) $this->id)." AND entity = ".((int) $conf->entity));
1183 1183
 
1184
-								$sql = "INSERT INTO " . $this->db->prefix() . "product_perentity (";
1184
+								$sql = "INSERT INTO ".$this->db->prefix()."product_perentity (";
1185 1185
 								$sql .= " fk_product";
1186 1186
 								$sql .= ", entity";
1187 1187
 								$sql .= ", accountancy_code_buy";
@@ -1192,13 +1192,13 @@  discard block
 block discarded – undo
1192 1192
 								$sql .= ", accountancy_code_sell_export";
1193 1193
 								$sql .= ") VALUES (";
1194 1194
 								$sql .= $this->id;
1195
-								$sql .= ", " . ((int) $conf->entity);
1196
-								$sql .= ", '" . $this->db->escape($this->accountancy_code_buy) . "'";
1197
-								$sql .= ", '" . $this->db->escape($this->accountancy_code_buy_intra) . "'";
1198
-								$sql .= ", '" . $this->db->escape($this->accountancy_code_buy_export) . "'";
1199
-								$sql .= ", '" . $this->db->escape($this->accountancy_code_sell) . "'";
1200
-								$sql .= ", '" . $this->db->escape($this->accountancy_code_sell_intra) . "'";
1201
-								$sql .= ", '" . $this->db->escape($this->accountancy_code_sell_export) . "'";
1195
+								$sql .= ", ".((int) $conf->entity);
1196
+								$sql .= ", '".$this->db->escape($this->accountancy_code_buy)."'";
1197
+								$sql .= ", '".$this->db->escape($this->accountancy_code_buy_intra)."'";
1198
+								$sql .= ", '".$this->db->escape($this->accountancy_code_buy_export)."'";
1199
+								$sql .= ", '".$this->db->escape($this->accountancy_code_sell)."'";
1200
+								$sql .= ", '".$this->db->escape($this->accountancy_code_sell_intra)."'";
1201
+								$sql .= ", '".$this->db->escape($this->accountancy_code_sell_export)."'";
1202 1202
 								$sql .= ")";
1203 1203
 								$result = $this->db->query($sql);
1204 1204
 								if (!$result) {
@@ -1582,12 +1582,12 @@  discard block
 block discarded – undo
1582 1582
 			$sql .= ", note_public = ".(isset($this->note_public) ? "'".$this->db->escape($this->note_public)."'" : 'null');
1583 1583
 			$sql .= ", duration = '".$this->db->escape($this->duration_value.$this->duration_unit)."'";
1584 1584
 			if (!getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED')) {
1585
-				$sql .= ", accountancy_code_buy = '" . $this->db->escape($this->accountancy_code_buy) . "'";
1586
-				$sql .= ", accountancy_code_buy_intra = '" . $this->db->escape($this->accountancy_code_buy_intra) . "'";
1587
-				$sql .= ", accountancy_code_buy_export = '" . $this->db->escape($this->accountancy_code_buy_export) . "'";
1588
-				$sql .= ", accountancy_code_sell= '" . $this->db->escape($this->accountancy_code_sell) . "'";
1589
-				$sql .= ", accountancy_code_sell_intra= '" . $this->db->escape($this->accountancy_code_sell_intra) . "'";
1590
-				$sql .= ", accountancy_code_sell_export= '" . $this->db->escape($this->accountancy_code_sell_export) . "'";
1585
+				$sql .= ", accountancy_code_buy = '".$this->db->escape($this->accountancy_code_buy)."'";
1586
+				$sql .= ", accountancy_code_buy_intra = '".$this->db->escape($this->accountancy_code_buy_intra)."'";
1587
+				$sql .= ", accountancy_code_buy_export = '".$this->db->escape($this->accountancy_code_buy_export)."'";
1588
+				$sql .= ", accountancy_code_sell= '".$this->db->escape($this->accountancy_code_sell)."'";
1589
+				$sql .= ", accountancy_code_sell_intra= '".$this->db->escape($this->accountancy_code_sell_intra)."'";
1590
+				$sql .= ", accountancy_code_sell_export= '".$this->db->escape($this->accountancy_code_sell_export)."'";
1591 1591
 			}
1592 1592
 			$sql .= ", desiredstock = ".((isset($this->desiredstock) && is_numeric($this->desiredstock)) ? (float) $this->desiredstock : "null");
1593 1593
 			$sql .= ", cost_price = ".($this->cost_price != '' ? ((float) $this->cost_price) : 'null');
@@ -1620,9 +1620,9 @@  discard block
 block discarded – undo
1620 1620
 
1621 1621
 				// update accountancy for this entity
1622 1622
 				if (!$error && getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED')) {
1623
-					$this->db->query("DELETE FROM " . $this->db->prefix() . "product_perentity WHERE fk_product = " . ((int) $this->id) . " AND entity = " . ((int) $conf->entity));
1623
+					$this->db->query("DELETE FROM ".$this->db->prefix()."product_perentity WHERE fk_product = ".((int) $this->id)." AND entity = ".((int) $conf->entity));
1624 1624
 
1625
-					$sql = "INSERT INTO " . $this->db->prefix() . "product_perentity (";
1625
+					$sql = "INSERT INTO ".$this->db->prefix()."product_perentity (";
1626 1626
 					$sql .= " fk_product";
1627 1627
 					$sql .= ", entity";
1628 1628
 					$sql .= ", accountancy_code_buy";
@@ -1633,13 +1633,13 @@  discard block
 block discarded – undo
1633 1633
 					$sql .= ", accountancy_code_sell_export";
1634 1634
 					$sql .= ") VALUES (";
1635 1635
 					$sql .= ((int) $this->id);
1636
-					$sql .= ", " . ((int) $conf->entity);
1637
-					$sql .= ", '" . $this->db->escape($this->accountancy_code_buy) . "'";
1638
-					$sql .= ", '" . $this->db->escape($this->accountancy_code_buy_intra) . "'";
1639
-					$sql .= ", '" . $this->db->escape($this->accountancy_code_buy_export) . "'";
1640
-					$sql .= ", '" . $this->db->escape($this->accountancy_code_sell) . "'";
1641
-					$sql .= ", '" . $this->db->escape($this->accountancy_code_sell_intra) . "'";
1642
-					$sql .= ", '" . $this->db->escape($this->accountancy_code_sell_export) . "'";
1636
+					$sql .= ", ".((int) $conf->entity);
1637
+					$sql .= ", '".$this->db->escape($this->accountancy_code_buy)."'";
1638
+					$sql .= ", '".$this->db->escape($this->accountancy_code_buy_intra)."'";
1639
+					$sql .= ", '".$this->db->escape($this->accountancy_code_buy_export)."'";
1640
+					$sql .= ", '".$this->db->escape($this->accountancy_code_sell)."'";
1641
+					$sql .= ", '".$this->db->escape($this->accountancy_code_sell_intra)."'";
1642
+					$sql .= ", '".$this->db->escape($this->accountancy_code_sell_export)."'";
1643 1643
 					$sql .= ")";
1644 1644
 					$result = $this->db->query($sql);
1645 1645
 					if (!$result) {
@@ -1717,7 +1717,7 @@  discard block
 block discarded – undo
1717 1717
 								$error++;
1718 1718
 							} else {
1719 1719
 								// to keep old entries with the new dir
1720
-								require_once DOL_DOCUMENT_ROOT . '/ecm/class/ecmfiles.class.php';
1720
+								require_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmfiles.class.php';
1721 1721
 								$ecmfiles = new EcmFiles($this->db);
1722 1722
 								$ecmfiles->updateAfterRename("produit/".dol_sanitizeFileName($this->oldcopy->ref), "produit/".dol_sanitizeFileName($this->ref));
1723 1723
 							}
@@ -2015,7 +2015,7 @@  discard block
 block discarded – undo
2015 2015
 				}
2016 2016
 			} elseif (isset($this->multilangs[$key])) {
2017 2017
 				if (empty($this->multilangs[$key]["label"])) {
2018
-					$this->errors[] = $key . ' : ' . $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Label"));
2018
+					$this->errors[] = $key.' : '.$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Label"));
2019 2019
 					return -1;
2020 2020
 				}
2021 2021
 
@@ -2212,7 +2212,7 @@  discard block
 block discarded – undo
2212 2212
 	 */
2213 2213
 	private function getArrayForPriceCompare($level = 0)
2214 2214
 	{
2215
-		$testExit = array('multiprices','multiprices_ttc','multiprices_base_type','multiprices_min','multiprices_min_ttc','multiprices_tva_tx','multiprices_recuperableonly');
2215
+		$testExit = array('multiprices', 'multiprices_ttc', 'multiprices_base_type', 'multiprices_min', 'multiprices_min_ttc', 'multiprices_tva_tx', 'multiprices_recuperableonly');
2216 2216
 
2217 2217
 		foreach ($testExit as $field) {
2218 2218
 			if (!isset($this->$field)) {
@@ -2902,12 +2902,12 @@  discard block
 block discarded – undo
2902 2902
 
2903 2903
 		// For MultiCompany
2904 2904
 		// PMP per entity & Stocks Sharings stock_reel includes only stocks shared with this entity
2905
-		$separatedEntityPMP = false;	// Set to true to get the AWP from table llx_product_perentity instead of field 'pmp' into llx_product.
2906
-		$separatedStock = false;		// Set to true will count stock from subtable llx_product_stock. It is slower than using denormalized field 'stock', but it is required when using multientity and shared warehouses.
2905
+		$separatedEntityPMP = false; // Set to true to get the AWP from table llx_product_perentity instead of field 'pmp' into llx_product.
2906
+		$separatedStock = false; // Set to true will count stock from subtable llx_product_stock. It is slower than using denormalized field 'stock', but it is required when using multientity and shared warehouses.
2907 2907
 		$visibleWarehousesEntities = $conf->entity;
2908 2908
 		if (getDolGlobalString('MULTICOMPANY_PRODUCT_SHARING_ENABLED')) {
2909 2909
 			if (getDolGlobalString('MULTICOMPANY_PMP_PER_ENTITY_ENABLED')) {
2910
-				$checkPMPPerEntity = $this->db->query("SELECT pmp FROM " . $this->db->prefix() . "product_perentity WHERE fk_product = ".((int) $id)." AND entity = ".(int) $conf->entity);
2910
+				$checkPMPPerEntity = $this->db->query("SELECT pmp FROM ".$this->db->prefix()."product_perentity WHERE fk_product = ".((int) $id)." AND entity = ".(int) $conf->entity);
2911 2911
 				if ($this->db->num_rows($checkPMPPerEntity) > 0) {
2912 2912
 					$separatedEntityPMP = true;
2913 2913
 				}
@@ -2915,7 +2915,7 @@  discard block
 block discarded – undo
2915 2915
 			global $mc;
2916 2916
 			$separatedStock = true;
2917 2917
 			if (isset($mc->sharings['stock']) && !empty($mc->sharings['stock'])) {
2918
-				$visibleWarehousesEntities .= "," . implode(",", $mc->sharings['stock']);
2918
+				$visibleWarehousesEntities .= ",".implode(",", $mc->sharings['stock']);
2919 2919
 			}
2920 2920
 		}
2921 2921
 		if ($separatedEntityPMP) {
@@ -2933,10 +2933,10 @@  discard block
 block discarded – undo
2933 2933
 		}
2934 2934
 		$sql .= " FROM ".$this->db->prefix()."product as p";
2935 2935
 		if (getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED') || $separatedEntityPMP) {
2936
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "product_perentity as ppe ON ppe.fk_product = p.rowid AND ppe.entity = " . ((int) $conf->entity);
2936
+			$sql .= " LEFT JOIN ".$this->db->prefix()."product_perentity as ppe ON ppe.fk_product = p.rowid AND ppe.entity = ".((int) $conf->entity);
2937 2937
 		}
2938 2938
 		if ($separatedStock) {
2939
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "product_stock as sp ON sp.fk_product = p.rowid AND sp.fk_entrepot IN (SELECT rowid FROM ".$this->db->prefix()."entrepot WHERE entity IN (".$this->db->sanitize($visibleWarehousesEntities)."))";
2939
+			$sql .= " LEFT JOIN ".$this->db->prefix()."product_stock as sp ON sp.fk_product = p.rowid AND sp.fk_entrepot IN (SELECT rowid FROM ".$this->db->prefix()."entrepot WHERE entity IN (".$this->db->sanitize($visibleWarehousesEntities)."))";
2940 2940
 		}
2941 2941
 
2942 2942
 		if ($id) {
@@ -3103,15 +3103,15 @@  discard block
 block discarded – undo
3103 3103
 						$sql .= " WHERE entity IN (".getEntity('productprice').")";
3104 3104
 						$sql .= " AND price_level=".((int) $i);
3105 3105
 						$sql .= " AND fk_product = ".((int) $this->id);
3106
-						$sql .= " ORDER BY date_price DESC, rowid DESC";	// Get the most recent line
3107
-						$sql .= " LIMIT 1";									// Only the first one
3106
+						$sql .= " ORDER BY date_price DESC, rowid DESC"; // Get the most recent line
3107
+						$sql .= " LIMIT 1"; // Only the first one
3108 3108
 						$resql = $this->db->query($sql);
3109 3109
 						if ($resql) {
3110 3110
 							$result = $this->db->fetch_array($resql);
3111 3111
 
3112 3112
 							$this->multiprices[$i] = $result ? $result["price"] : null;
3113 3113
 							$this->multiprices_ttc[$i] = $result ? $result["price_ttc"] : null;
3114
-							$this->multiprices_min[$i] =  $result ? $result["price_min"] : null;
3114
+							$this->multiprices_min[$i] = $result ? $result["price_min"] : null;
3115 3115
 							$this->multiprices_min_ttc[$i] = $result ? $result["price_min_ttc"] : null;
3116 3116
 							$this->multiprices_base_type[$i] = $result ? $result["price_base_type"] : null;
3117 3117
 							// Next two fields are used only if PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL is on
@@ -3336,7 +3336,7 @@  discard block
 block discarded – undo
3336 3336
 				$obj = $this->db->fetch_object($result);
3337 3337
 				$this->stats_mo['customers_'.$role] = $obj->nb_customers ? $obj->nb_customers : 0;
3338 3338
 				$this->stats_mo['nb_'.$role] = $obj->nb ? $obj->nb : 0;
3339
-				$this->stats_mo['qty_'.$role] = $obj->qty ? price2num($obj->qty, 'MS') : 0;		// qty may be a float due to the SUM()
3339
+				$this->stats_mo['qty_'.$role] = $obj->qty ? price2num($obj->qty, 'MS') : 0; // qty may be a float due to the SUM()
3340 3340
 			} else {
3341 3341
 				$this->error = $this->db->error();
3342 3342
 				$error++;
@@ -4859,7 +4859,7 @@  discard block
 block discarded – undo
4859 4859
 				//Addition of a product with the highest rank +1
4860 4860
 				$sql = "INSERT INTO ".$this->db->prefix()."product_association(fk_product_pere,fk_product_fils,qty,incdec,rang)";
4861 4861
 				$sql .= " VALUES (".((int) $id_pere).", ".((int) $id_fils).", ".price2num($qty, 'MS').", ".((int) $incdec).", ".((int) $rank).")";
4862
-				if (! $this->db->query($sql)) {
4862
+				if (!$this->db->query($sql)) {
4863 4863
 					dol_print_error($this->db);
4864 4864
 					return -1;
4865 4865
 				} else {
@@ -4980,7 +4980,7 @@  discard block
 block discarded – undo
4980 4980
 				$sql = "UPDATE ".$this->db->prefix()."product_association";
4981 4981
 				$sql .= " SET rang = ".((int) $cpt);
4982 4982
 				$sql .= " WHERE rowid = ".((int) $objrank->rowid);
4983
-				if (! $this->db->query($sql)) {
4983
+				if (!$this->db->query($sql)) {
4984 4984
 					dol_print_error($this->db);
4985 4985
 					return -1;
4986 4986
 				}
@@ -5415,7 +5415,7 @@  discard block
 block discarded – undo
5415 5415
 		if (isset($this->sousprods) && is_array($this->sousprods)) {
5416 5416
 			foreach ($this->sousprods as $prod_name => $desc_product) {
5417 5417
 				if (is_array($desc_product)) {
5418
-					$this->fetch_prod_arbo($desc_product, "", $multiply, 1, $this->id, $ignore_stock_load);	// This set $this->res
5418
+					$this->fetch_prod_arbo($desc_product, "", $multiply, 1, $this->id, $ignore_stock_load); // This set $this->res
5419 5419
 				}
5420 5420
 			}
5421 5421
 		}
@@ -5572,7 +5572,7 @@  discard block
 block discarded – undo
5572 5572
 		$sql .= " AND pa.fk_product_fils <> ".((int) $id); // This should not happens, it is to avoid infinite loop if it happens
5573 5573
 		$sql .= " ORDER BY pa.rang";
5574 5574
 
5575
-		dol_syslog(get_class($this).'::getChildsArbo id='.$id.' level='.$level. ' parents='.(is_array($parents) ? implode(',', $parents) : $parents), LOG_DEBUG);
5575
+		dol_syslog(get_class($this).'::getChildsArbo id='.$id.' level='.$level.' parents='.(is_array($parents) ? implode(',', $parents) : $parents), LOG_DEBUG);
5576 5576
 
5577 5577
 		if ($level == 1) {
5578 5578
 			$alreadyfound = array($id => 1); // We init array of found object to start of tree, so if we found it later (should not happened), we stop immediately
@@ -5637,7 +5637,7 @@  discard block
 block discarded – undo
5637 5637
 			$parent[$this->label][$keyChild] = $valueChild;
5638 5638
 		}
5639 5639
 		foreach ($parent as $key => $value) {        // key=label, value is array of children
5640
-			$this->sousprods[$key] = $value;  // @phan-suppress-current-line PhanTypeMismatchProperty
5640
+			$this->sousprods[$key] = $value; // @phan-suppress-current-line PhanTypeMismatchProperty
5641 5641
 		}
5642 5642
 	}
5643 5643
 
@@ -5673,7 +5673,7 @@  discard block
 block discarded – undo
5673 5673
 		if (!empty($this->entity) && $permissiontoreadproduct) {
5674 5674
 			$tmpphoto = $this->show_photos('product', $conf->product->multidir_output[$this->entity], 1, 1, 0, 0, 0, 80, 0, 0, 0, 0, '1');
5675 5675
 			if ($this->nbphoto > 0) {
5676
-				$datas['photo'] = '<div class="photointooltip floatright">'."\n" . $tmpphoto . '</div>';
5676
+				$datas['photo'] = '<div class="photointooltip floatright">'."\n".$tmpphoto.'</div>';
5677 5677
 			}
5678 5678
 		}
5679 5679
 
@@ -5683,7 +5683,7 @@  discard block
 block discarded – undo
5683 5683
 			$datas['picto'] = img_picto('', 'service').' <u class="paddingrightonly">'.$langs->trans("Service").'</u>';
5684 5684
 		}
5685 5685
 		if (isset($this->status) && isset($this->status_buy)) {
5686
-			$datas['status'] = ' '.$this->getLibStatut(5, 0) . ' '.$this->getLibStatut(5, 1);
5686
+			$datas['status'] = ' '.$this->getLibStatut(5, 0).' '.$this->getLibStatut(5, 1);
5687 5687
 		}
5688 5688
 
5689 5689
 		if (!empty($this->ref)) {
@@ -5733,7 +5733,7 @@  discard block
 block discarded – undo
5733 5733
 					$labelsurfacevolume .= ($labelsurfacevolume ? " - " : "")."<b>".$langs->trans("Volume").'</b>: '.$this->volume.' '.measuringUnitString(0, 'volume', $this->volume_units);
5734 5734
 				}
5735 5735
 				if ($labelsurfacevolume) {
5736
-					$datas['surface'] = "<br>" . $labelsurfacevolume;
5736
+					$datas['surface'] = "<br>".$labelsurfacevolume;
5737 5737
 				}
5738 5738
 			}
5739 5739
 			if ($this->isService() && !empty($this->duration_value)) {
@@ -5775,9 +5775,9 @@  discard block
 block discarded – undo
5775 5775
 			}
5776 5776
 			// show categories for this record only in ajax to not overload lists
5777 5777
 			if (isModEnabled('category') && !$nofetch) {
5778
-				require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
5778
+				require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
5779 5779
 				$form = new Form($this->db);
5780
-				$datas['categories'] = '<br>' . $form->showCategories($this->id, Categorie::TYPE_PRODUCT, 1);
5780
+				$datas['categories'] = '<br>'.$form->showCategories($this->id, Categorie::TYPE_PRODUCT, 1);
5781 5781
 			}
5782 5782
 		}
5783 5783
 
@@ -6301,7 +6301,7 @@  discard block
 block discarded – undo
6301 6301
 		if (isModEnabled("supplier_order")) {
6302 6302
 			$filterStatus = getDolGlobalString('SUPPLIER_ORDER_STATUS_FOR_VIRTUAL_STOCK', '3,4');
6303 6303
 			if (isset($includedraftpoforvirtual)) {
6304
-				$filterStatus = '0,1,2,'.$filterStatus;	// 1,2 may have already been inside $filterStatus but it is better to have twice than missing $filterStatus does not include them
6304
+				$filterStatus = '0,1,2,'.$filterStatus; // 1,2 may have already been inside $filterStatus but it is better to have twice than missing $filterStatus does not include them
6305 6305
 			}
6306 6306
 			$result = $this->load_stats_commande_fournisseur(0, $filterStatus, 1, $dateofvirtualstock);
6307 6307
 			if ($result < 0) {
@@ -6342,7 +6342,7 @@  discard block
 block discarded – undo
6342 6342
 		} elseif (getDolGlobalString('STOCK_CALCULATE_ON_VALIDATE_ORDER')) {
6343 6343
 			if (getDolGlobalString('STOCK_CALCULATE_ON_VALIDATE_ORDER_INCLUDE_DRAFT')) {	// By default, draft means "does not exist", so we do not include them by default, except if option is on
6344 6344
 				$tmpnewprod = dol_clone($this, 1);
6345
-				$result = $tmpnewprod->load_stats_commande(0, '0', 1);	// Get qty in draft orders
6345
+				$result = $tmpnewprod->load_stats_commande(0, '0', 1); // Get qty in draft orders
6346 6346
 				$this->stock_theorique += $tmpnewprod->stats_commande['qty'];
6347 6347
 			}
6348 6348
 		} elseif (getDolGlobalString('STOCK_CALCULATE_ON_BILL') && $weBillOrderOrShipmentReception == 'order') {
@@ -6359,7 +6359,7 @@  discard block
 block discarded – undo
6359 6359
 		} elseif (getDolGlobalString('STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER')) {	// Warning: stock change "on approval", not on validation !
6360 6360
 			if (getDolGlobalString('STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER_INCLUDE_DRAFT')) {	// By default, draft means "does not exist", so we do not include them by default, except if option is on
6361 6361
 				$tmpnewprod = dol_clone($this, 1);
6362
-				$result = $tmpnewprod->load_stats_commande_fournisseur(0, '0', 1);	// Get qty in draft orders
6362
+				$result = $tmpnewprod->load_stats_commande_fournisseur(0, '0', 1); // Get qty in draft orders
6363 6363
 				$this->stock_theorique += $this->stats_commande_fournisseur['qty'];
6364 6364
 			}
6365 6365
 			$this->stock_theorique -= $stock_reception_fournisseur;
@@ -6736,7 +6736,7 @@  discard block
 block discarded – undo
6736 6736
 		if (getDolGlobalString('BARCODE_PRODUCT_ADDON_NUM')) {
6737 6737
 			$dirsociete = array_merge(array('/core/modules/barcode/'), $conf->modules_parts['barcode']);
6738 6738
 			foreach ($dirsociete as $dirroot) {
6739
-				$res = dol_include_once($dirroot . getDolGlobalString('BARCODE_PRODUCT_ADDON_NUM').'.php');
6739
+				$res = dol_include_once($dirroot.getDolGlobalString('BARCODE_PRODUCT_ADDON_NUM').'.php');
6740 6740
 				if ($res) {
6741 6741
 					break;
6742 6742
 				}
Please login to merge, or discard this patch.
htdocs/expensereport/card.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
 }
164 164
 $result = restrictedArea($user, 'expensereport', $object->id, 'expensereport');
165 165
 
166
-$permissiontoadd = $user->hasRight('expensereport', 'creer');	// Used by the include of actions_dellink.inc.php
166
+$permissiontoadd = $user->hasRight('expensereport', 'creer'); // Used by the include of actions_dellink.inc.php
167 167
 
168 168
 
169 169
 /*
@@ -314,7 +314,7 @@  discard block
 block discarded – undo
314 314
 
315 315
 			if ($overlappingExpenseReportID > 0) {
316 316
 				$error++;
317
-				setEventMessages($langs->trans("ErrorDoubleDeclaration").' <a href="'.$_SERVER['PHP_SELF'].'?id='.$overlappingExpenseReportID.'">'. $langs->trans('ShowTrip').'</a>', null, 'errors');
317
+				setEventMessages($langs->trans("ErrorDoubleDeclaration").' <a href="'.$_SERVER['PHP_SELF'].'?id='.$overlappingExpenseReportID.'">'.$langs->trans('ShowTrip').'</a>', null, 'errors');
318 318
 				$action = 'create';
319 319
 			}
320 320
 		}
@@ -2387,7 +2387,7 @@  discard block
 block discarded – undo
2387 2387
 							}
2388 2388
 						}
2389 2389
 
2390
-						$tredited = 'tredited';	// Case the addfile and linkto file is used for edit (used by following tpl)
2390
+						$tredited = 'tredited'; // Case the addfile and linkto file is used for edit (used by following tpl)
2391 2391
 						include DOL_DOCUMENT_ROOT.'/expensereport/tpl/expensereport_addfile.tpl.php';
2392 2392
 						include DOL_DOCUMENT_ROOT.'/expensereport/tpl/expensereport_linktofile.tpl.php';
2393 2393
 
@@ -2442,7 +2442,7 @@  discard block
 block discarded – undo
2442 2442
 
2443 2443
 						// Quantity
2444 2444
 						print '<td class="right">';
2445
-						print '<input type="text" min="0" class="input_qty right maxwidth50"  name="qty" value="'.dol_escape_htmltag((string) $line->qty).'" />';  // We must be able to enter decimal qty
2445
+						print '<input type="text" min="0" class="input_qty right maxwidth50"  name="qty" value="'.dol_escape_htmltag((string) $line->qty).'" />'; // We must be able to enter decimal qty
2446 2446
 						print '</td>';
2447 2447
 
2448 2448
 						//print '<td class="right">'.$langs->trans('AmountHT').'</td>';
@@ -2547,7 +2547,7 @@  discard block
 block discarded – undo
2547 2547
 				print '</script>'."\n";
2548 2548
 				print '</td></tr>';
2549 2549
 
2550
-				$tredited = '';	// Case the addfile and linkto file is used for edit (used by following tpl)
2550
+				$tredited = ''; // Case the addfile and linkto file is used for edit (used by following tpl)
2551 2551
 				include DOL_DOCUMENT_ROOT.'/expensereport/tpl/expensereport_linktofile.tpl.php';
2552 2552
 				include DOL_DOCUMENT_ROOT.'/expensereport/tpl/expensereport_addfile.tpl.php';
2553 2553
 
Please login to merge, or discard this patch.
htdocs/societe/card.php 1 patch
Spacing   +59 added lines, -59 removed lines patch added patch discarded remove patch
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
 $backtopage = GETPOST('backtopage', 'alpha');
118 118
 $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha');
119 119
 $backtopagejsfields = GETPOST('backtopagejsfields', 'alpha');
120
-$confirm 	= GETPOST('confirm', 'alpha');
120
+$confirm = GETPOST('confirm', 'alpha');
121 121
 
122 122
 $dol_openinpopup = '';
123 123
 if (!empty($backtopagejsfields)) {
@@ -168,12 +168,12 @@  discard block
 block discarded – undo
168 168
 }
169 169
 
170 170
 // Permissions
171
-$permissiontoread 	= $user->hasRight('societe', 'lire');
172
-$permissiontoadd 	= $user->hasRight('societe', 'creer'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
171
+$permissiontoread = $user->hasRight('societe', 'lire');
172
+$permissiontoadd = $user->hasRight('societe', 'creer'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
173 173
 $permissiontodelete = $user->hasRight('societe', 'supprimer') || ($permissiontoadd && isset($object->status) && $object->status == 0);
174
-$permissionnote 	= $user->hasRight('societe', 'creer'); // Used by the include of actions_setnotes.inc.php
174
+$permissionnote = $user->hasRight('societe', 'creer'); // Used by the include of actions_setnotes.inc.php
175 175
 $permissiondellink 	= $user->hasRight('societe', 'creer'); // Used by the include of actions_dellink.inc.php
176
-$upload_dir 		= $conf->societe->multidir_output[isset($object->entity) ? $object->entity : 1];
176
+$upload_dir = $conf->societe->multidir_output[isset($object->entity) ? $object->entity : 1];
177 177
 
178 178
 // Security check
179 179
 $result = restrictedArea($user, 'societe', $socid, '&societe', '', 'fk_soc', 'rowid', 0);
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
 
218 218
 	if ($action == 'confirm_merge' && $confirm == 'yes' && $permissiontoadd) {
219 219
 		$soc_origin_id = GETPOSTINT('soc_origin');
220
-		$soc_origin = new Societe($db);		// The thirdparty that we will delete
220
+		$soc_origin = new Societe($db); // The thirdparty that we will delete
221 221
 
222 222
 		if ($soc_origin_id <= 0) {
223 223
 			$langs->load('errors');
@@ -333,19 +333,19 @@  discard block
 block discarded – undo
333 333
 				$object->name = dolGetFirstLastname(GETPOST('firstname', 'alphanohtml'), GETPOST('name', 'alphanohtml'));
334 334
 				$object->civility_id		= GETPOST('civility_id', 'alphanohtml'); // Note: civility id is a code, not an int
335 335
 				// Add non official properties
336
-				$object->name_bis			= GETPOST('name', 'alphanohtml');
337
-				$object->firstname			= GETPOST('firstname', 'alphanohtml');
336
+				$object->name_bis = GETPOST('name', 'alphanohtml');
337
+				$object->firstname = GETPOST('firstname', 'alphanohtml');
338 338
 			} else {
339
-				$object->name				= GETPOST('name', 'alphanohtml');
339
+				$object->name = GETPOST('name', 'alphanohtml');
340 340
 			}
341 341
 			$object->entity					= ((GETPOSTISSET('entity') && GETPOST('entity') != '') ? GETPOSTINT('entity') : $conf->entity);
342
-			$object->name_alias				= GETPOST('name_alias', 'alphanohtml');
342
+			$object->name_alias = GETPOST('name_alias', 'alphanohtml');
343 343
 			$object->parent					= GETPOSTISSET('parent_company_id') ? GETPOSTINT('parent_company_id') : $object->parent;
344 344
 			$object->address				= GETPOST('address', 'alphanohtml');
345
-			$object->zip					= GETPOST('zipcode', 'alphanohtml');
346
-			$object->town					= GETPOST('town', 'alphanohtml');
347
-			$object->country_id				= GETPOSTINT('country_id');
348
-			$object->state_id				= GETPOSTINT('state_id');
345
+			$object->zip = GETPOST('zipcode', 'alphanohtml');
346
+			$object->town = GETPOST('town', 'alphanohtml');
347
+			$object->country_id = GETPOSTINT('country_id');
348
+			$object->state_id = GETPOSTINT('state_id');
349 349
 
350 350
 			$object->socialnetworks = array();
351 351
 			if (isModEnabled('socialnetworks')) {
@@ -357,10 +357,10 @@  discard block
 block discarded – undo
357 357
 			}
358 358
 
359 359
 			$object->phone					= GETPOST('phone', 'alpha');
360
-			$object->phone_mobile 			= (string) GETPOST("phone_mobile", 'alpha');
360
+			$object->phone_mobile = (string) GETPOST("phone_mobile", 'alpha');
361 361
 			$object->fax					= GETPOST('fax', 'alpha');
362 362
 			$object->email					= trim(GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL));
363
-			$object->no_email 				= GETPOSTINT("no_email");
363
+			$object->no_email = GETPOSTINT("no_email");
364 364
 			$object->url					= trim(GETPOST('url', 'custom', 0, FILTER_SANITIZE_URL));
365 365
 			$object->idprof1				= trim(GETPOST('idprof1', 'alphanohtml'));
366 366
 			$object->idprof2				= trim(GETPOST('idprof2', 'alphanohtml'));
@@ -370,13 +370,13 @@  discard block
 block discarded – undo
370 370
 			$object->idprof6				= trim(GETPOST('idprof6', 'alphanohtml'));
371 371
 			$object->prefix_comm			= GETPOST('prefix_comm', 'alphanohtml');
372 372
 			$object->code_client			= GETPOSTISSET('customer_code') ? GETPOST('customer_code', 'alpha') : GETPOST('code_client', 'alpha');
373
-			$object->code_fournisseur		= GETPOSTISSET('supplier_code') ? GETPOST('supplier_code', 'alpha') : GETPOST('code_fournisseur', 'alpha');
373
+			$object->code_fournisseur = GETPOSTISSET('supplier_code') ? GETPOST('supplier_code', 'alpha') : GETPOST('code_fournisseur', 'alpha');
374 374
 			$object->capital				= GETPOSTFLOAT('capital');
375 375
 			$object->barcode				= GETPOST('barcode', 'alphanohtml');
376 376
 
377 377
 			$object->tva_intra				= GETPOST('tva_intra', 'alphanohtml');
378 378
 			$object->tva_assuj				= GETPOSTINT('assujtva_value');
379
-			$object->vat_reverse_charge		= GETPOST('vat_reverse_charge') == 'on' ? 1 : 0;
379
+			$object->vat_reverse_charge = GETPOST('vat_reverse_charge') == 'on' ? 1 : 0;
380 380
 			$object->status = GETPOSTINT('status');
381 381
 
382 382
 			// Local Taxes
@@ -386,9 +386,9 @@  discard block
 block discarded – undo
386 386
 			$object->localtax1_value		= GETPOST('lt1', 'alpha');
387 387
 			$object->localtax2_value		= GETPOST('lt2', 'alpha');
388 388
 
389
-			$object->forme_juridique_code	= GETPOSTINT('forme_juridique_code');
389
+			$object->forme_juridique_code = GETPOSTINT('forme_juridique_code');
390 390
 			$object->effectif_id			= GETPOSTINT('effectif_id');
391
-			$object->typent_id				= GETPOSTINT('typent_id');
391
+			$object->typent_id = GETPOSTINT('typent_id');
392 392
 
393 393
 			$object->typent_code			= dol_getIdFromCode($db, $object->typent_id, 'c_typent', 'id', 'code'); // Force typent_code too so check in verify() will be done on new type
394 394
 
@@ -397,8 +397,8 @@  discard block
 block discarded – undo
397 397
 			$prospect = (GETPOSTINT('prospect') > 0 ? 2 : 0);
398 398
 			$prospectcustomer = $customer + $prospect;
399 399
 
400
-			$object->client					= $prospectcustomer;
401
-			$object->fournisseur			= (GETPOSTINT('supplier') > 0 ? 1 : 0);
400
+			$object->client = $prospectcustomer;
401
+			$object->fournisseur = (GETPOSTINT('supplier') > 0 ? 1 : 0);
402 402
 
403 403
 			if ($action == 'add') {
404 404
 				// for prospect, customer or supplier
@@ -418,7 +418,7 @@  discard block
 block discarded – undo
418 418
 					}
419 419
 
420 420
 					if ($object->fournisseur > 0) {
421
-						$object->cond_reglement_supplier_id	= $paymentTermId;
421
+						$object->cond_reglement_supplier_id = $paymentTermId;
422 422
 
423 423
 						$filterPaymentTypeIdArr = array(1, 2, 3); // allow payment type for supplier (filter is "DBIT" in "Form::select_types_paiements()" method)
424 424
 						if (!empty($form->cache_types_paiements[$paymentTypeId]) && isset($form->cache_types_paiements[$paymentTypeId]['type']) && in_array($form->cache_types_paiements[$paymentTypeId]['type'], $filterPaymentTypeIdArr)) {
@@ -428,15 +428,15 @@  discard block
 block discarded – undo
428 428
 				}
429 429
 			}
430 430
 
431
-			$object->commercial_id			= GETPOSTINT('commercial_id');
432
-			$object->default_lang			= GETPOST('default_lang');
431
+			$object->commercial_id = GETPOSTINT('commercial_id');
432
+			$object->default_lang = GETPOST('default_lang');
433 433
 
434 434
 			// Webservices url/key
435 435
 			$object->webservices_url		= GETPOST('webservices_url', 'custom', 0, FILTER_SANITIZE_URL);
436 436
 			$object->webservices_key		= GETPOST('webservices_key', 'san_alpha');
437 437
 
438 438
 			if (GETPOSTISSET('accountancy_code_sell')) {
439
-				$accountancy_code_sell		= GETPOST('accountancy_code_sell', 'alpha');
439
+				$accountancy_code_sell = GETPOST('accountancy_code_sell', 'alpha');
440 440
 
441 441
 				if (empty($accountancy_code_sell) || $accountancy_code_sell == '-1') {
442 442
 					$object->accountancy_code_sell = '';
@@ -445,7 +445,7 @@  discard block
 block discarded – undo
445 445
 				}
446 446
 			}
447 447
 			if (GETPOSTISSET('accountancy_code_buy')) {
448
-				$accountancy_code_buy		= GETPOST('accountancy_code_buy', 'alpha');
448
+				$accountancy_code_buy = GETPOST('accountancy_code_buy', 'alpha');
449 449
 
450 450
 				if (empty($accountancy_code_buy) || $accountancy_code_buy == '-1') {
451 451
 					$object->accountancy_code_buy = '';
@@ -916,7 +916,7 @@  discard block
 block discarded – undo
916 916
 				} else {
917 917
 					$db->commit();
918 918
 					$db->close();
919
-					header("Location: " . $_SERVER["PHP_SELF"] . "?id=" . $id);
919
+					header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id);
920 920
 					exit;
921 921
 				}
922 922
 			} else {
@@ -1097,21 +1097,21 @@  discard block
 block discarded – undo
1097 1097
 		}
1098 1098
 
1099 1099
 		$object->phone				= GETPOST('phone', 'alpha');
1100
-		$object->phone_mobile       = (string) GETPOST("phone_mobile", 'alpha');
1100
+		$object->phone_mobile = (string) GETPOST("phone_mobile", 'alpha');
1101 1101
 		$object->fax				= GETPOST('fax', 'alpha');
1102 1102
 		$object->email				= GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL);
1103 1103
 		$object->url				= GETPOST('url', 'custom', 0, FILTER_SANITIZE_URL);
1104
-		$object->capital			= GETPOSTFLOAT('capital');
1104
+		$object->capital = GETPOSTFLOAT('capital');
1105 1105
 		$paymentTermId = GETPOSTINT('cond_reglement_id'); // can be set by default values on create page and not already in get or post variables
1106 1106
 		if (empty($paymentTermId) && !GETPOSTISSET('cond_reglement_id')) {
1107 1107
 			$paymentTermId = getDolGlobalString('MAIN_DEFAULT_PAYMENT_TERM_ID');
1108 1108
 		}
1109
-		$object->cond_reglement_id	= $paymentTermId;
1109
+		$object->cond_reglement_id = $paymentTermId;
1110 1110
 		$paymentTypeId = GETPOSTINT('mode_reglement_id'); // can be set by default values on create page and not already in get or post variables
1111 1111
 		if (empty($paymentTypeId) && !GETPOSTISSET('mode_reglement_id')) {
1112 1112
 			$paymentTypeId = getDolGlobalString('MAIN_DEFAULT_PAYMENT_TYPE_ID');
1113 1113
 		}
1114
-		$object->mode_reglement_id 	= $paymentTypeId;
1114
+		$object->mode_reglement_id = $paymentTypeId;
1115 1115
 		$object->barcode			= GETPOST('barcode', 'alphanohtml');
1116 1116
 		$object->idprof1			= GETPOST('idprof1', 'alphanohtml');
1117 1117
 		$object->idprof2			= GETPOST('idprof2', 'alphanohtml');
@@ -1124,7 +1124,7 @@  discard block
 block discarded – undo
1124 1124
 		$object->civility_id		= GETPOST('civility_id', 'alpha');
1125 1125
 
1126 1126
 		$object->tva_assuj = GETPOSTINT('assujtva_value');
1127
-		$object->vat_reverse_charge	= GETPOST('vat_reverse_charge') == 'on' ? 1 : 0;
1127
+		$object->vat_reverse_charge = GETPOST('vat_reverse_charge') == 'on' ? 1 : 0;
1128 1128
 		$object->status = GETPOSTINT('status');
1129 1129
 
1130 1130
 		//Local Taxes
@@ -1140,7 +1140,7 @@  discard block
 block discarded – undo
1140 1140
 		$object->default_lang = GETPOST('default_lang');
1141 1141
 
1142 1142
 		if (GETPOSTISSET('accountancy_code_sell')) {
1143
-			$accountancy_code_sell  = GETPOST('accountancy_code_sell', 'alpha');
1143
+			$accountancy_code_sell = GETPOST('accountancy_code_sell', 'alpha');
1144 1144
 
1145 1145
 			if (empty($accountancy_code_sell) || $accountancy_code_sell == '-1') {
1146 1146
 				$object->accountancy_code_sell = '';
@@ -1149,7 +1149,7 @@  discard block
 block discarded – undo
1149 1149
 			}
1150 1150
 		}
1151 1151
 		if (GETPOSTISSET('accountancy_code_buy')) {
1152
-			$accountancy_code_buy   = GETPOST('accountancy_code_buy', 'alpha');
1152
+			$accountancy_code_buy = GETPOST('accountancy_code_buy', 'alpha');
1153 1153
 
1154 1154
 			if (empty($accountancy_code_buy) || $accountancy_code_buy == '-1') {
1155 1155
 				$object->accountancy_code_buy = '';
@@ -1274,7 +1274,7 @@  discard block
 block discarded – undo
1274 1274
 
1275 1275
 			print '<script type="text/javascript">';
1276 1276
 			print '$(document).ready(function () {
1277
-					var canHaveCustomerCategoryIfNotCustomerProspectSupplier = ' . (!getDolGlobalString('THIRDPARTY_CAN_HAVE_CUSTOMER_CATEGORY_EVEN_IF_NOT_CUSTOMER_PROSPECT') ? '0' : '1') . ';
1277
+					var canHaveCustomerCategoryIfNotCustomerProspectSupplier = ' . (!getDolGlobalString('THIRDPARTY_CAN_HAVE_CUSTOMER_CATEGORY_EVEN_IF_NOT_CUSTOMER_PROSPECT') ? '0' : '1').';
1278 1278
 
1279 1279
 					init_customer_categ();
1280 1280
 			  		$("#customerprospect").change(function() {
@@ -1347,7 +1347,7 @@  discard block
 block discarded – undo
1347 1347
 			print '</td><td'.(getDolGlobalString('SOCIETE_USEPREFIX') ? '' : ' colspan="3"').'>';
1348 1348
 
1349 1349
 			print '<input type="text" class="minwidth300" maxlength="128" name="name" id="name" value="'.dol_escape_htmltag($object->name).'" autofocus="autofocus">';
1350
-			print $form->widgetForTranslation("name", $object, $permissiontoadd, 'string', 'alphanohtml', 'minwidth300');	// For some countries that need the company name in 2 languages
1350
+			print $form->widgetForTranslation("name", $object, $permissiontoadd, 'string', 'alphanohtml', 'minwidth300'); // For some countries that need the company name in 2 languages
1351 1351
 			// This implementation of the feature to search already existing company has been disabled. It must be implemented by keeping the "input text" and we must call the search ajax societe/ajax/ajaxcompanies.php
1352 1352
 			// on a keydown of the input. We should show data about a duplicate found if we found less than 5 answers into a div under the input.
1353 1353
 			/*
@@ -1719,7 +1719,7 @@  discard block
 block discarded – undo
1719 1719
 					print '<td></td>';
1720 1720
 					print '<td></td>';
1721 1721
 				}
1722
-				print '<td class="individualline noemail">'.$form->editfieldkey($langs->trans('No_Email') .' ('.$langs->trans('Contact').')', 'contact_no_email', '', $object, 0).'</td>';
1722
+				print '<td class="individualline noemail">'.$form->editfieldkey($langs->trans('No_Email').' ('.$langs->trans('Contact').')', 'contact_no_email', '', $object, 0).'</td>';
1723 1723
 				print '<td class="individualline" '.(($conf->browser->layout == 'phone') || !isModEnabled('mailing') ? ' colspan="3"' : '').'>'.$form->selectyesno('contact_no_email', (GETPOSTISSET("contact_no_email") ? GETPOST("contact_no_email", 'alpha') : (empty($object->no_email) ? 0 : 1)), 1, false, 1).'</td>';
1724 1724
 				print '</tr>';
1725 1725
 			}
@@ -1767,7 +1767,7 @@  discard block
 block discarded – undo
1767 1767
 			// Vat is used
1768 1768
 			print '<tr><td><label for="assujtva_value">'.$form->editfieldkey('VATIsUsed', 'assujtva_value', '', $object, 0).'</label></td>';
1769 1769
 			print '<td>';
1770
-			print '<input id="assujtva_value" name="assujtva_value" type="checkbox" ' . (GETPOSTISSET('assujtva_value') ? (GETPOST('assujtva_value', 'alpha') != '' ? ' checked="checked"' : '') : 'checked="checked"') . ' value="1">'; // Assujeti par default en creation
1770
+			print '<input id="assujtva_value" name="assujtva_value" type="checkbox" '.(GETPOSTISSET('assujtva_value') ? (GETPOST('assujtva_value', 'alpha') != '' ? ' checked="checked"' : '') : 'checked="checked"').' value="1">'; // Assujeti par default en creation
1771 1771
 			print '</td>';
1772 1772
 			if ($conf->browser->layout == 'phone') {
1773 1773
 				print '</tr><tr>';
@@ -1808,7 +1808,7 @@  discard block
 block discarded – undo
1808 1808
 
1809 1809
 			// VAT reverse charge by default
1810 1810
 			if (getDolGlobalString('ACCOUNTING_FORCE_ENABLE_VAT_REVERSE_CHARGE')) {
1811
-				print '<tr><td><label for="vat_reverse_charge">' . $form->editfieldkey('VATReverseChargeByDefault', 'vat_reverse_charge', '', $object, 0) . '</label></td><td colspan="3">';
1811
+				print '<tr><td><label for="vat_reverse_charge">'.$form->editfieldkey('VATReverseChargeByDefault', 'vat_reverse_charge', '', $object, 0).'</label></td><td colspan="3">';
1812 1812
 				print '<input type="checkbox" name="vat_reverse_charge" id="vat_reverse_charge" '.($object->vat_reverse_charge == '1' ? ' checked' : '').'>';
1813 1813
 				print '</td></tr>';
1814 1814
 			}
@@ -1817,21 +1817,21 @@  discard block
 block discarded – undo
1817 1817
 			//TODO: Place into a function to control showing by country or study better option
1818 1818
 			if ($mysoc->localtax1_assuj == "1" && $mysoc->localtax2_assuj == "1") {
1819 1819
 				print '<tr><td>'.$langs->transcountry("LocalTax1IsUsed", $mysoc->country_code).'</td><td>';
1820
-				print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" ' . (isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX1) ? 'checked="checked"' : '') . ' value="1">';
1820
+				print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" '.(isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX1) ? 'checked="checked"' : '').' value="1">';
1821 1821
 				print '</td>';
1822 1822
 				if ($conf->browser->layout == 'phone') {
1823 1823
 					print '</tr><tr>';
1824 1824
 				}
1825 1825
 				print '<td>'.$langs->transcountry("LocalTax2IsUsed", $mysoc->country_code).'</td><td>';
1826
-				print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" ' . (isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX2) ? 'checked="checked"' : '') . ' value="1">';
1826
+				print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" '.(isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX2) ? 'checked="checked"' : '').' value="1">';
1827 1827
 				print '</td></tr>';
1828 1828
 			} elseif ($mysoc->localtax1_assuj == "1") {
1829 1829
 				print '<tr><td>'.$langs->transcountry("LocalTax1IsUsed", $mysoc->country_code).'</td><td colspan="3">';
1830
-				print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" ' . (isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX1) ? 'checked="checked"' : '') . ' value="1">';
1830
+				print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" '.(isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX1) ? 'checked="checked"' : '').' value="1">';
1831 1831
 				print '</td></tr>';
1832 1832
 			} elseif ($mysoc->localtax2_assuj == "1") {
1833 1833
 				print '<tr><td>'.$langs->transcountry("LocalTax2IsUsed", $mysoc->country_code).'</td><td colspan="3">';
1834
-				print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" ' . (isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX2) ? 'checked="checked"' : '') . ' value="1">';
1834
+				print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" '.(isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX2) ? 'checked="checked"' : '').' value="1">';
1835 1835
 				print '</td></tr>';
1836 1836
 			}
1837 1837
 
@@ -2099,10 +2099,10 @@  discard block
 block discarded – undo
2099 2099
 				}
2100 2100
 
2101 2101
 				$object->phone					= GETPOST('phone', 'alpha');
2102
-				$object->phone_mobile			= (string) GETPOST('phone_mobile', 'alpha');
2102
+				$object->phone_mobile = (string) GETPOST('phone_mobile', 'alpha');
2103 2103
 				$object->fax					= GETPOST('fax', 'alpha');
2104 2104
 				$object->email					= GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL);
2105
-				$object->no_email				= GETPOSTINT("no_email");
2105
+				$object->no_email = GETPOSTINT("no_email");
2106 2106
 				$object->url					= GETPOST('url', 'custom', 0, FILTER_SANITIZE_URL);
2107 2107
 				$object->capital				= GETPOSTFLOAT('capital');
2108 2108
 				$object->idprof1				= GETPOST('idprof1', 'alphanohtml');
@@ -2118,16 +2118,16 @@  discard block
 block discarded – undo
2118 2118
 				$object->default_lang = GETPOST('default_lang', 'alpha');
2119 2119
 
2120 2120
 				$object->tva_assuj				= GETPOSTINT('assujtva_value');
2121
-				$object->vat_reverse_charge		= GETPOST('vat_reverse_charge') == 'on' ? 1 : 0;
2121
+				$object->vat_reverse_charge = GETPOST('vat_reverse_charge') == 'on' ? 1 : 0;
2122 2122
 				$object->tva_intra				= GETPOST('tva_intra', 'alphanohtml');
2123
-				$object->status =				GETPOSTINT('status');
2123
+				$object->status = GETPOSTINT('status');
2124 2124
 
2125 2125
 				// Webservices url/key
2126 2126
 				$object->webservices_url        = GETPOST('webservices_url', 'custom', 0, FILTER_SANITIZE_URL);
2127 2127
 				$object->webservices_key        = GETPOST('webservices_key', 'san_alpha');
2128 2128
 
2129 2129
 				if (GETPOSTISSET('accountancy_code_sell')) {
2130
-					$accountancy_code_sell  = GETPOST('accountancy_code_sell', 'alpha');
2130
+					$accountancy_code_sell = GETPOST('accountancy_code_sell', 'alpha');
2131 2131
 
2132 2132
 					if (empty($accountancy_code_sell) || $accountancy_code_sell == '-1') {
2133 2133
 						$object->accountancy_code_sell = '';
@@ -2136,7 +2136,7 @@  discard block
 block discarded – undo
2136 2136
 					}
2137 2137
 				}
2138 2138
 				if (GETPOSTISSET('accountancy_code_buy')) {
2139
-					$accountancy_code_buy   = GETPOST('accountancy_code_buy', 'alpha');
2139
+					$accountancy_code_buy = GETPOST('accountancy_code_buy', 'alpha');
2140 2140
 
2141 2141
 					if (empty($accountancy_code_buy) || $accountancy_code_buy == '-1') {
2142 2142
 						$object->accountancy_code_buy = '';
@@ -2218,7 +2218,7 @@  discard block
 block discarded – undo
2218 2218
     				}
2219 2219
     			});
2220 2220
 
2221
-				var canHaveCustomerCategoryIfNotCustomerProspect = ' . (getDolGlobalInt('THIRDPARTY_CAN_HAVE_CUSTOMER_CATEGORY_EVEN_IF_NOT_CUSTOMER_PROSPECT') ? '1' : '0') . ';
2221
+				var canHaveCustomerCategoryIfNotCustomerProspect = ' . (getDolGlobalInt('THIRDPARTY_CAN_HAVE_CUSTOMER_CATEGORY_EVEN_IF_NOT_CUSTOMER_PROSPECT') ? '1' : '0').';
2222 2222
 
2223 2223
 				init_customer_categ();
2224 2224
 	  			$("#customerprospect").change(function() {
@@ -2597,14 +2597,14 @@  discard block
 block discarded – undo
2597 2597
 
2598 2598
 				// VAT is used
2599 2599
 				print '<tr><td>'.$form->editfieldkey('VATIsUsed', 'assujtva_value', '', $object, 0).'</td><td colspan="3">';
2600
-				print '<input id="assujtva_value" name="assujtva_value" type="checkbox" ' . ($object->tva_assuj ? 'checked="checked"' : '') . ' value="1">';
2600
+				print '<input id="assujtva_value" name="assujtva_value" type="checkbox" '.($object->tva_assuj ? 'checked="checked"' : '').' value="1">';
2601 2601
 				print '</td></tr>';
2602 2602
 
2603 2603
 				// Local Taxes
2604 2604
 				//TODO: Place into a function to control showing by country or study better option
2605 2605
 				if ($mysoc->localtax1_assuj == "1" && $mysoc->localtax2_assuj == "1") {
2606 2606
 					print '<tr><td>'.$form->editfieldkey($langs->transcountry("LocalTax1IsUsed", $mysoc->country_code), 'localtax1assuj_value', '', $object, 0).'</td><td>';
2607
-					print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" ' . ($object->localtax1_assuj ? 'checked="checked"' : '') . ' value="1">';
2607
+					print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" '.($object->localtax1_assuj ? 'checked="checked"' : '').' value="1">';
2608 2608
 					if (!isOnlyOneLocalTax(1)) {
2609 2609
 						print '<span class="cblt1">     '.$langs->transcountry("Type", $mysoc->country_code).': ';
2610 2610
 						$formcompany->select_localtax(1, $object->localtax1_value, "lt1");
@@ -2613,7 +2613,7 @@  discard block
 block discarded – undo
2613 2613
 					print '</td>';
2614 2614
 					print '</tr><tr>';
2615 2615
 					print '<td>'.$form->editfieldkey($langs->transcountry("LocalTax2IsUsed", $mysoc->country_code), 'localtax2assuj_value', '', $object, 0).'</td><td>';
2616
-					print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" ' . ($object->localtax2_assuj ? 'checked="checked"' : '') . ' value="1"></td></tr>';
2616
+					print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" '.($object->localtax2_assuj ? 'checked="checked"' : '').' value="1"></td></tr>';
2617 2617
 					if (!isOnlyOneLocalTax(2)) {
2618 2618
 						print '<span class="cblt2">     '.$langs->transcountry("Type", $mysoc->country_code).': ';
2619 2619
 						$formcompany->select_localtax(2, $object->localtax2_value, "lt2");
@@ -2622,7 +2622,7 @@  discard block
 block discarded – undo
2622 2622
 					print '</td></tr>';
2623 2623
 				} elseif ($mysoc->localtax1_assuj == "1" && $mysoc->localtax2_assuj != "1") {
2624 2624
 					print '<tr><td>'.$form->editfieldkey($langs->transcountry("LocalTax1IsUsed", $mysoc->country_code), 'localtax1assuj_value', '', $object, 0).'</td><td colspan="3">';
2625
-					print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" ' . ($object->localtax1_assuj ? 'checked="checked"' : '') . ' value="1">';
2625
+					print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" '.($object->localtax1_assuj ? 'checked="checked"' : '').' value="1">';
2626 2626
 					if (!isOnlyOneLocalTax(1)) {
2627 2627
 						print '<span class="cblt1">     '.$langs->transcountry("Type", $mysoc->country_code).': ';
2628 2628
 						$formcompany->select_localtax(1, $object->localtax1_value, "lt1");
@@ -2631,7 +2631,7 @@  discard block
 block discarded – undo
2631 2631
 					print '</td></tr>';
2632 2632
 				} elseif ($mysoc->localtax2_assuj == "1" && $mysoc->localtax1_assuj != "1") {
2633 2633
 					print '<tr><td>'.$form->editfieldkey($langs->transcountry("LocalTax2IsUsed", $mysoc->country_code), 'localtax2assuj_value', '', $object, 0).'</td><td colspan="3">';
2634
-					print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" ' . ($object->localtax2_assuj ? 'checked="checked"' : '') . ' value="1">';
2634
+					print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" '.($object->localtax2_assuj ? 'checked="checked"' : '').' value="1">';
2635 2635
 					if (!isOnlyOneLocalTax(2)) {
2636 2636
 						print '<span class="cblt2">     '.$langs->transcountry("Type", $mysoc->country_code).': ';
2637 2637
 						$formcompany->select_localtax(2, $object->localtax2_value, "lt2");
@@ -2642,7 +2642,7 @@  discard block
 block discarded – undo
2642 2642
 
2643 2643
 				// VAT reverse charge by default
2644 2644
 				if (getDolGlobalString('ACCOUNTING_FORCE_ENABLE_VAT_REVERSE_CHARGE')) {
2645
-					print '<tr><td>' . $form->editfieldkey('VATReverseChargeByDefault', 'vat_reverse_charge', '', $object, 0) . '</td><td colspan="3">';
2645
+					print '<tr><td>'.$form->editfieldkey('VATReverseChargeByDefault', 'vat_reverse_charge', '', $object, 0).'</td><td colspan="3">';
2646 2646
 					print '<input type="checkbox" name="vat_reverse_charge" '.($object->vat_reverse_charge == '1' ? ' checked' : '').'>';
2647 2647
 					print '</td></tr>';
2648 2648
 				}
@@ -2811,7 +2811,7 @@  discard block
 block discarded – undo
2811 2811
 					$maxfilesizearray = getMaxFileSizeArray();
2812 2812
 					$maxmin = $maxfilesizearray['maxmin'];
2813 2813
 					if ($maxmin > 0) {
2814
-						print '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">';	// MAX_FILE_SIZE must precede the field type=file
2814
+						print '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file
2815 2815
 					}
2816 2816
 					print '<input type="file" class="flat" name="photo" id="photoinput">';
2817 2817
 					print '</td></tr>';
@@ -3043,7 +3043,7 @@  discard block
 block discarded – undo
3043 3043
 					print '<tr><td>';
3044 3044
 					print $form->textwithpicto($langs->trans('VATReverseChargeByDefault'), $langs->trans('VATReverseChargeByDefaultDesc'));
3045 3045
 					print '</td><td>';
3046
-					print '<input type="checkbox" name="vat_reverse_charge" ' . ($object->vat_reverse_charge == '1' ? ' checked' : '') . ' disabled>';
3046
+					print '<input type="checkbox" name="vat_reverse_charge" '.($object->vat_reverse_charge == '1' ? ' checked' : '').' disabled>';
3047 3047
 					print '</td>';
3048 3048
 					print '</tr>';
3049 3049
 				}
Please login to merge, or discard this patch.
htdocs/core/class/commonobject.class.php 1 patch
Spacing   +131 added lines, -131 removed lines patch added patch discarded remove patch
@@ -477,11 +477,11 @@  discard block
 block discarded – undo
477 477
 	 *
478 478
 	 * Note: cond_reglement can not be aliased to cond_reglement!!!
479 479
 	 */
480
-	private $cond_reglement;  // Private to call DolDeprecationHandler
480
+	private $cond_reglement; // Private to call DolDeprecationHandler
481 481
 	/**
482 482
 	 * @var int|string Internal to detect deprecated access
483 483
 	 */
484
-	protected $depr_cond_reglement;  // Internal value for deprecation
484
+	protected $depr_cond_reglement; // Internal value for deprecation
485 485
 
486 486
 	/**
487 487
 	 * @var int 		Delivery address ID
@@ -538,12 +538,12 @@  discard block
 block discarded – undo
538 538
 	/**
539 539
 	 * @var float|string Multicurrency total localtax1
540 540
 	 */
541
-	public $multicurrency_total_localtax1;	// not in database
541
+	public $multicurrency_total_localtax1; // not in database
542 542
 
543 543
 	/**
544 544
 	 * @var float|string Multicurrency total localtax2
545 545
 	 */
546
-	public $multicurrency_total_localtax2;	// not in database
546
+	public $multicurrency_total_localtax2; // not in database
547 547
 
548 548
 	/**
549 549
 	 * @var ?string
@@ -1028,17 +1028,17 @@  discard block
 block discarded – undo
1028 1028
 				}
1029 1029
 				$labelextra = $langs->trans((string) $extrafields->attributes[$this->table_element]['label'][$key]);
1030 1030
 				if ($extrafields->attributes[$this->table_element]['type'][$key] == 'separate') {
1031
-					$data[$key] = '<br><b><u>'. $labelextra . '</u></b>';
1031
+					$data[$key] = '<br><b><u>'.$labelextra.'</u></b>';
1032 1032
 				} else {
1033
-					$value = (empty($this->array_options['options_' . $key]) ? '' : $this->array_options['options_' . $key]);
1034
-					$data[$key] = '<br><b>'. $labelextra . ':</b> ' . $extrafields->showOutputField($key, $value, '', $this->table_element);
1033
+					$value = (empty($this->array_options['options_'.$key]) ? '' : $this->array_options['options_'.$key]);
1034
+					$data[$key] = '<br><b>'.$labelextra.':</b> '.$extrafields->showOutputField($key, $value, '', $this->table_element);
1035 1035
 					$count++;
1036 1036
 				}
1037 1037
 			}
1038 1038
 			$data['closedivextra'] = '</div>';
1039 1039
 		}
1040 1040
 
1041
-		$hookmanager->initHooks(array($this->element . 'dao'));
1041
+		$hookmanager->initHooks(array($this->element.'dao'));
1042 1042
 		$parameters = array(
1043 1043
 			'tooltipcontentarray' => &$data,
1044 1044
 			'params' => $params,
@@ -1538,7 +1538,7 @@  discard block
 block discarded – undo
1538 1538
 			$sql .= " AND ec.fk_c_type_contact IN (".$this->db->sanitize(implode(',', $arrayoftcids)).")";
1539 1539
 		}
1540 1540
 		if ($status >= 0) {
1541
-			$sql .= " AND t.statut = ".((int) $status);	// t is llx_user or llx_socpeople
1541
+			$sql .= " AND t.statut = ".((int) $status); // t is llx_user or llx_socpeople
1542 1542
 		}
1543 1543
 		if ($statusoflink >= 0) {
1544 1544
 			$sql .= " AND ec.statut = ".((int) $statusoflink);
@@ -1922,7 +1922,7 @@  discard block
 block discarded – undo
1922 1922
 		}
1923 1923
 
1924 1924
 		$sql = "SELECT rowid FROM ".$this->db->prefix().$this->table_element;
1925
-		$sql .= " WHERE ".$this->table_ref_field." LIKE '".$this->db->escape($ref)."'";	// no escapeforlike here
1925
+		$sql .= " WHERE ".$this->table_ref_field." LIKE '".$this->db->escape($ref)."'"; // no escapeforlike here
1926 1926
 		$sql .= " LIMIT 1";
1927 1927
 
1928 1928
 		$query = $this->db->query($sql);
@@ -2241,9 +2241,9 @@  discard block
 block discarded – undo
2241 2241
 
2242 2242
 		$oldvalue = null;
2243 2243
 		if ($trigkey) {
2244
-			$sql = "SELECT " . $field;
2245
-			$sql .= " FROM " . MAIN_DB_PREFIX . $table;
2246
-			$sql .= " WHERE " . $id_field . " = " . ((int) $id);
2244
+			$sql = "SELECT ".$field;
2245
+			$sql .= " FROM ".MAIN_DB_PREFIX.$table;
2246
+			$sql .= " WHERE ".$id_field." = ".((int) $id);
2247 2247
 
2248 2248
 			$resql = $this->db->query($sql);
2249 2249
 			if ($resql) {
@@ -2623,7 +2623,7 @@  discard block
 block discarded – undo
2623 2623
 		// Triggers
2624 2624
 		if (!$error && !$notrigger) {
2625 2625
 			// Call triggers
2626
-			$result = $this->call_trigger(strtoupper($this->element) . '_MODIFY', $user);
2626
+			$result = $this->call_trigger(strtoupper($this->element).'_MODIFY', $user);
2627 2627
 			if ($result < 0) {
2628 2628
 				$error++;
2629 2629
 			} //Do also here what you must do to rollback action if trigger fail
@@ -3001,7 +3001,7 @@  discard block
 block discarded – undo
3001 3001
 			$sql = 'UPDATE '.$this->db->prefix().$this->table_element;
3002 3002
 			$sql .= " SET ".$fieldname." = ".(($id > 0 || $id == '0') ? ((int) $id) : 'NULL');
3003 3003
 			if (in_array($this->table_element, array('propal', 'commande', 'societe'))) {
3004
-				$sql .= " , deposit_percent = " . (empty($deposit_percent) ? 'NULL' : "'".$this->db->escape($deposit_percent)."'");
3004
+				$sql .= " , deposit_percent = ".(empty($deposit_percent) ? 'NULL' : "'".$this->db->escape($deposit_percent)."'");
3005 3005
 			}
3006 3006
 			$sql .= ' WHERE rowid='.((int) $this->id);
3007 3007
 
@@ -3349,10 +3349,10 @@  discard block
 block discarded – undo
3349 3349
 		$sql = "SELECT count(rowid) FROM ".$this->db->prefix().$this->table_element_line;
3350 3350
 		$sql .= " WHERE ".$this->fk_element." = ".((int) $this->id);
3351 3351
 		if (!$renum) {
3352
-			$sql .= " AND " . $fieldposition . " = 0";
3352
+			$sql .= " AND ".$fieldposition." = 0";
3353 3353
 		}
3354 3354
 		if ($renum) {
3355
-			$sql .= " AND " . $fieldposition . " <> 0";
3355
+			$sql .= " AND ".$fieldposition." <> 0";
3356 3356
 		}
3357 3357
 
3358 3358
 		dol_syslog(get_class($this)."::line_order", LOG_DEBUG);
@@ -3373,7 +3373,7 @@  discard block
 block discarded – undo
3373 3373
 			if ($fk_parent_line) {
3374 3374
 				$sql .= ' AND fk_parent_line IS NULL';
3375 3375
 			}
3376
-			$sql .= " ORDER BY " . $fieldposition . " ASC, rowid " . $rowidorder;
3376
+			$sql .= " ORDER BY ".$fieldposition." ASC, rowid ".$rowidorder;
3377 3377
 
3378 3378
 			dol_syslog(get_class($this)."::line_order search all parent lines", LOG_DEBUG);
3379 3379
 			$resql = $this->db->query($sql);
@@ -3425,7 +3425,7 @@  discard block
 block discarded – undo
3425 3425
 		$sql = "SELECT rowid FROM ".$this->db->prefix().$this->table_element_line;
3426 3426
 		$sql .= " WHERE ".$this->fk_element." = ".((int) $this->id);
3427 3427
 		$sql .= ' AND fk_parent_line = '.((int) $id);
3428
-		$sql .= " ORDER BY " . $fieldposition . " ASC";
3428
+		$sql .= " ORDER BY ".$fieldposition." ASC";
3429 3429
 
3430 3430
 		dol_syslog(get_class($this)."::getChildrenOfLine search children lines for line ".$id, LOG_DEBUG);
3431 3431
 
@@ -3549,7 +3549,7 @@  discard block
 block discarded – undo
3549 3549
 
3550 3550
 			$sql = "UPDATE ".$this->db->prefix().$this->table_element_line." SET ".$fieldposition." = ".((int) $rang);
3551 3551
 			$sql .= " WHERE ".$this->fk_element." = ".((int) $this->id);
3552
-			$sql .= " AND " . $fieldposition . " = " . ((int) ($rang - 1));
3552
+			$sql .= " AND ".$fieldposition." = ".((int) ($rang - 1));
3553 3553
 			if ($this->db->query($sql)) {
3554 3554
 				$sql = "UPDATE ".$this->db->prefix().$this->table_element_line." SET ".$fieldposition." = ".((int) ($rang - 1));
3555 3555
 				$sql .= ' WHERE rowid = '.((int) $rowid);
@@ -3580,7 +3580,7 @@  discard block
 block discarded – undo
3580 3580
 
3581 3581
 			$sql = "UPDATE ".$this->db->prefix().$this->table_element_line." SET ".$fieldposition." = ".((int) $rang);
3582 3582
 			$sql .= " WHERE ".$this->fk_element." = ".((int) $this->id);
3583
-			$sql .= " AND " . $fieldposition . " = " . ((int) ($rang + 1));
3583
+			$sql .= " AND ".$fieldposition." = ".((int) ($rang + 1));
3584 3584
 			if ($this->db->query($sql)) {
3585 3585
 				$sql = "UPDATE ".$this->db->prefix().$this->table_element_line." SET ".$fieldposition." = ".((int) ($rang + 1));
3586 3586
 				$sql .= ' WHERE rowid = '.((int) $rowid);
@@ -3606,7 +3606,7 @@  discard block
 block discarded – undo
3606 3606
 			$fieldposition = 'position';
3607 3607
 		}
3608 3608
 
3609
-		$sql = "SELECT " . $fieldposition . " FROM ".$this->db->prefix().$this->table_element_line;
3609
+		$sql = "SELECT ".$fieldposition." FROM ".$this->db->prefix().$this->table_element_line;
3610 3610
 		$sql .= " WHERE rowid = ".((int) $rowid);
3611 3611
 
3612 3612
 		dol_syslog(get_class($this)."::getRangOfLine", LOG_DEBUG);
@@ -3634,7 +3634,7 @@  discard block
 block discarded – undo
3634 3634
 
3635 3635
 		$sql = "SELECT rowid FROM ".$this->db->prefix().$this->table_element_line;
3636 3636
 		$sql .= " WHERE ".$this->fk_element." = ".((int) $this->id);
3637
-		$sql .= " AND " . $fieldposition . " = ".((int) $rang);
3637
+		$sql .= " AND ".$fieldposition." = ".((int) $rang);
3638 3638
 		$resql = $this->db->query($sql);
3639 3639
 		if ($resql) {
3640 3640
 			$row = $this->db->fetch_row($resql);
@@ -3753,7 +3753,7 @@  discard block
 block discarded – undo
3753 3753
 			$newsuffix = '';
3754 3754
 		}
3755 3755
 		if (in_array($this->table_element, array('actioncomm', 'adherent', 'advtargetemailing', 'cronjob', 'establishment'))) {
3756
-			$fieldusermod =  "fk_user_mod";
3756
+			$fieldusermod = "fk_user_mod";
3757 3757
 		} elseif ($this->table_element == 'ecm_files') {
3758 3758
 			$fieldusermod = "fk_user_m";
3759 3759
 		} else {
@@ -3795,7 +3795,7 @@  discard block
 block discarded – undo
3795 3795
 						$trigger_name = 'EXPENSE_REPORT_MODIFY';
3796 3796
 						break;
3797 3797
 					default:
3798
-						$trigger_name = strtoupper($this->element) . '_MODIFY';
3798
+						$trigger_name = strtoupper($this->element).'_MODIFY';
3799 3799
 				}
3800 3800
 				$ret = $this->call_trigger($trigger_name, $user);
3801 3801
 				if ($ret < 0) {
@@ -4093,7 +4093,7 @@  discard block
 block discarded – undo
4093 4093
 			// Situations totals
4094 4094
 			if (!empty($this->situation_cycle_ref) && !empty($this->situation_counter) && $this->situation_counter > 1 && method_exists($this, 'get_prev_sits')) {  // @phan-suppress-current-line PhanUndeclaredProperty
4095 4095
 				'@phan-var-force Facture $this';
4096
-				include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';  // Note: possibly useless as $this is normally already Facture, so the class file should be loaded
4096
+				include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; // Note: possibly useless as $this is normally already Facture, so the class file should be loaded
4097 4097
 				if ($this->type != Facture::TYPE_CREDIT_NOTE) {	// @phpstan-ignore-line
4098 4098
 					if (getDolGlobalInt('INVOICE_USE_SITUATION') != 2) {
4099 4099
 						$prev_sits = $this->get_prev_sits();
@@ -4219,19 +4219,19 @@  discard block
 block discarded – undo
4219 4219
 		$this->db->begin();
4220 4220
 		$error = 0;
4221 4221
 
4222
-		$sql = "INSERT INTO " . $this->db->prefix() . "element_element (";
4222
+		$sql = "INSERT INTO ".$this->db->prefix()."element_element (";
4223 4223
 		$sql .= "fk_source";
4224 4224
 		$sql .= ", sourcetype";
4225 4225
 		$sql .= ", fk_target";
4226 4226
 		$sql .= ", targettype";
4227 4227
 		$sql .= ") VALUES (";
4228 4228
 		$sql .= ((int) $origin_id);
4229
-		$sql .= ", '" . $this->db->escape($origin) . "'";
4230
-		$sql .= ", " . ((int) $this->id);
4231
-		$sql .= ", '" . $this->db->escape($targettype) . "'";
4229
+		$sql .= ", '".$this->db->escape($origin)."'";
4230
+		$sql .= ", ".((int) $this->id);
4231
+		$sql .= ", '".$this->db->escape($targettype)."'";
4232 4232
 		$sql .= ")";
4233 4233
 
4234
-		dol_syslog(get_class($this) . "::add_object_linked", LOG_DEBUG);
4234
+		dol_syslog(get_class($this)."::add_object_linked", LOG_DEBUG);
4235 4235
 		if ($this->db->query($sql)) {
4236 4236
 			if (!$notrigger) {
4237 4237
 				// Call trigger
@@ -4484,20 +4484,20 @@  discard block
 block discarded – undo
4484 4484
 		$this->db->begin();
4485 4485
 		$error = 0;
4486 4486
 
4487
-		$sql = "UPDATE " . $this->db->prefix() . "element_element SET ";
4487
+		$sql = "UPDATE ".$this->db->prefix()."element_element SET ";
4488 4488
 		if ($updatesource) {
4489
-			$sql .= "fk_source = " . ((int) $sourceid);
4490
-			$sql .= ", sourcetype = '" . $this->db->escape($sourcetype) . "'";
4491
-			$sql .= " WHERE fk_target = " . ((int) $this->id);
4492
-			$sql .= " AND targettype = '" . $this->db->escape($this->element) . "'";
4489
+			$sql .= "fk_source = ".((int) $sourceid);
4490
+			$sql .= ", sourcetype = '".$this->db->escape($sourcetype)."'";
4491
+			$sql .= " WHERE fk_target = ".((int) $this->id);
4492
+			$sql .= " AND targettype = '".$this->db->escape($this->element)."'";
4493 4493
 		} elseif ($updatetarget) {
4494
-			$sql .= "fk_target = " . ((int) $targetid);
4495
-			$sql .= ", targettype = '" . $this->db->escape($targettype) . "'";
4496
-			$sql .= " WHERE fk_source = " . ((int) $this->id);
4497
-			$sql .= " AND sourcetype = '" . $this->db->escape($this->element) . "'";
4494
+			$sql .= "fk_target = ".((int) $targetid);
4495
+			$sql .= ", targettype = '".$this->db->escape($targettype)."'";
4496
+			$sql .= " WHERE fk_source = ".((int) $this->id);
4497
+			$sql .= " AND sourcetype = '".$this->db->escape($this->element)."'";
4498 4498
 		}
4499 4499
 
4500
-		dol_syslog(get_class($this) . "::updateObjectLinked", LOG_DEBUG);
4500
+		dol_syslog(get_class($this)."::updateObjectLinked", LOG_DEBUG);
4501 4501
 		if ($this->db->query($sql)) {
4502 4502
 			if (!$notrigger) {
4503 4503
 				// Call trigger
@@ -4573,25 +4573,25 @@  discard block
 block discarded – undo
4573 4573
 		}
4574 4574
 
4575 4575
 		if (!$error) {
4576
-			$sql = "DELETE FROM " . $this->db->prefix() . "element_element";
4576
+			$sql = "DELETE FROM ".$this->db->prefix()."element_element";
4577 4577
 			$sql .= " WHERE";
4578 4578
 			if ($rowid > 0) {
4579
-				$sql .= " rowid = " . ((int) $rowid);
4579
+				$sql .= " rowid = ".((int) $rowid);
4580 4580
 			} else {
4581 4581
 				if ($deletesource) {
4582
-					$sql .= " fk_source = " . ((int) $sourceid) . " AND sourcetype = '" . $this->db->escape($sourcetype) . "'";
4583
-					$sql .= " AND fk_target = " . ((int) $this->id) . " AND targettype = '" . $this->db->escape($this->element) . "'";
4582
+					$sql .= " fk_source = ".((int) $sourceid)." AND sourcetype = '".$this->db->escape($sourcetype)."'";
4583
+					$sql .= " AND fk_target = ".((int) $this->id)." AND targettype = '".$this->db->escape($this->element)."'";
4584 4584
 				} elseif ($deletetarget) {
4585
-					$sql .= " fk_target = " . ((int) $targetid) . " AND targettype = '" . $this->db->escape($targettype) . "'";
4586
-					$sql .= " AND fk_source = " . ((int) $this->id) . " AND sourcetype = '" . $this->db->escape($this->element) . "'";
4585
+					$sql .= " fk_target = ".((int) $targetid)." AND targettype = '".$this->db->escape($targettype)."'";
4586
+					$sql .= " AND fk_source = ".((int) $this->id)." AND sourcetype = '".$this->db->escape($this->element)."'";
4587 4587
 				} else {
4588
-					$sql .= " (fk_source = " . ((int) $this->id) . " AND sourcetype = '" . $this->db->escape($this->element) . "')";
4588
+					$sql .= " (fk_source = ".((int) $this->id)." AND sourcetype = '".$this->db->escape($this->element)."')";
4589 4589
 					$sql .= " OR";
4590
-					$sql .= " (fk_target = " . ((int) $this->id) . " AND targettype = '" . $this->db->escape($this->element) . "')";
4590
+					$sql .= " (fk_target = ".((int) $this->id)." AND targettype = '".$this->db->escape($this->element)."')";
4591 4591
 				}
4592 4592
 			}
4593 4593
 
4594
-			dol_syslog(get_class($this) . "::deleteObjectLinked", LOG_DEBUG);
4594
+			dol_syslog(get_class($this)."::deleteObjectLinked", LOG_DEBUG);
4595 4595
 			if (!$this->db->query($sql)) {
4596 4596
 				$this->error = $this->db->lasterror();
4597 4597
 				$this->errors[] = $this->error;
@@ -4756,14 +4756,14 @@  discard block
 block discarded – undo
4756 4756
 			$sql .= ", date_validation = '".$this->db->idate(dol_now())."'";
4757 4757
 		}
4758 4758
 		$sql .= " WHERE rowid = ".((int) $elementId);
4759
-		$sql .= " AND ".$fieldstatus." <> ".((int) $status);	// We avoid update if status already correct
4759
+		$sql .= " AND ".$fieldstatus." <> ".((int) $status); // We avoid update if status already correct
4760 4760
 
4761 4761
 		dol_syslog(get_class($this)."::setStatut", LOG_DEBUG);
4762 4762
 		$resql = $this->db->query($sql);
4763 4763
 		if ($resql) {
4764 4764
 			$error = 0;
4765 4765
 
4766
-			$nb_rows_affected = $this->db->affected_rows($resql);	// should be 1 or 0 if status was already correct
4766
+			$nb_rows_affected = $this->db->affected_rows($resql); // should be 1 or 0 if status was already correct
4767 4767
 
4768 4768
 			if ($nb_rows_affected > 0) {
4769 4769
 				if (empty($trigkey)) {
@@ -4810,7 +4810,7 @@  discard block
 block discarded – undo
4810 4810
 					if ($fieldstatus == 'tosell') {
4811 4811
 						$this->status = $status;
4812 4812
 					} elseif ($fieldstatus == 'tobuy') {
4813
-						$this->status_buy = $status;	// @phpstan-ignore-line
4813
+						$this->status_buy = $status; // @phpstan-ignore-line
4814 4814
 					} else {
4815 4815
 						$this->status = $status;
4816 4816
 					}
@@ -4918,7 +4918,7 @@  discard block
 block discarded – undo
4918 4918
 			return -1;
4919 4919
 		}
4920 4920
 
4921
-		$arraytoscan = $this->childtables;		// array('tablename'=>array('fk_element'=>'parentfield'), ...) or array('tablename'=>array('parent'=>table_parent, 'parentkey'=>'nameoffieldforparentfkkey'), ...)
4921
+		$arraytoscan = $this->childtables; // array('tablename'=>array('fk_element'=>'parentfield'), ...) or array('tablename'=>array('parent'=>table_parent, 'parentkey'=>'nameoffieldforparentfkkey'), ...)
4922 4922
 		// For backward compatibility, we check if array is old format array('tablename1', 'tablename2', ...)
4923 4923
 		$tmparray = array_keys($this->childtables);
4924 4924
 		if (is_numeric($tmparray[0])) {
@@ -6021,7 +6021,7 @@  discard block
 block discarded – undo
6021 6021
 			$setsharekey = false;
6022 6022
 			if ($this->element == 'propal' || $this->element == 'proposal') {
6023 6023
 				if (getDolGlobalInt("PROPOSAL_ALLOW_ONLINESIGN")) {
6024
-					$setsharekey = true;	// feature to make online signature is not set or set to on (default)
6024
+					$setsharekey = true; // feature to make online signature is not set or set to on (default)
6025 6025
 				}
6026 6026
 				if (getDolGlobalInt("PROPOSAL_ALLOW_EXTERNAL_DOWNLOAD")) {
6027 6027
 					$setsharekey = true;
@@ -6081,7 +6081,7 @@  discard block
 block discarded – undo
6081 6081
 				$ecmfile->gen_or_uploaded = 'generated';
6082 6082
 				$ecmfile->description = ''; // indexed content
6083 6083
 				$ecmfile->keywords = ''; // keyword content
6084
-				$ecmfile->src_object_type = $this->table_element;	// $this->table_name is 'myobject' or 'mymodule_myobject'.
6084
+				$ecmfile->src_object_type = $this->table_element; // $this->table_name is 'myobject' or 'mymodule_myobject'.
6085 6085
 				$ecmfile->src_object_id   = $this->id;
6086 6086
 
6087 6087
 				$result = $ecmfile->create($user);
@@ -6233,8 +6233,8 @@  discard block
 block discarded – undo
6233 6233
 		// phpcs:enable
6234 6234
 		global $langs, $conf;
6235 6235
 
6236
-		if (!empty(self::TRIGGER_PREFIX) && strpos($triggerName, self::TRIGGER_PREFIX . '_') !== 0) {
6237
-			dol_print_error(null, 'The trigger "' . $triggerName . '" does not start with "' . self::TRIGGER_PREFIX . '_" as required.');
6236
+		if (!empty(self::TRIGGER_PREFIX) && strpos($triggerName, self::TRIGGER_PREFIX.'_') !== 0) {
6237
+			dol_print_error(null, 'The trigger "'.$triggerName.'" does not start with "'.self::TRIGGER_PREFIX.'_" as required.');
6238 6238
 			exit;
6239 6239
 		}
6240 6240
 		if (!is_object($langs)) {	// If lang was not defined, we set it. It is required by run_triggers().
@@ -6426,7 +6426,7 @@  discard block
 block discarded – undo
6426 6426
 		$savDisableCompute = $conf->disable_compute;
6427 6427
 		$conf->disable_compute = 1;
6428 6428
 
6429
-		$ret = $this->fetch($id);	/* @phpstan-ignore-line */
6429
+		$ret = $this->fetch($id); /* @phpstan-ignore-line */
6430 6430
 
6431 6431
 		$conf->disable_compute = $savDisableCompute;
6432 6432
 
@@ -6488,7 +6488,7 @@  discard block
 block discarded – undo
6488 6488
 		if (is_array($optionsArray) && count($optionsArray) > 0) {
6489 6489
 			$sql = "SELECT rowid";
6490 6490
 			foreach ($optionsArray as $name => $label) {
6491
-				if (empty($extrafields->attributes[$this->table_element]['type'][$name]) || (!in_array($extrafields->attributes[$this->table_element]['type'][$name], ['separate', 'point', 'multipts', 'linestrg','polygon']))) {
6491
+				if (empty($extrafields->attributes[$this->table_element]['type'][$name]) || (!in_array($extrafields->attributes[$this->table_element]['type'][$name], ['separate', 'point', 'multipts', 'linestrg', 'polygon']))) {
6492 6492
 					$sql .= ", ".$name;
6493 6493
 				}
6494 6494
 				// use geo sql fonction to read as text
@@ -6541,7 +6541,7 @@  discard block
 block discarded – undo
6541 6541
 					 **/
6542 6542
 					if (is_array($extrafields->attributes[$this->table_element]['label'])) {
6543 6543
 						foreach ($extrafields->attributes[$this->table_element]['label'] as $key => $val) {
6544
-							$this->array_options['options_' . $key] = null;
6544
+							$this->array_options['options_'.$key] = null;
6545 6545
 						}
6546 6546
 					}
6547 6547
 				}
@@ -6553,9 +6553,9 @@  discard block
 block discarded – undo
6553 6553
 						if (!empty($extrafields->attributes[$this->table_element]) && !empty($extrafields->attributes[$this->table_element]['computed'][$key])) {
6554 6554
 							//var_dump($conf->disable_compute);
6555 6555
 							if (empty($conf->disable_compute)) {
6556
-								global $objectoffield;        // We set a global variable to $objectoffield so
6557
-								$objectoffield = $this;        // we can use it inside computed formula
6558
-								$this->array_options['options_' . $key] = dol_eval($extrafields->attributes[$this->table_element]['computed'][$key], 1, 0, '2');
6556
+								global $objectoffield; // We set a global variable to $objectoffield so
6557
+								$objectoffield = $this; // we can use it inside computed formula
6558
+								$this->array_options['options_'.$key] = dol_eval($extrafields->attributes[$this->table_element]['computed'][$key], 1, 0, '2');
6559 6559
 							}
6560 6560
 						}
6561 6561
 					}
@@ -6740,7 +6740,7 @@  discard block
 block discarded – undo
6740 6740
 										// If old value encrypted in database is same than submitted new value, it means we don't change it, so we don't update.
6741 6741
 										if ($algo == 'dolcrypt') {	// dolibarr reversible encryption
6742 6742
 											if (!preg_match('/^dolcrypt:/', $this->array_options[$key])) {
6743
-												$new_array_options[$key] = dolEncrypt($this->array_options[$key]);	// warning, must be called when on the master
6743
+												$new_array_options[$key] = dolEncrypt($this->array_options[$key]); // warning, must be called when on the master
6744 6744
 											} else {
6745 6745
 												$new_array_options[$key] = $this->array_options[$key]; // Value is kept
6746 6746
 											}
@@ -6751,7 +6751,7 @@  discard block
 block discarded – undo
6751 6751
 										// If value has changed
6752 6752
 										if ($algo == 'dolcrypt') {	// dolibarr reversible encryption
6753 6753
 											if (!preg_match('/^dolcrypt:/', $this->array_options[$key])) {
6754
-												$new_array_options[$key] = dolEncrypt($this->array_options[$key]);	// warning, must be called when on the master
6754
+												$new_array_options[$key] = dolEncrypt($this->array_options[$key]); // warning, must be called when on the master
6755 6755
 											} else {
6756 6756
 												$new_array_options[$key] = $this->array_options[$key]; // Value is kept
6757 6757
 											}
@@ -6763,7 +6763,7 @@  discard block
 block discarded – undo
6763 6763
 									//var_dump('jjj'.$algo.' '.$this->oldcopy->array_options[$key].' -> '.$this->array_options[$key]);
6764 6764
 									// If this->oldcopy is not defined, we can't know if we change attribute or not, so we must keep value
6765 6765
 									if ($algo == 'dolcrypt' && !preg_match('/^dolcrypt:/', $this->array_options[$key])) {	// dolibarr reversible encryption
6766
-										$new_array_options[$key] = dolEncrypt($this->array_options[$key]);	// warning, must be called when on the master
6766
+										$new_array_options[$key] = dolEncrypt($this->array_options[$key]); // warning, must be called when on the master
6767 6767
 									} else {
6768 6768
 										$new_array_options[$key] = $this->array_options[$key]; // Value is kept
6769 6769
 									}
@@ -7213,7 +7213,7 @@  discard block
 block discarded – undo
7213 7213
 								if (isset($this->oldcopy->array_options["options_".$key]) && $this->array_options["options_".$key] == $this->oldcopy->array_options["options_".$key]) {	// If old value encrypted in database is same than submitted new value, it means we don't change it, so we don't update.
7214 7214
 									if ($algo == 'dolcrypt') {	// dolibarr reversible encryption
7215 7215
 										if (!preg_match('/^dolcrypt:/', $this->array_options["options_".$key])) {
7216
-											$new_array_options["options_".$key] = dolEncrypt($this->array_options["options_".$key]);	// warning, must be called when on the master
7216
+											$new_array_options["options_".$key] = dolEncrypt($this->array_options["options_".$key]); // warning, must be called when on the master
7217 7217
 										} else {
7218 7218
 											$new_array_options["options_".$key] = $this->array_options["options_".$key]; // Value is kept
7219 7219
 										}
@@ -7233,7 +7233,7 @@  discard block
 block discarded – undo
7233 7233
 								}
7234 7234
 							} else {
7235 7235
 								if ($algo == 'dolcrypt' && !preg_match('/^dolcrypt:/', $this->array_options["options_".$key])) {	// dolibarr reversible encryption
7236
-									$new_array_options["options_".$key] = dolEncrypt($this->array_options["options_".$key]);	// warning, must be called when on the master
7236
+									$new_array_options["options_".$key] = dolEncrypt($this->array_options["options_".$key]); // warning, must be called when on the master
7237 7237
 								} else {
7238 7238
 									$new_array_options["options_".$key] = $this->array_options["options_".$key]; // Value is kept
7239 7239
 								}
@@ -7820,7 +7820,7 @@  discard block
 block discarded – undo
7820 7820
 				// 7 : sort field
7821 7821
 
7822 7822
 				// If there is filter
7823
-				if (! empty($InfoFieldList[4])) {
7823
+				if (!empty($InfoFieldList[4])) {
7824 7824
 					$pos = 0;
7825 7825
 					$parenthesisopen = 0;
7826 7826
 					while (substr($InfoFieldList[4], $pos, 1) !== '' && ($parenthesisopen || $pos == 0 || substr($InfoFieldList[4], $pos, 1) != ':')) {
@@ -7884,8 +7884,8 @@  discard block
 block discarded – undo
7884 7884
 					}
7885 7885
 
7886 7886
 					$sqlwhere = '';
7887
-					$sql = "SELECT " . $keyList;
7888
-					$sql .= " FROM " . $this->db->prefix() . $InfoFieldList[0];
7887
+					$sql = "SELECT ".$keyList;
7888
+					$sql .= " FROM ".$this->db->prefix().$InfoFieldList[0];
7889 7889
 
7890 7890
 					if (!empty($InfoFieldList[4])) {
7891 7891
 						// can use SELECT request
@@ -7903,11 +7903,11 @@  discard block
 block discarded – undo
7903 7903
 						// We have to join on extrafield table
7904 7904
 						$errstr = '';
7905 7905
 						if (strpos($InfoFieldList[4], 'extra') !== false) {
7906
-							$sql .= " as main, " . $this->db->sanitize($this->db->prefix() . $InfoFieldList[0]) . "_extrafields as extra";
7907
-							$sqlwhere .= " WHERE extra.fk_object = main." . $this->db->sanitize($InfoFieldList[2]);
7908
-							$sqlwhere .= " AND " . forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1);
7906
+							$sql .= " as main, ".$this->db->sanitize($this->db->prefix().$InfoFieldList[0])."_extrafields as extra";
7907
+							$sqlwhere .= " WHERE extra.fk_object = main.".$this->db->sanitize($InfoFieldList[2]);
7908
+							$sqlwhere .= " AND ".forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1);
7909 7909
 						} else {
7910
-							$sqlwhere .= " WHERE " . forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1);
7910
+							$sqlwhere .= " WHERE ".forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1);
7911 7911
 						}
7912 7912
 					} else {
7913 7913
 						$sqlwhere .= ' WHERE 1=1';
@@ -7928,7 +7928,7 @@  discard block
 block discarded – undo
7928 7928
 
7929 7929
 					// Some tables may have field, some other not. For the moment we disable it.
7930 7930
 					if (in_array($InfoFieldList[0], array('tablewithentity'))) {
7931
-						$sqlwhere .= " AND entity = " . ((int) $conf->entity);
7931
+						$sqlwhere .= " AND entity = ".((int) $conf->entity);
7932 7932
 					}
7933 7933
 					$sql .= $sqlwhere;
7934 7934
 
@@ -7939,7 +7939,7 @@  discard block
 block discarded – undo
7939 7939
 						$sql .= " ORDER BY ".$this->db->sanitize(implode(', ', $fields_label));
7940 7940
 					}
7941 7941
 
7942
-					dol_syslog(get_class($this) . '::showInputField type=sellist', LOG_DEBUG);
7942
+					dol_syslog(get_class($this).'::showInputField type=sellist', LOG_DEBUG);
7943 7943
 					$resql = $this->db->query($sql);
7944 7944
 					if ($resql) {
7945 7945
 						$out .= '<option value="0">&nbsp;</option>';
@@ -7955,7 +7955,7 @@  discard block
 block discarded – undo
7955 7955
 							if (count($fields_label) > 1) {
7956 7956
 								$notrans = true;
7957 7957
 								foreach ($fields_label as $field_toshow) {
7958
-									$labeltoshow .= $obj->$field_toshow . ' ';
7958
+									$labeltoshow .= $obj->$field_toshow.' ';
7959 7959
 								}
7960 7960
 							} else {
7961 7961
 								$labeltoshow = $obj->{$InfoFieldList[1]};
@@ -7966,12 +7966,12 @@  discard block
 block discarded – undo
7966 7966
 								foreach ($fields_label as $field_toshow) {
7967 7967
 									$translabel = $langs->trans($obj->$field_toshow);
7968 7968
 									if ($translabel != $obj->$field_toshow) {
7969
-										$labeltoshow = dol_trunc($translabel) . ' ';
7969
+										$labeltoshow = dol_trunc($translabel).' ';
7970 7970
 									} else {
7971
-										$labeltoshow = dol_trunc($obj->$field_toshow) . ' ';
7971
+										$labeltoshow = dol_trunc($obj->$field_toshow).' ';
7972 7972
 									}
7973 7973
 								}
7974
-								$out .= '<option value="' . $obj->rowid . '" selected>' . $labeltoshow . '</option>';
7974
+								$out .= '<option value="'.$obj->rowid.'" selected>'.$labeltoshow.'</option>';
7975 7975
 							} else {
7976 7976
 								if (!$notrans) {
7977 7977
 									$translabel = $langs->trans($obj->{$InfoFieldList[1]});
@@ -7985,34 +7985,34 @@  discard block
 block discarded – undo
7985 7985
 									$labeltoshow = '(not defined)';
7986 7986
 								}
7987 7987
 								if ($value == $obj->rowid) {
7988
-									$out .= '<option value="' . $obj->rowid . '" selected>' . $labeltoshow . '</option>';
7988
+									$out .= '<option value="'.$obj->rowid.'" selected>'.$labeltoshow.'</option>';
7989 7989
 								}
7990 7990
 
7991 7991
 								if (!empty($InfoFieldList[3]) && $parentField) {
7992
-									$parent = $parentName . ':' . $obj->{$parentField};
7992
+									$parent = $parentName.':'.$obj->{$parentField};
7993 7993
 									$isDependList = 1;
7994 7994
 								}
7995 7995
 
7996
-								$out .= '<option value="' . $obj->rowid . '"';
7996
+								$out .= '<option value="'.$obj->rowid.'"';
7997 7997
 								$out .= ($value == $obj->rowid ? ' selected' : '');
7998
-								$out .= (!empty($parent) ? ' parent="' . $parent . '"' : '');
7999
-								$out .= '>' . $labeltoshow . '</option>';
7998
+								$out .= (!empty($parent) ? ' parent="'.$parent.'"' : '');
7999
+								$out .= '>'.$labeltoshow.'</option>';
8000 8000
 							}
8001 8001
 
8002 8002
 							$i++;
8003 8003
 						}
8004 8004
 						$this->db->free($resql);
8005 8005
 					} else {
8006
-						print 'Error in request ' . $sql . ' ' . $this->db->lasterror() . '. Check setup of extra parameters.<br>';
8006
+						print 'Error in request '.$sql.' '.$this->db->lasterror().'. Check setup of extra parameters.<br>';
8007 8007
 					}
8008 8008
 				} else {
8009 8009
 					require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
8010 8010
 					$data = $form->select_all_categories(Categorie::$MAP_ID_TO_CODE[$InfoFieldList[5]], '', 'parent', 64, $InfoFieldList[6], 1, 1);
8011 8011
 					$out .= '<option value="0">&nbsp;</option>';
8012 8012
 					foreach ($data as $data_key => $data_value) {
8013
-						$out .= '<option value="' . $data_key . '"';
8013
+						$out .= '<option value="'.$data_key.'"';
8014 8014
 						$out .= ($value == $data_key ? ' selected' : '');
8015
-						$out .= '>' . $data_value . '</option>';
8015
+						$out .= '>'.$data_value.'</option>';
8016 8016
 					}
8017 8017
 				}
8018 8018
 			}
@@ -8052,7 +8052,7 @@  discard block
 block discarded – undo
8052 8052
 				// 7 : sort field
8053 8053
 
8054 8054
 				// If there is a filter
8055
-				if (! empty($InfoFieldList[4])) {
8055
+				if (!empty($InfoFieldList[4])) {
8056 8056
 					$pos = 0;
8057 8057
 					$parenthesisopen = 0;
8058 8058
 					while (substr($InfoFieldList[4], $pos, 1) !== '' && ($parenthesisopen || $pos == 0 || substr($InfoFieldList[4], $pos, 1) != ':')) {
@@ -8118,8 +8118,8 @@  discard block
 block discarded – undo
8118 8118
 					}
8119 8119
 
8120 8120
 					$sqlwhere = '';
8121
-					$sql = "SELECT " . $keyList;
8122
-					$sql .= ' FROM ' . $this->db->prefix() . $InfoFieldList[0];
8121
+					$sql = "SELECT ".$keyList;
8122
+					$sql .= ' FROM '.$this->db->prefix().$InfoFieldList[0];
8123 8123
 
8124 8124
 					if (!empty($InfoFieldList[4])) {
8125 8125
 						// can use SELECT request
@@ -8137,11 +8137,11 @@  discard block
 block discarded – undo
8137 8137
 						// We have to join on extrafield table
8138 8138
 						$errstr = '';
8139 8139
 						if (strpos($InfoFieldList[4], 'extra') !== false) {
8140
-							$sql .= ' as main, ' . $this->db->sanitize($this->db->prefix() . $InfoFieldList[0]) . '_extrafields as extra';
8141
-							$sqlwhere .= " WHERE extra.fk_object = main." . $this->db->sanitize($InfoFieldList[2]);
8142
-							$sqlwhere .= " AND " . $InfoFieldList[4];
8140
+							$sql .= ' as main, '.$this->db->sanitize($this->db->prefix().$InfoFieldList[0]).'_extrafields as extra';
8141
+							$sqlwhere .= " WHERE extra.fk_object = main.".$this->db->sanitize($InfoFieldList[2]);
8142
+							$sqlwhere .= " AND ".$InfoFieldList[4];
8143 8143
 						} else {
8144
-							$sqlwhere .= " WHERE " . $InfoFieldList[4];
8144
+							$sqlwhere .= " WHERE ".$InfoFieldList[4];
8145 8145
 						}
8146 8146
 					} else {
8147 8147
 						$sqlwhere .= ' WHERE 1=1';
@@ -8162,14 +8162,14 @@  discard block
 block discarded – undo
8162 8162
 
8163 8163
 					// Some tables may have field, some other not. For the moment we disable it.
8164 8164
 					if (in_array($InfoFieldList[0], array('tablewithentity'))) {
8165
-						$sqlwhere .= " AND entity = " . ((int) $conf->entity);
8165
+						$sqlwhere .= " AND entity = ".((int) $conf->entity);
8166 8166
 					}
8167 8167
 					// $sql.=preg_replace('/^ AND /','',$sqlwhere);
8168 8168
 					// print $sql;
8169 8169
 
8170 8170
 					$sql .= $sqlwhere;
8171 8171
 
8172
-					dol_syslog(get_class($this) . '::showInputField type=chkbxlst', LOG_DEBUG);
8172
+					dol_syslog(get_class($this).'::showInputField type=chkbxlst', LOG_DEBUG);
8173 8173
 
8174 8174
 					$resql = $this->db->query($sql);
8175 8175
 					if ($resql) {
@@ -8188,7 +8188,7 @@  discard block
 block discarded – undo
8188 8188
 							if (count($fields_label) > 1) {
8189 8189
 								$notrans = true;
8190 8190
 								foreach ($fields_label as $field_toshow) {
8191
-									$labeltoshow .= $obj->$field_toshow . ' ';
8191
+									$labeltoshow .= $obj->$field_toshow.' ';
8192 8192
 								}
8193 8193
 							} else {
8194 8194
 								$labeltoshow = $obj->{$InfoFieldList[1]};
@@ -8199,9 +8199,9 @@  discard block
 block discarded – undo
8199 8199
 								foreach ($fields_label as $field_toshow) {
8200 8200
 									$translabel = $langs->trans($obj->$field_toshow);
8201 8201
 									if ($translabel != $obj->$field_toshow) {
8202
-										$labeltoshow = dol_trunc($translabel, 18) . ' ';
8202
+										$labeltoshow = dol_trunc($translabel, 18).' ';
8203 8203
 									} else {
8204
-										$labeltoshow = dol_trunc($obj->$field_toshow, 18) . ' ';
8204
+										$labeltoshow = dol_trunc($obj->$field_toshow, 18).' ';
8205 8205
 									}
8206 8206
 								}
8207 8207
 
@@ -8224,7 +8224,7 @@  discard block
 block discarded – undo
8224 8224
 								}
8225 8225
 
8226 8226
 								if (!empty($InfoFieldList[3]) && $parentField) {
8227
-									$parent = $parentName . ':' . $obj->{$parentField};
8227
+									$parent = $parentName.':'.$obj->{$parentField};
8228 8228
 									$isDependList = 1;
8229 8229
 								}
8230 8230
 
@@ -8235,14 +8235,14 @@  discard block
 block discarded – undo
8235 8235
 						}
8236 8236
 						$this->db->free($resql);
8237 8237
 
8238
-						$out = $form->multiselectarray($keyprefix . $key . $keysuffix, $data, $value_arr, 0, 0, $morecss, 0, '100%');
8238
+						$out = $form->multiselectarray($keyprefix.$key.$keysuffix, $data, $value_arr, 0, 0, $morecss, 0, '100%');
8239 8239
 					} else {
8240
-						print 'Error in request ' . $sql . ' ' . $this->db->lasterror() . '. Check setup of extra parameters.<br>';
8240
+						print 'Error in request '.$sql.' '.$this->db->lasterror().'. Check setup of extra parameters.<br>';
8241 8241
 					}
8242 8242
 				} else {
8243 8243
 					require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
8244 8244
 					$data = $form->select_all_categories(Categorie::$MAP_ID_TO_CODE[(int) $InfoFieldList[5]], '', 'parent', 64, $InfoFieldList[6], 1, 1);
8245
-					$out = $form->multiselectarray($keyprefix . $key . $keysuffix, $data, $value_arr, 0, 0, $morecss, 0, '100%');
8245
+					$out = $form->multiselectarray($keyprefix.$key.$keysuffix, $data, $value_arr, 0, 0, $morecss, 0, '100%');
8246 8246
 				}
8247 8247
 			}
8248 8248
 		} elseif ($type == 'link') {
@@ -8277,7 +8277,7 @@  discard block
 block discarded – undo
8277 8277
 			// $val is already the record field found at same place than found by $valparent but already loaded and may have been modified by parent caller.
8278 8278
 
8279 8279
 			//$objectfield = $valparent;
8280
-			$objectfield = $val;			// Is better than using old method $valparent
8280
+			$objectfield = $val; // Is better than using old method $valparent
8281 8281
 
8282 8282
 			$out = $form->selectForForms($param_list_array[0], $keyprefix.$key.$keysuffix, $value, $showempty, '', '', $morecss, $moreparam, 0, (empty($val['disabled']) ? 0 : 1), '', $objectfield);
8283 8283
 
@@ -8489,7 +8489,7 @@  discard block
 block discarded – undo
8489 8489
 			$value = $this->getLibStatut(3);
8490 8490
 		} elseif ($type == 'date') {
8491 8491
 			if (!empty($value)) {
8492
-				$value = dol_print_date($value, 'day');	// We suppose dates without time are always gmt (storage of course + output)
8492
+				$value = dol_print_date($value, 'day'); // We suppose dates without time are always gmt (storage of course + output)
8493 8493
 			} else {
8494 8494
 				$value = '';
8495 8495
 			}
@@ -8590,7 +8590,7 @@  discard block
 block discarded – undo
8590 8590
 			$value = isset($param['options'][(string) $value]) ? $param['options'][(string) $value] : '';
8591 8591
 			if (strpos($value, "|") !== false) {
8592 8592
 				$value = $langs->trans(explode('|', $value)[0]);
8593
-			} elseif (! is_numeric($value)) {
8593
+			} elseif (!is_numeric($value)) {
8594 8594
 				$value = $langs->trans($value);
8595 8595
 			}
8596 8596
 		} elseif ($type == 'sellist') {
@@ -8652,9 +8652,9 @@  discard block
 block discarded – undo
8652 8652
 									$translabel = $langs->trans($obj->$field_toshow);
8653 8653
 								}
8654 8654
 								if ($translabel != $field_toshow) {
8655
-									$value .= dol_trunc($translabel, 18) . ' ';
8655
+									$value .= dol_trunc($translabel, 18).' ';
8656 8656
 								} else {
8657
-									$value .= $obj->$field_toshow . ' ';
8657
+									$value .= $obj->$field_toshow.' ';
8658 8658
 								}
8659 8659
 							}
8660 8660
 						} else {
@@ -8670,7 +8670,7 @@  discard block
 block discarded – undo
8670 8670
 						}
8671 8671
 					}
8672 8672
 				} else {
8673
-					require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
8673
+					require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
8674 8674
 
8675 8675
 					$toprint = array();
8676 8676
 					$obj = $this->db->fetch_object($resql);
@@ -8678,7 +8678,7 @@  discard block
 block discarded – undo
8678 8678
 					$c->fetch($obj->rowid);
8679 8679
 					$ways = $c->print_all_ways(); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text
8680 8680
 					foreach ($ways as $way) {
8681
-						$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #aaa"') . '>' . img_object('', 'category') . ' ' . $way . '</li>';
8681
+						$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ? ' style="background: #'.$c->color.';"' : ' style="background: #aaa"').'>'.img_object('', 'category').' '.$way.'</li>';
8682 8682
 					}
8683 8683
 					$value = '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>';
8684 8684
 				}
@@ -8694,11 +8694,11 @@  discard block
 block discarded – undo
8694 8694
 				$toprint = array();
8695 8695
 				foreach ($value_arr as $keyval => $valueval) {
8696 8696
 					if (!empty($valueval)) {
8697
-						$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . $param['options'][$valueval] . '</li>';
8697
+						$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.$param['options'][$valueval].'</li>';
8698 8698
 					}
8699 8699
 				}
8700 8700
 				if (!empty($toprint)) {
8701
-					$value = '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">' . implode(' ', $toprint) . '</ul></div>';
8701
+					$value = '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>';
8702 8702
 				}
8703 8703
 			}
8704 8704
 		} elseif ($type == 'chkbxlst') {
@@ -8753,9 +8753,9 @@  discard block
 block discarded – undo
8753 8753
 										$translabel = $langs->trans($obj->$field_toshow);
8754 8754
 									}
8755 8755
 									if ($translabel != $field_toshow) {
8756
-										$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . dol_trunc($translabel, 18) . '</li>';
8756
+										$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.dol_trunc($translabel, 18).'</li>';
8757 8757
 									} else {
8758
-										$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . $obj->$field_toshow . '</li>';
8758
+										$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.$obj->$field_toshow.'</li>';
8759 8759
 									}
8760 8760
 								}
8761 8761
 							} else {
@@ -8764,15 +8764,15 @@  discard block
 block discarded – undo
8764 8764
 									$translabel = $langs->trans($obj->{$InfoFieldList[1]});
8765 8765
 								}
8766 8766
 								if ($translabel != $obj->{$InfoFieldList[1]}) {
8767
-									$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . dol_trunc($translabel, 18) . '</li>';
8767
+									$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.dol_trunc($translabel, 18).'</li>';
8768 8768
 								} else {
8769
-									$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . $obj->{$InfoFieldList[1]} . '</li>';
8769
+									$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.$obj->{$InfoFieldList[1]}.'</li>';
8770 8770
 								}
8771 8771
 							}
8772 8772
 						}
8773 8773
 					}
8774 8774
 				} else {
8775
-					require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
8775
+					require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
8776 8776
 
8777 8777
 					$toprint = array();
8778 8778
 					while ($obj = $this->db->fetch_object($resql)) {
@@ -8781,7 +8781,7 @@  discard block
 block discarded – undo
8781 8781
 							$c->fetch($obj->rowid);
8782 8782
 							$ways = $c->print_all_ways(); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text
8783 8783
 							foreach ($ways as $way) {
8784
-								$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #aaa"') . '>' . img_object('', 'category') . ' ' . $way . '</li>';
8784
+								$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ? ' style="background: #'.$c->color.';"' : ' style="background: #aaa"').'>'.img_object('', 'category').' '.$way.'</li>';
8785 8785
 							}
8786 8786
 						}
8787 8787
 					}
@@ -8951,7 +8951,7 @@  discard block
 block discarded – undo
8951 8951
 		global $langs;
8952 8952
 
8953 8953
 		if (!class_exists('Validate')) {
8954
-			require_once DOL_DOCUMENT_ROOT . '/core/class/validate.class.php';
8954
+			require_once DOL_DOCUMENT_ROOT.'/core/class/validate.class.php';
8955 8955
 		}
8956 8956
 
8957 8957
 		$this->clearFieldError($fieldKey);
@@ -9190,7 +9190,7 @@  discard block
 block discarded – undo
9190 9190
 				$out .= "\n";
9191 9191
 
9192 9192
 				$nbofextrafieldsshown = 0;
9193
-				$e = 0;	// var to manage the modulo (odd/even)
9193
+				$e = 0; // var to manage the modulo (odd/even)
9194 9194
 
9195 9195
 				$lastseparatorkeyfound = '';
9196 9196
 				$extrafields_collapse_num = '';
@@ -9228,9 +9228,9 @@  discard block
 block discarded – undo
9228 9228
 						continue; // <> -1 and <> 1 and <> 3 = not visible on forms, only on list
9229 9229
 					} elseif (($mode == 'edit') && !in_array(abs($visibility), array(1, 3, 4))) {
9230 9230
 						// We need to make sure, that the values of hidden extrafields are also part of $_POST. Otherwise, they would be empty after an update of the object. See also getOptionalsFromPost
9231
-						$ef_name = 'options_' . $key;
9231
+						$ef_name = 'options_'.$key;
9232 9232
 						$ef_value = $this->array_options[$ef_name];
9233
-						$out .= '<input type="hidden" name="' . $ef_name . '" id="' . $ef_name . '" value="' . $ef_value . '" />' . "\n";
9233
+						$out .= '<input type="hidden" name="'.$ef_name.'" id="'.$ef_name.'" value="'.$ef_value.'" />'."\n";
9234 9234
 						continue; // <> -1 and <> 1 and <> 3 = not visible on forms, only on list and <> 4 = not visible at the creation
9235 9235
 					} elseif ($mode == 'view' && empty($visibility)) {
9236 9236
 						continue;
@@ -10308,7 +10308,7 @@  discard block
 block discarded – undo
10308 10308
 						continue;
10309 10309
 					}
10310 10310
 				}
10311
-				$keys_with_alias[] = $alias . '.' . $fieldname;
10311
+				$keys_with_alias[] = $alias.'.'.$fieldname;
10312 10312
 			}
10313 10313
 			return implode(',', $keys_with_alias);
10314 10314
 		} else {
@@ -10448,7 +10448,7 @@  discard block
 block discarded – undo
10448 10448
 		if (!$error) {
10449 10449
 			$sql = "INSERT INTO ".$this->db->prefix().$this->table_element;
10450 10450
 			$sql .= " (".implode(", ", $keys).')';
10451
-			$sql .= " VALUES (".implode(", ", $values).")";		// $values can contains 'abc' or 123
10451
+			$sql .= " VALUES (".implode(", ", $values).")"; // $values can contains 'abc' or 123
10452 10452
 
10453 10453
 			$res = $this->db->query($sql);
10454 10454
 			if (!$res) {
@@ -10751,7 +10751,7 @@  discard block
 block discarded – undo
10751 10751
 
10752 10752
 		// Update extrafield
10753 10753
 		if (!$error) {
10754
-			$result = $this->insertExtraFields();	// This delete and reinsert extrafields
10754
+			$result = $this->insertExtraFields(); // This delete and reinsert extrafields
10755 10755
 			if ($result < 0) {
10756 10756
 				$error++;
10757 10757
 			}
@@ -10953,12 +10953,12 @@  discard block
 block discarded – undo
10953 10953
 				$error++;
10954 10954
 			} else {
10955 10955
 				while ($obj = $this->db->fetch_object($resql)) {
10956
-					$result = $this->fetch($obj->rowid);	// @phpstan-ignore-line
10956
+					$result = $this->fetch($obj->rowid); // @phpstan-ignore-line
10957 10957
 					if ($result < 0) {
10958 10958
 						$error++;
10959 10959
 						$this->errors[] = $this->error;
10960 10960
 					} else {
10961
-						$result = $this->delete($user);	// @phpstan-ignore-line
10961
+						$result = $this->delete($user); // @phpstan-ignore-line
10962 10962
 						if ($result < 0) {
10963 10963
 							$error++;
10964 10964
 							$this->errors[] = $this->error;
@@ -11124,7 +11124,7 @@  discard block
 block discarded – undo
11124 11124
 		);
11125 11125
 		foreach ($fields as $key => $value) {
11126 11126
 			if (array_key_exists($key, $this->fields)) {
11127
-				$this->{$key} = $value;		// @phpstan-ignore-line
11127
+				$this->{$key} = $value; // @phpstan-ignore-line
11128 11128
 			}
11129 11129
 		}
11130 11130
 
Please login to merge, or discard this patch.
htdocs/fichinter/list.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 $search_date_endday = GETPOSTINT('search_date_endday');
86 86
 $search_date_endmonth = GETPOSTINT('search_date_endmonth');
87 87
 $search_date_endyear = GETPOSTINT('search_date_endyear');
88
-$search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear);	// Use tzserver
88
+$search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver
89 89
 $search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear);
90 90
 $optioncss = GETPOST('optioncss', 'alpha');
91 91
 $socid = GETPOSTINT('socid');
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
 
114 114
 // Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
115 115
 $object = new Fichinter($db);
116
-$hookmanager->initHooks(array($contextpage)); 	// Note that conf->hooks_modules contains array of activated contexes
116
+$hookmanager->initHooks(array($contextpage)); // Note that conf->hooks_modules contains array of activated contexes
117 117
 
118 118
 $extrafields = new ExtraFields($db);
119 119
 
@@ -428,7 +428,7 @@  discard block
 block discarded – undo
428 428
 // Output page
429 429
 // --------------------------------------------------------------------
430 430
 
431
-llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'bodyforlist mod-fichinter page-list');	// Can use also classforhorizontalscrolloftabs instead of bodyforlist for no horizontal scroll
431
+llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'bodyforlist mod-fichinter page-list'); // Can use also classforhorizontalscrolloftabs instead of bodyforlist for no horizontal scroll
432 432
 
433 433
 
434 434
 $arrayofselected = is_array($toselect) ? $toselect : array();
@@ -581,7 +581,7 @@  discard block
 block discarded – undo
581 581
 }
582 582
 
583 583
 $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
584
-$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN'));  // This also change content of $arrayfields with user setup
584
+$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup
585 585
 $selectedfields = ($mode != 'kanban' ? $htmlofselectarray : '');
586 586
 $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
587 587
 
@@ -813,7 +813,7 @@  discard block
 block discarded – undo
813 813
 	$objectstatic->id = $obj->rowid;
814 814
 	$objectstatic->ref = $obj->ref;
815 815
 	$objectstatic->ref_client = $obj->ref_client;
816
-	$objectstatic->statut = $obj->status;	// deprecated
816
+	$objectstatic->statut = $obj->status; // deprecated
817 817
 	$objectstatic->status = $obj->status;
818 818
 	$objectstatic->signed_status = $obj->signed_status;
819 819
 
Please login to merge, or discard this patch.