Completed
Branch develop (404fac)
by
unknown
20:18
created
htdocs/accountancy/admin/index.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -275,19 +275,19 @@  discard block
 block discarded – undo
275 275
 // Show message if accountancy hidden options are activated to help to resolve some problems
276 276
 if (!$user->admin) {
277 277
 	if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
278
-		print '<div class="info">' . $langs->trans("ConstantIsOn", "FACTURE_DEPOSITS_ARE_JUST_PAYMENTS") . '</div>';
278
+		print '<div class="info">'.$langs->trans("ConstantIsOn", "FACTURE_DEPOSITS_ARE_JUST_PAYMENTS").'</div>';
279 279
 	}
280 280
 	if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) {
281
-		print '<div class="info">' . $langs->trans("ConstantIsOn", "FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS") . '</div>';
281
+		print '<div class="info">'.$langs->trans("ConstantIsOn", "FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS").'</div>';
282 282
 	}
283 283
 	if (!empty($conf->global->ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY)) {
284
-		print '<div class="info">' . $langs->trans("ConstantIsOn", "ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY") . '</div>';
284
+		print '<div class="info">'.$langs->trans("ConstantIsOn", "ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY").'</div>';
285 285
 	}
286 286
 	if (!empty($conf->global->MAIN_COMPANY_PERENTITY_SHARED)) {
287
-		print '<div class="info">' . $langs->trans("ConstantIsOn", "MAIN_COMPANY_PERENTITY_SHARED") . '</div>';
287
+		print '<div class="info">'.$langs->trans("ConstantIsOn", "MAIN_COMPANY_PERENTITY_SHARED").'</div>';
288 288
 	}
289 289
 	if (!empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED)) {
290
-		print '<div class="info">' . $langs->trans("ConstantIsOn", "MAIN_PRODUCT_PERENTITY_SHARED") . '</div>';
290
+		print '<div class="info">'.$langs->trans("ConstantIsOn", "MAIN_PRODUCT_PERENTITY_SHARED").'</div>';
291 291
 	}
292 292
 }
293 293
 
@@ -459,7 +459,7 @@  discard block
 block discarded – undo
459 459
 // Advanced params
460 460
 print '<table class="noborder centpercent">';
461 461
 print '<tr class="liste_titre">';
462
-print '<td colspan="2">' . $langs->trans('OptionsAdvanced') . '</td>';
462
+print '<td colspan="2">'.$langs->trans('OptionsAdvanced').'</td>';
463 463
 print "</tr>\n";
464 464
 
465 465
 print '<tr class="oddeven">';
@@ -480,7 +480,7 @@  discard block
 block discarded – undo
480 480
 	// Number of letters for lettering (3 by default (AAA), min 2 (AA))
481 481
 	print '<tr class="oddeven">';
482 482
 	print '<td>';
483
-	print $form->textwithpicto($langs->trans("ACCOUNTING_LETTERING_NBLETTERS"), $langs->trans("ACCOUNTING_LETTERING_NBLETTERS_DESC")) . '</td>';
483
+	print $form->textwithpicto($langs->trans("ACCOUNTING_LETTERING_NBLETTERS"), $langs->trans("ACCOUNTING_LETTERING_NBLETTERS_DESC")).'</td>';
484 484
 	print '<td class="right">';
485 485
 
486 486
 	if (empty($letter)) {
@@ -491,19 +491,19 @@  discard block
 block discarded – undo
491 491
 		}
492 492
 	}
493 493
 
494
-	print '<input class="flat" name="ACCOUNTING_LETTERING_NBLETTERS" id="ACCOUNTING_LETTERING_NBLETTERS" value="' . $nbletter . '" type="number" step="1" min="2" max="3" >' . "\n";
494
+	print '<input class="flat" name="ACCOUNTING_LETTERING_NBLETTERS" id="ACCOUNTING_LETTERING_NBLETTERS" value="'.$nbletter.'" type="number" step="1" min="2" max="3" >'."\n";
495 495
 	print '</tr>';
496 496
 
497 497
 	// Auto Lettering when transfer in accountancy is realized
498 498
 	print '<tr class="oddeven">';
499 499
 	print '<td>';
500
-	print $form->textwithpicto($langs->trans("ACCOUNTING_ENABLE_AUTOLETTERING"), $langs->trans("ACCOUNTING_ENABLE_AUTOLETTERING_DESC")) . '</td>';
500
+	print $form->textwithpicto($langs->trans("ACCOUNTING_ENABLE_AUTOLETTERING"), $langs->trans("ACCOUNTING_ENABLE_AUTOLETTERING_DESC")).'</td>';
501 501
 	if (!empty($conf->global->ACCOUNTING_ENABLE_AUTOLETTERING)) {
502
-		print '<td class="right"><a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?token=' . newToken() . '&action=setenableautolettering&value=0">';
502
+		print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setenableautolettering&value=0">';
503 503
 		print img_picto($langs->trans("Activated"), 'switch_on');
504 504
 		print '</a></td>';
505 505
 	} else {
506
-		print '<td class="right"><a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?token=' . newToken() . '&action=setenableautolettering&value=1">';
506
+		print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setenableautolettering&value=1">';
507 507
 		print img_picto($langs->trans("Disabled"), 'switch_off');
508 508
 		print '</a></td>';
509 509
 	}
@@ -514,11 +514,11 @@  discard block
 block discarded – undo
514 514
 print '<td>';
515 515
 print $form->textwithpicto($langs->trans("ACCOUNTING_FORCE_ENABLE_VAT_REVERSE_CHARGE"), $langs->trans("ACCOUNTING_FORCE_ENABLE_VAT_REVERSE_CHARGE_DESC", $langs->transnoentities("MenuDefaultAccounts"))).'</td>';
516 516
 if (!empty($conf->global->ACCOUNTING_FORCE_ENABLE_VAT_REVERSE_CHARGE)) {
517
-	print '<td class="right"><a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?token=' . newToken() . '&action=setenablevatreversecharge&value=0">';
517
+	print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setenablevatreversecharge&value=0">';
518 518
 	print img_picto($langs->trans("Activated"), 'switch_on');
519 519
 	print '</a></td>';
520 520
 } else {
521
-	print '<td class="right"><a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?token=' . newToken() . '&action=setenablevatreversecharge&value=1">';
521
+	print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setenablevatreversecharge&value=1">';
522 522
 	print img_picto($langs->trans("Disabled"), 'switch_off');
523 523
 	print '</a></td>';
524 524
 }
Please login to merge, or discard this patch.
htdocs/accountancy/class/lettering.class.php 1 patch
Spacing   +48 added lines, -48 removed lines patch added patch discarded remove patch
@@ -293,12 +293,12 @@  discard block
 block discarded – undo
293 293
 		$lettre = str_pad("", getDolGlobalInt('ACCOUNTING_LETTERING_NBLETTERS', 3), "A");
294 294
 
295 295
 		$sql = "SELECT DISTINCT ab2.lettering_code";
296
-		$sql .=	" FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping AS ab";
297
-		$sql .=	" LEFT JOIN " . MAIN_DB_PREFIX . "accounting_bookkeeping AS ab2 ON ab2.subledger_account = ab.subledger_account";
298
-		$sql .=	" WHERE ab.rowid IN (" . $this->db->sanitize(implode(',', $ids)) . ")";
299
-		$sql .=	" AND ab2.lettering_code != ''";
300
-		$sql .=	" ORDER BY ab2.lettering_code DESC";
301
-		$sql .=	" LIMIT 1 ";
296
+		$sql .= " FROM ".MAIN_DB_PREFIX."accounting_bookkeeping AS ab";
297
+		$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_bookkeeping AS ab2 ON ab2.subledger_account = ab.subledger_account";
298
+		$sql .= " WHERE ab.rowid IN (".$this->db->sanitize(implode(',', $ids)).")";
299
+		$sql .= " AND ab2.lettering_code != ''";
300
+		$sql .= " ORDER BY ab2.lettering_code DESC";
301
+		$sql .= " LIMIT 1 ";
302 302
 
303 303
 		$resqla = $this->db->query($sql);
