Completed
Branch develop (b49701)
by
unknown
24:08
created
htdocs/projet/list.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 $optioncss = GETPOST('optioncss', 'alpha');
69 69
 $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'projectlist';
70 70
 $mode = GETPOST('mode', 'alpha');
71
-$groupby = GETPOST('groupby', 'aZ09');	// Example: $groupby = 'p.fk_opp_status' or $groupby = 'p.fk_statut'. Must be a field into $object->fields
71
+$groupby = GETPOST('groupby', 'aZ09'); // Example: $groupby = 'p.fk_opp_status' or $groupby = 'p.fk_statut'. Must be a field into $object->fields
72 72
 
73 73
 $title = $langs->trans("Projects");
74 74
 
@@ -162,38 +162,38 @@  discard block
 block discarded – undo
162 162
 $search_date_start_startmonth = GETPOSTINT('search_date_start_startmonth');
163 163
 $search_date_start_startyear = GETPOSTINT('search_date_start_startyear');
164 164
 $search_date_start_startday = GETPOSTINT('search_date_start_startday');
165
-$search_date_start_start = GETPOSTDATE('search_date_start_start');	// Use tzserver
165
+$search_date_start_start = GETPOSTDATE('search_date_start_start'); // Use tzserver
166 166
 $search_date_start_endmonth = GETPOSTINT('search_date_start_endmonth');
167 167
 $search_date_start_endyear = GETPOSTINT('search_date_start_endyear');
168 168
 $search_date_start_endday = GETPOSTINT('search_date_start_endday');
169
-$search_date_start_end = GETPOSTDATE('search_date_start_end', 'end');	// Use tzserver
169
+$search_date_start_end = GETPOSTDATE('search_date_start_end', 'end'); // Use tzserver
170 170
 
171 171
 $search_date_end_startmonth = GETPOSTINT('search_date_end_startmonth');
172 172
 $search_date_end_startyear = GETPOSTINT('search_date_end_startyear');
173 173
 $search_date_end_startday = GETPOSTINT('search_date_end_startday');
174
-$search_date_end_start = GETPOSTDATE('search_date_end_start');	// Use tzserver
174
+$search_date_end_start = GETPOSTDATE('search_date_end_start'); // Use tzserver
175 175
 $search_date_end_endmonth = GETPOSTINT('search_date_end_endmonth');
176 176
 $search_date_end_endyear = GETPOSTINT('search_date_end_endyear');
177 177
 $search_date_end_endday = GETPOSTINT('search_date_end_endday');
178
-$search_date_end_end = GETPOSTDATE('search_date_end_end', 'end');	;	// Use tzserver
178
+$search_date_end_end = GETPOSTDATE('search_date_end_end', 'end'); ;	// Use tzserver
179 179
 
180 180
 $search_date_creation_startmonth = GETPOSTINT('search_date_creation_startmonth');
181 181
 $search_date_creation_startyear = GETPOSTINT('search_date_creation_startyear');
182 182
 $search_date_creation_startday = GETPOSTINT('search_date_creation_startday');
183
-$search_date_creation_start = GETPOSTDATE('search_date_creation_start');	// Use tzserver
183
+$search_date_creation_start = GETPOSTDATE('search_date_creation_start'); // Use tzserver
184 184
 $search_date_creation_endmonth = GETPOSTINT('search_date_creation_endmonth');
185 185
 $search_date_creation_endyear = GETPOSTINT('search_date_creation_endyear');
186 186
 $search_date_creation_endday = GETPOSTINT('search_date_creation_endday');
187
-$search_date_creation_end = GETPOSTDATE('search_date_creation_end', 'end');	// Use tzserver
187
+$search_date_creation_end = GETPOSTDATE('search_date_creation_end', 'end'); // Use tzserver
188 188
 
189 189
 $search_date_modif_startmonth = GETPOSTINT('search_date_modif_startmonth');
190 190
 $search_date_modif_startyear = GETPOSTINT('search_date_modif_startyear');
191 191
 $search_date_modif_startday = GETPOSTINT('search_date_modif_startday');
192
-$search_date_modif_start = GETPOSTDATE('search_date_modif_start');	// Use tzserver
192
+$search_date_modif_start = GETPOSTDATE('search_date_modif_start'); // Use tzserver
193 193
 $search_date_modif_endmonth = GETPOSTINT('search_date_modif_endmonth');
194 194
 $search_date_modif_endyear = GETPOSTINT('search_date_modif_endyear');
195 195
 $search_date_modif_endday = GETPOSTINT('search_date_modif_endday');
196
-$search_date_modif_end = GETPOSTDATE('search_date_modif_end', 'end');	// Use tzserver
196
+$search_date_modif_end = GETPOSTDATE('search_date_modif_end', 'end'); // Use tzserver
197 197
 
198 198
 $search_category_array = array();
199 199
 $search_category_user_array = array();
@@ -334,7 +334,7 @@  discard block
 block discarded – undo
334 334
 			$sql .= " WHERE active = 1";
335 335
 			//$sql .= " AND cls.code <> 'LOST'";
336 336
 			//$sql .= " AND cls.code <> 'WON'";
337
-			$sql .= $db->order('cls.position,cls.rowid', 'ASC');	// Must use the same order key than the key in $groupby
337
+			$sql .= $db->order('cls.position,cls.rowid', 'ASC'); // Must use the same order key than the key in $groupby
338 338
 			$resql = $db->query($sql);
339 339
 			if ($resql) {
340 340
 				$num = $db->num_rows($resql);
@@ -831,7 +831,7 @@  discard block
 block discarded – undo
831 831
 			if ($searchCategoryUserOperator == 0) {
832 832
 				$searchCategoryUserSqlList[] = " EXISTS (SELECT ck.fk_user FROM ".MAIN_DB_PREFIX."categorie_user as ck WHERE u.rowid = ck.fk_user AND ck.fk_categorie = ".((int) $searchCategoryUser).")";
833 833
 			} else {
834
-				$listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryUser);
834
+				$listofcategoryid .= ($listofcategoryid ? ', ' : '').((int) $searchCategoryUser);
835 835
 			}
836 836
 		}
837 837
 	}
@@ -862,7 +862,7 @@  discard block
 block discarded – undo
862 862
 			if ($searchCategoryProjectOperator == 0) {
863 863
 				$searchCategoryProjectSqlList[] = " EXISTS (SELECT ck.fk_project FROM ".MAIN_DB_PREFIX."categorie_project as ck WHERE p.rowid = ck.fk_project AND ck.fk_categorie = ".((int) $searchCategoryProject).")";
864 864
 			} else {
865
-				$listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryProject);
865
+				$listofcategoryid .= ($listofcategoryid ? ', ' : '').((int) $searchCategoryProject);
866 866
 			}
867 867
 		}
868 868
 	}
@@ -1084,7 +1084,7 @@  discard block
 block discarded – undo
1084 1084
 	$param .= '&search_date_end_endday='.urlencode((string) ($search_date_end_endday));
1085 1085
 }
1086 1086
 if ($search_date_end_end) {
1087
-	$param .= '&search_date_end_end=' . urlencode((string) $search_date_end_end);
1087
+	$param .= '&search_date_end_end='.urlencode((string) $search_date_end_end);
1088 1088
 }
1089 1089
 if ($search_date_creation_startmonth) {
1090 1090
 	$param .= '&search_date_creation_startmonth='.urlencode((string) ($search_date_creation_startmonth));
@@ -1132,7 +1132,7 @@  discard block
 block discarded – undo
1132 1132
 	$param .= '&search_date_modif_endday='.urlencode((string) ($search_date_modif_endday));
1133 1133
 }
1134 1134
 if ($search_date_modif_end) {
1135
-	$param .= '&search_date_modif_end=' . urlencode((string) $search_date_modif_end);
1135
+	$param .= '&search_date_modif_end='.urlencode((string) $search_date_modif_end);
1136 1136
 }
1137 1137
 if (!empty($search_category_user_array)) {
1138 1138
 	foreach ($search_category_user_array as $tmpval) {
@@ -1391,7 +1391,7 @@  discard block
 block discarded – undo
1391 1391
 }
1392 1392
 
1393 1393
 $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
1394
-$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN'));  // This also change content of $arrayfields with user setup
1394
+$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup
1395 1395
 $selectedfields = (($mode != 'kanban' && $mode != 'kanbangroupby') ? $htmlofselectarray : '');
1396 1396
 $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
1397 1397
 
@@ -1918,7 +1918,7 @@  discard block
 block discarded – undo
1918 1918
 			//var_dump("groupby=$groupby groupbyvalue=$groupbyvalue groupbyfield=$groupbyfield");
1919 1919
 
1920 1920
 			if (is_null($groupbyold)) {
1921
-				print '<div class="box-flex-container-columns kanban">';	// Start div for all kanban columns
1921
+				print '<div class="box-flex-container-columns kanban">'; // Start div for all kanban columns
1922 1922
 			}
1923 1923
 			// Start kanban column
1924 1924
 			if (is_null($obj->$groupbyfield)) {
@@ -1931,7 +1931,7 @@  discard block
 block discarded – undo
1931 1931
 
1932 1932
 			if ($groupbyold !== $groupbyvalue) {	// We found a break on a new column
1933 1933
 				if (!is_null($groupbyold)) {
1934
-					print '</div>';	// We need a new kanban column - end box-flex-container
1934
+					print '</div>'; // We need a new kanban column - end box-flex-container
1935 1935
 				}
1936 1936
 
1937 1937
 				$indexofgroupbyvalue = null;
@@ -1973,10 +1973,10 @@  discard block
 block discarded – undo
1973 1973
 					}
1974 1974
 					print '" data-groupbyid="'.preg_replace('/[^a-z0-9]/', '', $tmpgroupbyvalue['id']).'" data-groupbyfield="'.$groupbyfield.'">';
1975 1975
 					print '<div class="kanbanlabel">'.$langs->trans($tmpgroupbyvalue['label']).'</div>';
1976
-					print '</div>';	// Start and end the new column
1976
+					print '</div>'; // Start and end the new column
1977 1977
 				}
1978 1978
 
1979
-				print '<!-- start column for value --><div class="box-flex-container-column kanban column" data-groupbyid="'.preg_replace('/[^a-z0-9]/i', '', $groupbyvalue).'" data-groupbyfield="'.$groupbyfield.'">';	// Start new column
1979
+				print '<!-- start column for value --><div class="box-flex-container-column kanban column" data-groupbyid="'.preg_replace('/[^a-z0-9]/i', '', $groupbyvalue).'" data-groupbyfield="'.$groupbyfield.'">'; // Start new column
1980 1980
 				print '<div class="kanbanlabel">'.$langs->trans((is_null($indexofgroupbyvalue) || empty($groupbyvalues[$indexofgroupbyvalue]['label'])) ? 'Undefined' : $groupbyvalues[$indexofgroupbyvalue]['label']).'</div>';
1981 1981
 			}
1982 1982
 			$groupbyold = $groupbyvalue;
@@ -2000,7 +2000,7 @@  discard block
 block discarded – undo
2000 2000
 		if ($i == ($imaxinloop - 1)) {
2001 2001
 			// Close kanban column
2002 2002
 			if (!empty($groupby)) {
2003
-				print '</div>';	// end box-flex-container
2003
+				print '</div>'; // end box-flex-container
2004 2004
 
2005 2005
 				// We show column that we must show after the last current record
2006 2006
 				//var_dump("groupbyold=".$groupbyold.", current record to show has group value groupbyvalue=".$groupbyvalue);
@@ -2037,11 +2037,11 @@  discard block
 block discarded – undo
2037 2037
 					}
2038 2038
 					print '" data-groupbyid="'.preg_replace('/[^a-z0-9]/', '', $tmpgroupbyvalue['id']).'" data-groupbyfield="'.$groupbyfield.'">';
2039 2039
 					print '<div class="kanbanlabel">'.$langs->trans(empty($tmpgroupbyvalue['label']) ? 'Undefined' : $tmpgroupbyvalue['label']).'</div>';
2040
-					print '</div>';	// Start and end the new column
2040
+					print '</div>'; // Start and end the new column
2041 2041
 				}
2042
-				print '</div>';	// end box-flex-container-columns
2042
+				print '</div>'; // end box-flex-container-columns
2043 2043
 			} else {
2044
-				print '</div>';	// end box-flex-container
2044
+				print '</div>'; // end box-flex-container
2045 2045
 			}
2046 2046
 
2047 2047
 			print '</td></tr>';
Please login to merge, or discard this patch.
htdocs/product/card.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
 $formbarcode = null;
109 109
 
110 110
 // Get parameters
111
-$id  = GETPOSTINT('id');
111
+$id = GETPOSTINT('id');
112 112
 if (getDolGlobalString('MAIN_SECURITY_ALLOW_UNSECURED_REF_LABELS')) {
113 113
 	$ref = (GETPOSTISSET('ref') ? GETPOST('ref', 'nohtml') : null);
114 114
 } else {
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
 $backtopage = GETPOST('backtopage', 'alpha');
121 121
 $confirm = GETPOST('confirm', 'alpha');
122 122
 $socid = GETPOSTINT('socid');
123
-$duration_value = GETPOST('duration_value') === '' ? null : GETPOSTINT('duration_value');	// duration value can be an empty string
123
+$duration_value = GETPOST('duration_value') === '' ? null : GETPOSTINT('duration_value'); // duration value can be an empty string
124 124
 $duration_unit = GETPOST('duration_unit', 'alpha');
125 125
 
126 126
 $accountancy_code_sell = GETPOST('accountancy_code_sell', 'alpha');
@@ -497,7 +497,7 @@  discard block
 block discarded – undo
497 497
 	// Quick edit for extrafields
498 498
 	if ($action == 'update_extras' && $permissiontoeditextra) {
499 499
 		// we may use oldcopy->hasBatch( in triggers so keep 1
500
-		$object->oldcopy = dol_clone($object, 1);  // @phan-suppress-current-line PhanTypeMismatchProperty
500
+		$object->oldcopy = dol_clone($object, 1); // @phan-suppress-current-line PhanTypeMismatchProperty
501 501
 
502 502
 		$attribute_name = GETPOST('attribute', 'aZ09');
503 503
 
@@ -656,7 +656,7 @@  discard block
 block discarded – undo
656 656
 			$object->width = GETPOST('sizewidth');
657 657
 			$object->height = GETPOST('sizeheight');
658 658
 			$object->surface = GETPOST('surface');
659
-			$object->surface_units  = GETPOST('surface_units') === '' ? null : GETPOSTINT('surface_units'); // This is not the fk_unit but the power of unit
659
+			$object->surface_units = GETPOST('surface_units') === '' ? null : GETPOSTINT('surface_units'); // This is not the fk_unit but the power of unit
660 660
 			$object->volume = GETPOST('volume');
661 661
 			$object->volume_units = GETPOST('volume_units') === '' ? null : GETPOSTINT('volume_units'); // This is not the fk_unit but the power of unit
662 662
 			$finished = GETPOSTINT('finished');
@@ -792,7 +792,7 @@  discard block
 block discarded – undo
792 792
 		} else {
793 793
 			if ($object->id > 0) {
794 794
 				// Need dol_clone methode 1 (same object class) because update product use hasbatch() method on oldcopy
795
-				$object->oldcopy = dol_clone($object, 1);  // @phan-suppress-current-line PhanTypeMismatchProperty
795
+				$object->oldcopy = dol_clone($object, 1); // @phan-suppress-current-line PhanTypeMismatchProperty
796 796
 
797 797
 				if (!getDolGlobalString('PRODUCT_GENERATE_REF_AFTER_FORM')) {
798 798
 					$object->ref = (string) $ref;
@@ -924,7 +924,7 @@  discard block
 block discarded – undo
924 924
 					$object->accountancy_code_buy_export = $accountancy_code_buy_export;
925 925
 				}
926 926
 				if ($object->isService()) {
927
-					$object->mandatory_period =  (!empty($checkmandatory)) ? 1 : 0 ;
927
+					$object->mandatory_period = (!empty($checkmandatory)) ? 1 : 0;
928 928
 				}
929 929
 
930 930
 
@@ -1058,7 +1058,7 @@  discard block
 block discarded – undo
1058 1058
 							$action = "";
1059 1059
 
1060 1060
 							$mesg = $langs->trans("ErrorProductAlreadyExists", $clone->ref);
1061
-							$mesg .= ' <a href="' . $_SERVER["PHP_SELF"] . '?ref=' . $clone->ref . '">' . $langs->trans("ShowCardHere") . '</a>.';
1061
+							$mesg .= ' <a href="'.$_SERVER["PHP_SELF"].'?ref='.$clone->ref.'">'.$langs->trans("ShowCardHere").'</a>.';
1062 1062
 							setEventMessages($mesg, null, 'errors');
1063 1063
 						} else {
1064 1064
 							setEventMessages(empty($clone->error) ? '' : $langs->trans($clone->error), $clone->errors, 'errors');
@@ -1073,7 +1073,7 @@  discard block
 block discarded – undo
1073 1073
 					} else {
1074 1074
 						$db->commit();
1075 1075
 						$db->close();
1076
-						header("Location: " . $_SERVER["PHP_SELF"] . "?id=" . $id);
1076
+						header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id);
1077 1077
 						exit;
1078 1078
 					}
1079 1079
 				} else {
@@ -2284,9 +2284,9 @@  discard block
 block discarded – undo
2284 2284
 					if (isModEnabled('productbatch') && $object->hasbatch()) {
2285 2285
 						print '<tr><td><input type="hidden" id="stockable_product" name="stockable_product" value="on" /></td><td></td></tr>';
2286 2286
 					} else {
2287
-						print '<tr><td><label for="stockable_product">' . $langs->trans("StockableProduct") . '</label></td>';
2287
+						print '<tr><td><label for="stockable_product">'.$langs->trans("StockableProduct").'</label></td>';
2288 2288
 						$checked = empty($object->stockable_product) ? "" : "checked";
2289
-						print '<td><input type="checkbox" id="stockable_product" name="stockable_product" '. $checked . ' /></td></tr>';
2289
+						print '<td><input type="checkbox" id="stockable_product" name="stockable_product" '.$checked.' /></td></tr>';
2290 2290
 					}
2291 2291
 
2292 2292
 					// Default warehouse
@@ -2413,7 +2413,7 @@  discard block
 block discarded – undo
2413 2413
 				// Customs code
2414 2414
 				if (!$object->isService() && !getDolGlobalString('PRODUCT_DISABLE_CUSTOMS_INFO')) {
2415 2415
 					print '<tr><td class="wordbreak">'.$form->textwithpicto($langs->trans("CustomsCode"), $langs->trans("CustomsCodeHelp")).'</td>';
2416
-					print '<td>' . img_picto('', 'fa-clipboard-check', 'class="pictofixedwidth"') . '<input name="customcode" class="maxwidth100onsmartphone" value="'.(GETPOSTISSET('customcode') ? GETPOST('customcode') : $object->customcode).'"></td></tr>';
2416
+					print '<td>'.img_picto('', 'fa-clipboard-check', 'class="pictofixedwidth"').'<input name="customcode" class="maxwidth100onsmartphone" value="'.(GETPOSTISSET('customcode') ? GETPOST('customcode') : $object->customcode).'"></td></tr>';
2417 2417
 					// Origin country
2418 2418
 					print '<tr><td>'.$langs->trans("CountryOrigin").'</td>';
2419 2419
 					print '<td>';
@@ -2578,7 +2578,7 @@  discard block
 block discarded – undo
2578 2578
 		} else {
2579 2579
 			// Card in view mode
2580 2580
 
2581
-			$showbarcode = (isModEnabled('barcode')&& getDolGlobalString('BARCODE_USE_ON_PRODUCT'));
2581
+			$showbarcode = (isModEnabled('barcode') && getDolGlobalString('BARCODE_USE_ON_PRODUCT'));
2582 2582
 			if (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && !$user->hasRight('barcode', 'lire_advance')) {
2583 2583
 				$showbarcode = 0;
2584 2584
 			}
@@ -2810,7 +2810,7 @@  discard block
 block discarded – undo
2810 2810
 
2811 2811
 				// Stockable product / default warehouse
2812 2812
 				if (($object->isProduct() || getDolGlobalInt('STOCK_SUPPORTS_SERVICES')) && isModEnabled('stock')) {
2813
-					print '<tr><td>' . $form->textwithpicto($langs->trans("StockableProduct"), $langs->trans('StockableProductDescription')) . '</td>';
2813
+					print '<tr><td>'.$form->textwithpicto($langs->trans("StockableProduct"), $langs->trans('StockableProductDescription')).'</td>';
2814 2814
 					print '<td><input type="checkbox" readonly disabled '.($object->stockable_product == 1 ? 'checked' : '').'></td></tr>';
2815 2815
 
2816 2816
 					if ($object->isStockManaged()) {
@@ -2867,7 +2867,7 @@  discard block
 block discarded – undo
2867 2867
 					$result = $measuringUnits->fetchAll('', 'scale', 0, 0, ['t.active' => 1, 't.unit_type' => 'time']);
2868 2868
 					if ($result !== -1) {
2869 2869
 						foreach ($measuringUnits->records as $record) {
2870
-							$durations[$record->short_label] = dol_ucfirst((string) $record->label) . $plural;
2870
+							$durations[$record->short_label] = dol_ucfirst((string) $record->label).$plural;
2871 2871
 						}
2872 2872
 					}
2873 2873
 					print '<tr><td class="titlefieldmiddle">'.$langs->trans("Duration").'</td><td>';
@@ -3107,7 +3107,7 @@  discard block
 block discarded – undo
3107 3107
 			}
3108 3108
 
3109 3109
 			//Send
3110
-			print dolGetButtonAction('', $langs->trans('SendMail'), 'email', $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=presend&mode=init&token=' . newToken() . '#formmailbeforetitle');
3110
+			print dolGetButtonAction('', $langs->trans('SendMail'), 'email', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=presend&mode=init&token='.newToken().'#formmailbeforetitle');
3111 3111
 
3112 3112
 			if (!isset($hookmanager->resArray['no_button_copy']) || $hookmanager->resArray['no_button_copy'] != 1) {
3113 3113
 				if (!empty($conf->use_javascript_ajax) && empty($conf->dol_use_jmobile)) {
@@ -3289,7 +3289,7 @@  discard block
 block discarded – undo
3289 3289
 	$modelmail = 'product_send';
3290 3290
 	$defaulttopic = $object->label;
3291 3291
 	$diroutput = $conf->product->multidir_output[$object->entity ?? $conf->entity];
3292
-	$trackid = 'prod' . $object->id;
3292
+	$trackid = 'prod'.$object->id;
3293 3293
 
3294 3294
 	include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php';
3295 3295
 }
Please login to merge, or discard this patch.
htdocs/main.inc.php 1 patch
Spacing   +63 added lines, -63 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 //@ini_set('memory_limit', '128M');	// This may be useless if memory is hard limited by your PHP
43 43
 
44 44
 // For optional tuning. Enabled if environment variable MAIN_SHOW_TUNING_INFO is defined.
45
-$micro_start_time = 0;	// Used as global var into printCommonFooter()
45
+$micro_start_time = 0; // Used as global var into printCommonFooter()
46 46
 if (!empty($_SERVER['MAIN_SHOW_TUNING_INFO'])) {
47 47
 	list($usec, $sec) = explode(" ", microtime());
48 48
 	$micro_start_time = ((float) $usec + (float) $sec);
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
 		session_set_cookie_params($sessioncookieparams);
132 132
 	}
133 133
 	session_name($sessionname);
134
-	dol_session_start();	// This call the open and read of session handler
134
+	dol_session_start(); // This call the open and read of session handler
135 135
 	//exit;	// this exist generates a call to write and close
136 136
 }
137 137
 
@@ -176,12 +176,12 @@  discard block
 block discarded – undo
176 176
 	if (!$ok) {
177 177
 		if (session_id() && isset($_SESSION["dol_login"]) && !in_array($_SESSION["dol_login"], explode(';', getDolGlobalString('MAIN_ONLY_LOGIN_ALLOWED')))) {
178 178
 			print 'Sorry, your application is offline.'."\n";
179
-			print 'You are logged with user "'.$_SESSION["dol_login"].'" and only administrator users (' . str_replace(';', ', ', getDolGlobalString('MAIN_ONLY_LOGIN_ALLOWED')).') is allowed to connect for the moment.'."\n";
180
-			$nexturl = dolBuildUrl(DOL_URL_ROOT . '/user/logout.php', [], true);
179
+			print 'You are logged with user "'.$_SESSION["dol_login"].'" and only administrator users ('.str_replace(';', ', ', getDolGlobalString('MAIN_ONLY_LOGIN_ALLOWED')).') is allowed to connect for the moment.'."\n";
180
+			$nexturl = dolBuildUrl(DOL_URL_ROOT.'/user/logout.php', [], true);
181 181
 			print 'Please try later or <a href="'.$nexturl.'">click here to disconnect and change login user</a>...'."\n";
182 182
 		} else {
183
-			print 'Sorry, your application is offline. Only administrator users (' . str_replace(';', ', ', getDolGlobalString('MAIN_ONLY_LOGIN_ALLOWED')).') is allowed to connect for the moment.'."\n";
184
-			$nexturl = dolBuildUrl(DOL_URL_ROOT . '/');
183
+			print 'Sorry, your application is offline. Only administrator users ('.str_replace(';', ', ', getDolGlobalString('MAIN_ONLY_LOGIN_ALLOWED')).') is allowed to connect for the moment.'."\n";
184
+			$nexturl = dolBuildUrl(DOL_URL_ROOT.'/');
185 185
 			print 'Please try later or <a href="'.$nexturl.'">click here to change login user</a>...'."\n";
186 186
 		}
187 187
 		exit;
@@ -396,7 +396,7 @@  discard block
 block discarded – undo
396 396
 					print "Access to this page this way (POST method or GET with a sensible value for 'action' parameter) is refused by CSRF protection in main.inc.php. Token not provided.\n";
397 397
 					print "If you access your server behind a proxy using url rewriting and the parameter is provided by caller, you might check that all HTTP header are propagated (or add the line \$dolibarr_nocsrfcheck=1 into your conf.php file or MAIN_SECURITY_CSRF_WITH_TOKEN to 0";
398 398
 					if (getDolGlobalString('MAIN_SECURITY_CSRF_WITH_TOKEN')) {
399
-						print " instead of " . getDolGlobalString('MAIN_SECURITY_CSRF_WITH_TOKEN');
399
+						print " instead of ".getDolGlobalString('MAIN_SECURITY_CSRF_WITH_TOKEN');
400 400
 					}
401 401
 					print " into setup).\n";
402 402
 				}
@@ -424,7 +424,7 @@  discard block
 block discarded – undo
424 424
 		unset($_GET['action']);
425 425
 		unset($_GET['confirmmassaction']);
426 426
 		unset($_GET['massaction']);
427
-		unset($_GET['token']);			// TODO Make a redirect if we have a token in url to remove it ?
427
+		unset($_GET['token']); // TODO Make a redirect if we have a token in url to remove it ?
428 428
 		if (isset($savid)) {
429 429
 			$_POST['id'] = ((int) $savid);
430 430
 		}
@@ -446,18 +446,18 @@  discard block
 block discarded – undo
446 446
 	foreach ($disabled_modules as $module) {
447 447
 		if ($module) {
448 448
 			if (empty($conf->$module)) {
449
-				$conf->$module = new stdClass(); 	// To avoid warnings
449
+				$conf->$module = new stdClass(); // To avoid warnings
450 450
 			}
451 451
 
452
-			$conf->$module->enabled = false;		// Old usage
452
+			$conf->$module->enabled = false; // Old usage
453 453
 			unset($conf->modules[$module]);
454 454
 
455 455
 			foreach ($modulepartkeys as $modulepartkey) {
456 456
 				unset($conf->modules_parts[$modulepartkey][$module]);
457 457
 			}
458 458
 			if ($module == 'fournisseur') {		// Special case
459
-				$conf->supplier_order->enabled = 0;		// Old usage
460
-				$conf->supplier_invoice->enabled = 0;	// Old usage
459
+				$conf->supplier_order->enabled = 0; // Old usage
460
+				$conf->supplier_invoice->enabled = 0; // Old usage
461 461
 				unset($conf->modules['supplier_order']);
462 462
 				unset($conf->modules['supplier_invoice']);
463 463
 			}
@@ -554,7 +554,7 @@  discard block
 block discarded – undo
554 554
 				if ($dol_use_jmobile) {
555 555
 					$query += ['dol_use_jmobile='.$dol_use_jmobile];
556 556
 				}
557
-				header("Location: " . dolBuildUrl(DOL_URL_ROOT . '/public/demo/index.php', $query));
557
+				header("Location: ".dolBuildUrl(DOL_URL_ROOT.'/public/demo/index.php', $query));
558 558
 				exit;
559 559
 			}
560 560
 		}
@@ -602,12 +602,12 @@  discard block
 block discarded – undo
602 602
 					if (is_object($captchaobj) && method_exists($captchaobj, 'validateCodeAfterLoginSubmit')) {
603 603
 						$ok = $captchaobj->validateCodeAfterLoginSubmit(); // @phan-suppress-current-line PhanUndeclaredMethod
604 604
 					} else {
605
-						$_SESSION["dol_loginmesg"] =  'Error, the captcha handler '.get_class($captchaobj).' does not have any method validateCodeAfterLoginSubmit()';
605
+						$_SESSION["dol_loginmesg"] = 'Error, the captcha handler '.get_class($captchaobj).' does not have any method validateCodeAfterLoginSubmit()';
606 606
 						$test = false;
607 607
 						$error++;
608 608
 					}
609 609
 				} else {
610
-					$_SESSION["dol_loginmesg"] =  'Error, the captcha handler class '.$classname.' was not found after the include';
610
+					$_SESSION["dol_loginmesg"] = 'Error, the captcha handler class '.$classname.' was not found after the include';
611 611
 					$test = false;
612 612
 					$error++;
613 613
 				}
@@ -651,7 +651,7 @@  discard block
 block discarded – undo
651 651
 
652 652
 		$allowedmethodtopostusername = 3;
653 653
 		if (defined('MAIN_AUTHENTICATION_POST_METHOD')) {
654
-			$allowedmethodtopostusername = constant('MAIN_AUTHENTICATION_POST_METHOD');	// Note a value of 2 is not compatible with some authentication methods that put username as GET parameter
654
+			$allowedmethodtopostusername = constant('MAIN_AUTHENTICATION_POST_METHOD'); // Note a value of 2 is not compatible with some authentication methods that put username as GET parameter
655 655
 		}
656 656
 		// TODO Remove use of $_COOKIE['login_dolibarr'] by replacing line with $usertotest = GETPOST("username", "alpha", $allowedmethodtopostusername); ?
657 657
 		$usertotest = (!empty($_COOKIE['login_dolibarr']) ? preg_replace('/[^a-zA-Z0-9_@\-\.]/', '', $_COOKIE['login_dolibarr']) : GETPOST("username", "alpha", $allowedmethodtopostusername));
@@ -800,7 +800,7 @@  discard block
 block discarded – undo
800 800
 				}
801 801
 
802 802
 				// Show login form
803
-				dol_loginfunction($langs, $conf, (!empty($mysoc) ? $mysoc : ''));	// This include http headers
803
+				dol_loginfunction($langs, $conf, (!empty($mysoc) ? $mysoc : '')); // This include http headers
804 804
 			}
805 805
 			exit;
806 806
 		}
@@ -861,7 +861,7 @@  discard block
 block discarded – undo
861 861
 			if (GETPOST('lang', 'aZ09')) {
862 862
 				$paramsurl += ['lang' => (string) GETPOST('lang', 'aZ09')];
863 863
 			}
864
-			header('Location: '.dolBuildUrl(DOL_URL_ROOT . '/index.php', $paramsurl));
864
+			header('Location: '.dolBuildUrl(DOL_URL_ROOT.'/index.php', $paramsurl));
865 865
 			exit;
866 866
 		} else {
867 867
 			// User is loaded, we may need to change language for him according to its choice
@@ -1158,7 +1158,7 @@  discard block
 block discarded – undo
1158 1158
 } else {
1159 1159
 	// We may have NOLOGIN set, but NOREQUIREUSER not
1160 1160
 	if (!empty($user) && method_exists($user, 'loadDefaultValues') && !defined('NODEFAULTVALUES')) {
1161
-		$user->loadDefaultValues();		// Load default values for everybody (works even if $user->id = 0
1161
+		$user->loadDefaultValues(); // Load default values for everybody (works even if $user->id = 0
1162 1162
 	}
1163 1163
 }
