Completed
Branch develop (c9ecc5)
by
unknown
23:16
created
htdocs/modulebuilder/template/myobject_list.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
 $backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page
112 112
 $optioncss  = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
113 113
 $mode       = GETPOST('mode', 'aZ'); // The display mode ('list', 'kanban', 'hierarchy', 'calendar', 'gantt', ...)
114
-$groupby = GETPOST('groupby', 'aZ09');	// Example: $groupby = 'p.fk_opp_status' or $groupby = 'p.fk_statut'
114
+$groupby = GETPOST('groupby', 'aZ09'); // Example: $groupby = 'p.fk_opp_status' or $groupby = 'p.fk_statut'
115 115
 
116 116
 $id = GETPOSTINT('id');
117 117
 $ref = GETPOST('ref', 'alpha');
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
 $object = new MyObject($db);
134 134
 $extrafields = new ExtraFields($db);
135 135
 $diroutputmassaction = $conf->mymodule->dir_output.'/temp/massgeneration/'.$user->id;
136
-$hookmanager->initHooks(array($contextpage)); 	// Note that conf->hooks_modules contains array of activated contexes
136
+$hookmanager->initHooks(array($contextpage)); // Note that conf->hooks_modules contains array of activated contexes
137 137
 
138 138
 // Fetch optionals attributes and labels
139 139
 $extrafields->fetch_name_optionals_label($object->table_element);
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
 
144 144
 // Default sort order (if not yet defined by previous GETPOST)
145 145
 if (!$sortfield) {
146
-	reset($object->fields);					// Reset is required to avoid key() to return null.
146
+	reset($object->fields); // Reset is required to avoid key() to return null.
147 147
 	$sortfield = "t.".key($object->fields); // Set here default search field. By default 1st field in definition.
148 148
 }
149 149
 if (!$sortorder) {
@@ -462,7 +462,7 @@  discard block
 block discarded – undo
462 462
 // Output page
463 463
 // --------------------------------------------------------------------
464 464
 
465
-llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'mod-mymodule page-list bodyforlist');	// Can use also classforhorizontalscrolloftabs instead of bodyforlist for a horizontal scroll in the table instead of page
465
+llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'mod-mymodule page-list bodyforlist'); // Can use also classforhorizontalscrolloftabs instead of bodyforlist for a horizontal scroll in the table instead of page
466 466
 
467 467
 // Example : Adding jquery code
468 468
 // print '<script type="text/javascript">
@@ -598,7 +598,7 @@  discard block
 block discarded – undo
598 598
 }
599 599
 
600 600
 $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
601
-$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, $conf->main_checkbox_left_column);  // This also change content of $arrayfields with user setup
601
+$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, $conf->main_checkbox_left_column); // This also change content of $arrayfields with user setup
602 602
 $selectedfields = ($mode != 'kanban' ? $htmlofselectarray : '');
603 603
 $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
604 604
 
@@ -691,7 +691,7 @@  discard block
 block discarded – undo
691 691
 	} elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && !in_array($key, array('id', 'rowid', 'ref', 'status')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) {
692 692
 		$cssforfield .= ($cssforfield ? ' ' : '').'right';
693 693
 	}
694
-	$cssforfield = preg_replace('/small\s*/', '', $cssforfield);	// the 'small' css must not be used for the title label
694
+	$cssforfield = preg_replace('/small\s*/', '', $cssforfield); // the 'small' css must not be used for the title label
695 695
 	if (!empty($arrayfields['t.'.$key]['checked'])) {
696 696
 		print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, ($cssforfield ? 'class="'.$cssforfield.'"' : ''), $sortfield, $sortorder, ($cssforfield ? $cssforfield.' ' : ''), 0, (empty($val['helplist']) ? '' : $val['helplist']))."\n";
697 697
 		$totalarray['nbfield']++;
Please login to merge, or discard this patch.
htdocs/societe/list.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -150,20 +150,20 @@  discard block
 block discarded – undo
150 150
 $search_date_creation_startmonth = GETPOSTINT('search_date_creation_startmonth');
151 151
 $search_date_creation_startyear = GETPOSTINT('search_date_creation_startyear');
152 152
 $search_date_creation_startday = GETPOSTINT('search_date_creation_startday');
153
-$search_date_creation_start = dol_mktime(0, 0, 0, $search_date_creation_startmonth, $search_date_creation_startday, $search_date_creation_startyear);	// Use tzserver
153
+$search_date_creation_start = dol_mktime(0, 0, 0, $search_date_creation_startmonth, $search_date_creation_startday, $search_date_creation_startyear); // Use tzserver
154 154
 $search_date_creation_endmonth = GETPOSTINT('search_date_creation_endmonth');
155 155
 $search_date_creation_endyear = GETPOSTINT('search_date_creation_endyear');
156 156
 $search_date_creation_endday = GETPOSTINT('search_date_creation_endday');
157
-$search_date_creation_end = dol_mktime(23, 59, 59, $search_date_creation_endmonth, $search_date_creation_endday, $search_date_creation_endyear);	// Use tzserver
157
+$search_date_creation_end = dol_mktime(23, 59, 59, $search_date_creation_endmonth, $search_date_creation_endday, $search_date_creation_endyear); // Use tzserver
158 158
 
159 159
 $search_date_modif_startmonth = GETPOSTINT('search_date_modif_startmonth');
160 160
 $search_date_modif_startyear = GETPOSTINT('search_date_modif_startyear');
161 161
 $search_date_modif_startday = GETPOSTINT('search_date_modif_startday');
162
-$search_date_modif_start = dol_mktime(0, 0, 0, $search_date_modif_startmonth, $search_date_modif_startday, $search_date_modif_startyear);	// Use tzserver
162
+$search_date_modif_start = dol_mktime(0, 0, 0, $search_date_modif_startmonth, $search_date_modif_startday, $search_date_modif_startyear); // Use tzserver
163 163
 $search_date_modif_endmonth = GETPOSTINT('search_date_modif_endmonth');
164 164
 $search_date_modif_endyear = GETPOSTINT('search_date_modif_endyear');
165 165
 $search_date_modif_endday = GETPOSTINT('search_date_modif_endday');
166
-$search_date_modif_end = dol_mktime(23, 59, 59, $search_date_modif_endmonth, $search_date_modif_endday, $search_date_modif_endyear);	// Use tzserver
166
+$search_date_modif_end = dol_mktime(23, 59, 59, $search_date_modif_endmonth, $search_date_modif_endday, $search_date_modif_endyear); // Use tzserver
167 167
 
168 168
 $type = GETPOST('type', 'alpha');
169 169
 $place = GETPOST('place', 'aZ09') ? GETPOST('place', 'aZ09') : '0'; // $place is string id of table for Bar or Restaurant
@@ -637,7 +637,7 @@  discard block
 block discarded – undo
637 637
 }
638 638
 // Search on sale representative
639 639
 if (!empty($search_sale) && $search_sale != '-1') {
640
-	$search_sale_req = array_filter($search_sale, function (string $value): bool {
640
+	$search_sale_req = array_filter($search_sale, function(string $value): bool {
641 641
 		$value = intval($value);
642 642
 		return $value >= 0;
643 643
 	});
@@ -665,7 +665,7 @@  discard block
 block discarded – undo
665 665
 			if ($searchCategoryCustomerOperator == 0) {
666 666
 				$searchCategoryCustomerSqlList[] = " EXISTS (SELECT ck.fk_soc FROM ".MAIN_DB_PREFIX."categorie_societe as ck WHERE s.rowid = ck.fk_soc AND ck.fk_categorie = ".((int) $searchCategoryCustomer).")";
667 667
 			} else {
668
-				$listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryCustomer);
668
+				$listofcategoryid .= ($listofcategoryid ? ', ' : '').((int) $searchCategoryCustomer);
669 669
 			}
670 670
 		}
671 671
 	}
@@ -694,7 +694,7 @@  discard block
 block discarded – undo
694 694
 			if ($searchCategorySupplierOperator == 0) {
695 695
 				$searchCategorySupplierSqlList[] = " EXISTS (SELECT ck.fk_soc FROM ".MAIN_DB_PREFIX."categorie_fournisseur as ck WHERE s.rowid = ck.fk_soc AND ck.fk_categorie = ".((int) $searchCategorySupplier).")";
696 696
 			} else {
697
-				$listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategorySupplier);
697
+				$listofcategoryid .= ($listofcategoryid ? ', ' : '').((int) $searchCategorySupplier);
698 698
 			}
699 699
 		}
700 700
 	}
@@ -989,7 +989,7 @@  discard block
 block discarded – undo
989 989
 }
990 990
 if (is_array($search_sale)) {
991 991
 	foreach ($search_sale as $sale_id) {
992
-		$param .= '&search_sale[]=' . urlencode($sale_id);
992
+		$param .= '&search_sale[]='.urlencode($sale_id);
993 993
 	}
994 994
 }
995 995
 if ($search_id > 0) {
@@ -1153,7 +1153,7 @@  discard block
 block discarded – undo
1153 1153
 	$param .= '&search_date_modif_endday='.urlencode((string) ($search_date_modif_endday));
1154 1154
 }
1155 1155
 if ($search_date_modif_end) {
1156
-	$param .= '&search_date_modif_end=' . urlencode($search_date_modif_end);
1156
+	$param .= '&search_date_modif_end='.urlencode($search_date_modif_end);
1157 1157
 }
1158 1158
 