304 304
 		if ($resqla) {
@@ -404,7 +404,7 @@  discard block
 block discarded – undo
404 404
 	 */
405 405
 	public function bookkeepingLetteringAll($bookkeeping_ids, $unlettering = false)
406 406
 	{
407
-		dol_syslog(__METHOD__ . " - ", LOG_DEBUG);
407
+		dol_syslog(__METHOD__." - ", LOG_DEBUG);
408 408
 
409 409
 		$error = 0;
410 410
 		$errors = array();
@@ -521,25 +521,25 @@  discard block
 block discarded – undo
521 521
 
522 522
 		// Get all bookkeeping lines
523 523
 		$sql = "SELECT DISTINCT ab.doc_type, ab.fk_doc";
524
-		$sql .= " FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping AS ab";
525
-		$sql .= " WHERE ab.entity IN (" . getEntity('accountancy') . ")";
524
+		$sql .= " FROM ".MAIN_DB_PREFIX."accounting_bookkeeping AS ab";
525
+		$sql .= " WHERE ab.entity IN (".getEntity('accountancy').")";
526 526
 		$sql .= " AND ab.fk_doc > 0";
527 527
 		if (!empty($bookkeeping_ids)) {
528 528
 			// Get all bookkeeping lines of piece number
529 529
 			$sql .= " AND EXISTS (";
530 530
 			$sql .= "  SELECT rowid";
531
-			$sql .= "  FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping AS pn";
532
-			$sql .= "  WHERE pn.entity IN (" . getEntity('accountancy') . ")";
533
-			$sql .= "  AND pn.rowid IN (" . $this->db->sanitize(implode(',', $bookkeeping_ids)) . ")";
531
+			$sql .= "  FROM ".MAIN_DB_PREFIX."accounting_bookkeeping AS pn";
532
+			$sql .= "  WHERE pn.entity IN (".getEntity('accountancy').")";
533
+			$sql .= "  AND pn.rowid IN (".$this->db->sanitize(implode(',', $bookkeeping_ids)).")";
534 534
 			$sql .= "  AND pn.piece_num = ab.piece_num";
535 535
 			$sql .= " )";
536 536
 		}
537 537
 		if ($only_has_subledger_account) $sql .= " AND ab.subledger_account != ''";
538 538
 
539
-		dol_syslog(__METHOD__ . " - Get all bookkeeping lines", LOG_DEBUG);
539
+		dol_syslog(__METHOD__." - Get all bookkeeping lines", LOG_DEBUG);
540 540
 		$resql = $this->db->query($sql);
541 541
 		if (!$resql) {
542
-			$this->errors[] = "Error " . $this->db->lasterror();
542
+			$this->errors[] = "Error ".$this->db->lasterror();
543 543
 			return -1;
544 544
 		}
545 545
 
@@ -586,34 +586,34 @@  discard block
 block discarded – undo
586 586
 
587 587
 				// Get all bookkeeping lines linked
588 588
 				$sql = "SELECT DISTINCT ab.rowid, ab.piece_num, ab.debit, ab.credit, ab.lettering_code";
589
-				$sql .= " FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping AS ab";
590
-				$sql .= " WHERE ab.entity IN (" . getEntity('accountancy') . ")";
589
+				$sql .= " FROM ".MAIN_DB_PREFIX."accounting_bookkeeping AS ab";
590
+				$sql .= " WHERE ab.entity IN (".getEntity('accountancy').")";
591 591
 				$sql .= " AND (";
592 592
 				if (!empty($bank_ids)) {
593 593
 					$sql .= " EXISTS (";
594 594
 					$sql .= "  SELECT bpn.rowid";
595
-					$sql .= "  FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping AS bpn";
596
-					$sql .= "  WHERE bpn.entity IN (" . getEntity('accountancy') . ")";
595
+					$sql .= "  FROM ".MAIN_DB_PREFIX."accounting_bookkeeping AS bpn";
596
+					$sql .= "  WHERE bpn.entity IN (".getEntity('accountancy').")";
597 597
 					$sql .= "  AND bpn.doc_type = 'bank'";
598
-					$sql .= "  AND bpn.fk_doc IN (" . $this->db->sanitize(implode(',', $bank_ids)) . ")";
598
+					$sql .= "  AND bpn.fk_doc IN (".$this->db->sanitize(implode(',', $bank_ids)).")";
599 599
 					$sql .= "  AND bpn.piece_num = ab.piece_num";
600 600
 					$sql .= " ) OR ";
601 601
 				}
602 602
 				$sql .= " EXISTS (";
603 603
 				$sql .= "  SELECT dpn.rowid";
604
-				$sql .= "  FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping AS dpn";
605
-				$sql .= "  WHERE dpn.entity IN (" . getEntity('accountancy') . ")";
606
-				$sql .= "  AND dpn.doc_type = '" . $this->db->escape($doc_type) . "'";
607
-				$sql .= "  AND dpn.fk_doc IN (" . $this->db->sanitize(implode(',', $doc_ids)) . ")";
604
+				$sql .= "  FROM ".MAIN_DB_PREFIX."accounting_bookkeeping AS dpn";
605
+				$sql .= "  WHERE dpn.entity IN (".getEntity('accountancy').")";
606
+				$sql .= "  AND dpn.doc_type = '".$this->db->escape($doc_type)."'";
607
+				$sql .= "  AND dpn.fk_doc IN (".$this->db->sanitize(implode(',', $doc_ids)).")";
608 608
 				$sql .= "  AND dpn.piece_num = ab.piece_num";
609 609
 				$sql .= " )";
610 610
 				$sql .= ")";
611 611
 				if ($only_has_subledger_account) $sql .= " AND ab.subledger_account != ''";
612 612
 
613
-				dol_syslog(__METHOD__ . " - Get all bookkeeping lines linked", LOG_DEBUG);
613
+				dol_syslog(__METHOD__." - Get all bookkeeping lines linked", LOG_DEBUG);
614 614
 				$resql = $this->db->query($sql);
615 615
 				if (!$resql) {
616
-					$this->errors[] = "Error " . $this->db->lasterror();
616
+					$this->errors[] = "Error ".$this->db->lasterror();
617 617
 					return -1;
618 618
 				}
619 619
 
@@ -644,7 +644,7 @@  discard block
 block discarded – undo
644 644
 	 */
645 645
 	public function getDocTypeAndFkDocFromBankLines($bank_ids)
646 646
 	{
647
-		dol_syslog(__METHOD__ . " - bank_ids=".json_encode($bank_ids), LOG_DEBUG);
647
+		dol_syslog(__METHOD__." - bank_ids=".json_encode($bank_ids), LOG_DEBUG);
648 648
 
649 649
 		// Clean parameters
650 650
 		$bank_ids = is_array($bank_ids) ? $bank_ids : array();
@@ -656,16 +656,16 @@  discard block
 block discarded – undo
656 656
 		$bookkeeping_lines_by_type = array();
657 657
 		foreach (self::$doc_type_infos as $doc_type => $doc_type_info) {
658 658
 			// Get all fk_doc by doc_type from bank ids
659
-			$sql = "SELECT DISTINCT dp." . $doc_type_info['doc_payment_table_fk_doc'] . " AS fk_doc";
660
-			$sql .= " FROM " . MAIN_DB_PREFIX . $doc_type_info['payment_table'] . " AS p";
661
-			$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . $doc_type_info['doc_payment_table'] . " AS dp ON dp." . $doc_type_info['doc_payment_table_fk_payment'] . " = p.rowid";
662
-			$sql .= " WHERE p." . $doc_type_info['payment_table_fk_bank'] . " IN (" . $this->db->sanitize(implode(',', $bank_ids)) . ")";
663
-			$sql .= " AND dp." . $doc_type_info['doc_payment_table_fk_doc'] . " > 0";
659
+			$sql = "SELECT DISTINCT dp.".$doc_type_info['doc_payment_table_fk_doc']." AS fk_doc";
660
+			$sql .= " FROM ".MAIN_DB_PREFIX.$doc_type_info['payment_table']." AS p";
661
+			$sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$doc_type_info['doc_payment_table']." AS dp ON dp.".$doc_type_info['doc_payment_table_fk_payment']." = p.rowid";
662
+			$sql .= " WHERE p.".$doc_type_info['payment_table_fk_bank']." IN (".$this->db->sanitize(implode(',', $bank_ids)).")";
663
+			$sql .= " AND dp.".$doc_type_info['doc_payment_table_fk_doc']." > 0";
664 664
 
665
-			dol_syslog(__METHOD__ . " - Get all fk_doc by doc_type from list of bank ids for '" . $doc_type . "'", LOG_DEBUG);
665
+			dol_syslog(__METHOD__." - Get all fk_doc by doc_type from list of bank ids for '".$doc_type."'", LOG_DEBUG);
666 666
 			$resql = $this->db->query($sql);
667 667
 			if (!$resql) {
668
-				$this->errors[] = "Error " . $this->db->lasterror();
668
+				$this->errors[] = "Error ".$this->db->lasterror();
669 669
 				return -1;
670 670
 			}
671 671
 
@@ -689,7 +689,7 @@  discard block
 block discarded – undo
689 689
 	{
690 690
 		global $langs;
691 691
 
692
-		dol_syslog(__METHOD__ . " - bank_ids=".json_encode($document_ids) . ", doc_type=$doc_type", LOG_DEBUG);
692
+		dol_syslog(__METHOD__." - bank_ids=".json_encode($document_ids).", doc_type=$doc_type", LOG_DEBUG);
693 693
 
694 694
 		// Clean parameters
695 695
 		$document_ids = is_array($document_ids) ? $document_ids : array();
@@ -711,16 +711,16 @@  discard block
 block discarded – undo
711 711
 		$bank_ids = array();
712 712
 
713 713
 		// Get all fk_doc by doc_type from bank ids
714
-		$sql = "SELECT DISTINCT p." . $doc_type_info['payment_table_fk_bank'] . " AS fk_doc";
715
-		$sql .= " FROM " . MAIN_DB_PREFIX . $doc_type_info['payment_table'] . " AS p";
716
-		$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . $doc_type_info['doc_payment_table'] . " AS dp ON dp." . $doc_type_info['doc_payment_table_fk_payment'] . " = p.rowid";
717
-		$sql .= " WHERE dp." . $doc_type_info['doc_payment_table_fk_doc'] . " IN (" . $this->db->sanitize(implode(',', $document_ids)) . ")";
718
-		$sql .= " AND p." . $doc_type_info['payment_table_fk_bank'] . " > 0";
714
+		$sql = "SELECT DISTINCT p.".$doc_type_info['payment_table_fk_bank']." AS fk_doc";
715
+		$sql .= " FROM ".MAIN_DB_PREFIX.$doc_type_info['payment_table']." AS p";
716
+		$sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$doc_type_info['doc_payment_table']." AS dp ON dp.".$doc_type_info['doc_payment_table_fk_payment']." = p.rowid";
717
+		$sql .= " WHERE dp.".$doc_type_info['doc_payment_table_fk_doc']." IN (".$this->db->sanitize(implode(',', $document_ids)).")";
718
+		$sql .= " AND p.".$doc_type_info['payment_table_fk_bank']." > 0";
719 719
 
720
-		dol_syslog(__METHOD__ . " - Get all bank ids from list of document ids of a type '" . $doc_type . "'", LOG_DEBUG);
720
+		dol_syslog(__METHOD__." - Get all bank ids from list of document ids of a type '".$doc_type."'", LOG_DEBUG);
721 721
 		$resql = $this->db->query($sql);
722 722
 		if (!$resql) {
723
-			$this->errors[] = "Error " . $this->db->lasterror();
723
+			$this->errors[] = "Error ".$this->db->lasterror();
724 724
 			return -1;
725 725
 		}
726 726
 
@@ -766,15 +766,15 @@  discard block
 block discarded – undo
766 766
 		$link_by_element = array();
767 767
 		$element_by_link = array();
768 768
 		foreach ($doc_type_info['linked_info'] as $linked_info) {
769
-			$sql = "SELECT DISTINCT tl2." . $linked_info['fk_link'] . " AS fk_link, tl2." . $linked_info['fk_doc'] . " AS fk_doc";
770
-			$sql .= " FROM " . MAIN_DB_PREFIX . $linked_info['table'] . " AS tl";
771
-			$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . $linked_info['table'] . " AS tl2 ON tl2." . $linked_info['fk_link'] . " = tl." . $linked_info['fk_link'];
772
-			$sql .= " WHERE tl." . $linked_info['fk_doc'] . " IN (" . $this->db->sanitize(implode(',', $document_ids)) . ")";
769
+			$sql = "SELECT DISTINCT tl2.".$linked_info['fk_link']." AS fk_link, tl2.".$linked_info['fk_doc']." AS fk_doc";
770
+			$sql .= " FROM ".MAIN_DB_PREFIX.$linked_info['table']." AS tl";
771
+			$sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$linked_info['table']." AS tl2 ON tl2.".$linked_info['fk_link']." = tl.".$linked_info['fk_link'];
772
+			$sql .= " WHERE tl.".$linked_info['fk_doc']." IN (".$this->db->sanitize(implode(',', $document_ids)).")";
773 773
 
774
-			dol_syslog(__METHOD__ . " - Get document lines", LOG_DEBUG);
774
+			dol_syslog(__METHOD__." - Get document lines", LOG_DEBUG);
775 775
 			$resql = $this->db->query($sql);
776 776
 			if (!$resql) {
777
-				$this->errors[] = "Error " . $this->db->lasterror();
777
+				$this->errors[] = "Error ".$this->db->lasterror();
778 778
 				return -1;
779 779
 			}
780 780
 
@@ -782,7 +782,7 @@  discard block
 block discarded – undo
782 782
 			while ($obj = $this->db->fetch_object($resql)) {
783 783
 				$current_document_ids[$obj->fk_doc] = $obj->fk_doc;
784 784
 
785
-				$link_key = $linked_info['prefix'] . $obj->fk_link;
785
+				$link_key = $linked_info['prefix'].$obj->fk_link;
786 786
 				$element_by_link[$link_key][$obj->fk_doc] = $obj->fk_doc;
787 787
 				$link_by_element[$obj->fk_doc][$link_key] = $link_key;
788 788
 				if ($is_fk_link_is_also_fk_doc) {
Please login to merge, or discard this patch.
htdocs/user/perms.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -219,9 +219,9 @@  discard block
 block discarded – undo
219 219
 // Read the permissions of a user inherited by its groups
220 220
 $permsgroupbyentity = array();
221 221
 
222
-$sql = "SELECT DISTINCT gr.fk_id, gu.entity";	// fk_id are permission id and entity is entity of the group
222
+$sql = "SELECT DISTINCT gr.fk_id, gu.entity"; // fk_id are permission id and entity is entity of the group
223 223
 $sql .= " FROM ".MAIN_DB_PREFIX."usergroup_rights as gr,";
224
-$sql .= " ".MAIN_DB_PREFIX."usergroup_user as gu";	// all groups of a user
224
+$sql .= " ".MAIN_DB_PREFIX."usergroup_user as gu"; // all groups of a user
225 225
 $sql .= " WHERE gr.entity = ".((int) $entity);
226 226
 $sql .= " AND gu.entity =".((int) $entity);
227 227
 $sql .= " AND gr.fk_usergroup = gu.fk_usergroup";
@@ -498,7 +498,7 @@  discard block
 block discarded – undo
498 498
 		} else {
499 499
 			$ishidden = 0;
500 500
 		}
501
-		$isexpanded = ! $ishidden;
501
+		$isexpanded = !$ishidden;
502 502
 		//var_dump("isexpanded=".$isexpanded);
503 503
 
504 504
 		$permsgroupbyentitypluszero = array();
@@ -522,7 +522,7 @@  discard block
 block discarded – undo
522 522
 			} else {
523 523
 				$ishidden = 0;
524 524
 			}
525
-			$isexpanded = ! $ishidden;
525
+			$isexpanded = !$ishidden;
526 526
 			//var_dump('$obj->module='.$obj->module.' isexpanded='.$isexpanded);
527 527
 
528 528
 			// Break detected, we get objMod
Please login to merge, or discard this patch.
test/phpunit/functional/InstallTest.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 	public static function setUpBeforeClass(): void
50 50
 	{
51 51
 		// Make sure we backup and remove the configuration file to force new install.
52
-		@rename('htdocs/conf/conf.php', sys_get_temp_dir() . '/conf.php');
52
+		@rename('htdocs/conf/conf.php', sys_get_temp_dir().'/conf.php');
53 53
 
54 54
 		// Start without a database
55 55
 		self::dropTestDatabase();
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
 	protected static function dropTestDatabase()
67 67
 	{
68 68
 		$mysqli = new mysqli(self::$db_host, self::$db_admin_user, self::$db_admin_pass);
69
-		$mysqli->query("DROP DATABASE " . self::$db_name);
69
+		$mysqli->query("DROP DATABASE ".self::$db_name);
70 70
 	}
71 71
 
72 72
 	/**
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 	{
79 79
 		// Remove the generated configuration and restore the backed up file.
80 80
 		@unlink('htdocs/conf/conf.php');
81
-		@rename(sys_get_temp_dir() . '/conf.php', 'htdocs/conf/conf.php');
81
+		@rename(sys_get_temp_dir().'/conf.php', 'htdocs/conf/conf.php');
82 82
 
83 83
 		// Cleanup test database
84 84
 		self::dropTestDatabase();
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
 		// FIXME: the button itself should have an ID
221 221
 		$this->byId('nextbutton')->byTag('input')->click();
222 222
 		$time = $start->diff(new DateTimeImmutable());
223
-		echo "\nPopulating the database took " . $time->format("%s seconds.\n");
223
+		echo "\nPopulating the database took ".$time->format("%s seconds.\n");
224 224
 		$this->assertStringContainsString('/install/step2.php', $this->url());
225 225
 	}
226 226
 
Please login to merge, or discard this patch.
test/phpunit/SocieteTest.php 1 patch
Spacing   +134 added lines, -134 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
  *      \remarks    To run this script as CLI:  phpunit filename.php
25 25
  */
26 26
 
27
-global $conf,$user,$langs,$db;
27
+global $conf, $user, $langs, $db;
28 28
 //define('TEST_DB_FORCE_TYPE','mysql'); // This is to force using mysql driver
29 29
 //require_once 'PHPUnit/Autoload.php';
30 30
 require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 	$user->fetch(1);
37 37
 	$user->getrights();
38 38
 }
39
-$conf->global->MAIN_DISABLE_ALL_MAILS=1;
39
+$conf->global->MAIN_DISABLE_ALL_MAILS = 1;
40 40
 
41 41
 
42 42
 /**
@@ -65,11 +65,11 @@  discard block
 block discarded – undo
65 65
 		parent::__construct($name);
66 66
 
67 67
 		//$this->sharedFixture
68
-		global $conf,$user,$langs,$db;
69
-		$this->savconf=$conf;
70
-		$this->savuser=$user;
71
-		$this->savlangs=$langs;
72
-		$this->savdb=$db;
68
+		global $conf, $user, $langs, $db;
69
+		$this->savconf = $conf;
70
+		$this->savuser = $user;
71
+		$this->savlangs = $langs;
72
+		$this->savdb = $db;
73 73
 
74 74
 		print __METHOD__." db->type=".$db->type." user->id=".$user->id;
75 75
 		//print " - db ".$db->db;
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
 	 */
84 84
 	public static function setUpBeforeClass(): void
85 85
 	{
86
-		global $conf,$user,$langs,$db;
86
+		global $conf, $user, $langs, $db;
87 87
 
88 88
 		if ($conf->global->SOCIETE_CODECLIENT_ADDON != 'mod_codeclient_monkey') {
89 89
 			print "\n".__METHOD__." third party ref checker must be setup to 'mod_codeclient_monkey' not to '".$conf->global->SOCIETE_CODECLIENT_ADDON."'.\n"; die(1);
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
 			print "\n".__METHOD__." default language of company must be set to autodetect.\n"; die(1);
98 98
 		}
99 99
 
100
-		$db->begin();	// This is to have all actions inside a transaction even if test launched without suite.
100
+		$db->begin(); // This is to have all actions inside a transaction even if test launched without suite.
101 101
 
102 102
 		print __METHOD__."\n";
103 103
 	}
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
 	 */
110 110
 	public static function tearDownAfterClass(): void
111 111
 	{
112
-		global $conf,$user,$langs,$db;
112
+		global $conf, $user, $langs, $db;
113 113
 		$db->rollback();
114 114
 
115 115
 		print __METHOD__."\n";
@@ -122,11 +122,11 @@  discard block
 block discarded – undo
122 122
 	 */
123 123
 	protected function setUp(): void
124 124
 	{
125
-		global $conf,$user,$langs,$db;
126
-		$conf=$this->savconf;
127
-		$user=$this->savuser;
128
-		$langs=$this->savlangs;
129
-		$db=$this->savdb;
125
+		global $conf, $user, $langs, $db;
126
+		$conf = $this->savconf;
127
+		$user = $this->savuser;
128
+		$langs = $this->savlangs;
129
+		$db = $this->savdb;
130 130
 
131 131
 		print __METHOD__."\n";
132 132
 	}
@@ -148,15 +148,15 @@  discard block
 block discarded – undo
148 148
 	 */
149 149
 	public function testSocieteCreate()
150 150
 	{
151
-		global $conf,$user,$langs,$db;
152
-		$conf=$this->savconf;
153
-		$user=$this->savuser;
154
-		$langs=$this->savlangs;
155
-		$db=$this->savdb;
151
+		global $conf, $user, $langs, $db;
152
+		$conf = $this->savconf;
153
+		$user = $this->savuser;
154
+		$langs = $this->savlangs;
155
+		$db = $this->savdb;
156 156
 
157
-		$localobject=new Societe($db);
157
+		$localobject = new Societe($db);
158 158
 		$localobject->initAsSpecimen();
159
-		$result=$localobject->create($user);
159
+		$result = $localobject->create($user);
160 160
 
161 161
 		print __METHOD__." result=".$result."\n";
162 162
 		$this->assertLessThanOrEqual($result, 0);
@@ -175,18 +175,18 @@  discard block
 block discarded – undo
175 175
 	 */
176 176
 	public function testSocieteFetch($id)
177 177
 	{
178
-		global $conf,$user,$langs,$db;
179
-		$conf=$this->savconf;
180
-		$user=$this->savuser;
181
-		$langs=$this->savlangs;
182
-		$db=$this->savdb;
183
-
184
-		$localobject=new Societe($db);
185
-		$result=$localobject->fetch($id);
178
+		global $conf, $user, $langs, $db;
179
+		$conf = $this->savconf;
180
+		$user = $this->savuser;
181
+		$langs = $this->savlangs;
182
+		$db = $this->savdb;
183
+
184
+		$localobject = new Societe($db);
185
+		$result = $localobject->fetch($id);
186 186
 		print __METHOD__." id=".$id." result=".$result."\n";
187 187
 		$this->assertLessThan($result, 0);
188 188
 
189
-		$result=$localobject->verify();
189
+		$result = $localobject->verify();
190 190
 		print __METHOD__." id=".$id." result=".$result."\n";
191 191
 		$this->assertEquals($result, 0);
192 192
 
@@ -204,43 +204,43 @@  discard block
 block discarded – undo
204 204
 	 */
205 205
 	public function testSocieteUpdate($localobject)
206 206
 	{
207
-		global $conf,$user,$langs,$db;
208
-		$conf=$this->savconf;
209
-		$user=$this->savuser;
210
-		$langs=$this->savlangs;
211
-		$db=$this->savdb;
212
-
213
-		$localobject->note_private='New private note after update';
214
-		$localobject->note_public='New public note after update';
215
-		$localobject->name='New name';
216
-		$localobject->address='New address';
217
-		$localobject->zip='New zip';
218
-		$localobject->town='New town';
219
-		$localobject->country_id=2;
220
-		$localobject->status=0;
221
-		$localobject->phone='New tel';
222
-		$localobject->fax='New fax';
223
-		$localobject->email='[email protected]';
224
-		$localobject->url='New url';
225
-		$localobject->idprof1='new idprof1';
226
-		$localobject->idprof2='new idprof2';
227
-		$localobject->idprof3='new idprof3';
228
-		$localobject->idprof4='new idprof4';
229
-
230
-		$result=$localobject->update($localobject->id, $user);
207
+		global $conf, $user, $langs, $db;
208
+		$conf = $this->savconf;
209
+		$user = $this->savuser;
210
+		$langs = $this->savlangs;
211
+		$db = $this->savdb;
212
+
213
+		$localobject->note_private = 'New private note after update';
214
+		$localobject->note_public = 'New public note after update';
215
+		$localobject->name = 'New name';
216
+		$localobject->address = 'New address';
217
+		$localobject->zip = 'New zip';
218
+		$localobject->town = 'New town';
219
+		$localobject->country_id = 2;
220
+		$localobject->status = 0;
221
+		$localobject->phone = 'New tel';
222
+		$localobject->fax = 'New fax';
223
+		$localobject->email = '[email protected]';
224
+		$localobject->url = 'New url';
225
+		$localobject->idprof1 = 'new idprof1';
226
+		$localobject->idprof2 = 'new idprof2';
227
+		$localobject->idprof3 = 'new idprof3';
228
+		$localobject->idprof4 = 'new idprof4';
229
+
230
+		$result = $localobject->update($localobject->id, $user);
231 231
 		print __METHOD__." id=".$localobject->id." result=".$result."\n";
232 232
 		$this->assertLessThan($result, 0);
233 233
 
234
-		$result=$localobject->update_note($localobject->note_private, '_private');
234
+		$result = $localobject->update_note($localobject->note_private, '_private');
235 235
 		print __METHOD__." id=".$localobject->id." result=".$result."\n";
236 236
 		$this->assertLessThan($result, 0, 'Holiday::update_note (private) error');
237 237
 
238
-		$result=$localobject->update_note($localobject->note_public, '_public');
238
+		$result = $localobject->update_note($localobject->note_public, '_public');
239 239
 		print __METHOD__." id=".$localobject->id." result=".$result."\n";
240 240
 		$this->assertLessThan($result, 0, 'Holiday::update_note (public) error');
241 241
 
242
-		$newobject=new Societe($db);
243
-		$result=$newobject->fetch($localobject->id);
242
+		$newobject = new Societe($db);
243
+		$result = $newobject->fetch($localobject->id);
244 244
 		print __METHOD__." id=".$localobject->id." result=".$result."\n";
245 245
 		$this->assertLessThan($result, 0);
246 246
 
@@ -277,42 +277,42 @@  discard block
 block discarded – undo
277 277
 	public function testIdProfCheck($localobject)
278 278
 	{
279 279
 		// OK FR
280
-		$localobject->country_code='FR';
281
-		$localobject->idprof1=493861496;
282
-		$localobject->idprof2=49386149600021;
283
-		$result=$localobject->id_prof_check(1, $localobject);    // Must be > 0
280
+		$localobject->country_code = 'FR';
281
+		$localobject->idprof1 = 493861496;
282
+		$localobject->idprof2 = 49386149600021;
283
+		$result = $localobject->id_prof_check(1, $localobject); // Must be > 0
284 284
 		print __METHOD__." OK FR idprof1 result=".$result."\n";
285 285
 		$this->assertGreaterThanOrEqual(1, $result);
286
-		$result=$localobject->id_prof_check(2, $localobject);    // Must be > 0
286
+		$result = $localobject->id_prof_check(2, $localobject); // Must be > 0
287 287
 		print __METHOD__." OK FR idprof2 result=".$result."\n";
288 288
 		$this->assertGreaterThanOrEqual(1, $result);
289 289
 
290 290
 		// KO FR
291
-		$localobject->country_code='FR';
292
-		$localobject->idprof1='id1ko';
293
-		$localobject->idprof2='id2ko';
294
-		$result=$localobject->id_prof_check(1, $localobject);    // Must be <= 0
291
+		$localobject->country_code = 'FR';
292
+		$localobject->idprof1 = 'id1ko';
293
+		$localobject->idprof2 = 'id2ko';
294
+		$result = $localobject->id_prof_check(1, $localobject); // Must be <= 0
295 295
 		print __METHOD__." KO FR idprof1 result=".$result."\n";
296 296
 		$this->assertLessThan(1, $result);
297
-		$result=$localobject->id_prof_check(2, $localobject);    // Must be <= 0
297
+		$result = $localobject->id_prof_check(2, $localobject); // Must be <= 0
298 298
 		print __METHOD__." KO FR idprof2 result=".$result."\n";
299 299
 		$this->assertLessThan(1, $result);
300 300
 
301 301
 		// KO ES
302
-		$localobject->country_code='ES';
303
-		$localobject->idprof1='id1ko';
304
-		$result=$localobject->id_prof_check(1, $localobject);    // Must be <= 0
302
+		$localobject->country_code = 'ES';
303
+		$localobject->idprof1 = 'id1ko';
304
+		$result = $localobject->id_prof_check(1, $localobject); // Must be <= 0
305 305
 		print __METHOD__." KO ES idprof1 result=".$result."\n";
306 306
 		$this->assertLessThan(1, $result);
307 307
 
308 308
 		// OK AR
309
-		$localobject->country_code='AR';
310
-		$localobject->idprof1='id1ko';
311
-		$localobject->idprof2='id2ko';
312
-		$result=$localobject->id_prof_check(1, $localobject);    // Must be > 0
309
+		$localobject->country_code = 'AR';
310
+		$localobject->idprof1 = 'id1ko';
311
+		$localobject->idprof2 = 'id2ko';
312
+		$result = $localobject->id_prof_check(1, $localobject); // Must be > 0
313 313
 		print __METHOD__." OK AR idprof1 result=".$result."\n";
314 314
 		$this->assertGreaterThanOrEqual(0, $result);
315
-		$result=$localobject->id_prof_check(2, $localobject);    // Must be > 0
315
+		$result = $localobject->id_prof_check(2, $localobject); // Must be > 0
316 316
 		print __METHOD__." OK AR idprof2 result=".$result."\n";
317 317
 		$this->assertGreaterThanOrEqual(1, $result);
318 318
 
@@ -331,37 +331,37 @@  discard block
 block discarded – undo
331 331
 	 */
332 332
 	public function testSocieteOther($localobject)
333 333
 	{
334
-		global $conf,$user,$langs,$db;
335
-		$conf=$this->savconf;
336
-		$user=$this->savuser;
337
-		$langs=$this->savlangs;
338
-		$db=$this->savdb;
334
+		global $conf, $user, $langs, $db;
335
+		$conf = $this->savconf;
336
+		$user = $this->savuser;
337
+		$langs = $this->savlangs;
338
+		$db = $this->savdb;
339 339
 
340
-		$result=$localobject->setAsCustomer();
340
+		$result = $localobject->setAsCustomer();
341 341
 		print __METHOD__." id=".$localobject->id." result=".$result."\n";
342 342
 		$this->assertLessThan($result, 0);
343 343
 
344
-		$result=$localobject->setPriceLevel(1, $user);
344
+		$result = $localobject->setPriceLevel(1, $user);
345 345
 		print __METHOD__." id=".$localobject->id." result=".$result."\n";
346 346
 		$this->assertLessThan($result, 0);
347 347
 
348
-		$result=$localobject->set_remise_client(10, 'Gift', $user);
348
+		$result = $localobject->set_remise_client(10, 'Gift', $user);
349 349
 		print __METHOD__." id=".$localobject->id." result=".$result."\n";
350 350
 		$this->assertLessThan($result, 0);
351 351
 
352
-		$result=$localobject->getNomUrl(1);
352
+		$result = $localobject->getNomUrl(1);
353 353
 		print __METHOD__." id=".$localobject->id." result=".$result."\n";
354 354
 		$this->assertNotEquals($result, '');
355 355
 
356 356
 		$localobject->country_code = 'FR';
357 357
 
358
-		$result=$localobject->isInEEC();
358
+		$result = $localobject->isInEEC();
359 359
 		print __METHOD__." id=".$localobject->id." country_code=".$localobject->country_code." result=".$result."\n";
360 360
 		$this->assertTrue($result);
361 361
 
362 362
 		$localobject->country_code = 'US';
363 363
 
364
-		$result=$localobject->isInEEC();
364
+		$result = $localobject->isInEEC();
365 365
 		print __METHOD__." id=".$localobject->id." country_code=".$localobject->country_code." result=".$result."\n";
366 366
 		$this->assertFalse($result);
367 367
 
@@ -391,16 +391,16 @@  discard block
 block discarded – undo
391 391
 	 */
392 392
 	public function testGetOutstandingBills($id)
393 393
 	{
394
-		global $conf,$user,$langs,$db;
395
-		$conf=$this->savconf;
396
-		$user=$this->savuser;
397
-		$langs=$this->savlangs;
398
-		$db=$this->savdb;
394
+		global $conf, $user, $langs, $db;
395
+		$conf = $this->savconf;
396
+		$user = $this->savuser;
397
+		$langs = $this->savlangs;
398
+		$db = $this->savdb;
399 399
 
400
-		$localobject=new Societe($db);
400
+		$localobject = new Societe($db);
401 401
 		$localobject->fetch($id);
402 402
 
403
-		$result=$localobject->getOutstandingBills();
403
+		$result = $localobject->getOutstandingBills();
404 404
 
405 405
 		print __METHOD__." id=".$id." result=".var_export($result, true)."\n";
406 406
 		$this->assertTrue(array_key_exists('opened', $result), 'Result of getOutstandingBills failed');
@@ -420,16 +420,16 @@  discard block
 block discarded – undo
420 420
 	 */
421 421
 	public function testSocieteDelete($id)
422 422
 	{
423
-		global $conf,$user,$langs,$db;
424
-		$conf=$this->savconf;
425
-		$user=$this->savuser;
426
-		$langs=$this->savlangs;
427
-		$db=$this->savdb;
423
+		global $conf, $user, $langs, $db;
424
+		$conf = $this->savconf;
425
+		$user = $this->savuser;
426
+		$langs = $this->savlangs;
427
+		$db = $this->savdb;
428 428
 
429
-		$localobject=new Societe($db);
430
-		$result=$localobject->fetch($id);
429
+		$localobject = new Societe($db);
430
+		$result = $localobject->fetch($id);
431 431
 
432
-		$result=$localobject->delete($id, $user);
432
+		$result = $localobject->delete($id, $user);
433 433
 		print __METHOD__." id=".$id." result=".$result."\n";
434 434
 		$this->assertLessThan($result, 0);
435 435
 
@@ -444,57 +444,57 @@  discard block
 block discarded – undo
444 444
 	 */
445 445
 	public function testSocieteGetFullAddress()
446 446
 	{
447
-		global $conf,$user,$langs,$db;
448
-		$conf=$this->savconf;
449
-		$user=$this->savuser;
450
-		$langs=$this->savlangs;
451
-		$db=$this->savdb;
447
+		global $conf, $user, $langs, $db;
448
+		$conf = $this->savconf;
449
+		$user = $this->savuser;
450
+		$langs = $this->savlangs;
451
+		$db = $this->savdb;
452 452
 
453
-		$localobjectadd=new Societe($db);
453
+		$localobjectadd = new Societe($db);
454 454
 		$localobjectadd->initAsSpecimen();
455 455
 
456 456
 		// France
457 457
 		unset($localobjectadd->country_code);
458
-		$localobjectadd->country_id=1;
459
-		$localobjectadd->name='New name';
460
-		$localobjectadd->address='New address';
461
-		$localobjectadd->zip='New zip';
462
-		$localobjectadd->town='New town';
463
-		$result=$localobjectadd->getFullAddress(1);
458
+		$localobjectadd->country_id = 1;
459
+		$localobjectadd->name = 'New name';
460
+		$localobjectadd->address = 'New address';
461
+		$localobjectadd->zip = 'New zip';
462
+		$localobjectadd->town = 'New town';
463
+		$result = $localobjectadd->getFullAddress(1);
464 464
 		print __METHOD__." id=".$localobjectadd->id." result=".$result."\n";
465 465
 		$this->assertStringContainsString("New address\nNew zip New town\nFrance", $result);
466 466
 
467 467
 		// Belgium
468 468
 		unset($localobjectadd->country_code);
469
-		$localobjectadd->country_id=2;
470
-		$localobjectadd->name='New name';
471
-		$localobjectadd->address='New address';
472
-		$localobjectadd->zip='New zip';
473
-		$localobjectadd->town='New town';
474
-		$result=$localobjectadd->getFullAddress(1);
469
+		$localobjectadd->country_id = 2;
470
+		$localobjectadd->name = 'New name';
471
+		$localobjectadd->address = 'New address';
472
+		$localobjectadd->zip = 'New zip';
473
+		$localobjectadd->town = 'New town';
474
+		$result = $localobjectadd->getFullAddress(1);
475 475
 		print __METHOD__." id=".$localobjectadd->id." result=".$result."\n";
476 476
 		$this->assertStringContainsString("New address\nNew zip New town\nBelgium", $result);
477 477
 
478 478
 		// Switzerland
479 479
 		unset($localobjectadd->country_code);
480
-		$localobjectadd->country_id=6;
481
-		$localobjectadd->name='New name';
482
-		$localobjectadd->address='New address';
483
-		$localobjectadd->zip='New zip';
484
-		$localobjectadd->town='New town';
485
-		$result=$localobjectadd->getFullAddress(1);
480
+		$localobjectadd->country_id = 6;
481
+		$localobjectadd->name = 'New name';
482
+		$localobjectadd->address = 'New address';
483
+		$localobjectadd->zip = 'New zip';
484
+		$localobjectadd->town = 'New town';
485
+		$result = $localobjectadd->getFullAddress(1);
486 486
 		print __METHOD__." id=".$localobjectadd->id." result=".$result."\n";
487 487
 		$this->assertStringContainsString("New address\nNew zip New town\nSwitzerland", $result);
488 488
 
489 489
 		// USA
490 490
 		unset($localobjectadd->country_code);
491
-		$localobjectadd->country_id=11;
492
-		$localobjectadd->name='New name';
493
-		$localobjectadd->address='New address';
494
-		$localobjectadd->zip='New zip';
495
-		$localobjectadd->town='New town';
496
-		$localobjectadd->state='New state';
497
-		$result=$localobjectadd->getFullAddress(1);
491
+		$localobjectadd->country_id = 11;
492
+		$localobjectadd->name = 'New name';
493
+		$localobjectadd->address = 'New address';
494
+		$localobjectadd->zip = 'New zip';
495
+		$localobjectadd->town = 'New town';
496
+		$localobjectadd->state = 'New state';
497
+		$result = $localobjectadd->getFullAddress(1);
498 498
 		print __METHOD__." id=".$localobjectadd->id." result=".$result."\n";
499 499
 		$this->assertStringContainsString("New address\nNew town, New state, New zip\nUnited States", $result);
500 500
 
Please login to merge, or discard this patch.
test/phpunit/LangTest.php 1 patch
Spacing   +56 added lines, -56 removed lines patch added patch discarded remove patch
@@ -24,42 +24,42 @@  discard block
 block discarded – undo
24 24
  *		\remarks	To run this script as CLI:  phpunit filename.php
25 25
  */
26 26
 
27
-global $conf,$user,$langs,$db;
27
+global $conf, $user, $langs, $db;
28 28
 //define('TEST_DB_FORCE_TYPE','mysql');	// This is to force using mysql driver
29 29
 //require_once 'PHPUnit/Autoload.php';
30 30
 require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
31 31
 require_once dirname(__FILE__).'/../../htdocs/core/lib/security.lib.php';
32 32
 require_once dirname(__FILE__).'/../../htdocs/core/lib/security2.lib.php';
33 33
 
34
-if (! defined('NOREQUIREUSER')) {
34
+if (!defined('NOREQUIREUSER')) {
35 35
 	define('NOREQUIREUSER', '1');
36 36
 }
37
-if (! defined('NOREQUIREDB')) {
37
+if (!defined('NOREQUIREDB')) {
38 38
 	define('NOREQUIREDB', '1');
39 39
 }
40
-if (! defined('NOREQUIRESOC')) {
40
+if (!defined('NOREQUIRESOC')) {
41 41
 	define('NOREQUIRESOC', '1');
42 42
 }
43
-if (! defined('NOREQUIRETRAN')) {
43
+if (!defined('NOREQUIRETRAN')) {
44 44
 	define('NOREQUIRETRAN', '1');
45 45
 }
46
-if (! defined('NOCSRFCHECK')) {
46
+if (!defined('NOCSRFCHECK')) {
47 47
 	define('NOCSRFCHECK', '1');
48 48
 }
49
-if (! defined('NOTOKENRENEWAL')) {
49
+if (!defined('NOTOKENRENEWAL')) {
50 50
 	define('NOTOKENRENEWAL', '1');
51 51
 }
52
-if (! defined('NOREQUIREMENU')) {
52
+if (!defined('NOREQUIREMENU')) {
53 53
 	define('NOREQUIREMENU', '1'); // If there is no menu to show
54 54
 }
55
-if (! defined('NOREQUIREHTML')) {
55
+if (!defined('NOREQUIREHTML')) {
56 56
 	define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php
57 57
 }
58
-if (! defined('NOREQUIREAJAX')) {
58
+if (!defined('NOREQUIREAJAX')) {
59 59
 	define('NOREQUIREAJAX', '1');
60 60
 }
61
-if (! defined("NOLOGIN")) {
62
-	define("NOLOGIN", '1');       // If this page is public (can be called outside logged session)
61
+if (!defined("NOLOGIN")) {
62
+	define("NOLOGIN", '1'); // If this page is public (can be called outside logged session)
63 63
 }
64 64
 
65 65
 if (empty($user->id)) {
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
 	$user->fetch(1);
68 68
 	$user->getrights();
69 69
 }
70
-$conf->global->MAIN_DISABLE_ALL_MAILS=1;
70
+$conf->global->MAIN_DISABLE_ALL_MAILS = 1;
71 71
 
72 72
 
73 73
 /**
@@ -96,11 +96,11 @@  discard block
 block discarded – undo
96 96
 		parent::__construct($name);
97 97
 
98 98
 		//$this->sharedFixture
99
-		global $conf,$user,$langs,$db;
100
-		$this->savconf=$conf;
101
-		$this->savuser=$user;
102
-		$this->savlangs=$langs;
103
-		$this->savdb=$db;
99
+		global $conf, $user, $langs, $db;
100
+		$this->savconf = $conf;
101
+		$this->savuser = $user;
102
+		$this->savlangs = $langs;
103
+		$this->savdb = $db;
104 104
 
105 105
 		print __METHOD__." db->type=".$db->type." user->id=".$user->id;
106 106
 		//print " - db ".$db->db;
@@ -114,8 +114,8 @@  discard block
 block discarded – undo
114 114
 	 */
115 115
 	public static function setUpBeforeClass(): void
116 116
 	{
117
-		global $conf,$user,$langs,$db;
118
-		$db->begin();	// This is to have all actions inside a transaction even if test launched without suite.
117
+		global $conf, $user, $langs, $db;
118
+		$db->begin(); // This is to have all actions inside a transaction even if test launched without suite.
119 119
 
120 120
 		print __METHOD__."\n";
121 121
 	}
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
 	 */
128 128
 	public static function tearDownAfterClass(): void
129 129
 	{
130
-		global $conf,$user,$langs,$db;
130
+		global $conf, $user, $langs, $db;
131 131
 		$db->rollback();
132 132
 
133 133
 		print __METHOD__."\n";
@@ -140,11 +140,11 @@  discard block
 block discarded – undo
140 140
 	 */
141 141
 	protected function setUp(): void
142 142
 	{
143
-		global $conf,$user,$langs,$db;
144
-		$conf=$this->savconf;
145
-		$user=$this->savuser;
146
-		$langs=$this->savlangs;
147
-		$db=$this->savdb;
143
+		global $conf, $user, $langs, $db;
144
+		$conf = $this->savconf;
145
+		$user = $this->savuser;
146
+		$langs = $this->savlangs;
147
+		$db = $this->savdb;
148 148
 
149 149
 		print __METHOD__."\n";
150 150
 	}
@@ -166,47 +166,47 @@  discard block
 block discarded – undo
166 166
 	 */
167 167
 	public function testLang()
168 168
 	{
169
-		global $conf,$user,$langs,$db;
170
-		$conf=$this->savconf;
171
-		$user=$this->savuser;
172
-		$langs=$this->savlangs;
173
-		$db=$this->savdb;
169
+		global $conf, $user, $langs, $db;
170
+		$conf = $this->savconf;
171
+		$user = $this->savuser;
172
+		$langs = $this->savlangs;
173
+		$db = $this->savdb;
174 174
 
175 175
 		include_once DOL_DOCUMENT_ROOT.'/core/class/translate.class.php';
176 176
 
177 177
 		$filesarray = scandir(DOL_DOCUMENT_ROOT.'/langs');
178 178
 		foreach ($filesarray as $key => $code) {
179
-			if (! preg_match('/^[a-z]+_[A-Z]+$/', $code)) {
179
+			if (!preg_match('/^[a-z]+_[A-Z]+$/', $code)) {
180 180
 				continue;
181 181
 			}
182 182
 
183 183
 			print 'Check language file for lang code='.$code."\n";
184
-			$tmplangs=new Translate('', $conf);
185
-			$langcode=$code;
184
+			$tmplangs = new Translate('', $conf);
185
+			$langcode = $code;
186 186
 			$tmplangs->setDefaultLang($langcode);
187 187
 			$tmplangs->load("main");
188 188
 
189
-			$result=$tmplangs->transnoentitiesnoconv("FONTFORPDF");
189
+			$result = $tmplangs->transnoentitiesnoconv("FONTFORPDF");
190 190
 			print __METHOD__." FONTFORPDF=".$result."\n";
191 191
 			$this->assertTrue(in_array($result, array('msungstdlight', 'stsongstdlight', 'helvetica', 'DejaVuSans', 'cid0jp', 'cid0kr', 'freemono', 'freeserif')), 'Error bad value '.$result.' for FONTFORPDF in main.lang file '.$code);
192 192
 
193
-			$result=$tmplangs->transnoentitiesnoconv("DIRECTION");
193
+			$result = $tmplangs->transnoentitiesnoconv("DIRECTION");
194 194
 			print __METHOD__." DIRECTION=".$result."\n";
195 195
 			$this->assertTrue(in_array($result, array('rtl', 'ltr')), 'Error bad value for DIRECTION in main.lang file '.$code);
196 196
 
197
-			$result=$tmplangs->transnoentitiesnoconv("SeparatorDecimal");
197
+			$result = $tmplangs->transnoentitiesnoconv("SeparatorDecimal");
198 198
 			print __METHOD__." SeparatorDecimal=".$result."\n";
199
-			$this->assertTrue(in_array($result, array('.',',','/',' ','','None')), 'Error on decimal separator for lang code '.$code);	// Note that ، that is coma for RTL languages is not supported
199
+			$this->assertTrue(in_array($result, array('.', ',', '/', ' ', '', 'None')), 'Error on decimal separator for lang code '.$code); // Note that ، that is coma for RTL languages is not supported
200 200
 
201
-			$result=$tmplangs->transnoentitiesnoconv("SeparatorThousand");
201
+			$result = $tmplangs->transnoentitiesnoconv("SeparatorThousand");
202 202
 			print __METHOD__." SeparatorThousand=".$result."\n";
203
-			$this->assertTrue(in_array($result, array('.',',','/',' ','','\'','None','Space')), 'Error on thousand separator for lang code '.$code);	// Note that ، that is coma for RTL languages is not supported
203
+			$this->assertTrue(in_array($result, array('.', ',', '/', ' ', '', '\'', 'None', 'Space')), 'Error on thousand separator for lang code '.$code); // Note that ، that is coma for RTL languages is not supported
204 204
 
205 205
 			// Test java string contains only d,M,y,/,-,. and not m,...
206
-			$result=$tmplangs->transnoentitiesnoconv("FormatDateShortJava");
206
+			$result = $tmplangs->transnoentitiesnoconv("FormatDateShortJava");
207 207
 			print __METHOD__." FormatDateShortJava=".$result."\n";
208 208
 			$this->assertRegExp('/^[dMy\/\-\.]+$/', $result, 'FormatDateShortJava KO for lang code '.$code);
209
-			$result=$tmplangs->trans("FormatDateShortJavaInput");
209
+			$result = $tmplangs->trans("FormatDateShortJavaInput");
210 210
 			print __METHOD__." FormatDateShortJavaInput=".$result."\n";
211 211
 			$this->assertRegExp('/^[dMy\/\-\.]+$/', $result, 'FormatDateShortJavaInput KO for lang code '.$code);
212 212
 
@@ -215,26 +215,26 @@  discard block
 block discarded – undo
215 215
 			print "Check also some syntax rules into the language file\n";
216 216
 			$filesarray2 = scandir(DOL_DOCUMENT_ROOT.'/langs/'.$code);
217 217
 			foreach ($filesarray2 as $key => $file) {
218
-				if (! preg_match('/\.lang$/', $file)) {
218
+				if (!preg_match('/\.lang$/', $file)) {
219 219
 					continue;
220 220
 				}
221 221
 
222 222
 				//print 'Check lang file '.$file."\n";
223
-				$filecontent=file_get_contents(DOL_DOCUMENT_ROOT.'/langs/'.$code.'/'.$file);
223
+				$filecontent = file_get_contents(DOL_DOCUMENT_ROOT.'/langs/'.$code.'/'.$file);
224 224
 
225
-				$result=preg_match('/=--$/m', $filecontent);	// A special % char we don't want. We want the common one.
225
+				$result = preg_match('/=--$/m', $filecontent); // A special % char we don't want. We want the common one.
226 226
 				//print __METHOD__." Result for checking we don't have bad percent char = ".$result."\n";
227 227
 				$this->assertTrue($result == 0, 'Found a translation KEY=-- into file '.$code.'/'.$file.'. We probably want Key=- instead.');
228 228
 
229
-				$result=strpos($filecontent, '%');	// A special % char we don't want. We want the common one.
229
+				$result = strpos($filecontent, '%'); // A special % char we don't want. We want the common one.
230 230
 				//print __METHOD__." Result for checking we don't have bad percent char = ".$result."\n";
231 231
 				$this->assertTrue($result === false, 'Found a bad percent char % instead of % into file '.$code.'/'.$file);
232 232
 
233
-				$result=preg_match('/%n/m', $filecontent);	// A sequence of char we don't want
233
+				$result = preg_match('/%n/m', $filecontent); // A sequence of char we don't want
234 234
 				//print __METHOD__." Result for checking we don't have bad percent char = ".$result."\n";
235 235
 				$this->assertTrue($result == 0, 'Found a sequence %n into the translation file '.$code.'/'.$file.'. We probably want %s');
236 236
 
237
-				$result=preg_match('/<<<<</m', $filecontent);	// A sequence of char we don't want
237
+				$result = preg_match('/<<<<</m', $filecontent); // A sequence of char we don't want
238 238
 				//print __METHOD__." Result for checking we don't have bad percent char = ".$result."\n";
239 239
 				$this->assertTrue($result == 0, 'Found a sequence <<<<< into the translation file '.$code.'/'.$file.'. Probably a bad merge of code were done.');
240 240
 			}
@@ -250,14 +250,14 @@  discard block
 block discarded – undo
250 250
 	 */
251 251
 	public function testTrans()
252 252
 	{
253
-		global $conf,$user,$langs,$db;
254
-		$conf=$this->savconf;
255
-		$user=$this->savuser;
256
-		$langs=$this->savlangs;
257
-		$db=$this->savdb;
258
-
259
-		$tmplangs=new Translate('', $conf);
260
-		$langcode='en_US';
253
+		global $conf, $user, $langs, $db;
254
+		$conf = $this->savconf;
255
+		$user = $this->savuser;
256
+		$langs = $this->savlangs;
257
+		$db = $this->savdb;
258
+
259
+		$tmplangs = new Translate('', $conf);
260
+		$langcode = 'en_US';
261 261
 		$tmplangs->setDefaultLang($langcode);
262 262
 		$tmplangs->load("main");
263 263
 
Please login to merge, or discard this patch.
htdocs/projet/tasks/time.php 1 patch
Spacing   +167 added lines, -167 removed lines patch added patch discarded remove patch
@@ -30,14 +30,14 @@  discard block
 block discarded – undo
30 30
 
31 31
 // Load Dolibarr environment
32 32
 require '../../main.inc.php';
33
-require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
34
-require_once DOL_DOCUMENT_ROOT . '/projet/class/task.class.php';
35
-require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
36
-require_once DOL_DOCUMENT_ROOT . '/core/lib/project.lib.php';
37
-require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
38
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php';
39
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php';
40
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formintervention.class.php';
33
+require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
34
+require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php';
35
+require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
36
+require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
37
+require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
38
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
39
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
40
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formintervention.class.php';
41 41
 
42 42
 // Load translation files required by the page
43 43
 $langsLoad = array('projects', 'bills', 'orders', 'companies');
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
 	setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
165 165
 }
166 166
 
167
-include DOL_DOCUMENT_ROOT . '/core/actions_changeselectedfields.inc.php';
167
+include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
168 168
 
169 169
 // Purge search criteria
170 170
 if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers
@@ -354,10 +354,10 @@  discard block
 block discarded – undo
354 354
 }
355 355
 
356 356
 if ($action == 'confirm_deleteline' && $confirm == "yes" && ($user->hasRight('projet', 'time') || $user->hasRight('projet', 'all', 'creer'))) {
357
-	$object->fetchTimeSpent(GETPOST('lineid', 'int'));    // load properties like $object->timespent_xxx
357
+	$object->fetchTimeSpent(GETPOST('lineid', 'int')); // load properties like $object->timespent_xxx
358 358
 
359 359
 	if (in_array($object->timespent_fk_user, $childids) || $user->hasRight('projet', 'all', 'creer')) {
360
-		$result = $object->delTimeSpent($user);    // delete line with $object->timespent_id
360
+		$result = $object->delTimeSpent($user); // delete line with $object->timespent_id
361 361
 
362 362
 		if ($result < 0) {
363 363
 			$langs->load("errors");
@@ -377,7 +377,7 @@  discard block
 block discarded – undo
377 377
 		if (count($tasksarray) > 0) {
378 378
 			$id = $tasksarray[0]->id;
379 379
 		} else {
380
-			header("Location: " . DOL_URL_ROOT . '/projet/tasks.php?id=' . $projectstatic->id . ($withproject ? '&withproject=1' : '') . (empty($mode) ? '' : '&mode=' . $mode));
380
+			header("Location: ".DOL_URL_ROOT.'/projet/tasks.php?id='.$projectstatic->id.($withproject ? '&withproject=1' : '').(empty($mode) ? '' : '&mode='.$mode));
381 381
 			exit;
382 382
 		}
383 383
 	}
@@ -414,9 +414,9 @@  discard block
 block discarded – undo
414 414
 	if (!($projectstatic->thirdparty->id > 0)) {
415 415
 		setEventMessages($langs->trans("ThirdPartyRequiredToGenerateInvoice"), null, 'errors');
416 416
 	} else {
417
-		include_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
418
-		include_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
419
-		include_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
417
+		include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
418
+		include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
419
+		include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
420 420
 
421 421
 		$tmpinvoice = new Facture($db);
422 422
 		$tmptimespent = new Task($db);
@@ -481,7 +481,7 @@  discard block
 block discarded – undo
481 481
 				$arrayoftasks = array();
482 482
 				foreach ($toselect as $key => $value) {
483 483
 					// Get userid, timepent
484
-					$object->fetchTimeSpent($value);    // $value is ID of 1 line in timespent table
484
+					$object->fetchTimeSpent($value); // $value is ID of 1 line in timespent table
485 485
 					$arrayoftasks[$object->timespent_fk_user][(int) $object->timespent_fk_product]['timespent'] += $object->timespent_duration;
486 486
 					$arrayoftasks[$object->timespent_fk_user][(int) $object->timespent_fk_product]['totalvaluetodivideby3600'] += ($object->timespent_duration * $object->timespent_thm);
487 487
 				}
@@ -553,7 +553,7 @@  discard block
 block discarded – undo
553 553
 						}
554 554
 
555 555
 						// Add lines
556
-						$lineid = $tmpinvoice->addline($langs->trans("TimeSpentForInvoice", $username) . ' : ' . $qtyhourtext, $pu_htline, round($qtyhour / $prodDurationHours, 2), $txtvaline, $localtax1line, $localtax2line, ($idprodline > 0 ? $idprodline : 0));
556
+						$lineid = $tmpinvoice->addline($langs->trans("TimeSpentForInvoice", $username).' : '.$qtyhourtext, $pu_htline, round($qtyhour / $prodDurationHours, 2), $txtvaline, $localtax1line, $localtax2line, ($idprodline > 0 ? $idprodline : 0));
557 557
 						if ($lineid < 0) {
558 558
 							$error++;
559 559
 							setEventMessages(null, $tmpinvoice->errors, 'errors');
@@ -586,16 +586,16 @@  discard block
 block discarded – undo
586 586
 
587 587
 					$arrayoftasks[$object->timespent_id]['timespent'] = $object->timespent_duration;
588 588
 					$arrayoftasks[$object->timespent_id]['totalvaluetodivideby3600'] = $object->timespent_duration * $object->timespent_thm;
589
-					$arrayoftasks[$object->timespent_id]['note'] = $ftask->ref . ' - ' . $ftask->label . ' - ' . $username;
589
+					$arrayoftasks[$object->timespent_id]['note'] = $ftask->ref.' - '.$ftask->label.' - '.$username;
590 590
 					$arrayoftasks[$object->timespent_id]['note'] = dol_concatdesc($arrayoftasks[$object->timespent_id]['note'], $object->timespent_note);
591 591
 
592 592
 					if (!empty($withdetail)) {
593 593
 						if (!empty($object->timespent_withhour)) {
594
-							$arrayoftasks[$object->timespent_id]['note'] = dol_concatdesc($arrayoftasks[$object->timespent_id]['note'], $langs->trans("Date") . ': ' . dol_print_date($object->timespent_datehour));
594
+							$arrayoftasks[$object->timespent_id]['note'] = dol_concatdesc($arrayoftasks[$object->timespent_id]['note'], $langs->trans("Date").': '.dol_print_date($object->timespent_datehour));
595 595
 						} else {
596
-							$arrayoftasks[$object->timespent_id]['note'] = dol_concatdesc($arrayoftasks[$object->timespent_id]['note'], $langs->trans("Date") . ': ' . dol_print_date($object->timespent_date));
596
+							$arrayoftasks[$object->timespent_id]['note'] = dol_concatdesc($arrayoftasks[$object->timespent_id]['note'], $langs->trans("Date").': '.dol_print_date($object->timespent_date));
597 597
 						}
598
-						$arrayoftasks[$object->timespent_id]['note'] = dol_concatdesc($arrayoftasks[$object->timespent_id]['note'], $langs->trans("Duration") . ': ' . convertSecondToTime($object->timespent_duration, 'all', $conf->global->MAIN_DURATION_OF_WORKDAY));
598
+						$arrayoftasks[$object->timespent_id]['note'] = dol_concatdesc($arrayoftasks[$object->timespent_id]['note'], $langs->trans("Duration").': '.convertSecondToTime($object->timespent_duration, 'all', $conf->global->MAIN_DURATION_OF_WORKDAY));
599 599
 					}
600 600
 					$arrayoftasks[$object->timespent_id]['user'] = $object->timespent_fk_user;
601 601
 					$arrayoftasks[$object->timespent_id]['fk_product'] = $object->timespent_fk_product;
@@ -673,7 +673,7 @@  discard block
 block discarded – undo
673 673
 				$arrayoftasks = array();
674 674
 				foreach ($toselect as $key => $value) {
675 675
 					// Get userid, timepent
676
-					$object->fetchTimeSpent($value);        // Call method to get list of timespent for a timespent line id (We use the utiliy method found into Task object)
676
+					$object->fetchTimeSpent($value); // Call method to get list of timespent for a timespent line id (We use the utiliy method found into Task object)
677 677
 					// $object->id is now the task id
678 678
 					$arrayoftasks[$object->id][(int) $object->timespent_fk_product]['timespent'] += $object->timespent_duration;
679 679
 					$arrayoftasks[$object->id][(int) $object->timespent_fk_product]['totalvaluetodivideby3600'] += ($object->timespent_duration * $object->timespent_thm);
@@ -749,7 +749,7 @@  discard block
 block discarded – undo
749 749
 						// Add lines
750 750
 						$date_start = '';
751 751
 						$date_end = '';
752
-						$lineName = $ftask->ref . ' - ' . $ftask->label;
752
+						$lineName = $ftask->ref.' - '.$ftask->label;
753 753
 						$lineid = $tmpinvoice->addline($lineName, $pu_ht_for_task, price2num($qtyhour / $prodDurationHours, 'MS'), $txtvaline, $localtax1line, $localtax2line, ($idprodline > 0 ? $idprodline : 0), 0, $date_start, $date_end, 0, 0, '', 'HT', 0, 1, -1, 0, '', 0, 0, null, $pa_ht);
754 754
 						if ($lineid < 0) {
755 755
 							$error++;
@@ -759,8 +759,8 @@  discard block
 block discarded – undo
759 759
 
760 760
 						if (!$error) {
761 761
 							// Update lineid into line of timespent
762
-							$sql = 'UPDATE ' . MAIN_DB_PREFIX . 'element_time SET invoice_line_id = ' . ((int) $lineid) . ', invoice_id = ' . ((int) $tmpinvoice->id);
763
-							$sql .= ' WHERE rowid IN (' . $db->sanitize(join(',', $toselect)) . ')';
762
+							$sql = 'UPDATE '.MAIN_DB_PREFIX.'element_time SET invoice_line_id = '.((int) $lineid).', invoice_id = '.((int) $tmpinvoice->id);
763
+							$sql .= ' WHERE rowid IN ('.$db->sanitize(join(',', $toselect)).')';
764 764
 							$result = $db->query($sql);
765 765
 							if (!$result) {
766 766
 								$error++;
@@ -796,12 +796,12 @@  discard block
 block discarded – undo
796 796
 	if (!($projectstatic->thirdparty->id > 0)) {
797 797
 		setEventMessages($langs->trans("ThirdPartyRequiredToGenerateIntervention"), null, 'errors');
798 798
 	} else {
799
-		include_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
800
-		include_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
801
-		include_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
799
+		include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
800
+		include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
801
+		include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
802 802
 
803 803
 
804
-		require_once DOL_DOCUMENT_ROOT . '/fichinter/class/fichinter.class.php';
804
+		require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php';
805 805
 		$tmpinter = new Fichinter($db);
806 806
 		$tmptimespent = new Task($db);
807 807
 		$fuser = new User($db);
@@ -813,7 +813,7 @@  discard block
 block discarded – undo
813 813
 		$tmpinter->socid = $projectstatic->thirdparty->id;
814 814
 		$tmpinter->date = dol_mktime(GETPOST('rehour', 'int'), GETPOST('remin', 'int'), GETPOST('resec', 'int'), GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int'));
815 815
 		$tmpinter->fk_project = $projectstatic->id;
816
-		$tmpinter->description = $projectstatic->title . (!empty($projectstatic->description) ? '-' . $projectstatic->label : '');
816
+		$tmpinter->description = $projectstatic->title.(!empty($projectstatic->description) ? '-'.$projectstatic->label : '');
817 817
 
818 818
 		if ($interToUse) {
819 819
 			$tmpinter->fetch($interToUse);
@@ -846,7 +846,7 @@  discard block
 block discarded – undo
846 846
 				$qtyhourtext = convertSecondToTime($value['timespent'], 'all', $conf->global->MAIN_DURATION_OF_WORKDAY);
847 847
 
848 848
 				// Add lines
849
-				$lineid = $tmpinter->addline($user, $tmpinter->id, $ftask->label . (!empty($value['note']) ? ' - ' . $value['note'] : ''), $value['date'], $value['timespent']);
849
+				$lineid = $tmpinter->addline($user, $tmpinter->id, $ftask->label.(!empty($value['note']) ? ' - '.$value['note'] : ''), $value['date'], $value['timespent']);
850 850
 			}
851 851
 		}
852 852
 
@@ -877,9 +877,9 @@  discard block
 block discarded – undo
877 877
 //$result = $projectstatic->fetch($object->fk_project);
878 878
 $arrayofselected = is_array($toselect) ? $toselect : array();
879 879
 
880
-$title = $object->ref . ' - ' . $langs->trans("TimeSpent");
880
+$title = $object->ref.' - '.$langs->trans("TimeSpent");
881 881
 if (!empty($withproject)) {
882
-	$title .= ' | ' . $langs->trans("Project") . (!empty($projectstatic->ref) ? ': ' . $projectstatic->ref : '');
882
+	$title .= ' | '.$langs->trans("Project").(!empty($projectstatic->ref) ? ': '.$projectstatic->ref : '');
883 883
 }
884 884
 $help_url = '';
885 885
 
@@ -928,13 +928,13 @@  discard block
 block discarded – undo
928 928
 
929 929
 			$param = ((!empty($mode) && $mode == 'mine') ? '&mode=mine' : '');
930 930
 			if ($search_user) {
931
-				$param .= '&search_user=' . ((int) $search_user);
931
+				$param .= '&search_user='.((int) $search_user);
932 932
 			}
933 933
 			if ($search_month) {
934
-				$param .= '&search_month=' . ((int) $search_month);
934
+				$param .= '&search_month='.((int) $search_month);
935 935
 			}
936 936
 			if ($search_year) {
937
-				$param .= '&search_year=' . ((int) $search_year);
937
+				$param .= '&search_year='.((int) $search_year);
938 938
 			}
939 939
 
940 940
 			// Project card
@@ -946,14 +946,14 @@  discard block
 block discarded – undo
946 946
 			$morehtmlref .= $projectstatic->title;
947 947
 			// Thirdparty
948 948
 			if (!empty($projectstatic->thirdparty->id) && $projectstatic->thirdparty->id > 0) {
949
-				$morehtmlref .= '<br>' . $projectstatic->thirdparty->getNomUrl(1, 'project');
949
+				$morehtmlref .= '<br>'.$projectstatic->thirdparty->getNomUrl(1, 'project');
950 950
 			}
951 951
 			$morehtmlref .= '</div>';
952 952
 
953 953
 			// Define a complementary filter for search of next/prev ref.
954 954
 			if (empty($user->rights->projet->all->lire)) {
955 955
 				$objectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 0);
956
-				$projectstatic->next_prev_filter = " rowid IN (" . $db->sanitize(count($objectsListId) ? join(',', array_keys($objectsListId)) : '0') . ")";
956
+				$projectstatic->next_prev_filter = " rowid IN (".$db->sanitize(count($objectsListId) ? join(',', array_keys($objectsListId)) : '0').")";
957 957
 			}
958 958
 
959 959
 			dol_banner_tab($projectstatic, 'project_ref', $linkback, 1, 'ref', 'ref', $morehtmlref, $param);
@@ -971,25 +971,25 @@  discard block
 block discarded – undo
971 971
 				print '</td>';
972 972
 				print '<td>';
973 973
 				if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) {
974
-					print '<input type="checkbox" disabled name="usage_opportunity"' . (GETPOSTISSET('usage_opportunity') ? (GETPOST('usage_opportunity', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_opportunity ? ' checked="checked"' : '')) . '"> ';
974
+					print '<input type="checkbox" disabled name="usage_opportunity"'.(GETPOSTISSET('usage_opportunity') ? (GETPOST('usage_opportunity', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_opportunity ? ' checked="checked"' : '')).'"> ';
975 975
 					$htmltext = $langs->trans("ProjectFollowOpportunity");
976 976
 					print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext);
977 977
 					print '<br>';
978 978
 				}
979 979
 				if (empty($conf->global->PROJECT_HIDE_TASKS)) {
980
-					print '<input type="checkbox" disabled name="usage_task"' . (GETPOSTISSET('usage_task') ? (GETPOST('usage_task', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_task ? ' checked="checked"' : '')) . '"> ';
980
+					print '<input type="checkbox" disabled name="usage_task"'.(GETPOSTISSET('usage_task') ? (GETPOST('usage_task', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_task ? ' checked="checked"' : '')).'"> ';
981 981
 					$htmltext = $langs->trans("ProjectFollowTasks");
982 982
 					print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext);
983 983
 					print '<br>';
984 984
 				}
985 985
 				if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_BILL_TIME_SPENT)) {
986
-					print '<input type="checkbox" disabled name="usage_bill_time"' . (GETPOSTISSET('usage_bill_time') ? (GETPOST('usage_bill_time', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_bill_time ? ' checked="checked"' : '')) . '"> ';
986
+					print '<input type="checkbox" disabled name="usage_bill_time"'.(GETPOSTISSET('usage_bill_time') ? (GETPOST('usage_bill_time', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_bill_time ? ' checked="checked"' : '')).'"> ';
987 987
 					$htmltext = $langs->trans("ProjectBillTimeDescription");
988 988
 					print $form->textwithpicto($langs->trans("BillTime"), $htmltext);
989 989
 					print '<br>';
990 990
 				}
991 991
 				if (isModEnabled('eventorganization')) {
992
-					print '<input type="checkbox" disabled name="usage_organize_event"' . (GETPOSTISSET('usage_organize_event') ? (GETPOST('usage_organize_event', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_organize_event ? ' checked="checked"' : '')) . '"> ';
992
+					print '<input type="checkbox" disabled name="usage_organize_event"'.(GETPOSTISSET('usage_organize_event') ? (GETPOST('usage_organize_event', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_organize_event ? ' checked="checked"' : '')).'"> ';
993 993
 					$htmltext = $langs->trans("EventOrganizationDescriptionLong");
994 994
 					print $form->textwithpicto($langs->trans("ManageOrganizeEvent"), $htmltext);
995 995
 				}
@@ -997,7 +997,7 @@  discard block
 block discarded – undo
997 997
 			}
998 998
 
999 999
 			// Visibility
1000
-			print '<tr><td class="titlefield">' . $langs->trans("Visibility") . '</td><td>';
1000
+			print '<tr><td class="titlefield">'.$langs->trans("Visibility").'</td><td>';
1001 1001
 			if ($projectstatic->public) {
1002 1002
 				print img_picto($langs->trans('SharedProject'), 'world', 'class="paddingrightonly"');
1003 1003
 				print $langs->trans('SharedProject');
@@ -1008,14 +1008,14 @@  discard block
 block discarded – undo
1008 1008
 			print '</td></tr>';
1009 1009
 
1010 1010
 			// Budget
1011
-			print '<tr><td>' . $langs->trans("Budget") . '</td><td>';
1011
+			print '<tr><td>'.$langs->trans("Budget").'</td><td>';
1012 1012
 			if (!is_null($projectstatic->budget_amount) && strcmp($projectstatic->budget_amount, '')) {
1013
-				print '<span class="amount">' . price($projectstatic->budget_amount, '', $langs, 1, 0, 0, $conf->currency) . '</span>';
1013
+				print '<span class="amount">'.price($projectstatic->budget_amount, '', $langs, 1, 0, 0, $conf->currency).'</span>';
1014 1014
 			}
1015 1015
 			print '</td></tr>';
1016 1016
 
1017 1017
 			// Date start - end project
1018
-			print '<tr><td>' . $langs->trans("Dates") . '</td><td>';
1018
+			print '<tr><td>'.$langs->trans("Dates").'</td><td>';
1019 1019
 			$start = dol_print_date($projectstatic->date_start, 'day');
1020 1020
 			print ($start ? $start : '?');
1021 1021
 			$end = dol_print_date($projectstatic->date_end, 'day');
@@ -1030,7 +1030,7 @@  discard block
 block discarded – undo
1030 1030
 			$cols = 2;
1031 1031
 			$savobject = $object;
1032 1032
 			$object = $projectstatic;
1033
-			include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
1033
+			include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
1034 1034
 			$object = $savobject;
1035 1035
 
1036 1036
 			print '</table>';
@@ -1048,7 +1048,7 @@  discard block
 block discarded – undo
1048 1048
 
1049 1049
 			// Categories
1050 1050
 			if (isModEnabled('categorie')) {
1051
-				print '<tr><td class="valignmiddle">' . $langs->trans("Categories") . '</td><td>';
1051
+				print '<tr><td class="valignmiddle">'.$langs->trans("Categories").'</td><td>';
1052 1052
 				print $form->showCategories($projectstatic->id, 'project', 1);
1053 1053
 				print "</td></tr>";
1054 1054
 			}
@@ -1077,12 +1077,12 @@  discard block
 block discarded – undo
1077 1077
 
1078 1078
 				if (!empty($projectidforalltimes)) {
1079 1079
 					// We are on tab 'Time Spent' of project
1080
-					$backtourl = $_SERVER['PHP_SELF'] . '?projectid=' . $projectstatic->id . ($withproject ? '&withproject=1' : '');
1081
-					$linktocreatetimeUrl = $_SERVER['PHP_SELF'] . '?' . ($withproject ? 'withproject=1' : '') . '&projectid=' . $projectstatic->id . '&action=createtime&token=' . newToken() . $param . '&backtopage=' . urlencode($backtourl);
1080
+					$backtourl = $_SERVER['PHP_SELF'].'?projectid='.$projectstatic->id.($withproject ? '&withproject=1' : '');
1081
+					$linktocreatetimeUrl = $_SERVER['PHP_SELF'].'?'.($withproject ? 'withproject=1' : '').'&projectid='.$projectstatic->id.'&action=createtime&token='.newToken().$param.'&backtopage='.urlencode($backtourl);
1082 1082
 				} else {
1083 1083
 					// We are on tab 'Time Spent' of task
1084
-					$backtourl = $_SERVER['PHP_SELF'] . '?id=' . $object->id . ($withproject ? '&withproject=1' : '');
1085
-					$linktocreatetimeUrl = $_SERVER['PHP_SELF'] . '?' . ($withproject ? 'withproject=1' : '') . ($object->id > 0 ? '&id=' . $object->id : '&projectid=' . $projectstatic->id) . '&action=createtime&token=' . newToken() . $param . '&backtopage=' . urlencode($backtourl);
1084
+					$backtourl = $_SERVER['PHP_SELF'].'?id='.$object->id.($withproject ? '&withproject=1' : '');
1085
+					$linktocreatetimeUrl = $_SERVER['PHP_SELF'].'?'.($withproject ? 'withproject=1' : '').($object->id > 0 ? '&id='.$object->id : '&projectid='.$projectstatic->id).'&action=createtime&token='.newToken().$param.'&backtopage='.urlencode($backtourl);
1086 1086
 				}
1087 1087
 			} else {
1088 1088
 				$linktocreatetimeBtnStatus = -2;
@@ -1127,19 +1127,19 @@  discard block
 block discarded – undo
1127 1127
 		print dol_get_fiche_head($head, 'task_time', $langs->trans("Task"), -1, 'projecttask', 0, '', 'reposition');
1128 1128
 
1129 1129
 		if ($action == 'deleteline') {
1130
-			$urlafterconfirm = $_SERVER["PHP_SELF"] . "?" . ($object->id > 0 ? "id=" . $object->id : 'projectid=' . $projectstatic->id) . '&lineid=' . GETPOST("lineid", 'int') . ($withproject ? '&withproject=1' : '');
1130
+			$urlafterconfirm = $_SERVER["PHP_SELF"]."?".($object->id > 0 ? "id=".$object->id : 'projectid='.$projectstatic->id).'&lineid='.GETPOST("lineid", 'int').($withproject ? '&withproject=1' : '');
1131 1131
 			print $form->formconfirm($urlafterconfirm, $langs->trans("DeleteATimeSpent"), $langs->trans("ConfirmDeleteATimeSpent"), "confirm_deleteline", '', '', 1);
1132 1132
 		}
1133 1133
 
1134 1134
 		$param = ($withproject ? '&withproject=1' : '');
1135
-		$param .= ($param ? '&' : '') . 'id=' . $object->id;        // ID of task
1136
-		$linkback = $withproject ? '<a href="' . DOL_URL_ROOT . '/projet/tasks.php?id=' . $projectstatic->id . '">' . $langs->trans("BackToList") . '</a>' : '';
1135
+		$param .= ($param ? '&' : '').'id='.$object->id; // ID of task
1136
+		$linkback = $withproject ? '<a href="'.DOL_URL_ROOT.'/projet/tasks.php?id='.$projectstatic->id.'">'.$langs->trans("BackToList").'</a>' : '';
1137 1137
 
1138 1138
 		if (!GETPOST('withproject') || empty($projectstatic->id)) {
1139 1139
 			$projectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 1);
1140
-			$object->next_prev_filter = " fk_projet IN (" . $db->sanitize($projectsListId) . ")";
1140
+			$object->next_prev_filter = " fk_projet IN (".$db->sanitize($projectsListId).")";
1141 1141
 		} else {
1142
-			$object->next_prev_filter = " fk_projet = " . ((int) $projectstatic->id);
1142
+			$object->next_prev_filter = " fk_projet = ".((int) $projectstatic->id);
1143 1143
 		}
1144 1144
 
1145 1145
 		$morehtmlref = '';
@@ -1147,12 +1147,12 @@  discard block
 block discarded – undo
1147 1147
 		// Project
1148 1148
 		if (empty($withproject)) {
1149 1149
 			$morehtmlref .= '<div class="refidno">';
1150
-			$morehtmlref .= $langs->trans("Project") . ': ';
1150
+			$morehtmlref .= $langs->trans("Project").': ';
1151 1151
 			$morehtmlref .= $projectstatic->getNomUrl(1);
1152 1152
 			$morehtmlref .= '<br>';
1153 1153
 
1154 1154
 			// Third party
1155
-			$morehtmlref .= $langs->trans("ThirdParty") . ': ';
1155
+			$morehtmlref .= $langs->trans("ThirdParty").': ';
1156 1156
 			if (!empty($projectstatic->thirdparty) && is_object($projectstatic->thirdparty)) {
1157 1157
 				$morehtmlref .= $projectstatic->thirdparty->getNomUrl(1);
1158 1158
 			}
@@ -1168,7 +1168,7 @@  discard block
 block discarded – undo
1168 1168
 		print '<table class="border centpercent tableforfield">';
1169 1169
 
1170 1170
 		// Task parent
1171
-		print '<tr><td>' . $langs->trans("ChildOfTask") . '</td><td>';
1171
+		print '<tr><td>'.$langs->trans("ChildOfTask").'</td><td>';
1172 1172
 		if ($object->fk_task_parent > 0) {
1173 1173
 			$tasktmp = new Task($db);
1174 1174
 			$tasktmp->fetch($object->fk_task_parent);
@@ -1177,7 +1177,7 @@  discard block
 block discarded – undo
1177 1177
 		print '</td></tr>';
1178 1178
 
1179 1179
 		// Date start - Date end task
1180
-		print '<tr><td class="titlefield">' . $langs->trans("DateStart") . ' - ' . $langs->trans("Deadline") . '</td><td>';
1180
+		print '<tr><td class="titlefield">'.$langs->trans("DateStart").' - '.$langs->trans("Deadline").'</td><td>';
1181 1181
 		$start = dol_print_date($object->date_start, 'dayhour');
1182 1182
 		print ($start ? $start : '?');
1183 1183
 		$end = dol_print_date($object->date_end, 'dayhour');
@@ -1189,7 +1189,7 @@  discard block
 block discarded – undo
1189 1189
 		print '</td></tr>';
1190 1190
 
1191 1191
 		// Planned workload
1192
-		print '<tr><td>' . $langs->trans("PlannedWorkload") . '</td><td>';
1192
+		print '<tr><td>'.$langs->trans("PlannedWorkload").'</td><td>';
1193 1193
 		if ($object->planned_workload) {
1194 1194
 			print convertSecondToTime($object->planned_workload, 'allhourmin');
1195 1195
 		}
@@ -1204,21 +1204,21 @@  discard block
 block discarded – undo
1204 1204
 		print '<table class="border tableforfield centpercent">';
1205 1205
 
1206 1206
 		// Progress declared
1207
-		print '<tr><td class="titlefield">' . $langs->trans("ProgressDeclared") . '</td><td>';
1208
-		print $object->progress != '' ? $object->progress . ' %' : '';
1207
+		print '<tr><td class="titlefield">'.$langs->trans("ProgressDeclared").'</td><td>';
1208
+		print $object->progress != '' ? $object->progress.' %' : '';
1209 1209
 		print '</td></tr>';
1210 1210
 
1211 1211
 		// Progress calculated
1212
-		print '<tr><td>' . $langs->trans("ProgressCalculated") . '</td><td>';
1212
+		print '<tr><td>'.$langs->trans("ProgressCalculated").'</td><td>';
1213 1213
 		if ($object->planned_workload) {
1214 1214
 			$tmparray = $object->getSummaryOfTimeSpent();
1215 1215
 			if ($tmparray['total_duration'] > 0) {
1216
-				print round($tmparray['total_duration'] / $object->planned_workload * 100, 2) . ' %';
1216
+				print round($tmparray['total_duration'] / $object->planned_workload * 100, 2).' %';
1217 1217
 			} else {
1218 1218
 				print '0 %';
1219 1219
 			}
1220 1220
 		} else {
1221
-			print '<span class="opacitymedium">' . $langs->trans("WorkloadNotDefined") . '</span>';
1221
+			print '<span class="opacitymedium">'.$langs->trans("WorkloadNotDefined").'</span>';
1222 1222
 		}
1223 1223
 		print '</td>';
1224 1224
 
@@ -1243,7 +1243,7 @@  discard block
 block discarded – undo
1243 1243
 
1244 1244
 		if ($action == 'deleteline' && !empty($projectidforalltimes)) {
1245 1245
 			// We must use projectidprojectid if on list of timespent of project and id=taskid if on list of timespent of a task
1246
-			$urlafterconfirm = $_SERVER["PHP_SELF"] . "?" . ($projectstatic->id > 0 ? 'projectid=' . $projectstatic->id : ($object->id > 0 ? "id=" . $object->id : '')) . '&lineid=' . GETPOST('lineid', 'int') . ($withproject ? '&withproject=1' : '') . "&contextpage=" . urlencode($contextpage);
1246
+			$urlafterconfirm = $_SERVER["PHP_SELF"]."?".($projectstatic->id > 0 ? 'projectid='.$projectstatic->id : ($object->id > 0 ? "id=".$object->id : '')).'&lineid='.GETPOST('lineid', 'int').($withproject ? '&withproject=1' : '')."&contextpage=".urlencode($contextpage);
1247 1247
 			$formconfirm = $form->formconfirm($urlafterconfirm, $langs->trans("DeleteATimeSpent"), $langs->trans("ConfirmDeleteATimeSpent"), "confirm_deleteline", '', '', 1);
1248 1248
 		}
1249 1249
 
@@ -1262,10 +1262,10 @@  discard block
 block discarded – undo
1262 1262
 		// Definition of fields for list
1263 1263
 		$arrayfields = array();
1264 1264
 		$arrayfields['t.element_date'] = array('label'=>$langs->trans("Date"), 'checked'=>1);
1265
-		$arrayfields['p.fk_soc'] = array('label'=>$langs->trans("ThirdParty"), 'type'=>'integer:Societe:/societe/class/societe.class.php:1','checked'=>1);
1265
+		$arrayfields['p.fk_soc'] = array('label'=>$langs->trans("ThirdParty"), 'type'=>'integer:Societe:/societe/class/societe.class.php:1', 'checked'=>1);
1266 1266
 		$arrayfields['s.name_alias'] = array('label'=>$langs->trans("AliasNameShort"), 'type'=>'integer:Societe:/societe/class/societe.class.php:1');
1267 1267
 		if ((empty($id) && empty($ref)) || !empty($projectidforalltimes)) {	// Not a dedicated task
1268
-			if (! empty($allprojectforuser)) {
1268
+			if (!empty($allprojectforuser)) {
1269 1269
 				$arrayfields['p.project_ref'] = ['label' => $langs->trans('RefProject'), 'checked' => 1];
1270 1270
 				$arrayfields['p.project_label'] = ['label' => $langs->trans('ProjectLabel'), 'checked' => 1];
1271 1271
 			}
@@ -1281,82 +1281,82 @@  discard block
 block discarded – undo
1281 1281
 		$arrayfields['value'] = array('label'=>$langs->trans("Value"), 'checked'=>1, 'enabled'=>(empty($conf->salaries->enabled) ? 0 : 1));
1282 1282
 		$arrayfields['valuebilled'] = array('label'=>$langs->trans("Billed"), 'checked'=>1, 'enabled'=>(((!empty($conf->global->PROJECT_HIDE_TASKS) || empty($conf->global->PROJECT_BILL_TIME_SPENT)) ? 0 : 1) && $projectstatic->usage_bill_time));
1283 1283
 		// Extra fields
1284
-		include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_array_fields.tpl.php';
1284
+		include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
1285 1285
 
1286 1286
 		$arrayfields = dol_sort_array($arrayfields, 'position');
1287 1287
 
1288 1288
 		$param = '';
1289 1289
 		if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
1290
-			$param .= '&contextpage=' . urlencode($contextpage);
1290
+			$param .= '&contextpage='.urlencode($contextpage);
1291 1291
 		}
1292 1292
 		if ($limit > 0 && $limit != $conf->liste_limit) {
1293 1293
 			$param .= '&limit='.((int) $limit);
1294 1294
 		}
1295 1295
 		if ($search_month > 0) {
1296
-			$param .= '&search_month=' . urlencode($search_month);
1296
+			$param .= '&search_month='.urlencode($search_month);
1297 1297
 		}
1298 1298
 		if ($search_year > 0) {
1299
-			$param .= '&search_year=' . urlencode($search_year);
1299
+			$param .= '&search_year='.urlencode($search_year);
1300 1300
 		}
1301 1301
 		if (!empty($search_user)) { 	// We keep param if -1 because default value is forced to user id if not set
1302 1302
 			$param .= '&search_user='.urlencode($search_user);
1303 1303
 		}
1304 1304
 		if ($search_task_ref != '') {
1305
-			$param .= '&search_task_ref=' . urlencode($search_task_ref);
1305
+			$param .= '&search_task_ref='.urlencode($search_task_ref);
1306 1306
 		}
1307 1307
 		if ($search_company != '') {
1308
-			$param .= '&amp;$search_company=' . urlencode($search_company);
1308
+			$param .= '&amp;$search_company='.urlencode($search_company);
1309 1309
 		}
1310 1310
 		if ($search_company_alias != '') {
1311
-			$param .= '&amp;$search_company_alias=' . urlencode($search_company_alias);
1311
+			$param .= '&amp;$search_company_alias='.urlencode($search_company_alias);
1312 1312
 		}
1313 1313
 		if ($search_project_ref != '') {
1314
-			$param .= '&amp;$search_project_ref=' . urlencode($search_project_ref);
1314
+			$param .= '&amp;$search_project_ref='.urlencode($search_project_ref);
1315 1315
 		}
1316 1316
 		if ($search_project_label != '') {
1317
-			$param .= '&amp;$search_project_label=' . urlencode($search_project_label);
1317
+			$param .= '&amp;$search_project_label='.urlencode($search_project_label);
1318 1318
 		}
1319 1319
 		if ($search_task_label != '') {
1320
-			$param .= '&search_task_label=' . urlencode($search_task_label);
1320
+			$param .= '&search_task_label='.urlencode($search_task_label);
1321 1321
 		}
1322 1322
 		if ($search_note != '') {
1323
-			$param .= '&search_note=' . urlencode($search_note);
1323
+			$param .= '&search_note='.urlencode($search_note);
1324 1324
 		}
1325 1325
 		if ($search_duration != '') {
1326
-			$param .= '&amp;search_field2=' . urlencode($search_duration);
1326
+			$param .= '&amp;search_field2='.urlencode($search_duration);
1327 1327
 		}
1328 1328
 		if ($optioncss != '') {
1329
-			$param .= '&optioncss=' . urlencode($optioncss);
1329
+			$param .= '&optioncss='.urlencode($optioncss);
1330 1330
 		}
1331 1331
 		if ($search_date_startday) {
1332
-			$param .= '&search_date_startday=' . urlencode($search_date_startday);
1332
+			$param .= '&search_date_startday='.urlencode($search_date_startday);
1333 1333
 		}
1334 1334
 		if ($search_date_startmonth) {
1335
-			$param .= '&search_date_startmonth=' . urlencode($search_date_startmonth);
1335
+			$param .= '&search_date_startmonth='.urlencode($search_date_startmonth);
1336 1336
 		}
1337 1337
 		if ($search_date_startyear) {
1338
-			$param .= '&search_date_startyear=' . urlencode($search_date_startyear);
1338
+			$param .= '&search_date_startyear='.urlencode($search_date_startyear);
1339 1339
 		}
1340 1340
 		if ($search_date_endday) {
1341
-			$param .= '&search_date_endday=' . urlencode($search_date_endday);
1341
+			$param .= '&search_date_endday='.urlencode($search_date_endday);
1342 1342
 		}
1343 1343
 		if ($search_date_endmonth) {
1344
-			$param .= '&search_date_endmonth=' . urlencode($search_date_endmonth);
1344
+			$param .= '&search_date_endmonth='.urlencode($search_date_endmonth);
1345 1345
 		}
1346 1346
 		if ($search_date_endyear) {
1347
-			$param .= '&search_date_endyear=' . urlencode($search_date_endyear);
1347
+			$param .= '&search_date_endyear='.urlencode($search_date_endyear);
1348 1348
 		}
1349 1349
 		if ($search_timespent_starthour) {
1350
-			$param .= '&search_timespent_duration_starthour=' . urlencode($search_timespent_starthour);
1350
+			$param .= '&search_timespent_duration_starthour='.urlencode($search_timespent_starthour);
1351 1351
 		}
1352 1352
 		if ($search_timespent_startmin) {
1353
-			$param .= '&search_timespent_duration_startmin=' . urlencode($search_timespent_startmin);
1353
+			$param .= '&search_timespent_duration_startmin='.urlencode($search_timespent_startmin);
1354 1354
 		}
1355 1355
 		if ($search_timespent_endhour) {
1356
-			$param .= '&search_timespent_duration_endhour=' . urlencode($search_timespent_endhour);
1356
+			$param .= '&search_timespent_duration_endhour='.urlencode($search_timespent_endhour);
1357 1357
 		}
1358 1358
 		if ($search_timespent_endmin) {
1359
-			$param .= '&search_timespent_duration_endmin=' . urlencode($search_timespent_endmin);
1359
+			$param .= '&search_timespent_duration_endmin='.urlencode($search_timespent_endmin);
1360 1360
 		}
1361 1361
 
1362 1362
 		/*
@@ -1364,24 +1364,24 @@  discard block
 block discarded – undo
1364 1364
 		 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
1365 1365
 		 */
1366 1366
 		if ($id) {
1367
-			$param .= '&id=' . urlencode($id);
1367
+			$param .= '&id='.urlencode($id);
1368 1368
 		}
1369 1369
 		if ($projectid) {
1370
-			$param .= '&projectid=' . urlencode($projectid);
1370
+			$param .= '&projectid='.urlencode($projectid);
1371 1371
 		}
1372 1372
 		if ($withproject) {
1373
-			$param .= '&withproject=' . urlencode($withproject);
1373
+			$param .= '&withproject='.urlencode($withproject);
1374 1374
 		}
1375 1375
 		// Add $param from hooks
1376 1376
 		$parameters = array();
1377 1377
 		$reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object); // Note that $action and $object may have been modified by hook
1378 1378
 		$param .= $hookmanager->resPrint;
1379 1379
 
1380
-		print '<form method="POST" action="' . $_SERVER["PHP_SELF"] . '">';
1380
+		print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
1381 1381
 		if ($optioncss != '') {
1382
-			print '<input type="hidden" name="optioncss" value="' . $optioncss . '">';
1382
+			print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
1383 1383
 		}
1384
-		print '<input type="hidden" name="token" value="' . newToken() . '">';
1384
+		print '<input type="hidden" name="token" value="'.newToken().'">';
1385 1385
 		print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
1386 1386
 		if ($action == 'editline') {
1387 1387
 			print '<input type="hidden" name="action" value="updateline">';
@@ -1396,13 +1396,13 @@  discard block
 block discarded – undo
1396 1396
 		} else {
1397 1397
 			print '<input type="hidden" name="action" value="list">';
1398 1398
 		}
1399
-		print '<input type="hidden" name="sortfield" value="' . $sortfield . '">';
1400
-		print '<input type="hidden" name="sortorder" value="' . $sortorder . '">';
1399
+		print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
1400
+		print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
1401 1401
 
1402
-		print '<input type="hidden" name="id" value="' . $id . '">';
1403
-		print '<input type="hidden" name="projectid" value="' . $projectidforalltimes . '">';
1404
-		print '<input type="hidden" name="withproject" value="' . $withproject . '">';
1405
-		print '<input type="hidden" name="tab" value="' . $tab . '">';
1402
+		print '<input type="hidden" name="id" value="'.$id.'">';
1403
+		print '<input type="hidden" name="projectid" value="'.$projectidforalltimes.'">';
1404
+		print '<input type="hidden" name="withproject" value="'.$withproject.'">';
1405
+		print '<input type="hidden" name="tab" value="'.$tab.'">';
1406 1406
 		print '<input type="hidden" name="page_y" value="">';
1407 1407
 
1408 1408
 		// Form to convert time spent into invoice
@@ -1429,7 +1429,7 @@  discard block
 block discarded – undo
1429 1429
 					'onelineperperiod' => 'OneLinePerTimeSpentLine',
1430 1430
 				);
1431 1431
 				print $form->selectarray('generateinvoicemode', $tmparray, 'onelineperuser', 0, 0, 0, '', 1);
1432
-				print "\n" . '<script type="text/javascript">';
1432
+				print "\n".'<script type="text/javascript">';
1433 1433
 				print '
1434 1434
 				$(document).ready(function () {
1435 1435
 					setDetailVisibility();
@@ -1446,8 +1446,8 @@  discard block
 block discarded – undo
1446 1446
             		}
1447 1447
             	});
1448 1448
             			';
1449
-				print '</script>' . "\n";
1450
-				print '<span style="display:none" id="detail_time_duration"><input type="checkbox" value="detail" name="detail_time_duration"/>' . $langs->trans('AddDetailDateAndDuration') . '</span>';
1449
+				print '</script>'."\n";
1450
+				print '<span style="display:none" id="detail_time_duration"><input type="checkbox" value="detail" name="detail_time_duration"/>'.$langs->trans('AddDetailDateAndDuration').'</span>';
1451 1451
 				print '</td>';
1452 1452
 				print '</tr>';
1453 1453
 
@@ -1482,14 +1482,14 @@  discard block
 block discarded – undo
1482 1482
 
1483 1483
 				print '<br>';
1484 1484
 				print '<div class="center">';
1485
-				print '<input type="submit" class="button" id="createbills" name="createbills" value="' . $langs->trans('GenerateBill') . '">  ';
1486
-				print '<input type="submit" class="button button-cancel" id="cancel" name="cancel" value="' . $langs->trans("Cancel") . '">';
1485
+				print '<input type="submit" class="button" id="createbills" name="createbills" value="'.$langs->trans('GenerateBill').'">  ';
1486
+				print '<input type="submit" class="button button-cancel" id="cancel" name="cancel" value="'.$langs->trans("Cancel").'">';
1487 1487
 				print '</div>';
1488 1488
 				print '<br>';
1489 1489
 			} else {
1490
-				print '<div class="warning">' . $langs->trans("ThirdPartyRequiredToGenerateInvoice") . '</div>';
1490
+				print '<div class="warning">'.$langs->trans("ThirdPartyRequiredToGenerateInvoice").'</div>';
1491 1491
 				print '<div class="center">';
1492
-				print '<input type="submit" class="button button-cancel" id="cancel" name="cancel" value="' . $langs->trans("Cancel") . '">';
1492
+				print '<input type="submit" class="button button-cancel" id="cancel" name="cancel" value="'.$langs->trans("Cancel").'">';
1493 1493
 				print '</div>';
1494 1494
 				$massaction = '';
1495 1495
 			}
@@ -1502,7 +1502,7 @@  discard block
 block discarded – undo
1502 1502
 				print '<table class="noborder centpercent">';
1503 1503
 				print '<tr>';
1504 1504
 				print '<td class="titlefield">';
1505
-				print img_picto('', 'intervention', 'class="pictofixedwidth"') . $langs->trans('InterToUse');
1505
+				print img_picto('', 'intervention', 'class="pictofixedwidth"').$langs->trans('InterToUse');
1506 1506
 				print '</td>';
1507 1507
 				print '<td>';
1508 1508
 				$forminter = new FormIntervention($db);
@@ -1512,14 +1512,14 @@  discard block
 block discarded – undo
1512 1512
 				print '</table>';
1513 1513
 
1514 1514
 				print '<div class="center">';
1515
-				print '<input type="submit" class="button" id="createinter" name="createinter" value="' . $langs->trans('GenerateInter') . '">  ';
1516
-				print '<input type="submit" class="button" id="cancel" name="cancel" value="' . $langs->trans('Cancel') . '">';
1515
+				print '<input type="submit" class="button" id="createinter" name="createinter" value="'.$langs->trans('GenerateInter').'">  ';
1516
+				print '<input type="submit" class="button" id="cancel" name="cancel" value="'.$langs->trans('Cancel').'">';
1517 1517
 				print '</div>';
1518 1518
 				print '<br>';
1519 1519
 			} else {
1520
-				print '<div class="warning">' . $langs->trans("ThirdPartyRequiredToGenerateIntervention") . '</div>';
1520
+				print '<div class="warning">'.$langs->trans("ThirdPartyRequiredToGenerateIntervention").'</div>';
1521 1521
 				print '<div class="center">';
1522
-				print '<input type="submit" class="button" id="cancel" name="cancel" value="' . $langs->trans('Cancel') . '">';
1522
+				print '<input type="submit" class="button" id="cancel" name="cancel" value="'.$langs->trans('Cancel').'">';
1523 1523
 				print '</div>';
1524 1524
 				$massaction = '';
1525 1525
 			}
@@ -1580,13 +1580,13 @@  discard block
 block discarded – undo
1580 1580
 			$sql .= " AND t.fk_element =".((int) $object->id);
1581 1581
 		} elseif (!empty($projectidforalltimes)) {
1582 1582
 			// Limit on one project
1583
-			$sql .= " AND pt.fk_projet IN (" . $db->sanitize($projectidforalltimes) . ")";
1583
+			$sql .= " AND pt.fk_projet IN (".$db->sanitize($projectidforalltimes).")";
1584 1584
 		} elseif (!empty($allprojectforuser)) {
1585 1585
 			// Limit on on user
1586 1586
 			if (empty($search_user)) {
1587 1587
 				$search_user = $user->id;
1588 1588
 			}
1589
-			if ($search_user > 0) $sql .= " AND t.fk_user = " . ((int) $search_user);
1589
+			if ($search_user > 0) $sql .= " AND t.fk_user = ".((int) $search_user);
1590 1590
 		}
1591 1591
 
1592 1592
 		if ($search_note) {
@@ -1638,13 +1638,13 @@  discard block
 block discarded – undo
1638 1638
 			if ($search_timespent_starthour || $search_timespent_startmin) {
1639 1639
 				$timespent_duration_start = $search_timespent_starthour * 60 * 60; // We store duration in seconds
1640 1640
 				$timespent_duration_start += ($search_timespent_startmin ? $search_timespent_startmin : 0) * 60; // We store duration in seconds
1641
-				$sql .= " AND t.element_duration >= " . $timespent_duration_start;
1641
+				$sql .= " AND t.element_duration >= ".$timespent_duration_start;
1642 1642
 			}
1643 1643
 
1644 1644
 			if ($search_timespent_endhour || $search_timespent_endmin) {
1645 1645
 				$timespent_duration_end = $search_timespent_endhour * 60 * 60; // We store duration in seconds
1646 1646
 				$timespent_duration_end += ($search_timespent_endmin ? $search_timespent_endmin : 0) * 60; // We store duration in seconds
1647
-				$sql .= " AND t.element_duration <= " . $timespent_duration_end;
1647
+				$sql .= " AND t.element_duration <= ".$timespent_duration_end;
1648 1648
 			}
1649 1649
 		}
1650 1650
 
@@ -1692,13 +1692,13 @@  discard block
 block discarded – undo
1692 1692
 
1693 1693
 		if ($num >= 0) {
1694 1694
 			if (!empty($projectidforalltimes)) {
1695
-				print '<!-- List of time spent for project -->' . "\n";
1695
+				print '<!-- List of time spent for project -->'."\n";
1696 1696
 
1697 1697
 				$title = $langs->trans("ListTaskTimeUserProject");
1698 1698
 
1699 1699
 				print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'clock', 0, $linktocreatetime, '', $limit, 0, 0, 1);
1700 1700
 			} else {
1701
-				print '<!-- List of time spent -->' . "\n";
1701
+				print '<!-- List of time spent -->'."\n";
1702 1702
 
1703 1703
 				$title = $langs->trans("ListTaskTimeForTask");
1704 1704
 
@@ -1720,26 +1720,26 @@  discard block
 block discarded – undo
1720 1720
 		 * Form to add a new line of time spent
1721 1721
 		 */
1722 1722
 		if ($action == 'createtime' && $user->rights->projet->time) {
1723
-			print '<!-- table to add time spent -->' . "\n";
1723
+			print '<!-- table to add time spent -->'."\n";
1724 1724
 			if (!empty($id)) {
1725
-				print '<input type="hidden" name="taskid" value="' . $id . '">';
1725
+				print '<input type="hidden" name="taskid" value="'.$id.'">';
1726 1726
 			}
1727 1727
 
1728 1728
 			print '<div class="div-table-responsive-no-min">'; // You can use div-table-responsive-no-min if you dont need reserved height for your table
1729 1729
 			print '<table class="noborder nohover centpercent">';
1730 1730
 
1731 1731
 			print '<tr class="liste_titre">';
1732
-			print '<td>' . $langs->trans("Date") . '</td>';
1732
+			print '<td>'.$langs->trans("Date").'</td>';
1733 1733
 			if (!empty($allprojectforuser)) {
1734
-				print '<td>' . $langs->trans("Project") . '</td>';
1734
+				print '<td>'.$langs->trans("Project").'</td>';
1735 1735
 			}
1736 1736
 			if (empty($id)) {
1737
-				print '<td>' . $langs->trans("Task") . '</td>';
1737
+				print '<td>'.$langs->trans("Task").'</td>';
1738 1738
 			}
1739
-			print '<td>' . $langs->trans("By") . '</td>';
1740
-			print '<td>' . $langs->trans("Note") . '</td>';
1741
-			print '<td>' . $langs->trans("NewTimeSpent") . '</td>';
1742
-			print '<td>' . $langs->trans("ProgressDeclared") . '</td>';
1739
+			print '<td>'.$langs->trans("By").'</td>';
1740
+			print '<td>'.$langs->trans("Note").'</td>';
1741
+			print '<td>'.$langs->trans("NewTimeSpent").'</td>';
1742
+			print '<td>'.$langs->trans("ProgressDeclared").'</td>';
1743 1743
 			if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_BILL_TIME_SPENT)) {
1744 1744
 				print '<td></td>';
1745 1745
 
@@ -1793,14 +1793,14 @@  discard block
 block discarded – undo
1793 1793
 				print $form->select_dolusers((GETPOST('userid', 'int') ? GETPOST('userid', 'int') : $userid), 'userid', 0, '', 0, '', $contactsofproject, 0, 0, 0, '', 0, $langs->trans("ResourceNotAssignedToProject"), 'maxwidth200');
1794 1794
 			} else {
1795 1795
 				if ($nboftasks) {
1796
-					print img_error($langs->trans('FirstAddRessourceToAllocateTime')) . ' ' . $langs->trans('FirstAddRessourceToAllocateTime');
1796
+					print img_error($langs->trans('FirstAddRessourceToAllocateTime')).' '.$langs->trans('FirstAddRessourceToAllocateTime');
1797 1797
 				}
1798 1798
 			}
1799 1799
 			print '</td>';
1800 1800
 
1801 1801
 			// Note
1802 1802
 			print '<td>';
1803
-			print '<textarea name="timespent_note" class="maxwidth100onsmartphone" rows="' . ROWS_2 . '">' . (GETPOST('timespent_note') ? GETPOST('timespent_note') : '') . '</textarea>';
1803
+			print '<textarea name="timespent_note" class="maxwidth100onsmartphone" rows="'.ROWS_2.'">'.(GETPOST('timespent_note') ? GETPOST('timespent_note') : '').'</textarea>';
1804 1804
 			print '</td>';
1805 1805
 
1806 1806
 			// Duration - Time spent
@@ -1868,7 +1868,7 @@  discard block
 block discarded – undo
1868 1868
 		$selectedfields .= (is_array($arrayofmassactions) && count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
1869 1869
 
1870 1870
 		print '<div class="div-table-responsive">';
1871
-		print '<table class="tagtable nobottomiftotal liste' . ($moreforfilter ? " listwithfilterbefore" : "") . '">' . "\n";
1871
+		print '<table class="tagtable nobottomiftotal liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
1872 1872
 
1873 1873
 		// Fields title search
1874 1874
 		// --------------------------------------------------------------------
@@ -1893,20 +1893,20 @@  discard block
 block discarded – undo
1893 1893
 		}
1894 1894
 		// Thirdparty
1895 1895
 		if (!empty($arrayfields['p.fk_soc']['checked'])) {
1896
-			print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_company" value="' . dol_escape_htmltag($search_company) . '"></td>';
1896
+			print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_company" value="'.dol_escape_htmltag($search_company).'"></td>';
1897 1897
 		}
1898 1898
 
1899 1899
 		// Thirdparty alias
1900 1900
 		if (!empty($arrayfields['s.name_alias']['checked'])) {
1901
-			print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_company_alias" value="' . dol_escape_htmltag($search_company_alias) . '"></td>';
1901
+			print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_company_alias" value="'.dol_escape_htmltag($search_company_alias).'"></td>';
1902 1902
 		}
1903 1903
 
1904 1904
 		if (!empty($allprojectforuser)) {
1905 1905
 			if (!empty($arrayfields['p.project_ref']['checked'])) {
1906
-				print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_project_ref" value="' . dol_escape_htmltag($search_project_ref) . '"></td>';
1906
+				print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_project_ref" value="'.dol_escape_htmltag($search_project_ref).'"></td>';
1907 1907
 			}
1908 1908
 			if (!empty($arrayfields['p.project_label']['checked'])) {
1909
-				print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_project_label" value="' . dol_escape_htmltag($search_project_label) . '"></td>';
1909
+				print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_project_label" value="'.dol_escape_htmltag($search_project_label).'"></td>';
1910 1910
 			}
1911 1911
 		}
1912 1912
 		// Task
@@ -1924,7 +1924,7 @@  discard block
 block discarded – undo
1924 1924
 		}
1925 1925
 		// Note
1926 1926
 		if (!empty($arrayfields['t.note']['checked'])) {
1927
-			print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="search_note" value="' . dol_escape_htmltag($search_note) . '"></td>';
1927
+			print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="search_note" value="'.dol_escape_htmltag($search_note).'"></td>';
1928 1928
 		}
1929 1929
 		// Duration
1930 1930
 		if (!empty($arrayfields['t.element_duration']['checked'])) {
@@ -1935,7 +1935,7 @@  discard block
 block discarded – undo
1935 1935
 			if ($search_timespent_starthour || $search_timespent_startmin) {
1936 1936
 				$durationtouse_start = ($search_timespent_starthour * 3600 + $search_timespent_startmin * 60);
1937 1937
 			}
1938
-			print '<div class="nowraponall">' . $langs->trans('from') . ' ';
1938
+			print '<div class="nowraponall">'.$langs->trans('from').' ';
1939 1939
 			print $form->select_duration('search_timespent_duration_start', $durationtouse_start, 0, 'text', 0, 1);
1940 1940
 			print '</div>';
1941 1941
 
@@ -1943,7 +1943,7 @@  discard block
 block discarded – undo
1943 1943
 			if ($search_timespent_endhour || $search_timespent_endmin) {
1944 1944
 				$durationtouse_end = ($search_timespent_endhour * 3600 + $search_timespent_endmin * 60);
1945 1945
 			}
1946
-			print '<div class="nowraponall">' . $langs->trans('at') . ' ';
1946
+			print '<div class="nowraponall">'.$langs->trans('at').' ';
1947 1947
 			print $form->select_duration('search_timespent_duration_end', $durationtouse_end, 0, 'text', 0, 1);
1948 1948
 			print '</div>';
1949 1949
 
@@ -1959,7 +1959,7 @@  discard block
 block discarded – undo
1959 1959
 		}
1960 1960
 		// Value billed
1961 1961
 		if (!empty($arrayfields['valuebilled']['checked'])) {
1962
-			print '<td class="liste_titre center">' . $form->selectyesno('search_valuebilled', $search_valuebilled, 1, false, 1) . '</td>';
1962
+			print '<td class="liste_titre center">'.$form->selectyesno('search_valuebilled', $search_valuebilled, 1, false, 1).'</td>';
1963 1963
 		}
1964 1964
 
1965 1965
 		/*
@@ -1977,7 +1977,7 @@  discard block
 block discarded – undo
1977 1977
 			print $searchpicto;
1978 1978
 			print '</td>';
1979 1979
 		}
1980
-		print '</tr>' . "\n";
1980
+		print '</tr>'."\n";
1981 1981
 
1982 1982
 		$totalarray = array();
1983 1983
 		$totalarray['nbfield'] = 0;
@@ -2087,7 +2087,7 @@  discard block
 block discarded – undo
2087 2087
 			if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
2088 2088
 				print '<td class="center nowraponall">';
2089 2089
 				if (($action == 'editline' || $action == 'splitline') && GETPOST('lineid', 'int') == $task_time->rowid) {
2090
-					print '<input type="hidden" name="lineid" value="' . GETPOST('lineid', 'int') . '">';
2090
+					print '<input type="hidden" name="lineid" value="'.GETPOST('lineid', 'int').'">';
2091 2091
 					print '<input type="submit" class="button buttongen smallpaddingimp margintoponlyshort marginbottomonlyshort button-save" name="save" value="'.$langs->trans("Save").'">';
2092 2092
 					print ' ';
2093 2093
 					print '<input type="submit" class="button buttongen smallpaddingimp margintoponlyshort marginbottomonlyshort button-cancel" name="cancel" value="'.$langs->trans("Cancel").'">';
@@ -2095,7 +2095,7 @@  discard block
 block discarded – undo
2095 2095
 					if (in_array($task_time->fk_user, $childids) || $user->hasRight('projet', 'all', 'creer')) {
2096 2096
 						if (getDolGlobalString('MAIN_FEATURES_LEVEL') >= 2) {
2097 2097
 							print '&nbsp;';
2098
-							print '<a class="reposition" href="' . $_SERVER["PHP_SELF"] . '?action=splitline&token=' . newToken() . '&lineid=' . $task_time->rowid . $param . ((empty($id) || $tab == 'timespent') ? '&tab=timespent' : '') . '">';
2098
+							print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=splitline&token='.newToken().'&lineid='.$task_time->rowid.$param.((empty($id) || $tab == 'timespent') ? '&tab=timespent' : '').'">';
2099 2099
 							print img_split('', 'class="pictofixedwidth"');
2100 2100
 							print '</a>';
2101 2101
 						}
@@ -2114,7 +2114,7 @@  discard block
 block discarded – undo
2114 2114
 								$selected = 1;
2115 2115
 							}
2116 2116
 							print '&nbsp;';
2117
-							print '<input id="cb' . $task_time->rowid . '" class="flat checkforselect marginleftonly" type="checkbox" name="toselect[]" value="' . $task_time->rowid . '"' . ($selected ? ' checked="checked"' : '') . '>';
2117
+							print '<input id="cb'.$task_time->rowid.'" class="flat checkforselect marginleftonly" type="checkbox" name="toselect[]" value="'.$task_time->rowid.'"'.($selected ? ' checked="checked"' : '').'>';
2118 2118
 						}
2119 2119
 					}
2120 2120
 				}
@@ -2232,7 +2232,7 @@  discard block
 block discarded – undo
2232 2232
 					}
2233 2233
 				}
2234 2234
 			} elseif ($action !== 'createtime') {
2235
-				print '<input type="hidden" name="taskid" value="' . $id . '">';
2235
+				print '<input type="hidden" name="taskid" value="'.$id.'">';
2236 2236
 			}
2237 2237
 
2238 2238
 			// Task label
@@ -2262,7 +2262,7 @@  discard block
 block discarded – undo
2262 2262
 						print img_object('', 'user', 'class="hideonsmartphone"');
2263 2263
 						print $form->select_dolusers($task_time->fk_user, 'userid_line', 0, '', 0, '', $contactsoftask, '0', 0, 0, '', 0, '', 'maxwidth200');
2264 2264
 					} else {
2265
-						print img_error($langs->trans('FirstAddRessourceToAllocateTime')) . $langs->trans('FirstAddRessourceToAllocateTime');
2265
+						print img_error($langs->trans('FirstAddRessourceToAllocateTime')).$langs->trans('FirstAddRessourceToAllocateTime');
2266 2266
 					}
2267 2267
 				} else {
2268 2268
 					$userstatic->id = $task_time->fk_user;
@@ -2282,7 +2282,7 @@  discard block
 block discarded – undo
2282 2282
 			if (!empty($arrayfields['t.note']['checked'])) {
2283 2283
 				print '<td class="small">';
2284 2284
 				if ($action == 'editline' && GETPOST('lineid', 'int') == $task_time->rowid) {
2285
-					print '<textarea name="timespent_note_line" width="95%" rows="' . ROWS_1 . '">' . dol_escape_htmltag($task_time->note, 0, 1) . '</textarea>';
2285
+					print '<textarea name="timespent_note_line" width="95%" rows="'.ROWS_1.'">'.dol_escape_htmltag($task_time->note, 0, 1).'</textarea>';
2286 2286
 				} else {
2287 2287
 					print dol_nl2br($task_time->note);
2288 2288
 				}
@@ -2291,7 +2291,7 @@  discard block
 block discarded – undo
2291 2291
 					$totalarray['nbfield']++;
2292 2292
 				}
2293 2293
 			} elseif ($action == 'editline' && GETPOST('lineid', 'int') == $task_time->rowid) {
2294
-				print '<input type="hidden" name="timespent_note_line" value="' . dol_escape_htmltag($task_time->note, 0, 1) . '">';
2294
+				print '<input type="hidden" name="timespent_note_line" value="'.dol_escape_htmltag($task_time->note, 0, 1).'">';
2295 2295
 			}
2296 2296
 
2297 2297
 			// Time spent
@@ -2351,7 +2351,7 @@  discard block
 block discarded – undo
2351 2351
 				$value = price2num($task_time->thm * $task_time->element_duration / 3600, 'MT', 1);
2352 2352
 
2353 2353
 				print '<td class="nowraponall right">';
2354
-				print '<span class="amount" title="' . $langs->trans("THM") . ': ' . price($task_time->thm) . '">';
2354
+				print '<span class="amount" title="'.$langs->trans("THM").': '.price($task_time->thm).'">';
2355 2355
 				print price($value, 1, $langs, 1, -1, -1, $conf->currency);
2356 2356
 				print '</span>';
2357 2357
 				print '</td>';
@@ -2384,7 +2384,7 @@  discard block
 block discarded – undo
2384 2384
 						if ($task_time->invoice_id) {
2385 2385
 							$result = $tmpinvoice->fetch($task_time->invoice_id);
2386 2386
 							if ($result > 0) {
2387
-								if ($action=='editline' && $_GET['lineid'] == $task_time->rowid) {
2387
+								if ($action == 'editline' && $_GET['lineid'] == $task_time->rowid) {
2388 2388
 									print $formproject->selectInvoiceAndLine($task_time->invoice_id, $task_time->invoice_line_id, 'invoiceid', 'invoicelineid', 'maxwidth500', array('p.rowid'=>$projectstatic->id));
2389 2389
 								} else {
2390 2390
 									print $tmpinvoice->getNomUrl(1);
@@ -2402,7 +2402,7 @@  discard block
 block discarded – undo
2402 2402
 							print $langs->trans("No");
2403 2403
 						}
2404 2404
 					} else {
2405
-						print '<span class="opacitymedium">' . $langs->trans("NA") . '</span>';
2405
+						print '<span class="opacitymedium">'.$langs->trans("NA").'</span>';
2406 2406
 					}
2407 2407
 				}
2408 2408
 				print '</td>';
@@ -2433,7 +2433,7 @@  discard block
 block discarded – undo
2433 2433
 					if (in_array($task_time->fk_user, $childids) || $user->hasRight('projet', 'all', 'creer')) {
2434 2434
 						if (getDolGlobalString('MAIN_FEATURES_LEVEL') >= 2) {
2435 2435
 							print '&nbsp;';
2436
-							print '<a class="reposition" href="' . $_SERVER["PHP_SELF"] . '?action=splitline&token=' . newToken() . '&lineid=' . $task_time->rowid . $param . ((empty($id) || $tab == 'timespent') ? '&tab=timespent' : '') . '">';
2436
+							print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=splitline&token='.newToken().'&lineid='.$task_time->rowid.$param.((empty($id) || $tab == 'timespent') ? '&tab=timespent' : '').'">';
2437 2437
 							print img_split('', 'class="pictofixedwidth"');
2438 2438
 							print '</a>';
2439 2439
 						}
@@ -2452,7 +2452,7 @@  discard block
 block discarded – undo
2452 2452
 								$selected = 1;
2453 2453
 							}
2454 2454
 							print '&nbsp;';
2455
-							print '<input id="cb' . $task_time->rowid . '" class="flat checkforselect marginleftonly" type="checkbox" name="toselect[]" value="' . $task_time->rowid . '"' . ($selected ? ' checked="checked"' : '') . '>';
2455
+							print '<input id="cb'.$task_time->rowid.'" class="flat checkforselect marginleftonly" type="checkbox" name="toselect[]" value="'.$task_time->rowid.'"'.($selected ? ' checked="checked"' : '').'>';
2456 2456
 						}
2457 2457
 					}
2458 2458
 				}
@@ -2542,7 +2542,7 @@  discard block
 block discarded – undo
2542 2542
 							print img_object('', 'user', 'class="hideonsmartphone"');
2543 2543
 							print $form->select_dolusers($task_time->fk_user, 'userid_line', 0, '', 0, '', $contactsoftask);
2544 2544
 						} else {
2545
-							print img_error($langs->trans('FirstAddRessourceToAllocateTime')) . $langs->trans('FirstAddRessourceToAllocateTime');
2545
+							print img_error($langs->trans('FirstAddRessourceToAllocateTime')).$langs->trans('FirstAddRessourceToAllocateTime');
2546 2546
 						}
2547 2547
 					} else {
2548 2548
 						$userstatic->id = $task_time->fk_user;
@@ -2559,13 +2559,13 @@  discard block
 block discarded – undo
2559 2559
 				if (!empty($arrayfields['t.note']['checked'])) {
2560 2560
 					print '<td class="tdoverflowmax300">';
2561 2561
 					if ($action == 'splitline' && GETPOST('lineid', 'int') == $task_time->rowid) {
2562
-						print '<textarea name="timespent_note_line" width="95%" rows="' . ROWS_1 . '">' . dol_escape_htmltag($task_time->note, 0, 1) . '</textarea>';
2562
+						print '<textarea name="timespent_note_line" width="95%" rows="'.ROWS_1.'">'.dol_escape_htmltag($task_time->note, 0, 1).'</textarea>';
2563 2563
 					} else {
2564 2564
 						print dol_nl2br($task_time->note);
2565 2565
 					}
2566 2566
 					print '</td>';
2567 2567
 				} elseif ($action == 'splitline' && GETPOST('lineid', 'int') == $task_time->rowid) {
2568
-					print '<input type="hidden" name="timespent_note_line" rows="' . ROWS_1 . '" value="' . dol_escape_htmltag($task_time->note, 0, 1) . '">';
2568
+					print '<input type="hidden" name="timespent_note_line" rows="'.ROWS_1.'" value="'.dol_escape_htmltag($task_time->note, 0, 1).'">';
2569 2569
 				}
2570 2570
 
2571 2571
 				// Time spent
@@ -2698,7 +2698,7 @@  discard block
 block discarded – undo
2698 2698
 							print img_object('', 'user', 'class="hideonsmartphone"');
2699 2699
 							print $form->select_dolusers($task_time->fk_user, 'userid_line_2', 0, '', 0, '', $contactsoftask);
2700 2700
 						} else {
2701
-							print img_error($langs->trans('FirstAddRessourceToAllocateTime')) . $langs->trans('FirstAddRessourceToAllocateTime');
2701
+							print img_error($langs->trans('FirstAddRessourceToAllocateTime')).$langs->trans('FirstAddRessourceToAllocateTime');
2702 2702
 						}
2703 2703
 					} else {
2704 2704
 						$userstatic->id = $task_time->fk_user;
@@ -2715,13 +2715,13 @@  discard block
 block discarded – undo
2715 2715
 				if (!empty($arrayfields['t.note']['checked'])) {
2716 2716
 					print '<td class="small tdoverflowmax300"">';
2717 2717
 					if ($action == 'splitline' && GETPOST('lineid', 'int') == $task_time->rowid) {
2718
-						print '<textarea name="timespent_note_line_2" width="95%" rows="' . ROWS_1 . '">' . dol_escape_htmltag($task_time->note, 0, 1) . '</textarea>';
2718
+						print '<textarea name="timespent_note_line_2" width="95%" rows="'.ROWS_1.'">'.dol_escape_htmltag($task_time->note, 0, 1).'</textarea>';
2719 2719
 					} else {
2720 2720
 						print dol_nl2br($task_time->note);
2721 2721
 					}
2722 2722
 					print '</td>';
2723 2723
 				} elseif ($action == 'splitline' && GETPOST('lineid', 'int') == $task_time->rowid) {
2724
-					print '<input type="hidden" name="timespent_note_line_2" value="' . dol_escape_htmltag($task_time->note, 0, 1) . '">';
2724
+					print '<input type="hidden" name="timespent_note_line_2" value="'.dol_escape_htmltag($task_time->note, 0, 1).'">';
2725 2725
 				}
2726 2726
 
2727 2727
 				// Time spent
@@ -2793,14 +2793,14 @@  discard block
 block discarded – undo
2793 2793
 				$i++;
2794 2794
 				if ($i == 1) {
2795 2795
 					if ($num < $limit && empty($offset)) {
2796
-						print '<td class="left">' . $langs->trans("Total") . '</td>';
2796
+						print '<td class="left">'.$langs->trans("Total").'</td>';
2797 2797
 					} else {
2798 2798
 						print '<td class="left">'.$form->textwithpicto($langs->trans("Total"), $langs->trans("Totalforthispage")).'</td>';
2799 2799
 					}
2800 2800
 				} elseif ($totalarray['totaldurationfield'] == $i) {
2801
-					print '<td class="right">' . convertSecondToTime($totalarray['totalduration'], 'allhourmin') . '</td>';
2801
+					print '<td class="right">'.convertSecondToTime($totalarray['totalduration'], 'allhourmin').'</td>';
2802 2802
 				} elseif ($totalarray['totalvaluefield'] == $i) {
2803
-					print '<td class="right">' . price($totalarray['totalvalue']) . '</td>';
2803
+					print '<td class="right">'.price($totalarray['totalvalue']).'</td>';
2804 2804
 					//} elseif ($totalarray['totalvaluebilledfield'] == $i) { print '<td class="center">'.price($totalarray['totalvaluebilled']).'</td>';
2805 2805
 				} else {
2806 2806
 					print '<td></td>';
@@ -2816,8 +2816,8 @@  discard block
 block discarded – undo
2816 2816
 					$totalnboffields++;
2817 2817
 				}
2818 2818
 			}
2819
-			print '<tr class="oddeven"><td colspan="' . $totalnboffields . '">';
2820
-			print '<span class="opacitymedium">' . $langs->trans("None") . '</span>';
2819
+			print '<tr class="oddeven"><td colspan="'.$totalnboffields.'">';
2820
+			print '<span class="opacitymedium">'.$langs->trans("None").'</span>';
2821 2821
 			print '</td></tr>';
2822 2822
 		}
2823 2823
 
Please login to merge, or discard this patch.