1164 1164
 
@@ -1221,7 +1221,7 @@  discard block
 block discarded – undo
1221 1221
 	$conf->dol_optimize_smallscreen = 1;
1222 1222
 
1223 1223
 	if (getDolGlobalInt('PRODUIT_DESC_IN_FORM') == 1) {
1224
-		$conf->global->PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE = 0;	// This was set to PRODUIT_DESC_IN_FORM and is forced to 0 if smartphone in this case
1224
+		$conf->global->PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE = 0; // This was set to PRODUIT_DESC_IN_FORM and is forced to 0 if smartphone in this case
1225 1225
 	}
1226 1226
 }
1227 1227
 // Replace themes bugged with jmobile with eldy
@@ -1326,7 +1326,7 @@  discard block
 block discarded – undo
1326 1326
 	define('ROWS_9', 8);
1327 1327
 }
1328 1328
 
1329
-$heightforframes = 52;	// Used by frames.php page
1329
+$heightforframes = 52; // Used by frames.php page
1330 1330
 
1331 1331
 // Init menu manager
1332 1332
 if (!defined('NOREQUIREMENU')) {
@@ -1366,7 +1366,7 @@  discard block
 block discarded – undo
1366 1366
 
1367 1367
 if (!empty(GETPOST('seteventmessages', 'alpha'))) {
1368 1368
 	$message = GETPOST('seteventmessages', 'alpha');
1369
-	$messages  = explode(',', $message);
1369
+	$messages = explode(',', $message);
1370 1370
 	foreach ($messages as $key => $msg) {
1371 1371
 		$tmp = explode(':', $msg);
1372 1372
 		setEventMessages($tmp[0], null, !empty($tmp[1]) ? $tmp[1] : 'mesgs');
@@ -1705,7 +1705,7 @@  discard block
 block discarded – undo
1705 1705
 		}
1706 1706
 
1707 1707
 		if (getDolGlobalString('THEME_ELDY_TOPMENU_BACK1')) {
1708
-			print '<meta name="theme-color" content="rgb(' . getDolGlobalString('THEME_ELDY_TOPMENU_BACK1').')">'."\n";
1708
+			print '<meta name="theme-color" content="rgb('.getDolGlobalString('THEME_ELDY_TOPMENU_BACK1').')">'."\n";
1709 1709
 		}
1710 1710
 
1711 1711
 		// Auto refresh page
@@ -1754,7 +1754,7 @@  discard block
 block discarded – undo
1754 1754
 
1755 1755
 		$themeparam = '?lang='.$langs->defaultlang.'&amp;theme='.$conf->theme.(GETPOST('optioncss', 'aZ09') ? '&amp;optioncss='.GETPOST('optioncss', 'aZ09', 1) : '').(empty($user->id) ? '' : ('&amp;userid='.$user->id)).'&amp;entity='.$conf->entity;
1756 1756
 
1757
-		$themeparam .= '&' .$ext . '&revision='.getDolGlobalInt("MAIN_IHM_PARAMS_REV");
1757
+		$themeparam .= '&'.$ext.'&revision='.getDolGlobalInt("MAIN_IHM_PARAMS_REV");
1758 1758
 		if (GETPOSTISSET('dol_hide_topmenu')) {
1759 1759
 			$themeparam .= '&amp;dol_hide_topmenu='.GETPOSTINT('dol_hide_topmenu');
1760 1760
 		}
@@ -1794,24 +1794,24 @@  discard block
 block discarded – undo
1794 1794
 					$jquerytheme = getDolGlobalString('MAIN_USE_JQUERY_THEME');
1795 1795
 				}
1796 1796
 				if (constant('JS_JQUERY_UI')) {
1797
-					print '<link rel="stylesheet" type="text/css" href="' . JS_JQUERY_UI . 'css/' . $jquerytheme . '/jquery-ui.min.css?' . $ext . '">' . "\n"; // Forced JQuery
1797
+					print '<link rel="stylesheet" type="text/css" href="'.JS_JQUERY_UI.'css/'.$jquerytheme.'/jquery-ui.min.css?'.$ext.'">'."\n"; // Forced JQuery
1798 1798
 				} else {
1799
-					print '<link rel="stylesheet" type="text/css" href="' . DOL_URL_ROOT . '/includes/jquery/css/' . $jquerytheme . '/jquery-ui.css?' . $ext . '">' . "\n"; // JQuery
1799
+					print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/css/'.$jquerytheme.'/jquery-ui.css?'.$ext.'">'."\n"; // JQuery
1800 1800
 				}
1801 1801
 			}
1802 1802
 			if (!defined('DISABLE_JQUERY_JNOTIFY')) {
1803
-				print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/plugins/jnotify/jquery.jnotify-alt.min.css?' . $ext . '">'."\n"; // JNotify
1803
+				print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/plugins/jnotify/jquery.jnotify-alt.min.css?'.$ext.'">'."\n"; // JNotify
1804 1804
 			}
1805 1805
 			if (!defined('DISABLE_SELECT2') && (getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') || defined('REQUIRE_JQUERY_MULTISELECT'))) {     // jQuery plugin "mutiselect", "multiple-select", "select2"...
1806 1806
 				$tmpplugin = !getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') ? constant('REQUIRE_JQUERY_MULTISELECT') : getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT');
1807
-				print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/plugins/'.$tmpplugin.'/dist/css/'.$tmpplugin.'.css?' . $ext . '">'."\n";
1807
+				print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/plugins/'.$tmpplugin.'/dist/css/'.$tmpplugin.'.css?'.$ext.'">'."\n";
1808 1808
 			}
1809 1809
 		}
1810 1810
 
1811 1811
 		if (!defined('DISABLE_FONT_AWSOME')) {
1812 1812
 			print '<!-- Includes CSS for font awesome -->'."\n";
1813 1813
 			$fontawesome_directory = getDolGlobalString('MAIN_FONTAWESOME_DIRECTORY', '/theme/common/fontawesome-5');
1814
-			print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.$fontawesome_directory.'/css/all.min.css?' . $ext . '">'."\n";
1814
+			print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.$fontawesome_directory.'/css/all.min.css?'.$ext.'">'."\n";
1815 1815
 		}
1816 1816
 
1817 1817
 		// Output style sheets (optioncss='print' or ''). Note: $conf->css looks like '/theme/eldy/style.css.php'
@@ -1829,7 +1829,7 @@  discard block
 block discarded – undo
1829 1829
 
1830 1830
 		if (!defined('DISABLE_CSS_DEFAULT_THEME')) {
1831 1831
 			print '<!-- Includes CSS for Dolibarr theme -->'."\n";
1832
-			print '<link rel="stylesheet" type="text/css" href="' . $themepath . $themeparam . '">' . "\n";
1832
+			print '<link rel="stylesheet" type="text/css" href="'.$themepath.$themeparam.'">'."\n";
1833 1833
 		}
1834 1834
 
1835 1835
 		// To fix old chrome bug
@@ -1841,8 +1841,8 @@  discard block
 block discarded – undo
1841 1841
 
1842 1842
 		// LEAFLET AND GEOMAN
1843 1843
 		if (getDolGlobalString('MAIN_USE_GEOPHP')) {
1844
-			print '<link rel="stylesheet" href="'.DOL_URL_ROOT.'/includes/leaflet/leaflet.css?' . $ext . "\">\n";
1845
-			print '<link rel="stylesheet" href="'.DOL_URL_ROOT.'/includes/leaflet/leaflet-geoman.css?' . $ext . "\">\n";
1844
+			print '<link rel="stylesheet" href="'.DOL_URL_ROOT.'/includes/leaflet/leaflet.css?'.$ext."\">\n";
1845
+			print '<link rel="stylesheet" href="'.DOL_URL_ROOT.'/includes/leaflet/leaflet-geoman.css?'.$ext."\">\n";
1846 1846
 		}
1847 1847
 
1848 1848
 		// CSS forced by modules (relative url starting with /)
@@ -1889,7 +1889,7 @@  discard block
 block discarded – undo
1889 1889
 		// Custom CSS
1890 1890
 		if (getDolGlobalString('MAIN_IHM_CUSTOM_CSS')) {
1891 1891
 			// If a custom CSS was set, we add link to the custom css php file
1892
-			print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/theme/custom.css.php?' . $ext . '&amp;revision='.getDolGlobalInt("MAIN_IHM_PARAMS_REV").'">'."\n";
1892
+			print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/theme/custom.css.php?'.$ext.'&amp;revision='.getDolGlobalInt("MAIN_IHM_PARAMS_REV").'">'."\n";
1893 1893
 		}
1894 1894
 
1895 1895
 		// Output standard javascript links
@@ -1897,36 +1897,36 @@  discard block
 block discarded – undo
1897 1897
 			// JQuery. Must be before other includes
1898 1898
 			print '<!-- Includes JS for JQuery -->'."\n";
1899 1899
 			if (defined('JS_JQUERY') && constant('JS_JQUERY')) {
1900
-				print '<script nonce="'.getNonce().'" src="'.JS_JQUERY.'jquery.min.js?' . $ext . '"></script>'."\n";
1900
+				print '<script nonce="'.getNonce().'" src="'.JS_JQUERY.'jquery.min.js?'.$ext.'"></script>'."\n";
1901 1901
 			} else {
1902
-				print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/jquery/js/jquery.min.js?' . $ext . '"></script>'."\n";
1902
+				print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/jquery/js/jquery.min.js?'.$ext.'"></script>'."\n";
1903 1903
 			}
1904 1904
 			if (!defined('DISABLE_JQUERY_UI')) {
1905 1905
 				if (defined('JS_JQUERY_UI') && constant('JS_JQUERY_UI')) {
1906
-					print '<script nonce="' . getNonce() . '" src="' . JS_JQUERY_UI . 'jquery-ui.min.js?' . $ext . '"></script>' . "\n";
1906
+					print '<script nonce="'.getNonce().'" src="'.JS_JQUERY_UI.'jquery-ui.min.js?'.$ext.'"></script>'."\n";
1907 1907
 				} else {
1908
-					print '<script nonce="' . getNonce() . '" src="' . DOL_URL_ROOT . '/includes/jquery/js/jquery-ui.min.js?' . $ext . '"></script>' . "\n";
1908
+					print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/jquery/js/jquery-ui.min.js?'.$ext.'"></script>'."\n";
1909 1909
 				}
1910 1910
 			}
1911 1911
 			// jQuery jnotify
1912 1912
 			if (!getDolGlobalString('MAIN_DISABLE_JQUERY_JNOTIFY') && !defined('DISABLE_JQUERY_JNOTIFY')) {
1913
-				print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/jnotify/jquery.jnotify.min.js?' . $ext . '"></script>'."\n";
1913
+				print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/jnotify/jquery.jnotify.min.js?'.$ext.'"></script>'."\n";
1914 1914
 			}
1915 1915
 			// Table drag and drop lines
1916 1916
 			if (empty($disableforlogin) && !defined('DISABLE_JQUERY_TABLEDND')) {
1917
-				print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/tablednd/jquery.tablednd.min.js?' . $ext . '"></script>'."\n";
1917
+				print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/tablednd/jquery.tablednd.min.js?'.$ext.'"></script>'."\n";
1918 1918
 			}
1919 1919
 			// Chart
1920 1920
 			if (empty($disableforlogin) && (!getDolGlobalString('MAIN_JS_GRAPH') || getDolGlobalString('MAIN_JS_GRAPH') == 'chart') && !defined('DISABLE_JS_GRAPH')) {
1921
-				print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/nnnick/chartjs/dist/chart.min.js?' . $ext . '"></script>'."\n";
1921
+				print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/nnnick/chartjs/dist/chart.min.js?'.$ext.'"></script>'."\n";
1922 1922
 			}
1923 1923
 
1924 1924
 			// jQuery jeditable for Edit In Place features
1925 1925
 			if (getDolGlobalString('MAIN_USE_JQUERY_JEDITABLE') && !defined('DISABLE_JQUERY_JEDITABLE')) {
1926 1926
 				print '<!-- JS to manage editInPlace feature -->'."\n";
1927
-				print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/jeditable/jquery.jeditable.js?' . $ext . '"></script>'."\n";
1928
-				print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/jeditable/jquery.jeditable.ui-datepicker.js?' . $ext . '"></script>'."\n";
1929
-				print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/jeditable/jquery.jeditable.ui-autocomplete.js?' . $ext . '"></script>'."\n";
1927
+				print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/jeditable/jquery.jeditable.js?'.$ext.'"></script>'."\n";
1928
+				print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/jeditable/jquery.jeditable.ui-datepicker.js?'.$ext.'"></script>'."\n";
1929
+				print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/jeditable/jquery.jeditable.ui-autocomplete.js?'.$ext.'"></script>'."\n";
1930 1930
 				print '<script nonce="'.getNonce().'" >'."\n";
1931 1931
 				print 'var urlSaveInPlace = \''.DOL_URL_ROOT.'/core/ajax/saveinplace.php\';'."\n";
1932 1932
 				print 'var urlLoadInPlace = \''.DOL_URL_ROOT.'/core/ajax/loadinplace.php\';'."\n";
@@ -1937,16 +1937,16 @@  discard block
 block discarded – undo
1937 1937
 				print 'var indicatorInPlace = \'<img src="'.DOL_URL_ROOT."/theme/".$conf->theme."/img/working.gif".'">\';'."\n";
1938 1938
 				print 'var withInPlace = 300;'; // width in pixel for default string edit
1939 1939
 				print '</script>'."\n";
1940
-				print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/core/js/editinplace.js?' . $ext . '"></script>'."\n";
1941
-				print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/jeditable/jquery.jeditable.ckeditor.js?' . $ext . '"></script>'."\n";
1940
+				print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/core/js/editinplace.js?'.$ext.'"></script>'."\n";
1941
+				print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/jeditable/jquery.jeditable.ckeditor.js?'.$ext.'"></script>'."\n";
1942 1942
 			}
1943 1943
 			if (!defined('DISABLE_SELECT2') && (getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') || defined('REQUIRE_JQUERY_MULTISELECT'))) {
1944 1944
 				// jQuery plugin "mutiselect", "multiple-select", "select2", ...
1945 1945
 				$tmpplugin = !getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') ? constant('REQUIRE_JQUERY_MULTISELECT') : getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT');
1946
-				print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/'.$tmpplugin.'/dist/js/'.$tmpplugin.'.full.min.js?' . $ext . '"></script>'."\n"; // We include full because we need the support of containerCssClass
1946
+				print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/'.$tmpplugin.'/dist/js/'.$tmpplugin.'.full.min.js?'.$ext.'"></script>'."\n"; // We include full because we need the support of containerCssClass
1947 1947
 			}
1948 1948
 			if (!defined('DISABLE_MULTISELECT')) {     // jQuery plugin "mutiselect" to select with checkboxes. Can be removed once we have an enhanced search tool
1949
-				print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/multiselect/jquery.multi-select.js?' . $ext . '"></script>'."\n";
1949
+				print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/multiselect/jquery.multi-select.js?'.$ext.'"></script>'."\n";
1950 1950
 			}
1951 1951
 		}
1952 1952
 
@@ -1963,11 +1963,11 @@  discard block
 block discarded – undo
1963 1963
 				print '<script nonce="'.getNonce().'">';
1964 1964
 				print '/* enable ckeditor by main.inc.php */';
1965 1965
 				print 'var CKEDITOR_BASEPATH = \''.dol_escape_js($pathckeditor).'\';'."\n";
1966
-				print 'var ckeditorConfig = \''.dol_escape_js(dol_buildpath($themesubdir.'/theme/'.$conf->theme.'/ckeditor/config.js?' . $ext, 1)).'\';'."\n"; // $themesubdir='' in standard usage
1966
+				print 'var ckeditorConfig = \''.dol_escape_js(dol_buildpath($themesubdir.'/theme/'.$conf->theme.'/ckeditor/config.js?'.$ext, 1)).'\';'."\n"; // $themesubdir='' in standard usage
1967 1967
 				print 'var ckeditorFilebrowserBrowseUrl = \''.DOL_URL_ROOT.'/core/filemanagerdol/browser/default/browser.php?Connector='.DOL_URL_ROOT.'/core/filemanagerdol/connectors/php/connector.php\';'."\n";
1968 1968
 				print 'var ckeditorFilebrowserImageBrowseUrl = \''.DOL_URL_ROOT.'/core/filemanagerdol/browser/default/browser.php?Type=Image&Connector='.DOL_URL_ROOT.'/core/filemanagerdol/connectors/php/connector.php\';'."\n";
1969 1969
 				print '</script>'."\n";
1970
-				print '<script src="'.$pathckeditor.$jsckeditor. '?' . $ext . '"></script>'."\n";
1970
+				print '<script src="'.$pathckeditor.$jsckeditor.'?'.$ext.'"></script>'."\n";
1971 1971
 				print '<script>';
1972 1972
 				if (GETPOST('mode', 'aZ09') == 'Full_inline') {
1973 1973
 					print 'CKEDITOR.disableAutoInline = false;'."\n";
@@ -1988,20 +1988,20 @@  discard block
 block discarded – undo
1988 1988
 				}
1989 1989
 				if ($enablebrowsernotif) {
1990 1990
 					print '<!-- Includes JS of Dolibarr (browser layout = '.$conf->browser->layout.')-->'."\n";
1991
-					print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/core/js/lib_notification.js.php?lang='.$langs->defaultlang. '&' . $ext . '"></script>'."\n";
1991
+					print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/core/js/lib_notification.js.php?lang='.$langs->defaultlang.'&'.$ext.'"></script>'."\n";
1992 1992
 				}
1993 1993
 			}
1994 1994
 
1995 1995
 			// Global js function
1996 1996
 			print '<!-- Includes JS of Dolibarr -->'."\n";
1997 1997
 			if (!defined('DISABLE_LIB_HEAD_JS')) {
1998
-				print '<script nonce="' . getNonce() . '" src="' . DOL_URL_ROOT . '/core/js/lib_head.js.php?lang=' . $langs->defaultlang . '&' . $ext . '"></script>' . "\n";
1998
+				print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/core/js/lib_head.js.php?lang='.$langs->defaultlang.'&'.$ext.'"></script>'."\n";
1999 1999
 			}
2000 2000
 
2001 2001
 			// Leaflet
2002 2002
 			if (getDolGlobalString('MAIN_USE_GEOPHP')) {
2003
-				print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/leaflet/leaflet.js?' . $ext . '"></script>'."\n";
2004
-				print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/leaflet/leaflet-geoman.min.js?' . $ext . '"></script>'."\n";
2003
+				print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/leaflet/leaflet.js?'.$ext.'"></script>'."\n";
2004
+				print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/leaflet/leaflet-geoman.min.js?'.$ext.'"></script>'."\n";
2005 2005
 			}
2006 2006
 
2007 2007
 			// JS forced by modules (relative url starting with /)
@@ -2038,7 +2038,7 @@  discard block
 block discarded – undo
2038 2038
 		if (getDolGlobalString('ALLOW_THEME_JS')) {
2039 2039
 			$theme_js = dol_buildpath('/theme/'.$conf->theme.'/'.$conf->theme.'.js', 0);
2040 2040
 			if (file_exists($theme_js)) {
2041
-				print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/'.$conf->theme.'.js?' . $ext . '"></script>'."\n";
2041
+				print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/'.$conf->theme.'.js?'.$ext.'"></script>'."\n";
2042 2042
 			}
2043 2043
 		}
2044 2044
 
@@ -2046,7 +2046,7 @@  discard block
 block discarded – undo
2046 2046
 			print $head."\n";
2047 2047
 		}
2048 2048
 		if (getDolGlobalString('MAIN_HTML_HEADER')) {
2049
-			print getDolGlobalString('MAIN_HTML_HEADER') . "\n";
2049
+			print getDolGlobalString('MAIN_HTML_HEADER')."\n";
2050 2050
 		}
2051 2051
 
2052 2052
 		$parameters = array();
@@ -2174,7 +2174,7 @@  discard block
 block discarded – undo
2174 2174
 
2175 2175
 		$toprightmenu .= '</div>';
2176 2176
 
2177
-		$toprightmenu .= '</div>'."\n";		 // end div class="login_block_tools"
2177
+		$toprightmenu .= '</div>'."\n"; // end div class="login_block_tools"
2178 2178
 
2179 2179
 
2180 2180
 		// Add block for other tools
@@ -2195,7 +2195,7 @@  discard block
 block discarded – undo
2195 2195
 
2196 2196
 		// Link to module builder
2197 2197
 		if (isModEnabled('modulebuilder')) {
2198
-			$text = '<a href="' . dolBuildUrl(DOL_URL_ROOT . '/modulebuilder/index.php', ['mainmenu' => 'home', 'leftmenu' => 'admintools']) .'" target="modulebuilder">';
2198
+			$text = '<a href="'.dolBuildUrl(DOL_URL_ROOT.'/modulebuilder/index.php', ['mainmenu' => 'home', 'leftmenu' => 'admintools']).'" target="modulebuilder">';
2199 2199
 			//$text.= img_picto(":".$langs->trans("ModuleBuilder"), 'printer_top.png', 'class="printer"');
2200 2200
 			$text .= '<span class="fa fa-bug atoplogin valignmiddle"></span>';
2201 2201
 			$text .= '</a>';
@@ -2475,7 +2475,7 @@  discard block
 block discarded – undo
2475 2475
 	}
2476 2476
 
2477 2477
 	if (empty($urllogout)) {
2478
-		$urllogout = dolBuildUrl(DOL_URL_ROOT . '/user/logout.php', [], true);
2478
+		$urllogout = dolBuildUrl(DOL_URL_ROOT.'/user/logout.php', [], true);
2479 2479
 	}
2480 2480
 
2481 2481
 	// Defined the links for bottom of card
@@ -2884,7 +2884,7 @@  discard block
 block discarded – undo
2884 2884
 		$langs->load(explode('@', $item['name'])[1]);
2885 2885
 		$dropDownQuickAddHtml .= '
2886 2886
 			<a class="dropdown-item quickadd-item" href="'.DOL_URL_ROOT.$item['url'].'" title="'.$langs->trans(explode('@', $item['title'])[0]).'">
2887
-			'. img_picto('', $item['picto'], 'style="width:18px;"') . ' ' . $langs->trans(explode('@', $item['name'])[0]) . '</a>
2887
+			'. img_picto('', $item['picto'], 'style="width:18px;"').' '.$langs->trans(explode('@', $item['name'])[0]).'</a>
2888 2888
 		';
2889 2889
 	}
2890 2890
 
@@ -2989,7 +2989,7 @@  discard block
 block discarded – undo
2989 2989
  */
2990 2990
 function top_menu_search()