1159 1159
 // Add $param from extra fields
@@ -1330,7 +1330,7 @@  discard block
 block discarded – undo
1330 1330
 	$moreforfilter .= '<div class="divsearchfield">';
1331 1331
 	$tmptitle = $langs->trans('SalesRepresentatives');
1332 1332
 	$moreforfilter .= img_picto($tmptitle, 'user', 'class="pictofixedwidth"');
1333
-	$moreforfilter .=  $form->multiselectarray('search_sale', $userlist, $search_sale, 0, 0, '', 0, 300, '', '', $langs->trans('SalesRepresentatives'), 1);
1333
+	$moreforfilter .= $form->multiselectarray('search_sale', $userlist, $search_sale, 0, 0, '', 0, 300, '', '', $langs->trans('SalesRepresentatives'), 1);
1334 1334
 	$moreforfilter .= '</div>';
1335 1335
 }
1336 1336
 if (!empty($moreforfilter)) {
@@ -1343,7 +1343,7 @@  discard block
 block discarded – undo
1343 1343
 }
1344 1344
 
1345 1345
 $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
1346
-$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, $conf->main_checkbox_left_column);  // This also change content of $arrayfields with user setup
1346
+$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, $conf->main_checkbox_left_column); // This also change content of $arrayfields with user setup
1347 1347
 $selectedfields = ($mode != 'kanban' ? $htmlofselectarray : '');
1348 1348
 $selectedfields .= ((count($arrayofmassactions) && $contextpage != 'poslist') ? $form->showCheckAddButtons('checkforselect', 1) : '');
1349 1349
 
@@ -1827,16 +1827,16 @@  discard block
 block discarded – undo
1827 1827
 // IP Address
1828 1828
 if (!empty($arrayfields['s.ip']['checked'])) {
1829 1829
 	print_liste_field_titre($arrayfields['s.ip']['label'], $_SERVER["PHP_SELF"], "s.ip", "", $param, '', $sortfield, $sortorder, 'center nowrap ');
1830
-	$totalarray['nbfield']++;	// For the column action
1830
+	$totalarray['nbfield']++; // For the column action
1831 1831
 }
1832 1832
 // Date creation
1833 1833
 if (!empty($arrayfields['s.datec']['checked'])) {
1834 1834
 	print_liste_field_titre($arrayfields['s.datec']['label'], $_SERVER["PHP_SELF"], "s.datec", "", $param, '', $sortfield, $sortorder, 'center nowrap ');
1835
-	$totalarray['nbfield']++;	// For the column action
1835
+	$totalarray['nbfield']++; // For the column action
1836 1836
 }
1837 1837
 if (!empty($arrayfields['s.tms']['checked'])) {
1838 1838
 	print_liste_field_titre($arrayfields['s.tms']['label'], $_SERVER["PHP_SELF"], "s.tms", "", $param, '', $sortfield, $sortorder, 'center nowrap ');
1839
-	$totalarray['nbfield']++;	// For the column action
1839
+	$totalarray['nbfield']++; // For the column action
1840 1840
 }
1841 1841
 if (!empty($arrayfields['s.note_public']['checked'])) {
1842 1842
 	print_liste_field_titre($arrayfields['s.note_public']['label'], $_SERVER["PHP_SELF"], "s.note_public", "", $param, '', $sortfield, $sortorder, 'center nowrap ');
@@ -1848,11 +1848,11 @@  discard block
 block discarded – undo
1848 1848
 }
1849 1849
 if (!empty($arrayfields['s.status']['checked'])) {
1850 1850
 	print_liste_field_titre($arrayfields['s.status']['label'], $_SERVER["PHP_SELF"], "s.status", "", $param, '', $sortfield, $sortorder, 'center ');
1851
-	$totalarray['nbfield']++;	// For the column action
1851
+	$totalarray['nbfield']++; // For the column action
1852 1852
 }
1853 1853
 if (!empty($arrayfields['s.import_key']['checked'])) {
1854 1854
 	print_liste_field_titre($arrayfields['s.import_key']['label'], $_SERVER["PHP_SELF"], "s.import_key", "", $param, '', $sortfield, $sortorder, 'center ');
1855
-	$totalarray['nbfield']++;	// For the column action
1855
+	$totalarray['nbfield']++; // For the column action
1856 1856
 }
1857 1857
 // Action column
1858 1858
 if (!$conf->main_checkbox_left_column) {
Please login to merge, or discard this patch.
htdocs/societe/class/societe.class.php 1 patch
Spacing   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -1081,8 +1081,8 @@  discard block
 block discarded – undo
1081 1081
 			$sql .= ", '".$this->db->escape($this->ip)."'";
1082 1082
 			if (!getDolGlobalString('MAIN_COMPANY_PERENTITY_SHARED')) {
1083 1083
 				$sql .= ", ".(empty($this->vat_reverse_charge) ? '0' : '1');
1084
-				$sql .= ", '" . $this->db->escape($this->accountancy_code_buy) . "'";
1085
-				$sql .= ", '" . $this->db->escape($this->accountancy_code_sell) . "'";
1084
+				$sql .= ", '".$this->db->escape($this->accountancy_code_buy)."'";
1085
+				$sql .= ", '".$this->db->escape($this->accountancy_code_sell)."'";
1086 1086
 			}
1087 1087
 			$sql .= ")";
1088 1088
 
@@ -1135,7 +1135,7 @@  discard block
 block discarded – undo
1135 1135
 				}
1136 1136
 
1137 1137
 				if ($ret >= 0) {
1138
-					if (! $notrigger) {
1138
+					if (!$notrigger) {
1139 1139
 						// Call trigger
1140 1140
 						$result = $this->call_trigger('COMPANY_CREATE', $user);
1141 1141
 						if ($result < 0) {
@@ -1383,7 +1383,7 @@  discard block
 block discarded – undo
1383 1383
 						if ($this->id_prof_exists($keymin, $vallabel, ($this->id > 0 ? $this->id : 0))) {
1384 1384
 							$langs->loadLangs(array("errors", 'compta'));
1385 1385
 							$error++;
1386
-							$this->errors[] = $langs->trans('CustomerAccountancyCodeShort') . " " . $langs->trans("ErrorProdIdAlreadyExist", $vallabel) . ' (' . $langs->trans("ForbiddenBySetupRules") . ')';
1386
+							$this->errors[] = $langs->trans('CustomerAccountancyCodeShort')." ".$langs->trans("ErrorProdIdAlreadyExist", $vallabel).' ('.$langs->trans("ForbiddenBySetupRules").')';
1387 1387
 						}
1388 1388
 					}
1389 1389
 
@@ -1391,7 +1391,7 @@  discard block
 block discarded – undo
1391 1391
 					if (getDolGlobalString('SOCIETE_ACCOUNTANCY_CODE_CUSTOMER_MANDATORY') && (!isset($vallabel) || trim($vallabel) === '')) {
1392 1392
 						$langs->loadLangs(array("errors", 'compta'));
1393 1393
 						$error++;
1394
-						$this->errors[] = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv('CustomerAccountancyCodeShort')) . ' (' . $langs->trans("ForbiddenBySetupRules") . ')';
1394
+						$this->errors[] = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv('CustomerAccountancyCodeShort')).' ('.$langs->trans("ForbiddenBySetupRules").')';
1395 1395
 					}
1396 1396
 				} elseif ($key == 'ACCOUNTANCY_CODE_SUPPLIER' && !empty($this->fournisseur)) {
1397 1397
 					// Check for unicity
@@ -1399,7 +1399,7 @@  discard block
 block discarded – undo
1399 1399
 						if ($this->id_prof_exists($keymin, $vallabel, ($this->id > 0 ? $this->id : 0))) {
1400 1400
 							$langs->loadLangs(array("errors", 'compta'));
1401 1401
 							$error++;
1402
-							$this->errors[] = $langs->trans('SupplierAccountancyCodeShort') . " " . $langs->trans("ErrorProdIdAlreadyExist", $vallabel) . ' (' . $langs->trans("ForbiddenBySetupRules") . ')';
1402
+							$this->errors[] = $langs->trans('SupplierAccountancyCodeShort')." ".$langs->trans("ErrorProdIdAlreadyExist", $vallabel).' ('.$langs->trans("ForbiddenBySetupRules").')';
1403 1403
 						}
1404 1404
 					}
1405 1405
 
@@ -1407,7 +1407,7 @@  discard block
 block discarded – undo
1407 1407
 					if (getDolGlobalString('SOCIETE_ACCOUNTANCY_CODE_SUPPLIER_MANDATORY') && (!isset($vallabel) || trim($vallabel) === '')) {
1408 1408
 						$langs->loadLangs(array("errors", 'compta'));
1409 1409
 						$error++;
1410
-						$this->errors[] = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv('SupplierAccountancyCodeShort')) . ' (' . $langs->trans("ForbiddenBySetupRules") . ')';
1410
+						$this->errors[] = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv('SupplierAccountancyCodeShort')).' ('.$langs->trans("ForbiddenBySetupRules").')';
1411 1411
 					}
1412 1412
 				}
1413 1413
 			}
@@ -1457,17 +1457,17 @@  discard block
 block discarded – undo
1457 1457
 		$now = dol_now();
1458 1458
 
1459 1459
 		// Clean parameters
