Completed
Branch develop (afe385)
by
unknown
26:36
created
htdocs/core/class/commondocgenerator.class.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -248,11 +248,11 @@  discard block
 block discarded – undo
248 248
 	/**
249 249
 	 * @var float
250 250
 	 */
251
-	public $posxpicture;	// For picture
251
+	public $posxpicture; // For picture
252 252
 	/**
253 253
 	 * @var float
254 254
 	 */
255
-	public $posxdesc;		// For description
255
+	public $posxdesc; // For description
256 256
 	/**
257 257
 	 * @var float
258 258
 	 */
@@ -330,7 +330,7 @@  discard block
 block discarded – undo
330 330
 		// phpcs:enable
331 331
 		global $conf, $extrafields;
332 332
 
333
-		$logotouse = $conf->user->dir_output . '/' . get_exdir(0, 0, 0, 0, $user, 'user') . 'photos/' . getImageFileNameForSize($user->photo, '_small');
333
+		$logotouse = $conf->user->dir_output.'/'.get_exdir(0, 0, 0, 0, $user, 'user').'photos/'.getImageFileNameForSize($user->photo, '_small');
334 334
 
335 335
 		$array_user = array(
336 336
 			'myuser_lastname' => $user->lastname,
@@ -350,7 +350,7 @@  discard block
 block discarded – undo
350 350
 			'myuser_email' => $user->email,
351 351
 			'myuser_logo' => $logotouse,
352 352
 			'myuser_job' => $user->job,
353
-			'myuser_web' => '',	// url not exist in $user object
353
+			'myuser_web' => '', // url not exist in $user object
354 354
 			'myuser_birth' => dol_print_date($user->birth, 'day', 'gmt'),
355 355
 			'myuser_dateemployment' => dol_print_date($user->dateemployment, 'day', 'tzuser'),
356 356
 			'myuser_dateemploymentend' => dol_print_date($user->dateemploymentend, 'day', 'tzuser'),
@@ -679,16 +679,16 @@  discard block
 block discarded – undo
679 679
 		$date = (isset($object->element) && $object->element == 'contrat' && isset($object->date_contrat)) ? $object->date_contrat : (isset($object->date) ? $object->date : null);
680 680
 
681 681
 		if ($object instanceof CommandeFournisseur) {
682
-			$object->date_validation =  $object->date_valid;
682
+			$object->date_validation = $object->date_valid;
683 683
 			$object->date_commande = $object->date;
684 684
 		}
685 685
 		$resarray = array(
686 686
 			$array_key.'_id' => $object->id,
687 687
 			$array_key.'_ref' => (property_exists($object, 'ref') ? $object->ref : ''),
688
-			$array_key.'_label' => (property_exists($object, 'label') ? $object->label : ''),  // @phan-suppress-current-line PhanUndeclaredProperty
688
+			$array_key.'_label' => (property_exists($object, 'label') ? $object->label : ''), // @phan-suppress-current-line PhanUndeclaredProperty
689 689
 			$array_key.'_ref_ext' => (property_exists($object, 'ref_ext') ? $object->ref_ext : ''),
690 690
 			$array_key.'_ref_customer' => (!empty($object->ref_client) ? $object->ref_client : (empty($object->ref_customer) ? '' : $object->ref_customer)),
691
-			$array_key.'_ref_supplier' => (!empty($object->ref_fournisseur) ? $object->ref_fournisseur : (empty($object->ref_supplier) ? '' : $object->ref_supplier)),  // @phan-suppress-current-line PhanUndeclaredProperty
691
+			$array_key.'_ref_supplier' => (!empty($object->ref_fournisseur) ? $object->ref_fournisseur : (empty($object->ref_supplier) ? '' : $object->ref_supplier)), // @phan-suppress-current-line PhanUndeclaredProperty
692 692
 			$array_key.'_source_invoice_ref' => ((empty($invoice_source) || empty($invoice_source->ref)) ? '' : $invoice_source->ref),
693 693
 			// Dates
694 694
 			$array_key.'_hour' => dol_print_date($date, 'hour'),
@@ -696,7 +696,7 @@  discard block
 block discarded – undo
696 696
 			$array_key.'_date_rfc' => dol_print_date($date, 'dayrfc'),
697 697
 			$array_key.'_date_limit' => (!empty($object->date_lim_reglement) ? dol_print_date($object->date_lim_reglement, 'day') : ''),
698 698
 			$array_key.'_date_limit_rfc' => (!empty($object->date_lim_reglement) ? dol_print_date($object->date_lim_reglement, 'dayrfc') : ''),
699
-			$array_key.'_date_end' => (!empty($object->fin_validite) ? dol_print_date($object->fin_validite, 'day') : ''),  // @phan-suppress-current-line PhanUndeclaredProperty
699
+			$array_key.'_date_end' => (!empty($object->fin_validite) ? dol_print_date($object->fin_validite, 'day') : ''), // @phan-suppress-current-line PhanUndeclaredProperty
700 700
 			$array_key.'_date_creation' => dol_print_date($object->date_creation, 'day'),
701 701
 			$array_key.'_date_modification' => (!empty($object->date_modification) ? dol_print_date($object->date_modification, 'day') : ''),
702 702
 			$array_key.'_date_validation' => (!empty($object->date_validation) ? dol_print_date($object->date_validation, 'dayhour') : ''),
@@ -712,13 +712,13 @@  discard block
 block discarded – undo
712 712
 			$array_key.'_incoterms' => (method_exists($object, 'display_incoterms') ? $object->display_incoterms() : ''),
713 713
 
714 714
 			$array_key.'_total_ht_locale' => price($object->total_ht, 0, $outputlangs),
715
-			$array_key.'_total_vat_locale' => (!empty($object->total_vat) ? price($object->total_vat, 0, $outputlangs) : price($object->total_tva, 0, $outputlangs)),  // @phan-suppress-current-line PhanUndeclaredProperty
715
+			$array_key.'_total_vat_locale' => (!empty($object->total_vat) ? price($object->total_vat, 0, $outputlangs) : price($object->total_tva, 0, $outputlangs)), // @phan-suppress-current-line PhanUndeclaredProperty
716 716
 			$array_key.'_total_localtax1_locale' => price($object->total_localtax1, 0, $outputlangs),
717 717
 			$array_key.'_total_localtax2_locale' => price($object->total_localtax2, 0, $outputlangs),
718 718
 			$array_key.'_total_ttc_locale' => price($object->total_ttc, 0, $outputlangs),
719 719
 
720 720
 			$array_key.'_total_ht' => price2num($object->total_ht),
721
-			$array_key.'_total_vat' => (!empty($object->total_vat) ? price2num($object->total_vat) : price2num($object->total_tva)),  // @phan-suppress-current-line PhanUndeclaredProperty
721
+			$array_key.'_total_vat' => (!empty($object->total_vat) ? price2num($object->total_vat) : price2num($object->total_tva)), // @phan-suppress-current-line PhanUndeclaredProperty
722 722
 			$array_key.'_total_localtax1' => price2num($object->total_localtax1),
723 723
 			$array_key.'_total_localtax2' => price2num($object->total_localtax2),
724 724
 			$array_key.'_total_ttc' => price2num($object->total_ttc),
@@ -1041,7 +1041,7 @@  discard block
 block discarded – undo
1041 1041
 			$array_key.'_ref' => $object->ref,
1042 1042
 			$array_key.'_ref_ext' => $object->ref_ext,
1043 1043
 			$array_key.'_ref_customer' => $object->ref_customer,
1044
-			$array_key.'_date_delivery' => dol_print_date($object->date_delivery, 'day'),	// note: for shipment, delivery and reception: date_delivery, for orders: delivery_date
1044
+			$array_key.'_date_delivery' => dol_print_date($object->date_delivery, 'day'), // note: for shipment, delivery and reception: date_delivery, for orders: delivery_date
1045 1045
 			$array_key.'_hour_delivery' => dol_print_date($object->date_delivery, 'hour'),
1046 1046
 			$array_key.'_date_creation' => dol_print_date($object->date_creation, 'day'),
1047 1047
 			$array_key.'_total_ht' => price($object->total_ht),
@@ -1109,7 +1109,7 @@  discard block
 block discarded – undo
1109 1109
 			if ($object->volume_units < 50) {
1110 1110
 					$array_shipment[$array_key.'_total_volume'] = (empty($totalVolume)) ? '' : showDimensionInBestUnit($object->trueVolume, $object->volume_units, "volume", $outputlangs);
1111 1111
 			} else {
1112
-					$array_shipment[$array_key.'_total_volume'] = (empty($totalVolume)) ? '' :  price($object->trueVolume, 0, $outputlangs, 0, 0).' '.measuringUnitString(0, "volume", $object->volume_units);
1112
+					$array_shipment[$array_key.'_total_volume'] = (empty($totalVolume)) ? '' : price($object->trueVolume, 0, $outputlangs, 0, 0).' '.measuringUnitString(0, "volume", $object->volume_units);
1113 1113
 			}
1114 1114
 		} elseif (!empty($totalVolume)) {
1115 1115
 				$array_shipment[$array_key.'_total_volume'] = showDimensionInBestUnit($totalVolume, 0, "volume", $outputlangs, -1, 'no', 1);
@@ -1820,7 +1820,7 @@  discard block
 block discarded – undo
1820 1820
 				 * @param stdClass $b
1821 1821
 				 * @return int<-1,1>
1822 1822
 				 */
1823
-				static function ($a, $b) {
1823
+				static function($a, $b) {
1824 1824
 					return  ($a->rank > $b->rank) ? 1 : -1;
1825 1825
 				}
1826 1826
 			);
Please login to merge, or discard this patch.
htdocs/core/modules/import/import_xlsx.modules.php 1 patch
Spacing   +53 added lines, -53 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 use PhpOffice\PhpSpreadsheet\Style\Alignment;
33 33
 use PhpOffice\PhpSpreadsheet\Shared\Date;
34 34
 
35
-require_once DOL_DOCUMENT_ROOT . '/core/modules/import/modules_import.php';
35
+require_once DOL_DOCUMENT_ROOT.'/core/modules/import/modules_import.php';
36 36
 
37 37
 
38 38
 /**
@@ -175,10 +175,10 @@  discard block
 block discarded – undo
175 175
 		// phpcs:enable
176 176
 		global $user, $conf, $langs, $file;
177 177
 		// create a temporary object, the final output will be generated in footer
178
-		$this->workbook->getProperties()->setCreator($user->getFullName($outputlangs) . ' - Dolibarr ' . DOL_VERSION);
179
-		$this->workbook->getProperties()->setTitle($outputlangs->trans("Import") . ' - ' . $file);
180
-		$this->workbook->getProperties()->setSubject($outputlangs->trans("Import") . ' - ' . $file);
181
-		$this->workbook->getProperties()->setDescription($outputlangs->trans("Import") . ' - ' . $file);
178
+		$this->workbook->getProperties()->setCreator($user->getFullName($outputlangs).' - Dolibarr '.DOL_VERSION);
179
+		$this->workbook->getProperties()->setTitle($outputlangs->trans("Import").' - '.$file);
180
+		$this->workbook->getProperties()->setSubject($outputlangs->trans("Import").' - '.$file);
181
+		$this->workbook->getProperties()->setDescription($outputlangs->trans("Import").' - '.$file);
182 182
 
183 183
 		$this->workbook->setActiveSheetIndex(0);
184 184
 		$this->workbook->getActiveSheet()->setTitle($outputlangs->trans("Sheet"));
@@ -270,7 +270,7 @@  discard block
 block discarded – undo
270 270
 		// phpcs:enable
271 271
 		$ret = 1;
272 272
 
273
-		dol_syslog(get_class($this) . "::open_file file=" . $file);
273
+		dol_syslog(get_class($this)."::open_file file=".$file);
274 274
 
275 275
 		$reader = new Xlsx();
276 276
 		$this->workbook = $reader->load($file);
@@ -435,7 +435,7 @@  discard block
 block discarded – undo
435 435
 
436 436
 				// Define $tablewithentity_cache[$tablename] if not already defined
437 437
 				if (!isset($tablewithentity_cache[$tablename])) {	// keep this test with "isset"
438
-					dol_syslog("Check if table " . $tablename . " has an entity field");
438
+					dol_syslog("Check if table ".$tablename." has an entity field");
439 439
 					$resql = $this->db->DDLDescTable($tablename, 'entity');
440 440
 					if ($resql) {
441 441
 						$obj = $this->db->fetch_object($resql);
@@ -508,12 +508,12 @@  discard block
 block discarded – undo
508 508
 										$file = (empty($objimport->array_import_convertvalue[0][$val]['classfile']) ? $objimport->array_import_convertvalue[0][$val]['file'] : $objimport->array_import_convertvalue[0][$val]['classfile']);
509 509
 										$class = $objimport->array_import_convertvalue[0][$val]['class'];
510 510
 										$method = $objimport->array_import_convertvalue[0][$val]['method'];
511
-										if ($this->cacheconvert[$file . '_' . $class . '_' . $method . '_'][$newval] != '') {
512
-											$newval = $this->cacheconvert[$file . '_' . $class . '_' . $method . '_'][$newval];
511
+										if ($this->cacheconvert[$file.'_'.$class.'_'.$method.'_'][$newval] != '') {
512
+											$newval = $this->cacheconvert[$file.'_'.$class.'_'.$method.'_'][$newval];
513 513
 										} else {
514 514
 											$resultload = dol_include_once($file);
515 515
 											if (empty($resultload)) {
516
-												dol_print_error(null, 'Error trying to call file=' . $file . ', class=' . $class . ', method=' . $method);
516
+												dol_print_error(null, 'Error trying to call file='.$file.', class='.$class.', method='.$method);
517 517
 												break;
518 518
 											}
519 519
 											$classinstance = new $class($this->db);
@@ -555,12 +555,12 @@  discard block
 block discarded – undo
555 555
 												$param_array = array('', '', $newval);
556 556
 												call_user_func_array(array($classinstance, $method), $param_array);
557 557
 											}
558
-											$this->cacheconvert[$file . '_' . $class . '_' . $method . '_'][$newval] = $classinstance->id;
558
+											$this->cacheconvert[$file.'_'.$class.'_'.$method.'_'][$newval] = $classinstance->id;
559 559
 
560 560
 											//print 'We have made a '.$class.'->'.$method.' to get id from code '.$newval.'. ';
561 561
 											if ($classinstance->id != '') {	// id may be 0, it is a found value
562 562
 												$newval = $classinstance->id;
563
-											} elseif (! $error) {
563
+											} elseif (!$error) {
564 564
 												if (!empty($objimport->array_import_convertvalue[0][$val]['dict'])) {
565 565
 													// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
566 566
 													$this->errors[$error]['lib'] = $langs->trans('ErrorFieldValueNotIn', $key, $newval, 'code', $langs->transnoentitiesnoconv($objimport->array_import_convertvalue[0][$val]['dict']));
@@ -589,19 +589,19 @@  discard block
 block discarded – undo
589 589
 										$method = $objimport->array_import_convertvalue[0][$val]['method'];
590 590
 										$codefromfield = $objimport->array_import_convertvalue[0][$val]['codefromfield'];
591 591
 										$code = $arrayrecord[$arrayfield[$codefromfield]]['val'];
592
-										if ($this->cacheconvert[$file . '_' . $class . '_' . $method . '_' . $code][$newval] != '') {
593
-											$newval = $this->cacheconvert[$file . '_' . $class . '_' . $method . '_' . $code][$newval];
592
+										if ($this->cacheconvert[$file.'_'.$class.'_'.$method.'_'.$code][$newval] != '') {
593
+											$newval = $this->cacheconvert[$file.'_'.$class.'_'.$method.'_'.$code][$newval];
594 594
 										} else {
595 595
 											$resultload = dol_include_once($file);
596 596
 											if (empty($resultload)) {
597
-												dol_print_error(null, 'Error trying to call file=' . $file . ', class=' . $class . ', method=' . $method . ', code=' . $code);
597
+												dol_print_error(null, 'Error trying to call file='.$file.', class='.$class.', method='.$method.', code='.$code);
598 598
 												break;
599 599
 											}
600 600
 											$classinstance = new $class($this->db);
601 601
 											// Try the fetch from code and ref
602 602
 											$param_array = array('', $newval, $code);
603 603
 											call_user_func_array(array($classinstance, $method), $param_array);
604
-											$this->cacheconvert[$file . '_' . $class . '_' . $method . '_' . $code][$newval] = $classinstance->id;
604
+											$this->cacheconvert[$file.'_'.$class.'_'.$method.'_'.$code][$newval] = $classinstance->id;
605 605
 											if ($classinstance->id > 0) {    // we found record
606 606
 												$newval = $classinstance->id;
607 607
 											} else {
@@ -626,19 +626,19 @@  discard block
 block discarded – undo
626 626
 									$class = $objimport->array_import_convertvalue[0][$val]['class'];
627 627
 									$method = $objimport->array_import_convertvalue[0][$val]['method'];
628 628
 									$units = $objimport->array_import_convertvalue[0][$val]['units'];
629
-									if ($this->cacheconvert[$file . '_' . $class . '_' . $method . '_' . $units][$newval] != '') {
630
-										$newval = $this->cacheconvert[$file . '_' . $class . '_' . $method . '_' . $units][$newval];
629
+									if ($this->cacheconvert[$file.'_'.$class.'_'.$method.'_'.$units][$newval] != '') {
630
+										$newval = $this->cacheconvert[$file.'_'.$class.'_'.$method.'_'.$units][$newval];
631 631
 									} else {
632 632
 										$resultload = dol_include_once($file);
633 633
 										if (empty($resultload)) {
634
-											dol_print_error(null, 'Error trying to call file=' . $file . ', class=' . $class . ', method=' . $method . ', units=' . $units);
634
+											dol_print_error(null, 'Error trying to call file='.$file.', class='.$class.', method='.$method.', units='.$units);
635 635
 											break;
636 636
 										}
637 637
 										$classinstance = new $class($this->db);
638 638
 										// Try the fetch from code or ref
639 639
 										call_user_func_array(array($classinstance, $method), array('', '', $newval, $units));
640 640
 										$scaleorid = (($objimport->array_import_convertvalue[0][$val]['rule'] == 'fetchidfromcodeunits') ? $classinstance->id : $classinstance->scale);
641
-										$this->cacheconvert[$file . '_' . $class . '_' . $method . '_' . $units][$newval] = $scaleorid;
641
+										$this->cacheconvert[$file.'_'.$class.'_'.$method.'_'.$units][$newval] = $scaleorid;
642 642
 										//print 'We have made a '.$class.'->'.$method." to get a value from key '".$newval."' and we got '".$scaleorid."'.";exit;
643 643
 										if ($classinstance->id > 0) {	// we found record
644 644
 											$newval = $scaleorid ? $scaleorid : 0;
@@ -732,13 +732,13 @@  discard block
 block discarded – undo
732 732
 									$method = $objimport->array_import_convertvalue[0][$val]['method'];
733 733
 									$resultload = dol_include_once($file);
734 734
 									if (empty($resultload)) {
735
-										dol_print_error(null, 'Error trying to call file=' . $file . ', class=' . $class . ', method=' . $method);
735
+										dol_print_error(null, 'Error trying to call file='.$file.', class='.$class.', method='.$method);
736 736
 										break;
737 737
 									}
738 738
 									$classinstance = new $class($this->db);
739 739
 									$res = call_user_func_array(array($classinstance, $method), array(&$arrayrecord, $arrayfield, $key));
740 740
 									if (empty($classinstance->error) && empty($classinstance->errors)) {
741
-										$newval = $res; 	// We get new value computed.
741
+										$newval = $res; // We get new value computed.
742 742
 									} else {
743 743
 										$this->errors[$error]['type'] = 'CLASSERROR';
744 744
 										$this->errors[$error]['lib'] = implode(
@@ -770,16 +770,16 @@  discard block
 block discarded – undo
770 770
 									$table = $reg[2];
771 771
 									$filter = !empty($reg[3]) ? substr($reg[3], 1) : '';
772 772
 
773
-									$cachekey = $field . '@' . $table;
773
+									$cachekey = $field.'@'.$table;
774 774
 									if (!empty($filter)) {
775
-										$cachekey .= ':' . $filter;
775
+										$cachekey .= ':'.$filter;
776 776
 									}
777 777
 
778 778
 									// Load content of field@table into cache array
779 779
 									if (!is_array($this->cachefieldtable[$cachekey])) { // If content of field@table not already loaded into cache
780
-										$sql = "SELECT " . $field . " as aliasfield FROM " . $table;
780
+										$sql = "SELECT ".$field." as aliasfield FROM ".$table;
781 781
 										if (!empty($filter)) {
782
-											$sql .= ' WHERE ' . $filter;
782
+											$sql .= ' WHERE '.$filter;
783 783
 										}
784 784
 
785 785
 										$resql = $this->db->query($sql);
@@ -802,7 +802,7 @@  discard block
 block discarded – undo
802 802
 									if (!is_array($this->cachefieldtable[$cachekey]) || !in_array($newval, $this->cachefieldtable[$cachekey])) {
803 803
 										$tableforerror = $table;
804 804
 										if (!empty($filter)) {
805
-											$tableforerror .= ':' . $filter;
805
+											$tableforerror .= ':'.$filter;
806 806
 										}
807 807
 										// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
808 808
 										$this->errors[$error]['lib'] = $langs->transnoentitiesnoconv('ErrorFieldValueNotIn', $key, $newval, $field, $tableforerror);
@@ -810,7 +810,7 @@  discard block
 block discarded – undo
810 810
 										$errorforthistable++;
811 811
 										$error++;
812 812
 									}
813
-								} elseif (!preg_match('/' . $objimport->array_import_regex[0][$val] . '/i', $newval)) {
813
+								} elseif (!preg_match('/'.$objimport->array_import_regex[0][$val].'/i', $newval)) {
814 814
 									// If test is just a static regex
815 815
 									//if ($key == 19) print "xxx".$newval."zzz".$objimport->array_import_regex[0][$val]."<br>";
816 816
 									// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
@@ -839,11 +839,11 @@  discard block
 block discarded – undo
839 839
 						if (isModEnabled("socialnetworks") && strpos($fieldname, "socialnetworks") !== false) {
840 840
 							if (!in_array("socialnetworks", $listfields)) {
841 841
 								$listfields[] = "socialnetworks";
842
-								$socialkey = array_search("socialnetworks", $listfields);	// Return position of 'socialnetworks' key in array. Example socialkey=19
842
+								$socialkey = array_search("socialnetworks", $listfields); // Return position of 'socialnetworks' key in array. Example socialkey=19
843 843
 								$listvalues[$socialkey] = '';
844 844
 							}
845 845
 							if (!empty($newval) && $arrayrecord[($key)]['type'] > 0) {
846
-								$socialkey = array_search("socialnetworks", $listfields);	// Return position of 'socialnetworks' key in array. Example socialkey=19
846
+								$socialkey = array_search("socialnetworks", $listfields); // Return position of 'socialnetworks' key in array. Example socialkey=19
847 847
 								$socialnetwork = explode("_", $fieldname)[1];
848 848
 								if (empty($listvalues[$socialkey]) || $listvalues[$socialkey] == "null") {
849 849
 									$json = new stdClass();
@@ -878,10 +878,10 @@  discard block
 block discarded – undo
878 878
 				if (!empty($listfields) && is_array($objimport->array_import_fieldshidden[0])) {
879 879
 					// Loop on each hidden fields to add them into listfields/listvalues
880 880
 					foreach ($objimport->array_import_fieldshidden[0] as $key => $val) {
881
-						if (!preg_match('/^' . preg_quote($alias, '/') . '\./', $key)) {
881
+						if (!preg_match('/^'.preg_quote($alias, '/').'\./', $key)) {
882 882
 							continue; // Not a field of current table
883 883
 						}
884
-						$keyfield = preg_replace('/^' . preg_quote($alias, '/') . '\./', '', $key);
884
+						$keyfield = preg_replace('/^'.preg_quote($alias, '/').'\./', '', $key);
885 885
 
886 886
 						if (in_array($keyfield, $listfields)) {	// avoid duplicates in insert
887 887
 							continue;
@@ -909,7 +909,7 @@  discard block
 block discarded – undo
909 909
 									$type = $objimport->array_import_convertvalue[0][$fieldname]['type'];
910 910
 									$resultload = dol_include_once($file);
911 911
 									if (empty($resultload)) {
912
-										dol_print_error(null, 'Error trying to call file=' . $file . ', class=' . $class . ', method=' . $method);
912
+										dol_print_error(null, 'Error trying to call file='.$file.', class='.$class.', method='.$method);
913 913
 										break;
914 914
 									}
915 915
 									$classinstance = new $class($this->db);
@@ -945,7 +945,7 @@  discard block
 block discarded – undo
945 945
 								}
946 946
 							}
947 947
 						} else {
948
-							$this->errors[$error]['lib'] = 'Bad value of profile setup ' . $val . ' for array_import_fieldshidden';
948
+							$this->errors[$error]['lib'] = 'Bad value of profile setup '.$val.' for array_import_fieldshidden';
949 949
 							$this->errors[$error]['type'] = 'Import profile setup';
950 950
 							$error++;
951 951
 						}
@@ -972,14 +972,14 @@  discard block
 block discarded – undo
972 972
 							// We do SELECT to get the rowid, if we already have the rowid, it's to be used below for related tables (extrafields)
973 973
 
974 974
 							if (empty($lastinsertid)) {	// No insert done yet for a parent table
975
-								$sqlSelect = "SELECT ".$fname." FROM " . $tablename;
975
+								$sqlSelect = "SELECT ".$fname." FROM ".$tablename;
976 976
 
977 977
 								$data = array_combine($listfields, $listvalues);
978 978
 
979
-								$where = array();	// filters to forge SQL request
979
+								$where = array(); // filters to forge SQL request
980 980
 								// @phpstan-ignore-next-line
981 981
 								'@phan-var string[] $where';
982
-								$filters = array();	// filters to forge output error message
982
+								$filters = array(); // filters to forge output error message
983 983
 								foreach ($updatekeys as $key) {
984 984
 									$col = $objimport->array_import_updatekeys[0][$key];
985 985
 									$key = preg_replace('/^.*\./i', '', $key);
@@ -1004,7 +1004,7 @@  discard block
 block discarded – undo
1004 1004
 									$where[] = "entity IN (".getEntity($this->getElementFromTableWithPrefix($tablename)).")";
1005 1005
 									$filters[] = "entity IN (".getEntity($this->getElementFromTableWithPrefix($tablename)).")";
1006 1006
 								}
1007
-								$sqlSelect .= " WHERE " . implode(' AND ', $where);
1007
+								$sqlSelect .= " WHERE ".implode(' AND ', $where);
1008 1008
 
1009 1009
 								$resql = $this->db->query($sqlSelect);
1010 1010
 								if ($resql) {
@@ -1035,7 +1035,7 @@  discard block
 block discarded – undo
1035 1035
 								// a direct insert into subtable extrafields, but when me wake an update, the insertid is defined and the child record
1036 1036
 								// may already exists. So we rescan the extrafield table to know if record exists or not for the rowid.
1037 1037
 								// Note: For extrafield tablename, we have in importfieldshidden_array an entry 'extra.fk_object'=>'lastrowid-tableparent' so $keyfield is 'fk_object'
1038
-								$sqlSelect = "SELECT rowid FROM " . $tablename;
1038
+								$sqlSelect = "SELECT rowid FROM ".$tablename;
1039 1039
 
1040 1040
 
1041 1041
 								if (empty($keyfield)) {
@@ -1069,35 +1069,35 @@  discard block
 block discarded – undo
1069 1069
 								// We db escape social network field because he isn't in field creation
1070 1070
 								if (in_array("socialnetworks", $listfields)) {
1071 1071
 									$socialkey = array_search("socialnetworks", $listfields);
1072
-									$tmpsql =  $listvalues[$socialkey];
1072
+									$tmpsql = $listvalues[$socialkey];
1073 1073
 									$listvalues[$socialkey] = "'".$this->db->escape($tmpsql)."'";
1074 1074
 								}
1075 1075
 
1076 1076
 								// Build SQL UPDATE request
1077
-								$sqlstart = "UPDATE " . $tablename;
1077
+								$sqlstart = "UPDATE ".$tablename;
1078 1078
 
1079 1079
 								$data = array_combine($listfields, $listvalues);
1080 1080
 								$set = array();
1081 1081
 								foreach ($data as $key => $val) {
1082
-									$set[] = $key." = ".$val;	// $val was escaped/sanitized previously
1082
+									$set[] = $key." = ".$val; // $val was escaped/sanitized previously
1083 1083
 								}
1084
-								$sqlstart .= " SET " . implode(', ', $set) . ", import_key = '" . $this->db->escape($importid) . "'";
1084
+								$sqlstart .= " SET ".implode(', ', $set).", import_key = '".$this->db->escape($importid)."'";
1085 1085
 
1086 1086
 								if (empty($keyfield)) {
1087 1087
 									$keyfield = 'rowid';
1088 1088
 								}
1089
-								$sqlend = " WHERE " . $keyfield . " = ".((int) $lastinsertid);
1089
+								$sqlend = " WHERE ".$keyfield." = ".((int) $lastinsertid);
1090 1090
 
1091 1091
 								if ($is_table_category_link) {
1092 1092
 									'@phan-var-force string[] $where';
1093
-									$sqlend = " WHERE " . implode(' AND ', $where);
1093
+									$sqlend = " WHERE ".implode(' AND ', $where);
1094 1094
 								}
1095 1095
 
1096 1096
 								if (!empty($tablewithentity_cache[$tablename])) {
1097 1097
 									$sqlend .= " AND entity IN (".getEntity($this->getElementFromTableWithPrefix($tablename)).")";
1098 1098
 								}
1099 1099
 
1100
-								$sql = $sqlstart . $sqlend;
1100
+								$sql = $sqlstart.$sqlend;
1101 1101
 
1102 1102
 								// Run update request
1103 1103
 								$resql = $this->db->query($sql);
@@ -1118,22 +1118,22 @@  discard block
 block discarded – undo
1118 1118
 							// We db escape social network field because he isn't in field creation
1119 1119
 							if (in_array("socialnetworks", $listfields)) {
1120 1120
 								$socialkey = array_search("socialnetworks", $listfields);
1121
-								$tmpsql =  $listvalues[$socialkey];
1121
+								$tmpsql = $listvalues[$socialkey];
1122 1122
 								$listvalues[$socialkey] = "'".$this->db->escape($tmpsql)."'";
1123 1123
 							}
1124 1124
 
1125 1125
 							// Build SQL INSERT request
1126
-							$sqlstart = "INSERT INTO " . $tablename . "(" . implode(", ", $listfields) . ", import_key";
1127
-							$sqlend = ") VALUES(" . implode(', ', $listvalues) . ", '" . $this->db->escape($importid) . "'";
1126
+							$sqlstart = "INSERT INTO ".$tablename."(".implode(", ", $listfields).", import_key";
1127
+							$sqlend = ") VALUES(".implode(', ', $listvalues).", '".$this->db->escape($importid)."'";
1128 1128
 							if (!empty($tablewithentity_cache[$tablename])) {
1129 1129
 								$sqlstart .= ", entity";
1130
-								$sqlend .= ", " . $conf->entity;
1130
+								$sqlend .= ", ".$conf->entity;
1131 1131
 							}
1132 1132
 							if (!empty($objimport->array_import_tables_creator[0][$alias])) {
1133
-								$sqlstart .= ", " . $objimport->array_import_tables_creator[0][$alias];
1134
-								$sqlend .= ", " . $user->id;
1133
+								$sqlstart .= ", ".$objimport->array_import_tables_creator[0][$alias];
1134
+								$sqlend .= ", ".$user->id;
1135 1135
 							}
1136
-							$sql = $sqlstart . $sqlend . ")";
1136
+							$sql = $sqlstart.$sqlend.")";
1137 1137
 							//dol_syslog("import_xlsx.modules", LOG_DEBUG);
1138 1138
 
1139 1139
 							// Run insert request
Please login to merge, or discard this patch.
htdocs/comm/propal/class/propal.class.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -666,7 +666,7 @@  discard block
 block discarded – undo
666 666
 			}
667 667
 			$txlocaltax1 = price2num($txlocaltax1);
668 668
 			$txlocaltax2 = price2num($txlocaltax2);
669
-			$pa_ht = price2num($pa_ht);  // do not convert to float here, it breaks the functioning of $pa_ht_isemptystring
669
+			$pa_ht = price2num($pa_ht); // do not convert to float here, it breaks the functioning of $pa_ht_isemptystring
670 670
 			if ($price_base_type == 'HT') {
671 671
 				$pu = $pu_ht;
672 672
 			} else {
@@ -894,7 +894,7 @@  discard block
 block discarded – undo
894 894
 		}
895 895
 		$txlocaltax1 = price2num($txlocaltax1);
896 896
 		$txlocaltax2 = price2num($txlocaltax2);
897
-		$pa_ht = price2num($pa_ht);  // do not convert to float here, it breaks the functioning of $pa_ht_isemptystring
897
+		$pa_ht = price2num($pa_ht); // do not convert to float here, it breaks the functioning of $pa_ht_isemptystring
898 898
 		if (empty($qty) && empty($special_code)) {
899 899
 			$special_code = 3; // Set option tag
900 900
 		}
@@ -1479,7 +1479,7 @@  discard block
 block discarded – undo
1479 1479
 			if ($objsoc->id > 0 && !empty($object->lines)) {
1480 1480
 				if ($update_prices === true && getDolGlobalString('PRODUIT_CUSTOMER_PRICES')) {
1481 1481
 					// If price per customer
1482
-					require_once DOL_DOCUMENT_ROOT . '/product/class/productcustomerprice.class.php';
1482
+					require_once DOL_DOCUMENT_ROOT.'/product/class/productcustomerprice.class.php';
1483 1483
 				}
1484 1484
 
1485 1485
 				foreach ($object->lines as $line) {
@@ -1673,7 +1673,7 @@  discard block
 block discarded – undo
1673 1673
 				$this->ref_customer         = $obj->ref_client;
1674 1674
 				$this->ref_ext              = $obj->ref_ext;
1675 1675
 
1676
-				$this->total                = $obj->total_ttc;			// TODO deprecated
1676
+				$this->total                = $obj->total_ttc; // TODO deprecated
1677 1677
 				$this->total_ttc            = $obj->total_ttc;
1678 1678
 				$this->total_ht             = $obj->total_ht;
1679 1679
 				$this->total_tva            = $obj->total_tva;
@@ -2588,7 +2588,7 @@  discard block
 block discarded – undo
2588 2588
 	 */
2589 2589
 	public function closeProposal($user, $status, $note_private = '', $notrigger = 0, $note_public = '')
2590 2590
 	{
2591
-		global $langs,$conf;
2591
+		global $langs, $conf;
2592 2592
 
2593 2593
 		$error = 0;
2594 2594
 		$now = dol_now();
@@ -2623,10 +2623,10 @@  discard block
 block discarded – undo
2623 2623
 		if ($resql) {
2624 2624
 			// Status self::STATUS_REFUSED by default
2625 2625
 			$modelpdf = getDolGlobalString('PROPALE_ADDON_PDF_ODT_CLOSED', $this->model_pdf);
2626
-			$trigger_name = 'PROPAL_CLOSE_REFUSED';		// used later in call_trigger()
2626
+			$trigger_name = 'PROPAL_CLOSE_REFUSED'; // used later in call_trigger()
2627 2627
 
2628 2628
 			if ($status == self::STATUS_SIGNED) {	// Status self::STATUS_SIGNED
2629
-				$trigger_name = 'PROPAL_CLOSE_SIGNED';	// used later in call_trigger()
2629
+				$trigger_name = 'PROPAL_CLOSE_SIGNED'; // used later in call_trigger()
2630 2630
 				$modelpdf = getDolGlobalString('PROPALE_ADDON_PDF_ODT_TOBILL') ? $conf->global->PROPALE_ADDON_PDF_ODT_TOBILL : $this->model_pdf;
2631 2631
 
2632 2632
 				// The connected company is classified as a client
@@ -2793,10 +2793,10 @@  discard block
 block discarded – undo
2793 2793
 
2794 2794
 		$this->db->begin();
2795 2795
 
2796
-		$sql = "UPDATE ". MAIN_DB_PREFIX . "propal";
2797
-		$sql .= " SET fk_statut = " . self::STATUS_CANCELED . ",";
2798
-		$sql .= " fk_user_modif = " . ((int) $user->id);
2799
-		$sql .= " WHERE rowid = " . ((int) $this->id);
2796
+		$sql = "UPDATE ".MAIN_DB_PREFIX."propal";
2797
+		$sql .= " SET fk_statut = ".self::STATUS_CANCELED.",";
2798
+		$sql .= " fk_user_modif = ".((int) $user->id);
2799
+		$sql .= " WHERE rowid = ".((int) $this->id);
2800 2800
 
2801 2801
 		dol_syslog(get_class($this)."::cancel", LOG_DEBUG);
2802 2802
 		if ($this->db->query($sql)) {
@@ -3159,7 +3159,7 @@  discard block
 block discarded – undo
3159 3159
 					}
3160 3160
 				}
3161 3161
 				if (file_exists($dir)) {
3162
-					$res = @dol_delete_dir_recursive($dir);		// delete files physically + into ecm tables
3162
+					$res = @dol_delete_dir_recursive($dir); // delete files physically + into ecm tables
3163 3163
 					if (!$res) {
3164 3164
 						$this->error = 'ErrorFailToDeleteDir';
3165 3165
 						$this->errors[] = $this->error;
@@ -3563,7 +3563,7 @@  discard block
 block discarded – undo
3563 3563
 		$this->multicurrency_code = $conf->currency;
3564 3564
 
3565 3565
 		// Lines
3566
-		$nbp = min(1000, GETPOSTINT('nblines') ? GETPOSTINT('nblines') : 5);	// We can force the nb of lines to test from command line (but not more than 1000)
3566
+		$nbp = min(1000, GETPOSTINT('nblines') ? GETPOSTINT('nblines') : 5); // We can force the nb of lines to test from command line (but not more than 1000)
3567 3567
 		$xnbp = 0;
3568 3568
 		while ($xnbp < $nbp) {
3569 3569
 			$line = new PropaleLigne($this->db);
@@ -3893,7 +3893,7 @@  discard block
 block discarded – undo
3893 3893
 		}
3894 3894
 
3895 3895
 		global $action;
3896
-		$hookmanager->initHooks(array($this->element . 'dao'));
3896
+		$hookmanager->initHooks(array($this->element.'dao'));
3897 3897
 		$parameters = array('id' => $this->id, 'getnomurl' => &$result);
3898 3898
 		$reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
3899 3899
 		if ($reshook > 0) {
Please login to merge, or discard this patch.
htdocs/product/inventory/class/inventory.class.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -53,10 +53,10 @@  discard block
 block discarded – undo
53 53
 	 */
54 54
 	public $picto = 'inventory';
55 55
 
56
-	const STATUS_DRAFT     = 0;		// Draft
57
-	const STATUS_VALIDATED = 1;		// Inventory is in process
58
-	const STATUS_RECORDED  = 2;		// Inventory is finisged. Stock movement has been recorded.
59
-	const STATUS_CANCELED  = 9;		// Canceled
56
+	const STATUS_DRAFT     = 0; // Draft
57
+	const STATUS_VALIDATED = 1; // Inventory is in process
58
+	const STATUS_RECORDED  = 2; // Inventory is finisged. Stock movement has been recorded.
59
+	const STATUS_CANCELED  = 9; // Canceled
60 60
 
61 61
 	/**
62 62
 	 *  'type' field format ('integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter]]', 'sellist:TableName:LabelFieldName[:KeyFieldName[:KeyFieldParent[:Filter]]]', 'varchar(x)', 'double(24,8)', 'real', 'price', 'text', 'text:none', 'html', 'date', 'datetime', 'timestamp', 'duration', 'mail', 'phone', 'url', 'password')
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
 		'fk_warehouse'       => array('type' => 'integer:Entrepot:product/stock/class/entrepot.class.php', 'label' => 'Warehouse', 'visible' => 1, 'enabled' => 1, 'position' => 30, 'index' => 1, 'help' => 'InventoryForASpecificWarehouse', 'picto' => 'stock', 'css' => 'minwidth300 maxwidth500 widthcentpercentminusx', 'csslist' => 'tdoverflowmax150'),
97 97
 		'fk_product'         => array('type' => 'integer:Product:product/class/product.class.php', 'label' => 'Product', 'get_name_url_params' => '0::0:-1:0::1', 'visible' => 1, 'enabled' => 1, 'position' => 32, 'index' => 1, 'help' => 'InventoryForASpecificProduct', 'picto' => 'product', 'css' => 'minwidth300 maxwidth500 widthcentpercentminusx', 'csslist' => 'tdoverflowmax150'),
98 98
 		'categories_product' => array('type' => 'chkbxlst:categorie:label:rowid::type=0:0:', 'label' => 'OrProductsWithCategories', 'visible' => 3, 'enabled' => 1, 'position' => 33, 'help' => '', 'picto' => 'category', 'css' => 'minwidth300 maxwidth500 widthcentpercentminusx'),
99
-		'date_inventory'     => array('type' => 'date', 'label' => 'DateValue', 'visible' => 1, 'enabled' => '$conf->global->STOCK_INVENTORY_ADD_A_VALUE_DATE', 'position' => 35, 'csslist' => 'nowraponall'),	// This date is not used so disabled by default.
99
+		'date_inventory'     => array('type' => 'date', 'label' => 'DateValue', 'visible' => 1, 'enabled' => '$conf->global->STOCK_INVENTORY_ADD_A_VALUE_DATE', 'position' => 35, 'csslist' => 'nowraponall'), // This date is not used so disabled by default.
100 100
 		'date_creation'      => array('type' => 'datetime', 'label' => 'DateCreation', 'enabled' => 1, 'visible' => -2, 'notnull' => 1, 'position' => 500, 'csslist' => 'nowraponall'),
101 101
 		'tms'                => array('type' => 'timestamp', 'label' => 'DateModification', 'enabled' => 1, 'visible' => -2, 'notnull' => 1, 'position' => 501, 'csslist' => 'nowraponall'),
102 102
 		'date_validation'    => array('type' => 'datetime', 'label' => 'DateValidation', 'visible' => -2, 'enabled' => 1, 'position' => 502, 'csslist' => 'nowraponall'),
@@ -294,7 +294,7 @@  discard block
 block discarded – undo
294 294
 					$TChildWarehouses = array();
295 295
 					$this->getChildWarehouse($this->fk_warehouse, $TChildWarehouses);
296 296
 					if (!empty($TChildWarehouses)) {
297
-						$sql .= " OR ps.fk_entrepot IN (" . $this->db->sanitize(implode(',', $TChildWarehouses)) . ")";
297
+						$sql .= " OR ps.fk_entrepot IN (".$this->db->sanitize(implode(',', $TChildWarehouses)).")";
298 298
 					}
299 299
 				}
300 300
 				$sql .= ')';
Please login to merge, or discard this patch.
htdocs/reception/class/reception.class.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
 		if (getDolGlobalString('RECEPTION_ADDON_NUMBER')) {
224 224
 			$mybool = false;
225 225
 
226
-			$file = getDolGlobalString('RECEPTION_ADDON_NUMBER') . ".php";
226
+			$file = getDolGlobalString('RECEPTION_ADDON_NUMBER').".php";
227 227
 			$classname = getDolGlobalString('RECEPTION_ADDON_NUMBER');
228 228
 
229 229
 			// Include file with class
@@ -785,13 +785,13 @@  discard block
 block discarded – undo
785 785
 				$this->fetch_origin();
786 786
 				if ($this->origin_object instanceof CommonObject && empty($this->origin_object->lines)) {
787 787
 					$res = $this->origin_object->fetch_lines();
788
-					$this->commandeFournisseur = null;	// deprecated
788
+					$this->commandeFournisseur = null; // deprecated
789 789
 					if ($res < 0) {
790 790
 						return $res;
791 791
 					}
792 792
 				} elseif ($this->origin_object instanceof CommandeFournisseur && empty($this->origin_object->lines)) {
793 793
 					$res = $this->origin_object->fetch_lines();
794
-					$this->commandeFournisseur = $this->origin_object;	// deprecated
794
+					$this->commandeFournisseur = $this->origin_object; // deprecated
795 795
 					if ($res < 0) {
796 796
 						return $res;
797 797
 					}
@@ -925,10 +925,10 @@  discard block
 block discarded – undo
925 925
 			// check sell-by / eat-by date is mandatory
926 926
 			$errorMsgArr = Productlot::checkSellOrEatByMandatoryFromProductAndDates($product, $sellby, $eatby);
927 927
 			if (!empty($errorMsgArr)) {
928
-				$errorMessage = '<b>' . $product->ref . '</b> : ';
928
+				$errorMessage = '<b>'.$product->ref.'</b> : ';
929 929
 				$errorMessage .= '<ul>';
930 930
 				foreach ($errorMsgArr as $errorMsg) {
931
-					$errorMessage .= '<li>' . $errorMsg . '</li>';
931
+					$errorMessage .= '<li>'.$errorMsg.'</li>';
932 932
 				}
933 933
 				$errorMessage .= '</ul>';
934 934
 				$this->error = $errorMessage;
@@ -1373,7 +1373,7 @@  discard block
 block discarded – undo
1373 1373
 		$result .= $linkend;
1374 1374
 
1375 1375
 		global $action;
1376
-		$hookmanager->initHooks(array($this->element . 'dao'));
1376
+		$hookmanager->initHooks(array($this->element.'dao'));
1377 1377
 		$parameters = array('id' => $this->id, 'getnomurl' => &$result);
1378 1378
 		$reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
1379 1379
 		if ($reshook > 0) {
@@ -1419,7 +1419,7 @@  discard block
 block discarded – undo
1419 1419
 		if (getDolGlobalInt("STOCK_CALCULATE_ON_RECEPTION_CLOSE")) {
1420 1420
 			$this->labelStatus[1]  = 'StatusReceptionValidatedToReceive';
1421 1421
 		}
1422
-		$this->labelStatus[2]  = 'StatusReceptionProcessed';
1422
+		$this->labelStatus[2] = 'StatusReceptionProcessed';
1423 1423
 
1424 1424
 		// List of short language codes for status
1425 1425
 		$this->labelStatusShort[-1] = 'StatusReceptionCanceledShort';
@@ -1524,12 +1524,12 @@  discard block
 block discarded – undo
1524 1524
 
1525 1525
 		$this->fk_incoterms = 1;
1526 1526
 
1527
-		$nbp = min(1000, GETPOSTINT('nblines') ? GETPOSTINT('nblines') : 5);	// We can force the nb of lines to test from command line (but not more than 1000)
1527
+		$nbp = min(1000, GETPOSTINT('nblines') ? GETPOSTINT('nblines') : 5); // We can force the nb of lines to test from command line (but not more than 1000)
1528 1528
 		$xnbp = 0;
1529 1529
 		while ($xnbp < $nbp) {
1530 1530
 			$line = new CommandeFournisseurDispatch($this->db);
1531 1531
 			$line->desc = $langs->trans("Description")." ".$xnbp;
1532
-			$line->libelle = $langs->trans("Description")." ".$xnbp;	// deprecated
1532
+			$line->libelle = $langs->trans("Description")." ".$xnbp; // deprecated
1533 1533
 			$line->label = $langs->trans("Description")." ".$xnbp;
1534 1534
 			$line->qty = 10;
1535 1535
 
Please login to merge, or discard this patch.