2991 2991
 {
2992
-	global $langs, $conf, $db, $user, $hookmanager;	// used by htdocs/core/ajax/selectsearchbox.php
2992
+	global $langs, $conf, $db, $user, $hookmanager; // used by htdocs/core/ajax/selectsearchbox.php
2993 2993
 
2994 2994
 	$html = '';
2995 2995
 
@@ -3677,7 +3677,7 @@  discard block
 block discarded – undo
3677 3677
 
3678 3678
 		if (!empty($conf->use_javascript_ajax)) {
3679 3679
 			print "\n".'<!-- Includes JS Footer of Dolibarr -->'."\n";
3680
-			print '<script src="'.DOL_URL_ROOT.'/core/js/lib_foot.js.php?lang='.$langs->defaultlang . '&' . $ext .'"></script>'."\n";
3680
+			print '<script src="'.DOL_URL_ROOT.'/core/js/lib_foot.js.php?lang='.$langs->defaultlang.'&'.$ext.'"></script>'."\n";
3681 3681
 		}
3682 3682
 
3683 3683
 		// JS wrapper to add an unalterable log when clicking on Download or Preview
@@ -3731,7 +3731,7 @@  discard block
 block discarded – undo
3731 3731
 		$forceping = GETPOSTINT('forceping');
3732 3732
 
3733 3733
 		if (($_SERVER["PHP_SELF"] == DOL_URL_ROOT.'/index.php') || $forceping) {
3734
-			$hash_unique_id = dol_hash('dolibarr'.$conf->file->instance_unique_id, 'sha256');	// Note: if the global salt changes, this hash changes too so ping may be counted twice. We don't mind. It is for statistics purpose only.
3734
+			$hash_unique_id = dol_hash('dolibarr'.$conf->file->instance_unique_id, 'sha256'); // Note: if the global salt changes, this hash changes too so ping may be counted twice. We don't mind. It is for statistics purpose only.
3735 3735
 			$constanttosavelastko = 'MAIN_LAST_PING_KO_DATE';
3736 3736
 			$constanttosavefirstok = 'MAIN_FIRST_PING_OK_DATE';
3737 3737
 			$constanttosavefirstokid = 'MAIN_FIRST_PING_OK_ID';
@@ -3770,7 +3770,7 @@  discard block
 block discarded – undo
3770 3770
 			} elseif (!isRegistrationRecorded()) {
3771 3771
 				print "\n<!-- NO JS CODE TO ENABLE the registration. Registration data not saved -->\n";
3772 3772
 			} else {
3773
-				$hash_unique_id = dol_hash('dolibarr'.$conf->file->instance_unique_id, 'sha256');	// Note: if the global salt changes, this hash changes too so ping may be counted twice. We don't mind. It is for statistics purpose only.
3773
+				$hash_unique_id = dol_hash('dolibarr'.$conf->file->instance_unique_id, 'sha256'); // Note: if the global salt changes, this hash changes too so ping may be counted twice. We don't mind. It is for statistics purpose only.
3774 3774
 				$constanttosavelastko = 'MAIN_LAST_REGISTRATION_KO_DATE';
3775 3775
 				$constanttosavefirstok = 'MAIN_FIRST_REGISTRATION_OK_DATE';
3776 3776
 				$constanttosavefirstokid = 'MAIN_FIRST_REGISTRATION_OK_ID';
Please login to merge, or discard this patch.
htdocs/comm/propal/card.php 1 patch
Spacing   +258 added lines, -258 removed lines patch added patch discarded remove patch
@@ -44,24 +44,24 @@  discard block
 block discarded – undo
44 44
 // Load Dolibarr environment
45 45
 require '../../main.inc.php';
46 46
 require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
47
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php';
48
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formfile.class.php';
49
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formpropal.class.php';
50
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formmargin.class.php';
51
-require_once DOL_DOCUMENT_ROOT . '/comm/propal/class/propal.class.php';
52
-require_once DOL_DOCUMENT_ROOT . '/comm/action/class/actioncomm.class.php';
53
-require_once DOL_DOCUMENT_ROOT . '/core/modules/propale/modules_propale.php';
54
-require_once DOL_DOCUMENT_ROOT . '/core/lib/propal.lib.php';
55
-require_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php';
56
-require_once DOL_DOCUMENT_ROOT . '/core/class/extrafields.class.php';
57
-require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php';
47
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
48
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
49
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formpropal.class.php';
50
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formmargin.class.php';
51
+require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
52
+require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
53
+require_once DOL_DOCUMENT_ROOT.'/core/modules/propale/modules_propale.php';
54
+require_once DOL_DOCUMENT_ROOT.'/core/lib/propal.lib.php';
55
+require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
56
+require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
57
+require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
58 58
 if (isModEnabled('project')) {
59
-	require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
60
-	require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php';
59
+	require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
60
+	require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
61 61
 }
62 62
 
63 63
 if (isModEnabled('variants')) {
64
-	require_once DOL_DOCUMENT_ROOT . '/variants/class/ProductCombination.class.php';
64
+	require_once DOL_DOCUMENT_ROOT.'/variants/class/ProductCombination.class.php';
65 65
 }
66 66
 
67 67
 /**
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
 $cancel = GETPOST('cancel', 'alpha');
94 94
 $origin = GETPOST('origin', 'alpha');
95 95
 $originid = GETPOSTINT('originid');
96
-$renewal = GETPOST('renewal');	// for contract renewal
96
+$renewal = GETPOST('renewal'); // for contract renewal
97 97
 $confirm = GETPOST('confirm', 'alpha');
98 98
 $backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page
99 99
 $lineid = GETPOSTINT('lineid');
@@ -178,34 +178,34 @@  discard block
 block discarded – undo
178 178
 	setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
179 179
 }
180 180
 if (empty($reshook)) {
181
-	$backurlforlist = DOL_URL_ROOT . '/comm/propal/list.php';
181
+	$backurlforlist = DOL_URL_ROOT.'/comm/propal/list.php';
182 182
 
183 183
 	if (empty($backtopage) || ($cancel && empty($id))) {
184 184
 		if (empty($backtopage) || ($cancel && strpos($backtopage, '__ID__'))) {
185 185
 			if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) {
186 186
 				$backtopage = $backurlforlist;
187 187
 			} else {
188
-				$backtopage = DOL_URL_ROOT . '/comm/propal/card.php?id=' . ((!empty($id) && $id > 0) ? $id : '__ID__');
188
+				$backtopage = DOL_URL_ROOT.'/comm/propal/card.php?id='.((!empty($id) && $id > 0) ? $id : '__ID__');
189 189
 			}
190 190
 		}
191 191
 	}
192 192
 
193 193
 	if ($cancel) {
194 194
 		if (!empty($backtopageforcancel)) {
195
-			header("Location: " . $backtopageforcancel);
195
+			header("Location: ".$backtopageforcancel);
196 196
 			exit;
197 197
 		} elseif (!empty($backtopage)) {
198
-			header("Location: " . $backtopage);
198
+			header("Location: ".$backtopage);
199 199
 			exit;
200 200
 		}
201 201
 		$action = '';
202 202
 	}
203 203
 
204
-	include DOL_DOCUMENT_ROOT . '/core/actions_setnotes.inc.php'; // Must be include, not includ_once
204
+	include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not includ_once
205 205
 
206
-	include DOL_DOCUMENT_ROOT . '/core/actions_dellink.inc.php'; // Must be 'include', not 'include_once'
206
+	include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be 'include', not 'include_once'
207 207
 
208
-	include DOL_DOCUMENT_ROOT . '/core/actions_lineupdown.inc.php'; // Must be 'include', not 'include_once'
208
+	include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; // Must be 'include', not 'include_once'
209 209
 	// Action clone object
210 210
 	if ($action == 'confirm_clone' && $confirm == 'yes' && $usercancreate) {
211 211
 		if (!($socid > 0)) {
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
 							$object->delivery_date = $date_delivery;
240 240
 							foreach ($object->lines as $line) {
241 241
 								if (isset($line->date_start)) {
242
-									$line->date_start +=  $difference;
242
+									$line->date_start += $difference;
243 243
 								}
244 244
 								if (isset($line->date_end)) {
245 245
 									$line->date_end += $difference;
@@ -267,7 +267,7 @@  discard block
 block discarded – undo
267 267
 						setEventMessages('', $warningMsgLineList, 'warnings');
268 268
 					}
269 269
 
270
-					header("Location: " . $_SERVER['PHP_SELF'] . '?id=' . $result);
270
+					header("Location: ".$_SERVER['PHP_SELF'].'?id='.$result);
271 271
 					exit();
272 272
 				} else {
273 273
 					if (count($object->errors) > 0) {
@@ -281,7 +281,7 @@  discard block
 block discarded – undo
281 281
 		// Cancel proposal
282 282
 		$result = $object->setCancel($user);
283 283
 		if ($result > 0) {
284
-			header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object->id);
284
+			header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id);
285 285
 			exit();
286 286
 		} else {
287 287
 			$langs->load("errors");
@@ -291,7 +291,7 @@  discard block
 block discarded – undo
291 291
 		// Delete proposal
292 292
 		$result = $object->delete($user);
293 293
 		if ($result > 0) {
294
-			header('Location: ' . DOL_URL_ROOT . '/comm/propal/list.php?restore_lastsearch_values=1');
294
+			header('Location: '.DOL_URL_ROOT.'/comm/propal/list.php?restore_lastsearch_values=1');
295 295
 			exit();
296 296
 		} else {
297 297
 			$langs->load("errors");
@@ -323,7 +323,7 @@  discard block
 block discarded – undo
323 323
 			$object->generateDocument($object->model_pdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
324 324
 		}
325 325
 
326
-		header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object->id);
326
+		header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id);
327 327
 		exit();
328 328
 	} elseif ($action == 'confirm_delete_subtotalline' && $confirm == 'yes' && $usercancreate) {
329 329
 		// Delete line
@@ -353,7 +353,7 @@  discard block
 block discarded – undo
353 353
 				$result = $object->generateDocument($object->model_pdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
354 354
 			}
355 355
 			if ($result >= 0) {
356
-				header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $id);
356
+				header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id);
357 357
 				exit();
358 358
 			}
359 359
 		} else {
@@ -625,14 +625,14 @@  discard block
 block discarded – undo
625 625
 
626 626
 					$id = $object->create($user);
627 627
 					if ($id > 0) {
628
-						dol_include_once('/' . $element . '/class/' . $subelement . '.class.php');
628
+						dol_include_once('/'.$element.'/class/'.$subelement.'.class.php');
629 629
 
630 630
 						$classname = ucfirst($subelement);
631 631
 						$srcobject = new $classname($db);
632
-						'@phan-var-force Commande|Propal|Contrat|Fichinter|Expedition $srcobject';  // Can be other class, but CommonObject is too generic
632
+						'@phan-var-force Commande|Propal|Contrat|Fichinter|Expedition $srcobject'; // Can be other class, but CommonObject is too generic
633 633
 						/** @var Commande|Propal|Contrat|Fichinter|Expedition $srcobject */
634 634
 
635
-						dol_syslog("Try to find source object origin=" . $object->origin . " originid=" . $object->origin_id . " to add lines");
635
+						dol_syslog("Try to find source object origin=".$object->origin." originid=".$object->origin_id." to add lines");
636 636
 						$result = $srcobject->fetch($object->origin_id);
637 637
 
638 638
 						if ($result > 0) {
@@ -697,7 +697,7 @@  discard block
 block discarded – undo
697 697
 
698 698
 								$tva_tx = $lines[$i]->tva_tx;
699 699
 								if (!empty($lines[$i]->vat_src_code) && !preg_match('/\(/', $tva_tx)) {
700
-									$tva_tx .= ' (' . $lines[$i]->vat_src_code . ')';
700
+									$tva_tx .= ' ('.$lines[$i]->vat_src_code.')';
701 701
 								}
702 702
 
703 703
 								$result = $object->addline($desc, $lines[$i]->subprice, $lines[$i]->qty, $tva_tx, $lines[$i]->localtax1_tx, $lines[$i]->localtax2_tx, $lines[$i]->fk_product, $lines[$i]->remise_percent, 'HT', 0, $lines[$i]->info_bits, $product_type, $lines[$i]->rang, $lines[$i]->special_code, $fk_parent_line, $lines[$i]->fk_fournprice, $lines[$i]->pa_ht, $label, $date_start, $date_end, $array_options, $lines[$i]->fk_unit);
@@ -787,7 +787,7 @@  discard block
 block discarded – undo
787 787
 							}
788 788
 						}
789 789
 
790
-						header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $id);
790
+						header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id);
791 791
 						exit();
792 792
 					} else {
793 793
 						$db->rollback();
@@ -835,7 +835,7 @@  discard block
 block discarded – undo
835 835
 					$error++;
836 836
 				} else {
837 837
 					// Needed if object linked modified by trigger (because linked objects can't be fetched two times : linkedObjectsFullLoaded)
838
-					$locationTarget = DOL_URL_ROOT . '/comm/propal/card.php?id=' . $object->id;
838
+					$locationTarget = DOL_URL_ROOT.'/comm/propal/card.php?id='.$object->id;
839 839
 				}
840 840
 
841 841
 				$deposit = null;
@@ -846,7 +846,7 @@  discard block
 block discarded – undo
846 846
 					!$error && GETPOSTINT('statut') == $object::STATUS_SIGNED && GETPOST('generate_deposit') == 'on'
847 847
 					&& !empty($deposit_percent_from_payment_terms) && isModEnabled('invoice') && $user->hasRight('facture', 'creer')
848 848
 				) {
849
-					require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
849
+					require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
850 850
 
851 851
 					$date = dol_mktime(0, 0, 0, GETPOSTINT('datefmonth'), GETPOSTINT('datefday'), GETPOSTINT('datefyear'));
852 852
 					$forceFields = array();
@@ -859,10 +859,10 @@  discard block
 block discarded – undo
859 859
 
860 860
 					if ($deposit) {
861 861
 						setEventMessage('DepositGenerated');
862
-						$locationTarget = DOL_URL_ROOT . '/compta/facture/card.php?id=' . $deposit->id;
862
+						$locationTarget = DOL_URL_ROOT.'/compta/facture/card.php?id='.$deposit->id;
863 863
 					} else {
864 864
 						$error++;
865
-						setEventMessages("Failed to create down payment - " . $object->error, $object->errors, 'errors');
865
+						setEventMessages("Failed to create down payment - ".$object->error, $object->errors, 'errors');
866 866
 					}
867 867
 				}
868 868
 
@@ -887,12 +887,12 @@  discard block
 block discarded – undo
887 887
 					}
888 888
 
889 889
 					if ($locationTarget) {
890
-						header('Location: ' . $locationTarget);
890
+						header('Location: '.$locationTarget);
891 891
 						exit;
892 892
 					}
893 893
 				} else {
894 894
 					$object->status = $oldstatus;
895
-					$object->statut = $oldstatus;	// deprecated
895
+					$object->statut = $oldstatus; // deprecated
896 896
 
897 897
 					$db->rollback();
898 898
 					$action = '';
@@ -911,7 +911,7 @@  discard block
 block discarded – undo
911 911
 				setEventMessages($object->error, $object->errors, 'errors');
912 912
 				$error++;
913 913
 			} else {
914
-				$object->statut = $newstatus;	// deprecated
914
+				$object->statut = $newstatus; // deprecated
915 915
 				$object->status = $newstatus;
916 916
 			}
917 917
 
@@ -929,13 +929,13 @@  discard block
 block discarded – undo
929 929
 
930 930
 		if (!empty($importLines) && is_array($importLines) && !empty($fromElement) && ctype_alpha($fromElement) && !empty($fromElementid)) {
931 931
 			if ($fromElement == 'commande') {
932
-				dol_include_once('/' . $fromElement . '/class/' . $fromElement . '.class.php');
932
+				dol_include_once('/'.$fromElement.'/class/'.$fromElement.'.class.php');
933 933
 				$lineClassName = 'OrderLine';
934 934
 			} elseif ($fromElement == 'propal') {
935
-				dol_include_once('/comm/' . $fromElement . '/class/' . $fromElement . '.class.php');
935
+				dol_include_once('/comm/'.$fromElement.'/class/'.$fromElement.'.class.php');
936 936
 				$lineClassName = 'PropaleLigne';
937 937
 			} elseif ($fromElement == 'facture') {
938
-				dol_include_once('/compta/' . $fromElement . '/class/' . $fromElement . '.class.php');
938
+				dol_include_once('/compta/'.$fromElement.'/class/'.$fromElement.'.class.php');
939 939
 				$lineClassName = 'FactureLigne';
940 940
 			} else {
941 941
 				$lineClassName = null;
@@ -1002,14 +1002,14 @@  discard block
 block discarded – undo
1002 1002
 		$object->updateSubtotalLineBlockLines($langs, $object->getRangOfLine($lineid), 'discount', $discount);
1003 1003
 	}
1004 1004
 
1005
-	include DOL_DOCUMENT_ROOT . '/core/actions_printing.inc.php';
1005
+	include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
1006 1006
 
1007 1007
 	// Actions to send emails
1008 1008
 	$actiontypecode = 'AC_OTH_AUTO';
1009 1009
 	$triggersendname = 'PROPAL_SENTBYMAIL';
1010 1010
 	$autocopy = 'MAIN_MAIL_AUTOCOPY_PROPOSAL_TO';
1011
-	$trackid = 'pro' . $object->id;
1012
-	include DOL_DOCUMENT_ROOT . '/core/actions_sendmails.inc.php';
1011
+	$trackid = 'pro'.$object->id;
1012
+	include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
1013 1013
 
1014 1014
 
1015 1015
 	// Go back to draft
@@ -1078,7 +1078,7 @@  discard block
 block discarded – undo
1078 1078
 			}
1079 1079
 			$tvatx = $line->tva_tx;
1080 1080
 			if (!empty($line->vat_src_code)) {
1081
-				$tvatx .= ' (' . $line->vat_src_code . ')';
1081
+				$tvatx .= ' ('.$line->vat_src_code.')';
1082 1082
 			}
1083 1083
 			$result = $object->updateline($line->id, $line->subprice, $line->qty, (float) $remise_percent, $tvatx, $line->localtax1_tx, $line->localtax2_tx, $line->desc, 'HT', $line->info_bits, $line->special_code, $line->fk_parent_line, 0, $line->fk_fournprice, $line->pa_ht, $line->label, $line->product_type, $line->date_start, $line->date_end, $line->array_options, $line->fk_unit, $line->multicurrency_subprice);
1084 1084
 			$object->lines[$key] = $object->line;
@@ -1096,7 +1096,7 @@  discard block
 block discarded – undo
1096 1096
 			if ($prod->price_min > $subprice) {
1097 1097
 				$price_subprice  = price($subprice, 0, $outlangs, 1, -1, -1, 'auto');
1098 1098
 				$price_price_min = price($prod->price_min, 0, $outlangs, 1, -1, -1, 'auto');
1099
-				setEventMessages($prod->ref . ' - ' . $prod->label . ' (' . $price_subprice . ' < ' . $price_price_min . ' ' . strtolower($langs->trans("MinPrice")) . ')' . "\n", null, 'warnings');
1099
+				setEventMessages($prod->ref.' - '.$prod->label.' ('.$price_subprice.' < '.$price_price_min.' '.strtolower($langs->trans("MinPrice")).')'."\n", null, 'warnings');
1100 1100
 			}
1101 1101
 			// Manage $line->subprice and $line->multicurrency_subprice
1102 1102
 			if ($line->subprice <> 0) {
@@ -1166,7 +1166,7 @@  discard block
 block discarded – undo
1166 1166
 		} else {
1167 1167
 			setEventMessages($object->error, $object->errors, 'errors');
1168 1168
 		}
1169
-		header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $id);
1169
+		header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id);
1170 1170
 		exit();
1171 1171
 	} elseif ($action == 'confirm_addsubtotalline' && $usercancreate) {
1172 1172
 		// Handling adding a new subtotal line for subtotals module
@@ -1218,7 +1218,7 @@  discard block
 block discarded – undo
1218 1218
 		} else {
1219 1219
 			setEventMessages($object->error, $object->errors, 'errors');
1220 1220
 		}
1221
-		header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $id);
1221
+		header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id);
1222 1222
 		exit();
1223 1223
 	} elseif ($action == 'addline' && !GETPOST('submitforalllines', 'alpha') && !GETPOST('submitforallmargins', 'alpha') && !GETPOST('markforalllines', 'alpha') && $usercancreate) {
1224 1224
 		// Add line
@@ -1260,8 +1260,8 @@  discard block
 block discarded – undo
1260 1260
 
1261 1261
 		$tva_tx = GETPOST('tva_tx', 'alpha');
1262 1262
 
1263
-		$qty = price2num(GETPOST('qty' . $predef, 'alpha'), 'MS', 2);
1264
-		$remise_percent = (GETPOSTISSET('remise_percent' . $predef) ? price2num(GETPOST('remise_percent' . $predef, 'alpha'), '', 2) : 0);
1263
+		$qty = price2num(GETPOST('qty'.$predef, 'alpha'), 'MS', 2);
1264
+		$remise_percent = (GETPOSTISSET('remise_percent'.$predef) ? price2num(GETPOST('remise_percent'.$predef, 'alpha'), '', 2) : 0);
1265 1265
 		if (empty($remise_percent)) {
1266 1266
 			$remise_percent = 0;
1267 1267
 		}
@@ -1273,7 +1273,7 @@  discard block
 block discarded – undo
1273 1273
 		if (is_array($extralabelsline)) {
1274 1274
 			// Get extra fields
1275 1275
 			foreach ($extralabelsline as $key => $value) {
1276
-				unset($_POST["options_" . $key]);
1276
+				unset($_POST["options_".$key]);
1277 1277
 			}
1278 1278
 		}
1279 1279
 
@@ -1345,7 +1345,7 @@  discard block
 block discarded – undo
1345 1345
 
1346 1346
 				if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES')) {
1347 1347
 					// If price per customer
1348
-					require_once DOL_DOCUMENT_ROOT . '/product/class/productcustomerprice.class.php';
1348
+					require_once DOL_DOCUMENT_ROOT.'/product/class/productcustomerprice.class.php';
1349 1349
 					$prodcustprice = new ProductCustomerPrice($db);
1350 1350
 					$filter = array('t.fk_product' => (string) $prod->id, 't.fk_soc' => (string) $object->thirdparty->id);
1351 1351
 
@@ -1409,7 +1409,7 @@  discard block
 block discarded – undo
1409 1409
 					}
1410 1410
 				} elseif (getDolGlobalString('PRODUIT_CUSTOMER_PRICES')) {
1411 1411
 					// If price per customer
1412
-					require_once DOL_DOCUMENT_ROOT . '/product/class/productcustomerprice.class.php';
1412
+					require_once DOL_DOCUMENT_ROOT.'/product/class/productcustomerprice.class.php';
1413 1413
 
1414 1414
 					$prodcustprice = new ProductCustomerPrice($db);
1415 1415
 
@@ -1556,23 +1556,23 @@  discard block
 block discarded – undo
1556 1556
 							$outputlangs->load('products');
1557 1557
 						}
1558 1558
 						if (!empty($prod->customcode)) {
1559
-							$tmptxt .= $outputlangs->transnoentitiesnoconv("CustomsCode") . ': ' . $prod->customcode;
1559
+							$tmptxt .= $outputlangs->transnoentitiesnoconv("CustomsCode").': '.$prod->customcode;
1560 1560
 						}
1561 1561
 						if (!empty($prod->customcode) && !empty($prod->country_code)) {
1562 1562
 							$tmptxt .= ' - ';
1563 1563
 						}
1564 1564
 						if (!empty($prod->country_code)) {
1565
-							$tmptxt .= $outputlangs->transnoentitiesnoconv("CountryOrigin") . ': ' . getCountry($prod->country_code, '', $db, $outputlangs, 0);
1565
+							$tmptxt .= $outputlangs->transnoentitiesnoconv("CountryOrigin").': '.getCountry($prod->country_code, '', $db, $outputlangs, 0);
1566 1566
 						}
1567 1567
 					} else {
1568 1568
 						if (!empty($prod->customcode)) {
1569
-							$tmptxt .= $langs->transnoentitiesnoconv("CustomsCode") . ': ' . $prod->customcode;
1569
+							$tmptxt .= $langs->transnoentitiesnoconv("CustomsCode").': '.$prod->customcode;
1570 1570
 						}
1571 1571
 						if (!empty($prod->customcode) && !empty($prod->country_code)) {
1572 1572
 							$tmptxt .= ' - ';
1573 1573
 						}
1574 1574
 						if (!empty($prod->country_code)) {
1575
-							$tmptxt .= $langs->transnoentitiesnoconv("CountryOrigin") . ': ' . getCountry($prod->country_code, '', $db, $langs, 0);
1575
+							$tmptxt .= $langs->transnoentitiesnoconv("CountryOrigin").': '.getCountry($prod->country_code, '', $db, $langs, 0);
1576 1576
 						}
1577 1577
 					}
1578 1578
 					$tmptxt .= ')';
@@ -1611,11 +1611,11 @@  discard block
 block discarded – undo
1611 1611
 			$localtax2_tx = get_localtax($tva_tx, 2, $object->thirdparty, $mysoc, $tva_npr);
1612 1612
 
1613 1613
 			// Margin
1614
-			$fournprice = (int) (GETPOST('fournprice' . $predef) ? GETPOST('fournprice' . $predef) : '');	// This can be id of supplier price, or 'pmpprice' or 'costprice', or 'inputprice', we force to keep ID only
1615
-			$buyingprice = price2num((GETPOST('buying_price' . $predef) != '' ? GETPOST('buying_price' . $predef) : ''), '', 2); // If buying_price is '0', we must keep this value
1614
+			$fournprice = (int) (GETPOST('fournprice'.$predef) ? GETPOST('fournprice'.$predef) : ''); // This can be id of supplier price, or 'pmpprice' or 'costprice', or 'inputprice', we force to keep ID only
1615
+			$buyingprice = price2num((GETPOST('buying_price'.$predef) != '' ? GETPOST('buying_price'.$predef) : ''), '', 2); // If buying_price is '0', we must keep this value
1616 1616
 
1617
-			$date_start = dol_mktime(GETPOSTINT('date_start' . $predef . 'hour'), GETPOSTINT('date_start' . $predef . 'min'), GETPOSTINT('date_start' . $predef . 'sec'), GETPOSTINT('date_start' . $predef . 'month'), GETPOSTINT('date_start' . $predef . 'day'), GETPOSTINT('date_start' . $predef . 'year'));
1618
-			$date_end = dol_mktime(GETPOSTINT('date_end' . $predef . 'hour'), GETPOSTINT('date_end' . $predef . 'min'), GETPOSTINT('date_end' . $predef . 'sec'), GETPOSTINT('date_end' . $predef . 'month'), GETPOSTINT('date_end' . $predef . 'day'), GETPOSTINT('date_end' . $predef . 'year'));
1617
+			$date_start = dol_mktime(GETPOSTINT('date_start'.$predef.'hour'), GETPOSTINT('date_start'.$predef.'min'), GETPOSTINT('date_start'.$predef.'sec'), GETPOSTINT('date_start'.$predef.'month'), GETPOSTINT('date_start'.$predef.'day'), GETPOSTINT('date_start'.$predef.'year'));
1618
+			$date_end = dol_mktime(GETPOSTINT('date_end'.$predef.'hour'), GETPOSTINT('date_end'.$predef.'min'), GETPOSTINT('date_end'.$predef.'sec'), GETPOSTINT('date_end'.$predef.'month'), GETPOSTINT('date_end'.$predef.'day'), GETPOSTINT('date_end'.$predef.'year'));
1619 1619
 
1620 1620
 			// Prepare a price equivalent for minimum price check
1621 1621
 			$pu_equivalent = $pu_ht;
@@ -1746,7 +1746,7 @@  discard block
 block discarded – undo
1746 1746
 				if ($prod->price_min > $line->subprice) {
1747 1747
 					$price_subprice = price($line->subprice, 0, $outlangs, 1, -1, -1, 'auto');
1748 1748
 					$price_price_min = price($prod->price_min, 0, $outlangs, 1, -1, -1, 'auto');
1749
-					setEventMessages($prod->ref . ' - ' . $prod->label . ' (' . $price_subprice . ' < ' . $price_price_min . ' ' . strtolower($langs->trans("MinPrice")) . ')' . "\n", null, 'warnings');
1749
+					setEventMessages($prod->ref.' - '.$prod->label.' ('.$price_subprice.' < '.$price_price_min.' '.strtolower($langs->trans("MinPrice")).')'."\n", null, 'warnings');
1750 1750
 				} else {
1751 1751
 					setEventMessages($prod->error, $prod->errors, 'errors');
1752 1752
 				}
@@ -1884,7 +1884,7 @@  discard block
 block discarded – undo
1884 1884
 		$pu_ttc = price2num(GETPOST('price_ttc'), '', 2);
1885 1885
 
1886 1886
 		// Add buying price
1887
-		$fournprice = (int) (GETPOST('fournprice') ? GETPOST('fournprice') : '');	// This can be id of supplier price, or 'pmpprice' or 'costprice', or 'inputprice', we force to keep ID only
1887
+		$fournprice = (int) (GETPOST('fournprice') ? GETPOST('fournprice') : ''); // This can be id of supplier price, or 'pmpprice' or 'costprice', or 'inputprice', we force to keep ID only
1888 1888
 		$buyingprice = price2num((GETPOST('buying_price') != '' ? GETPOST('buying_price') : ''), '', 2); // If buying_price is '0', we must keep this value
1889 1889
 
1890 1890
 		$pu_ht_devise = price2num(GETPOST('multicurrency_subprice'), '', 2);
@@ -1931,7 +1931,7 @@  discard block
 block discarded – undo
1931 1931
 		if (is_array($extralabelsline)) {
1932 1932
 			// Get extra fields
1933 1933
 			foreach ($extralabelsline as $key => $value) {
1934
-				unset($_POST["options_" . $key]);
1934
+				unset($_POST["options_".$key]);
1935 1935
 			}
1936 1936
 		}
1937 1937
 
@@ -2063,7 +2063,7 @@  discard block
 block discarded – undo
2063 2063
 			}
2064 2064
 		}
2065 2065
 	} elseif ($action == 'updateline' && $usercancreate && GETPOST('cancel', 'alpha')) {
2066
-		header('Location: ' . $_SERVER['PHP_SELF'] . '?id=' . $object->id); //  To re-display card in edit mode
2066
+		header('Location: '.$_SERVER['PHP_SELF'].'?id='.$object->id); //  To re-display card in edit mode
2067 2067
 		exit();
2068 2068
 	} elseif ($action == 'classin' && $usercancreate) {
2069 2069
 		// Set project
@@ -2077,8 +2077,8 @@  discard block
 block discarded – undo
2077 2077
 	} elseif ($action == 'setconditions' && $usercancreate) {
2078 2078
 		// Terms of payment
2079 2079
 		$sql = "SELECT code ";
2080
-		$sql .= "FROM " . $db->prefix() . "c_payment_term";
2081
-		$sql .= " WHERE rowid = " . ((int) GETPOST('cond_reglement_id', 'int'));
2080
+		$sql .= "FROM ".$db->prefix()."c_payment_term";
2081
+		$sql .= " WHERE rowid = ".((int) GETPOST('cond_reglement_id', 'int'));
2082 2082
 		$result = $db->query($sql);
2083 2083
 		if ($result) {
2084 2084
 			$obj = $db->fetch_object($result);
@@ -2143,7 +2143,7 @@  discard block
 block discarded – undo
2143 2143
 			}
2144 2144
 
2145 2145
 			if ($result >= 0) {
2146
-				header("Location: " . $_SERVER['PHP_SELF'] . "?id=" . $object->id);
2146
+				header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
2147 2147
 				exit();
2148 2148
 			} else {
2149 2149
 				if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') {
@@ -2166,7 +2166,7 @@  discard block
 block discarded – undo
2166 2166
 			$result = $object->delete_contact($lineid);
2167 2167
 
2168 2168
 			if ($result >= 0) {
2169
-				header("Location: " . $_SERVER['PHP_SELF'] . "?id=" . $object->id);
2169
+				header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
2170 2170
 				exit();
2171 2171
 			} else {
2172 2172
 				dol_print_error($db);
@@ -2177,7 +2177,7 @@  discard block
 block discarded – undo
2177 2177
 	// Actions to build doc
2178 2178
 	$upload_dir = !empty($conf->propal->multidir_output[$object->entity ?? $conf->entity]) ? $conf->propal->multidir_output[$object->entity ?? $conf->entity] : $conf->propal->dir_output;
2179 2179
 	$permissiontoadd = $usercancreate;
2180
-	include DOL_DOCUMENT_ROOT . '/core/actions_builddoc.inc.php';
2180
+	include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
2181 2181
 }
2182 2182
 
2183 2183
 
@@ -2194,7 +2194,7 @@  discard block
 block discarded – undo
2194 2194
 	$formproject = new FormProjets($db);
2195 2195
 }
2196 2196
 
2197
-$title = $object->ref . " - " . $langs->trans('Card');
2197
+$title = $object->ref." - ".$langs->trans('Card');
2198 2198
 if ($action == 'create') {
2199 2199
 	$title = $langs->trans("NewPropal");
2200 2200
 }
@@ -2219,7 +2219,7 @@  discard block
 block discarded – undo
2219 2219
 	$deposit_percent = GETPOSTFLOAT('cond_reglement_id_deposit_percent');
2220 2220
 	$mode_reglement_id = GETPOSTINT('mode_reglement_id');
2221 2221
 	$fk_account = GETPOSTINT('fk_account');
2222
-	$datepropal = (getDolGlobalString('MAIN_DO_NOT_AUTOFILL_DATE_PROPOSAL') ? -1 : '');		// By default '' so we will autofill date. -1 means keep empty.
2222
+	$datepropal = (getDolGlobalString('MAIN_DO_NOT_AUTOFILL_DATE_PROPOSAL') ? -1 : ''); // By default '' so we will autofill date. -1 means keep empty.
2223 2223
 
2224 2224
 	// Load objectsrc
2225 2225
 	$objectsrc = null;
@@ -2258,11 +2258,11 @@  discard block
 block discarded – undo
2258 2258
 				$element = $subelement = 'expedition';
2259 2259
 			}
2260 2260
 
2261
-			dol_include_once('/' . $element . '/class/' . $subelement . '.class.php');
2261
+			dol_include_once('/'.$element.'/class/'.$subelement.'.class.php');
2262 2262
 
2263 2263
 			$classname = ucfirst($subelement);
2264 2264
 			$objectsrc = new $classname($db);
2265
-			'@phan-var-force Commande|Propal|Contrat|Expedition $objectsrc';  // Can be other class, but CommonObject is too generic
2265
+			'@phan-var-force Commande|Propal|Contrat|Expedition $objectsrc'; // Can be other class, but CommonObject is too generic
2266 2266
 			/** @var Commande|Propal|Contrat|Expedition $objectsrc */
2267 2267
 			$objectsrc->fetch($originid);
2268 2268
 			if (empty($objectsrc->lines) && method_exists($objectsrc, 'fetch_lines')) {
@@ -2338,19 +2338,19 @@  discard block
 block discarded – undo
2338 2338
 		}