1460
-		$this->id 			= $id;
1461
-		$this->entity 		= ((isset($this->entity) && is_numeric($this->entity)) ? $this->entity : $conf->entity);
1460
+		$this->id = $id;
1461
+		$this->entity = ((isset($this->entity) && is_numeric($this->entity)) ? $this->entity : $conf->entity);
1462 1462
 		$this->name 		= $this->name ? trim($this->name) : trim((string) $this->nom);
1463 1463
 		$this->nom 			= $this->name; // For backward compatibility
1464
-		$this->name_alias 	= trim((string) $this->name_alias);
1464
+		$this->name_alias = trim((string) $this->name_alias);
1465 1465
 		$this->ref_ext		= (empty($this->ref_ext) ? '' : trim($this->ref_ext));
1466 1466
 		$this->address		= trim((string) $this->address);
1467 1467
 		$this->zip 			= trim((string) $this->zip);
1468 1468
 		$this->town 		= trim((string) $this->town);
1469
-		$this->state_id 	= (is_numeric($this->state_id)) ? (int) $this->state_id : 0;
1470
-		$this->country_id 	= ($this->country_id > 0) ? $this->country_id : 0;
1469
+		$this->state_id = (is_numeric($this->state_id)) ? (int) $this->state_id : 0;
1470
+		$this->country_id = ($this->country_id > 0) ? $this->country_id : 0;
1471 1471
 		$this->phone		= trim((string) $this->phone);
1472 1472
 		$this->phone		= preg_replace("/\s/", "", $this->phone);
1473 1473
 		$this->phone		= preg_replace("/\./", "", $this->phone);
@@ -1477,7 +1477,7 @@  discard block
 block discarded – undo
1477 1477
 		$this->fax			= trim((string) $this->fax);
1478 1478
 		$this->fax			= preg_replace("/\s/", "", $this->fax);
1479 1479
 		$this->fax			= preg_replace("/\./", "", $this->fax);
1480
-		$this->email		= trim((string) $this->email);
1480
+		$this->email = trim((string) $this->email);
1481 1481
 		$this->url			= $this->url ? clean_url($this->url, 0) : '';
1482 1482
 		$this->note_private = (empty($this->note_private) ? '' : trim($this->note_private));
1483 1483
 		$this->note_public  = (empty($this->note_public) ? '' : trim($this->note_public));
@@ -1646,7 +1646,7 @@  discard block
 block discarded – undo
1646 1646
 			$sql .= ",tva_assuj = ".($this->tva_assuj != '' ? "'".$this->db->escape((string) $this->tva_assuj)."'" : "null");
1647 1647
 			$sql .= ",tva_intra = '".$this->db->escape($this->tva_intra)."'";
1648 1648
 			if (!getDolGlobalString('MAIN_COMPANY_PERENTITY_SHARED')) {
1649
-				$sql .= ",vat_reverse_charge = " . ($this->vat_reverse_charge != '' ? "'" . $this->db->escape((string) $this->vat_reverse_charge) . "'" : 0);
1649
+				$sql .= ",vat_reverse_charge = ".($this->vat_reverse_charge != '' ? "'".$this->db->escape((string) $this->vat_reverse_charge)."'" : 0);
1650 1650
 			}
1651 1651
 			$sql .= ",status = ".((int) $this->status);
1652 1652
 
@@ -1707,8 +1707,8 @@  discard block
 block discarded – undo
1707 1707
 			$sql .= ",supplier_order_min_amount= ".($this->supplier_order_min_amount != '' ? $this->supplier_order_min_amount : 'null');
1708 1708
 			$sql .= ",fk_prospectlevel='".$this->db->escape($this->fk_prospectlevel)."'";
1709 1709
 			if (!getDolGlobalString('MAIN_COMPANY_PERENTITY_SHARED')) {
1710
-				$sql .= ", accountancy_code_buy = '" . $this->db->escape($this->accountancy_code_buy) . "'";
1711
-				$sql .= ", accountancy_code_sell= '" . $this->db->escape($this->accountancy_code_sell) . "'";
1710
+				$sql .= ", accountancy_code_buy = '".$this->db->escape($this->accountancy_code_buy)."'";
1711
+				$sql .= ", accountancy_code_sell= '".$this->db->escape($this->accountancy_code_sell)."'";
1712 1712
 				if ($customer) {
1713 1713
 					$sql .= ", accountancy_code_customer_general = ".(!empty($this->accountancy_code_customer_general) ? "'".$this->db->escape($this->accountancy_code_customer_general)."'" : "null");
1714 1714
 					$sql .= ", code_compta = ".(!empty($this->code_compta_client) ? "'".$this->db->escape($this->code_compta_client)."'" : "null");
@@ -2106,7 +2106,7 @@  discard block
 block discarded – undo
2106 2106
 					$this->vat_reverse_charge = 0;
2107 2107
 				}
2108 2108
 
2109
-				$this->status				= $obj->status;
2109
+				$this->status = $obj->status;
2110 2110
 
2111 2111
 				// Local Taxes
2112 2112
 				$this->localtax1_assuj      = $obj->localtax1_assuj;
@@ -2133,7 +2133,7 @@  discard block
 block discarded – undo
2133 2133
 
2134 2134
 				$this->mode_reglement_id 	= $obj->mode_reglement;
2135 2135
 				$this->cond_reglement_id 	= $obj->cond_reglement;
2136
-				$this->deposit_percent		= $obj->deposit_percent;
2136
+				$this->deposit_percent = $obj->deposit_percent;
2137 2137
 				$this->transport_mode_id 	= $obj->transport_mode;
2138 2138
 				$this->mode_reglement_supplier_id 	= $obj->mode_reglement_supplier;
2139 2139
 				$this->cond_reglement_supplier_id 	= $obj->cond_reglement_supplier;
@@ -2298,7 +2298,7 @@  discard block
 block discarded – undo
2298 2298
 		}
2299 2299
 