2339 2339
 	}
2340 2340
 
2341
-	print '<form name="addprop" action="' . $_SERVER["PHP_SELF"] . '" method="POST">';
2342
-	print '<input type="hidden" name="token" value="' . newToken() . '">';
2341
+	print '<form name="addprop" action="'.$_SERVER["PHP_SELF"].'" method="POST">';
2342
+	print '<input type="hidden" name="token" value="'.newToken().'">';
2343 2343
 	print '<input type="hidden" name="action" value="add">';
2344
-	print '<input type="hidden" name="changecompany" value="0">';	// will be set to 1 by javascript so we know post is done after a company change
2345
-	print '<input type="hidden" name="backtopage" value="' . $backtopage . '">';
2344
+	print '<input type="hidden" name="changecompany" value="0">'; // will be set to 1 by javascript so we know post is done after a company change
2345
+	print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
2346 2346
 	if ($origin != 'project' && $originid) {
2347
-		print '<input type="hidden" name="origin" value="' . $origin . '">';
2348
-		print '<input type="hidden" name="originid" value="' . $originid . '">';
2347
+		print '<input type="hidden" name="origin" value="'.$origin.'">';
2348
+		print '<input type="hidden" name="originid" value="'.$originid.'">';
2349 2349
 		if ($origin == 'contrat' && !empty($renewal)) {
2350
-			print '<input type="hidden" name="renewal" value="' . $renewal . '">';
2350
+			print '<input type="hidden" name="renewal" value="'.$renewal.'">';
2351 2351
 		}
2352 2352
 	} elseif ($origin == 'project' && !empty($projectid)) {
2353
-		print '<input type="hidden" name="projectid" value="' . $projectid . '">';
2353
+		print '<input type="hidden" name="projectid" value="'.$projectid.'">';
2354 2354
 	}
2355 2355
 
2356 2356
 	print dol_get_fiche_head();
@@ -2363,22 +2363,22 @@  discard block
 block discarded – undo
2363 2363
 		print '<table class="border centpercent">';
2364 2364
 
2365 2365
 		// Reference
2366
-		print '<tr class="field_ref"><td class="titlefieldcreate fieldrequired">' . $langs->trans('Ref') . '</td><td class="valuefieldcreate">' . $langs->trans("Draft") . '</td></tr>';
2366
+		print '<tr class="field_ref"><td class="titlefieldcreate fieldrequired">'.$langs->trans('Ref').'</td><td class="valuefieldcreate">'.$langs->trans("Draft").'</td></tr>';
2367 2367
 
2368 2368
 		// Ref customer
2369
-		print '<tr class="field_ref_client"><td class="titlefieldcreate">' . $langs->trans('RefCustomer') . '</td><td class="valuefieldcreate">';
2370
-		print '<input type="text" name="ref_client" value="' . (!empty($ref_client) ? $ref_client : GETPOST('ref_client')) . '"></td>';
2369
+		print '<tr class="field_ref_client"><td class="titlefieldcreate">'.$langs->trans('RefCustomer').'</td><td class="valuefieldcreate">';
2370
+		print '<input type="text" name="ref_client" value="'.(!empty($ref_client) ? $ref_client : GETPOST('ref_client')).'"></td>';
2371 2371
 		print '</tr>';
2372 2372
 
2373 2373
 		// Third party
2374 2374
 		print '<tr class="field_socid">';
2375
-		print '<td class="titlefieldcreate fieldrequired">' . $langs->trans('Customer') . '</td>';
2375
+		print '<td class="titlefieldcreate fieldrequired">'.$langs->trans('Customer').'</td>';
2376 2376
 		$shipping_method_id = 0;
2377 2377
 		$warehouse_id = 0;
2378 2378
 		if ($socid > 0) {
2379 2379
 			print '<td class="valuefieldcreate">';
2380 2380
 			print $soc->getNomUrl(1, 'customer');
2381
-			print '<input type="hidden" name="socid" value="' . $soc->id . '">';
2381
+			print '<input type="hidden" name="socid" value="'.$soc->id.'">';
2382 2382
 			print '</td>';
2383 2383
 			if (getDolGlobalString('SOCIETE_ASK_FOR_SHIPPING_METHOD') && !empty($soc->shipping_method_id)) {
2384 2384
 				$shipping_method_id = $soc->shipping_method_id;
@@ -2387,7 +2387,7 @@  discard block
 block discarded – undo
2387 2387
 		} else {
2388 2388
 			print '<td class="valuefieldcreate">';
2389 2389
 			$filter = '((s.client:IN:1,2,3) AND (s.status:=:1))';
2390
-			print img_picto('', 'company', 'class="pictofixedwidth"') . $form->select_company('', 'socid', $filter, 'SelectThirdParty', 1, 0, array(), 0, 'minwidth300 maxwidth500 widthcentpercentminusxx');
2390
+			print img_picto('', 'company', 'class="pictofixedwidth"').$form->select_company('', 'socid', $filter, 'SelectThirdParty', 1, 0, array(), 0, 'minwidth300 maxwidth500 widthcentpercentminusxx');
2391 2391
 			// reload page to retrieve customer information
2392 2392
 			if (!getDolGlobalString('RELOAD_PAGE_ON_CUSTOMER_CHANGE_DISABLED')) {
2393 2393
 				print '<script>
@@ -2403,63 +2403,63 @@  discard block
 block discarded – undo
2403 2403
 				});
2404 2404
 				</script>';
2405 2405
 			}
2406
-			print ' <a href="' . DOL_URL_ROOT . '/societe/card.php?action=create&prospect=3&fournisseur=0&backtopage=' . urlencode($_SERVER["PHP_SELF"] . '?action=create') . '"><span class="fa fa-plus-circle valignmiddle paddingleft" title="' . $langs->trans("AddThirdParty") . '"></span></a>';
2406
+			print ' <a href="'.DOL_URL_ROOT.'/societe/card.php?action=create&prospect=3&fournisseur=0&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create').'"><span class="fa fa-plus-circle valignmiddle paddingleft" title="'.$langs->trans("AddThirdParty").'"></span></a>';
2407 2407
 			print '</td>';
2408 2408
 		}
2409
-		print '</tr>' . "\n";
2409
+		print '</tr>'."\n";
2410 2410
 
2411 2411
 		if ($socid > 0) {
2412 2412
 			// Contacts (ask contact only if thirdparty already defined).
2413
-			print '<tr class="field_contactid"><td class="titlefieldcreate">' . $langs->trans("DefaultContact") . '</td><td class="valuefieldcreate">';
2413
+			print '<tr class="field_contactid"><td class="titlefieldcreate">'.$langs->trans("DefaultContact").'</td><td class="valuefieldcreate">';
2414 2414
 			print img_picto('', 'contact', 'class="pictofixedwidth"');
2415 2415
 			//print $form->selectcontacts($soc->id, $contactid, 'contactid', 1, '', '', 0, 'minwidth300 widthcentpercentminusx');
2416 2416
 			print $form->select_contact($soc->id, $contactid, 'contactid', 1, '', '', 1, 'maxwidth300 widthcentpercentminusx', true);
2417 2417
 			print '</td></tr>';
2418 2418
 
2419 2419
 			// Third party discounts info line
2420
-			print '<tr class="field_discount_info"><td class="titlefieldcreate">' . $langs->trans('Discounts') . '</td><td class="valuefieldcreate">';
2420
+			print '<tr class="field_discount_info"><td class="titlefieldcreate">'.$langs->trans('Discounts').'</td><td class="valuefieldcreate">';
2421 2421
 
2422 2422
 			$absolute_discount = $soc->getAvailableDiscounts();
2423 2423
 
2424 2424
 			$thirdparty = $soc;
2425 2425
 			$discount_type = 0;
2426
-			$backtopage = $_SERVER["PHP_SELF"] . '?socid=' . $thirdparty->id . '&action=' . $action . '&origin=' . urlencode((string) (GETPOST('origin'))) . '&originid=' . urlencode((string) (GETPOSTINT('originid')));
2427
-			include DOL_DOCUMENT_ROOT . '/core/tpl/object_discounts.tpl.php';
2426
+			$backtopage = $_SERVER["PHP_SELF"].'?socid='.$thirdparty->id.'&action='.$action.'&origin='.urlencode((string) (GETPOST('origin'))).'&originid='.urlencode((string) (GETPOSTINT('originid')));
2427
+			include DOL_DOCUMENT_ROOT.'/core/tpl/object_discounts.tpl.php';
2428 2428
 			print '</td></tr>';
2429 2429
 		}
2430 2430
 
2431 2431
 		$newdatepropal = dol_mktime(0, 0, 0, GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear'), 'tzserver');
2432 2432
 		// Date
2433
-		print '<tr class="field_addprop"><td class="titlefieldcreate fieldrequired">' . $langs->trans('DatePropal') . '</td><td class="valuefieldcreate">';
2433
+		print '<tr class="field_addprop"><td class="titlefieldcreate fieldrequired">'.$langs->trans('DatePropal').'</td><td class="valuefieldcreate">';
2434 2434
 		print img_picto('', 'action', 'class="pictofixedwidth"');
2435 2435
 		print $form->selectDate($newdatepropal ? $newdatepropal : $datepropal, '', 0, 0, 0, "addprop", 1, 1);
2436 2436
 		print '</td></tr>';
2437 2437
 
2438 2438
 		// Validaty duration
2439
-		print '<tr class="field_duree_validitee"><td class="titlefieldcreate fieldrequired">' . $langs->trans("ValidityDuration") . '</td><td class="valuefieldcreate">' . img_picto('', 'clock', 'class="pictofixedwidth"') . '<input name="duree_validite" class="width50" value="' . (GETPOSTISSET('duree_validite') ? GETPOST('duree_validite', 'alphanohtml') : getDolGlobalString('PROPALE_VALIDITY_DURATION')) . '"> ' . $langs->trans("days") . '</td></tr>';
2439
+		print '<tr class="field_duree_validitee"><td class="titlefieldcreate fieldrequired">'.$langs->trans("ValidityDuration").'</td><td class="valuefieldcreate">'.img_picto('', 'clock', 'class="pictofixedwidth"').'<input name="duree_validite" class="width50" value="'.(GETPOSTISSET('duree_validite') ? GETPOST('duree_validite', 'alphanohtml') : getDolGlobalString('PROPALE_VALIDITY_DURATION')).'"> '.$langs->trans("days").'</td></tr>';
2440 2440
 
2441 2441
 		// Terms of payment
2442
-		print '<tr class="field_cond_reglement_id"><td class="nowrap">' . $langs->trans('PaymentConditionsShort') . '</td><td>';
2442
+		print '<tr class="field_cond_reglement_id"><td class="nowrap">'.$langs->trans('PaymentConditionsShort').'</td><td>';
2443 2443
 		print img_picto('', 'payment', 'class="pictofixedwidth"');
2444 2444
 		// at last resort we take the payment term id which may be filled by default values set (if not getpostisset)
2445 2445
 		print $form->getSelectConditionsPaiements((int) $cond_reglement_id, 'cond_reglement_id', 1, 1, 0, '', $deposit_percent);
2446 2446
 		print '</td></tr>';
2447 2447
 
2448 2448
 		// Mode of payment
2449
-		print '<tr class="field_mode_reglement_id"><td class="titlefieldcreate">' . $langs->trans('PaymentMode') . '</td><td class="valuefieldcreate">';
2449
+		print '<tr class="field_mode_reglement_id"><td class="titlefieldcreate">'.$langs->trans('PaymentMode').'</td><td class="valuefieldcreate">';
2450 2450
 		print img_picto('', 'bank', 'class="pictofixedwidth"');
2451 2451
 		print $form->select_types_paiements((string) $mode_reglement_id, 'mode_reglement_id', 'CRDT', 0, 1, 0, 0, 1, 'maxwidth200 widthcentpercentminusx', 1);
2452 2452
 		print '</td></tr>';
2453 2453
 
2454 2454
 		// Bank Account
2455 2455
 		if (getDolGlobalString('BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL') && isModEnabled("bank")) {
2456
-			print '<tr class="field_fk_account"><td class="titlefieldcreate">' . $langs->trans('BankAccount') . '</td><td class="valuefieldcreate">';
2457
-			print img_picto('', 'bank_account', 'class="pictofixedwidth"') . $form->select_comptes((int) $fk_account, 'fk_account', 0, '', 1, '', 0, 'maxwidth200 widthcentpercentminusx', 1);
2456
+			print '<tr class="field_fk_account"><td class="titlefieldcreate">'.$langs->trans('BankAccount').'</td><td class="valuefieldcreate">';
2457
+			print img_picto('', 'bank_account', 'class="pictofixedwidth"').$form->select_comptes((int) $fk_account, 'fk_account', 0, '', 1, '', 0, 'maxwidth200 widthcentpercentminusx', 1);
2458 2458
 			print '</td></tr>';
2459 2459
 		}
2460 2460
 
2461 2461
 		// Source / Channel - What trigger creation
2462
-		print '<tr class="field_demand_reason_id"><td class="titlefieldcreate">' . $langs->trans('Source') . '</td><td class="valuefieldcreate">';
2462
+		print '<tr class="field_demand_reason_id"><td class="titlefieldcreate">'.$langs->trans('Source').'</td><td class="valuefieldcreate">';
2463 2463
 		print img_picto('', 'question', 'class="pictofixedwidth"');
2464 2464
 		$form->selectInputReason((GETPOSTISSET('demand_reason_id') ? GETPOSTINT('demand_reason_id') : ''), 'demand_reason_id', "SRC_PROP", 1, 'maxwidth200 widthcentpercentminusx');
2465 2465
 		print '</td></tr>';
@@ -2469,7 +2469,7 @@  discard block
 block discarded – undo
2469 2469
 			if (getDolGlobalString('SOCIETE_ASK_FOR_SHIPPING_METHOD') && !empty($soc->shipping_method_id)) {
2470 2470
 				$shipping_method_id = $soc->shipping_method_id;
2471 2471
 			}
2472
-			print '<tr class="field_shipping_method_id"><td class="titlefieldcreate">' . $langs->trans('SendingMethod') . '</td><td class="valuefieldcreate">';
2472
+			print '<tr class="field_shipping_method_id"><td class="titlefieldcreate">'.$langs->trans('SendingMethod').'</td><td class="valuefieldcreate">';
2473 2473
 			print img_picto('', 'dolly', 'class="pictofixedwidth"');
2474 2474
 			$form->selectShippingMethod((string) (GETPOSTISSET('shipping_method_id') ? GETPOSTINT('shipping_method_id') : $shipping_method_id), 'shipping_method_id', '', 1, '', 0, 'maxwidth200 widthcentpercentminusx');
2475 2475
 			print '</td></tr>';
@@ -2478,17 +2478,17 @@  discard block
 block discarded – undo
2478 2478
 		$formproduct = null;
2479 2479
 		// Warehouse
2480 2480
 		if (isModEnabled('stock') && getDolGlobalString('WAREHOUSE_ASK_WAREHOUSE_DURING_PROPAL')) {
2481
-			require_once DOL_DOCUMENT_ROOT . '/product/class/html.formproduct.class.php';
2481
+			require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
2482 2482
 			$formproduct = new FormProduct($db);
2483
-			print '<tr class="field_warehouse_id"><td class="titlefieldcreate">' . $langs->trans('Warehouse') . '</td><td class="valuefieldcreate">';
2484
-			print img_picto('', 'stock', 'class="pictofixedwidth"') . $formproduct->selectWarehouses($warehouse_id, 'warehouse_id', '', 1, 0, 0, '', 0, 0, array(), 'maxwidth500 widthcentpercentminusxx');
2483
+			print '<tr class="field_warehouse_id"><td class="titlefieldcreate">'.$langs->trans('Warehouse').'</td><td class="valuefieldcreate">';
2484
+			print img_picto('', 'stock', 'class="pictofixedwidth"').$formproduct->selectWarehouses($warehouse_id, 'warehouse_id', '', 1, 0, 0, '', 0, 0, array(), 'maxwidth500 widthcentpercentminusxx');
2485 2485
 			print '</td></tr>';
2486 2486
 		}
2487 2487
 
2488 2488
 		// Delivery delay
2489
-		print '<tr class="field_availability_id"><td class="titlefieldcreate">' . $langs->trans('AvailabilityPeriod');
2489
+		print '<tr class="field_availability_id"><td class="titlefieldcreate">'.$langs->trans('AvailabilityPeriod');
2490 2490
 		if (isModEnabled('order')) {
2491
-			print ' (' . $langs->trans('AfterOrder') . ')';
2491
+			print ' ('.$langs->trans('AfterOrder').')';
2492 2492
 		}
2493 2493
 		print '</td><td class="valuefieldcreate">';
2494 2494
 		print img_picto('', 'clock', 'class="pictofixedwidth"');
@@ -2496,7 +2496,7 @@  discard block
 block discarded – undo
2496 2496
 		print '</td></tr>';
2497 2497
 
2498 2498
 		// Delivery date (or manufacturing)
2499
-		print '<tr class="field_date_livraison"><td class="titlefieldcreate">' . $langs->trans("DeliveryDate") . '</td>';
2499
+		print '<tr class="field_date_livraison"><td class="titlefieldcreate">'.$langs->trans("DeliveryDate").'</td>';
2500 2500
 		print '<td class="valuefieldcreate">';
2501 2501
 		print img_picto('', 'action', 'class="pictofixedwidth"');
2502 2502
 		if (is_numeric(getDolGlobalString('DATE_LIVRAISON_WEEK_DELAY'))) {	// If value set to 0 or a num, not empty
@@ -2504,7 +2504,7 @@  discard block
 block discarded – undo
2504 2504
 			$syear = date("Y", $tmpdte);
2505 2505
 			$smonth = date("m", $tmpdte);
2506 2506
 			$sday = date("d", $tmpdte);
2507
-			print $form->selectDate($syear . "-" . $smonth . "-" . $sday, 'date_livraison', 0, 0, 0, "addprop");
2507
+			print $form->selectDate($syear."-".$smonth."-".$sday, 'date_livraison', 0, 0, 0, "addprop");
2508 2508
 		} else {
2509 2509
 			$tmp_date_delivery = GETPOST('date_delivery') ?: -1;
2510 2510
 			print $form->selectDate($tmp_date_delivery, 'date_livraison', 0, 0, 0, "addprop", 1, 1);
@@ -2525,7 +2525,7 @@  discard block
 block discarded – undo
2525 2525
 		// Incoterms
2526 2526
 		if (isModEnabled('incoterm')) {
2527 2527
 			print '<tr class="field_incoterm_id">';
2528
-			print '<td class="titlefieldcreate"><label for="incoterm_id">' . $form->textwithpicto($langs->trans("IncotermLabel"), $soc->label_incoterms, 1) . '</label></td>';
2528
+			print '<td class="titlefieldcreate"><label for="incoterm_id">'.$form->textwithpicto($langs->trans("IncotermLabel"), $soc->label_incoterms, 1).'</label></td>';
2529 2529
 			print '<td  class="valuefieldcreate maxwidthonsmartphone">';
2530 2530
 			print img_picto('', 'incoterm', 'class="pictofixedwidth"');
2531 2531
 			print $form->select_incoterms((!empty($soc->fk_incoterms) ? $soc->fk_incoterms : ''), (!empty($soc->location_incoterms) ? $soc->location_incoterms : ''));
@@ -2539,7 +2539,7 @@  discard block
 block discarded – undo
2539 2539
 		}
2540 2540
 		// Template to use by default
2541 2541
 		print '<tr class="field_model">';
2542
-		print '<td class="titlefieldcreate">' . $langs->trans("DefaultModel") . '</td>';
2542
+		print '<td class="titlefieldcreate">'.$langs->trans("DefaultModel").'</td>';
2543 2543
 		print '<td class="valuefieldcreate">';
2544 2544
 		print img_picto('', 'pdf', 'class="pictofixedwidth"');
2545 2545
 		$liste = ModelePDFPropales::liste_modeles($db);
@@ -2550,15 +2550,15 @@  discard block
 block discarded – undo
2550 2550
 		// Multicurrency
2551 2551
 		if (isModEnabled("multicurrency")) {
2552 2552
 			print '<tr class="field_currency">';
2553
-			print '<td class="titlefieldcreate">' . $form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0) . '</td>';
2553
+			print '<td class="titlefieldcreate">'.$form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0).'</td>';
2554 2554
 			print '<td class="valuefieldcreate maxwidthonsmartphone">';
2555
-			print img_picto('', 'currency', 'class="pictofixedwidth"') . $form->selectMultiCurrency(((GETPOSTISSET('multicurrency_code') && !GETPOST('changecompany')) ? GETPOST('multicurrency_code') : $currency_code), 'multicurrency_code', 0, '', false, 'maxwidth200 widthcentpercentminusx');
2555
+			print img_picto('', 'currency', 'class="pictofixedwidth"').$form->selectMultiCurrency(((GETPOSTISSET('multicurrency_code') && !GETPOST('changecompany')) ? GETPOST('multicurrency_code') : $currency_code), 'multicurrency_code', 0, '', false, 'maxwidth200 widthcentpercentminusx');
2556 2556
 			print '</td></tr>';
2557 2557
 		}
2558 2558
 
2559 2559
 		// Public note
2560 2560
 		print '<tr class="field_note_public">';
2561
-		print '<td class="titlefieldcreate tdtop">' . $langs->trans('NotePublic') . '</td>';
2561
+		print '<td class="titlefieldcreate tdtop">'.$langs->trans('NotePublic').'</td>';
2562 2562
 		print '<td class="valuefieldcreate">';
2563 2563
 		$note_public = GETPOST('note_public', 'restricthtml');
2564 2564
 		if (!GETPOSTISSET('note_public') && empty($note_public) && !empty($objectsrc)) {
@@ -2570,7 +2570,7 @@  discard block
 block discarded – undo
2570 2570
 		// Private note
2571 2571
 		if (empty($user->socid)) {
2572 2572
 			print '<tr class="field_note_private">';
2573
-			print '<td class="titlefieldcreate tdtop">' . $langs->trans('NotePrivate') . '</td>';
2573
+			print '<td class="titlefieldcreate tdtop">'.$langs->trans('NotePrivate').'</td>';
2574 2574
 			print '<td class="valuefieldcreate">';
2575 2575
 			$note_private = GETPOST('note_private', 'restricthtml');
2576 2576
 			if (!GETPOSTISSET('note_private') && empty($note_private) && !empty($objectsrc)) {
@@ -2583,7 +2583,7 @@  discard block
 block discarded – undo
2583 2583
 		}
2584 2584
 
2585 2585
 		// Other attributes
2586
-		include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_add.tpl.php';
2586
+		include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php';
2587 2587
 
2588 2588
 		// Lines from source
2589 2589
 		if (!empty($origin) && !empty($originid) && is_object($objectsrc)) {
@@ -2595,13 +2595,13 @@  discard block
 block discarded – undo
2595 2595
 				$objectsrc->update_price(1, 'auto', 1);
2596 2596
 			}
2597 2597
 
2598
-			print "\n<!-- " . $classname . " info -->";
2598
+			print "\n<!-- ".$classname." info -->";
2599 2599
 			print "\n";
2600
-			print '<input type="hidden" name="amount"         value="' . $objectsrc->total_ht . '">' . "\n";
2601
-			print '<input type="hidden" name="total"          value="' . $objectsrc->total_ttc . '">' . "\n";
2602
-			print '<input type="hidden" name="tva"            value="' . $objectsrc->total_tva . '">' . "\n";
2603
-			print '<input type="hidden" name="origin"         value="' . $objectsrc->element . '">';
2604
-			print '<input type="hidden" name="originid"       value="' . $objectsrc->id . '">';
2600
+			print '<input type="hidden" name="amount"         value="'.$objectsrc->total_ht.'">'."\n";
2601
+			print '<input type="hidden" name="total"          value="'.$objectsrc->total_ttc.'">'."\n";
2602
+			print '<input type="hidden" name="tva"            value="'.$objectsrc->total_tva.'">'."\n";
2603
+			print '<input type="hidden" name="origin"         value="'.$objectsrc->element.'">';
2604
+			print '<input type="hidden" name="originid"       value="'.$objectsrc->id.'">';
2605 2605
 
2606 2606
 			$newclassname = $classname;
2607 2607
 			if ($newclassname == 'Propal') {
@@ -2614,22 +2614,22 @@  discard block
 block discarded – undo
2614 2614
 				$newclassname = 'Intervention';
2615 2615
 			}
2616 2616
 
2617
-			print '<tr><td>' . $langs->trans($newclassname) . '</td><td>' . $objectsrc->getNomUrl(1) . '</td></tr>';
2618
-			print '<tr><td>' . $langs->trans('AmountHT') . '</td><td>' . price($objectsrc->total_ht, 0, $langs, 1, -1, -1, $conf->currency) . '</td></tr>';
2619
-			print '<tr><td>' . $langs->trans('AmountVAT') . '</td><td>' . price($objectsrc->total_tva, 0, $langs, 1, -1, -1, $conf->currency) . "</td></tr>";
2617
+			print '<tr><td>'.$langs->trans($newclassname).'</td><td>'.$objectsrc->getNomUrl(1).'</td></tr>';
2618
+			print '<tr><td>'.$langs->trans('AmountHT').'</td><td>'.price($objectsrc->total_ht, 0, $langs, 1, -1, -1, $conf->currency).'</td></tr>';
2619
+			print '<tr><td>'.$langs->trans('AmountVAT').'</td><td>'.price($objectsrc->total_tva, 0, $langs, 1, -1, -1, $conf->currency)."</td></tr>";
2620 2620
 			if ($mysoc->localtax1_assuj == "1" || $objectsrc->total_localtax1 != 0) { 		// Localtax1
2621
-				print '<tr><td>' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '</td><td>' . price($objectsrc->total_localtax1, 0, $langs, 1, -1, -1, $conf->currency) . "</td></tr>";
2621
+				print '<tr><td>'.$langs->transcountry("AmountLT1", $mysoc->country_code).'</td><td>'.price($objectsrc->total_localtax1, 0, $langs, 1, -1, -1, $conf->currency)."</td></tr>";
2622 2622
 			}
2623 2623
 
2624 2624
 			if ($mysoc->localtax2_assuj == "1" || $objectsrc->total_localtax2 != 0) { 		// Localtax2
2625
-				print '<tr><td>' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '</td><td>' . price($objectsrc->total_localtax2, 0, $langs, 1, -1, -1, $conf->currency) . "</td></tr>";
2625
+				print '<tr><td>'.$langs->transcountry("AmountLT2", $mysoc->country_code).'</td><td>'.price($objectsrc->total_localtax2, 0, $langs, 1, -1, -1, $conf->currency)."</td></tr>";
2626 2626
 			}
2627
-			print '<tr><td>' . $langs->trans('AmountTTC') . '</td><td>' . price($objectsrc->total_ttc, 0, $langs, 1, -1, -1, $conf->currency) . "</td></tr>";
2627
+			print '<tr><td>'.$langs->trans('AmountTTC').'</td><td>'.price($objectsrc->total_ttc, 0, $langs, 1, -1, -1, $conf->currency)."</td></tr>";
2628 2628
 
2629 2629
 			if (isModEnabled("multicurrency")) {
2630
-				print '<tr><td>' . $langs->trans('MulticurrencyAmountHT') . '</td><td>' . price($objectsrc->multicurrency_total_ht) . '</td></tr>';
2631
-				print '<tr><td>' . $langs->trans('MulticurrencyAmountVAT') . '</td><td>' . price($objectsrc->multicurrency_total_tva) . "</td></tr>";
2632
-				print '<tr><td>' . $langs->trans('MulticurrencyAmountTTC') . '</td><td>' . price($objectsrc->multicurrency_total_ttc) . "</td></tr>";
2630
+				print '<tr><td>'.$langs->trans('MulticurrencyAmountHT').'</td><td>'.price($objectsrc->multicurrency_total_ht).'</td></tr>';
2631
+				print '<tr><td>'.$langs->trans('MulticurrencyAmountVAT').'</td><td>'.price($objectsrc->multicurrency_total_tva)."</td></tr>";
2632
+				print '<tr><td>'.$langs->trans('MulticurrencyAmountTTC').'</td><td>'.price($objectsrc->multicurrency_total_ttc)."</td></tr>";
2633 2633
 			}
2634 2634
 		}
2635 2635
 
@@ -2650,16 +2650,16 @@  discard block
 block discarded – undo
2650 2650
 			// For backward compatibility
2651 2651
 			print '<tr>';
2652 2652
 			print '<td><input type="radio" name="createmode" value="copy"></td>';
2653
-			print '<td>' . $langs->trans("CopyPropalFrom") . ' </td>';
2653
+			print '<td>'.$langs->trans("CopyPropalFrom").' </td>';
2654 2654
 			print '<td>';
2655 2655
 			$liste_propal = array();
2656 2656
 			$liste_propal[0] = '';
2657 2657
 
2658 2658
 			$sql = "SELECT p.rowid as id, p.ref, s.nom";
2659
-			$sql .= " FROM " . MAIN_DB_PREFIX . "propal p";
2660
-			$sql .= ", " . MAIN_DB_PREFIX . "societe s";
2659
+			$sql .= " FROM ".MAIN_DB_PREFIX."propal p";
2660
+			$sql .= ", ".MAIN_DB_PREFIX."societe s";
2661 2661
 			$sql .= " WHERE s.rowid = p.fk_soc";
2662
-			$sql .= " AND p.entity IN (" . getEntity('propal') . ")";
2662
+			$sql .= " AND p.entity IN (".getEntity('propal').")";
2663 2663
 			$sql .= " AND p.fk_statut <> 0";
2664 2664
 			$sql .= " ORDER BY Id";
2665 2665
 
@@ -2669,7 +2669,7 @@  discard block
 block discarded – undo
2669 2669
 				$i = 0;
2670 2670
 				while ($i < $num) {
2671 2671
 					$row = $db->fetch_row($resql);
2672
-					$propalRefAndSocName = $row[1] . " - " . $row[2];
2672
+					$propalRefAndSocName = $row[1]." - ".$row[2];
2673 2673
 					$liste_propal[$row[0]] = $propalRefAndSocName;
2674 2674
 					$i++;
2675 2675
 				}
@@ -2680,7 +2680,7 @@  discard block
 block discarded – undo
2680 2680
 			print '</td></tr>';
2681 2681
 
2682 2682
 			print '<tr><td class="tdtop"><input type="radio" name="createmode" value="empty" checked></td>';
2683
-			print '<td valign="top" colspan="2">' . $langs->trans("CreateEmptyPropal") . '</td></tr>';
2683
+			print '<td valign="top" colspan="2">'.$langs->trans("CreateEmptyPropal").'</td></tr>';
2684 2684
 			print '</table>';
2685 2685
 		}
2686 2686
 	}
@@ -2760,9 +2760,9 @@  discard block
 block discarded – undo
2760 2760
 		//Form to close proposal (signed or not)
2761 2761
 		$formquestion = array();
2762 2762
 		if (!getDolGlobalString('PROPAL_SKIP_ACCEPT_REFUSE')) {
2763
-			$formquestion[] = array('type' => 'select', 'name' => 'statut', 'label' => '<span class="fieldrequired">' . $langs->trans("CloseAs") . '</span>', 'values' => array($object::STATUS_SIGNED => $object->LibStatut($object::STATUS_SIGNED), $object::STATUS_NOTSIGNED => $object->LibStatut($object::STATUS_NOTSIGNED)));
2763
+			$formquestion[] = array('type' => 'select', 'name' => 'statut', 'label' => '<span class="fieldrequired">'.$langs->trans("CloseAs").'</span>', 'values' => array($object::STATUS_SIGNED => $object->LibStatut($object::STATUS_SIGNED), $object::STATUS_NOTSIGNED => $object->LibStatut($object::STATUS_NOTSIGNED)));
2764 2764
 		}
2765
-		$formquestion[] = array('type' => 'text', 'name' => 'note_private', 'label' => $langs->trans("Note"), 'value' => '');				// Field to complete private note (not replace)
2765
+		$formquestion[] = array('type' => 'text', 'name' => 'note_private', 'label' => $langs->trans("Note"), 'value' => ''); // Field to complete private note (not replace)
2766 2766
 
2767 2767
 		if (getDolGlobalInt('PROPOSAL_SUGGEST_DOWN_PAYMENT_INVOICE_CREATION')) {
2768 2768
 			// This is a hidden option:
@@ -2772,7 +2772,7 @@  discard block
 block discarded – undo
2772 2772
 			$deposit_percent_from_payment_terms = getDictionaryValue('c_payment_term', 'deposit_percent', $object->cond_reglement_id);
2773 2773
 
2774 2774
 			if (!empty($deposit_percent_from_payment_terms) && isModEnabled('invoice') && $user->hasRight('facture', 'creer')) {
2775
-				require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
2775
+				require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
2776 2776
 
2777 2777
 				$object->fetchObjectLinked();
2778 2778
 
@@ -2858,7 +2858,7 @@  discard block
 block discarded – undo
2858 2858
 						'type' => 'onecolumn',
2859 2859
 						'value' => '
2860 2860
 							<script>
2861
-								let signedValue = ' . $object::STATUS_SIGNED . ';
2861
+								let signedValue = ' . $object::STATUS_SIGNED.';
2862 2862
 
2863 2863
 								$(document).ready(function() {
2864 2864
 									$("[name=generate_deposit]").change(function () {
@@ -2898,7 +2898,7 @@  discard block
 block discarded – undo
2898 2898
 		}
2899 2899
 
2900 2900
 		if (isModEnabled('notification')) {
2901
-			require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php';
2901
+			require_once DOL_DOCUMENT_ROOT.'/core/class/notify.class.php';
2902 2902
 			$notify = new Notify($db);
2903 2903
 			$formquestion = array_merge($formquestion, array(
2904 2904
 				array('type' => 'onecolumn', 'value' => $notify->confirmMessage('PROPAL_CLOSE_SIGNED', $object->socid, $object)),
@@ -2908,7 +2908,7 @@  discard block
 block discarded – undo
2908 2908
 		if (!getDolGlobalString('PROPAL_SKIP_ACCEPT_REFUSE')) {
2909 2909
 			$formconfirm = $form->formconfirm(dolBuildUrl($_SERVER["PHP_SELF"], ['id' => $object->id]), $langs->trans('SetAcceptedRefused'), '', 'confirm_closeas', $formquestion, '', 1, 250);
2910 2910
 		} else {
2911
-			$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?statut=3&id=' . $object->id, $langs->trans('Close'), '', 'confirm_closeas', $formquestion, '', 1, 250);
2911
+			$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?statut=3&id='.$object->id, $langs->trans('Close'), '', 'confirm_closeas', $formquestion, '', 1, 250);
2912 2912
 		}
2913 2913
 	} elseif ($action == 'cancel') {
2914 2914
 		// Confirm cancel
@@ -2921,7 +2921,7 @@  discard block
 block discarded – undo
2921 2921
 		$formconfirm = $form->formconfirm(dolBuildUrl($_SERVER["PHP_SELF"], ['id' => $object->id]), $langs->trans('ReOpen'), $langs->trans('ConfirmReOpenProp', $object->ref), 'confirm_reopen', '', 0, 1);
2922 2922
 	} elseif ($action == 'ask_deleteline') {
2923 2923
 		// Confirmation delete product/service line
2924
-		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id . '&lineid=' . $lineid, $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteline', '', 0, 1);
2924
+		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteline', '', 0, 1);
2925 2925
 	} elseif ($action == 'ask_subtotal_deleteline') {
2926 2926
 		// Confirmation de la suppression d'une ligne subtotal
2927 2927
 		$langs->load("subtotals");
@@ -2932,7 +2932,7 @@  discard block
 block discarded – undo
2932 2932
 			$title = "DeleteTitleLine";
2933 2933
 			$question = "ConfirmDeleteTitleLine";
2934 2934
 		}
2935
-		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id . '&lineid=' . $lineid, $langs->trans($title), $langs->trans($question), 'confirm_delete_subtotalline', $formconfirm, 'no', 1);
2935
+		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans($title), $langs->trans($question), 'confirm_delete_subtotalline', $formconfirm, 'no', 1);
2936 2936
 	} elseif ($action == 'validate') {
2937 2937
 		// Confirm validate proposal
2938 2938
 		$error = 0;
@@ -2951,7 +2951,7 @@  discard block
 block discarded – undo
2951 2951
 
2952 2952
 		$text = $langs->trans('ConfirmValidateProp', $numref);
2953 2953
 		if (isModEnabled('notification')) {
2954
-			require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php';
2954
+			require_once DOL_DOCUMENT_ROOT.'/core/class/notify.class.php';
2955 2955
 			$notify = new Notify($db);
2956 2956
 			$text .= '<br>';
2957 2957
 			$text .= $notify->confirmMessage('PROPAL_VALIDATE', $object->socid, $object);
@@ -2961,7 +2961,7 @@  discard block
 block discarded – undo
2961 2961
 		$nbMandated = 0;
2962 2962
 		foreach ($object->lines as $line) {
2963 2963
 			$res = $line->fetch_product();
2964
-			if ($res  > 0) {
2964
+			if ($res > 0) {
2965 2965
 				if ($line->product->isService() && $line->product->isMandatoryPeriod() && (empty($line->date_start) || empty($line->date_end))) {
2966 2966
 					$nbMandated++;
2967 2967
 					break;
@@ -2973,7 +2973,7 @@  discard block
 block discarded – undo
2973 2973
 				setEventMessages($langs->trans("mandatoryPeriodNeedTobeSetMsgValidate"), null, 'errors');
2974 2974
 				$error++;
2975 2975
 			} else {
2976
-				$text .= '<div><span class="clearboth nowraponall warning">' . img_warning() . $langs->trans("mandatoryPeriodNeedTobeSetMsgValidate") . '</span></div>';
2976
+				$text .= '<div><span class="clearboth nowraponall warning">'.img_warning().$langs->trans("mandatoryPeriodNeedTobeSetMsgValidate").'</span></div>';
2977 2977
 			}
2978 2978
 		}
2979 2979
 
@@ -2997,16 +2997,16 @@  discard block
 block discarded – undo
2997 2997
 
2998 2998
 	// Proposal card
2999 2999
 
3000
-	$linkback = '<a href="' . DOL_URL_ROOT . '/comm/propal/list.php?restore_lastsearch_values=1' . (!empty($socid) ? '&socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';
3000
+	$linkback = '<a href="'.DOL_URL_ROOT.'/comm/propal/list.php?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>';
3001 3001
 
3002 3002
 	$morehtmlref = '<div class="refidno">';
3003 3003
 	// Ref customer
3004 3004
 	$morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, $usercancreate, 'string', '', 0, 1);
3005
-	$morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, $usercancreate, 'string' . (isset($conf->global->THIRDPARTY_REF_INPUT_SIZE) ? ':' . getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') : ''), '', null, null, '', 1);
3005
+	$morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, $usercancreate, 'string'.(isset($conf->global->THIRDPARTY_REF_INPUT_SIZE) ? ':'.getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') : ''), '', null, null, '', 1);
3006 3006
 	// Thirdparty
3007
-	$morehtmlref .= '<br>' . $soc->getNomUrl(1, 'customer');
3007
+	$morehtmlref .= '<br>'.$soc->getNomUrl(1, 'customer');
3008 3008
 	if (!getDolGlobalString('MAIN_DISABLE_OTHER_LINK') && $soc->id > 0) {
3009
-		$morehtmlref .= ' (<a href="' . DOL_URL_ROOT . '/comm/propal/list.php?socid=' . $soc->id . '&search_societe=' . urlencode($soc->name) . '">' . $langs->trans("OtherProposals") . '</a>)';
3009
+		$morehtmlref .= ' (<a href="'.DOL_URL_ROOT.'/comm/propal/list.php?socid='.$soc->id.'&search_societe='.urlencode($soc->name).'">'.$langs->trans("OtherProposals").'</a>)';
3010 3010
 	}
3011 3011
 	// Project
3012 3012
 	if (isModEnabled('project')) {
@@ -3015,16 +3015,16 @@  discard block
 block discarded – undo
3015 3015
 		if ($usercancreate) {
3016 3016
 			$morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"');
3017 3017
 			if ($action != 'classify') {
3018
-				$morehtmlref .= '<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&token=' . newToken() . '&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> ';
3018
+				$morehtmlref .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> ';
3019 3019
 			}
3020
-			$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, (string) $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300');
3020
+			$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, (string) $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300');
3021 3021
 		} else {
3022 3022
 			if (!empty($object->fk_project)) {
3023 3023
 				$proj = new Project($db);
3024 3024
 				$proj->fetch($object->fk_project);
3025 3025
 				$morehtmlref .= $proj->getNomUrl(1);
3026 3026
 				if ($proj->title) {
3027
-					$morehtmlref .= '<span class="opacitymedium"> - ' . dol_escape_htmltag($proj->title) . '</span>';
3027
+					$morehtmlref .= '<span class="opacitymedium"> - '.dol_escape_htmltag($proj->title).'</span>';
3028 3028
 				}
3029 3029
 			}
3030 3030
 		}
@@ -3054,7 +3054,7 @@  discard block
 block discarded – undo
3054 3054
 			$filtercreditnote = "fk_facture_source IS NOT NULL AND (description NOT LIKE '(DEPOSIT)%' OR description LIKE '(EXCESS RECEIVED)%')";
3055 3055
 		}
3056 3056
 
3057
-		print '<tr><td class="titlefieldmax45">' . $langs->trans('Discounts') . '</td><td>';
3057
+		print '<tr><td class="titlefieldmax45">'.$langs->trans('Discounts').'</td><td>';
3058 3058
 
3059 3059
 		$absolute_discount = $soc->getAvailableDiscounts(null, $filterabsolutediscount);
3060 3060
 		$absolute_creditnote = $soc->getAvailableDiscounts(null, $filtercreditnote);
@@ -3065,8 +3065,8 @@  discard block
 block discarded – undo
3065 3065
 
3066 3066
 		$thirdparty = $soc;
3067 3067
 		$discount_type = 0;
3068
-		$backtopage = $_SERVER["PHP_SELF"] . '?id=' . $object->id;
3069
-		include DOL_DOCUMENT_ROOT . '/core/tpl/object_discounts.tpl.php';
3068
+		$backtopage = $_SERVER["PHP_SELF"].'?id='.$object->id;
3069
+		include DOL_DOCUMENT_ROOT.'/core/tpl/object_discounts.tpl.php';
3070 3070
 
3071 3071
 		print '</td></tr>';
3072 3072
 
@@ -3085,12 +3085,12 @@  discard block
 block discarded – undo
3085 3085
 		print $form->editfieldkey("DatePropal", 'date', '', $object, (int) $editenable);
3086 3086
 		print '</td><td class="valuefield">';
3087 3087
 		if ($action == 'editdate' && $usercancreate && $caneditfield) {
3088
-			print '<form name="editdate" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '" method="post">';
3089
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
3088
+			print '<form name="editdate" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="post">';
3089
+			print '<input type="hidden" name="token" value="'.newToken().'">';
3090 3090
 			print '<input type="hidden" name="action" value="setdate">';
3091
-			print '<input type="hidden" name="backtopage" value="' . $backtopage . '">';
3091
+			print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
3092 3092
 			print $form->selectDate($object->date, 're', 0, 0, 0, "editdate");
3093
-			print '<input type="submit" class="button button-edit" value="' . $langs->trans('Modify') . '">';
3093
+			print '<input type="submit" class="button button-edit" value="'.$langs->trans('Modify').'">';
3094 3094
 			print '</form>';
3095 3095
 		} else {
3096 3096
 			if ($object->date) {
@@ -3108,17 +3108,17 @@  discard block
 block discarded – undo
3108 3108
 		print $langs->trans('DateEndPropal');
3109 3109
 		print '</td>';
3110 3110
 		if ($action != 'editecheance' && $usercancreate && $caneditfield) {
3111
-			print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editecheance&token=' . newToken() . '&id=' . $object->id . '">' . img_edit($langs->trans('SetConditions'), 1) . '</a></td>';
3111
+			print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editecheance&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->trans('SetConditions'), 1).'</a></td>';
3112 3112
 		}
3113 3113
 		print '</tr></table>';
3114 3114
 		print '</td><td class="valuefield">';
3115 3115
 		if ($action == 'editecheance' && $usercancreate && $caneditfield) {
3116
-			print '<form name="editecheance" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '" method="post">';
3117
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
3116
+			print '<form name="editecheance" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="post">';
3117
+			print '<input type="hidden" name="token" value="'.newToken().'">';
3118 3118
 			print '<input type="hidden" name="action" value="setecheance">';
3119
-			print '<input type="hidden" name="backtopage" value="' . $backtopage . '">';
3119
+			print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
3120 3120
 			print $form->selectDate($object->fin_validite, 'ech', 0, 0, 0, "editecheance");
3121
-			print '<input type="submit" class="button button-edit" value="' . $langs->trans('Modify') . '">';
3121
+			print '<input type="submit" class="button button-edit" value="'.$langs->trans('Modify').'">';
3122 3122
 			print '</form>';
3123 3123
 		} else {
3124 3124
 			if (!empty($object->fin_validite)) {
@@ -3139,14 +3139,14 @@  discard block
 block discarded – undo
3139 3139
 		print $langs->trans('PaymentConditionsShort');
3140 3140
 		print '</td>';
3141 3141
 		if ($action != 'editconditions' && $usercancreate && $caneditfield) {
3142
-			print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editconditions&token=' . newToken() . '&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetConditions'), 1) . '</a></td>';
3142
+			print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editconditions&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetConditions'), 1).'</a></td>';
3143 3143
 		}
3144 3144
 		print '</tr></table>';
3145 3145
 		print '</td><td class="valuefield">';
3146 3146
 		if ($action == 'editconditions' && $usercancreate && $caneditfield) {
3147
-			$form->form_conditions_reglement($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->cond_reglement_id, 'cond_reglement_id', 0, '', 1, $object->deposit_percent);
3147
+			$form->form_conditions_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->cond_reglement_id, 'cond_reglement_id', 0, '', 1, $object->deposit_percent);
3148 3148
 		} else {
3149
-			$form->form_conditions_reglement($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->cond_reglement_id, 'none', 0, '', 1, $object->deposit_percent);
3149
+			$form->form_conditions_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->cond_reglement_id, 'none', 0, '', 1, $object->deposit_percent);
3150 3150
 		}
3151 3151
 		print '</td>';
3152 3152
 		print '</tr>';
@@ -3158,14 +3158,14 @@  discard block
 block discarded – undo
3158 3158
 		print $langs->trans('PaymentMode');
3159 3159
 		print '</td>';
3160 3160
 		if ($action != 'editmode' && $usercancreate && $caneditfield) {
3161
-			print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editmode&token=' . newToken() . '&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetMode'), 1) . '</a></td>';
3161
+			print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editmode&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetMode'), 1).'</a></td>';
3162 3162
 		}
3163 3163
 		print '</tr></table>';
3164 3164
 		print '</td><td class="valuefieldcreate">';
3165 3165
 		if ($action == 'editmode' && $usercancreate && $caneditfield) {
3166
-			$form->form_modes_reglement($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->mode_reglement_id, 'mode_reglement_id', 'CRDT', 1, 1);
3166
+			$form->form_modes_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->mode_reglement_id, 'mode_reglement_id', 'CRDT', 1, 1);
3167 3167
 		} else {
3168
-			$form->form_modes_reglement($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->mode_reglement_id, 'none');
3168
+			$form->form_modes_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->mode_reglement_id, 'none');
3169 3169
 		}
3170 3170
 		print '</td></tr>';
3171 3171
 
@@ -3181,20 +3181,20 @@  discard block
 block discarded – undo
3181 3181
 		print '<tr class="fielddeliverydelay"><td>';
3182 3182
 		print '<table class="nobordernopadding centpercent"><tr><td>';
3183 3183
 		if (isModEnabled('order')) {
3184
-			print $form->textwithpicto($langs->trans('AvailabilityPeriod'), $langs->trans('AvailabilityPeriod') . ' (' . $langs->trans('AfterOrder') . ')');
3184
+			print $form->textwithpicto($langs->trans('AvailabilityPeriod'), $langs->trans('AvailabilityPeriod').' ('.$langs->trans('AfterOrder').')');
3185 3185
 		} else {
3186 3186
 			print $langs->trans('AvailabilityPeriod');
3187 3187
 		}
3188 3188
 		print '</td>';
3189 3189
 		if ($action != 'editavailability' && $usercancreate && $caneditfield) {
3190
-			print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editavailability&token=' . newToken() . '&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetAvailability'), 1) . '</a></td>';
3190
+			print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editavailability&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetAvailability'), 1).'</a></td>';
3191 3191
 		}
3192 3192
 		print '</tr></table>';
3193 3193
 		print '</td><td class="valuefield">';
3194 3194
 		if ($action == 'editavailability' && $usercancreate && $caneditfield) {
3195
-			$form->form_availability($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->availability_id, 'availability_id', 1);
3195
+			$form->form_availability($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->availability_id, 'availability_id', 1);
3196 3196
 		} else {
3197
-			$form->form_availability($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->availability_id, 'none', 1);
3197
+			$form->form_availability($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->availability_id, 'none', 1);
3198 3198
 		}
3199 3199
 
3200 3200
 		print '</td>';
@@ -3207,14 +3207,14 @@  discard block
 block discarded – undo
3207 3207
 			print $langs->trans('SendingMethod');
3208 3208
 			print '</td>';
3209 3209
 			if ($action != 'editshippingmethod' && $usercancreate && $caneditfield) {
3210
-				print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editshippingmethod&token=' . newToken() . '&id=' . $object->id . '">' . img_edit($langs->trans('SetShippingMode'), 1) . '</a></td>';
3210
+				print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editshippingmethod&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->trans('SetShippingMode'), 1).'</a></td>';
3211 3211
 			}
3212 3212
 			print '</tr></table>';
3213 3213
 			print '</td><td class="valuefield">';
3214 3214
 			if ($action == 'editshippingmethod' && $usercancreate && $caneditfield) {
3215
-				$form->formSelectShippingMethod($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->shipping_method_id, 'shipping_method_id', 1);
3215
+				$form->formSelectShippingMethod($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->shipping_method_id, 'shipping_method_id', 1);
3216 3216
 			} else {
3217
-				$form->formSelectShippingMethod($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->shipping_method_id, 'none');
3217
+				$form->formSelectShippingMethod($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->shipping_method_id, 'none');
3218 3218
 			}
3219 3219
 			print '</td>';
3220 3220
 			print '</tr>';
@@ -3223,16 +3223,16 @@  discard block
 block discarded – undo
3223 3223
 		// Warehouse
3224 3224
 		if (isModEnabled('stock') && getDolGlobalString('WAREHOUSE_ASK_WAREHOUSE_DURING_PROPAL')) {
3225 3225
 			$langs->load('stocks');
3226
-			require_once DOL_DOCUMENT_ROOT . '/product/class/html.formproduct.class.php';
3226
+			require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
3227 3227
 			$formproduct = new FormProduct($db);
3228 3228
 			print '<tr class="field_warehouse_id"><td>';
3229 3229
 			$editenable = $usercancreate;
3230 3230
 			print $form->editfieldkey("Warehouse", 'warehouse', '', $object, $editenable);
3231 3231
 			print '</td><td class="valuefieldcreate">';
3232 3232
 			if ($action == 'editwarehouse') {
3233
-				$formproduct->formSelectWarehouses($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->warehouse_id, 'warehouse_id', 1);
3233
+				$formproduct->formSelectWarehouses($_SERVER['PHP_SELF'].'?id='.$object->id, $object->warehouse_id, 'warehouse_id', 1);
3234 3234
 			} else {
3235
-				$formproduct->formSelectWarehouses($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->warehouse_id, 'none');
3235
+				$formproduct->formSelectWarehouses($_SERVER['PHP_SELF'].'?id='.$object->id, $object->warehouse_id, 'none');
3236 3236
 			}
3237 3237
 			print '</td>';
3238 3238
 			print '</tr>';
@@ -3244,14 +3244,14 @@  discard block
 block discarded – undo
3244 3244
 		print $langs->trans('Source');
3245 3245
 		print '</td>';
3246 3246
 		if ($action != 'editdemandreason' && $usercancreate) {
3247
-			print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editdemandreason&token=' . newToken() . '&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetDemandReason'), 1) . '</a></td>';
3247
+			print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editdemandreason&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetDemandReason'), 1).'</a></td>';
3248 3248
 		}
3249 3249
 		print '</tr></table>';
3250 3250
 		print '</td><td class="valuefield">';
3251 3251
 		if ($action == 'editdemandreason' && $usercancreate) {
3252
-			$form->formInputReason($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->demand_reason_id, 'demand_reason_id', 1);
3252
+			$form->formInputReason($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->demand_reason_id, 'demand_reason_id', 1);
3253 3253
 		} else {
3254
-			$form->formInputReason($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->demand_reason_id, 'none');
3254
+			$form->formInputReason($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->demand_reason_id, 'none');
3255 3255
 		}
3256 3256
 		print '</td>';
3257 3257
 		print '</tr>';
@@ -3263,7 +3263,7 @@  discard block
 block discarded – undo
3263 3263
 			print '</td><td class="valuefield">';
3264 3264
 			$arrayoutstandingbills = $soc->getOutstandingBills();
3265 3265
 			print($arrayoutstandingbills['opened'] > $soc->outstanding_limit ? img_warning() : '');
3266
-			print price($arrayoutstandingbills['opened']) . ' / ';
3266
+			print price($arrayoutstandingbills['opened']).' / ';
3267 3267
 			print price($soc->outstanding_limit, 0, $langs, 1, -1, -1, $conf->currency);
3268 3268
 			print '</td>';
3269 3269
 			print '</tr>';
@@ -3276,14 +3276,14 @@  discard block
 block discarded – undo
3276 3276
 			print $langs->trans('BankAccount');
3277 3277
 			print '</td>';
3278 3278
 			if ($action != 'editbankaccount' && $usercancreate) {
3279
-				print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editbankaccount&token=' . newToken() . '&id=' . $object->id . '">' . img_edit($langs->trans('SetBankAccount'), 1) . '</a></td>';
3279
+				print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editbankaccount&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->trans('SetBankAccount'), 1).'</a></td>';
3280 3280
 			}
3281 3281
 			print '</tr></table>';
3282 3282
 			print '</td><td class="valuefield">';
3283 3283
 			if ($action == 'editbankaccount') {
3284
-				$form->formSelectAccount($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->fk_account, 'fk_account', 1);
3284
+				$form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->fk_account, 'fk_account', 1);
3285 3285
 			} else {
3286
-				$form->formSelectAccount($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->fk_account, 'none');
3286
+				$form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->fk_account, 'none');
3287 3287
 			}
3288 3288
 			print '</td>';
3289 3289
 			print '</tr>';
@@ -3294,13 +3294,13 @@  discard block
 block discarded – undo
3294 3294
 			$totalWeight = isset($tmparray['weight']) ? $tmparray['weight'] : 0;
3295 3295
 			$totalVolume = isset($tmparray['volume']) ? $tmparray['volume'] : 0;
3296 3296
 			if ($totalWeight) {
3297
-				print '<tr><td>' . $langs->trans("CalculatedWeight") . '</td>';
3297
+				print '<tr><td>'.$langs->trans("CalculatedWeight").'</td>';
3298 3298
 				print '<td class="valuefield">';
3299 3299
 				print showDimensionInBestUnit($totalWeight, 0, "weight", $langs, getDolGlobalInt('MAIN_WEIGHT_DEFAULT_ROUND', -1), getDolGlobalString('MAIN_WEIGHT_DEFAULT_UNIT', 'no'), 1);
3300 3300
 				print '</td></tr>';
3301 3301
 			}
3302 3302
 			if ($totalVolume) {
3303
-				print '<tr><td>' . $langs->trans("CalculatedVolume") . '</td>';
3303
+				print '<tr><td>'.$langs->trans("CalculatedVolume").'</td>';
3304 3304
 				print '<td class="valuefield">';
3305 3305
 				print showDimensionInBestUnit($totalVolume, 0, "volume", $langs, getDolGlobalInt('MAIN_VOLUME_DEFAULT_ROUND', -1), getDolGlobalString('MAIN_VOLUME_DEFAULT_UNIT', 'no'), 1);
3306 3306
 				print '</td></tr>';
@@ -3314,7 +3314,7 @@  discard block
 block discarded – undo
3314 3314
 			print $langs->trans('IncotermLabel');
3315 3315
 			print '<td><td class="right">';
3316 3316
 			if ($action != 'editincoterm' && $usercancreate && $caneditfield) {
3317
-				print '<a class="editfielda" href="' . DOL_URL_ROOT . '/comm/propal/card.php?id=' . $object->id . '&action=editincoterm&token=' . newToken() . '">' . img_edit() . '</a>';
3317
+				print '<a class="editfielda" href="'.DOL_URL_ROOT.'/comm/propal/card.php?id='.$object->id.'&action=editincoterm&token='.newToken().'">'.img_edit().'</a>';
3318 3318
 			} else {
3319 3319
 				print '&nbsp;';
3320 3320
 			}
@@ -3322,7 +3322,7 @@  discard block
 block discarded – undo
3322 3322
 			print '</td>';
3323 3323
 			print '<td class="valuefield">';
3324 3324
 			if ($action == 'editincoterm' && $usercancreate && $caneditfield) {
3325
-				print $form->select_incoterms((!empty($object->fk_incoterms) ? $object->fk_incoterms : ''), (!empty($object->location_incoterms) ? $object->location_incoterms : ''), $_SERVER['PHP_SELF'] . '?id=' . $object->id);
3325
+				print $form->select_incoterms((!empty($object->fk_incoterms) ? $object->fk_incoterms : ''), (!empty($object->location_incoterms) ? $object->location_incoterms : ''), $_SERVER['PHP_SELF'].'?id='.$object->id);
3326 3326
 			} else {
3327 3327
 				print $form->textwithpicto($object->display_incoterms(), $object->label_incoterms, 1);
3328 3328
 			}
@@ -3357,7 +3357,7 @@  discard block
 block discarded – undo
3357 3357
 		}
3358 3358
 
3359 3359
 		// Other attributes
3360
-		include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
3360
+		include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
3361 3361
 
3362 3362
 		print '</table>';
3363 3363
 
@@ -3367,53 +3367,53 @@  discard block
 block discarded – undo
3367 3367
 
3368 3368
 		print '<table class="border tableforfield centpercent">';
3369 3369
 
3370
-		include DOL_DOCUMENT_ROOT . '/core/tpl/object_currency_amount.tpl.php';
3370
+		include DOL_DOCUMENT_ROOT.'/core/tpl/object_currency_amount.tpl.php';
3371 3371
 
3372 3372
 		print '<tr>';
3373
-		print '<td class="titlefieldmiddle">' . $langs->trans('AmountHT') . '</td>';
3374
-		print '<td class="nowrap amountcard right">' . price($object->total_ht, 0, $langs, 1, -1, -1, $conf->currency) . '</td>';
3373
+		print '<td class="titlefieldmiddle">'.$langs->trans('AmountHT').'</td>';
3374
+		print '<td class="nowrap amountcard right">'.price($object->total_ht, 0, $langs, 1, -1, -1, $conf->currency).'</td>';
3375 3375
 		if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
3376
-			print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_ht, 0, $langs, 1, -1, -1, $object->multicurrency_code) . '</td>';
3376
+			print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_ht, 0, $langs, 1, -1, -1, $object->multicurrency_code).'</td>';
3377 3377
 		}
3378 3378
 		print '</tr>';
3379 3379
 
3380 3380
 		print '<tr>';
3381
-		print '<td>' . $langs->trans('AmountVAT') . '</td>';
3382
-		print '<td class="nowrap amountcard right">' . price($object->total_tva, 0, $langs, 1, -1, -1, $conf->currency) . '</td>';
3381
+		print '<td>'.$langs->trans('AmountVAT').'</td>';
3382
+		print '<td class="nowrap amountcard right">'.price($object->total_tva, 0, $langs, 1, -1, -1, $conf->currency).'</td>';
3383 3383
 		if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
3384
-			print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_tva, 0, $langs, 1, -1, -1, $object->multicurrency_code) . '</td>';
3384
+			print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_tva, 0, $langs, 1, -1, -1, $object->multicurrency_code).'</td>';
3385 3385
 		}