2300 2300
 		if ($sqlprof) {
2301
-			$sqlprofquery = $sqlstart . " AND (".$sqlprof." )";
2301
+			$sqlprofquery = $sqlstart." AND (".$sqlprof." )";
2302 2302
 			$resql = $this->db->query($sqlprofquery);
2303 2303
 			if ($resql) {
2304 2304
 				$num = $this->db->num_rows($resql);
@@ -2351,7 +2351,7 @@  discard block
 block discarded – undo
2351 2351
 		}
2352 2352
 
2353 2353
 		if ($sqlref) {
2354
-			$sqlrefquery = $sqlstart . " AND (".$sqlref." )";
2354
+			$sqlrefquery = $sqlstart." AND (".$sqlref." )";
2355 2355
 			$resql = $this->db->query($sqlrefquery);
2356 2356
 			if ($resql) {
2357 2357
 				$num = $this->db->num_rows($resql);
@@ -2828,7 +2828,7 @@  discard block
 block discarded – undo
2828 2828
 			$sortfield = 'u.lastname,u.firstname';
2829 2829
 		}
2830 2830
 		if (empty($sortorder)) {
2831
-			$sortorder = str_repeat('ASC,', count(explode(',', $sortfield)) - 1) . 'ASC';
2831
+			$sortorder = str_repeat('ASC,', count(explode(',', $sortfield)) - 1).'ASC';
2832 2832
 		}
2833 2833
 		$sql .= $this->db->order($sortfield, $sortorder);
2834 2834
 
@@ -2845,10 +2845,10 @@  discard block
 block discarded – undo
2845 2845
 					$reparray[$i]['firstname'] = $obj->firstname;
2846 2846
 					$reparray[$i]['email'] = $obj->email;
2847 2847
 					$reparray[$i]['phone'] = $obj->office_phone;
2848
-					$reparray[$i]['office_phone'] = $obj->office_phone;			// Pro phone
2848
+					$reparray[$i]['office_phone'] = $obj->office_phone; // Pro phone
2849 2849
 					$reparray[$i]['office_fax'] = $obj->office_fax;
2850
-					$reparray[$i]['user_mobile'] = $obj->user_mobile;			// Pro mobile
2851
-					$reparray[$i]['personal_mobile'] = $obj->personal_mobile;	// Personal mobile
2850
+					$reparray[$i]['user_mobile'] = $obj->user_mobile; // Pro mobile
2851
+					$reparray[$i]['personal_mobile'] = $obj->personal_mobile; // Personal mobile
2852 2852
 					$reparray[$i]['job'] = $obj->job;
2853 2853
 					$reparray[$i]['statut'] = $obj->status; // deprecated
2854 2854
 					$reparray[$i]['status'] = $obj->status;
@@ -3061,7 +3061,7 @@  discard block
 block discarded – undo
3061 3061
 			$datas['status'] = ' '.$this->getLibStatut(5);
3062 3062
 		}
3063 3063
 		if (isset($this->client) && isset($this->fournisseur)) {
3064
-			$datas['type'] = ' &nbsp; ' . $this->getTypeUrl(1, '', 0, 'span');
3064
+			$datas['type'] = ' &nbsp; '.$this->getTypeUrl(1, '', 0, 'span');
3065 3065
 		}
3066 3066
 		$datas['name'] = '<br><b>'.$langs->trans('Name').':</b> '.dol_escape_htmltag(dol_string_nohtmltag($this->name));
3067 3067
 		if (!empty($this->name_alias) && empty($noaliasinname)) {
@@ -3129,9 +3129,9 @@  discard block
 block discarded – undo
3129 3129
 		}
3130 3130
 		// show categories for this record only in ajax to not overload lists
3131 3131
 		if (!$nofetch && isModEnabled('category') && $this->client) {
3132
-			require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
3132
+			require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
3133 3133
 			$form = new Form($this->db);
3134
-			$datas['categories_customer'] = '<br>' . $form->showCategories($this->id, Categorie::TYPE_CUSTOMER, 1, 1);
3134
+			$datas['categories_customer'] = '<br>'.$form->showCategories($this->id, Categorie::TYPE_CUSTOMER, 1, 1);
3135 3135
 		}
3136 3136
 		if (!empty($this->code_fournisseur) && $this->fournisseur) {
3137 3137
 			$datas['suppliercode'] = '<br><b>'.$langs->trans('SupplierCode').':</b> '.$this->code_fournisseur;
@@ -3142,9 +3142,9 @@  discard block
 block discarded – undo
3142 3142
 		}
3143 3143
 		// show categories for this record only in ajax to not overload lists
3144 3144
 		if (!$nofetch && isModEnabled('category') && $this->fournisseur) {
3145
-			require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
3145
+			require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
3146 3146
 			$form = new Form($this->db);
3147
-			$datas['categories_supplier'] = '<br>' . $form->showCategories($this->id, Categorie::TYPE_SUPPLIER, 1, 1);
3147
+			$datas['categories_supplier'] = '<br>'.$form->showCategories($this->id, Categorie::TYPE_SUPPLIER, 1, 1);
3148 3148
 		}
3149 3149
 
3150 3150
 		$datas['divclose'] = '</div>';
@@ -3691,7 +3691,7 @@  discard block
 block discarded – undo
3691 3691
 	{
3692 3692
 		// phpcs:enable
3693 3693
 		require_once DOL_DOCUMENT_ROOT.'/societe/class/companybankaccount.class.php';
3694
-		$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."societe_rib WHERE type = 'ban' AND default_rib = 1 AND fk_soc = ". (int) $this->id;
3694
+		$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."societe_rib WHERE type = 'ban' AND default_rib = 1 AND fk_soc = ".(int) $this->id;
3695 3695
 		$resql = $this->db->query($sql);
3696 3696
 		if (!$resql) {
3697 3697
 			$this->error = $this->db->lasterror();
@@ -4081,7 +4081,7 @@  discard block
 block discarded – undo
4081 4081
 		global $langs;
4082 4082
 
4083 4083
 		if ($company_id > 0) {
4084
-			$sql = "SELECT parent FROM " . MAIN_DB_PREFIX . "societe WHERE rowid = ".((int) $company_id);
4084
+			$sql = "SELECT parent FROM ".MAIN_DB_PREFIX."societe WHERE rowid = ".((int) $company_id);
4085 4085
 			$resql = $this->db->query($sql);
4086 4086
 			if ($resql) {
4087 4087
 				if ($obj = $this->db->fetch_object($resql)) {
@@ -4378,7 +4378,7 @@  discard block
 block discarded – undo
4378 4378
 	public function isACompany()
4379 4379
 	{
4380 4380
 		// Define if third party is treated as company (or not) when nature is unknown
4381
-		$isACompany = getDolGlobalInt('MAIN_UNKNOWN_CUSTOMERS_ARE_COMPANIES', 1);	// default if not set is 1 because it was like this in all past versions
4381
+		$isACompany = getDolGlobalInt('MAIN_UNKNOWN_CUSTOMERS_ARE_COMPANIES', 1); // default if not set is 1 because it was like this in all past versions
4382 4382
 
4383 4383
 		// Now try to guess using different tips
4384 4384
 		if (!empty($this->tva_intra)) {
@@ -4716,7 +4716,7 @@  discard block
 block discarded – undo
4716 4716
 		$country_code = $country_label = '';
4717 4717
 		if (getDolGlobalString('MAIN_INFO_SOCIETE_COUNTRY')) {
4718 4718
 			$tmp = explode(':', getDolGlobalString('MAIN_INFO_SOCIETE_COUNTRY'));
4719
-			$country_id =  (is_numeric($tmp[0])) ? (int) $tmp[0] : 0;
4719
+			$country_id = (is_numeric($tmp[0])) ? (int) $tmp[0] : 0;
4720 4720
 			if (!empty($tmp[1])) {   // If $conf->global->MAIN_INFO_SOCIETE_COUNTRY is "id:code:label"
4721 4721
 				$country_code = $tmp[1];
4722 4722
 				$country_label = $tmp[2];
@@ -5598,7 +5598,7 @@  discard block
 block discarded – undo
5598 5598
 		if (method_exists($this, 'getLibStatut')) {
5599 5599
 			$return .= '<br><div class="info-box-status">'.$this->getLibStatut(3).'</div>';
5600 5600
 		}
5601
-		$return .= '</div>';	// end info-box-content
5601
+		$return .= '</div>'; // end info-box-content
5602 5602
 		$return .= '</div>';
5603 5603
 		$return .= '</div>';
5604 5604
 
@@ -5701,7 +5701,7 @@  discard block
 block discarded – undo
5701 5701
 		global $conf, $langs, $hookmanager, $user, $action;
5702 5702
 
5703 5703
 		$error = 0;
5704
-		$soc_origin = new Societe($this->db);		// The thirdparty that we will delete
5704
+		$soc_origin = new Societe($this->db); // The thirdparty that we will delete
5705 5705
 
5706 5706
 		dol_syslog("mergeCompany merge thirdparty id=".$soc_origin_id." (will be deleted) into the thirdparty id=".$this->id);
5707 5707
 
Please login to merge, or discard this patch.
htdocs/contrat/card.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -103,8 +103,8 @@  discard block
 block discarded – undo
103 103
 $object = new Contrat($db);
104 104
 $extrafields = new ExtraFields($db);
105 105
 $ret = 0;
106
-$pu_ht = null;  // Init for static analysis
107
-$pu_ttc = null;  // Init for static analysis
106
+$pu_ht = null; // Init for static analysis
107
+$pu_ttc = null; // Init for static analysis
108 108
 
109 109
 // Load object
110 110
 if ($id > 0 || !empty($ref) && $action != 'add') {
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
 $permissionnote = $user->hasRight('contrat', 'creer'); // Used by the include of actions_setnotes.inc.php
127 127
 $permissiondellink = $user->hasRight('contrat', 'creer'); // Used by the include of actions_dellink.inc.php
128 128
 $permissiontodelete = ($user->hasRight('contrat', 'creer') && $object->status == $object::STATUS_DRAFT) || $user->hasRight('contrat', 'supprimer');
129
-$permissiontoadd   = $user->hasRight('contrat', 'creer');     //  Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
129
+$permissiontoadd   = $user->hasRight('contrat', 'creer'); //  Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
130 130
 $permissiontoedit = $permissiontoadd;
131 131
 $permissiontoactivate = $user->hasRight('contrat', 'activer');
132 132
 $permissiontoeditextra = $permissiontoadd;
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
 
183 183
 	include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be 'include', not 'include_once'
184 184
 
185
-	include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php';  // Must be 'include', not 'include_once'
185
+	include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; // Must be 'include', not 'include_once'
186 186
 
187 187
 	if ($action == 'confirm_active' && $confirm == 'yes' && $permissiontoactivate) {
188 188
 		$date_start = '';
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
 	} elseif ($action == 'confirm_sign' && $confirm == 'yes' && $user->hasRight('contract', 'creer')) {
206 206
 		$result = $object->setSignedStatus($user, GETPOSTINT('signed_status'), 0, 'CONTRACT_MODIFY');
207 207
 		if ($result >= 0) {
208
-			header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object->id);
208
+			header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id);
209 209
 			exit;
210 210
 		} else {
211 211
 			$mesg = $object->error;
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
 	} elseif ($action == 'confirm_unsign' && $confirm == 'yes' && $user->hasRight('contract', 'creer')) {
214 214
 		$result = $object->setSignedStatus($user, Contrat::$SIGNED_STATUSES['STATUS_NO_SIGNATURE'], 0, 'CONTRACT_MODIFY');
215 215
 		if ($result >= 0) {
216
-			header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object->id);
216
+			header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id);
217 217
 			exit;
218 218
 		} else {
219 219
 			$mesg = $object->error;
@@ -344,7 +344,7 @@  discard block
 block discarded – undo
344 344
 
345 345
 					$classname = ucfirst($subelement);
346 346
 					$srcobject = new $classname($db);
347
-					'@phan-var-force Commande|Propal|Facture $srcobject';  // Can be other class, but CommonObject is too Generic
347
+					'@phan-var-force Commande|Propal|Facture $srcobject'; // Can be other class, but CommonObject is too Generic
348 348
 
349 349
 					dol_syslog("Try to find source object origin=".$object->origin." originid=".$object->origin_id." to add lines");
350 350
 					$result = $srcobject->fetch($object->origin_id);
@@ -769,7 +769,7 @@  discard block
 block discarded – undo
769 769
 			}
770 770
 			$objectline->fetch_optionals();
771 771
 
772
-			$objectline->oldcopy = dol_clone($objectline, 2);  // @phan-suppress-current-line PhanTypeMismatchProperty
772
+			$objectline->oldcopy = dol_clone($objectline, 2); // @phan-suppress-current-line PhanTypeMismatchProperty
773 773
 		} else {
774 774
 			$objectline = null;
775 775
 		}
@@ -919,7 +919,7 @@  discard block
 block discarded – undo
919 919
 	} elseif ($action == 'confirm_activate' && $confirm == 'yes' && $user->hasRight('contrat', 'creer')) {
920 920
 		$date_start = dol_mktime(12, 0, 0, GETPOSTINT('d_startmonth'), GETPOSTINT('d_startday'), GETPOSTINT('d_startyear'));
921 921
 		$date_end   = dol_mktime(12, 0, 0, GETPOSTINT('d_endmonth'), GETPOSTINT('d_endday'), GETPOSTINT('d_endyear'));
922
-		$comment      = GETPOST('comment', 'alpha');
922
+		$comment = GETPOST('comment', 'alpha');
923 923
 		$result = $object->activateAll($user, $date_start, 0, $comment, $date_end);
924 924
 		if ($result < 0) {
925 925
 			setEventMessages($object->error, $object->errors, 'errors');
@@ -1481,7 +1481,7 @@  discard block
 block discarded – undo
1481 1481
 		$morehtmlref .= '<div class="refidno">';
1482 1482
 		// Ref customer
1483 1483
 		$morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_customer', $object->ref_customer, $object, $user->hasRight('contrat', 'creer'), 'string', '', 0, 1);
1484
-		$morehtmlref .= $form->editfieldval("RefCustomer", 'ref_customer', $object->ref_customer, $object, $user->hasRight('contrat', 'creer'), 'string'.(isset($conf->global->THIRDPARTY_REF_INPUT_SIZE) ? ':' . getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') : ''), '', null, null, '', 1, 'getFormatedCustomerRef');
1484
+		$morehtmlref .= $form->editfieldval("RefCustomer", 'ref_customer', $object->ref_customer, $object, $user->hasRight('contrat', 'creer'), 'string'.(isset($conf->global->THIRDPARTY_REF_INPUT_SIZE) ? ':'.getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') : ''), '', null, null, '', 1, 'getFormatedCustomerRef');
1485 1485
 		// Ref supplier
1486 1486
 		$morehtmlref .= '<br>';
1487 1487
 		$morehtmlref .= $form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->hasRight('contrat', 'creer'), 'string', '', 0, 1);
@@ -1574,7 +1574,7 @@  discard block
 block discarded – undo
1574 1574
 		}
1575 1575
 
1576 1576
 
1577
-		$arrayothercontracts = $object->getListOfContracts('others');	// array or -1 if technical error
1577
+		$arrayothercontracts = $object->getListOfContracts('others'); // array or -1 if technical error
1578 1578
 
1579 1579
 		/*
1580 1580
 		 * Lines of contracts
@@ -1702,7 +1702,7 @@  discard block
 block discarded – undo
1702 1702
 						$description = $objp->description;
1703 1703
 
1704 1704
 						if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) {
1705
-							print (!empty($line->fk_parent_line) ? img_picto('', 'rightarrow') : '') . $text;
1705
+							print (!empty($line->fk_parent_line) ? img_picto('', 'rightarrow') : '').$text;
1706 1706
 							if (!getDolGlobalInt('PRODUIT_DESC_IN_FORM')) {
1707 1707
 								print $form->textwithpicto('', $description);
1708 1708
 							}
@@ -1844,7 +1844,7 @@  discard block
 block discarded – undo
1844 1844
 							print $objp->label ? ' - '.dol_trunc($objp->label, 32) : '';
1845 1845
 							print '<input type="hidden" name="idprod" value="'.$currentLineProductId.'">';
1846 1846
 						} else {
1847
-							$senderissupplier = 0;	// @TODO Option to allow purchased products ?
1847
+							$senderissupplier = 0; // @TODO Option to allow purchased products ?
1848 1848
 							if (empty($senderissupplier)) {
1849 1849
 								if (getDolGlobalString('CONTRACT_SUPPORT_PRODUCTS')) {
1850 1850
 									$filtertype = '';
@@ -2346,9 +2346,9 @@  discard block
 block discarded – undo
2346 2346
 				// Sign
2347 2347
 				if ($object->status > Contrat::STATUS_DRAFT) {
2348 2348
 					if ($object->signed_status != Contrat::$SIGNED_STATUSES['STATUS_SIGNED_ALL']) {
2349
-						print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=sign&token=' . newToken() . '">' . $langs->trans("ContractSign") . '</a></div>';
2349
+						print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=sign&token='.newToken().'">'.$langs->trans("ContractSign").'</a></div>';
2350 2350
 					} else {
2351
-						print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=unsign&token=' . newToken() . '">' . $langs->trans("ContractUnsign") . '</a></div>';
2351
+						print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=unsign&token='.newToken().'">'.$langs->trans("ContractUnsign").'</a></div>';
2352 2352
 					}
2353 2353
 				}
2354 2354
 
Please login to merge, or discard this patch.
htdocs/contrat/class/contrat.class.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -323,7 +323,7 @@  discard block
 block discarded – undo
323 323
 		if (getDolGlobalString('CONTRACT_ADDON')) {
324 324
 			$mybool = false;
325 325
 
326
-			$file = getDolGlobalString('CONTRACT_ADDON') . ".php";
326
+			$file = getDolGlobalString('CONTRACT_ADDON').".php";
327 327
 			$classname = getDolGlobalString('CONTRACT_ADDON');
328 328
 
329 329
 			// Include file with class
@@ -433,7 +433,7 @@  discard block
 block discarded – undo
433 433
 			if ($contratline->statut != ContratLigne::STATUS_OPEN) {
434 434
 				$contratline->context = $this->context;
435 435
 
436
-				$result = $contratline->active_line($user, $date_start, !empty($date_end) ? $date_end : -1, $comment);	// This call trigger LINECONTRACT_ACTIVATE
436
+				$result = $contratline->active_line($user, $date_start, !empty($date_end) ? $date_end : -1, $comment); // This call trigger LINECONTRACT_ACTIVATE
437 437
 				if ($result < 0) {
438 438
 					$error++;
439 439
 					$this->error = $contratline->error;
@@ -483,7 +483,7 @@  discard block
 block discarded – undo
483 483
 			// Close lines not already closed
484 484
 			if ($contratline->statut != ContratLigne::STATUS_CLOSED) {
485 485
 				$contratline->date_end_real = $now;
486
-				$contratline->date_cloture = $now;	// For backward compatibility
486
+				$contratline->date_cloture = $now; // For backward compatibility
487 487
 				$contratline->user_closing_id = $user->id;
488 488
 				$contratline->statut = ContratLigne::STATUS_CLOSED;
489 489
 
@@ -623,7 +623,7 @@  discard block
 block discarded – undo
623 623
 			if (!$error) {
624 624
 				$this->ref = $num;
625 625
 				$this->status = self::STATUS_VALIDATED;
626
-				$this->statut = self::STATUS_VALIDATED;	// deprecated
626
+				$this->statut = self::STATUS_VALIDATED; // deprecated
627 627
 				$this->date_validation = $now;
628 628
 			}
629 629
 		} else {
@@ -898,10 +898,10 @@  discard block
 block discarded – undo
898 898
 				$line->localtax2_tx		= $objp->localtax2_tx;
899 899
 				$line->localtax1_type	= $objp->localtax1_type;
900 900
 				$line->localtax2_type	= $objp->localtax2_type;
901
-				$line->subprice			= $objp->subprice;
901
+				$line->subprice = $objp->subprice;
902 902
 				$line->statut           = $objp->status; // For backward compatibility
903 903
 				$line->status           = $objp->status;
904
-				$line->remise_percent	= $objp->remise_percent;
904
+				$line->remise_percent = $objp->remise_percent;
905 905
 				$line->total_ht			= $objp->total_ht;
906 906
 				$line->total_tva		= $objp->total_tva;
907 907
 				$line->total_localtax1	= $objp->total_localtax1;
@@ -944,7 +944,7 @@  discard block
 block discarded – undo
944 944
 				//$line->date_fin_prevue   = $this->db->jdate($objp->date_fin_validite);
945 945
 				//$line->date_fin_reel     = $this->db->jdate($objp->date_cloture);
946 946
 
947
-				$line->rang     = $objp->rang;
947
+				$line->rang = $objp->rang;
948 948
 
949 949
 				// Retrieve all extrafields for contract line
950 950
 				// fetch optionals attributes and labels
@@ -1419,7 +1419,7 @@  discard block
 block discarded – undo
1419 1419
 		}
1420 1420
 
1421 1421
 		if (!$error) {
1422
-			$result = $this->insertExtraFields();	// This delete and reinsert extrafields
1422
+			$result = $this->insertExtraFields(); // This delete and reinsert extrafields
1423 1423
 			if ($result < 0) {
1424 1424
 				$error++;
1425 1425
 			}
@@ -2032,7 +2032,7 @@  discard block
 block discarded – undo
2032 2032
 				}
2033 2033
 				$datas['customer'] = '<br><b>'.$langs->trans('Customer').':</b> '.$this->thirdparty->getNomUrl(1, '', 0, 1);
2034 2034
 			}
2035
-			$datas['refcustomer'] = '<br><b>'.$langs->trans('RefCustomer').':</b> '. $this->ref_customer;
2035
+			$datas['refcustomer'] = '<br><b>'.$langs->trans('RefCustomer').':</b> '.$this->ref_customer;
2036 2036
 			if (!$nofetch) {
2037 2037
 				$langs->load('project');
2038 2038
 				if (is_null($this->project) || (is_object($this->project) && $this->project->isEmpty())) {
@@ -2456,7 +2456,7 @@  discard block
 block discarded – undo
2456 2456
 		$this->note_public = 'This is a comment (public)';
2457 2457
 		$this->fk_project = 0;
2458 2458
 		// Lines
2459
-		$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)
2459
+		$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)
2460 2460
 		$xnbp = 0;
2461 2461
 		while ($xnbp < $nbp) {
2462 2462
 			$line = new ContratLigne($this->db);
@@ -2502,7 +2502,7 @@  discard block
 block discarded – undo
2502 2502
 		global $user;
2503 2503
 
2504 2504
 		$ticket = new Ticket($this->db);
2505
-		$nbTicket =  $ticket->fetchAll($user, 'ASC', 't.datec', 0, 0, 0, array('t.fk_contract' => $this->id));
2505
+		$nbTicket = $ticket->fetchAll($user, 'ASC', 't.datec', 0, 0, 0, array('t.fk_contract' => $this->id));
2506 2506
 
2507 2507
 		return ($nbTicket < 0 ? $nbTicket : $ticket->lines);
2508 2508
 	}
@@ -2524,7 +2524,7 @@  discard block
 block discarded – undo
2524 2524
 		global $conf, $langs;
2525 2525
 
2526 2526
 		if (!dol_strlen($modele)) {
2527
-			$modele = '';	// No doc template/generation by default
2527
+			$modele = ''; // No doc template/generation by default
2528 2528
 
2529 2529
 			if (!empty($this->model_pdf)) {
2530 2530
 				$modele = $this->model_pdf;
@@ -2621,14 +2621,14 @@  discard block
 block discarded – undo
2621 2621
 			}
2622 2622
 		}
2623 2623
 
2624
-		if (!getDolGlobalString('CONTRACT_ADDON') || !is_readable(DOL_DOCUMENT_ROOT."/core/modules/contract/" . getDolGlobalString('CONTRACT_ADDON').".php")) {
2624
+		if (!getDolGlobalString('CONTRACT_ADDON') || !is_readable(DOL_DOCUMENT_ROOT."/core/modules/contract/".getDolGlobalString('CONTRACT_ADDON').".php")) {
2625 2625
 			$this->error = 'ErrorSetupNotComplete';
2626 2626
 			dol_syslog($this->error);
2627 2627
 			return -1;
2628 2628
 		}
2629 2629
 
2630 2630
 		// Set ref
2631
-		require_once DOL_DOCUMENT_ROOT."/core/modules/contract/" . getDolGlobalString('CONTRACT_ADDON').'.php';
2631
+		require_once DOL_DOCUMENT_ROOT."/core/modules/contract/".getDolGlobalString('CONTRACT_ADDON').'.php';
2632 2632
 		$obj = getDolGlobalString('CONTRACT_ADDON');
2633 2633
 		$modContract = new $obj();
2634 2634
 		'@phan-var-force ModelNumRefContracts $modContract';
@@ -2751,7 +2751,7 @@  discard block
 block discarded – undo
2751 2751
 
2752 2752
 					// Load contract
2753 2753
 					$object = new Contrat($this->db);
2754
-					$object->fetch($obj->rowid);		// fetch also lines
2754
+					$object->fetch($obj->rowid); // fetch also lines
2755 2755
 					//$object->fetch_thirdparty();
2756 2756
 
2757 2757
 					if ($object->id <= 0) {
@@ -2798,7 +2798,7 @@  discard block
 block discarded – undo
2798 2798
 					if ($expirationdate && $expirationdate < $enddatetoscan) {
2799 2799
 						dol_syslog("Define the newdate of end of services from expirationdate=".$expirationdate);
2800 2800
 						$newdate = $expirationdate;
2801
-						$protecti = 0;	// $protecti is to avoid infinite loop
2801
+						$protecti = 0; // $protecti is to avoid infinite loop
2802 2802
 						while ($newdate < $enddatetoscan && $protecti < 1000) {
2803 2803
 							$newdate = dol_time_plus_duree($newdate, (int) $duration_value, $duration_unit);
2804 2804
 							$protecti++;
@@ -2826,21 +2826,21 @@  discard block
 block discarded – undo
2826 2826
 
2827 2827
 								// Create an event
2828 2828
 								$actioncomm = new ActionComm($this->db);
2829
-								$actioncomm->type_code    = 'AC_OTH_AUTO';		// Type of event ('AC_OTH', 'AC_OTH_AUTO', 'AC_XXX'...)
2829
+								$actioncomm->type_code    = 'AC_OTH_AUTO'; // Type of event ('AC_OTH', 'AC_OTH_AUTO', 'AC_XXX'...)
2830 2830
 								$actioncomm->code         = 'AC_'.$actioncode;
2831 2831
 								$actioncomm->label        = $label;
2832 2832
 								$actioncomm->datep        = $now;
2833 2833
 								$actioncomm->datef        = $now;
2834
-								$actioncomm->percentage   = -1;   // Not applicable
2834
+								$actioncomm->percentage   = -1; // Not applicable
2835 2835
 								$actioncomm->socid        = $object->socid;
2836
-								$actioncomm->authorid     = $user->id;   // User saving action
2837
-								$actioncomm->userownerid  = $user->id;	// Owner of action
2836
+								$actioncomm->authorid     = $user->id; // User saving action
2837
+								$actioncomm->userownerid  = $user->id; // Owner of action
2838 2838
 								$actioncomm->fk_element   = $object->id;
2839 2839
 								$actioncomm->elementid    = $object->id;
2840 2840
 								$actioncomm->elementtype  = 'contract';
2841 2841
 								$actioncomm->note_private = $comment;
2842 2842
 
2843
-								$ret = $actioncomm->create($user);       // User creating action
2843
+								$ret = $actioncomm->create($user); // User creating action
2844 2844
 							} else {
2845 2845
 								$contracterror[$object->id] = $object->ref;
2846 2846
 
@@ -2849,7 +2849,7 @@  discard block
 block discarded – undo
2849 2849
 								$this->error = $this->db->lasterror();
2850 2850
 							}
2851 2851
 
2852
-							if (! $errorforlocaltransaction) {
2852
+							if (!$errorforlocaltransaction) {
2853 2853
 								$this->db->commit();
2854 2854
 							} else {
2855 2855
 								$this->db->rollback();
Please login to merge, or discard this patch.
htdocs/categories/categorie_list.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 $backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page
53 53
 $optioncss  = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
54 54
 $mode       = GETPOST('mode', 'aZ'); // The display mode ('list', 'kanban', 'hierarchy', 'calendar', 'gantt', ...)
55
-$groupby = GETPOST('groupby', 'aZ09');	// Example: $groupby = 'p.fk_opp_status' or $groupby = 'p.fk_statut'
55
+$groupby = GETPOST('groupby', 'aZ09'); // Example: $groupby = 'p.fk_opp_status' or $groupby = 'p.fk_statut'
56 56
 
57 57
 $id = GETPOSTINT('id');
58 58
 $ref = GETPOST('ref', 'alpha');
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 $object = new Categorie($db);
79 79
 $extrafields = new ExtraFields($db);
80 80
 $diroutputmassaction = $conf->categories->dir_output.'/temp/massgeneration/'.$user->id;
81
-$hookmanager->initHooks(array($contextpage)); 	// Note that conf->hooks_modules contains array of activated contexes
81
+$hookmanager->initHooks(array($contextpage)); // Note that conf->hooks_modules contains array of activated contexes
82 82
 
83 83
 // Fetch optionals attributes and labels
84 84
 $extrafields->fetch_name_optionals_label($object->table_element);
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
 
89 89
 // Default sort order (if not yet defined by previous GETPOST)
90 90
 if (!$sortfield) {
91
-	reset($object->fields);					// Reset is required to avoid key() to return null.
91
+	reset($object->fields); // Reset is required to avoid key() to return null.
92 92
 	$sortfield = "t.".key($object->fields); // Set here default search field. By default 1st field in definition.
93 93
 }
94 94
 if (!$sortorder) {
@@ -413,7 +413,7 @@  discard block
 block discarded – undo
413 413
 // Output page
414 414
 // --------------------------------------------------------------------
415 415
 
416
-llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'mod-aaa page-list bodyforlist');	// Can use also classforhorizontalscrolloftabs instead of bodyforlist for a horizontal scroll in the table instead of page
416
+llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'mod-aaa page-list bodyforlist'); // Can use also classforhorizontalscrolloftabs instead of bodyforlist for a horizontal scroll in the table instead of page
417 417
 
418 418
 // Example : Adding jquery code
419 419
 // print '<script type="text/javascript">
@@ -553,7 +553,7 @@  discard block
 block discarded – undo
553 553
 }
554 554
 
555 555
 $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
556
-$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, $conf->main_checkbox_left_column);  // This also change content of $arrayfields with user setup
556
+$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, $conf->main_checkbox_left_column); // This also change content of $arrayfields with user setup
557 557
 $selectedfields = ($mode != 'kanban' ? $htmlofselectarray : '');
558 558
 $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
559 559
 
@@ -650,7 +650,7 @@  discard block
 block discarded – undo
650 650
 	} elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && !in_array($key, array('id', 'rowid', 'ref', 'status')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) {
651 651
 		$cssforfield .= ($cssforfield ? ' ' : '').'right';
652 652
 	}
653
-	$cssforfield = preg_replace('/small\s*/', '', $cssforfield);	// the 'small' css must not be used for the title label
653
+	$cssforfield = preg_replace('/small\s*/', '', $cssforfield); // the 'small' css must not be used for the title label
654 654
 	if (!empty($arrayfields['t.'.$key]['checked'])) {
655 655
 		print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, ($cssforfield ? 'class="'.$cssforfield.'"' : ''), $sortfield, $sortorder, ($cssforfield ? $cssforfield.' ' : ''), 0, (empty($val['helplist']) ? '' : $val['helplist']))."\n";
656 656
 		$totalarray['nbfield']++;
Please login to merge, or discard this patch.
htdocs/categories/index.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
 
59 59
 $categstatic = new Categorie($db);
60 60
 if (is_numeric($type)) {
61
-	$type = array_search($type, $categstatic->MAP_ID);	// For backward compatibility
61
+	$type = array_search($type, $categstatic->MAP_ID); // For backward compatibility
62 62
 }
63 63
 
64 64
 // Initialize a technical object to manage hooks. Note that conf->hooks_modules contains array array
@@ -157,12 +157,12 @@  discard block
 block discarded – undo
157 157
 	*/
158 158
 	$entry .= '<td class="right" width="30px;">';
159 159
 	if ($user->hasRight('categorie', 'creer')) {
160
-		$entry .= '<a class="editfielda" href="' . DOL_URL_ROOT . '/categories/edit.php?id=' . $val['id'] . '&type=' . urlencode($type) . $param . '&backtopage=' . urlencode($_SERVER["PHP_SELF"] . '?type=' . urlencode($type)) . '">' . img_edit() . '</a>';
160
+		$entry .= '<a class="editfielda" href="'.DOL_URL_ROOT.'/categories/edit.php?id='.$val['id'].'&type='.urlencode($type).$param.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?type='.urlencode($type)).'">'.img_edit().'</a>';
161 161
 	}
162 162
 	$entry .= '</td>';
163 163
 	$entry .= '<td class="right" width="30px;">';
164 164
 	if ($user->hasRight('categorie', 'supprimer')) {
165
-		$entry .= '<a class="deletefilelink" href="' . DOL_URL_ROOT . '/categories/viewcat.php?action=delete&token=' . newToken() . '&id=' . $val['id'] . '&type=' . urlencode($type) . $param . '&backtopage=' . urlencode($_SERVER["PHP_SELF"] . '?type=' . urlencode($type) . $param) . '&backtolist=' . urlencode($_SERVER["PHP_SELF"] . '?type=' . urlencode($type) . $param) . '">' . img_delete() . '</a>';
165
+		$entry .= '<a class="deletefilelink" href="'.DOL_URL_ROOT.'/categories/viewcat.php?action=delete&token='.newToken().'&id='.$val['id'].'&type='.urlencode($type).$param.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?type='.urlencode($type).$param).'&backtolist='.urlencode($_SERVER["PHP_SELF"].'?type='.urlencode($type).$param).'">'.img_delete().'</a>';
166 166
 	}
167 167
 	$entry .= '</td>';
168 168
 
Please login to merge, or discard this patch.
htdocs/core/ajax/ajaxextrafield.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 }
41 41
 
42 42
 include '../../main.inc.php';
43
-include_once DOL_DOCUMENT_ROOT . '/core/class/html.form.class.php';
43
+include_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php';
44 44
 /**
45 45
  * @var Conf $conf
46 46
  * @var DoliDB $db
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 // Load object according to $element
70 70
 $object = fetchObjectByElement($objectid, $objecttype, $element_ref);
71 71
 if (empty($object->element)) {
72
-	httponly_accessforbidden('Failed to get object with fetchObjectByElement(id=' . $objectid . ', objecttype=' . $objecttype . ')');
72
+	httponly_accessforbidden('Failed to get object with fetchObjectByElement(id='.$objectid.', objecttype='.$objecttype.')');
73 73
 }
74 74
 
75 75
 $module = $object->module;
@@ -127,8 +127,8 @@  discard block
 block discarded – undo
127 127
 		// 7 : sort field (not used here but used into format for commobject)
128 128
 
129 129
 		// If there is a filter, we extract it by taking all content inside parenthesis.
130
-		if (! empty($InfoFieldList[4])) {
131
-			$pos = 0;	// $pos will be position of ending filter
130
+		if (!empty($InfoFieldList[4])) {
131
+			$pos = 0; // $pos will be position of ending filter
132 132
 			$parenthesisopen = 0;
133 133
 			while (substr($InfoFieldList[4], $pos, 1) !== '' && ($parenthesisopen || $pos == 0 || substr($InfoFieldList[4], $pos, 1) != ':')) {
134 134
 				if (substr($InfoFieldList[4], $pos, 1) == '(') {
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
 			// Fix better compatibility with some old extrafield syntax filter "(field=123)"
151 151
 			$reg = array();
152 152
 			if (preg_match('/^\(?([a-z0-9]+)([=<>]+)(\d+)\)?$/i', $InfoFieldList[4], $reg)) {
153
-				$InfoFieldList[4] = '(' . $reg[1] . ':' . $reg[2] . ':' . $reg[3] . ')';
153
+				$InfoFieldList[4] = '('.$reg[1].':'.$reg[2].':'.$reg[3].')';
154 154
 			}
155 155
 
156 156
 			//var_dump($InfoFieldList);
@@ -158,17 +158,17 @@  discard block
 block discarded – undo
158 158
 
159 159
 		$parentName = '';
160 160
 		$parentField = '';
161
-		$keyList = (empty($InfoFieldList[2]) ? 'rowid' : $InfoFieldList[2] . ' as rowid');
161
+		$keyList = (empty($InfoFieldList[2]) ? 'rowid' : $InfoFieldList[2].' as rowid');
162 162
 
163 163
 		if (count($InfoFieldList) > 3 && !empty($InfoFieldList[3])) {
164 164
 			list($parentName, $parentField) = explode('|', $InfoFieldList[3]);
165
-			$keyList .= ', ' . $parentField;
165
+			$keyList .= ', '.$parentField;
166 166
 		}
167 167
 		if (count($InfoFieldList) > 4 && !empty($InfoFieldList[4])) {
168 168
 			if (strpos($InfoFieldList[4], 'extra.') !== false) {
169
-				$keyList = 'main.' . $InfoFieldList[2] . ' as rowid';
169
+				$keyList = 'main.'.$InfoFieldList[2].' as rowid';
170 170
 			} else {
171
-				$keyList = $InfoFieldList[2] . ' as rowid';
171
+				$keyList = $InfoFieldList[2].' as rowid';
172 172
 			}
173 173
 		}
174 174
 
@@ -187,8 +187,8 @@  discard block
 block discarded – undo
187 187
 			}
188 188
 
189 189
 			$sqlwhere = '';
190
-			$sql = "SELECT " . $keyList;
191
-			$sql .= ' FROM ' . $db->prefix() . $InfoFieldList[0];
190
+			$sql = "SELECT ".$keyList;
191
+			$sql .= ' FROM '.$db->prefix().$InfoFieldList[0];
192 192
 
193 193
 			// Add filter from 4th field
194 194
 			if (!empty($InfoFieldList[4])) {
@@ -231,11 +231,11 @@  discard block
 block discarded – undo
231 231
 				// We have to filter on a field of the extrafield table
232 232
 				$errstr = '';
233 233
 				if (strpos($InfoFieldList[4], 'extra.') !== false) {
234
-					$sql .= ' as main, ' . $db->sanitize($db->prefix() . $InfoFieldList[0]) . '_extrafields as extra';	// Add the join
235
-					$sqlwhere .= " WHERE extra.fk_object = main." . $db->sanitize($InfoFieldList[2]);
236
-					$sqlwhere .= " AND " . forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1);	// Add the filter
234
+					$sql .= ' as main, '.$db->sanitize($db->prefix().$InfoFieldList[0]).'_extrafields as extra'; // Add the join
235
+					$sqlwhere .= " WHERE extra.fk_object = main.".$db->sanitize($InfoFieldList[2]);
236
+					$sqlwhere .= " AND ".forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1); // Add the filter
237 237
 				} else {
238
-					$sqlwhere .= " WHERE " . forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1);
238
+					$sqlwhere .= " WHERE ".forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1);
239 239
 				}
240 240
 			} else {
241 241
 				$sqlwhere .= ' WHERE 1=1';
@@ -243,11 +243,11 @@  discard block
 block discarded – undo
243 243
 
244 244
 			// Some tables may have field, some other not. For the moment we disable it.
245 245
 			if (in_array($InfoFieldList[0], array('tablewithentity'))) {
246
-				$sqlwhere .= ' AND entity = ' . ((int) $conf->entity);
246
+				$sqlwhere .= ' AND entity = '.((int) $conf->entity);
247 247
 			}
248 248
 			if ($search) {
249 249
 				if ($fields_label) {
250
-					$sqlwhere .= " " . natural_search($fields_label, $search, 0);
250
+					$sqlwhere .= " ".natural_search($fields_label, $search, 0);
251 251
 				}
252 252
 			}
253 253
 
@@ -278,7 +278,7 @@  discard block
 block discarded – undo
278 278
 					if (count($fields_label) > 1) {
279 279
 						$notrans = true;
280 280
 						foreach ($fields_label as $field_toshow) {
281
-							$labeltoshow .= $obj->$field_toshow . ' ';
281
+							$labeltoshow .= $obj->$field_toshow.' ';
282 282
 						}
283 283
 					} else {
284 284
 						$labeltoshow = $obj->{$InfoFieldList[1]};
@@ -288,7 +288,7 @@  discard block
 block discarded – undo
288 288
 						if (!$notrans) {
289 289
 							foreach ($fields_label as $field_toshow) {
290 290
 								$translabel = $langs->trans($obj->$field_toshow);
291
-								$labeltoshow = $translabel . ' ';
291
+								$labeltoshow = $translabel.' ';
292 292
 							}
293 293
 						}
294 294
 						// $out .= '<option value="'.$obj->rowid.'" selected>'.$labeltoshow.'</option>';
@@ -306,7 +306,7 @@  discard block
 block discarded – undo
306 306
 						}
307 307
 
308 308
 						if (!empty($InfoFieldList[3]) && $parentField) {
309
-							$parent = $parentName . ':' . $obj->{$parentField};
309
+							$parent = $parentName.':'.$obj->{$parentField};
310 310
 						}
311 311
 
312 312
 						// $out .= '<option value="'.$obj->rowid.'"';
@@ -323,11 +323,11 @@  discard block
 block discarded – undo
323 323
 				}
324 324
 				$db->free($resql);
325 325
 			} else {
326
-				dol_syslog('Error in request ' . $db->lasterror() . '. Check setup of extra parameters.', LOG_ERR);
326
+				dol_syslog('Error in request '.$db->lasterror().'. Check setup of extra parameters.', LOG_ERR);
327 327
 			}
328 328
 		} else {
329
-			require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
330
-			require_once DOL_DOCUMENT_ROOT . '/core/class/html.form.class.php';
329
+			require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
330
+			require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php';
331 331
 		}
332 332
 	}
333 333
 }
Please login to merge, or discard this patch.
test/phpunit/SocieteTest.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
  *      \remarks    To run this script as CLI:  phpunit filename.php
28 28
  */
29 29
 
30
-global $conf,$user,$langs,$db;
30
+global $conf, $user, $langs, $db;
31 31
 //define('TEST_DB_FORCE_TYPE','mysql'); // This is to force using mysql driver
32 32
 //require_once 'PHPUnit/Autoload.php';
33 33
 require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
@@ -60,10 +60,10 @@  discard block
 block discarded – undo
60 60
 	 */
61 61
 	public static function setUpBeforeClass(): void
62 62
 	{
63
-		global $conf,$user,$langs,$db;
63
+		global $conf, $user, $langs, $db;
64 64
 
65 65
 		if ($conf->global->SOCIETE_CODECLIENT_ADDON != 'mod_codeclient_monkey') {
66
-			print "\n".__METHOD__." third party ref checker must be setup to 'mod_codeclient_monkey' not to '" . getDolGlobalString('SOCIETE_CODECLIENT_ADDON')."'.\n";
66
+			print "\n".__METHOD__." third party ref checker must be setup to 'mod_codeclient_monkey' not to '".getDolGlobalString('SOCIETE_CODECLIENT_ADDON')."'.\n";
67 67
 			die(1);
68 68
 		}
69 69
 
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 			die(1);
78 78
 		}
79 79
 
80
-		$db->begin();    // This is to have all actions inside a transaction even if test launched without suite.
80
+		$db->begin(); // This is to have all actions inside a transaction even if test launched without suite.
81 81
 
82 82
 		print __METHOD__."\n";
83 83
 	}
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
 	 */
90 90
 	public function testSocieteCreate()
91 91
 	{
92
-		global $conf,$user,$langs,$db;
92
+		global $conf, $user, $langs, $db;
93 93
 		$conf = $this->savconf;
94 94
 		$user = $this->savuser;
95 95
 		$langs = $this->savlangs;
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
 	 */
121 121
 	public function testSocieteFetch($id)
122 122
 	{
123
-		global $conf,$user,$langs,$db;
123
+		global $conf, $user, $langs, $db;
124 124
 		$conf = $this->savconf;
125 125
 		$user = $this->savuser;
126 126
 		$langs = $this->savlangs;
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
 	 */
150 150
 	public function testSocieteUpdate($localobject)
151 151
 	{
152
-		global $conf,$user,$langs,$db;
152
+		global $conf, $user, $langs, $db;
153 153
 		$conf = $this->savconf;
154 154
 		$user = $this->savuser;
155 155
 		$langs = $this->savlangs;
@@ -225,10 +225,10 @@  discard block
 block discarded – undo
225 225
 		$localobject->country_code = 'FR';
226 226
 		$localobject->idprof1 = 493861496;
227 227
 		$localobject->idprof2 = 49386149600021;
228
-		$result = $localobject->id_prof_check(1, $localobject);    // Must be > 0
228
+		$result = $localobject->id_prof_check(1, $localobject); // Must be > 0
229 229
 		print __METHOD__." OK FR idprof1 result=".$result."\n";
230 230
 		$this->assertGreaterThanOrEqual(1, $result);
231
-		$result = $localobject->id_prof_check(2, $localobject);    // Must be > 0
231
+		$result = $localobject->id_prof_check(2, $localobject); // Must be > 0
232 232
 		print __METHOD__." OK FR idprof2 result=".$result."\n";
233 233
 		$this->assertGreaterThanOrEqual(1, $result);
234 234
 
@@ -236,17 +236,17 @@  discard block
 block discarded – undo
236 236
 		$localobject->country_code = 'FR';
237 237
 		$localobject->idprof1 = 'id1ko';
238 238
 		$localobject->idprof2 = 'id2ko';
239
-		$result = $localobject->id_prof_check(1, $localobject);    // Must be <= 0
239
+		$result = $localobject->id_prof_check(1, $localobject); // Must be <= 0
240 240
 		print __METHOD__." KO FR idprof1 result=".$result."\n";
241 241
 		$this->assertLessThan(1, $result);
242
-		$result = $localobject->id_prof_check(2, $localobject);    // Must be <= 0
242
+		$result = $localobject->id_prof_check(2, $localobject); // Must be <= 0
243 243
 		print __METHOD__." KO FR idprof2 result=".$result."\n";
244 244
 		$this->assertLessThan(1, $result);
245 245
 
246 246
 		// KO ES
247 247
 		$localobject->country_code = 'ES';
248 248
 		$localobject->idprof1 = 'id1ko';
249
-		$result = $localobject->id_prof_check(1, $localobject);    // Must be <= 0
249
+		$result = $localobject->id_prof_check(1, $localobject); // Must be <= 0
250 250
 		print __METHOD__." KO ES idprof1 result=".$result."\n";
251 251
 		$this->assertLessThan(1, $result);
252 252
 
@@ -254,10 +254,10 @@  discard block
 block discarded – undo
254 254
 		$localobject->country_code = 'AR';
255 255
 		$localobject->idprof1 = 'id1ko';
256 256
 		$localobject->idprof2 = 'id2ko';
257
-		$result = $localobject->id_prof_check(1, $localobject);    // Must be > 0
257
+		$result = $localobject->id_prof_check(1, $localobject); // Must be > 0
258 258
 		print __METHOD__." OK AR idprof1 result=".$result."\n";
259 259
 		$this->assertGreaterThanOrEqual(0, $result);
260
-		$result = $localobject->id_prof_check(2, $localobject);    // Must be > 0
260
+		$result = $localobject->id_prof_check(2, $localobject); // Must be > 0
261 261
 		print __METHOD__." OK AR idprof2 result=".$result."\n";
262 262
 		$this->assertGreaterThanOrEqual(1, $result);
263 263
 
@@ -276,7 +276,7 @@  discard block
 block discarded – undo
276 276
 	 */
277 277
 	public function testSocieteOther($localobject)
278 278
 	{
279
-		global $conf,$user,$langs,$db;
279
+		global $conf, $user, $langs, $db;
280 280
 		$conf = $this->savconf;
281 281
 		$user = $this->savuser;
282 282
 		$langs = $this->savlangs;
@@ -336,7 +336,7 @@  discard block
 block discarded – undo
336 336
 	 */
337 337
 	public function testGetOutstandingBills($id)
338 338
 	{
339
-		global $conf,$user,$langs,$db;
339
+		global $conf, $user, $langs, $db;
340 340
 		$conf = $this->savconf;
341 341
 		$user = $this->savuser;
342 342
 		$langs = $this->savlangs;
@@ -365,7 +365,7 @@  discard block
 block discarded – undo
365 365
 	 */
366 366
 	public function testSocieteDelete($id)
367 367
 	{
368
-		global $conf,$user,$langs,$db;
368
+		global $conf, $user, $langs, $db;
369 369
 		$conf = $this->savconf;
370 370
 		$user = $this->savuser;
371 371
 		$langs = $this->savlangs;
@@ -389,7 +389,7 @@  discard block
 block discarded – undo
389 389
 	 */
390 390
 	public function testSocieteGetFullAddress()
391 391
 	{
392
-		global $conf,$user,$langs,$db;
392
+		global $conf, $user, $langs, $db;
393 393
 		$conf = $this->savconf;
394 394
 		$user = $this->savuser;
395 395
 		$langs = $this->savlangs;
@@ -493,7 +493,7 @@  discard block
 block discarded – undo
493 493
 	 */
494 494
 	public function testSocieteFindNearest()
495 495
 	{
496
-		global $conf,$user,$langs,$db;
496
+		global $conf, $user, $langs, $db;
497 497
 		$conf = $this->savconf;
498 498
 		$user = $this->savuser;
499 499
 		$langs = $this->savlangs;
Please login to merge, or discard this patch.