3386 3386
 		print '</tr>';
3387 3387
 
3388 3388
 		if ($mysoc->localtax1_assuj == "1" || $object->total_localtax1 != 0) {
3389 3389
 			print '<tr>';
3390
-			print '<td>' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '</td>';
3391
-			print '<td class="nowrap amountcard right">' . price($object->total_localtax1, 0, $langs, 1, -1, -1, $conf->currency) . '</td>';
3390
+			print '<td>'.$langs->transcountry("AmountLT1", $mysoc->country_code).'</td>';
3391
+			print '<td class="nowrap amountcard right">'.price($object->total_localtax1, 0, $langs, 1, -1, -1, $conf->currency).'</td>';
3392 3392
 			if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
3393 3393
 				$object->multicurrency_total_localtax1 = price2num($object->total_localtax1 * $object->multicurrency_tx, 'MT');
3394 3394
 
3395
-				print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_localtax1, 0, $langs, 1, -1, -1, $object->multicurrency_code) . '</td>';
3395
+				print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_localtax1, 0, $langs, 1, -1, -1, $object->multicurrency_code).'</td>';
3396 3396
 			}
3397 3397
 			print '</tr>';
3398 3398
 		}
3399 3399
 
3400 3400
 		if ($mysoc->localtax2_assuj == "1" || $object->total_localtax2 != 0) {
3401 3401
 			print '<tr>';
3402
-			print '<td>' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '</td>';
3403
-			print '<td class="nowrap amountcard right">' . price($object->total_localtax2, 0, $langs, 1, -1, -1, $conf->currency) . '</td>';
3402
+			print '<td>'.$langs->transcountry("AmountLT2", $mysoc->country_code).'</td>';
3403
+			print '<td class="nowrap amountcard right">'.price($object->total_localtax2, 0, $langs, 1, -1, -1, $conf->currency).'</td>';
3404 3404
 			if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
3405 3405
 				$object->multicurrency_total_localtax2 = price2num($object->total_localtax2 * $object->multicurrency_tx, 'MT');
3406 3406
 
3407
-				print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_localtax2, 0, $langs, 1, -1, -1, $object->multicurrency_code) . '</td>';
3407
+				print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_localtax2, 0, $langs, 1, -1, -1, $object->multicurrency_code).'</td>';
3408 3408
 			}
3409 3409
 			print '</tr>';
3410 3410
 		}
3411 3411
 
3412 3412
 		print '<tr>';
3413
-		print '<td>' . $langs->trans('AmountTTC') . '</td>';
3414
-		print '<td class="nowrap amountcard right">' . price($object->total_ttc, 0, $langs, 1, -1, -1, $conf->currency) . '</td>';
3413
+		print '<td>'.$langs->trans('AmountTTC').'</td>';
3414
+		print '<td class="nowrap amountcard right">'.price($object->total_ttc, 0, $langs, 1, -1, -1, $conf->currency).'</td>';
3415 3415
 		if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
3416
-			print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_ttc, 0, $langs, 1, -1, -1, $object->multicurrency_code) . '</td>';
3416
+			print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_ttc, 0, $langs, 1, -1, -1, $object->multicurrency_code).'</td>';
3417 3417
 		}
3418 3418
 		print '</tr>';
3419 3419
 
@@ -3432,13 +3432,13 @@  discard block
 block discarded – undo
3432 3432
 		if (getDolGlobalString('MAIN_DISABLE_CONTACTS_TAB')) {
3433 3433
 			$blocname = 'contacts';
3434 3434
 			$title = $langs->trans('ContactsAddresses');
3435
-			include DOL_DOCUMENT_ROOT . '/core/tpl/bloc_showhide.tpl.php';
3435
+			include DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php';
3436 3436
 		}
3437 3437
 
3438 3438
 		if (getDolGlobalString('MAIN_DISABLE_NOTES_TAB')) {
3439 3439
 			$blocname = 'notes';
3440 3440
 			$title = $langs->trans('Notes');
3441
-			include DOL_DOCUMENT_ROOT . '/core/tpl/bloc_showhide.tpl.php';
3441
+			include DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php';
3442 3442
 		}
3443 3443
 
3444 3444
 		/*
@@ -3453,20 +3453,20 @@  discard block
 block discarded – undo
3453 3453
 		global $inputalsopricewithtax;
3454 3454
 		$inputalsopricewithtax = 1;
3455 3455
 
3456
-		print '	<form name="addproduct" id="addproduct" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '" method="POST">
3457
-		<input type="hidden" name="token" value="' . newToken() . '">
3458
-		<input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline') . '">
3456
+		print '	<form name="addproduct" id="addproduct" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="POST">
3457
+		<input type="hidden" name="token" value="' . newToken().'">
3458
+		<input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline').'">
3459 3459
 		<input type="hidden" name="mode" value="">
3460 3460
 		<input type="hidden" name="page_y" value="">
3461
-		<input type="hidden" name="backtopage" value="' . $backtopage . '">
3462
-		<input type="hidden" name="id" value="' . $object->id . '">
3461
+		<input type="hidden" name="backtopage" value="' . $backtopage.'">
3462
+		<input type="hidden" name="id" value="' . $object->id.'">
3463 3463
 		';
3464 3464
 
3465 3465
 		if (!empty($conf->use_javascript_ajax) && $object->status == Propal::STATUS_DRAFT) {
3466 3466
 			if (isModEnabled('subtotals')) {
3467
-				include DOL_DOCUMENT_ROOT . '/core/tpl/subtotal_ajaxrow.tpl.php';
3467
+				include DOL_DOCUMENT_ROOT.'/core/tpl/subtotal_ajaxrow.tpl.php';
3468 3468
 			} else {
3469
-				include DOL_DOCUMENT_ROOT . '/core/tpl/ajaxrow.tpl.php';
3469
+				include DOL_DOCUMENT_ROOT.'/core/tpl/ajaxrow.tpl.php';
3470 3470
 			}
3471 3471
 		}
3472 3472
 
@@ -3521,7 +3521,7 @@  discard block
 block discarded – undo
3521 3521
 		if (empty($reshook)) {
3522 3522
 			if ($action != 'editline') {
3523 3523
 				// Subtotal
3524
-				if ($object->status == Propal::STATUS_DRAFT && isModEnabled('subtotals') && getDolGlobalString('SUBTOTAL_TITLE_' . strtoupper($object->element))) {
3524
+				if ($object->status == Propal::STATUS_DRAFT && isModEnabled('subtotals') && getDolGlobalString('SUBTOTAL_TITLE_'.strtoupper($object->element))) {
3525 3525
 					$langs->load('subtotals');
3526 3526
 
3527 3527
 					$url_button = array();
@@ -3531,7 +3531,7 @@  discard block
 block discarded – undo
3531 3531
 						'enabled' => (isModEnabled('propal') && $object->status == Propal::STATUS_DRAFT),
3532 3532
 						'perm' => (bool) $usercancreate,
3533 3533
 						'label' => $langs->trans('AddTitleLine'),
3534
-						'url' => '/comm/propal/card.php?id=' . $object->id . '&action=add_title_line&token=' . newToken()
3534
+						'url' => '/comm/propal/card.php?id='.$object->id.'&action=add_title_line&token='.newToken()
3535 3535
 					);
3536 3536
 
3537 3537
 					$url_button[] = array(
@@ -3539,7 +3539,7 @@  discard block
 block discarded – undo
3539 3539
 						'enabled' => (isModEnabled('propal') && $object->status == Propal::STATUS_DRAFT),
3540 3540
 						'perm' => (bool) $usercancreate,
3541 3541
 						'label' => $langs->trans('AddSubtotalLine'),
3542
-						'url' => '/comm/propal/card.php?id=' . $object->id . '&action=add_subtotal_line&token=' . newToken()
3542
+						'url' => '/comm/propal/card.php?id='.$object->id.'&action=add_subtotal_line&token='.newToken()
3543 3543
 					);
3544 3544
 
3545 3545
 					print dolGetButtonAction('', $langs->trans('Subtotal'), 'default', $url_button, '', true);
@@ -3550,9 +3550,9 @@  discard block
 block discarded – undo
3550 3550
 					|| ($object->status == Propal::STATUS_DRAFT && getDolGlobalString('PROPAL_ENABLE_NEGATIVE') && count($object->lines) > 0)
3551 3551
 				) {
3552 3552
 					if ($usercanvalidate) {
3553
-						print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=validate&token=' . newToken() . '">' . (!getDolGlobalString('PROPAL_SKIP_ACCEPT_REFUSE') ? $langs->trans('Validate') : $langs->trans('ValidateAndSign')) . '</a>';
3553
+						print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=validate&token='.newToken().'">'.(!getDolGlobalString('PROPAL_SKIP_ACCEPT_REFUSE') ? $langs->trans('Validate') : $langs->trans('ValidateAndSign')).'</a>';
3554 3554
 					} else {
3555
-						print '<a class="butActionRefused classfortooltip" href="#">' . $langs->trans('Validate') . '</a>';
3555
+						print '<a class="butActionRefused classfortooltip" href="#">'.$langs->trans('Validate').'</a>';
3556 3556
 					}
3557 3557
 				}
3558 3558
 				// Create event
@@ -3562,23 +3562,23 @@  discard block
 block discarded – undo
3562 3562
 				}*/
3563 3563
 				// Edit
3564 3564
 				if ($object->status == Propal::STATUS_VALIDATED && $usercancreate) {
3565
-					print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=modif&token=' . newToken() . '">' . $langs->trans('Modify') . '</a>';
3565
+					print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=modif&token='.newToken().'">'.$langs->trans('Modify').'</a>';
3566 3566
 				}
3567 3567
 
3568 3568
 				// ReOpen
3569 3569
 				if (((getDolGlobalString('PROPAL_REOPEN_UNSIGNED_ONLY') && $object->status == Propal::STATUS_NOTSIGNED) || (!getDolGlobalString('PROPAL_REOPEN_UNSIGNED_ONLY') && ($object->status == Propal::STATUS_SIGNED || $object->status == Propal::STATUS_NOTSIGNED || $object->status == Propal::STATUS_BILLED || $object->status == Propal::STATUS_CANCELED)))) {
3570 3570
 					if ($usercanreopen) {
3571
-						print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=reopen&token=' . newToken() . (!getDolGlobalString('MAIN_JUMP_TAG') ? '' : '#reopen') . '"';
3572
-						print '>' . $langs->trans('ReOpen') . '</a>';
3571
+						print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=reopen&token='.newToken().(!getDolGlobalString('MAIN_JUMP_TAG') ? '' : '#reopen').'"';
3572
+						print '>'.$langs->trans('ReOpen').'</a>';
3573 3573
 					} else {
3574
-						print '<a class="butActionRefused classfortooltip" href="#" title="' . $langs->trans("NotEnoughPermissions") . '">' . $langs->trans("ReOpen") . '</a>';
3574
+						print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("NotEnoughPermissions").'">'.$langs->trans("ReOpen").'</a>';
3575 3575
 					}
3576 3576
 				}
3577 3577
 
3578 3578
 				// Send
3579 3579
 				if (empty($user->socid)) {
3580 3580
 					if ($object->status == Propal::STATUS_VALIDATED || $object->status == Propal::STATUS_SIGNED || getDolGlobalString('PROPOSAL_SENDBYEMAIL_FOR_ALL_STATUS')) {
3581
-						print dolGetButtonAction('', $langs->trans('SendMail'), 'email', $_SERVER["PHP_SELF"] . '?action=presend&token=' . newToken() . '&id=' . $object->id . '&mode=init#formmailbeforetitle', '', $usercansend);
3581
+						print dolGetButtonAction('', $langs->trans('SendMail'), 'email', $_SERVER["PHP_SELF"].'?action=presend&token='.newToken().'&id='.$object->id.'&mode=init#formmailbeforetitle', '', $usercansend);
3582 3582
 					}
3583 3583
 				}
3584 3584
 
@@ -3590,7 +3590,7 @@  discard block
 block discarded – undo
3590 3590
 					'enabled' => (isModEnabled('order') && $object->status == Propal::STATUS_SIGNED),
3591 3591
 					'perm' => $usercancreateorder,
3592 3592
 					'label' => 'AddOrder',
3593
-					'url' => '/commande/card.php?action=create&origin=' . urlencode($object->element) . '&originid=' . ((int) $object->id) . '&socid=' . ((int) $object->socid)
3593
+					'url' => '/commande/card.php?action=create&origin='.urlencode($object->element).'&originid='.((int) $object->id).'&socid='.((int) $object->socid)
3594 3594
 				);
3595 3595
 				/*if (isModEnabled('order') && $object->status == Propal::STATUS_SIGNED) {
3596 3596
 					if ($usercancreateorder) {
@@ -3605,7 +3605,7 @@  discard block
 block discarded – undo
3605 3605
 						'enabled' => ($object->status == Propal::STATUS_SIGNED && isModEnabled("supplier_order")),
3606 3606
 						'perm' => $usercancreatepurchaseorder,
3607 3607
 						'label' => 'AddPurchaseOrder',
3608
-						'url' => '/fourn/commande/card.php?action=create&origin=' . urlencode($object->element) . '&originid=' . ((int) $object->id) . '&socid=' . ((int) $object->socid)
3608
+						'url' => '/fourn/commande/card.php?action=create&origin='.urlencode($object->element).'&originid='.((int) $object->id).'&socid='.((int) $object->socid)
3609 3609
 					);
3610 3610
 					/*if ($object->status == Propal::STATUS_SIGNED && isModEnabled("supplier_order")) {
3611 3611
 						if ($usercancreatepurchaseorder) {
@@ -3620,7 +3620,7 @@  discard block
 block discarded – undo
3620 3620
 					'enabled' => (isModEnabled("service") && isModEnabled('intervention') && $object->status == Propal::STATUS_SIGNED),
3621 3621
 					'perm' => $usercancreateintervention,
3622 3622
 					'label' => 'AddIntervention',
3623
-					'url' => '/fichinter/card.php?action=create&origin=' . urlencode($object->element) . '&originid=' . ((int) $object->id) . '&socid=' . ((int) $object->socid)
3623
+					'url' => '/fichinter/card.php?action=create&origin='.urlencode($object->element).'&originid='.((int) $object->id).'&socid='.((int) $object->socid)
3624 3624
 				);
3625 3625
 				/*if (isModEnabled("service") && isModEnabled('intervention') && $object->status == Propal::STATUS_SIGNED) {
3626 3626
 					if ($usercancreateintervention) {
@@ -3635,7 +3635,7 @@  discard block
 block discarded – undo
3635 3635
 					'enabled' => (isModEnabled('contract') && $object->status == Propal::STATUS_SIGNED),
3636 3636
 					'perm' => $usercancreatecontract,
3637 3637
 					'label' => 'AddContract',
3638
-					'url' => '/contrat/card.php?action=create&origin=' . urlencode($object->element) . '&originid=' . ((int) $object->id) . '&socid=' . ((int) $object->socid)
3638
+					'url' => '/contrat/card.php?action=create&origin='.urlencode($object->element).'&originid='.((int) $object->id).'&socid='.((int) $object->socid)
3639 3639
 				);
3640 3640
 				/*if (isModEnabled('contract') && $object->status == Propal::STATUS_SIGNED) {
3641 3641
 					$langs->load("contracts");
@@ -3652,7 +3652,7 @@  discard block
 block discarded – undo
3652 3652
 						'enabled' => isModEnabled('invoice'),
3653 3653
 						'perm' => $usercancreateinvoice,
3654 3654
 						'label' => 'CreateBill',
3655
-						'url' => '/compta/facture/card.php?action=create&origin=' . urlencode($object->element) . '&originid=' . ((int) $object->id) . '&socid=' . ((int) $object->socid),
3655
+						'url' => '/compta/facture/card.php?action=create&origin='.urlencode($object->element).'&originid='.((int) $object->id).'&socid='.((int) $object->socid),
3656 3656
 					];
3657 3657
 					/*if (isModEnabled('invoice') && $usercancreateinvoice) {
3658 3658
 						print '<a class="butAction" href="'.DOL_URL_ROOT.'/compta/facture/card.php?action=create&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->socid.'">'.$langs->trans("CreateBill").'</a>';
@@ -3661,7 +3661,7 @@  discard block
 block discarded – undo
3661 3661
 
3662 3662
 				$actionButtonsParameters = [
3663 3663
 					"areDropdownButtons" => !getDolGlobalInt("MAIN_REMOVE_DROPDOWN_CREATE_BUTTONS_ON_ORDER"),
3664
-					"backtopage" => $_SERVER["PHP_SELF"] . "?id=" . ((int) $id)
3664
+					"backtopage" => $_SERVER["PHP_SELF"]."?id=".((int) $id)
3665 3665
 				];
3666 3666
 
3667 3667
 				if ($numlines > 0) {
@@ -3674,9 +3674,9 @@  discard block
 block discarded – undo
3674 3674
 					$arrayofinvoiceforpropal = $object->getInvoiceArrayList();
3675 3675
 					if ((is_array($arrayofinvoiceforpropal) && count($arrayofinvoiceforpropal) > 0) || !getDolGlobalString('WORKFLOW_PROPAL_NEED_INVOICE_TO_BE_CLASSIFIED_BILLED')) {
3676 3676
 						if ($usercanclose) {
3677
-							print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=classifybilled&token=' . newToken() . '&socid=' . $object->socid . '">' . $langs->trans("ClassifyBilled") . '</a>';
3677
+							print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=classifybilled&token='.newToken().'&socid='.$object->socid.'">'.$langs->trans("ClassifyBilled").'</a>';
3678 3678
 						} else {
3679
-							print '<a class="butActionRefused classfortooltip" href="#" title="' . $langs->trans("NotEnoughPermissions") . '">' . $langs->trans("ClassifyBilled") . '</a>';
3679
+							print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("NotEnoughPermissions").'">'.$langs->trans("ClassifyBilled").'</a>';
3680 3680
 						}
3681 3681
 					}
3682 3682
 				}
@@ -3685,33 +3685,33 @@  discard block
 block discarded – undo
3685 3685
 					// Close as accepted/refused
3686 3686
 					if ($object->status == Propal::STATUS_VALIDATED) {
3687 3687
 						if ($usercanclose) {
3688
-							print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=closeas&token=' . newToken() . (!getDolGlobalString('MAIN_JUMP_TAG') ? '' : '#close') . '"';
3689
-							print '>' . $langs->trans('SetAcceptedRefused') . '</a>';
3688
+							print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=closeas&token='.newToken().(!getDolGlobalString('MAIN_JUMP_TAG') ? '' : '#close').'"';
3689
+							print '>'.$langs->trans('SetAcceptedRefused').'</a>';
3690 3690
 						} else {
3691
-							print '<a class="butActionRefused classfortooltip" href="#" title="' . $langs->trans("NotEnoughPermissions") . '"';
3692
-							print '>' . $langs->trans('SetAcceptedRefused') . '</a>';
3691
+							print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("NotEnoughPermissions").'"';
3692
+							print '>'.$langs->trans('SetAcceptedRefused').'</a>';
3693 3693
 						}
3694 3694
 					}
3695 3695
 				} else {
3696 3696
 					// Set not signed (close)
3697 3697
 					if ($object->status == Propal::STATUS_DRAFT && $usercanclose) {
3698
-						print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&token=' . newToken() . '&action=closeas&token=' . newToken() . (!getDolGlobalString('MAIN_JUMP_TAG') ? '' : '#close') . '"';
3699
-						print '>' . $langs->trans('SetRefusedAndClose') . '</a>';
3698
+						print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&token='.newToken().'&action=closeas&token='.newToken().(!getDolGlobalString('MAIN_JUMP_TAG') ? '' : '#close').'"';
3699
+						print '>'.$langs->trans('SetRefusedAndClose').'</a>';
3700 3700
 					}
3701 3701
 				}
3702 3702
 
3703 3703
 				// Cancel propal
3704 3704
 				if ($object->status > Propal::STATUS_DRAFT && $usercanclose) {
3705
-					print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=cancel&token=' . newToken() . '">' . $langs->trans("CancelPropal") . '</a>';
3705
+					print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=cancel&token='.newToken().'">'.$langs->trans("CancelPropal").'</a>';
3706 3706
 				}
3707 3707
 
3708 3708
 				// Clone
3709 3709
 				if ($usercancreate) {
3710
-					print '<a class="butAction" href="' . $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&socid=' . $object->socid . '&action=clone&token=' . newToken() . '&object=' . $object->element . '">' . $langs->trans("ToClone") . '</a>';
3710
+					print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&socid='.$object->socid.'&action=clone&token='.newToken().'&object='.$object->element.'">'.$langs->trans("ToClone").'</a>';
3711 3711
 				}
3712 3712
 
3713 3713
 				// Delete
3714
-				print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=delete&token=' . newToken(), 'delete', $usercandelete);
3714
+				print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', $usercandelete);
3715 3715
 			}
3716 3716
 		}
3717 3717
 
@@ -3730,8 +3730,8 @@  discard block
 block discarded – undo
3730 3730
 		 * Generated documents
3731 3731
 		 */
3732 3732
 		$objref = dol_sanitizeFileName($object->ref);
3733
-		$filedir = $conf->propal->multidir_output[$object->entity ?? $conf->entity] . "/" . dol_sanitizeFileName($object->ref);
3734
-		$urlsource = $_SERVER["PHP_SELF"] . "?id=" . $object->id;
3733
+		$filedir = $conf->propal->multidir_output[$object->entity ?? $conf->entity]."/".dol_sanitizeFileName($object->ref);
3734
+		$urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id;
3735 3735
 		$genallowed = $usercanread;
3736 3736
 		$delallowed = $usercancreate;
3737 3737
 		$tooltipAfterComboOfModels = '';
@@ -3758,19 +3758,19 @@  discard block
 block discarded – undo
3758 3758
 
3759 3759
 		if ($object->status != Propal::STATUS_DRAFT && $useonlinesignature) {
3760 3760
 			print '<br><!-- Link to sign -->';
3761
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/signature.lib.php';
3762
-			print showOnlineSignatureUrl('proposal', $object->ref, $object) . '<br>';
3761
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/signature.lib.php';
3762
+			print showOnlineSignatureUrl('proposal', $object->ref, $object).'<br>';
3763 3763
 		}
3764 3764
 
3765 3765
 		print '</div><div class="fichehalfright">';
3766 3766
 
3767 3767
 		$MAXEVENT = 10;
3768 3768
 
3769
-		$morehtmlcenter = dolGetButtonTitle($langs->trans('FullConversation'), '', 'fa fa-comments imgforviewmode', DOL_URL_ROOT . '/comm/propal/messaging.php?id=' . $object->id);
3770
-		$morehtmlcenter .= dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', DOL_URL_ROOT . '/comm/propal/agenda.php?id=' . $object->id);
3769
+		$morehtmlcenter = dolGetButtonTitle($langs->trans('FullConversation'), '', 'fa fa-comments imgforviewmode', DOL_URL_ROOT.'/comm/propal/messaging.php?id='.$object->id);
3770
+		$morehtmlcenter .= dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', DOL_URL_ROOT.'/comm/propal/agenda.php?id='.$object->id);
3771 3771
 
3772 3772
 		// List of actions on element
3773
-		include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
3773
+		include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
3774 3774
 		$formactions = new FormActions($db);
3775 3775
 		$somethingshown = $formactions->showactions($object, 'propal', $socid, 1, '', $MAXEVENT, '', $morehtmlcenter); // Show all action for thirdparty
3776 3776
 
@@ -3781,9 +3781,9 @@  discard block
 block discarded – undo
3781 3781
 	$modelmail = 'propal_send';
3782 3782
 	$defaulttopic = 'SendPropalRef';
3783 3783
 	$diroutput = $conf->propal->multidir_output[$object->entity ?? $conf->entity];
3784
-	$trackid = 'pro' . $object->id;
3784
+	$trackid = 'pro'.$object->id;
3785 3785
 
3786
-	include DOL_DOCUMENT_ROOT . '/core/tpl/card_presend.tpl.php';
3786
+	include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php';
3787 3787
 }
3788 3788
 
3789 3789
 // End of page
Please login to merge, or discard this patch.
htdocs/user/group/perms.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -329,7 +329,7 @@  discard block
 block discarded – undo
329 329
 // Get list of all permissions
330 330
 $sql = "SELECT r.id, r.libelle as label, r.module, r.perms, r.subperms, r.module_position, r.bydefault, r.family, r.family_position";
331 331
 $sql .= " FROM ".MAIN_DB_PREFIX."rights_def as r";
332
-$sql .= " WHERE r.libelle NOT LIKE 'tou%'";  // We ignore permission "tous les tiers". Why ?
332
+$sql .= " WHERE r.libelle NOT LIKE 'tou%'"; // We ignore permission "tous les tiers". Why ?
333 333
 $sql .= " AND r.entity = ".((int) $entity);
334 334
 if (!getDolGlobalString('MAIN_USE_ADVANCED_PERMS')) {
335 335
 	$sql .= " AND r.perms NOT LIKE '%_advance'"; // Hide advanced perms if option is not enabled
@@ -421,7 +421,7 @@  discard block
 block discarded – undo
421 421
 	} else {
422 422
 		$ishidden = 0;
423 423
 	}
424
-	$isexpanded = ! $ishidden;
424
+	$isexpanded = !$ishidden;
425 425
 	//var_dump("isexpanded=".$isexpanded);
426 426
 
427 427
 	$permsgroupbyentitypluszero = array();
@@ -445,7 +445,7 @@  discard block
 block discarded – undo
445 445
 		} else {
446 446
 			$ishidden = 0;
447 447
 		}
448
-		$isexpanded = ! $ishidden;
448
+		$isexpanded = !$ishidden;
449 449
 		//var_dump('$obj->module='.$obj->module.' isexpanded='.$isexpanded);
450 450
 
451 451
 		// Break detected, we get objMod
Please login to merge, or discard this patch.
htdocs/user/card.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
 $dateendvalidity = dol_mktime(0, 0, 0, GETPOSTINT('dateendvaliditymonth'), GETPOSTINT('dateendvalidityday'), GETPOSTINT('dateendvalidityyear'));
98 98
 $dateofbirth = dol_mktime(0, 0, 0, GETPOSTINT('dateofbirthmonth'), GETPOSTINT('dateofbirthday'), GETPOSTINT('dateofbirthyear'));
99 99
 
100
-$childids = $user->getAllChildIds(1);	// For test on hrm fields (like salary visibility)
100
+$childids = $user->getAllChildIds(1); // For test on hrm fields (like salary visibility)
101 101
 
102 102
 $object = new User($db);
103 103
 $extrafields = new ExtraFields($db);
@@ -161,8 +161,8 @@  discard block
 block discarded – undo
161 161
 if ($id > 0) {
162 162
 	// $user is the current logged user, $id is the user we want to edit
163 163
 	$permissiontoedit = ((($user->id == $id) && $user->hasRight("user", "self", "write")) || (($user->id != $id) && $user->hasRight("user", "user", "write"))) && (empty($user->socid) || $user->socid == $object->socid);
164
-	$permissiontoeditpasswordandsee = ((($user->id == $id) && $user->hasRight("user", "self", "password")) || (($user->id != $id) && $user->hasRight("user", "user", "password") && $user->admin))&& (empty($user->socid) || $user->socid == $object->socid);
165
-	$permissiontoeditpasswordandsend = ((($user->id == $id) && $user->hasRight("user", "self", "password")) || (($user->id != $id) && $user->hasRight("user", "user", "password")))&& (empty($user->socid) || $user->socid == $object->socid);
164
+	$permissiontoeditpasswordandsee = ((($user->id == $id) && $user->hasRight("user", "self", "password")) || (($user->id != $id) && $user->hasRight("user", "user", "password") && $user->admin)) && (empty($user->socid) || $user->socid == $object->socid);
165
+	$permissiontoeditpasswordandsend = ((($user->id == $id) && $user->hasRight("user", "self", "password")) || (($user->id != $id) && $user->hasRight("user", "user", "password"))) && (empty($user->socid) || $user->socid == $object->socid);
166 166
 }
167 167
 
168 168
 $passwordismodified = false;
@@ -452,7 +452,7 @@  discard block
 block discarded – undo
452 452
 			if (!$error) {
453 453
 				$object->fetch($id);
454 454
 
455
-				$object->oldcopy = clone $object;  // @phan-suppress-current-line PhanTypeMismatchProperty
455
+				$object->oldcopy = clone $object; // @phan-suppress-current-line PhanTypeMismatchProperty
456 456
 
457 457
 				$db->begin();
458 458
 
@@ -577,7 +577,7 @@  discard block
 block discarded – undo
577 577
 						}
578 578
 					}
579 579
 
580
-					$ret = $object->update($user);		// This may include call to setPassword if password has changed
580
+					$ret = $object->update($user); // This may include call to setPassword if password has changed
581 581
 					if ($ret < 0) {
582 582
 						$error++;
583 583
 						if ($db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') {
@@ -700,7 +700,7 @@  discard block
 block discarded – undo
700 700
 				$object->fetch($id);
701 701
 
702 702
 				if (GETPOST("password", "password")) {	// If pass is empty, we do not change it.
703
-					$object->oldcopy = clone $object;  // @phan-suppress-current-line PhanTypeMismatchProperty
703
+					$object->oldcopy = clone $object; // @phan-suppress-current-line PhanTypeMismatchProperty
704 704
 
705 705
 					$ret = $object->setPassword($user, GETPOST("password", "password"));
706 706
 					if (is_int($ret) && $ret < 0) {
@@ -717,7 +717,7 @@  discard block
 block discarded – undo
717 717
 	) {
718 718
 		$object->fetch($id);
719 719
 
720
-		$newpassword = $object->setPassword($user, '');	// This will generate a new password
720
+		$newpassword = $object->setPassword($user, ''); // This will generate a new password
721 721
 		if (is_int($newpassword) && $newpassword < 0) {
722 722
 			// Echec
723 723
 			setEventMessages($langs->trans("ErrorFailedToSetNewPassword"), null, 'errors');
@@ -845,7 +845,7 @@  discard block
 block discarded – undo
845 845
 						$action = "";
846 846
 
847 847
 						$mesg = $langs->trans("ErrorProductAlreadyExists", $clone->ref);
848
-						$mesg .= ' <a href="' . $_SERVER["PHP_SELF"] . '?ref=' . $clone->ref . '">' . $langs->trans("ShowCardHere") . '</a>.';
848
+						$mesg .= ' <a href="'.$_SERVER["PHP_SELF"].'?ref='.$clone->ref.'">'.$langs->trans("ShowCardHere").'</a>.';
849 849
 						setEventMessages($mesg, null, 'errors');
850 850
 					} else {
851 851
 						setEventMessages(empty($clone->error) ? '' : $langs->trans($clone->error), $clone->errors, 'errors');
@@ -859,7 +859,7 @@  discard block
 block discarded – undo
859 859
 				} else {
860 860
 					$db->commit();
861 861
 					$db->close();
862
-					header("Location: " . $_SERVER["PHP_SELF"] . "?id=" . $id);
862
+					header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id);
863 863
 					exit;
864 864
 				}
865 865
 			} else {
@@ -1564,7 +1564,7 @@  discard block
 block discarded – undo
1564 1564
 			$ldap = new Ldap();
1565 1565
 			$result = $ldap->connectBind();
1566 1566
 			if ($result > 0) {
1567
-				$userSearchFilter = '(' . getDolGlobalString('LDAP_FILTER_CONNECTION').'('.$ldap->getUserIdentifier().'='.$object->login.'))';
1567
+				$userSearchFilter = '('.getDolGlobalString('LDAP_FILTER_CONNECTION').'('.$ldap->getUserIdentifier().'='.$object->login.'))';
1568 1568
 				$entries = $ldap->fetch($object->login, $userSearchFilter);
1569 1569
 				if (!$entries) {
1570 1570
 					setEventMessages($ldap->error, $ldap->errors, 'errors');
@@ -2107,7 +2107,7 @@  discard block
 block discarded – undo
2107 2107
 				} else {
2108 2108
 					if (!empty($object->api_key)) {
2109 2109
 						print '<span class="opacitymedium">';
2110
-						print showValueWithClipboardCPButton($object->api_key, 1, $langs->transnoentities("Hidden"));		// TODO Add an option to also reveal the hash, not only copy paste
2110
+						print showValueWithClipboardCPButton($object->api_key, 1, $langs->transnoentities("Hidden")); // TODO Add an option to also reveal the hash, not only copy paste
2111 2111
 						print '</span>';
2112 2112
 					}
2113 2113
 					if (getDolGlobalString('API_ENABLE_COUNT_CALLS') || !empty($dolibarr_api_count_always_enabled)) {
@@ -2177,7 +2177,7 @@  discard block
 block discarded – undo
2177 2177
 						$langs->load("mails");
2178 2178
 						$params['attr']['title'] = $langs->trans('NoEMail');
2179 2179
 					}
2180
-					print dolGetButtonAction('', $langs->trans('SendMail'), 'email', dolBuildUrl($_SERVER['PHP_SELF'], ['id' => $object->id, 'action' => 'presend', 'mode' => 'init']) . '#formmailbeforetitle', '', $canSendMail, $params);
2180
+					print dolGetButtonAction('', $langs->trans('SendMail'), 'email', dolBuildUrl($_SERVER['PHP_SELF'], ['id' => $object->id, 'action' => 'presend', 'mode' => 'init']).'#formmailbeforetitle', '', $canSendMail, $params);
2181 2181
 				}
2182 2182
 
2183 2183
 				if ($permissiontoedit && (!isModEnabled('multicompany') || !$user->entity || ($object->entity == $conf->entity) || (getDolGlobalString('MULTICOMPANY_TRANSVERSE_MODE') && $object->entity == 1))) {
@@ -2242,13 +2242,13 @@  discard block
 block discarded – undo
2242 2242
 				if ($user->id != $id && $permissiontodisable && $object->status == User::STATUS_DISABLED &&
2243 2243
 				((!isModEnabled('multicompany') && $object->entity == $user->entity) || !$user->entity || ($object->entity == $conf->entity) || (getDolGlobalString('MULTICOMPANY_TRANSVERSE_MODE') && $object->entity == 1))) {
2244 2244
 					unset($params['attr']['title']);
2245
-					print dolGetButtonAction($langs->trans('Reactivate'), '', 'default', $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=enable&token='.newToken(), '', true, $params);
2245
+					print dolGetButtonAction($langs->trans('Reactivate'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=enable&token='.newToken(), '', true, $params);
2246 2246
 				}
2247 2247
 				// Disable user
2248 2248
 				if ($user->id != $id && $permissiontodisable && $object->status == User::STATUS_ENABLED &&
2249 2249
 				((!isModEnabled('multicompany') && $object->entity == $user->entity) || !$user->entity || ($object->entity == $conf->entity) || (getDolGlobalString('MULTICOMPANY_TRANSVERSE_MODE') && $object->entity == 1))) {
2250 2250
 					unset($params['attr']['title']);
2251
-					print dolGetButtonAction($langs->trans('DisableUser'), '', 'default', $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=disable&token='.newToken(), '', true, $params);
2251
+					print dolGetButtonAction($langs->trans('DisableUser'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=disable&token='.newToken(), '', true, $params);
2252 2252
 				} else {
2253 2253
 					if ($user->id == $id) {
2254 2254
 						$params['attr']['title'] = $langs->trans('CantDisableYourself');
Please login to merge, or discard this patch.
htdocs/asset/card.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
 		}
129 129
 	}
130 130
 
131
-	$object->oldcopy = dol_clone($object, 2);  // @phan-suppress-current-line PhanTypeMismatchProperty
131
+	$object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty
132 132
 	$triggermodname = 'ASSET_MODIFY'; // Name of trigger action code to execute when we modify record
133 133
 
134 134
 	// Action dispose object
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
 	}
200 200
 	if (GETPOSTISSET('supplier_invoice_id')) {
201 201
 		$object->fields['supplier_invoice_id'] = array('type' => 'integer:FactureFournisseur:fourn/class/fournisseur.facture.class.php:1:entity IN (__SHARED_ENTITIES__)', 'label' => 'SupplierInvoice', 'enabled' => '1', 'noteditable' => 1, 'position' => 280, 'notnull' => 0, 'visible' => 1, 'index' => 1, 'validate' => '1',);
202
-		print '<input type="hidden" name="supplier_invoice_id" value="' . GETPOSTINT('supplier_invoice_id') . '">';
202
+		print '<input type="hidden" name="supplier_invoice_id" value="'.GETPOSTINT('supplier_invoice_id').'">';
203 203
 	}
204 204
 
205 205
 	print dol_get_fiche_head(array(), '');
@@ -284,7 +284,7 @@  discard block
 block discarded – undo
284 284
 
285 285
 		$text = $langs->trans('ConfirmValidateAsset', $numref);
286 286
 		if (isModEnabled('notification')) {
287
-			require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php';
287
+			require_once DOL_DOCUMENT_ROOT.'/core/class/notify.class.php';
288 288
 			$notify = new Notify($db);
289 289
 			$text .= '<br>';
290 290
 			$text .= $notify->confirmMessage('ASSET_VALIDATE', 0, $object);
@@ -324,7 +324,7 @@  discard block
 block discarded – undo
324 324
 			array('type' => 'checkbox', 'name' => 'disposal_depreciated', 'label' => $langs->trans("AssetDisposalDepreciated"), 'value' => $disposal_depreciated),
325 325
 			array('type' => 'checkbox', 'name' => 'disposal_subject_to_vat', 'label' => $langs->trans("AssetDisposalSubjectToVat"), 'value' => $disposal_subject_to_vat),
326 326
 		);
327
-		$formconfirm = $form->formconfirm(dolBuildUrl($_SERVER["PHP_SELF"], ['id' => $object->id]), $langs->trans('AssetDisposal'), $langs->trans('AssetConfirmDisposalAsk', $object->ref . ' - ' . $object->label), 'confirm_disposal', $formquestion, 'yes', 1, 350);
327
+		$formconfirm = $form->formconfirm(dolBuildUrl($_SERVER["PHP_SELF"], ['id' => $object->id]), $langs->trans('AssetDisposal'), $langs->trans('AssetConfirmDisposalAsk', $object->ref.' - '.$object->label), 'confirm_disposal', $formquestion, 'yes', 1, 350);
328 328
 	}
329 329
 
330 330
 	// Confirmation of reopen
@@ -380,7 +380,7 @@  discard block
 block discarded – undo
380 380
 	print '<table class="border centpercent tableforfield">'."\n";
381 381
 
382 382
 	// Common attributes
383
-	$keyforbreak = 'date_acquisition';	// We change column just before this field
383
+	$keyforbreak = 'date_acquisition'; // We change column just before this field
384 384
 	//unset($object->fields['fk_project']);				// Hide field already shown in banner
385 385
 	//unset($object->fields['fk_soc']);					// Hide field already shown in banner
386 386
 	include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php';
@@ -398,7 +398,7 @@  discard block
 block discarded – undo
398 398
 
399 399
 	// Buttons for actions
400 400
 	if ($action != 'presend' && $action != 'editline') {
401
-		print '<div class="tabsAction">' . "\n";
401
+		print '<div class="tabsAction">'."\n";
402 402
 		$parameters = array();
403 403
 		$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
404 404
 		if ($reshook < 0) {
@@ -408,7 +408,7 @@  discard block
 block discarded – undo
408 408
 		if (empty($reshook)) {
409 409
 			// Send
410 410
 			if (empty($user->socid)) {
411
-				print dolGetButtonAction('', $langs->trans('SendMail'), 'email', $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=presend&mode=init&token=' . newToken() . '#formmailbeforetitle');
411
+				print dolGetButtonAction('', $langs->trans('SendMail'), 'email', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=presend&mode=init&token='.newToken().'#formmailbeforetitle');
412 412
 			}
413 413
 
414 414
 			// Back to draft
@@ -420,30 +420,30 @@  discard block
 block discarded – undo
420 420
 
421 421
 			// Modify
422 422
 			if ($object->status == $object::STATUS_DRAFT) {
423
-				print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=edit&token=' . newToken(), '', $permissiontoadd);
423
+				print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit&token='.newToken(), '', $permissiontoadd);
424 424
 			}
425 425
 
426 426
 			// Validate
427 427
 			if ($object->status == $object::STATUS_DRAFT) {
428
-				print dolGetButtonAction($langs->trans('Validate'), '', 'default', $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=validate&token=' . newToken(), '', $permissiontoadd);
428
+				print dolGetButtonAction($langs->trans('Validate'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=validate&token='.newToken(), '', $permissiontoadd);
429 429
 			}
430 430
 
431 431
 			if ($object->status == $object::STATUS_VALIDATED) {
432
-				print dolGetButtonAction($langs->trans('AssetDisposal'), '', 'default', $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=disposal&token=' . newToken(), '', $permissiontoadd);
432
+				print dolGetButtonAction($langs->trans('AssetDisposal'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=disposal&token='.newToken(), '', $permissiontoadd);
433 433
 			}
434 434
 
435 435
 			// Re-open
436 436
 			if ($permissiontoadd && $object->status == $object::STATUS_DISPOSED) {
437
-				print dolGetButtonAction($langs->trans('ReOpen'), '', 'default', $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=reopen&token=' . newToken(), '', $permissiontoadd);
437
+				print dolGetButtonAction($langs->trans('ReOpen'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=reopen&token='.newToken(), '', $permissiontoadd);
438 438
 			}
439 439
 
440 440
 			// Clone
441 441
 			//print dolGetButtonAction($langs->trans('ToClone'), '', 'default', $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=clone&token=' . newToken(), '', false && $permissiontoadd);
442 442
 
443 443
 			// Delete (need delete permission, or if draft, just need create/modify permission)
444
-			print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=delete&token=' . newToken(), '', $permissiontodelete || ($object->status == $object::STATUS_DRAFT && $permissiontoadd));
444
+			print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=delete&token='.newToken(), '', $permissiontodelete || ($object->status == $object::STATUS_DRAFT && $permissiontoadd));
445 445
 		}
446
-		print '</div>' . "\n";
446
+		print '</div>'."\n";
447 447
 	}
448 448
 
449 449
 	// Select mail models is same action as presend
Please login to merge, or discard this patch.
htdocs/core/actions_printing.inc.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -80,7 +80,7 @@
 block discarded – undo
80 80
 				}
81 81
 				try {
82 82
 					// Case of printing an invoice
83
-					$filetoprint = GETPOST('file', 'alpha');		//Example FAYYMM-123/FAYYMM-123-xxx.pdf
83
+					$filetoprint = GETPOST('file', 'alpha'); //Example FAYYMM-123/FAYYMM-123-xxx.pdf
84 84
 					if ($module == 'facture') {
85 85
 						require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
86 86
 						$refinvoice = preg_replace('/[\\\/].*$/', '', $filetoprint);
Please login to merge, or discard this patch.
htdocs/core/class/dolgraph.class.php 1 patch
Spacing   +123 added lines, -123 removed lines patch added patch discarded remove patch
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
 		}
224 224
 
225 225
 		// Load color of the theme
226
-		$color_file = DOL_DOCUMENT_ROOT . '/theme/' . $conf->theme . '/theme_vars.inc.php';
226
+		$color_file = DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/theme_vars.inc.php';
227 227
 		if (is_readable($color_file)) {
228 228
 			include $color_file;
229 229
 			if (isset($theme_bordercolor)) {
@@ -751,7 +751,7 @@  discard block
 block discarded – undo
751 751
 			for ($i = 0; $i < $nbseries; $i++) {	// Loop on each series
752 752
 				if (is_null($max)) {
753 753
 					if (isset($x[$i + 1])) {
754
-						$max = $x[$i + 1];		// $i+1 because the index 0 is the legend
754
+						$max = $x[$i + 1]; // $i+1 because the index 0 is the legend
755 755
 					}
756 756
 				} elseif ($max < $x[$i + 1]) {
757 757
 					$max = $x[$i + 1];
@@ -783,7 +783,7 @@  discard block
 block discarded – undo
783 783
 			for ($i = 0; $i < $nbseries; $i++) {	// Loop on each series
784 784
 				if (is_null($min)) {
785 785
 					if (isset($x[$i + 1])) {
786
-						$min = $x[$i + 1];		// $i+1 because the index 0 is the legend
786
+						$min = $x[$i + 1]; // $i+1 because the index 0 is the legend
787 787
 					}
788 788
 				} elseif ($min > $x[$i + 1]) {
789 789
 					$min = $x[$i + 1];
@@ -862,19 +862,19 @@  discard block
 block discarded – undo
862 862
 	{
863 863
 		if (empty($file)) {
864 864
 			$this->error = "Call to draw method was made with empty value for parameter file.";
865
-			dol_syslog(get_class($this) . "::draw " . $this->error, LOG_ERR);
865
+			dol_syslog(get_class($this)."::draw ".$this->error, LOG_ERR);
866 866
 			return -2;
867 867
 		}
868 868
 		if (!is_array($this->data)) {
869 869
 			$this->error = "Call to draw method was made but SetData was not called or called with an empty dataset for parameters";
870
-			dol_syslog(get_class($this) . "::draw " . $this->error, LOG_ERR);
870
+			dol_syslog(get_class($this)."::draw ".$this->error, LOG_ERR);
871 871
 			return -1;
872 872
 		}
873 873
 		if (count($this->data) < 1) {
874 874
 			$this->error = "Call to draw method was made but SetData was is an empty dataset";
875
-			dol_syslog(get_class($this) . "::draw " . $this->error, LOG_WARNING);
875
+			dol_syslog(get_class($this)."::draw ".$this->error, LOG_WARNING);
876 876
 		}
877
-		$call = "draw_" . $this->_library;	// Example "draw_jflot"
877
+		$call = "draw_".$this->_library; // Example "draw_jflot"
878 878
 
879 879
 		return call_user_func_array(array($this, $call), array($file, $fileurl));
880 880
 	}
@@ -901,7 +901,7 @@  discard block
 block discarded – undo
901 901
 		// phpcs:enable
902 902
 		global $langs;
903 903
 
904
-		dol_syslog(get_class($this) . "::draw_jflot this->type=" . implode(',', $this->type) . " this->MaxValue=" . $this->MaxValue);
904
+		dol_syslog(get_class($this)."::draw_jflot this->type=".implode(',', $this->type)." this->MaxValue=".$this->MaxValue);
905 905
 
906 906
 		if (empty($this->width) && empty($this->height)) {
907 907
 			print 'Error width or height not set';
@@ -924,7 +924,7 @@  discard block
 block discarded – undo
924 924
 		$series = array();
925 925
 		while ($i < $nblot) {	// Loop on each series
926 926
 			$values = array(); // Array with horizontal y values (specific values of a series) for each abscisse x
927
-			$series[$i] = "var d" . $i . " = [];\n";
927
+			$series[$i] = "var d".$i." = [];\n";
928 928
 
929 929
 			// Fill array $values
930 930
 			$x = 0;
@@ -937,13 +937,13 @@  discard block
 block discarded – undo
937 937
 			if (isset($this->type[$firstlot]) && in_array($this->type[$firstlot], array('pie', 'piesemicircle', 'polar'))) {
938 938
 				foreach ($values as $x => $y) {
939 939
 					if (isset($y)) {
940
-						$series[$i] .= 'd' . $i . '.push({"label":"' . dol_escape_js($legends[$x]) . '", "data":' . $y . '});' . "\n";
940
+						$series[$i] .= 'd'.$i.'.push({"label":"'.dol_escape_js($legends[$x]).'", "data":'.$y.'});'."\n";
941 941
 					}
942 942
 				}
943 943
 			} else {
944 944
 				foreach ($values as $x => $y) {
945 945
 					if (isset($y)) {
946
-						$series[$i] .= 'd' . $i . '.push([' . $x . ', ' . $y . ']);' . "\n";
946
+						$series[$i] .= 'd'.$i.'.push(['.$x.', '.$y.']);'."\n";
947 947
 					}
948 948
 				}
949 949
 			}
@@ -953,13 +953,13 @@  discard block
 block discarded – undo
953 953
 		}
954 954
 		$tag = dol_escape_htmltag(dol_string_unaccent(dol_string_nospecial(basename($file), '_', array('-', '.'))));
955 955
 
956
-		$this->stringtoshow = '<!-- Build using jflot -->' . "\n";
956
+		$this->stringtoshow = '<!-- Build using jflot -->'."\n";
957 957
 		if (!empty($this->title)) {
958
-			$this->stringtoshow .= '<div class="center dolgraphtitle' . (empty($this->cssprefix) ? '' : ' dolgraphtitle' . $this->cssprefix) . '">' . $this->title . '</div>';
958
+			$this->stringtoshow .= '<div class="center dolgraphtitle'.(empty($this->cssprefix) ? '' : ' dolgraphtitle'.$this->cssprefix).'">'.$this->title.'</div>';
959 959
 		}
960 960
 		if (!empty($this->shownographyet)) {
961
-			$this->stringtoshow .= '<div style="width:' . $this->width . 'px;height:' . $this->height . 'px;" class="nographyet"></div>';
962
-			$this->stringtoshow .= '<div class="nographyettext margintoponly">' . $langs->trans("NotEnoughDataYet") . '...</div>';
961
+			$this->stringtoshow .= '<div style="width:'.$this->width.'px;height:'.$this->height.'px;" class="nographyet"></div>';
962
+			$this->stringtoshow .= '<div class="nographyettext margintoponly">'.$langs->trans("NotEnoughDataYet").'...</div>';
963 963
 			return;
964 964
 		}
965 965
 
@@ -968,17 +968,17 @@  discard block
 block discarded – undo
968 968
 		if (count($this->data) > 20) {
969 969
 			$dolxaxisvertical = 'dol-xaxis-vertical';
970 970
 		}
971
-		$this->stringtoshow .= '<div id="placeholder_' . $tag . '" style="width:' . $this->width . 'px;height:' . $this->height . 'px;" class="dolgraph' . (empty($dolxaxisvertical) ? '' : ' ' . $dolxaxisvertical) . (empty($this->cssprefix) ? '' : ' dolgraph' . $this->cssprefix) . ' center"></div>' . "\n";
971
+		$this->stringtoshow .= '<div id="placeholder_'.$tag.'" style="width:'.$this->width.'px;height:'.$this->height.'px;" class="dolgraph'.(empty($dolxaxisvertical) ? '' : ' '.$dolxaxisvertical).(empty($this->cssprefix) ? '' : ' dolgraph'.$this->cssprefix).' center"></div>'."\n";
972 972
 
973
-		$this->stringtoshow .= '<script nonce="'.getNonce().'" id="' . $tag . '">' . "\n";
974
-		$this->stringtoshow .= '$(function () {' . "\n";
973
+		$this->stringtoshow .= '<script nonce="'.getNonce().'" id="'.$tag.'">'."\n";
974
+		$this->stringtoshow .= '$(function () {'."\n";
975 975
 		$i = $firstlot;
976 976
 		if ($nblot < 0) {
977
-			$this->stringtoshow .= '<!-- No series of data -->' . "\n";
977
+			$this->stringtoshow .= '<!-- No series of data -->'."\n";
978 978
 		} else {
979 979
 			while ($i < $nblot) {
980
-				$this->stringtoshow .= '<!-- Series ' . $i . ' -->' . "\n";
981
-				$this->stringtoshow .= $series[$i] . "\n";
980
+				$this->stringtoshow .= '<!-- Series '.$i.' -->'."\n";
981
+				$this->stringtoshow .= $series[$i]."\n";
982 982
 				$i++;
983 983
 			}
984 984
 		}
@@ -989,9 +989,9 @@  discard block
 block discarded – undo
989 989
 			$datacolor = array();
990 990
 			foreach ($this->datacolor as $val) {
991 991
 				if (is_array($val)) {
992
-					$datacolor[] = "#" . sprintf("%02x%02x%02x", $val[0], $val[1], $val[2]); // If datacolor is array(R, G, B)
992
+					$datacolor[] = "#".sprintf("%02x%02x%02x", $val[0], $val[1], $val[2]); // If datacolor is array(R, G, B)
993 993
 				} else {
994
-					$datacolor[] = "#" . str_replace(array('#', '-'), '', $val); // If $val is '124' or '#124'
994
+					$datacolor[] = "#".str_replace(array('#', '-'), '', $val); // If $val is '124' or '#124'
995 995
 				}
996 996
 			}
997 997
 
@@ -1001,8 +1001,8 @@  discard block
 block discarded – undo
1001 1001
 			$showpercent = $this->showpercent;
1002 1002
 
1003 1003
 			$this->stringtoshow .= '
1004
-			function plotWithOptions_' . $tag . '() {
1005
-			$.plot($("#placeholder_' . $tag . '"), d0,
1004
+			function plotWithOptions_' . $tag.'() {
1005
+			$.plot($("#placeholder_' . $tag.'"), d0,
1006 1006
 			{
1007 1007
 				series: {
1008 1008
 					pie: {
@@ -1010,8 +1010,8 @@  discard block
 block discarded – undo
1010 1010
 						radius: 0.8,
1011 1011
 						' . ($this->combine ? '
1012 1012
 						combine: {
1013
-						 	threshold: ' . $this->combine . '
1014
-						},' : '') . '
1013
+						 	threshold: ' . $this->combine.'
1014
+						},' : '').'
1015 1015
 						label: {
1016 1016
 							show: true,
1017 1017
 							radius: 0.9,
@@ -1021,7 +1021,7 @@  discard block
 block discarded – undo
1021 1021
 								return \'';
1022 1022
 			$this->stringtoshow .= '<span style="font-size:8pt;text-align:center;padding:2px;color:black;">';
1023 1023
 			if ($urltemp) {
1024
-				$this->stringtoshow .= '<a style="color: #FFFFFF;" border="0" href="' . $urltemp . '">';
1024
+				$this->stringtoshow .= '<a style="color: #FFFFFF;" border="0" href="'.$urltemp.'">';
1025 1025
 			}
1026 1026
 			$this->stringtoshow .= '\'+';
1027 1027
 			$this->stringtoshow .= ($showlegend ? '' : 'label+\' \'+'); // Hide label if already shown in legend
@@ -1047,9 +1047,9 @@  discard block
 block discarded – undo
1047 1047
 				interactive: true
1048 1048
 			},';
1049 1049
 			if (count($datacolor)) {
1050
-				$this->stringtoshow .= 'colors: ' . json_encode($datacolor) . ',';
1050
+				$this->stringtoshow .= 'colors: '.json_encode($datacolor).',';
1051 1051
 			}
1052
-			$this->stringtoshow .= 'legend: {show: ' . ($showlegend ? 'true' : 'false') . ', position: \'ne\' }
1052
+			$this->stringtoshow .= 'legend: {show: '.($showlegend ? 'true' : 'false').', position: \'ne\' }
1053 1053
 		});
1054 1054
 		}' . "\n";
1055 1055
 		} else {
@@ -1057,8 +1057,8 @@  discard block
 block discarded – undo
1057 1057
 			// Add code to support tooltips
1058 1058
 			// TODO: remove js css and use graph-tooltip-inner class instead by adding css in each themes
1059 1059
 			$this->stringtoshow .= '
1060
-			function showTooltip_' . $tag . '(x, y, contents) {
1061
-				$(\'<div class="graph-tooltip-inner" id="tooltip_' . $tag . '">\' + contents + \'</div>\').css({
1060
+			function showTooltip_' . $tag.'(x, y, contents) {
1061
+				$(\'<div class="graph-tooltip-inner" id="tooltip_' . $tag.'">\' + contents + \'</div>\').css({
1062 1062
 					position: \'absolute\',
1063 1063
 					display: \'none\',
1064 1064
 					top: y + 10,
@@ -1074,7 +1074,7 @@  discard block
 block discarded – undo
1074 1074
 			}
1075 1075
 
1076 1076
 			var previousPoint = null;
1077
-			$("#placeholder_' . $tag . '").bind("plothover", function (event, pos, item) {
1077
+			$("#placeholder_' . $tag.'").bind("plothover", function (event, pos, item) {
1078 1078
 				$("#x").text(pos.x.toFixed(2));
1079 1079
 				$("#y").text(pos.y.toFixed(2));
1080 1080
 
@@ -1090,27 +1090,27 @@  discard block
 block discarded – undo
1090 1090
 						';
1091 1091
 			if ($this->showpointvalue > 0) {
1092 1092
 				$this->stringtoshow .= '
1093
-							showTooltip_' . $tag . '(item.pageX, item.pageY, item.series.label + "<br>" + z + " => " + y);
1093
+							showTooltip_' . $tag.'(item.pageX, item.pageY, item.series.label + "<br>" + z + " => " + y);
1094 1094
 						';
1095 1095
 			}
1096 1096
 			$this->stringtoshow .= '
1097 1097
 					}
1098 1098
 				}
1099 1099
 				else {
1100
-					$("#tooltip_' . $tag . '").remove();
1100
+					$("#tooltip_' . $tag.'").remove();
1101 1101
 					previousPoint = null;
1102 1102
 				}
1103 1103
 			});
1104 1104
 			';
1105 1105
 
1106
-			$this->stringtoshow .= 'var stack = null, steps = false;' . "\n";
1106
+			$this->stringtoshow .= 'var stack = null, steps = false;'."\n";
1107 1107
 
1108
-			$this->stringtoshow .= 'function plotWithOptions_' . $tag . '() {' . "\n";
1109
-			$this->stringtoshow .= '$.plot($("#placeholder_' . $tag . '"), [ ' . "\n";
1108
+			$this->stringtoshow .= 'function plotWithOptions_'.$tag.'() {'."\n";
1109
+			$this->stringtoshow .= '$.plot($("#placeholder_'.$tag.'"), [ '."\n";
1110 1110
 			$i = $firstlot;
1111 1111
 			while ($i < $nblot) {
1112 1112
 				if ($i > $firstlot) {
1113
-					$this->stringtoshow .= ', ' . "\n";
1113
+					$this->stringtoshow .= ', '."\n";
1114 1114
 				}
1115 1115
 				$color = sprintf("%02x%02x%02x", $this->datacolor[$i][0], $this->datacolor[$i][1], $this->datacolor[$i][2]);
1116 1116
 				$this->stringtoshow .= '{ ';
@@ -1123,46 +1123,46 @@  discard block
 block discarded – undo
1123 1123
 						} else {
1124 1124
 							$align = 'left';
1125 1125
 						}
1126
-						$this->stringtoshow .= 'bars: { lineWidth: 1, show: true, align: "' . $align . '", barWidth: 0.45 }, ';
1126
+						$this->stringtoshow .= 'bars: { lineWidth: 1, show: true, align: "'.$align.'", barWidth: 0.45 }, ';
1127 1127
 					} else {
1128
-						$this->stringtoshow .= 'bars: { lineWidth: 1, show: true, align: "' . ($i == $firstlot ? 'center' : 'left') . '", barWidth: 0.5 }, ';
1128
+						$this->stringtoshow .= 'bars: { lineWidth: 1, show: true, align: "'.($i == $firstlot ? 'center' : 'left').'", barWidth: 0.5 }, ';
1129 1129
 					}
1130 1130
 				}
1131 1131
 				if (isset($this->type[$i]) && ($this->type[$i] == 'lines' || $this->type[$i] == 'linesnopoint')) {
1132
-					$this->stringtoshow .= 'lines: { show: true, fill: false }, points: { show: ' . ($this->type[$i] == 'linesnopoint' ? 'false' : 'true') . ' }, ';
1132
+					$this->stringtoshow .= 'lines: { show: true, fill: false }, points: { show: '.($this->type[$i] == 'linesnopoint' ? 'false' : 'true').' }, ';
1133 1133
 				}
1134
-				$this->stringtoshow .= 'color: "#' . $color . '", label: "' . (isset($this->Legend[$i]) ? dol_escape_js($this->Legend[$i]) : '') . '", data: d' . $i . ' }';
1134
+				$this->stringtoshow .= 'color: "#'.$color.'", label: "'.(isset($this->Legend[$i]) ? dol_escape_js($this->Legend[$i]) : '').'", data: d'.$i.' }';
1135 1135
 				$i++;
1136 1136
 			}
1137 1137
 			// shadowSize: 0 -> Drawing is faster without shadows
1138
-			$this->stringtoshow .= "\n" . ' ], { series: { shadowSize: 0, stack: stack, lines: { fill: false, steps: steps }, bars: { barWidth: 0.6,  fillColor: { colors: [{opacity: 0.9 }, {opacity: 0.85}] }} }' . "\n";
1138
+			$this->stringtoshow .= "\n".' ], { series: { shadowSize: 0, stack: stack, lines: { fill: false, steps: steps }, bars: { barWidth: 0.6,  fillColor: { colors: [{opacity: 0.9 }, {opacity: 0.85}] }} }'."\n";
1139 1139
 
1140 1140
 			// Xaxis
1141
-			$this->stringtoshow .= ', xaxis: { ticks: [' . "\n";
1141
+			$this->stringtoshow .= ', xaxis: { ticks: ['."\n";
1142 1142
 			$x = 0;
1143 1143
 			foreach ($this->data as $key => $valarray) {
1144 1144
 				if ($x > 0) {
1145
-					$this->stringtoshow .= ', ' . "\n";
1145
+					$this->stringtoshow .= ', '."\n";
1146 1146
 				}
1147
-				$this->stringtoshow .= ' [' . $x . ', "' . $valarray[0] . '"]';
1147
+				$this->stringtoshow .= ' ['.$x.', "'.$valarray[0].'"]';
1148 1148
 				$x++;
1149 1149
 			}
1150
-			$this->stringtoshow .= '] }' . "\n";
1150
+			$this->stringtoshow .= '] }'."\n";
1151 1151
 
1152 1152
 			// Yaxis
1153
-			$this->stringtoshow .= ', yaxis: { min: ' . $this->MinValue . ', max: ' . ($this->MaxValue) . ' }' . "\n";
1153
+			$this->stringtoshow .= ', yaxis: { min: '.$this->MinValue.', max: '.($this->MaxValue).' }'."\n";
1154 1154
 
1155 1155
 			// Background color
1156 1156
 			$color1 = sprintf("%02x%02x%02x", $this->bgcolorgrid[0], $this->bgcolorgrid[0], $this->bgcolorgrid[2]);
1157 1157
 			$color2 = sprintf("%02x%02x%02x", $this->bgcolorgrid[0], $this->bgcolorgrid[1], $this->bgcolorgrid[2]);
1158
-			$this->stringtoshow .= ', grid: { hoverable: true, backgroundColor: { colors: ["#' . $color1 . '", "#' . $color2 . '"] }, borderWidth: 1, borderColor: \'#e6e6e6\', tickColor  : \'#e6e6e6\' }' . "\n";
1159
-			$this->stringtoshow .= '});' . "\n";
1160
-			$this->stringtoshow .= '}' . "\n";
1158
+			$this->stringtoshow .= ', grid: { hoverable: true, backgroundColor: { colors: ["#'.$color1.'", "#'.$color2.'"] }, borderWidth: 1, borderColor: \'#e6e6e6\', tickColor  : \'#e6e6e6\' }'."\n";
1159
+			$this->stringtoshow .= '});'."\n";
1160
+			$this->stringtoshow .= '}'."\n";
1161 1161
 		}
1162 1162
 
1163
-		$this->stringtoshow .= 'plotWithOptions_' . $tag . '();' . "\n";
1164
-		$this->stringtoshow .= '});' . "\n";
1165
-		$this->stringtoshow .= '</script>' . "\n";
1163
+		$this->stringtoshow .= 'plotWithOptions_'.$tag.'();'."\n";
1164
+		$this->stringtoshow .= '});'."\n";
1165
+		$this->stringtoshow .= '</script>'."\n";
1166 1166
 	}
1167 1167
 
1168 1168
 
@@ -1188,7 +1188,7 @@  discard block
 block discarded – undo
1188 1188
 		// phpcs:enable
1189 1189
 		global $langs;
1190 1190
 
1191
-		dol_syslog(get_class($this) . "::draw_chart this->type=" . implode(',', $this->type) . " this->MaxValue=" . $this->MaxValue);
1191
+		dol_syslog(get_class($this)."::draw_chart this->type=".implode(',', $this->type)." this->MaxValue=".$this->MaxValue);
1192 1192
 
1193 1193
 		if (empty($this->width) && empty($this->height)) {
1194 1194
 			print 'Error width or height not set';
@@ -1231,15 +1231,15 @@  discard block
 block discarded – undo
1231 1231
 				$alabelexists = 1;
1232 1232
 				$tmpykey = explode('_', (string) ($array_of_ykeys[$i + ($alabelexists ? 1 : 0)]), 3);
1233 1233
 				if (isset($tmpykey[2]) && (!empty($tmpykey[2]) || $tmpykey[2] == '0')) {		// This is a 'Group by' array
1234
-					$tmpvalue = (array_key_exists('y_' . $tmpykey[1] . '_' . $tmpykey[2], $valarray) ? $valarray['y_' . $tmpykey[1] . '_' . $tmpykey[2]] : $valarray[$i + 1]);
1234
+					$tmpvalue = (array_key_exists('y_'.$tmpykey[1].'_'.$tmpykey[2], $valarray) ? $valarray['y_'.$tmpykey[1].'_'.$tmpykey[2]] : $valarray[$i + 1]);
1235 1235
 					$values[$x] = (is_numeric($tmpvalue) ? $tmpvalue : null);
1236 1236
 					$arrayofgroupslegend[$i] = array(
1237 1237
 						'stacknum' => (int) $tmpykey[1],
1238 1238
 						'legend' => $this->Legend[$tmpykey[1]] ?? '',
1239
-						'legendwithgroup' => ($this->Legend[$tmpykey[1]] ?? '') . ' - ' . $tmpykey[2]
1239
+						'legendwithgroup' => ($this->Legend[$tmpykey[1]] ?? '').' - '.$tmpykey[2]
1240 1240
 					);
1241 1241
 				} else {
1242
-					$tmpvalue = (array_key_exists('y_' . $i, $valarray) ? $valarray['y_' . $i] : $valarray[$i + 1]);
1242
+					$tmpvalue = (array_key_exists('y_'.$i, $valarray) ? $valarray['y_'.$i] : $valarray[$i + 1]);
1243 1243
 					//var_dump($i.'_'.$x.'_'.$tmpvalue);
1244 1244
 					$values[$x] = (is_numeric($tmpvalue) ? $tmpvalue : null);
1245 1245
 				}
@@ -1249,9 +1249,9 @@  discard block
 block discarded – undo
1249 1249
 			$j = 0;
1250 1250
 			foreach ($values as $x => $y) {
1251 1251
 				if (isset($y)) {
1252
-					$series[$i] .= ($j > 0 ? ", " : "") . $y;
1252
+					$series[$i] .= ($j > 0 ? ", " : "").$y;
1253 1253
 				} else {
1254
-					$series[$i] .= ($j > 0 ? ", " : "") . 'null';
1254
+					$series[$i] .= ($j > 0 ? ", " : "").'null';
1255 1255
 				}
1256 1256
 				$j++;
1257 1257
 			}
@@ -1264,13 +1264,13 @@  discard block
 block discarded – undo
1264 1264
 
1265 1265
 		$tag = dol_escape_htmltag(dol_string_unaccent(dol_string_nospecial(basename($file), '_', array('-', '.'))));
1266 1266
 
1267
-		$this->stringtoshow = '<!-- Build using chart -->' . "\n";
1267
+		$this->stringtoshow = '<!-- Build using chart -->'."\n";
1268 1268
 		if (!empty($this->title)) {
1269
-			$this->stringtoshow .= '<div class="center dolgraphtitle' . (empty($this->cssprefix) ? '' : ' dolgraphtitle' . $this->cssprefix) . '">' . $this->title . '</div>';
1269
+			$this->stringtoshow .= '<div class="center dolgraphtitle'.(empty($this->cssprefix) ? '' : ' dolgraphtitle'.$this->cssprefix).'">'.$this->title.'</div>';
1270 1270
 		}
1271 1271
 		if (!empty($this->shownographyet)) {
1272
-			$this->stringtoshow .= '<div style="width:' . $this->width . (strpos($this->width, '%') > 0 ? '' : 'px') . '; height:' . $this->height . 'px;" class="nographyet"></div>';
1273
-			$this->stringtoshow .= '<div class="nographyettext margintoponly">' . $langs->trans("NotEnoughDataYet") . '...</div>';
1272
+			$this->stringtoshow .= '<div style="width:'.$this->width.(strpos($this->width, '%') > 0 ? '' : 'px').'; height:'.$this->height.'px;" class="nographyet"></div>';
1273
+			$this->stringtoshow .= '<div class="nographyettext margintoponly">'.$langs->trans("NotEnoughDataYet").'...</div>';
1274 1274
 			return;
1275 1275
 		}
1276 1276
 
@@ -1282,12 +1282,12 @@  discard block
 block discarded – undo
1282 1282
 		// No height for the pie graph
1283 1283
 		$cssfordiv = 'dolgraphchart';
1284 1284
 		if (isset($this->type[$firstlot])) {
1285
-			$cssfordiv .= ' dolgraphchar' . $this->type[$firstlot];
1285
+			$cssfordiv .= ' dolgraphchar'.$this->type[$firstlot];
1286 1286
 		}
1287
-		$this->stringtoshow .= '<div id="placeholder_'.$tag.'" style="min-height: '.$this->height.(strpos((string) $this->height, '%') > 0 ? '' : 'px').'; max-height: '.(strpos((string) $this->height, '%') > 0 ? $this->height : ((int) $this->height + 100) . 'px').'; width:'.$this->width.(strpos((string) $this->width, '%') > 0 ? '' : 'px').';" class="'.$cssfordiv.' dolgraph'.(empty($dolxaxisvertical) ? '' : ' '.$dolxaxisvertical).(empty($this->cssprefix) ? '' : ' dolgraph'.$this->cssprefix).' center">'."\n";
1287
+		$this->stringtoshow .= '<div id="placeholder_'.$tag.'" style="min-height: '.$this->height.(strpos((string) $this->height, '%') > 0 ? '' : 'px').'; max-height: '.(strpos((string) $this->height, '%') > 0 ? $this->height : ((int) $this->height + 100).'px').'; width:'.$this->width.(strpos((string) $this->width, '%') > 0 ? '' : 'px').';" class="'.$cssfordiv.' dolgraph'.(empty($dolxaxisvertical) ? '' : ' '.$dolxaxisvertical).(empty($this->cssprefix) ? '' : ' dolgraph'.$this->cssprefix).' center">'."\n";
1288 1288
 		$this->stringtoshow .= '<canvas id="canvas_'.$tag.'"></canvas></div>'."\n";
1289 1289
 
1290
-		$this->stringtoshow .= '<script nonce="'.getNonce().'" id="' . $tag . '">' . "\n";
1290
+		$this->stringtoshow .= '<script nonce="'.getNonce().'" id="'.$tag.'">'."\n";
1291 1291
 		$i = $firstlot;
1292 1292
 		if ($nblot < 0) {
1293 1293
 			$this->stringtoshow .= '<!-- No series of data -->';
@@ -1313,11 +1313,11 @@  discard block
 block discarded – undo
1313 1313
 			if (empty($showlegend)) {
1314 1314
 				$this->stringtoshow .= 'legend: { display: false }, ';
1315 1315
 			} else {
1316
-				$this->stringtoshow .= 'legend: { labels: { boxWidth: 15 }, position: \'' . ($showlegend == 2 ? 'right' : 'top') . '\'';
1316
+				$this->stringtoshow .= 'legend: { labels: { boxWidth: 15 }, position: \''.($showlegend == 2 ? 'right' : 'top').'\'';
1317 1317
 				if (!empty($legendMaxLines)) {
1318
-					$this->stringtoshow .= ', maxLines: ' . $legendMaxLines;
1318
+					$this->stringtoshow .= ', maxLines: '.$legendMaxLines;
1319 1319
 				}
1320
-				$this->stringtoshow .= ' }, ' . "\n";
1320
+				$this->stringtoshow .= ' }, '."\n";
1321 1321
 			}
1322 1322
 
1323 1323
 			/* For Chartjs v3.5 */
@@ -1325,50 +1325,50 @@  discard block
 block discarded – undo
1325 1325
 			if (empty($showlegend)) {
1326 1326
 				$this->stringtoshow .= 'legend: { display: false }, ';
1327 1327
 			} else {
1328
-				$this->stringtoshow .= 'legend: { labels: { boxWidth: 15 }, position: \'' . ($showlegend == 2 ? 'right' : 'top') . '\'';
1328
+				$this->stringtoshow .= 'legend: { labels: { boxWidth: 15 }, position: \''.($showlegend == 2 ? 'right' : 'top').'\'';
1329 1329
 				if (!empty($legendMaxLines)) {
1330
-					$this->stringtoshow .= ', maxLines: ' . $legendMaxLines;
1330
+					$this->stringtoshow .= ', maxLines: '.$legendMaxLines;
1331 1331
 				}
1332
-				$this->stringtoshow .= ' }, ' . "\n";
1332
+				$this->stringtoshow .= ' }, '."\n";
1333 1333
 			}
1334
-			$this->stringtoshow .= ' }, ' . "\n";
1334
+			$this->stringtoshow .= ' }, '."\n";
1335 1335
 
1336 1336
 
1337 1337
 			if ($this->type[$firstlot] == 'piesemicircle') {
1338
-				$this->stringtoshow .= 'circumference: Math.PI,' . "\n";
1339
-				$this->stringtoshow .= 'rotation: -Math.PI,' . "\n";
1338
+				$this->stringtoshow .= 'circumference: Math.PI,'."\n";
1339
+				$this->stringtoshow .= 'rotation: -Math.PI,'."\n";
1340 1340
 			}
1341
-			$this->stringtoshow .= 'elements: { arc: {' . "\n";
1341
+			$this->stringtoshow .= 'elements: { arc: {'."\n";
1342 1342
 			// Color of each arc
1343 1343
 			$this->stringtoshow .= 'backgroundColor: [';
1344 1344
 			$i = 0;
1345 1345
 			$foundnegativecolor = 0;
1346 1346
 			foreach ($legends as $val) {	// Loop on each series
1347 1347
 				if ($i > 0) {
1348
-					$this->stringtoshow .= ', ' . "\n";
1348
+					$this->stringtoshow .= ', '."\n";
1349 1349
 				}
1350 1350
 				if (is_array($this->datacolor[$i])) {
1351
-					$color = 'rgb(' . $this->datacolor[$i][0] . ', ' . $this->datacolor[$i][1] . ', ' . $this->datacolor[$i][2] . ')'; // If datacolor is array(R, G, B)
1351
+					$color = 'rgb('.$this->datacolor[$i][0].', '.$this->datacolor[$i][1].', '.$this->datacolor[$i][2].')'; // If datacolor is array(R, G, B)
1352 1352
 				} else {
1353 1353
 					$tmp = str_replace('#', '', $this->datacolor[$i]);
1354 1354
 					if (strpos($tmp, '-') !== false) {
1355 1355
 						$foundnegativecolor++;
1356 1356
 						$color = 'rgba(0,0,0,.0)'; // If $val is '-123'
1357 1357
 					} else {
1358
-						$color = "#" . $tmp; // If $val is '123' or '#123'
1358
+						$color = "#".$tmp; // If $val is '123' or '#123'
1359 1359
 					}
1360 1360
 				}
1361
-				$this->stringtoshow .= "'" . $color . "'";
1361
+				$this->stringtoshow .= "'".$color."'";
1362 1362
 				$i++;
1363 1363
 			}
1364
-			$this->stringtoshow .= '], ' . "\n";
1364
+			$this->stringtoshow .= '], '."\n";
1365 1365
 			// Border color
1366 1366
 			if ($foundnegativecolor) {
1367 1367
 				$this->stringtoshow .= 'borderColor: [';
1368 1368
 				$i = 0;
1369 1369
 				foreach ($legends as $val) {	// Loop on each series
1370 1370
 					if ($i > 0) {
1371
-						$this->stringtoshow .= ', ' . "\n";
1371
+						$this->stringtoshow .= ', '."\n";
1372 1372
 					}
1373 1373
 					if ($this->datacolor !== null) {
1374 1374
 						$datacolor_item = $this->datacolor[$i];
@@ -1381,23 +1381,23 @@  discard block
 block discarded – undo
1381 1381
 					} else {
1382 1382
 						$tmpcolor = str_replace('#', '', $datacolor_item);
1383 1383
 						if (strpos($tmpcolor, '-') !== false) {
1384
-							$color = '#' . str_replace('-', '', $tmpcolor); // If $val is '-123'
1384
+							$color = '#'.str_replace('-', '', $tmpcolor); // If $val is '-123'
1385 1385
 						} else {
1386 1386
 							$color = 'null'; // If $val is '123' or '#123'
1387 1387
 						}
1388 1388
 					}
1389
-					$this->stringtoshow .= ($color == 'null' ? "'rgba(0,0,0,0.2)'" : "'" . $color . "'");
1389
+					$this->stringtoshow .= ($color == 'null' ? "'rgba(0,0,0,0.2)'" : "'".$color."'");
1390 1390
 					$i++;
1391 1391
 				}
1392 1392
 				$this->stringtoshow .= ']';
1393 1393
 			}
1394
-			$this->stringtoshow .= '} } };' . "\n";
1394
+			$this->stringtoshow .= '} } };'."\n";
1395 1395
 
1396 1396
 			$this->stringtoshow .= '
1397
-				var ctx = document.getElementById("canvas_' . $tag . '").getContext("2d");
1397
+				var ctx = document.getElementById("canvas_' . $tag.'").getContext("2d");
1398 1398
 				var chart = new Chart(ctx, {
1399 1399
 			    // The type of chart we want to create
1400
-    			type: \'' . (in_array($type, array('pie', 'piesemicircle')) ? 'doughnut' : 'polarArea') . '\',
1400
+    			type: \'' . (in_array($type, array('pie', 'piesemicircle')) ? 'doughnut' : 'polarArea').'\',
1401 1401
 				// Configuration options go here
1402 1402
     			options: options,
1403 1403
 				data: {
@@ -1408,7 +1408,7 @@  discard block
 block discarded – undo
1408 1408
 				if ($i > 0) {
1409 1409
 					$this->stringtoshow .= ', ';
1410 1410
 				}
1411
-				$this->stringtoshow .= "'" . dol_escape_js(dol_trunc($val, 25)) . "'";	// Lower than 25 make some important label (that we can't shorten) to be truncated
1411
+				$this->stringtoshow .= "'".dol_escape_js(dol_trunc($val, 25))."'"; // Lower than 25 make some important label (that we can't shorten) to be truncated
1412 1412
 				$i++;
1413 1413
 			}
1414 1414
 
@@ -1416,21 +1416,21 @@  discard block
 block discarded – undo
1416 1416
 					datasets: [';
1417 1417
 			$i = 0;
1418 1418
 			while ($i < $nblot) {	// Loop on each series
1419
-				$color = 'rgb(' . $this->datacolor[$i][0] . ', ' . $this->datacolor[$i][1] . ', ' . $this->datacolor[$i][2] . ')';
1419
+				$color = 'rgb('.$this->datacolor[$i][0].', '.$this->datacolor[$i][1].', '.$this->datacolor[$i][2].')';
1420 1420
 
1421 1421
 				if ($i > 0) {
1422
-					$this->stringtoshow .= ', ' . "\n";
1422
+					$this->stringtoshow .= ', '."\n";
1423 1423
 				}
1424
-				$this->stringtoshow .= '{' . "\n";
1424
+				$this->stringtoshow .= '{'."\n";
1425 1425
 				//$this->stringtoshow .= 'borderColor: \''.$color.'\', ';
1426 1426
 				//$this->stringtoshow .= 'backgroundColor: \''.$color.'\', ';
1427
-				$this->stringtoshow .= '  data: [' . $series[$i] . ']';
1428
-				$this->stringtoshow .= '}' . "\n";
1427
+				$this->stringtoshow .= '  data: ['.$series[$i].']';
1428
+				$this->stringtoshow .= '}'."\n";
1429 1429
 				$i++;
1430 1430
 			}
1431
-			$this->stringtoshow .= ']' . "\n";
1432
-			$this->stringtoshow .= '}' . "\n";
1433
-			$this->stringtoshow .= '});' . "\n";
1431
+			$this->stringtoshow .= ']'."\n";
1432
+			$this->stringtoshow .= '}'."\n";
1433
+			$this->stringtoshow .= '});'."\n";
1434 1434
 		} else {
1435 1435
 			// Other cases, graph of type 'bars', 'lines', 'linesnopoint'
1436 1436
 			$type = 'bar';
@@ -1464,7 +1464,7 @@  discard block
 block discarded – undo
1464 1464
 			if (empty($showlegend)) {
1465 1465
 				$this->stringtoshow .= 'legend: { display: false }, '."\n";
1466 1466
 			} else {
1467
-				$this->stringtoshow .= 'legend: { maxWidth: '.round(intval($this->width) / 2).', labels: { boxWidth: 15 }, position: \'' . (($showlegend && $showlegend == 2) ? 'right' : 'top') . '\' },'."\n";
1467
+				$this->stringtoshow .= 'legend: { maxWidth: '.round(intval($this->width) / 2).', labels: { boxWidth: 15 }, position: \''.(($showlegend && $showlegend == 2) ? 'right' : 'top').'\' },'."\n";
1468 1468
 			}
1469 1469
 			if (is_array($this->tooltipsLabels) || is_array($this->tooltipsTitles)) {
1470 1470
 				$this->stringtoshow .= 'tooltip: { mode: \'nearest\',
@@ -1522,10 +1522,10 @@  discard block
 block discarded – undo
1522 1522
 			}
1523 1523
 			$this->stringtoshow .= '};';
1524 1524
 			$this->stringtoshow .= '
1525
-				var ctx = document.getElementById("canvas_' . $tag . '").getContext("2d");
1525
+				var ctx = document.getElementById("canvas_' . $tag.'").getContext("2d");
1526 1526
 				var chart = new Chart(ctx, {
1527 1527
 			    // The type of chart we want to create
1528
-    			type: \'' . $type . '\',
1528
+    			type: \'' . $type.'\',
1529 1529
 				// Configuration options go here
1530 1530
     			options: options,
1531 1531
 				data: {
@@ -1536,7 +1536,7 @@  discard block
 block discarded – undo
1536 1536
 				if ($i > 0) {
1537 1537
 					$this->stringtoshow .= ', ';
1538 1538
 				}
1539
-				$this->stringtoshow .= "'" . dol_escape_js(dol_trunc($val, 32)) . "'";
1539
+				$this->stringtoshow .= "'".dol_escape_js(dol_trunc($val, 32))."'";
1540 1540
 				$i++;
1541 1541
 			}
1542 1542
 
@@ -1594,19 +1594,19 @@  discard block
 block discarded – undo
1594 1594
 					}
1595 1595
 					$oldstacknum = $arrayofgroupslegend[$i]['stacknum'];
1596 1596
 
1597
-					$color = 'rgb(' . $newcolor[0] . ', ' . $newcolor[1] . ', ' . $newcolor[2] . ', 0.9)';
1598
-					$bordercolor = 'rgb(' . $newcolor[0] . ', ' . $newcolor[1] . ', ' . $newcolor[2] . ')';
1597
+					$color = 'rgb('.$newcolor[0].', '.$newcolor[1].', '.$newcolor[2].', 0.9)';
1598
+					$bordercolor = 'rgb('.$newcolor[0].', '.$newcolor[1].', '.$newcolor[2].')';
1599 1599
 				} else { // We do not use a 'group by'
1600 1600
 					if (!empty($this->datacolor[$i])) {
1601 1601
 						if (is_array($this->datacolor[$i])) {
1602
-							$color = 'rgb(' . $this->datacolor[$i][0] . ', ' . $this->datacolor[$i][1] . ', ' . $this->datacolor[$i][2] . ', 0.9)';
1602
+							$color = 'rgb('.$this->datacolor[$i][0].', '.$this->datacolor[$i][1].', '.$this->datacolor[$i][2].', 0.9)';
1603 1603
 						} else {
1604 1604
 							$color = $this->datacolor[$i];
1605 1605
 						}
1606 1606
 					}
1607 1607
 					// else: $color will be undefined
1608 1608
 					if (!empty($this->bordercolor[$i]) && is_array($this->bordercolor[$i])) {
1609
-						$bordercolor = 'rgb(' . $this->bordercolor[$i][0] . ', ' . $this->bordercolor[$i][1] . ', ' . $this->bordercolor[$i][2] . ', 0.9)';
1609
+						$bordercolor = 'rgb('.$this->bordercolor[$i][0].', '.$this->bordercolor[$i][1].', '.$this->bordercolor[$i][2].', 0.9)';
1610 1610
 					} else {
1611 1611
 						if ($type != 'horizontalBar') {
1612 1612
 							$bordercolor = $color;
@@ -1628,34 +1628,34 @@  discard block
 block discarded – undo
1628 1628
 				}
1629 1629
 				$this->stringtoshow .= "\n";
1630 1630
 				$this->stringtoshow .= '{';
1631
-				$this->stringtoshow .= 'dolibarrinfo: \'y_' . $i . '\', ';
1632
-				$this->stringtoshow .= 'label: \'' . dol_escape_js(dol_string_nohtmltag($textoflegend)) . '\', ';
1633
-				$this->stringtoshow .= 'pointStyle: \'' . ((!empty($this->type[$i]) && $this->type[$i] == 'linesnopoint') ? 'line' : 'circle') . '\', ';
1634
-				$this->stringtoshow .= 'fill: ' . ($type == 'bar' ? 'true' : 'false') . ', ';
1631
+				$this->stringtoshow .= 'dolibarrinfo: \'y_'.$i.'\', ';
1632
+				$this->stringtoshow .= 'label: \''.dol_escape_js(dol_string_nohtmltag($textoflegend)).'\', ';
1633
+				$this->stringtoshow .= 'pointStyle: \''.((!empty($this->type[$i]) && $this->type[$i] == 'linesnopoint') ? 'line' : 'circle').'\', ';
1634
+				$this->stringtoshow .= 'fill: '.($type == 'bar' ? 'true' : 'false').', ';
1635 1635
 				if ($type == 'bar' || $type == 'horizontalBar') {
1636 1636
 					$this->stringtoshow .= 'borderWidth: \''.$this->borderwidth.'\', ';
1637 1637
 				}
1638
-				$this->stringtoshow .= 'borderColor: \'' . $bordercolor . '\', ';
1639
-				$this->stringtoshow .= 'borderSkipped: \'' . $this->borderskip . '\', ';
1640
-				$this->stringtoshow .= 'backgroundColor: \'' . $color . '\', ';
1638
+				$this->stringtoshow .= 'borderColor: \''.$bordercolor.'\', ';
1639
+				$this->stringtoshow .= 'borderSkipped: \''.$this->borderskip.'\', ';
1640
+				$this->stringtoshow .= 'backgroundColor: \''.$color.'\', ';
1641 1641
 				if (!empty($arrayofgroupslegend) && !empty($arrayofgroupslegend[$i])) {
1642
-					$this->stringtoshow .= 'stack: \'' . $arrayofgroupslegend[$i]['stacknum'] . '\', ';
1642
+					$this->stringtoshow .= 'stack: \''.$arrayofgroupslegend[$i]['stacknum'].'\', ';
1643 1643
 				}
1644 1644
 				$this->stringtoshow .= 'data: [';
1645 1645
 
1646
-				$this->stringtoshow .= $this->mirrorGraphValues ? '[-' . $series[$i] . ',' . $series[$i] . ']' : $series[$i];
1646
+				$this->stringtoshow .= $this->mirrorGraphValues ? '[-'.$series[$i].','.$series[$i].']' : $series[$i];
1647 1647
 				$this->stringtoshow .= ']';
1648
-				$this->stringtoshow .= '}' . "\n";
1648
+				$this->stringtoshow .= '}'."\n";
1649 1649
 
1650 1650
 				$i++;
1651 1651
 				$iinstack++;
1652 1652
 			}
1653
-			$this->stringtoshow .= ']' . "\n";
1654
-			$this->stringtoshow .= '}' . "\n";
1655
-			$this->stringtoshow .= '});' . "\n";
1653
+			$this->stringtoshow .= ']'."\n";
1654
+			$this->stringtoshow .= '}'."\n";
1655
+			$this->stringtoshow .= '});'."\n";
1656 1656
 		}
1657 1657
 
1658
-		$this->stringtoshow .= '</script>' . "\n";
1658
+		$this->stringtoshow .= '</script>'."\n";
1659 1659
 	}
1660 1660
 
1661 1661
 
@@ -1684,12 +1684,12 @@  discard block
 block discarded – undo
1684 1684
 		global $langs;
1685 1685
 
1686 1686
 		if ($shownographyet) {
1687
-			$s = '<div class="nographyet" style="max-width: 400px; width:' . (preg_match('/%/', $this->width) ? $this->width : $this->width . 'px') . '; height:' . (preg_match('/%/', $this->height) ? $this->height : $this->height . 'px') . ';"></div>';
1687
+			$s = '<div class="nographyet" style="max-width: 400px; width:'.(preg_match('/%/', $this->width) ? $this->width : $this->width.'px').'; height:'.(preg_match('/%/', $this->height) ? $this->height : $this->height.'px').';"></div>';
1688 1688
 			$s .= '<div class="nographyettext margintoponly">';
1689 1689
 			if (is_numeric($shownographyet)) {
1690
-				$s .= $langs->trans("NotEnoughDataYet") . '...';
1690
+				$s .= $langs->trans("NotEnoughDataYet").'...';
1691 1691
 			} else {
1692
-				$s .= $shownographyet . '...';
1692
+				$s .= $shownographyet.'...';
1693 1693
 			}
1694 1694
 			$s .= '</div>';
1695 1695
 			return $s;
Please login to merge, or discard this patch.