Completed
Branch develop (17d3a3)
by
unknown
23:22
created
htdocs/public/company/new.php 1 patch
Spacing   +54 added lines, -54 removed lines patch added patch discarded remove patch
@@ -52,16 +52,16 @@  discard block
 block discarded – undo
52 52
 
53 53
 // Load Dolibarr environment
54 54
 require '../../main.inc.php';
55
-require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php';
56
-require_once DOL_DOCUMENT_ROOT . '/core/lib/payments.lib.php';
57
-require_once DOL_DOCUMENT_ROOT . '/adherents/class/adherent.class.php';
58
-require_once DOL_DOCUMENT_ROOT . '/adherents/class/adherent_type.class.php';
59
-require_once DOL_DOCUMENT_ROOT . '/core/class/extrafields.class.php';
60
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formcompany.class.php';
61
-require_once DOL_DOCUMENT_ROOT . '/core/class/cunits.class.php';
62
-require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
63
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formadmin.class.php';
64
-require_once DOL_DOCUMENT_ROOT . '/core/lib/public.lib.php';
55
+require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
56
+require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php';
57
+require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
58
+require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php';
59
+require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
60
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
61
+require_once DOL_DOCUMENT_ROOT.'/core/class/cunits.class.php';
62
+require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
63
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
64
+require_once DOL_DOCUMENT_ROOT.'/core/lib/public.lib.php';
65 65
 
66 66
 /**
67 67
  * @var Conf $conf
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
 
94 94
 // permissions
95 95
 
96
-$permissiontoadd 	= $user->hasRight('societe', 'creer');
96
+$permissiontoadd = $user->hasRight('societe', 'creer');
97 97
 
98 98
 // Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
99 99
 $hookmanager->initHooks(array('publicnewmembercard', 'globalcard'));
@@ -149,8 +149,8 @@  discard block
 block discarded – undo
149 149
 	printCommonFooter('public');
150 150
 
151 151
 	if (!empty($conf->use_javascript_ajax)) {
152
-		print "\n" . '<!-- Includes JS Footer of Dolibarr -->' . "\n";
153
-		print '<script src="' . DOL_URL_ROOT . '/core/js/lib_foot.js.php?lang=' . $langs->defaultlang . '"></script>' . "\n";
152
+		print "\n".'<!-- Includes JS Footer of Dolibarr -->'."\n";
153
+		print '<script src="'.DOL_URL_ROOT.'/core/js/lib_foot.js.php?lang='.$langs->defaultlang.'"></script>'."\n";
154 154
 	}
155 155
 
156 156
 	print "</body>\n";
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
 		$ok = (array_key_exists($sessionkey, $_SESSION) && (strtolower($_SESSION[$sessionkey]) == strtolower(GETPOST('code'))));
189 189
 		if (!$ok) {
190 190
 			$error++;
191
-			$errmsg .= $langs->trans("ErrorBadValueForCode") . "<br>\n";
191
+			$errmsg .= $langs->trans("ErrorBadValueForCode")."<br>\n";
192 192
 			$action = '';
193 193
 		}
194 194
 	}
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
 		$societe->phone = GETPOST('phone', 'alpha');
204 204
 		$societe->fax = GETPOST('fax', 'alpha');
205 205
 		$societe->email = trim(GETPOST('email', 'email'));
206
-		$societe->client = 2 ; // our client is a prospect
206
+		$societe->client = 2; // our client is a prospect
207 207
 		$societe->code_client = '-1';
208 208
 		$societe->name_alias = GETPOST('name_alias', 'alphanohtml');
209 209
 		$societe->note_private = GETPOST('note_private', 'alphanohtml');
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
 		if (!$error) {
229 229
 			$result = $societe->create($user);
230 230
 			if ($result > 0) {
231
-				require_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php';
231
+				require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
232 232
 				$objectsoc = $societe;
233 233
 
234 234
 				if (!empty($backtopage)) {
@@ -237,7 +237,7 @@  discard block
 block discarded – undo
237 237
 					$urlback = getDolGlobalString('MEMBER_URL_REDIRECT_SUBSCRIPTION');
238 238
 					// TODO Make replacement of __AMOUNT__, etc...
239 239
 				} else {
240
-					$urlback = $_SERVER["PHP_SELF"] . "?action=added&token=" . newToken();
240
+					$urlback = $_SERVER["PHP_SELF"]."?action=added&token=".newToken();
241 241
 				}
242 242
 			} else {
243 243
 				$error++;
@@ -249,7 +249,7 @@  discard block
 block discarded – undo
249 249
 	if (!$error) {
250 250
 		$db->commit();
251 251
 
252
-		header("Location: " . $urlback);
252
+		header("Location: ".$urlback);
253 253
 		exit;
254 254
 	} else {
255 255
 		$db->rollback();
@@ -289,7 +289,7 @@  discard block
 block discarded – undo
289 289
 llxHeaderVierge($langs->trans("ContactUs"));
290 290
 
291 291
 print '<br>';
292
-print load_fiche_titre(img_picto('', 'member_nocolor', 'class="pictofixedwidth"') . ' &nbsp; ' . $langs->trans("ContactUs"), '', '', 0, '', 'center');
292
+print load_fiche_titre(img_picto('', 'member_nocolor', 'class="pictofixedwidth"').' &nbsp; '.$langs->trans("ContactUs"), '', '', 0, '', 'center');
293 293
 
294 294
 
295 295
 print '<div align="center">';
@@ -297,9 +297,9 @@  discard block
 block discarded – undo
297 297
 
298 298
 print '<div class="center subscriptionformhelptext opacitymedium justify">';
299 299
 if (getDolGlobalString('COMPANY_NEWFORM_TEXT')) {
300
-	print $langs->trans(getDolGlobalString('COMPANY_NEWFORM_TEXT')) . "<br>\n";
300
+	print $langs->trans(getDolGlobalString('COMPANY_NEWFORM_TEXT'))."<br>\n";
301 301
 } else {
302
-	print $langs->trans("ContactUsDesc", getDolGlobalString("MAIN_INFO_SOCIETE_MAIL")) . "<br>\n";
302
+	print $langs->trans("ContactUsDesc", getDolGlobalString("MAIN_INFO_SOCIETE_MAIL"))."<br>\n";
303 303
 }
304 304
 print '</div>';
305 305
 
@@ -307,13 +307,13 @@  discard block
 block discarded – undo
307 307
 dol_htmloutput_events();
308 308
 
309 309
 // Print form
310
-print '<form action="' . $_SERVER["PHP_SELF"] . '" method="POST" name="newprospect">' . "\n";
311
-print '<input type="hidden" name="token" value="' . newToken() . '" / >';
312
-print '<input type="hidden" name="entity" value="' . $entity . '" />';
310
+print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST" name="newprospect">'."\n";
311
+print '<input type="hidden" name="token" value="'.newToken().'" / >';
312
+print '<input type="hidden" name="entity" value="'.$entity.'" />';
313 313
 print '<input type="hidden" name="action" value="add" />';
314 314
 print '<br>';
315 315
 
316
-$messagemandatory = '<span class="">' . $langs->trans("FieldsWithAreMandatory", '*') . '</span>';
316
+$messagemandatory = '<span class="">'.$langs->trans("FieldsWithAreMandatory", '*').'</span>';
317 317
 //print '<br><span class="opacitymedium">'.$langs->trans("FieldsWithAreMandatory", '*').'</span><br>';
318 318
 //print $langs->trans("FieldsWithIsForPublic",'**').'<br>';
319 319
 
@@ -349,7 +349,7 @@  discard block
 block discarded – undo
349 349
 </script>';
350 350
 
351 351
 
352
-print '<table class="border" summary="form to subscribe" id="tablesubscribe">' . "\n";
352
+print '<table class="border" summary="form to subscribe" id="tablesubscribe">'."\n";
353 353
 //Third party name
354 354
 /*
355 355
 if ($objectsoc->particulier || $private) {
@@ -359,30 +359,30 @@  discard block
 block discarded – undo
359 359
 }
360 360
 */
361 361
 print '<tr class="tr-field-thirdparty-name"><td class="titlefieldcreate">'; // text appreas left
362
-print '<input type="hidden" name="ThirdPartyName" value="' . $langs->trans('ThirdPartyName') . '">';
363
-print '<span id="TypeName" class="fieldrequired"  title="' .dol_escape_htmltag($langs->trans("FieldsWithAreMandatory", '*')) . '" >' . $form->editfieldkey('Company', 'name', '', $objectsoc, 0) . '<span class="star"> *</span></span>';
362
+print '<input type="hidden" name="ThirdPartyName" value="'.$langs->trans('ThirdPartyName').'">';
363
+print '<span id="TypeName" class="fieldrequired"  title="'.dol_escape_htmltag($langs->trans("FieldsWithAreMandatory", '*')).'" >'.$form->editfieldkey('Company', 'name', '', $objectsoc, 0).'<span class="star"> *</span></span>';
364 364
 print '</td><td>'; // inline input
365
-print '<input type="text" class="minwidth300" maxlength="128" name="name" id="name" value="' . dol_escape_htmltag($objectsoc->name) . '" autofocus="autofocus">';
365
+print '<input type="text" class="minwidth300" maxlength="128" name="name" id="name" value="'.dol_escape_htmltag($objectsoc->name).'" autofocus="autofocus">';
366 366
 //
367 367
 
368 368
 // Name and lastname
369
-print '<tr><td class="classfortooltip" title="' . dol_escape_htmltag($messagemandatory) . '">' . $langs->trans("Firstname") . ' <span class="star">*</span></td><td><input type="text" name="firstname" class="minwidth150" value="' . dol_escape_htmltag(GETPOST('firstname')) . '"></td></tr>' . "\n";
369
+print '<tr><td class="classfortooltip" title="'.dol_escape_htmltag($messagemandatory).'">'.$langs->trans("Firstname").' <span class="star">*</span></td><td><input type="text" name="firstname" class="minwidth150" value="'.dol_escape_htmltag(GETPOST('firstname')).'"></td></tr>'."\n";
370 370
 
371
-print '<tr><td class="classfortooltip" title="' . dol_escape_htmltag($messagemandatory) . '">' . $langs->trans("Lastname") . ' <span class="star">*</span></td><td><input type="text" name="lastname" class="minwidth150" value="' . dol_escape_htmltag(GETPOST('lastname')) . '"></td></tr>' . "\n";
371
+print '<tr><td class="classfortooltip" title="'.dol_escape_htmltag($messagemandatory).'">'.$langs->trans("Lastname").' <span class="star">*</span></td><td><input type="text" name="lastname" class="minwidth150" value="'.dol_escape_htmltag(GETPOST('lastname')).'"></td></tr>'."\n";
372 372
 
373 373
 // Address
374 374
 print '<tr><td class="tdtop">';
375 375
 print $form->editfieldkey('Address', 'address', '', $objectsoc, 0);
376 376
 print '</td>';
377 377
 print '<td>';
378
-print '<textarea name="address" id="address" class="quatrevingtpercent" rows="' . ROWS_2 . '" wrap="soft">';
378
+print '<textarea name="address" id="address" class="quatrevingtpercent" rows="'.ROWS_2.'" wrap="soft">';
379 379
 print dol_escape_htmltag($objectsoc->address, 0, 1);
380 380
 print '</textarea>';
381 381
 print $form->widgetForTranslation("address", $objectsoc, $permissiontoadd, 'textarea', 'alphanohtml', 'quatrevingtpercent');
382 382
 print '</td></tr>';
383 383
 
384 384
 // Country
385
-print '<tr><td>' . $form->editfieldkey('Country', 'selectcountry_id', '', $objectsoc, 0) . '</td><td class="maxwidthonsmartphone">';
385
+print '<tr><td>'.$form->editfieldkey('Country', 'selectcountry_id', '', $objectsoc, 0).'</td><td class="maxwidthonsmartphone">';
386 386
 print img_picto('', 'country', 'class="pictofixedwidth"');
387 387
 print $form->select_country((GETPOSTISSET('country_id') ? GETPOST('country_id') : $objectsoc->country_id), 'country_id', '', 0, 'minwidth300 maxwidth500 widthcentpercentminusx');
388 388
 if ($user->admin) {
@@ -391,40 +391,40 @@  discard block
 block discarded – undo
391 391
 print '</td></tr>';
392 392
 
393 393
 // Phone / Fax
394
-print '<tr><td>' . $form->editfieldkey('Phone', 'phone', '', $objectsoc, 0) . '</td>';
395
-print '<td>' . img_picto('', 'object_phoning', 'class="pictofixedwidth"') . ' <input type="text" name="phone" id="phone" class="maxwidth200 widthcentpercentminusx" value="' . (GETPOSTISSET('phone') ? GETPOST('phone', 'alpha') : $objectsoc->phone) . '"></td>';
394
+print '<tr><td>'.$form->editfieldkey('Phone', 'phone', '', $objectsoc, 0).'</td>';
395
+print '<td>'.img_picto('', 'object_phoning', 'class="pictofixedwidth"').' <input type="text" name="phone" id="phone" class="maxwidth200 widthcentpercentminusx" value="'.(GETPOSTISSET('phone') ? GETPOST('phone', 'alpha') : $objectsoc->phone).'"></td>';
396 396
 print '</tr>';
397 397
 
398 398
 print '<tr>';
399
-print '<td>' . $form->editfieldkey('Fax', 'fax', '', $objectsoc, 0) . '</td>';
400
-print '<td>' . img_picto('', 'object_phoning_fax', 'class="pictofixedwidth"') . ' <input type="text" name="fax" id="fax" class="maxwidth200 widthcentpercentminusx" value="' . (GETPOSTISSET('fax') ? GETPOST('fax', 'alpha') : $objectsoc->fax) . '"></td>';
399
+print '<td>'.$form->editfieldkey('Fax', 'fax', '', $objectsoc, 0).'</td>';
400
+print '<td>'.img_picto('', 'object_phoning_fax', 'class="pictofixedwidth"').' <input type="text" name="fax" id="fax" class="maxwidth200 widthcentpercentminusx" value="'.(GETPOSTISSET('fax') ? GETPOST('fax', 'alpha') : $objectsoc->fax).'"></td>';
401 401
 print '</tr>';
402 402
 
403 403
 // Email / Web
404
-print '<tr><td>' . $form->editfieldkey('EMail', 'email', '', $objectsoc, 0, 'string', '', !getDolGlobalString('SOCIETE_EMAIL_MANDATORY') ? '' : $conf->global->SOCIETE_EMAIL_MANDATORY) . '</td>';
405
-print '<td>' . img_picto('', 'object_email', 'class="pictofixedwidth"') . ' <input type="text" class="maxwidth200 widthcentpercentminusx" name="email" id="email" value="' . $objectsoc->email . '"></td>';
404
+print '<tr><td>'.$form->editfieldkey('EMail', 'email', '', $objectsoc, 0, 'string', '', !getDolGlobalString('SOCIETE_EMAIL_MANDATORY') ? '' : $conf->global->SOCIETE_EMAIL_MANDATORY).'</td>';
405
+print '<td>'.img_picto('', 'object_email', 'class="pictofixedwidth"').' <input type="text" class="maxwidth200 widthcentpercentminusx" name="email" id="email" value="'.$objectsoc->email.'"></td>';
406 406
 if (isModEnabled('mailing') && getDolGlobalString('THIRDPARTY_SUGGEST_ALSO_ADDRESS_CREATION')) {
407 407
 	if ($conf->browser->layout == 'phone') {
408 408
 		print '</tr><tr>';
409 409
 	}
410
-	print '<td class="individualline noemail">' . $form->editfieldkey($langs->trans('No_Email') . ' (' . $langs->trans('Contact') . ')', 'contact_no_email', '', $objectsoc, 0) . '</td>';
411
-	print '<td class="individualline" ' . (($conf->browser->layout == 'phone') /* || !isModEnabled('mailing') */ ? ' colspan="3"' : '') . '>' . $form->selectyesno('contact_no_email', (GETPOSTISSET("contact_no_email") ? GETPOST("contact_no_email", 'alpha') : (empty($objectsoc->no_email) ? 0 : 1)), 1, false, 1) . '</td>';
410
+	print '<td class="individualline noemail">'.$form->editfieldkey($langs->trans('No_Email').' ('.$langs->trans('Contact').')', 'contact_no_email', '', $objectsoc, 0).'</td>';
411
+	print '<td class="individualline" '.(($conf->browser->layout == 'phone') /* || !isModEnabled('mailing') */ ? ' colspan="3"' : '').'>'.$form->selectyesno('contact_no_email', (GETPOSTISSET("contact_no_email") ? GETPOST("contact_no_email", 'alpha') : (empty($objectsoc->no_email) ? 0 : 1)), 1, false, 1).'</td>';
412 412
 }
413 413
 print '</tr>';
414 414
 
415
-print '<tr><td>' . $form->editfieldkey('Web', 'url', '', $objectsoc, 0) . '</td>';
416
-print '<td>' . img_picto('', 'globe', 'class="pictofixedwidth"') . ' <input type="text" class="maxwidth500 widthcentpercentminusx" name="url" id="url" value="' . $objectsoc->url . '"></td></tr>';
415
+print '<tr><td>'.$form->editfieldkey('Web', 'url', '', $objectsoc, 0).'</td>';
416
+print '<td>'.img_picto('', 'globe', 'class="pictofixedwidth"').' <input type="text" class="maxwidth500 widthcentpercentminusx" name="url" id="url" value="'.$objectsoc->url.'"></td></tr>';
417 417
 
418 418
 
419 419
 // Comments
420 420
 print '<tr>';
421
-print '<td class="tdtop">' . $langs->trans("Comments") . '</td>';
422
-print '<td class="tdtop"><textarea name="note_private" id="note_private" wrap="soft" class="quatrevingtpercent" rows="' . ROWS_3 . '">' . dol_escape_htmltag(GETPOST('note_private', 'restricthtml'), 0, 1) . '</textarea></td>';
423
-print '</tr>' . "\n";
421
+print '<td class="tdtop">'.$langs->trans("Comments").'</td>';
422
+print '<td class="tdtop"><textarea name="note_private" id="note_private" wrap="soft" class="quatrevingtpercent" rows="'.ROWS_3.'">'.dol_escape_htmltag(GETPOST('note_private', 'restricthtml'), 0, 1).'</textarea></td>';
423
+print '</tr>'."\n";
424 424
 
425 425
 
426 426
 // Other attributes
427
-$parameters['tpl_context'] = 'public';	// define template context to public
427
+$parameters['tpl_context'] = 'public'; // define template context to public
428 428
 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php';
429 429
 
430 430
 
@@ -432,14 +432,14 @@  discard block
 block discarded – undo
432 432
 
433 433
 // Display Captcha code if is enabled
434 434
 if (getDolGlobalString('MAIN_SECURITY_ENABLECAPTCHA_THIRDPARTY')) {
435
-	require_once DOL_DOCUMENT_ROOT . '/core/lib/security2.lib.php';
436
-	print '<tr><td class="titlefield"><label for="email"><span class="fieldrequired">' . $langs->trans("SecurityCode") . '</span></label></td><td>';
435
+	require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php';
436
+	print '<tr><td class="titlefield"><label for="email"><span class="fieldrequired">'.$langs->trans("SecurityCode").'</span></label></td><td>';
437 437
 	print '<span class="span-icon-security inline-block">';
438
-	print '<input id="securitycode" placeholder="' . $langs->trans("SecurityCode") . '" class="flat input-icon-security width150" type="text" maxlength="5" name="code" tabindex="3" />';
438
+	print '<input id="securitycode" placeholder="'.$langs->trans("SecurityCode").'" class="flat input-icon-security width150" type="text" maxlength="5" name="code" tabindex="3" />';
439 439
 	print '</span>';
440 440
 	print '<span class="nowrap inline-block">';
441
-	print '<img class="inline-block valignmiddle" src="' . DOL_URL_ROOT . '/core/antispamimage.php" border="0" width="80" height="32" id="img_securitycode" />';
442
-	print '<a class="inline-block valignmiddle" href="' . $_SERVER['PHP_SELF'] . '" tabindex="4" data-role="button">' . img_picto($langs->trans("Refresh"), 'refresh', 'id="captcha_refresh_img"') . '</a>';
441
+	print '<img class="inline-block valignmiddle" src="'.DOL_URL_ROOT.'/core/antispamimage.php" border="0" width="80" height="32" id="img_securitycode" />';
442
+	print '<a class="inline-block valignmiddle" href="'.$_SERVER['PHP_SELF'].'" tabindex="4" data-role="button">'.img_picto($langs->trans("Refresh"), 'refresh', 'id="captcha_refresh_img"').'</a>';
443 443
 	print '</span>';
444 444
 	print '</td></tr>';
445 445
 }
@@ -450,9 +450,9 @@  discard block
 block discarded – undo
450 450
 
451 451
 // Save / Submit
452 452
 print '<div class="center">';
453
-print '<input type="submit" value="' . $langs->trans("Send") . '" id="submitsave" class="button">';
453
+print '<input type="submit" value="'.$langs->trans("Send").'" id="submitsave" class="button">';
454 454
 if (!empty($backtopage)) {
455
-	print ' &nbsp; &nbsp; <input type="submit" value="' . $langs->trans("Cancel") . '" id="submitcancel" class="button button-cancel">';
455
+	print ' &nbsp; &nbsp; <input type="submit" value="'.$langs->trans("Cancel").'" id="submitcancel" class="button button-cancel">';
456 456
 }
457 457
 print '</div>';
458 458
 
Please login to merge, or discard this patch.
htdocs/societe/card.php 1 patch
Spacing   +71 added lines, -71 removed lines patch added patch discarded remove patch
@@ -117,8 +117,8 @@  discard block
 block discarded – undo
117 117
 $cancel		= GETPOST('cancel', 'alpha');
118 118
 $backtopage = GETPOST('backtopage', 'alpha');
119 119
 $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha');
120
-$confirm 	= GETPOST('confirm', 'alpha');
121
-$canvas		= GETPOST('canvas', 'alpha');
120
+$confirm = GETPOST('confirm', 'alpha');
121
+$canvas = GETPOST('canvas', 'alpha');
122 122
 
123 123
 $dol_openinpopup = '';
124 124
 
@@ -161,10 +161,10 @@  discard block
 block discarded – undo
161 161
 }
162 162
 
163 163
 // Permissions
164
-$permissiontoread 	= $user->hasRight('societe', 'lire');
165
-$permissiontoadd 	= $user->hasRight('societe', 'creer'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
164
+$permissiontoread = $user->hasRight('societe', 'lire');
165
+$permissiontoadd = $user->hasRight('societe', 'creer'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
166 166
 $permissiontodelete = $user->hasRight('societe', 'supprimer') || ($permissiontoadd && isset($object->status) && $object->status == 0);
167
-$permissionnote 	= $user->hasRight('societe', 'creer'); // Used by the include of actions_setnotes.inc.php
167
+$permissionnote = $user->hasRight('societe', 'creer'); // Used by the include of actions_setnotes.inc.php
168 168
 $permissiondellink 	= $user->hasRight('societe', 'creer'); // Used by the include of actions_dellink.inc.php
169 169
 $permissiontoeditextra = $permissiontoadd;
170 170
 if (GETPOST('attribute', 'aZ09') && isset($extrafields->attributes[$object->table_element]['perms'][GETPOST('attribute', 'aZ09')])) {
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
 	$permissiontoeditextra = dol_eval($extrafields->attributes[$object->table_element]['perms'][GETPOST('attribute', 'aZ09')]);
173 173
 }
174 174
 
175
-$upload_dir 		= $conf->societe->multidir_output[isset($object->entity) ? $object->entity : 1];
175
+$upload_dir = $conf->societe->multidir_output[isset($object->entity) ? $object->entity : 1];
176 176
 
177 177
 // Security check
178 178
 $result = restrictedArea($user, 'societe', $object->id, '&societe', '', 'fk_soc', 'rowid', 0);
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
 			if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) {
202 202
 				$backtopage = $backurlforlist;
203 203
 			} else {
204
-				$backtopage = DOL_URL_ROOT.'/societe/card.php?id='.((!empty($id) && $id > 0) ? $id : '__ID__') . (!empty($canvas) ? "&canvas=" . $canvas : "");
204
+				$backtopage = DOL_URL_ROOT.'/societe/card.php?id='.((!empty($id) && $id > 0) ? $id : '__ID__').(!empty($canvas) ? "&canvas=".$canvas : "");
205 205
 			}
206 206
 		}
207 207
 	}
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
 
220 220
 	if ($action == 'confirm_merge' && $confirm == 'yes' && $permissiontoadd) {
221 221
 		$soc_origin_id = GETPOSTINT('soc_origin');
222
-		$soc_origin = new Societe($db);		// The thirdparty that we will delete
222
+		$soc_origin = new Societe($db); // The thirdparty that we will delete
223 223
 
224 224
 		if ($soc_origin_id <= 0) {
225 225
 			$langs->load('errors');
@@ -267,7 +267,7 @@  discard block
 block discarded – undo
267 267
 	if ($action == 'update_extras' && $permissiontoeditextra) {
268 268
 		$object->fetch($socid);
269 269
 
270
-		$object->oldcopy = dol_clone($object, 2);  // @phan-suppress-current-line PhanTypeMismatchProperty
270
+		$object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty
271 271
 
272 272
 		$attribute_name = GETPOST('attribute', 'aZ09');
273 273
 
@@ -323,7 +323,7 @@  discard block
 block discarded – undo
323 323
 		if (!$error) {
324 324
 			if ($action == 'update') {	// Test on permission not required here
325 325
 				$ret = $object->fetch($socid);
326
-				$object->oldcopy = clone $object;  // @phan-suppress-current-line PhanTypeMismatchProperty
326
+				$object->oldcopy = clone $object; // @phan-suppress-current-line PhanTypeMismatchProperty
327 327
 			} else {
328 328
 				$object->canvas = $canvas;
329 329
 			}
@@ -333,21 +333,21 @@  discard block
 block discarded – undo
333 333
 
334 334
 				$object->name = dolGetFirstLastname(GETPOST('firstname', 'alphanohtml'), GETPOST('name', 'alphanohtml'));
335 335
 				$object->civility_id		= GETPOST('civility_id', 'alphanohtml'); // Note: civility id is a code, not an int
336
-				$object->civility_code		= GETPOST('civility_id', 'alphanohtml'); // Note: civility id is a code, not an int
336
+				$object->civility_code = GETPOST('civility_id', 'alphanohtml'); // Note: civility id is a code, not an int
337 337
 				// Add non official properties
338
-				$object->name_bis			= GETPOST('name', 'alphanohtml');
339
-				$object->firstname			= GETPOST('firstname', 'alphanohtml');
338
+				$object->name_bis = GETPOST('name', 'alphanohtml');
339
+				$object->firstname = GETPOST('firstname', 'alphanohtml');
340 340
 			} else {
341
-				$object->name				= GETPOST('name', 'alphanohtml');
341
+				$object->name = GETPOST('name', 'alphanohtml');
342 342
 			}
343 343
 			$object->entity					= ((GETPOSTISSET('entity') && GETPOST('entity') != '') ? GETPOSTINT('entity') : $conf->entity);
344
-			$object->name_alias				= GETPOST('name_alias', 'alphanohtml');
344
+			$object->name_alias = GETPOST('name_alias', 'alphanohtml');
345 345
 			$object->parent					= GETPOSTISSET('parent_company_id') ? GETPOSTINT('parent_company_id') : $object->parent;
346 346
 			$object->address				= GETPOST('address', 'alphanohtml');
347
-			$object->zip					= GETPOST('zipcode', 'alphanohtml');
348
-			$object->town					= GETPOST('town', 'alphanohtml');
349
-			$object->country_id				= GETPOSTINT('country_id');
350
-			$object->state_id				= GETPOSTINT('state_id');
347
+			$object->zip = GETPOST('zipcode', 'alphanohtml');
348
+			$object->town = GETPOST('town', 'alphanohtml');
349
+			$object->country_id = GETPOSTINT('country_id');
350
+			$object->state_id = GETPOSTINT('state_id');
351 351
 
352 352
 			$object->socialnetworks = array();
353 353
 			if (isModEnabled('socialnetworks')) {
@@ -359,10 +359,10 @@  discard block
 block discarded – undo
359 359
 			}
360 360
 
361 361
 			$object->phone					= GETPOST('phone', 'alpha');
362
-			$object->phone_mobile 			= (string) GETPOST("phone_mobile", 'alpha');
362
+			$object->phone_mobile = (string) GETPOST("phone_mobile", 'alpha');
363 363
 			$object->fax					= GETPOST('fax', 'alpha');
364 364
 			$object->email					= trim(GETPOST('email', 'email'));
365
-			$object->no_email 				= GETPOSTINT("no_email");
365
+			$object->no_email = GETPOSTINT("no_email");
366 366
 			$object->url					= trim(GETPOST('url', 'url'));
367 367
 			$object->idprof1				= trim(GETPOST('idprof1', 'alphanohtml'));
368 368
 			$object->idprof2				= trim(GETPOST('idprof2', 'alphanohtml'));
@@ -372,13 +372,13 @@  discard block
 block discarded – undo
372 372
 			$object->idprof6				= trim(GETPOST('idprof6', 'alphanohtml'));
373 373
 			$object->prefix_comm			= GETPOST('prefix_comm', 'alphanohtml');
374 374
 			$object->code_client			= GETPOSTISSET('customer_code') ? GETPOST('customer_code', 'alpha') : GETPOST('code_client', 'alpha');
375
-			$object->code_fournisseur		= GETPOSTISSET('supplier_code') ? GETPOST('supplier_code', 'alpha') : GETPOST('code_fournisseur', 'alpha');
375
+			$object->code_fournisseur = GETPOSTISSET('supplier_code') ? GETPOST('supplier_code', 'alpha') : GETPOST('code_fournisseur', 'alpha');
376 376
 			$object->capital				= GETPOSTFLOAT('capital');
377 377
 			$object->barcode				= GETPOST('barcode', 'alphanohtml');
378 378
 
379 379
 			$object->tva_intra				= GETPOST('tva_intra', 'alphanohtml');
380 380
 			$object->tva_assuj				= GETPOSTINT('assujtva_value');
381
-			$object->vat_reverse_charge		= GETPOST('vat_reverse_charge') == 'on' ? 1 : 0;
381
+			$object->vat_reverse_charge = GETPOST('vat_reverse_charge') == 'on' ? 1 : 0;
382 382
 			$object->status = GETPOSTINT('status');
383 383
 
384 384
 			// Local Taxes
@@ -388,11 +388,11 @@  discard block
 block discarded – undo
388 388
 			$object->localtax1_value		= GETPOST('lt1', 'alpha');
389 389
 			$object->localtax2_value		= GETPOST('lt2', 'alpha');
390 390
 
391
-			$object->forme_juridique_code	= GETPOSTINT('forme_juridique_code');
392
-			$object->birth				= dol_mktime(0, 0, 0, GETPOSTINT('birthmonth'), GETPOSTINT('birthday'), GETPOSTINT('birthyear'));
391
+			$object->forme_juridique_code = GETPOSTINT('forme_juridique_code');
392
+			$object->birth = dol_mktime(0, 0, 0, GETPOSTINT('birthmonth'), GETPOSTINT('birthday'), GETPOSTINT('birthyear'));
393 393
 
394 394
 			$object->effectif_id			= GETPOSTINT('effectif_id');
395
-			$object->typent_id				= GETPOSTINT('typent_id');
395
+			$object->typent_id = GETPOSTINT('typent_id');
396 396
 
397 397
 			$object->typent_code			= dol_getIdFromCode($db, $object->typent_id, 'c_typent', 'id', 'code'); // Force typent_code too so check in verify() will be done on new type
398 398
 
@@ -401,8 +401,8 @@  discard block
 block discarded – undo
401 401
 			$prospect = (GETPOSTINT('prospect') > 0 ? 2 : 0);
402 402
 			$prospectcustomer = $customer + $prospect;
403 403
 
404
-			$object->client					= $prospectcustomer;
405
-			$object->fournisseur			= (GETPOSTINT('supplier') > 0 ? 1 : 0);
404
+			$object->client = $prospectcustomer;
405
+			$object->fournisseur = (GETPOSTINT('supplier') > 0 ? 1 : 0);
406 406
 
407 407
 			if ($action == 'add') {
408 408
 				// for prospect, customer or supplier
@@ -422,7 +422,7 @@  discard block
 block discarded – undo
422 422
 					}
423 423
 
424 424
 					if ($object->fournisseur > 0) {
425
-						$object->cond_reglement_supplier_id	= $paymentTermId;
425
+						$object->cond_reglement_supplier_id = $paymentTermId;
426 426
 
427 427
 						$filterPaymentTypeIdArr = array(1, 2, 3); // allow payment type for supplier (filter is "DBIT" in "Form::select_types_paiements()" method)
428 428
 						if (!empty($form->cache_types_paiements[$paymentTypeId]) && isset($form->cache_types_paiements[$paymentTypeId]['type']) && in_array($form->cache_types_paiements[$paymentTypeId]['type'], $filterPaymentTypeIdArr)) {
@@ -432,15 +432,15 @@  discard block
 block discarded – undo
432 432
 				}
433 433
 			}
434 434
 
435
-			$object->commercial_id			= GETPOSTINT('commercial_id');
436
-			$object->default_lang			= GETPOST('default_lang');
435
+			$object->commercial_id = GETPOSTINT('commercial_id');
436
+			$object->default_lang = GETPOST('default_lang');
437 437
 
438 438
 			// Webservices url/key
439 439
 			$object->webservices_url		= GETPOST('webservices_url', 'url');
440 440
 			$object->webservices_key		= GETPOST('webservices_key', 'san_alpha');
441 441
 
442 442
 			if (GETPOSTISSET('accountancy_code_sell')) {
443
-				$accountancy_code_sell		= GETPOST('accountancy_code_sell', 'alpha');
443
+				$accountancy_code_sell = GETPOST('accountancy_code_sell', 'alpha');
444 444
 
445 445
 				if (empty($accountancy_code_sell) || $accountancy_code_sell == '-1') {
446 446
 					$object->accountancy_code_sell = '';
@@ -449,7 +449,7 @@  discard block
 block discarded – undo
449 449
 				}
450 450
 			}
451 451
 			if (GETPOSTISSET('accountancy_code_buy')) {
452
-				$accountancy_code_buy		= GETPOST('accountancy_code_buy', 'alpha');
452
+				$accountancy_code_buy = GETPOST('accountancy_code_buy', 'alpha');
453 453
 
454 454
 				if (empty($accountancy_code_buy) || $accountancy_code_buy == '-1') {
455 455
 					$object->accountancy_code_buy = '';
@@ -824,7 +824,7 @@  discard block
 block discarded – undo
824 824
 	// Delete third party
825 825
 	if ($action == 'confirm_delete' && $confirm == 'yes' && $user->hasRight('societe', 'supprimer')) {
826 826
 		$object->fetch($socid);
827
-		$object->oldcopy = clone $object;  // @phan-suppress-current-line PhanTypeMismatchProperty
827
+		$object->oldcopy = clone $object; // @phan-suppress-current-line PhanTypeMismatchProperty
828 828
 		$result = $object->delete($socid, $user);
829 829
 
830 830
 		if ($result > 0) {
@@ -902,7 +902,7 @@  discard block
 block discarded – undo
902 902
 				} else {
903 903
 					$db->commit();
904 904
 					$db->close();
905
-					header("Location: " . $_SERVER["PHP_SELF"] . "?id=" . $id);
905
+					header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id);
906 906
 					exit;
907 907
 				}
908 908
 			} else {
@@ -1084,21 +1084,21 @@  discard block
 block discarded – undo
1084 1084
 		}
1085 1085
 
1086 1086
 		$object->phone				= GETPOST('phone', 'alpha');
1087
-		$object->phone_mobile       = (string) GETPOST("phone_mobile", 'alpha');
1087
+		$object->phone_mobile = (string) GETPOST("phone_mobile", 'alpha');
1088 1088
 		$object->fax				= GETPOST('fax', 'alpha');
1089 1089
 		$object->email				= GETPOST('email', 'email');
1090 1090
 		$object->url				= GETPOST('url', 'url');
1091
-		$object->capital			= GETPOSTFLOAT('capital');
1091
+		$object->capital = GETPOSTFLOAT('capital');
1092 1092
 		$paymentTermId = GETPOSTINT('cond_reglement_id'); // can be set by default values on create page and not already in get or post variables
1093 1093
 		if (empty($paymentTermId) && !GETPOSTISSET('cond_reglement_id')) {
1094 1094
 			$paymentTermId = getDolGlobalString('MAIN_DEFAULT_PAYMENT_TERM_ID');
1095 1095
 		}
1096
-		$object->cond_reglement_id	= $paymentTermId;
1096
+		$object->cond_reglement_id = $paymentTermId;
1097 1097
 		$paymentTypeId = GETPOSTINT('mode_reglement_id'); // can be set by default values on create page and not already in get or post variables
1098 1098
 		if (empty($paymentTypeId) && !GETPOSTISSET('mode_reglement_id')) {
1099 1099
 			$paymentTypeId = getDolGlobalString('MAIN_DEFAULT_PAYMENT_TYPE_ID');
1100 1100
 		}
1101
-		$object->mode_reglement_id 	= $paymentTypeId;
1101
+		$object->mode_reglement_id = $paymentTypeId;
1102 1102
 		$object->barcode			= GETPOST('barcode', 'alphanohtml');
1103 1103
 		$object->idprof1			= GETPOST('idprof1', 'alphanohtml');
1104 1104
 		$object->idprof2			= GETPOST('idprof2', 'alphanohtml');
@@ -1111,7 +1111,7 @@  discard block
 block discarded – undo
1111 1111
 		$object->civility_id		= GETPOST('civility_id', 'alpha');
1112 1112
 
1113 1113
 		$object->tva_assuj = GETPOSTINT('assujtva_value');
1114
-		$object->vat_reverse_charge	= GETPOST('vat_reverse_charge') == 'on' ? 1 : 0;
1114
+		$object->vat_reverse_charge = GETPOST('vat_reverse_charge') == 'on' ? 1 : 0;
1115 1115
 		$object->status = GETPOSTINT('status');
1116 1116
 
1117 1117
 		//Local Taxes
@@ -1127,7 +1127,7 @@  discard block
 block discarded – undo
1127 1127
 		$object->default_lang = GETPOST('default_lang');
1128 1128
 
1129 1129
 		if (GETPOSTISSET('accountancy_code_sell')) {
1130
-			$accountancy_code_sell  = GETPOST('accountancy_code_sell', 'alpha');
1130
+			$accountancy_code_sell = GETPOST('accountancy_code_sell', 'alpha');
1131 1131
 
1132 1132
 			if (empty($accountancy_code_sell) || $accountancy_code_sell == '-1') {
1133 1133
 				$object->accountancy_code_sell = '';
@@ -1136,7 +1136,7 @@  discard block
 block discarded – undo
1136 1136
 			}
1137 1137
 		}
1138 1138
 		if (GETPOSTISSET('accountancy_code_buy')) {
1139
-			$accountancy_code_buy   = GETPOST('accountancy_code_buy', 'alpha');
1139
+			$accountancy_code_buy = GETPOST('accountancy_code_buy', 'alpha');
1140 1140
 
1141 1141
 			if (empty($accountancy_code_buy) || $accountancy_code_buy == '-1') {
1142 1142
 				$object->accountancy_code_buy = '';
@@ -1261,7 +1261,7 @@  discard block
 block discarded – undo
1261 1261
 
1262 1262
 			print '<script type="text/javascript">';
1263 1263
 			print '$(document).ready(function () {
1264
-					var canHaveCustomerCategoryIfNotCustomerProspectSupplier = ' . (!getDolGlobalString('THIRDPARTY_CAN_HAVE_CUSTOMER_CATEGORY_EVEN_IF_NOT_CUSTOMER_PROSPECT') ? '0' : '1') . ';
1264
+					var canHaveCustomerCategoryIfNotCustomerProspectSupplier = ' . (!getDolGlobalString('THIRDPARTY_CAN_HAVE_CUSTOMER_CATEGORY_EVEN_IF_NOT_CUSTOMER_PROSPECT') ? '0' : '1').';
1265 1265
 
1266 1266
 					init_customer_categ();
1267 1267
 			  		$("#customerprospect").change(function() {
@@ -1333,7 +1333,7 @@  discard block
 block discarded – undo
1333 1333
 			print '</td><td'.(getDolGlobalString('SOCIETE_USEPREFIX') ? '' : ' colspan="3"').'>';
1334 1334
 
1335 1335
 			print '<input type="text" class="minwidth300" maxlength="128" name="name" id="name" value="'.dol_escape_htmltag($object->name).'" autofocus="autofocus">';
1336
-			print $form->widgetForTranslation("name", $object, $permissiontoadd, 'string', 'alphanohtml', 'minwidth300');	// For some countries that need the company name in 2 languages
1336
+			print $form->widgetForTranslation("name", $object, $permissiontoadd, 'string', 'alphanohtml', 'minwidth300'); // For some countries that need the company name in 2 languages
1337 1337
 			// This implementation of the feature to search already existing company has been disabled. It must be implemented by keeping the "input text" and we must call the search ajax societe/ajax/ajaxcompanies.php
1338 1338
 			// on a keydown of the input. We should show data about a duplicate found if we found less than 5 answers into a div under the input.
1339 1339
 			/*
@@ -1453,8 +1453,8 @@  discard block
 block discarded – undo
1453 1453
 
1454 1454
 			// Prospect/Customer/Supplier
1455 1455
 			$selected = $object->client;
1456
-			$selectedcustomer = ((getDolGlobalInt('THIRDPARTY_CUSTOMERTYPE_BY_DEFAULT')==1 && GETPOST("type", 'aZ') != 'p' && GETPOST("type", 'aZ') != 'f') || (getDolGlobalInt('THIRDPARTY_CUSTOMERTYPE_BY_DEFAULT')==3 && GETPOST("type", 'aZ') != 'p' && GETPOST("type", 'aZ') != 'f') ? 1 : 0);
1457
-			$selectedprospect = ((getDolGlobalInt('THIRDPARTY_CUSTOMERTYPE_BY_DEFAULT')==2 && GETPOST("type", 'aZ') != 'c' && GETPOST("type", 'aZ') != 'f') || (getDolGlobalInt('THIRDPARTY_CUSTOMERTYPE_BY_DEFAULT')==3 && GETPOST("type", 'aZ') != 'c' && GETPOST("type", 'aZ') != 'f') ? 1 : 0);
1456
+			$selectedcustomer = ((getDolGlobalInt('THIRDPARTY_CUSTOMERTYPE_BY_DEFAULT') == 1 && GETPOST("type", 'aZ') != 'p' && GETPOST("type", 'aZ') != 'f') || (getDolGlobalInt('THIRDPARTY_CUSTOMERTYPE_BY_DEFAULT') == 3 && GETPOST("type", 'aZ') != 'p' && GETPOST("type", 'aZ') != 'f') ? 1 : 0);
1457
+			$selectedprospect = ((getDolGlobalInt('THIRDPARTY_CUSTOMERTYPE_BY_DEFAULT') == 2 && GETPOST("type", 'aZ') != 'c' && GETPOST("type", 'aZ') != 'f') || (getDolGlobalInt('THIRDPARTY_CUSTOMERTYPE_BY_DEFAULT') == 3 && GETPOST("type", 'aZ') != 'c' && GETPOST("type", 'aZ') != 'f') ? 1 : 0);
1458 1458
 			switch ($selected) {
1459 1459
 				case 1:
1460 1460
 					$selectedcustomer = 1;
@@ -1705,7 +1705,7 @@  discard block
 block discarded – undo
1705 1705
 					print '<td></td>';
1706 1706
 					print '<td></td>';
1707 1707
 				}
1708
-				print '<td class="individualline noemail">'.$form->editfieldkey($langs->trans('No_Email') .' ('.$langs->trans('Contact').')', 'contact_no_email', '', $object, 0).'</td>';
1708
+				print '<td class="individualline noemail">'.$form->editfieldkey($langs->trans('No_Email').' ('.$langs->trans('Contact').')', 'contact_no_email', '', $object, 0).'</td>';
1709 1709
 				print '<td class="individualline" '.(($conf->browser->layout == 'phone') || !isModEnabled('mailing') ? ' colspan="3"' : '').'>'.$form->selectyesno('contact_no_email', (GETPOSTISSET("contact_no_email") ? GETPOST("contact_no_email", 'alpha') : (empty($object->no_email) ? 0 : 1)), 1, false, 1).'</td>';
1710 1710
 				print '</tr>';
1711 1711
 			}
@@ -1753,7 +1753,7 @@  discard block
 block discarded – undo
1753 1753
 			// Vat is used
1754 1754
 			print '<tr><td><label for="assujtva_value">'.$form->editfieldkey('VATIsUsed', 'assujtva_value', '', $object, 0).'</label></td>';
1755 1755
 			print '<td>';
1756
-			print '<input id="assujtva_value" name="assujtva_value" type="checkbox" ' . (GETPOSTISSET('assujtva_value') ? (GETPOST('assujtva_value', 'alpha') != '' ? ' checked="checked"' : '') : 'checked="checked"') . ' value="1">'; // Assujeti par default en creation
1756
+			print '<input id="assujtva_value" name="assujtva_value" type="checkbox" '.(GETPOSTISSET('assujtva_value') ? (GETPOST('assujtva_value', 'alpha') != '' ? ' checked="checked"' : '') : 'checked="checked"').' value="1">'; // Assujeti par default en creation
1757 1757
 			print '</td>';
1758 1758
 			if ($conf->browser->layout == 'phone') {
1759 1759
 				print '</tr><tr>';
@@ -1794,7 +1794,7 @@  discard block
 block discarded – undo
1794 1794
 
1795 1795
 			// VAT reverse charge by default
1796 1796
 			if (getDolGlobalString('ACCOUNTING_FORCE_ENABLE_VAT_REVERSE_CHARGE')) {
1797
-				print '<tr><td><label for="vat_reverse_charge">' . $form->editfieldkey('VATReverseChargeByDefault', 'vat_reverse_charge', '', $object, 0) . '</label></td><td colspan="3">';
1797
+				print '<tr><td><label for="vat_reverse_charge">'.$form->editfieldkey('VATReverseChargeByDefault', 'vat_reverse_charge', '', $object, 0).'</label></td><td colspan="3">';
1798 1798
 				print '<input type="checkbox" name="vat_reverse_charge" id="vat_reverse_charge" '.($object->vat_reverse_charge == '1' ? ' checked' : '').'>';
1799 1799
 				print '</td></tr>';
1800 1800
 			}
@@ -1803,21 +1803,21 @@  discard block
 block discarded – undo
1803 1803
 			//TODO: Place into a function to control showing by country or study better option
1804 1804
 			if ($mysoc->localtax1_assuj == "1" && $mysoc->localtax2_assuj == "1") {
1805 1805
 				print '<tr><td>'.$langs->transcountry("LocalTax1IsUsed", $mysoc->country_code).'</td><td>';
1806
-				print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" ' . (isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX1) ? 'checked="checked"' : '') . ' value="1">';
1806
+				print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" '.(isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX1) ? 'checked="checked"' : '').' value="1">';
1807 1807
 				print '</td>';
1808 1808
 				if ($conf->browser->layout == 'phone') {
1809 1809
 					print '</tr><tr>';
1810 1810
 				}
1811 1811
 				print '<td>'.$langs->transcountry("LocalTax2IsUsed", $mysoc->country_code).'</td><td>';
1812
-				print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" ' . (isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX2) ? 'checked="checked"' : '') . ' value="1">';
1812
+				print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" '.(isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX2) ? 'checked="checked"' : '').' value="1">';
1813 1813
 				print '</td></tr>';
1814 1814
 			} elseif ($mysoc->localtax1_assuj == "1") {
1815 1815
 				print '<tr><td>'.$langs->transcountry("LocalTax1IsUsed", $mysoc->country_code).'</td><td colspan="3">';
1816
-				print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" ' . (isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX1) ? 'checked="checked"' : '') . ' value="1">';
1816
+				print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" '.(isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX1) ? 'checked="checked"' : '').' value="1">';
1817 1817
 				print '</td></tr>';
1818 1818
 			} elseif ($mysoc->localtax2_assuj == "1") {
1819 1819
 				print '<tr><td>'.$langs->transcountry("LocalTax2IsUsed", $mysoc->country_code).'</td><td colspan="3">';
1820
-				print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" ' . (isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX2) ? 'checked="checked"' : '') . ' value="1">';
1820
+				print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" '.(isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX2) ? 'checked="checked"' : '').' value="1">';
1821 1821
 				print '</td></tr>';
1822 1822
 			}
1823 1823
 
@@ -2060,7 +2060,7 @@  discard block
 block discarded – undo
2060 2060
 				$prefixSupplierIsUsed = false;
2061 2061
 			}
2062 2062
 
2063
-			$object->oldcopy = clone $object;  // @phan-suppress-current-line PhanTypeMismatchProperty
2063
+			$object->oldcopy = clone $object; // @phan-suppress-current-line PhanTypeMismatchProperty
2064 2064
 
2065 2065
 			if (GETPOSTISSET('name')) {
2066 2066
 				// We overwrite with values if posted
@@ -2088,10 +2088,10 @@  discard block
 block discarded – undo
2088 2088
 				}
2089 2089
 
2090 2090
 				$object->phone					= GETPOST('phone', 'alpha');
2091
-				$object->phone_mobile			= (string) GETPOST('phone_mobile', 'alpha');
2091
+				$object->phone_mobile = (string) GETPOST('phone_mobile', 'alpha');
2092 2092
 				$object->fax					= GETPOST('fax', 'alpha');
2093 2093
 				$object->email					= GETPOST('email', 'email');
2094
-				$object->no_email				= GETPOSTINT("no_email");
2094
+				$object->no_email = GETPOSTINT("no_email");
2095 2095
 				$object->url					= GETPOST('url', 'url');
2096 2096
 				$object->capital				= GETPOSTFLOAT('capital');
2097 2097
 				$object->idprof1				= GETPOST('idprof1', 'alphanohtml');
@@ -2107,16 +2107,16 @@  discard block
 block discarded – undo
2107 2107
 				$object->default_lang = GETPOST('default_lang', 'alpha');
2108 2108
 
2109 2109
 				$object->tva_assuj				= GETPOSTINT('assujtva_value');
2110
-				$object->vat_reverse_charge		= GETPOST('vat_reverse_charge') == 'on' ? 1 : 0;
2110
+				$object->vat_reverse_charge = GETPOST('vat_reverse_charge') == 'on' ? 1 : 0;
2111 2111
 				$object->tva_intra				= GETPOST('tva_intra', 'alphanohtml');
2112
-				$object->status =				GETPOSTINT('status');
2112
+				$object->status = GETPOSTINT('status');
2113 2113
 
2114 2114
 				// Webservices url/key
2115 2115
 				$object->webservices_url        = GETPOST('webservices_url', 'url');
2116 2116
 				$object->webservices_key        = GETPOST('webservices_key', 'san_alpha');
2117 2117
 
2118 2118
 				if (GETPOSTISSET('accountancy_code_sell')) {
2119
-					$accountancy_code_sell  = GETPOST('accountancy_code_sell', 'alpha');
2119
+					$accountancy_code_sell = GETPOST('accountancy_code_sell', 'alpha');
2120 2120
 
2121 2121
 					if (empty($accountancy_code_sell) || $accountancy_code_sell == '-1') {
2122 2122
 						$object->accountancy_code_sell = '';
@@ -2125,7 +2125,7 @@  discard block
 block discarded – undo
2125 2125
 					}
2126 2126
 				}
2127 2127
 				if (GETPOSTISSET('accountancy_code_buy')) {
2128
-					$accountancy_code_buy   = GETPOST('accountancy_code_buy', 'alpha');
2128
+					$accountancy_code_buy = GETPOST('accountancy_code_buy', 'alpha');
2129 2129
 
2130 2130
 					if (empty($accountancy_code_buy) || $accountancy_code_buy == '-1') {
2131 2131
 						$object->accountancy_code_buy = '';
@@ -2207,7 +2207,7 @@  discard block
 block discarded – undo
2207 2207
     				}
2208 2208
     			});
2209 2209
 
2210
-				var canHaveCustomerCategoryIfNotCustomerProspect = ' . (getDolGlobalInt('THIRDPARTY_CAN_HAVE_CUSTOMER_CATEGORY_EVEN_IF_NOT_CUSTOMER_PROSPECT') ? '1' : '0') . ';
2210
+				var canHaveCustomerCategoryIfNotCustomerProspect = ' . (getDolGlobalInt('THIRDPARTY_CAN_HAVE_CUSTOMER_CATEGORY_EVEN_IF_NOT_CUSTOMER_PROSPECT') ? '1' : '0').';
2211 2211
 
2212 2212
 				init_customer_categ();
2213 2213
 	  			$("#customerprospect").change(function() {
@@ -2394,7 +2394,7 @@  discard block
 block discarded – undo
2394 2394
 					$colspan = 3;
2395 2395
 				}
2396 2396
 
2397
-				print '<tr><td>'.$form->editfieldkey('CustomerCode', 'customer_code', '', $object, 0).'</td><td'.($colspan ? ' colspan="'.$colspan.'"': '').'>';
2397
+				print '<tr><td>'.$form->editfieldkey('CustomerCode', 'customer_code', '', $object, 0).'</td><td'.($colspan ? ' colspan="'.$colspan.'"' : '').'>';
2398 2398
 				print '<table class="nobordernopadding"><tr><td>';
2399 2399
 				$tmpcode = $object->code_client ?? '';
2400 2400
 				if (empty($tmpcode) && !empty($modCodeClient->code_auto)) {
@@ -2411,7 +2411,7 @@  discard block
 block discarded – undo
2411 2411
 					print '</tr><tr>';
2412 2412
 				}
2413 2413
 
2414
-				print '<td>'.$form->editfieldkey('SupplierCode', 'supplier_code', '', $object, 0).'</td><td'.($colspan ? ' colspan="'.$colspan.'"': '').'>';
2414
+				print '<td>'.$form->editfieldkey('SupplierCode', 'supplier_code', '', $object, 0).'</td><td'.($colspan ? ' colspan="'.$colspan.'"' : '').'>';
2415 2415
 
2416 2416
 				if ((isModEnabled("fournisseur") && $user->hasRight('fournisseur', 'lire') && !getDolGlobalString('MAIN_USE_NEW_SUPPLIERMOD')) || (isModEnabled("supplier_order") && $user->hasRight('supplier_order', 'lire')) || (isModEnabled("supplier_invoice") && $user->hasRight('supplier_invoice', 'lire'))) {
2417 2417
 					print '<table class="nobordernopadding"><tr><td>';
@@ -2592,14 +2592,14 @@  discard block
 block discarded – undo
2592 2592
 
2593 2593
 				// VAT is used
2594 2594
 				print '<tr><td>'.$form->editfieldkey('VATIsUsed', 'assujtva_value', '', $object, 0).'</td><td colspan="3">';
2595
-				print '<input id="assujtva_value" name="assujtva_value" type="checkbox" ' . ($object->tva_assuj ? 'checked="checked"' : '') . ' value="1">';
2595
+				print '<input id="assujtva_value" name="assujtva_value" type="checkbox" '.($object->tva_assuj ? 'checked="checked"' : '').' value="1">';
2596 2596
 				print '</td></tr>';
2597 2597
 
2598 2598
 				// Local Taxes
2599 2599
 				//TODO: Place into a function to control showing by country or study better option
2600 2600
 				if ($mysoc->localtax1_assuj == "1" && $mysoc->localtax2_assuj == "1") {
2601 2601
 					print '<tr><td>'.$form->editfieldkey($langs->transcountry("LocalTax1IsUsed", $mysoc->country_code), 'localtax1assuj_value', '', $object, 0).'</td><td>';
2602
-					print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" ' . ($object->localtax1_assuj ? 'checked="checked"' : '') . ' value="1">';
2602
+					print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" '.($object->localtax1_assuj ? 'checked="checked"' : '').' value="1">';
2603 2603
 					if (!isOnlyOneLocalTax(1)) {
2604 2604
 						print '<span class="cblt1">     '.$langs->transcountry("Type", $mysoc->country_code).': ';
2605 2605
 						$formcompany->select_localtax(1, (float) $object->localtax1_value, "lt1");
@@ -2608,7 +2608,7 @@  discard block
 block discarded – undo
2608 2608
 					print '</td>';
2609 2609
 					print '</tr><tr>';
2610 2610
 					print '<td>'.$form->editfieldkey($langs->transcountry("LocalTax2IsUsed", $mysoc->country_code), 'localtax2assuj_value', '', $object, 0).'</td><td>';
2611
-					print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" ' . ($object->localtax2_assuj ? 'checked="checked"' : '') . ' value="1"></td></tr>';
2611
+					print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" '.($object->localtax2_assuj ? 'checked="checked"' : '').' value="1"></td></tr>';
2612 2612
 					if (!isOnlyOneLocalTax(2)) {
2613 2613
 						print '<span class="cblt2">     '.$langs->transcountry("Type", $mysoc->country_code).': ';
2614 2614
 						$formcompany->select_localtax(2, (float) $object->localtax2_value, "lt2");
@@ -2617,7 +2617,7 @@  discard block
 block discarded – undo
2617 2617
 					print '</td></tr>';
2618 2618
 				} elseif ($mysoc->localtax1_assuj == "1" && $mysoc->localtax2_assuj != "1") {
2619 2619
 					print '<tr><td>'.$form->editfieldkey($langs->transcountry("LocalTax1IsUsed", $mysoc->country_code), 'localtax1assuj_value', '', $object, 0).'</td><td colspan="3">';
2620
-					print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" ' . ($object->localtax1_assuj ? 'checked="checked"' : '') . ' value="1">';
2620
+					print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" '.($object->localtax1_assuj ? 'checked="checked"' : '').' value="1">';
2621 2621
 					if (!isOnlyOneLocalTax(1)) {
2622 2622
 						print '<span class="cblt1">     '.$langs->transcountry("Type", $mysoc->country_code).': ';
2623 2623
 						$formcompany->select_localtax(1, (float) $object->localtax1_value, "lt1");
@@ -2626,7 +2626,7 @@  discard block
 block discarded – undo
2626 2626
 					print '</td></tr>';
2627 2627
 				} elseif ($mysoc->localtax2_assuj == "1" && $mysoc->localtax1_assuj != "1") {
2628 2628
 					print '<tr><td>'.$form->editfieldkey($langs->transcountry("LocalTax2IsUsed", $mysoc->country_code), 'localtax2assuj_value', '', $object, 0).'</td><td colspan="3">';
2629
-					print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" ' . ($object->localtax2_assuj ? 'checked="checked"' : '') . ' value="1">';
2629
+					print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" '.($object->localtax2_assuj ? 'checked="checked"' : '').' value="1">';
2630 2630
 					if (!isOnlyOneLocalTax(2)) {
2631 2631
 						print '<span class="cblt2">     '.$langs->transcountry("Type", $mysoc->country_code).': ';
2632 2632
 						$formcompany->select_localtax(2, (float) $object->localtax2_value, "lt2");
@@ -2637,7 +2637,7 @@  discard block
 block discarded – undo
2637 2637
 
2638 2638
 				// VAT reverse charge by default
2639 2639
 				if (getDolGlobalString('ACCOUNTING_FORCE_ENABLE_VAT_REVERSE_CHARGE')) {
2640
-					print '<tr><td>' . $form->editfieldkey('VATReverseChargeByDefault', 'vat_reverse_charge', '', $object, 0) . '</td><td colspan="3">';
2640
+					print '<tr><td>'.$form->editfieldkey('VATReverseChargeByDefault', 'vat_reverse_charge', '', $object, 0).'</td><td colspan="3">';
2641 2641
 					print '<input type="checkbox" name="vat_reverse_charge" '.($object->vat_reverse_charge == '1' ? ' checked' : '').'>';
2642 2642
 					print '</td></tr>';
2643 2643
 				}
@@ -2799,7 +2799,7 @@  discard block
 block discarded – undo
2799 2799
 					$maxfilesizearray = getMaxFileSizeArray();
2800 2800
 					$maxmin = $maxfilesizearray['maxmin'];
2801 2801
 					if ($maxmin > 0) {
2802
-						print '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">';	// MAX_FILE_SIZE must precede the field type=file
2802
+						print '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file
2803 2803
 					}
2804 2804
 					print '<input type="file" class="flat" name="photo" id="photoinput">';
2805 2805
 					print '</td></tr>';
@@ -3035,7 +3035,7 @@  discard block
 block discarded – undo
3035 3035
 					print '<tr><td>';
3036 3036
 					print $form->textwithpicto($langs->trans('VATReverseChargeByDefault'), $langs->trans('VATReverseChargeByDefaultDesc'));
3037 3037
 					print '</td><td>';
3038
-					print '<input type="checkbox" name="vat_reverse_charge" ' . ($object->vat_reverse_charge == '1' ? ' checked' : '') . ' disabled>';
3038
+					print '<input type="checkbox" name="vat_reverse_charge" '.($object->vat_reverse_charge == '1' ? ' checked' : '').' disabled>';
3039 3039
 					print '</td>';
3040 3040
 					print '</tr>';
3041 3041
 				}
Please login to merge, or discard this patch.
htdocs/api/class/api_documents.class.php 1 patch
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
 				throw new RestException(500, 'Error generating document');
212 212
 			}
213 213
 		} elseif ($modulepart == 'facture_fournisseur' || $modulepart == 'invoice_supplier') {
214
-			require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.facture.class.php';
214
+			require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
215 215
 			$tmpobject = new FactureFournisseur($this->db);
216 216
 			$result = $tmpobject->fetch(0, preg_replace('/\.[^\.]+$/', '', basename($original_file)));
217 217
 			if (!$result) {
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
 				throw new RestException(500, 'Error generating document');
249 249
 			}
250 250
 		} elseif ($modulepart == 'contrat' || $modulepart == 'contract') {
251
-			require_once DOL_DOCUMENT_ROOT . '/contrat/class/contrat.class.php';
251
+			require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
252 252
 
253 253
 			$tmpobject = new Contrat($this->db);
254 254
 			$result = $tmpobject->fetch(0, preg_replace('/\.[^\.]+$/', '', basename($original_file)));
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
 				throw new RestException(500, 'Error generating document missing doctemplate parameter');
265 265
 			}
266 266
 		} elseif ($modulepart == 'expedition' || $modulepart == 'shipment') {
267
-			require_once DOL_DOCUMENT_ROOT . '/expedition/class/expedition.class.php';
267
+			require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php';
268 268
 
269 269
 			$tmpobject = new Expedition($this->db);
270 270
 			$result = $tmpobject->fetch(0, preg_replace('/\.[^\.]+$/', '', basename($original_file)));
@@ -280,7 +280,7 @@  discard block
 block discarded – undo
280 280
 				throw new RestException(500, 'Error generating document missing doctemplate parameter');
281 281
 			}
282 282
 		} elseif ($modulepart == 'mrp') {
283
-			require_once DOL_DOCUMENT_ROOT . '/mrp/class/mo.class.php';
283
+			require_once DOL_DOCUMENT_ROOT.'/mrp/class/mo.class.php';
284 284
 
285 285
 			$tmpobject = new Mo($this->db);
286 286
 			$result = $tmpobject->fetch(0, preg_replace('/\.[^\.]+$/', '', basename($original_file)));
@@ -384,7 +384,7 @@  discard block
 block discarded – undo
384 384
 				throw new RestException(404, 'User not found');
385 385
 			}
386 386
 
387
-			$upload_dir = getMultidirOutput($object) . '/'.get_exdir(0, 0, 0, 0, $object, 'user').'/'.$object->id;
387
+			$upload_dir = getMultidirOutput($object).'/'.get_exdir(0, 0, 0, 0, $object, 'user').'/'.$object->id;
388 388
 		} elseif ($modulepart == 'adherent' || $modulepart == 'member') {
389 389
 			require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
390 390
 
@@ -398,7 +398,7 @@  discard block
 block discarded – undo
398 398
 				throw new RestException(404, 'Member not found');
399 399
 			}
400 400
 
401
-			$upload_dir = getMultidirOutput($object) . "/".get_exdir(0, 0, 0, 1, $object, 'member');
401
+			$upload_dir = getMultidirOutput($object)."/".get_exdir(0, 0, 0, 1, $object, 'member');
402 402
 		} elseif ($modulepart == 'propal' || $modulepart == 'proposal') {
403 403
 			require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
404 404
 
@@ -440,7 +440,7 @@  discard block
 block discarded – undo
440 440
 				throw new RestException(404, 'Order not found');
441 441
 			}
442 442
 
443
-			$upload_dir = getMultidirOutput($object). "/".get_exdir(0, 0, 0, 1, $object, 'commande');
443
+			$upload_dir = getMultidirOutput($object)."/".get_exdir(0, 0, 0, 1, $object, 'commande');
444 444
 		} elseif ($modulepart == 'commande_fournisseur' || $modulepart == 'supplier_order') {
445 445
 			$modulepart = 'supplier_order';
446 446
 
@@ -456,7 +456,7 @@  discard block
 block discarded – undo
456 456
 				throw new RestException(404, 'Purchase order not found');
457 457
 			}
458 458
 
459
-			$upload_dir = getMultidirOutput($object) . "/commande/".dol_sanitizeFileName($object->ref);
459
+			$upload_dir = getMultidirOutput($object)."/commande/".dol_sanitizeFileName($object->ref);
460 460
 		} elseif ($modulepart == 'shipment' || $modulepart == 'expedition') {
461 461
 			require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php';
462 462
 
@@ -470,7 +470,7 @@  discard block
 block discarded – undo
470 470
 				throw new RestException(404, 'Shipment not found');
471 471
 			}
472 472
 
473
-			$upload_dir = getMultidirOutput($object) . "/sending/".get_exdir(0, 0, 0, 1, $object, 'shipment');
473
+			$upload_dir = getMultidirOutput($object)."/sending/".get_exdir(0, 0, 0, 1, $object, 'shipment');
474 474
 		} elseif ($modulepart == 'facture' || $modulepart == 'invoice') {
475 475
 			require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
476 476
 
@@ -484,7 +484,7 @@  discard block
 block discarded – undo
484 484
 				throw new RestException(404, 'Invoice not found');
485 485
 			}
486 486
 
487
-			$upload_dir = getMultidirOutput($object) . "/".get_exdir(0, 0, 0, 1, $object, 'invoice');
487
+			$upload_dir = getMultidirOutput($object)."/".get_exdir(0, 0, 0, 1, $object, 'invoice');
488 488
 		} elseif ($modulepart == 'facture_fournisseur' || $modulepart == 'supplier_invoice') {
489 489
 			$modulepart = 'supplier_invoice';
490 490
 
@@ -500,7 +500,7 @@  discard block
 block discarded – undo
500 500
 				throw new RestException(404, 'Invoice not found');
501 501
 			}
502 502
 
503
-			$upload_dir = getMultidirOutput($object) . "/facture/".get_exdir($object->id, 2, 0, 0, $object, 'invoice_supplier').dol_sanitizeFileName($object->ref);
503
+			$upload_dir = getMultidirOutput($object)."/facture/".get_exdir($object->id, 2, 0, 0, $object, 'invoice_supplier').dol_sanitizeFileName($object->ref);
504 504
 		} elseif ($modulepart == 'produit' || $modulepart == 'product' || $modulepart == 'service') {
505 505
 			require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
506 506
 
@@ -530,7 +530,7 @@  discard block
 block discarded – undo
530 530
 				throw new RestException(404, 'Event not found');
531 531
 			}
532 532
 
533
-			$upload_dir = getMultidirOutput($object) . '/'.dol_sanitizeFileName($object->ref);
533
+			$upload_dir = getMultidirOutput($object).'/'.dol_sanitizeFileName($object->ref);
534 534
 		} elseif ($modulepart == 'expensereport') {
535 535
 			require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php';
536 536
 
@@ -544,7 +544,7 @@  discard block
 block discarded – undo
544 544
 				throw new RestException(404, 'Expense report not found');
545 545
 			}
546 546
 
547
-			$upload_dir = getMultidirOutput($object) . '/'.dol_sanitizeFileName($object->ref);
547
+			$upload_dir = getMultidirOutput($object).'/'.dol_sanitizeFileName($object->ref);
548 548
 		} elseif ($modulepart == 'ticket') {
549 549
 			require_once DOL_DOCUMENT_ROOT.'/ticket/class/ticket.class.php';
550 550
 
@@ -572,7 +572,7 @@  discard block
 block discarded – undo
572 572
 				throw new RestException(404, 'KM article not found');
573 573
 			}
574 574
 
575
-			$upload_dir = getMultidirOutput($object) . '/knowledgerecord/'.dol_sanitizeFileName($object->ref);
575
+			$upload_dir = getMultidirOutput($object).'/knowledgerecord/'.dol_sanitizeFileName($object->ref);
576 576
 		} elseif ($modulepart == 'categorie' || $modulepart == 'category') {
577 577
 			require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
578 578
 
@@ -605,7 +605,7 @@  discard block
 block discarded – undo
605 605
 			// $recursive = 0;
606 606
 		} elseif ($modulepart == 'contrat' || $modulepart == 'contract') {
607 607
 			$modulepart = 'contrat';
608
-			require_once DOL_DOCUMENT_ROOT . '/contrat/class/contrat.class.php';
608
+			require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
609 609
 
610 610
 			$object = new Contrat($this->db);
611 611
 			$result = $object->fetch($id, $ref);
@@ -613,10 +613,10 @@  discard block
 block discarded – undo
613 613
 				throw new RestException(404, 'Contract not found');
614 614
 			}
615 615
 
616
-			$upload_dir = getMultidirOutput($object) . "/" . get_exdir(0, 0, 0, 1, $object, 'contract');
616
+			$upload_dir = getMultidirOutput($object)."/".get_exdir(0, 0, 0, 1, $object, 'contract');
617 617
 		} elseif ($modulepart == 'intervention' || $modulepart == 'ficheinter') {
618 618
 			$modulepart = 'ficheinter';
619
-			require_once DOL_DOCUMENT_ROOT . '/fichinter/class/fichinter.class.php';
619
+			require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php';
620 620
 
621 621
 			$object = new Fichinter($this->db);
622 622
 			$result = $object->fetch($id, $ref);
@@ -624,10 +624,10 @@  discard block
 block discarded – undo
624 624
 				throw new RestException(404, 'Interventional not found');
625 625
 			}
626 626
 
627
-			$upload_dir = $conf->ficheinter->dir_output . "/" . get_exdir(0, 0, 0, 1, $object, 'ficheinter');
627
+			$upload_dir = $conf->ficheinter->dir_output."/".get_exdir(0, 0, 0, 1, $object, 'ficheinter');
628 628
 		} elseif ($modulepart == 'projet' || $modulepart == 'project') {
629 629
 			$modulepart = 'project';
630
-			require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
630
+			require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
631 631
 
632 632
 			$object = new Project($this->db);
633 633
 			$result = $object->fetch($id, $ref);
@@ -635,10 +635,10 @@  discard block
 block discarded – undo
635 635
 				throw new RestException(404, 'Project not found');
636 636
 			}
637 637
 
638
-			$upload_dir = getMultidirOutput($object) . "/" . get_exdir(0, 0, 0, 1, $object, 'project');
638
+			$upload_dir = getMultidirOutput($object)."/".get_exdir(0, 0, 0, 1, $object, 'project');
639 639
 		} elseif ($modulepart == 'mrp') {
640 640
 			$modulepart = 'mrp';
641
-			require_once DOL_DOCUMENT_ROOT . '/mrp/class/mo.class.php';
641
+			require_once DOL_DOCUMENT_ROOT.'/mrp/class/mo.class.php';
642 642
 
643 643
 			$object = new Mo($this->db);
644 644
 			$result = $object->fetch($id, $ref);
@@ -646,23 +646,23 @@  discard block
 block discarded – undo
646 646
 				throw new RestException(404, 'MO not found');
647 647
 			}
648 648
 
649
-			$upload_dir = getMultidirOutput($object) . "/" . get_exdir(0, 0, 0, 1, $object, 'mrp');
649
+			$upload_dir = getMultidirOutput($object)."/".get_exdir(0, 0, 0, 1, $object, 'mrp');
650 650
 		} elseif ($modulepart == 'contact' || $modulepart == 'socpeople') {
651 651
 			$modulepart = 'contact';
652 652
 			require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
653 653
 
654 654
 			$object = new Contact($this->db);
655
-			$result = $object->fetch($id?$id:$ref);
655
+			$result = $object->fetch($id ? $id : $ref);
656 656
 			if (!$result) {
657 657
 				throw new RestException(404, 'Contact not found');
658 658
 			}
659
-			$upload_dir = $conf->societe->multidir_output[$object->entity ?? $conf->entity] . "/contact/" . get_exdir(0, 0, 0, 1, $object, 'contact');
659
+			$upload_dir = $conf->societe->multidir_output[$object->entity ?? $conf->entity]."/contact/".get_exdir(0, 0, 0, 1, $object, 'contact');
660 660
 		} else {
661 661
 			throw new RestException(500, 'Modulepart '.$modulepart.' not implemented yet.');
662 662
 		}
663 663
 
664 664
 		$objectType = $modulepart;
665
-		if (! empty($object->id) && ! empty($object->table_element)) {
665
+		if (!empty($object->id) && !empty($object->table_element)) {
666 666
 			$objectType = $object->table_element;
667 667
 		}
668 668
 
@@ -680,7 +680,7 @@  discard block
 block discarded – undo
680 680
 					throw new RestException(503, 'Error when retrieve ecm list : '.$this->db->lasterror());
681 681
 				} elseif (is_array($ecmfile->lines) && count($ecmfile->lines) > 0) {
682 682
 					$count = count($filearray);
683
-					for ($i = 0 ; $i < $count ; $i++) {
683
+					for ($i = 0; $i < $count; $i++) {
684 684
 						foreach ($ecmfile->lines as $line) {
685 685
 							unset($line->db);
686 686
 							if ($filearray[$i]['name'] == $line->filename) {
@@ -860,7 +860,7 @@  discard block
 block discarded – undo
860 860
 				$object = new Propal($this->db);
861 861
 			} elseif ($modulepart == 'agenda' || $modulepart == 'action' || $modulepart == 'event') {
862 862
 				$modulepart = 'agenda';
863
-				require_once DOL_DOCUMENT_ROOT . '/comm/action/class/actioncomm.class.php';
863
+				require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
864 864
 				$object = new ActionComm($this->db);
865 865
 			} elseif ($modulepart == 'contact' || $modulepart == 'socpeople') {
866 866
 				$modulepart = 'contact';
@@ -869,11 +869,11 @@  discard block
 block discarded – undo
869 869
 				$fetchbyid = true;
870 870
 			} elseif ($modulepart == 'contrat' || $modulepart == 'contract') {
871 871
 				$modulepart = 'contrat';
872
-				require_once DOL_DOCUMENT_ROOT . '/contrat/class/contrat.class.php';
872
+				require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
873 873
 				$object = new Contrat($this->db);
874 874
 			} elseif ($modulepart == 'mrp') {
875 875
 				$modulepart = 'mrp';
876
-				require_once DOL_DOCUMENT_ROOT . '/mrp/class/mo.class.php';
876
+				require_once DOL_DOCUMENT_ROOT.'/mrp/class/mo.class.php';
877 877
 				$object = new Mo($this->db);
878 878
 			} elseif ($modulepart == 'ecm') {
879 879
 				throw new RestException(500, 'Using a non empty "ref" is not compatible with using modulepart = '.$modulepart);
Please login to merge, or discard this patch.
htdocs/partnership/class/partnershiputils.class.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 	{
80 80
 		global $conf, $langs, $user;
81 81
 
82
-		$managedfor	= getDolGlobalString('PARTNERSHIP_IS_MANAGED_FOR', 'thirdparty');
82
+		$managedfor = getDolGlobalString('PARTNERSHIP_IS_MANAGED_FOR', 'thirdparty');
83 83
 
84 84
 		if ($managedfor != 'member') {
85 85
 			return 0; // If option 'PARTNERSHIP_IS_MANAGED_FOR' = 'thirdparty', this cron job does nothing.
@@ -194,7 +194,7 @@  discard block
 block discarded – undo
194 194
 
195 195
 							$subject = make_substitutions($arraydefaultmessage->topic, $substitutionarray, $outputlangs);
196 196
 							$msg     = make_substitutions($arraydefaultmessage->content, $substitutionarray, $outputlangs);
197
-							$from = dol_string_nospecial($conf->global->MAIN_INFO_SOCIETE_NOM, ' ', array(",")).' <' . getDolGlobalString('MAIN_INFO_SOCIETE_MAIL').'>';
197
+							$from = dol_string_nospecial($conf->global->MAIN_INFO_SOCIETE_NOM, ' ', array(",")).' <'.getDolGlobalString('MAIN_INFO_SOCIETE_MAIL').'>';
198 198
 
199 199
 							// We are in the case of autocancellation subscription because of missing backlink
200 200
 							$fk_partner = $object->fk_member;
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
 									$object->actionmsg2 = $langs->transnoentities("PartnershipSentByEMail", $object->ref);
228 228
 									; // Short text ($langs->transnoentities('MailSentByTo')...);
229 229
 									if (getDolGlobalString('MAIN_MAIL_REPLACE_EVENT_TITLE_BY_EMAIL_SUBJECT')) {
230
-										$object->actionmsg2		= $subject; // Short text
230
+										$object->actionmsg2 = $subject; // Short text
231 231
 									}
232 232
 
233 233
 									$object->trackid = $trackid;
@@ -420,7 +420,7 @@  discard block
 block discarded – undo
420 420
 
421 421
 									$subject = make_substitutions($arraydefaultmessage->topic, $substitutionarray, $outputlangs);
422 422
 									$msg     = make_substitutions($arraydefaultmessage->content, $substitutionarray, $outputlangs);
423
-									$from = dol_string_nospecial($conf->global->MAIN_INFO_SOCIETE_NOM, ' ', array(",")).' <' . getDolGlobalString('MAIN_INFO_SOCIETE_MAIL').'>';
423
+									$from = dol_string_nospecial($conf->global->MAIN_INFO_SOCIETE_NOM, ' ', array(",")).' <'.getDolGlobalString('MAIN_INFO_SOCIETE_MAIL').'>';
424 424
 
425 425
 									$sendto = $obj->email;
426 426
 
@@ -451,7 +451,7 @@  discard block
 block discarded – undo
451 451
 											$object->actionmsg2 = $langs->transnoentities("PartnershipSentByEMail", $object->ref);
452 452
 											; // Short text ($langs->transnoentities('MailSentByTo')...);
453 453
 											if (getDolGlobalString('MAIN_MAIL_REPLACE_EVENT_TITLE_BY_EMAIL_SUBJECT')) {
454
-												$object->actionmsg2		= $subject; // Short text
454
+												$object->actionmsg2 = $subject; // Short text
455 455
 											}
456 456
 
457 457
 											$object->trackid = $trackid;
@@ -561,12 +561,12 @@  discard block
 block discarded – undo
561 561
 				$url = $href->getAttribute('href');
562 562
 				$url = filter_var($url, FILTER_SANITIZE_URL);
563 563
 				if (!(!filter_var($url, FILTER_VALIDATE_URL))) {
564
-					$webcontent .= $url;	// $webcontent is used for a test only, so having content not completely sanitized is not a problem.
564
+					$webcontent .= $url; // $webcontent is used for a test only, so having content not completely sanitized is not a problem.
565 565
 				}
566 566
 			}
567 567
 		}
568 568
 
569
-		if ($webcontent && getDolGlobalString('PARTNERSHIP_BACKLINKS_TO_CHECK') && preg_match('/' . getDolGlobalString('PARTNERSHIP_BACKLINKS_TO_CHECK').'/', $webcontent)) {
569
+		if ($webcontent && getDolGlobalString('PARTNERSHIP_BACKLINKS_TO_CHECK') && preg_match('/'.getDolGlobalString('PARTNERSHIP_BACKLINKS_TO_CHECK').'/', $webcontent)) {
570 570
 			$found = 1;
571 571
 		}
572 572
 
Please login to merge, or discard this patch.
htdocs/adherents/card.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
 $action = GETPOST('action', 'aZ09');
67 67
 $cancel = GETPOST('cancel', 'alpha');
68 68
 $backtopage = GETPOST('backtopage', 'alpha');
69
-$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha');	// if not set, $backtopage will be used
69
+$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); // if not set, $backtopage will be used
70 70
 $confirm = GETPOST('confirm', 'alpha');
71 71
 $rowid = GETPOSTINT('rowid');
72 72
 $id = GETPOST('id') ? GETPOSTINT('id') : $rowid;
@@ -275,7 +275,7 @@  discard block
 block discarded – undo
275 275
 	}
276 276
 	if ($action == 'confirm_merge' && $confirm == 'yes' && $user->hasRight('adherent', 'creer')) {
277 277
 		$member_origin_id = GETPOSTINT('member_origin');
278
-		$member_origin = new Adherent($db);		// The thirdparty that we will delete
278
+		$member_origin = new Adherent($db); // The thirdparty that we will delete
279 279
 
280 280
 		if ($member_origin_id <= 0) {
281 281
 			$langs->load('errors');
@@ -334,7 +334,7 @@  discard block
 block discarded – undo
334 334
 		}
335 335
 		// Create new object
336 336
 		if ($result > 0 && !$error) {
337
-			$object->oldcopy = dol_clone($object, 2);  // @phan-suppress-current-line PhanTypeMismatchProperty
337
+			$object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty
338 338
 
339 339
 			// Change values
340 340
 			$object->civility_id = trim(GETPOST("civility_id", 'alphanohtml'));
@@ -343,7 +343,7 @@  discard block
 block discarded – undo
343 343
 			$object->gender      = trim(GETPOST("gender", 'alphanohtml'));
344 344
 			$object->login       = trim(GETPOST("login", 'alphanohtml'));
345 345
 			if (GETPOSTISSET('pass')) {
346
-				$object->pass        = trim(GETPOST("pass", 'password'));	// For password, we must use 'none'
346
+				$object->pass = trim(GETPOST("pass", 'password')); // For password, we must use 'none'
347 347
 			}
348 348
 
349 349
 			$object->societe     = trim(GETPOST("societe", 'alphanohtml')); // deprecated
@@ -398,10 +398,10 @@  discard block
 block discarded – undo
398 398
 			}
399 399
 
400 400
 			// Check if we need to also synchronize password information
401
-			$nosyncuserpass = 1;	// no by default
401
+			$nosyncuserpass = 1; // no by default
402 402
 			if (GETPOSTISSET('pass')) {
403 403
 				if ($object->user_id) {	// If member is linked to a user
404
-					$nosyncuserpass = 0;	// We may try to sync password
404
+					$nosyncuserpass = 0; // We may try to sync password
405 405
 					if ($user->id == $object->user_id) {
406 406
 						if (!$user->hasRight('user', 'self', 'password')) {
407 407
 							$nosyncuserpass = 1; // Disable synchronizing
@@ -511,7 +511,7 @@  discard block
 block discarded – undo
511 511
 		$email = preg_replace('/\s+/', '', GETPOST("member_email", 'aZ09arobase'));
512 512
 		$url = trim(GETPOST('url', 'url'));
513 513
 		$login = GETPOST("member_login", 'alphanohtml');
514
-		$pass = GETPOST("password", 'password');	// For password, we use 'none'
514
+		$pass = GETPOST("password", 'password'); // For password, we use 'none'
515 515
 		$photo = GETPOST("photo", 'alphanohtml');
516 516
 		$morphy = GETPOST("morphy", 'alphanohtml');
517 517
 		$public = GETPOSTINT("public");
@@ -891,7 +891,7 @@  discard block
 block discarded – undo
891 891
 	}
892 892
 
893 893
 	if ($action == 'update_extras' && $permissiontoeditextra) {
894
-		$object->oldcopy = dol_clone($object, 2);  // @phan-suppress-current-line PhanTypeMismatchProperty
894
+		$object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty
895 895
 		$attribute_name = GETPOST('attribute', 'aZ09');
896 896
 
897 897
 		// Fill array 'array_options' with data from update form
@@ -1443,7 +1443,7 @@  discard block
 block discarded – undo
1443 1443
 			$maxfilesizearray = getMaxFileSizeArray();
1444 1444
 			$maxmin = $maxfilesizearray['maxmin'];
1445 1445
 			if ($maxmin > 0) {
1446
-				print '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">';	// MAX_FILE_SIZE must precede the field type=file
1446
+				print '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file
1447 1447
 			}
1448 1448
 			print '<input type="file" class="flat" name="photo" id="photoinput">';
1449 1449
 			print '</td></tr>';
@@ -1682,7 +1682,7 @@  discard block
 block discarded – undo
1682 1682
 
1683 1683
 			if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) {
1684 1684
 				$subject = (string) $arraydefaultmessage->topic;
1685
-				$msg	 = (string) $arraydefaultmessage->content;
1685
+				$msg = (string) $arraydefaultmessage->content;
1686 1686
 			}
1687 1687
 
1688 1688
 			$substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $object);
Please login to merge, or discard this patch.
htdocs/mrp/class/mo.class.php 2 patches
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -794,14 +794,14 @@
 block discarded – undo
794 794
 
795 795
 
796 796
 	/**
797
-	* Recurse through BOM only adding products to list to consume/produce
798
-	*
799
-	* @param  User $user      User that modifies
800
-	* @param  string $role    MoLine Role that products are added as
801
-	* @param  BOM $bom        BOM to parse lines from
802
-	* @param  float $quantity Quantity modifier for sub products/BOM
803
-	* @return int             Return integer <0 if KO, >0 if OK
804
-	*/
797
+	 * Recurse through BOM only adding products to list to consume/produce
798
+	 *
799
+	 * @param  User $user      User that modifies
800
+	 * @param  string $role    MoLine Role that products are added as
801
+	 * @param  BOM $bom        BOM to parse lines from
802
+	 * @param  float $quantity Quantity modifier for sub products/BOM
803
+	 * @return int             Return integer <0 if KO, >0 if OK
804
+	 */
805 805
 	public function processBOM(User $user, $role, $bom, $quantity)
806 806
 	{
807 807
 		$error = 0;
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -849,7 +849,9 @@
 block discarded – undo
849 849
 					}
850 850
 				}
851 851
 			}
852
-			if ($error) break;
852
+			if ($error) {
853
+				break;
854
+			}
853 855
 		}
854 856
 		return $error;
855 857
 	}
Please login to merge, or discard this patch.
htdocs/comm/propal/card.php 1 patch
Spacing   +266 added lines, -266 removed lines patch added patch discarded remove patch
@@ -43,24 +43,24 @@  discard block
 block discarded – undo
43 43
 
44 44
 // Load Dolibarr environment
45 45
 require '../../main.inc.php';
46
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php';
47
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formfile.class.php';
48
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formpropal.class.php';
49
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formmargin.class.php';
50
-require_once DOL_DOCUMENT_ROOT . '/comm/propal/class/propal.class.php';
51
-require_once DOL_DOCUMENT_ROOT . '/comm/action/class/actioncomm.class.php';
52
-require_once DOL_DOCUMENT_ROOT . '/core/modules/propale/modules_propale.php';
53
-require_once DOL_DOCUMENT_ROOT . '/core/lib/propal.lib.php';
54
-require_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php';
55
-require_once DOL_DOCUMENT_ROOT . '/core/class/extrafields.class.php';
56
-require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php';
46
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
47
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
48
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formpropal.class.php';
49
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formmargin.class.php';
50
+require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
51
+require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
52
+require_once DOL_DOCUMENT_ROOT.'/core/modules/propale/modules_propale.php';
53
+require_once DOL_DOCUMENT_ROOT.'/core/lib/propal.lib.php';
54
+require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
55
+require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
56
+require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
57 57
 if (isModEnabled('project')) {
58
-	require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
59
-	require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php';
58
+	require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
59
+	require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
60 60
 }
61 61
 
62 62
 if (isModEnabled('variants')) {
63
-	require_once DOL_DOCUMENT_ROOT . '/variants/class/ProductCombination.class.php';
63
+	require_once DOL_DOCUMENT_ROOT.'/variants/class/ProductCombination.class.php';
64 64
 }
65 65
 
66 66
 /**
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
 $cancel = GETPOST('cancel', 'alpha');
93 93
 $origin = GETPOST('origin', 'alpha');
94 94
 $originid = GETPOSTINT('originid');
95
-$renewal = GETPOST('renewal');	// for contract renewal
95
+$renewal = GETPOST('renewal'); // for contract renewal
96 96
 $confirm = GETPOST('confirm', 'alpha');
97 97
 $backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page
98 98
 $lineid = GETPOSTINT('lineid');
@@ -177,34 +177,34 @@  discard block
 block discarded – undo
177 177
 	setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
178 178
 }
179 179
 if (empty($reshook)) {
180
-	$backurlforlist = DOL_URL_ROOT . '/comm/propal/list.php';
180
+	$backurlforlist = DOL_URL_ROOT.'/comm/propal/list.php';
181 181
 
182 182
 	if (empty($backtopage) || ($cancel && empty($id))) {
183 183
 		if (empty($backtopage) || ($cancel && strpos($backtopage, '__ID__'))) {
184 184
 			if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) {
185 185
 				$backtopage = $backurlforlist;
186 186
 			} else {
187
-				$backtopage = DOL_URL_ROOT . '/comm/propal/card.php?id=' . ((!empty($id) && $id > 0) ? $id : '__ID__');
187
+				$backtopage = DOL_URL_ROOT.'/comm/propal/card.php?id='.((!empty($id) && $id > 0) ? $id : '__ID__');
188 188
 			}
189 189
 		}
190 190
 	}
191 191
 
192 192
 	if ($cancel) {
193 193
 		if (!empty($backtopageforcancel)) {
194
-			header("Location: " . $backtopageforcancel);
194
+			header("Location: ".$backtopageforcancel);
195 195
 			exit;
196 196
 		} elseif (!empty($backtopage)) {
197
-			header("Location: " . $backtopage);
197
+			header("Location: ".$backtopage);
198 198
 			exit;
199 199
 		}
200 200
 		$action = '';
201 201
 	}
202 202
 
203
-	include DOL_DOCUMENT_ROOT . '/core/actions_setnotes.inc.php'; // Must be include, not includ_once
203
+	include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not includ_once
204 204
 
205
-	include DOL_DOCUMENT_ROOT . '/core/actions_dellink.inc.php'; // Must be 'include', not 'include_once'
205
+	include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be 'include', not 'include_once'
206 206
 
207
-	include DOL_DOCUMENT_ROOT . '/core/actions_lineupdown.inc.php'; // Must be 'include', not 'include_once'
207
+	include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; // Must be 'include', not 'include_once'
208 208
 	// Action clone object
209 209
 	if ($action == 'confirm_clone' && $confirm == 'yes' && $usercancreate) {
210 210
 		if (!($socid > 0)) {
@@ -238,7 +238,7 @@  discard block
 block discarded – undo
238 238
 							$object->delivery_date = $date_delivery;
239 239
 							foreach ($object->lines as $line) {
240 240
 								if (isset($line->date_start)) {
241
-									$line->date_start +=  $difference;
241
+									$line->date_start += $difference;
242 242
 								}
243 243
 								if (isset($line->date_end)) {
244 244
 									$line->date_end += $difference;
@@ -266,7 +266,7 @@  discard block
 block discarded – undo
266 266
 						setEventMessages('', $warningMsgLineList, 'warnings');
267 267
 					}
268 268
 
269
-					header("Location: " . $_SERVER['PHP_SELF'] . '?id=' . $result);
269
+					header("Location: ".$_SERVER['PHP_SELF'].'?id='.$result);
270 270
 					exit();
271 271
 				} else {
272 272
 					if (count($object->errors) > 0) {
@@ -280,7 +280,7 @@  discard block
 block discarded – undo
280 280
 		// Cancel proposal
281 281
 		$result = $object->setCancel($user);
282 282
 		if ($result > 0) {
283
-			header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object->id);
283
+			header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id);
284 284
 			exit();
285 285
 		} else {
286 286
 			$langs->load("errors");
@@ -290,7 +290,7 @@  discard block
 block discarded – undo
290 290
 		// Delete proposal
291 291
 		$result = $object->delete($user);
292 292
 		if ($result > 0) {
293
-			header('Location: ' . DOL_URL_ROOT . '/comm/propal/list.php?restore_lastsearch_values=1');
293
+			header('Location: '.DOL_URL_ROOT.'/comm/propal/list.php?restore_lastsearch_values=1');
294 294
 			exit();
295 295
 		} else {
296 296
 			$langs->load("errors");
@@ -322,7 +322,7 @@  discard block
 block discarded – undo
322 322
 			$object->generateDocument($object->model_pdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
323 323
 		}
324 324
 
325
-		header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object->id);
325
+		header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id);
326 326
 		exit();
327 327
 	} elseif ($action == 'confirm_delete_subtotalline' && $confirm == 'yes' && $usercancreate) {
328 328
 		// Delete line
@@ -352,7 +352,7 @@  discard block
 block discarded – undo
352 352
 				$result = $object->generateDocument($object->model_pdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
353 353
 			}
354 354
 			if ($result >= 0) {
355
-				header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $id);
355
+				header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id);
356 356
 				exit();
357 357
 			}
358 358
 		} else {
@@ -622,14 +622,14 @@  discard block
 block discarded – undo
622 622
 
623 623
 					$id = $object->create($user);
624 624
 					if ($id > 0) {
625
-						dol_include_once('/' . $element . '/class/' . $subelement . '.class.php');
625
+						dol_include_once('/'.$element.'/class/'.$subelement.'.class.php');
626 626
 
627 627
 						$classname = ucfirst($subelement);
628 628
 						$srcobject = new $classname($db);
629
-						'@phan-var-force Commande|Propal|Contrat|Fichinter|Expedition $srcobject';  // Can be other class, but CommonObject is too generic
629
+						'@phan-var-force Commande|Propal|Contrat|Fichinter|Expedition $srcobject'; // Can be other class, but CommonObject is too generic
630 630
 						/** @var Commande|Propal|Contrat|Fichinter|Expedition $srcobject */
631 631
 
632
-						dol_syslog("Try to find source object origin=" . $object->origin . " originid=" . $object->origin_id . " to add lines");
632
+						dol_syslog("Try to find source object origin=".$object->origin." originid=".$object->origin_id." to add lines");
633 633
 						$result = $srcobject->fetch($object->origin_id);
634 634
 
635 635
 						if ($result > 0) {
@@ -694,7 +694,7 @@  discard block
 block discarded – undo
694 694
 
695 695
 								$tva_tx = $lines[$i]->tva_tx;
696 696
 								if (!empty($lines[$i]->vat_src_code) && !preg_match('/\(/', $tva_tx)) {
697
-									$tva_tx .= ' (' . $lines[$i]->vat_src_code . ')';
697
+									$tva_tx .= ' ('.$lines[$i]->vat_src_code.')';
698 698
 								}
699 699
 
700 700
 								$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);
@@ -778,7 +778,7 @@  discard block
 block discarded – undo
778 778
 							}
779 779
 						}
780 780
 
781
-						header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $id);
781
+						header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id);
782 782
 						exit();
783 783
 					} else {
784 784
 						$db->rollback();
@@ -826,7 +826,7 @@  discard block
 block discarded – undo
826 826
 					$error++;
827 827
 				} else {
828 828
 					// Needed if object linked modified by trigger (because linked objects can't be fetched two times : linkedObjectsFullLoaded)
829
-					$locationTarget = DOL_URL_ROOT . '/comm/propal/card.php?id=' . $object->id;
829
+					$locationTarget = DOL_URL_ROOT.'/comm/propal/card.php?id='.$object->id;
830 830
 				}
831 831
 
832 832
 				$deposit = null;
@@ -837,7 +837,7 @@  discard block
 block discarded – undo
837 837
 					!$error && GETPOSTINT('statut') == $object::STATUS_SIGNED && GETPOST('generate_deposit') == 'on'
838 838
 					&& !empty($deposit_percent_from_payment_terms) && isModEnabled('invoice') && $user->hasRight('facture', 'creer')
839 839
 				) {
840
-					require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
840
+					require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
841 841
 
842 842
 					$date = dol_mktime(0, 0, 0, GETPOSTINT('datefmonth'), GETPOSTINT('datefday'), GETPOSTINT('datefyear'));
843 843
 					$forceFields = array();
@@ -850,10 +850,10 @@  discard block
 block discarded – undo
850 850
 
851 851
 					if ($deposit) {
852 852
 						setEventMessage('DepositGenerated');
853
-						$locationTarget = DOL_URL_ROOT . '/compta/facture/card.php?id=' . $deposit->id;
853
+						$locationTarget = DOL_URL_ROOT.'/compta/facture/card.php?id='.$deposit->id;
854 854
 					} else {
855 855
 						$error++;
856
-						setEventMessages("Failed to create down payment - " . $object->error, $object->errors, 'errors');
856
+						setEventMessages("Failed to create down payment - ".$object->error, $object->errors, 'errors');
857 857
 					}
858 858
 				}
859 859
 
@@ -878,12 +878,12 @@  discard block
 block discarded – undo
878 878
 					}
879 879
 
880 880
 					if ($locationTarget) {
881
-						header('Location: ' . $locationTarget);
881
+						header('Location: '.$locationTarget);
882 882
 						exit;
883 883
 					}
884 884
 				} else {
885 885
 					$object->status = $oldstatus;
886
-					$object->statut = $oldstatus;	// deprecated
886
+					$object->statut = $oldstatus; // deprecated
887 887
 
888 888
 					$db->rollback();
889 889
 					$action = '';
@@ -902,7 +902,7 @@  discard block
 block discarded – undo
902 902
 				setEventMessages($object->error, $object->errors, 'errors');
903 903
 				$error++;
904 904
 			} else {
905
-				$object->statut = $newstatus;	// deprecated
905
+				$object->statut = $newstatus; // deprecated
906 906
 				$object->status = $newstatus;
907 907
 			}
908 908
 
@@ -920,13 +920,13 @@  discard block
 block discarded – undo
920 920
 
921 921
 		if (!empty($importLines) && is_array($importLines) && !empty($fromElement) && ctype_alpha($fromElement) && !empty($fromElementid)) {
922 922
 			if ($fromElement == 'commande') {
923
-				dol_include_once('/' . $fromElement . '/class/' . $fromElement . '.class.php');
923
+				dol_include_once('/'.$fromElement.'/class/'.$fromElement.'.class.php');
924 924
 				$lineClassName = 'OrderLine';
925 925
 			} elseif ($fromElement == 'propal') {
926
-				dol_include_once('/comm/' . $fromElement . '/class/' . $fromElement . '.class.php');
926
+				dol_include_once('/comm/'.$fromElement.'/class/'.$fromElement.'.class.php');
927 927
 				$lineClassName = 'PropaleLigne';
928 928
 			} elseif ($fromElement == 'facture') {
929
-				dol_include_once('/compta/' . $fromElement . '/class/' . $fromElement . '.class.php');
929
+				dol_include_once('/compta/'.$fromElement.'/class/'.$fromElement.'.class.php');
930 930
 				$lineClassName = 'FactureLigne';
931 931
 			} else {
932 932
 				$lineClassName = null;
@@ -993,14 +993,14 @@  discard block
 block discarded – undo
993 993
 		$object->updateSubtotalLineBlockLines($langs, $object->getRangOfLine($lineid), 'discount', $discount);
994 994
 	}
995 995
 
996
-	include DOL_DOCUMENT_ROOT . '/core/actions_printing.inc.php';
996
+	include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
997 997
 
998 998
 	// Actions to send emails
999 999
 	$actiontypecode = 'AC_OTH_AUTO';
1000 1000
 	$triggersendname = 'PROPAL_SENTBYMAIL';
1001 1001
 	$autocopy = 'MAIN_MAIL_AUTOCOPY_PROPOSAL_TO';
1002
-	$trackid = 'pro' . $object->id;
1003
-	include DOL_DOCUMENT_ROOT . '/core/actions_sendmails.inc.php';
1002
+	$trackid = 'pro'.$object->id;
1003
+	include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
1004 1004
 
1005 1005
 
1006 1006
 	// Go back to draft
@@ -1069,7 +1069,7 @@  discard block
 block discarded – undo
1069 1069
 			}
1070 1070
 			$tvatx = $line->tva_tx;
1071 1071
 			if (!empty($line->vat_src_code)) {
1072
-				$tvatx .= ' (' . $line->vat_src_code . ')';
1072
+				$tvatx .= ' ('.$line->vat_src_code.')';
1073 1073
 			}
1074 1074
 			$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);
1075 1075
 			$object->lines[$key] = $object->line;
@@ -1087,7 +1087,7 @@  discard block
 block discarded – undo
1087 1087
 			if ($prod->price_min > $subprice) {
1088 1088
 				$price_subprice  = price($subprice, 0, $outlangs, 1, -1, -1, 'auto');
1089 1089
 				$price_price_min = price($prod->price_min, 0, $outlangs, 1, -1, -1, 'auto');
1090
-				setEventMessages($prod->ref . ' - ' . $prod->label . ' (' . $price_subprice . ' < ' . $price_price_min . ' ' . strtolower($langs->trans("MinPrice")) . ')' . "\n", null, 'warnings');
1090
+				setEventMessages($prod->ref.' - '.$prod->label.' ('.$price_subprice.' < '.$price_price_min.' '.strtolower($langs->trans("MinPrice")).')'."\n", null, 'warnings');
1091 1091
 			}
1092 1092
 			// Manage $line->subprice and $line->multicurrency_subprice
1093 1093
 			if ($line->subprice <> 0) {
@@ -1157,7 +1157,7 @@  discard block
 block discarded – undo
1157 1157
 		} else {
1158 1158
 			setEventMessages($object->error, $object->errors, 'errors');
1159 1159
 		}
1160
-		header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $id);
1160
+		header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id);
1161 1161
 		exit();
1162 1162
 	} elseif ($action == 'confirm_addsubtotalline' && $usercancreate) {
1163 1163
 		// Handling adding a new subtotal line for subtotals module
@@ -1209,7 +1209,7 @@  discard block
 block discarded – undo
1209 1209
 		} else {
1210 1210
 			setEventMessages($object->error, $object->errors, 'errors');
1211 1211
 		}
1212
-		header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $id);
1212
+		header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id);
1213 1213
 		exit();
1214 1214
 	} elseif (
1215 1215
 		$action == 'addline' && !GETPOST('submitforalllines', 'alpha')
@@ -1254,8 +1254,8 @@  discard block
 block discarded – undo
1254 1254
 
1255 1255
 		$tva_tx = GETPOST('tva_tx', 'alpha');
1256 1256
 
1257
-		$qty = price2num(GETPOST('qty' . $predef, 'alpha'), 'MS', 2);
1258
-		$remise_percent = (GETPOSTISSET('remise_percent' . $predef) ? price2num(GETPOST('remise_percent' . $predef, 'alpha'), '', 2) : 0);
1257
+		$qty = price2num(GETPOST('qty'.$predef, 'alpha'), 'MS', 2);
1258
+		$remise_percent = (GETPOSTISSET('remise_percent'.$predef) ? price2num(GETPOST('remise_percent'.$predef, 'alpha'), '', 2) : 0);
1259 1259
 		if (empty($remise_percent)) {
1260 1260
 			$remise_percent = 0;
1261 1261
 		}
@@ -1267,7 +1267,7 @@  discard block
 block discarded – undo
1267 1267
 		if (is_array($extralabelsline)) {
1268 1268
 			// Get extra fields
1269 1269
 			foreach ($extralabelsline as $key => $value) {
1270
-				unset($_POST["options_" . $key]);
1270
+				unset($_POST["options_".$key]);
1271 1271
 			}
1272 1272
 		}
1273 1273
 
@@ -1339,7 +1339,7 @@  discard block
 block discarded – undo
1339 1339
 
1340 1340
 				if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES')) {
1341 1341
 					// If price per customer
1342
-					require_once DOL_DOCUMENT_ROOT . '/product/class/productcustomerprice.class.php';
1342
+					require_once DOL_DOCUMENT_ROOT.'/product/class/productcustomerprice.class.php';
1343 1343
 					$prodcustprice = new ProductCustomerPrice($db);
1344 1344
 					$filter = array('t.fk_product' => (string) $prod->id, 't.fk_soc' => (string) $object->thirdparty->id);
1345 1345
 
@@ -1403,7 +1403,7 @@  discard block
 block discarded – undo
1403 1403
 					}
1404 1404
 				} elseif (getDolGlobalString('PRODUIT_CUSTOMER_PRICES')) {
1405 1405
 					// If price per customer
1406
-					require_once DOL_DOCUMENT_ROOT . '/product/class/productcustomerprice.class.php';
1406
+					require_once DOL_DOCUMENT_ROOT.'/product/class/productcustomerprice.class.php';
1407 1407
 
1408 1408
 					$prodcustprice = new ProductCustomerPrice($db);
1409 1409
 
@@ -1550,23 +1550,23 @@  discard block
 block discarded – undo
1550 1550
 							$outputlangs->load('products');
1551 1551
 						}
1552 1552
 						if (!empty($prod->customcode)) {
1553
-							$tmptxt .= $outputlangs->transnoentitiesnoconv("CustomsCode") . ': ' . $prod->customcode;
1553
+							$tmptxt .= $outputlangs->transnoentitiesnoconv("CustomsCode").': '.$prod->customcode;
1554 1554
 						}
1555 1555
 						if (!empty($prod->customcode) && !empty($prod->country_code)) {
1556 1556
 							$tmptxt .= ' - ';
1557 1557
 						}
1558 1558
 						if (!empty($prod->country_code)) {
1559
-							$tmptxt .= $outputlangs->transnoentitiesnoconv("CountryOrigin") . ': ' . getCountry($prod->country_code, '', $db, $outputlangs, 0);
1559
+							$tmptxt .= $outputlangs->transnoentitiesnoconv("CountryOrigin").': '.getCountry($prod->country_code, '', $db, $outputlangs, 0);
1560 1560
 						}
1561 1561
 					} else {
1562 1562
 						if (!empty($prod->customcode)) {
1563
-							$tmptxt .= $langs->transnoentitiesnoconv("CustomsCode") . ': ' . $prod->customcode;
1563
+							$tmptxt .= $langs->transnoentitiesnoconv("CustomsCode").': '.$prod->customcode;
1564 1564
 						}
1565 1565
 						if (!empty($prod->customcode) && !empty($prod->country_code)) {
1566 1566
 							$tmptxt .= ' - ';
1567 1567
 						}
1568 1568
 						if (!empty($prod->country_code)) {
1569
-							$tmptxt .= $langs->transnoentitiesnoconv("CountryOrigin") . ': ' . getCountry($prod->country_code, '', $db, $langs, 0);
1569
+							$tmptxt .= $langs->transnoentitiesnoconv("CountryOrigin").': '.getCountry($prod->country_code, '', $db, $langs, 0);
1570 1570
 						}
1571 1571
 					}
1572 1572
 					$tmptxt .= ')';
@@ -1605,11 +1605,11 @@  discard block
 block discarded – undo
1605 1605
 			$localtax2_tx = get_localtax($tva_tx, 2, $object->thirdparty, $mysoc, $tva_npr);
1606 1606
 
1607 1607
 			// Margin
1608
-			$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
1609
-			$buyingprice = price2num((GETPOST('buying_price' . $predef) != '' ? GETPOST('buying_price' . $predef) : ''), '', 2); // If buying_price is '0', we must keep this value
1608
+			$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
1609
+			$buyingprice = price2num((GETPOST('buying_price'.$predef) != '' ? GETPOST('buying_price'.$predef) : ''), '', 2); // If buying_price is '0', we must keep this value
1610 1610
 
1611
-			$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'));
1612
-			$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'));
1611
+			$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'));
1612
+			$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'));
1613 1613
 
1614 1614
 			// Prepare a price equivalent for minimum price check
1615 1615
 			$pu_equivalent = $pu_ht;
@@ -1740,7 +1740,7 @@  discard block
 block discarded – undo
1740 1740
 				if ($prod->price_min > $line->subprice) {
1741 1741
 					$price_subprice = price($line->subprice, 0, $outlangs, 1, -1, -1, 'auto');
1742 1742
 					$price_price_min = price($prod->price_min, 0, $outlangs, 1, -1, -1, 'auto');
1743
-					setEventMessages($prod->ref . ' - ' . $prod->label . ' (' . $price_subprice . ' < ' . $price_price_min . ' ' . strtolower($langs->trans("MinPrice")) . ')' . "\n", null, 'warnings');
1743
+					setEventMessages($prod->ref.' - '.$prod->label.' ('.$price_subprice.' < '.$price_price_min.' '.strtolower($langs->trans("MinPrice")).')'."\n", null, 'warnings');
1744 1744
 				} else {
1745 1745
 					setEventMessages($prod->error, $prod->errors, 'errors');
1746 1746
 				}
@@ -1878,7 +1878,7 @@  discard block
 block discarded – undo
1878 1878
 		$pu_ttc = price2num(GETPOST('price_ttc'), '', 2);
1879 1879
 
1880 1880
 		// Add buying price
1881
-		$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
1881
+		$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
1882 1882
 		$buyingprice = price2num((GETPOST('buying_price') != '' ? GETPOST('buying_price') : ''), '', 2); // If buying_price is '0', we must keep this value
1883 1883
 
1884 1884
 		$pu_ht_devise = price2num(GETPOST('multicurrency_subprice'), '', 2);
@@ -1925,7 +1925,7 @@  discard block
 block discarded – undo
1925 1925
 		if (is_array($extralabelsline)) {
1926 1926
 			// Get extra fields
1927 1927
 			foreach ($extralabelsline as $key => $value) {
1928
-				unset($_POST["options_" . $key]);
1928
+				unset($_POST["options_".$key]);
1929 1929
 			}
1930 1930
 		}
1931 1931
 
@@ -2057,7 +2057,7 @@  discard block
 block discarded – undo
2057 2057
 			}
2058 2058
 		}
2059 2059
 	} elseif ($action == 'updateline' && $usercancreate && GETPOST('cancel', 'alpha')) {
2060
-		header('Location: ' . $_SERVER['PHP_SELF'] . '?id=' . $object->id); //  To re-display card in edit mode
2060
+		header('Location: '.$_SERVER['PHP_SELF'].'?id='.$object->id); //  To re-display card in edit mode
2061 2061
 		exit();
2062 2062
 	} elseif ($action == 'classin' && $usercancreate) {
2063 2063
 		// Set project
@@ -2071,8 +2071,8 @@  discard block
 block discarded – undo
2071 2071
 	} elseif ($action == 'setconditions' && $usercancreate) {
2072 2072
 		// Terms of payment
2073 2073
 		$sql = "SELECT code ";
2074
-		$sql .= "FROM " . $db->prefix() . "c_payment_term";
2075
-		$sql .= " WHERE rowid = " . ((int) GETPOST('cond_reglement_id', 'int'));
2074
+		$sql .= "FROM ".$db->prefix()."c_payment_term";
2075
+		$sql .= " WHERE rowid = ".((int) GETPOST('cond_reglement_id', 'int'));
2076 2076
 		$result = $db->query($sql);
2077 2077
 		if ($result) {
2078 2078
 			$obj = $db->fetch_object($result);
@@ -2137,7 +2137,7 @@  discard block
 block discarded – undo
2137 2137
 			}
2138 2138
 
2139 2139
 			if ($result >= 0) {
2140
-				header("Location: " . $_SERVER['PHP_SELF'] . "?id=" . $object->id);
2140
+				header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
2141 2141
 				exit();
2142 2142
 			} else {
2143 2143
 				if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') {
@@ -2160,7 +2160,7 @@  discard block
 block discarded – undo
2160 2160
 			$result = $object->delete_contact($lineid);
2161 2161
 
2162 2162
 			if ($result >= 0) {
2163
-				header("Location: " . $_SERVER['PHP_SELF'] . "?id=" . $object->id);
2163
+				header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
2164 2164
 				exit();
2165 2165
 			} else {
2166 2166
 				dol_print_error($db);
@@ -2171,7 +2171,7 @@  discard block
 block discarded – undo
2171 2171
 	// Actions to build doc
2172 2172
 	$upload_dir = !empty($conf->propal->multidir_output[$object->entity ?? $conf->entity]) ? $conf->propal->multidir_output[$object->entity ?? $conf->entity] : $conf->propal->dir_output;
2173 2173
 	$permissiontoadd = $usercancreate;
2174
-	include DOL_DOCUMENT_ROOT . '/core/actions_builddoc.inc.php';
2174
+	include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
2175 2175
 }
2176 2176
 
2177 2177
 
@@ -2188,7 +2188,7 @@  discard block
 block discarded – undo
2188 2188
 	$formproject = new FormProjets($db);
2189 2189
 }
2190 2190
 
2191
-$title = $object->ref . " - " . $langs->trans('Card');
2191
+$title = $object->ref." - ".$langs->trans('Card');
2192 2192
 if ($action == 'create') {
2193 2193
 	$title = $langs->trans("NewPropal");
2194 2194
 }
@@ -2254,11 +2254,11 @@  discard block
 block discarded – undo
2254 2254
 				$element = $subelement = 'expedition';
2255 2255
 			}
2256 2256
 
2257
-			dol_include_once('/' . $element . '/class/' . $subelement . '.class.php');
2257
+			dol_include_once('/'.$element.'/class/'.$subelement.'.class.php');
2258 2258
 
2259 2259
 			$classname = ucfirst($subelement);
2260 2260
 			$objectsrc = new $classname($db);
2261
-			'@phan-var-force Commande|Propal|Contrat|Expedition $objectsrc';  // Can be other class, but CommonObject is too generic
2261
+			'@phan-var-force Commande|Propal|Contrat|Expedition $objectsrc'; // Can be other class, but CommonObject is too generic
2262 2262
 			/** @var Commande|Propal|Contrat|Expedition $objectsrc */
2263 2263
 			$objectsrc->fetch($originid);
2264 2264
 			if (empty($objectsrc->lines) && method_exists($objectsrc, 'fetch_lines')) {
@@ -2334,19 +2334,19 @@  discard block
 block discarded – undo
2334 2334
 		}
2335 2335
 	}
2336 2336
 
2337
-	print '<form name="addprop" action="' . $_SERVER["PHP_SELF"] . '" method="POST">';
2338
-	print '<input type="hidden" name="token" value="' . newToken() . '">';
2337
+	print '<form name="addprop" action="'.$_SERVER["PHP_SELF"].'" method="POST">';
2338
+	print '<input type="hidden" name="token" value="'.newToken().'">';
2339 2339
 	print '<input type="hidden" name="action" value="add">';
2340
-	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
2341
-	print '<input type="hidden" name="backtopage" value="' . $backtopage . '">';
2340
+	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
2341
+	print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
2342 2342
 	if ($origin != 'project' && $originid) {
2343
-		print '<input type="hidden" name="origin" value="' . $origin . '">';
2344
-		print '<input type="hidden" name="originid" value="' . $originid . '">';
2343
+		print '<input type="hidden" name="origin" value="'.$origin.'">';
2344
+		print '<input type="hidden" name="originid" value="'.$originid.'">';
2345 2345
 		if ($origin == 'contrat' && !empty($renewal)) {
2346
-			print '<input type="hidden" name="renewal" value="' . $renewal . '">';
2346
+			print '<input type="hidden" name="renewal" value="'.$renewal.'">';
2347 2347
 		}
2348 2348
 	} elseif ($origin == 'project' && !empty($projectid)) {
2349
-		print '<input type="hidden" name="projectid" value="' . $projectid . '">';
2349
+		print '<input type="hidden" name="projectid" value="'.$projectid.'">';
2350 2350
 	}
2351 2351
 
2352 2352
 	print dol_get_fiche_head();
@@ -2359,22 +2359,22 @@  discard block
 block discarded – undo
2359 2359
 		print '<table class="border centpercent">';
2360 2360
 
2361 2361
 		// Reference
2362
-		print '<tr class="field_ref"><td class="titlefieldcreate fieldrequired">' . $langs->trans('Ref') . '</td><td class="valuefieldcreate">' . $langs->trans("Draft") . '</td></tr>';
2362
+		print '<tr class="field_ref"><td class="titlefieldcreate fieldrequired">'.$langs->trans('Ref').'</td><td class="valuefieldcreate">'.$langs->trans("Draft").'</td></tr>';
2363 2363
 
2364 2364
 		// Ref customer
2365
-		print '<tr class="field_ref_client"><td class="titlefieldcreate">' . $langs->trans('RefCustomer') . '</td><td class="valuefieldcreate">';
2366
-		print '<input type="text" name="ref_client" value="' . (!empty($ref_client) ? $ref_client : GETPOST('ref_client')) . '"></td>';
2365
+		print '<tr class="field_ref_client"><td class="titlefieldcreate">'.$langs->trans('RefCustomer').'</td><td class="valuefieldcreate">';
2366
+		print '<input type="text" name="ref_client" value="'.(!empty($ref_client) ? $ref_client : GETPOST('ref_client')).'"></td>';
2367 2367
 		print '</tr>';
2368 2368
 
2369 2369
 		// Third party
2370 2370
 		print '<tr class="field_socid">';
2371
-		print '<td class="titlefieldcreate fieldrequired">' . $langs->trans('Customer') . '</td>';
2371
+		print '<td class="titlefieldcreate fieldrequired">'.$langs->trans('Customer').'</td>';
2372 2372
 		$shipping_method_id = 0;
2373 2373
 		$warehouse_id = 0;
2374 2374
 		if ($socid > 0) {
2375 2375
 			print '<td class="valuefieldcreate">';
2376 2376
 			print $soc->getNomUrl(1, 'customer');
2377
-			print '<input type="hidden" name="socid" value="' . $soc->id . '">';
2377
+			print '<input type="hidden" name="socid" value="'.$soc->id.'">';
2378 2378
 			print '</td>';
2379 2379
 			if (getDolGlobalString('SOCIETE_ASK_FOR_SHIPPING_METHOD') && !empty($soc->shipping_method_id)) {
2380 2380
 				$shipping_method_id = $soc->shipping_method_id;
@@ -2383,7 +2383,7 @@  discard block
 block discarded – undo
2383 2383
 		} else {
2384 2384
 			print '<td class="valuefieldcreate">';
2385 2385
 			$filter = '((s.client:IN:1,2,3) AND (s.status:=:1))';
2386
-			print img_picto('', 'company', 'class="pictofixedwidth"') . $form->select_company('', 'socid', $filter, 'SelectThirdParty', 1, 0, array(), 0, 'minwidth300 maxwidth500 widthcentpercentminusxx');
2386
+			print img_picto('', 'company', 'class="pictofixedwidth"').$form->select_company('', 'socid', $filter, 'SelectThirdParty', 1, 0, array(), 0, 'minwidth300 maxwidth500 widthcentpercentminusxx');
2387 2387
 			// reload page to retrieve customer information
2388 2388
 			if (!getDolGlobalString('RELOAD_PAGE_ON_CUSTOMER_CHANGE_DISABLED')) {
2389 2389
 				print '<script>
@@ -2399,63 +2399,63 @@  discard block
 block discarded – undo
2399 2399
 				});
2400 2400
 				</script>';
2401 2401
 			}
2402
-			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>';
2402
+			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>';
2403 2403
 			print '</td>';
2404 2404
 		}
2405
-		print '</tr>' . "\n";
2405
+		print '</tr>'."\n";
2406 2406
 
2407 2407
 		if ($socid > 0) {
2408 2408
 			// Contacts (ask contact only if thirdparty already defined).
2409
-			print '<tr class="field_contactid"><td class="titlefieldcreate">' . $langs->trans("DefaultContact") . '</td><td class="valuefieldcreate">';
2409
+			print '<tr class="field_contactid"><td class="titlefieldcreate">'.$langs->trans("DefaultContact").'</td><td class="valuefieldcreate">';
2410 2410
 			print img_picto('', 'contact', 'class="pictofixedwidth"');
2411 2411
 			//print $form->selectcontacts($soc->id, $contactid, 'contactid', 1, '', '', 0, 'minwidth300 widthcentpercentminusx');
2412 2412
 			print $form->select_contact($soc->id, $contactid, 'contactid', 1, '', '', 1, 'maxwidth300 widthcentpercentminusx', true);
2413 2413
 			print '</td></tr>';
2414 2414
 
2415 2415
 			// Third party discounts info line
2416
-			print '<tr class="field_discount_info"><td class="titlefieldcreate">' . $langs->trans('Discounts') . '</td><td class="valuefieldcreate">';
2416
+			print '<tr class="field_discount_info"><td class="titlefieldcreate">'.$langs->trans('Discounts').'</td><td class="valuefieldcreate">';
2417 2417
 
2418 2418
 			$absolute_discount = $soc->getAvailableDiscounts();
2419 2419
 
2420 2420
 			$thirdparty = $soc;
2421 2421
 			$discount_type = 0;
2422
-			$backtopage = $_SERVER["PHP_SELF"] . '?socid=' . $thirdparty->id . '&action=' . $action . '&origin=' . urlencode((string) (GETPOST('origin'))) . '&originid=' . urlencode((string) (GETPOSTINT('originid')));
2423
-			include DOL_DOCUMENT_ROOT . '/core/tpl/object_discounts.tpl.php';
2422
+			$backtopage = $_SERVER["PHP_SELF"].'?socid='.$thirdparty->id.'&action='.$action.'&origin='.urlencode((string) (GETPOST('origin'))).'&originid='.urlencode((string) (GETPOSTINT('originid')));
2423
+			include DOL_DOCUMENT_ROOT.'/core/tpl/object_discounts.tpl.php';
2424 2424
 			print '</td></tr>';
2425 2425
 		}
2426 2426
 
2427 2427
 		$newdatepropal = dol_mktime(0, 0, 0, GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear'), 'tzserver');
2428 2428
 		// Date
2429
-		print '<tr class="field_addprop"><td class="titlefieldcreate fieldrequired">' . $langs->trans('DatePropal') . '</td><td class="valuefieldcreate">';
2429
+		print '<tr class="field_addprop"><td class="titlefieldcreate fieldrequired">'.$langs->trans('DatePropal').'</td><td class="valuefieldcreate">';
2430 2430
 		print img_picto('', 'action', 'class="pictofixedwidth"');
2431 2431
 		print $form->selectDate($newdatepropal ? $newdatepropal : $datepropal, '', 0, 0, 0, "addprop", 1, 1);
2432 2432
 		print '</td></tr>';
2433 2433
 
2434 2434
 		// Validaty duration
2435
-		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>';
2435
+		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>';
2436 2436
 
2437 2437
 		// Terms of payment
2438
-		print '<tr class="field_cond_reglement_id"><td class="nowrap">' . $langs->trans('PaymentConditionsShort') . '</td><td>';
2438
+		print '<tr class="field_cond_reglement_id"><td class="nowrap">'.$langs->trans('PaymentConditionsShort').'</td><td>';
2439 2439
 		print img_picto('', 'payment', 'class="pictofixedwidth"');
2440 2440
 		// at last resort we take the payment term id which may be filled by default values set (if not getpostisset)
2441 2441
 		print $form->getSelectConditionsPaiements((int) $cond_reglement_id, 'cond_reglement_id', 1, 1, 0, '', $deposit_percent);
2442 2442
 		print '</td></tr>';
2443 2443
 
2444 2444
 		// Mode of payment
2445
-		print '<tr class="field_mode_reglement_id"><td class="titlefieldcreate">' . $langs->trans('PaymentMode') . '</td><td class="valuefieldcreate">';
2445
+		print '<tr class="field_mode_reglement_id"><td class="titlefieldcreate">'.$langs->trans('PaymentMode').'</td><td class="valuefieldcreate">';
2446 2446
 		print img_picto('', 'bank', 'class="pictofixedwidth"');
2447 2447
 		print $form->select_types_paiements((string) $mode_reglement_id, 'mode_reglement_id', 'CRDT', 0, 1, 0, 0, 1, 'maxwidth200 widthcentpercentminusx', 1);
2448 2448
 		print '</td></tr>';
2449 2449
 
2450 2450
 		// Bank Account
2451 2451
 		if (getDolGlobalString('BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL') && isModEnabled("bank")) {
2452
-			print '<tr class="field_fk_account"><td class="titlefieldcreate">' . $langs->trans('BankAccount') . '</td><td class="valuefieldcreate">';
2453
-			print img_picto('', 'bank_account', 'class="pictofixedwidth"') . $form->select_comptes((int) $fk_account, 'fk_account', 0, '', 1, '', 0, 'maxwidth200 widthcentpercentminusx', 1);
2452
+			print '<tr class="field_fk_account"><td class="titlefieldcreate">'.$langs->trans('BankAccount').'</td><td class="valuefieldcreate">';
2453
+			print img_picto('', 'bank_account', 'class="pictofixedwidth"').$form->select_comptes((int) $fk_account, 'fk_account', 0, '', 1, '', 0, 'maxwidth200 widthcentpercentminusx', 1);
2454 2454
 			print '</td></tr>';
2455 2455
 		}
2456 2456
 
2457 2457
 		// Source / Channel - What trigger creation
2458
-		print '<tr class="field_demand_reason_id"><td class="titlefieldcreate">' . $langs->trans('Source') . '</td><td class="valuefieldcreate">';
2458
+		print '<tr class="field_demand_reason_id"><td class="titlefieldcreate">'.$langs->trans('Source').'</td><td class="valuefieldcreate">';
2459 2459
 		print img_picto('', 'question', 'class="pictofixedwidth"');
2460 2460
 		$form->selectInputReason((GETPOSTISSET('demand_reason_id') ? GETPOSTINT('demand_reason_id') : ''), 'demand_reason_id', "SRC_PROP", 1, 'maxwidth200 widthcentpercentminusx');
2461 2461
 		print '</td></tr>';
@@ -2465,7 +2465,7 @@  discard block
 block discarded – undo
2465 2465
 			if (getDolGlobalString('SOCIETE_ASK_FOR_SHIPPING_METHOD') && !empty($soc->shipping_method_id)) {
2466 2466
 				$shipping_method_id = $soc->shipping_method_id;
2467 2467
 			}
2468
-			print '<tr class="field_shipping_method_id"><td class="titlefieldcreate">' . $langs->trans('SendingMethod') . '</td><td class="valuefieldcreate">';
2468
+			print '<tr class="field_shipping_method_id"><td class="titlefieldcreate">'.$langs->trans('SendingMethod').'</td><td class="valuefieldcreate">';
2469 2469
 			print img_picto('', 'dolly', 'class="pictofixedwidth"');
2470 2470
 			$form->selectShippingMethod((string) (GETPOSTISSET('shipping_method_id') ? GETPOSTINT('shipping_method_id') : $shipping_method_id), 'shipping_method_id', '', 1, '', 0, 'maxwidth200 widthcentpercentminusx');
2471 2471
 			print '</td></tr>';
@@ -2474,17 +2474,17 @@  discard block
 block discarded – undo
2474 2474
 		$formproduct = null;
2475 2475
 		// Warehouse
2476 2476
 		if (isModEnabled('stock') && getDolGlobalString('WAREHOUSE_ASK_WAREHOUSE_DURING_PROPAL')) {
2477
-			require_once DOL_DOCUMENT_ROOT . '/product/class/html.formproduct.class.php';
2477
+			require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
2478 2478
 			$formproduct = new FormProduct($db);
2479
-			print '<tr class="field_warehouse_id"><td class="titlefieldcreate">' . $langs->trans('Warehouse') . '</td><td class="valuefieldcreate">';
2480
-			print img_picto('', 'stock', 'class="pictofixedwidth"') . $formproduct->selectWarehouses($warehouse_id, 'warehouse_id', '', 1, 0, 0, '', 0, 0, array(), 'maxwidth500 widthcentpercentminusxx');
2479
+			print '<tr class="field_warehouse_id"><td class="titlefieldcreate">'.$langs->trans('Warehouse').'</td><td class="valuefieldcreate">';
2480
+			print img_picto('', 'stock', 'class="pictofixedwidth"').$formproduct->selectWarehouses($warehouse_id, 'warehouse_id', '', 1, 0, 0, '', 0, 0, array(), 'maxwidth500 widthcentpercentminusxx');
2481 2481
 			print '</td></tr>';
2482 2482
 		}
2483 2483
 
2484 2484
 		// Delivery delay
2485
-		print '<tr class="field_availability_id"><td class="titlefieldcreate">' . $langs->trans('AvailabilityPeriod');
2485
+		print '<tr class="field_availability_id"><td class="titlefieldcreate">'.$langs->trans('AvailabilityPeriod');
2486 2486
 		if (isModEnabled('order')) {
2487
-			print ' (' . $langs->trans('AfterOrder') . ')';
2487
+			print ' ('.$langs->trans('AfterOrder').')';
2488 2488
 		}
2489 2489
 		print '</td><td class="valuefieldcreate">';
2490 2490
 		print img_picto('', 'clock', 'class="pictofixedwidth"');
@@ -2492,7 +2492,7 @@  discard block
 block discarded – undo
2492 2492
 		print '</td></tr>';
2493 2493
 
2494 2494
 		// Delivery date (or manufacturing)
2495
-		print '<tr class="field_date_livraison"><td class="titlefieldcreate">' . $langs->trans("DeliveryDate") . '</td>';
2495
+		print '<tr class="field_date_livraison"><td class="titlefieldcreate">'.$langs->trans("DeliveryDate").'</td>';
2496 2496
 		print '<td class="valuefieldcreate">';
2497 2497
 		print img_picto('', 'action', 'class="pictofixedwidth"');
2498 2498
 		if (is_numeric(getDolGlobalString('DATE_LIVRAISON_WEEK_DELAY'))) {	// If value set to 0 or a num, not empty
@@ -2500,7 +2500,7 @@  discard block
 block discarded – undo
2500 2500
 			$syear = date("Y", $tmpdte);
2501 2501
 			$smonth = date("m", $tmpdte);
2502 2502
 			$sday = date("d", $tmpdte);
2503
-			print $form->selectDate($syear . "-" . $smonth . "-" . $sday, 'date_livraison', 0, 0, 0, "addprop");
2503
+			print $form->selectDate($syear."-".$smonth."-".$sday, 'date_livraison', 0, 0, 0, "addprop");
2504 2504
 		} else {
2505 2505
 			$tmp_date_delivery = GETPOST('date_delivery') ?: -1;
2506 2506
 			print $form->selectDate($tmp_date_delivery, 'date_livraison', 0, 0, 0, "addprop", 1, 1);
@@ -2511,9 +2511,9 @@  discard block
 block discarded – undo
2511 2511
 		if (isModEnabled('project') && is_object($formproject)) {
2512 2512
 			$langs->load("projects");
2513 2513
 			print '<tr class="field_projectid">';
2514
-			print '<td class="titlefieldcreate">' . $langs->trans("Project") . '</td><td class="valuefieldcreate">';
2515
-			print img_picto('', 'project', 'class="pictofixedwidth"') . $formproject->select_projects(($soc->id > 0 ? $soc->id : -1), (string) $projectid, 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 1, 0, 'maxwidth500 widthcentpercentminusxx');
2516
-			print ' <a href="' . DOL_URL_ROOT . '/projet/card.php?socid=' . $soc->id . '&action=create&status=1&backtopage=' . urlencode($_SERVER["PHP_SELF"] . '?action=create&socid=' . $soc->id) . '"><span class="fa fa-plus-circle valignmiddle paddingleft" title="' . $langs->trans("AddProject") . '"></span></a>';
2514
+			print '<td class="titlefieldcreate">'.$langs->trans("Project").'</td><td class="valuefieldcreate">';
2515
+			print img_picto('', 'project', 'class="pictofixedwidth"').$formproject->select_projects(($soc->id > 0 ? $soc->id : -1), (string) $projectid, 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 1, 0, 'maxwidth500 widthcentpercentminusxx');
2516
+			print ' <a href="'.DOL_URL_ROOT.'/projet/card.php?socid='.$soc->id.'&action=create&status=1&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create&socid='.$soc->id).'"><span class="fa fa-plus-circle valignmiddle paddingleft" title="'.$langs->trans("AddProject").'"></span></a>';
2517 2517
 			print '</td>';
2518 2518
 			print '</tr>';
2519 2519
 		}
@@ -2521,7 +2521,7 @@  discard block
 block discarded – undo
2521 2521
 		// Incoterms
2522 2522
 		if (isModEnabled('incoterm')) {
2523 2523
 			print '<tr class="field_incoterm_id">';
2524
-			print '<td class="titlefieldcreate"><label for="incoterm_id">' . $form->textwithpicto($langs->trans("IncotermLabel"), $soc->label_incoterms, 1) . '</label></td>';
2524
+			print '<td class="titlefieldcreate"><label for="incoterm_id">'.$form->textwithpicto($langs->trans("IncotermLabel"), $soc->label_incoterms, 1).'</label></td>';
2525 2525
 			print '<td  class="valuefieldcreate maxwidthonsmartphone">';
2526 2526
 			print img_picto('', 'incoterm', 'class="pictofixedwidth"');
2527 2527
 			print $form->select_incoterms((!empty($soc->fk_incoterms) ? $soc->fk_incoterms : ''), (!empty($soc->location_incoterms) ? $soc->location_incoterms : ''));
@@ -2530,7 +2530,7 @@  discard block
 block discarded – undo
2530 2530
 
2531 2531
 		// Template to use by default
2532 2532
 		print '<tr class="field_model">';
2533
-		print '<td class="titlefieldcreate">' . $langs->trans("DefaultModel") . '</td>';
2533
+		print '<td class="titlefieldcreate">'.$langs->trans("DefaultModel").'</td>';
2534 2534
 		print '<td class="valuefieldcreate">';
2535 2535
 		print img_picto('', 'pdf', 'class="pictofixedwidth"');
2536 2536
 		$liste = ModelePDFPropales::liste_modeles($db);
@@ -2541,15 +2541,15 @@  discard block
 block discarded – undo
2541 2541
 		// Multicurrency
2542 2542
 		if (isModEnabled("multicurrency")) {
2543 2543
 			print '<tr class="field_currency">';
2544
-			print '<td class="titlefieldcreate">' . $form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0) . '</td>';
2544
+			print '<td class="titlefieldcreate">'.$form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0).'</td>';
2545 2545
 			print '<td class="valuefieldcreate maxwidthonsmartphone">';
2546
-			print img_picto('', 'currency', 'class="pictofixedwidth"') . $form->selectMultiCurrency(((GETPOSTISSET('multicurrency_code') && !GETPOST('changecompany')) ? GETPOST('multicurrency_code') : $currency_code), 'multicurrency_code', 0, '', false, 'maxwidth200 widthcentpercentminusx');
2546
+			print img_picto('', 'currency', 'class="pictofixedwidth"').$form->selectMultiCurrency(((GETPOSTISSET('multicurrency_code') && !GETPOST('changecompany')) ? GETPOST('multicurrency_code') : $currency_code), 'multicurrency_code', 0, '', false, 'maxwidth200 widthcentpercentminusx');
2547 2547
 			print '</td></tr>';
2548 2548
 		}
2549 2549
 
2550 2550
 		// Public note
2551 2551
 		print '<tr class="field_note_public">';
2552
-		print '<td class="titlefieldcreate tdtop">' . $langs->trans('NotePublic') . '</td>';
2552
+		print '<td class="titlefieldcreate tdtop">'.$langs->trans('NotePublic').'</td>';
2553 2553
 		print '<td class="valuefieldcreate">';
2554 2554
 		$note_public = $object->getDefaultCreateValueFor('note_public', (!empty($objectsrc) ? $objectsrc->note_public : (getDolGlobalString('PROPALE_ADDON_NOTE_PUBLIC_DEFAULT') ? $conf->global->PROPALE_ADDON_NOTE_PUBLIC_DEFAULT : null)), 'restricthtml');
2555 2555
 		$doleditor = new DolEditor('note_public', $note_public, '', 80, 'dolibarr_notes', 'In', false, false, !getDolGlobalString('FCKEDITOR_ENABLE_NOTE_PUBLIC') ? 0 : 1, ROWS_3, '90%');
@@ -2558,7 +2558,7 @@  discard block
 block discarded – undo
2558 2558
 		// Private note
2559 2559
 		if (empty($user->socid)) {
2560 2560
 			print '<tr class="field_note_private">';
2561
-			print '<td class="titlefieldcreate tdtop">' . $langs->trans('NotePrivate') . '</td>';
2561
+			print '<td class="titlefieldcreate tdtop">'.$langs->trans('NotePrivate').'</td>';
2562 2562
 			print '<td class="valuefieldcreate">';
2563 2563
 			$note_private = $object->getDefaultCreateValueFor('note_private', ((!empty($origin) && !empty($originid) && is_object($objectsrc)) ? $objectsrc->note_private : null));
2564 2564
 			$doleditor = new DolEditor('note_private', $note_private, '', 80, 'dolibarr_notes', 'In', false, false, !getDolGlobalString('FCKEDITOR_ENABLE_NOTE_PRIVATE') ? 0 : 1, ROWS_3, '90%');
@@ -2568,7 +2568,7 @@  discard block
 block discarded – undo
2568 2568
 		}
2569 2569
 
2570 2570
 		// Other attributes
2571
-		include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_add.tpl.php';
2571
+		include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php';
2572 2572
 
2573 2573
 		// Lines from source
2574 2574
 		if (!empty($origin) && !empty($originid) && is_object($objectsrc)) {
@@ -2580,13 +2580,13 @@  discard block
 block discarded – undo
2580 2580
 				$objectsrc->update_price(1, 'auto', 1);
2581 2581
 			}
2582 2582
 
2583
-			print "\n<!-- " . $classname . " info -->";
2583
+			print "\n<!-- ".$classname." info -->";
2584 2584
 			print "\n";
2585
-			print '<input type="hidden" name="amount"         value="' . $objectsrc->total_ht . '">' . "\n";
2586
-			print '<input type="hidden" name="total"          value="' . $objectsrc->total_ttc . '">' . "\n";
2587
-			print '<input type="hidden" name="tva"            value="' . $objectsrc->total_tva . '">' . "\n";
2588
-			print '<input type="hidden" name="origin"         value="' . $objectsrc->element . '">';
2589
-			print '<input type="hidden" name="originid"       value="' . $objectsrc->id . '">';
2585
+			print '<input type="hidden" name="amount"         value="'.$objectsrc->total_ht.'">'."\n";
2586
+			print '<input type="hidden" name="total"          value="'.$objectsrc->total_ttc.'">'."\n";
2587
+			print '<input type="hidden" name="tva"            value="'.$objectsrc->total_tva.'">'."\n";
2588
+			print '<input type="hidden" name="origin"         value="'.$objectsrc->element.'">';
2589
+			print '<input type="hidden" name="originid"       value="'.$objectsrc->id.'">';
2590 2590
 
2591 2591
 			$newclassname = $classname;
2592 2592
 			if ($newclassname == 'Propal') {
@@ -2599,22 +2599,22 @@  discard block
 block discarded – undo
2599 2599
 				$newclassname = 'Intervention';
2600 2600
 			}
2601 2601
 
2602
-			print '<tr><td>' . $langs->trans($newclassname) . '</td><td>' . $objectsrc->getNomUrl(1) . '</td></tr>';
2603
-			print '<tr><td>' . $langs->trans('AmountHT') . '</td><td>' . price($objectsrc->total_ht, 0, $langs, 1, -1, -1, $conf->currency) . '</td></tr>';
2604
-			print '<tr><td>' . $langs->trans('AmountVAT') . '</td><td>' . price($objectsrc->total_tva, 0, $langs, 1, -1, -1, $conf->currency) . "</td></tr>";
2602
+			print '<tr><td>'.$langs->trans($newclassname).'</td><td>'.$objectsrc->getNomUrl(1).'</td></tr>';
2603
+			print '<tr><td>'.$langs->trans('AmountHT').'</td><td>'.price($objectsrc->total_ht, 0, $langs, 1, -1, -1, $conf->currency).'</td></tr>';
2604
+			print '<tr><td>'.$langs->trans('AmountVAT').'</td><td>'.price($objectsrc->total_tva, 0, $langs, 1, -1, -1, $conf->currency)."</td></tr>";
2605 2605
 			if ($mysoc->localtax1_assuj == "1" || $objectsrc->total_localtax1 != 0) { 		// Localtax1
2606
-				print '<tr><td>' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '</td><td>' . price($objectsrc->total_localtax1, 0, $langs, 1, -1, -1, $conf->currency) . "</td></tr>";
2606
+				print '<tr><td>'.$langs->transcountry("AmountLT1", $mysoc->country_code).'</td><td>'.price($objectsrc->total_localtax1, 0, $langs, 1, -1, -1, $conf->currency)."</td></tr>";
2607 2607
 			}
2608 2608
 
2609 2609
 			if ($mysoc->localtax2_assuj == "1" || $objectsrc->total_localtax2 != 0) { 		// Localtax2
2610
-				print '<tr><td>' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '</td><td>' . price($objectsrc->total_localtax2, 0, $langs, 1, -1, -1, $conf->currency) . "</td></tr>";
2610
+				print '<tr><td>'.$langs->transcountry("AmountLT2", $mysoc->country_code).'</td><td>'.price($objectsrc->total_localtax2, 0, $langs, 1, -1, -1, $conf->currency)."</td></tr>";
2611 2611
 			}
2612
-			print '<tr><td>' . $langs->trans('AmountTTC') . '</td><td>' . price($objectsrc->total_ttc, 0, $langs, 1, -1, -1, $conf->currency) . "</td></tr>";
2612
+			print '<tr><td>'.$langs->trans('AmountTTC').'</td><td>'.price($objectsrc->total_ttc, 0, $langs, 1, -1, -1, $conf->currency)."</td></tr>";
2613 2613
 
2614 2614
 			if (isModEnabled("multicurrency")) {
2615
-				print '<tr><td>' . $langs->trans('MulticurrencyAmountHT') . '</td><td>' . price($objectsrc->multicurrency_total_ht) . '</td></tr>';
2616
-				print '<tr><td>' . $langs->trans('MulticurrencyAmountVAT') . '</td><td>' . price($objectsrc->multicurrency_total_tva) . "</td></tr>";
2617
-				print '<tr><td>' . $langs->trans('MulticurrencyAmountTTC') . '</td><td>' . price($objectsrc->multicurrency_total_ttc) . "</td></tr>";
2615
+				print '<tr><td>'.$langs->trans('MulticurrencyAmountHT').'</td><td>'.price($objectsrc->multicurrency_total_ht).'</td></tr>';
2616
+				print '<tr><td>'.$langs->trans('MulticurrencyAmountVAT').'</td><td>'.price($objectsrc->multicurrency_total_tva)."</td></tr>";
2617
+				print '<tr><td>'.$langs->trans('MulticurrencyAmountTTC').'</td><td>'.price($objectsrc->multicurrency_total_ttc)."</td></tr>";
2618 2618
 			}
2619 2619
 		}
2620 2620
 
@@ -2635,16 +2635,16 @@  discard block
 block discarded – undo
2635 2635
 			// For backward compatibility
2636 2636
 			print '<tr>';
2637 2637
 			print '<td><input type="radio" name="createmode" value="copy"></td>';
2638
-			print '<td>' . $langs->trans("CopyPropalFrom") . ' </td>';
2638
+			print '<td>'.$langs->trans("CopyPropalFrom").' </td>';
2639 2639
 			print '<td>';
2640 2640
 			$liste_propal = array();
2641 2641
 			$liste_propal[0] = '';
2642 2642
 
2643 2643
 			$sql = "SELECT p.rowid as id, p.ref, s.nom";
2644
-			$sql .= " FROM " . MAIN_DB_PREFIX . "propal p";
2645
-			$sql .= ", " . MAIN_DB_PREFIX . "societe s";
2644
+			$sql .= " FROM ".MAIN_DB_PREFIX."propal p";
2645
+			$sql .= ", ".MAIN_DB_PREFIX."societe s";
2646 2646
 			$sql .= " WHERE s.rowid = p.fk_soc";
2647
-			$sql .= " AND p.entity IN (" . getEntity('propal') . ")";
2647
+			$sql .= " AND p.entity IN (".getEntity('propal').")";
2648 2648
 			$sql .= " AND p.fk_statut <> 0";
2649 2649
 			$sql .= " ORDER BY Id";
2650 2650
 
@@ -2654,7 +2654,7 @@  discard block
 block discarded – undo
2654 2654
 				$i = 0;
2655 2655
 				while ($i < $num) {
2656 2656
 					$row = $db->fetch_row($resql);
2657
-					$propalRefAndSocName = $row[1] . " - " . $row[2];
2657
+					$propalRefAndSocName = $row[1]." - ".$row[2];
2658 2658
 					$liste_propal[$row[0]] = $propalRefAndSocName;
2659 2659
 					$i++;
2660 2660
 				}
@@ -2665,7 +2665,7 @@  discard block
 block discarded – undo
2665 2665
 			print '</td></tr>';
2666 2666
 
2667 2667
 			print '<tr><td class="tdtop"><input type="radio" name="createmode" value="empty" checked></td>';
2668
-			print '<td valign="top" colspan="2">' . $langs->trans("CreateEmptyPropal") . '</td></tr>';
2668
+			print '<td valign="top" colspan="2">'.$langs->trans("CreateEmptyPropal").'</td></tr>';
2669 2669
 			print '</table>';
2670 2670
 		}
2671 2671
 	}
@@ -2725,7 +2725,7 @@  discard block
 block discarded – undo
2725 2725
 			$formquestion[] = array('type' => 'date', 'name' => 'date_delivery', 'label' => $langs->trans("DeliveryDate"), 'value' => $object->delivery_date);
2726 2726
 		}
2727 2727
 		// Incomplete payment. We ask if reason = discount or other
2728
-		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('ToClone'), $langs->trans('ConfirmClonePropal', $object->ref), 'confirm_clone', $formquestion, 'yes', 1, 250, 600);
2728
+		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmClonePropal', $object->ref), 'confirm_clone', $formquestion, 'yes', 1, 250, 600);
2729 2729
 	}
2730 2730
 
2731 2731
 	// Subtotal line form
@@ -2745,9 +2745,9 @@  discard block
 block discarded – undo
2745 2745
 		//Form to close proposal (signed or not)
2746 2746
 		$formquestion = array();
2747 2747
 		if (!getDolGlobalString('PROPAL_SKIP_ACCEPT_REFUSE')) {
2748
-			$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)));
2748
+			$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)));
2749 2749
 		}
2750
-		$formquestion[] = array('type' => 'text', 'name' => 'note_private', 'label' => $langs->trans("Note"), 'value' => '');				// Field to complete private note (not replace)
2750
+		$formquestion[] = array('type' => 'text', 'name' => 'note_private', 'label' => $langs->trans("Note"), 'value' => ''); // Field to complete private note (not replace)
2751 2751
 
2752 2752
 		if (getDolGlobalInt('PROPOSAL_SUGGEST_DOWN_PAYMENT_INVOICE_CREATION')) {
2753 2753
 			// This is a hidden option:
@@ -2757,7 +2757,7 @@  discard block
 block discarded – undo
2757 2757
 			$deposit_percent_from_payment_terms = getDictionaryValue('c_payment_term', 'deposit_percent', $object->cond_reglement_id);
2758 2758
 
2759 2759
 			if (!empty($deposit_percent_from_payment_terms) && isModEnabled('invoice') && $user->hasRight('facture', 'creer')) {
2760
-				require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
2760
+				require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
2761 2761
 
2762 2762
 				$object->fetchObjectLinked();
2763 2763
 
@@ -2843,7 +2843,7 @@  discard block
 block discarded – undo
2843 2843
 						'type' => 'onecolumn',
2844 2844
 						'value' => '
2845 2845
 							<script>
2846
-								let signedValue = ' . $object::STATUS_SIGNED . ';
2846
+								let signedValue = ' . $object::STATUS_SIGNED.';
2847 2847
 
2848 2848
 								$(document).ready(function() {
2849 2849
 									$("[name=generate_deposit]").change(function () {
@@ -2883,7 +2883,7 @@  discard block
 block discarded – undo
2883 2883
 		}
2884 2884
 
2885 2885
 		if (isModEnabled('notification')) {
2886
-			require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php';
2886
+			require_once DOL_DOCUMENT_ROOT.'/core/class/notify.class.php';
2887 2887
 			$notify = new Notify($db);
2888 2888
 			$formquestion = array_merge($formquestion, array(
2889 2889
 				array('type' => 'onecolumn', 'value' => $notify->confirmMessage('PROPAL_CLOSE_SIGNED', $object->socid, $object)),
@@ -2891,22 +2891,22 @@  discard block
 block discarded – undo
2891 2891
 		}
2892 2892
 
2893 2893
 		if (!getDolGlobalString('PROPAL_SKIP_ACCEPT_REFUSE')) {
2894
-			$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('SetAcceptedRefused'), '', 'confirm_closeas', $formquestion, '', 1, 250);
2894
+			$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('SetAcceptedRefused'), '', 'confirm_closeas', $formquestion, '', 1, 250);
2895 2895
 		} else {
2896
-			$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?statut=3&id=' . $object->id, $langs->trans('Close'), '', 'confirm_closeas', $formquestion, '', 1, 250);
2896
+			$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?statut=3&id='.$object->id, $langs->trans('Close'), '', 'confirm_closeas', $formquestion, '', 1, 250);
2897 2897
 		}
2898 2898
 	} elseif ($action == 'cancel') {
2899 2899
 		// Confirm cancel
2900
-		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans("CancelPropal"), $langs->trans('ConfirmCancelPropal', $object->ref), 'confirm_cancel', '', 0, 1);
2900
+		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans("CancelPropal"), $langs->trans('ConfirmCancelPropal', $object->ref), 'confirm_cancel', '', 0, 1);
2901 2901
 	} elseif ($action == 'delete') {
2902 2902
 		// Confirm delete
2903
-		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('DeleteProp'), $langs->trans('ConfirmDeleteProp', $object->ref), 'confirm_delete', '', 0, 1);
2903
+		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteProp'), $langs->trans('ConfirmDeleteProp', $object->ref), 'confirm_delete', '', 0, 1);
2904 2904
 	} elseif ($action == 'reopen') {
2905 2905
 		// Confirm reopen
2906
-		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('ReOpen'), $langs->trans('ConfirmReOpenProp', $object->ref), 'confirm_reopen', '', 0, 1);
2906
+		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ReOpen'), $langs->trans('ConfirmReOpenProp', $object->ref), 'confirm_reopen', '', 0, 1);
2907 2907
 	} elseif ($action == 'ask_deleteline') {
2908 2908
 		// Confirmation delete product/service line
2909
-		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id . '&lineid=' . $lineid, $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteline', '', 0, 1);
2909
+		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteline', '', 0, 1);
2910 2910
 	} elseif ($action == 'ask_subtotal_deleteline') {
2911 2911
 		// Confirmation de la suppression d'une ligne subtotal
2912 2912
 		$langs->load("subtotals");
@@ -2917,7 +2917,7 @@  discard block
 block discarded – undo
2917 2917
 			$title = "DeleteTitleLine";
2918 2918
 			$question = "ConfirmDeleteTitleLine";
2919 2919
 		}
2920
-		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id . '&lineid=' . $lineid, $langs->trans($title), $langs->trans($question), 'confirm_delete_subtotalline', $formconfirm, 'no', 1);
2920
+		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans($title), $langs->trans($question), 'confirm_delete_subtotalline', $formconfirm, 'no', 1);
2921 2921
 	} elseif ($action == 'validate') {
2922 2922
 		// Confirm validate proposal
2923 2923
 		$error = 0;
@@ -2936,7 +2936,7 @@  discard block
 block discarded – undo
2936 2936
 
2937 2937
 		$text = $langs->trans('ConfirmValidateProp', $numref);
2938 2938
 		if (isModEnabled('notification')) {
2939
-			require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php';
2939
+			require_once DOL_DOCUMENT_ROOT.'/core/class/notify.class.php';
2940 2940
 			$notify = new Notify($db);
2941 2941
 			$text .= '<br>';
2942 2942
 			$text .= $notify->confirmMessage('PROPAL_VALIDATE', $object->socid, $object);
@@ -2946,7 +2946,7 @@  discard block
 block discarded – undo
2946 2946
 		$nbMandated = 0;
2947 2947
 		foreach ($object->lines as $line) {
2948 2948
 			$res = $line->fetch_product();
2949
-			if ($res  > 0) {
2949
+			if ($res > 0) {
2950 2950
 				if ($line->product->isService() && $line->product->isMandatoryPeriod() && (empty($line->date_start) || empty($line->date_end))) {
2951 2951
 					$nbMandated++;
2952 2952
 					break;
@@ -2958,12 +2958,12 @@  discard block
 block discarded – undo
2958 2958
 				setEventMessages($langs->trans("mandatoryPeriodNeedTobeSetMsgValidate"), null, 'errors');
2959 2959
 				$error++;
2960 2960
 			} else {
2961
-				$text .= '<div><span class="clearboth nowraponall warning">' . img_warning() . $langs->trans("mandatoryPeriodNeedTobeSetMsgValidate") . '</span></div>';
2961
+				$text .= '<div><span class="clearboth nowraponall warning">'.img_warning().$langs->trans("mandatoryPeriodNeedTobeSetMsgValidate").'</span></div>';
2962 2962
 			}
2963 2963
 		}
2964 2964
 
2965 2965
 		if (!$error) {
2966
-			$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('ValidateProp'), $text, 'confirm_validate', '', 0, 1, 240);
2966
+			$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ValidateProp'), $text, 'confirm_validate', '', 0, 1, 240);
2967 2967
 		}
2968 2968
 	}
2969 2969
 
@@ -2982,16 +2982,16 @@  discard block
 block discarded – undo
2982 2982
 
2983 2983
 	// Proposal card
2984 2984
 
2985
-	$linkback = '<a href="' . DOL_URL_ROOT . '/comm/propal/list.php?restore_lastsearch_values=1' . (!empty($socid) ? '&socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';
2985
+	$linkback = '<a href="'.DOL_URL_ROOT.'/comm/propal/list.php?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>';
2986 2986
 
2987 2987
 	$morehtmlref = '<div class="refidno">';
2988 2988
 	// Ref customer
2989 2989
 	$morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, $usercancreate, 'string', '', 0, 1);
2990
-	$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);
2990
+	$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);
2991 2991
 	// Thirdparty
2992
-	$morehtmlref .= '<br>' . $soc->getNomUrl(1, 'customer');
2992
+	$morehtmlref .= '<br>'.$soc->getNomUrl(1, 'customer');
2993 2993
 	if (!getDolGlobalString('MAIN_DISABLE_OTHER_LINK') && $soc->id > 0) {
2994
-		$morehtmlref .= ' (<a href="' . DOL_URL_ROOT . '/comm/propal/list.php?socid=' . $soc->id . '&search_societe=' . urlencode($soc->name) . '">' . $langs->trans("OtherProposals") . '</a>)';
2994
+		$morehtmlref .= ' (<a href="'.DOL_URL_ROOT.'/comm/propal/list.php?socid='.$soc->id.'&search_societe='.urlencode($soc->name).'">'.$langs->trans("OtherProposals").'</a>)';
2995 2995
 	}
2996 2996
 	// Project
2997 2997
 	if (isModEnabled('project')) {
@@ -3000,16 +3000,16 @@  discard block
 block discarded – undo
3000 3000
 		if ($usercancreate) {
3001 3001
 			$morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"');
3002 3002
 			if ($action != 'classify') {
3003
-				$morehtmlref .= '<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&token=' . newToken() . '&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> ';
3003
+				$morehtmlref .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> ';
3004 3004
 			}
3005
-			$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');
3005
+			$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');
3006 3006
 		} else {
3007 3007
 			if (!empty($object->fk_project)) {
3008 3008
 				$proj = new Project($db);
3009 3009
 				$proj->fetch($object->fk_project);
3010 3010
 				$morehtmlref .= $proj->getNomUrl(1);
3011 3011
 				if ($proj->title) {
3012
-					$morehtmlref .= '<span class="opacitymedium"> - ' . dol_escape_htmltag($proj->title) . '</span>';
3012
+					$morehtmlref .= '<span class="opacitymedium"> - '.dol_escape_htmltag($proj->title).'</span>';
3013 3013
 				}
3014 3014
 			}
3015 3015
 		}
@@ -3039,7 +3039,7 @@  discard block
 block discarded – undo
3039 3039
 			$filtercreditnote = "fk_facture_source IS NOT NULL AND (description NOT LIKE '(DEPOSIT)%' OR description LIKE '(EXCESS RECEIVED)%')";
3040 3040
 		}
3041 3041
 
3042
-		print '<tr><td class="titlefieldmax45">' . $langs->trans('Discounts') . '</td><td>';
3042
+		print '<tr><td class="titlefieldmax45">'.$langs->trans('Discounts').'</td><td>';
3043 3043
 
3044 3044
 		$absolute_discount = $soc->getAvailableDiscounts(null, $filterabsolutediscount);
3045 3045
 		$absolute_creditnote = $soc->getAvailableDiscounts(null, $filtercreditnote);
@@ -3050,8 +3050,8 @@  discard block
 block discarded – undo
3050 3050
 
3051 3051
 		$thirdparty = $soc;
3052 3052
 		$discount_type = 0;
3053
-		$backtopage = $_SERVER["PHP_SELF"] . '?id=' . $object->id;
3054
-		include DOL_DOCUMENT_ROOT . '/core/tpl/object_discounts.tpl.php';
3053
+		$backtopage = $_SERVER["PHP_SELF"].'?id='.$object->id;
3054
+		include DOL_DOCUMENT_ROOT.'/core/tpl/object_discounts.tpl.php';
3055 3055
 
3056 3056
 		print '</td></tr>';
3057 3057
 
@@ -3070,12 +3070,12 @@  discard block
 block discarded – undo
3070 3070
 		print $form->editfieldkey("DatePropal", 'date', '', $object, (int) $editenable);
3071 3071
 		print '</td><td class="valuefield">';
3072 3072
 		if ($action == 'editdate' && $usercancreate && $caneditfield) {
3073
-			print '<form name="editdate" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '" method="post">';
3074
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
3073
+			print '<form name="editdate" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="post">';
3074
+			print '<input type="hidden" name="token" value="'.newToken().'">';
3075 3075
 			print '<input type="hidden" name="action" value="setdate">';
3076
-			print '<input type="hidden" name="backtopage" value="' . $backtopage . '">';
3076
+			print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
3077 3077
 			print $form->selectDate($object->date, 're', 0, 0, 0, "editdate");
3078
-			print '<input type="submit" class="button button-edit" value="' . $langs->trans('Modify') . '">';
3078
+			print '<input type="submit" class="button button-edit" value="'.$langs->trans('Modify').'">';
3079 3079
 			print '</form>';
3080 3080
 		} else {
3081 3081
 			if ($object->date) {
@@ -3093,17 +3093,17 @@  discard block
 block discarded – undo
3093 3093
 		print $langs->trans('DateEndPropal');
3094 3094
 		print '</td>';
3095 3095
 		if ($action != 'editecheance' && $usercancreate && $caneditfield) {
3096
-			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>';
3096
+			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>';
3097 3097
 		}
3098 3098
 		print '</tr></table>';
3099 3099
 		print '</td><td class="valuefield">';
3100 3100
 		if ($action == 'editecheance' && $usercancreate && $caneditfield) {
3101
-			print '<form name="editecheance" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '" method="post">';
3102
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
3101
+			print '<form name="editecheance" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="post">';
3102
+			print '<input type="hidden" name="token" value="'.newToken().'">';
3103 3103
 			print '<input type="hidden" name="action" value="setecheance">';
3104
-			print '<input type="hidden" name="backtopage" value="' . $backtopage . '">';
3104
+			print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
3105 3105
 			print $form->selectDate($object->fin_validite, 'ech', 0, 0, 0, "editecheance");
3106
-			print '<input type="submit" class="button button-edit" value="' . $langs->trans('Modify') . '">';
3106
+			print '<input type="submit" class="button button-edit" value="'.$langs->trans('Modify').'">';
3107 3107
 			print '</form>';
3108 3108
 		} else {
3109 3109
 			if (!empty($object->fin_validite)) {
@@ -3124,14 +3124,14 @@  discard block
 block discarded – undo
3124 3124
 		print $langs->trans('PaymentConditionsShort');
3125 3125
 		print '</td>';
3126 3126
 		if ($action != 'editconditions' && $usercancreate && $caneditfield) {
3127
-			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>';
3127
+			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>';
3128 3128
 		}
3129 3129
 		print '</tr></table>';
3130 3130
 		print '</td><td class="valuefield">';
3131 3131
 		if ($action == 'editconditions' && $usercancreate && $caneditfield) {
3132
-			$form->form_conditions_reglement($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->cond_reglement_id, 'cond_reglement_id', 0, '', 1, $object->deposit_percent);
3132
+			$form->form_conditions_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->cond_reglement_id, 'cond_reglement_id', 0, '', 1, $object->deposit_percent);
3133 3133
 		} else {
3134
-			$form->form_conditions_reglement($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->cond_reglement_id, 'none', 0, '', 1, $object->deposit_percent);
3134
+			$form->form_conditions_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->cond_reglement_id, 'none', 0, '', 1, $object->deposit_percent);
3135 3135
 		}
3136 3136
 		print '</td>';
3137 3137
 		print '</tr>';
@@ -3143,14 +3143,14 @@  discard block
 block discarded – undo
3143 3143
 		print $langs->trans('PaymentMode');
3144 3144
 		print '</td>';
3145 3145
 		if ($action != 'editmode' && $usercancreate && $caneditfield) {
3146
-			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>';
3146
+			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>';
3147 3147
 		}
3148 3148
 		print '</tr></table>';
3149 3149
 		print '</td><td class="valuefieldcreate">';
3150 3150
 		if ($action == 'editmode' && $usercancreate && $caneditfield) {
3151
-			$form->form_modes_reglement($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->mode_reglement_id, 'mode_reglement_id', 'CRDT', 1, 1);
3151
+			$form->form_modes_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->mode_reglement_id, 'mode_reglement_id', 'CRDT', 1, 1);
3152 3152
 		} else {
3153
-			$form->form_modes_reglement($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->mode_reglement_id, 'none');
3153
+			$form->form_modes_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->mode_reglement_id, 'none');
3154 3154
 		}
3155 3155
 		print '</td></tr>';
3156 3156
 
@@ -3166,20 +3166,20 @@  discard block
 block discarded – undo
3166 3166
 		print '<tr class="fielddeliverydelay"><td>';
3167 3167
 		print '<table class="nobordernopadding centpercent"><tr><td>';
3168 3168
 		if (isModEnabled('order')) {
3169
-			print $form->textwithpicto($langs->trans('AvailabilityPeriod'), $langs->trans('AvailabilityPeriod') . ' (' . $langs->trans('AfterOrder') . ')');
3169
+			print $form->textwithpicto($langs->trans('AvailabilityPeriod'), $langs->trans('AvailabilityPeriod').' ('.$langs->trans('AfterOrder').')');
3170 3170
 		} else {
3171 3171
 			print $langs->trans('AvailabilityPeriod');
3172 3172
 		}
3173 3173
 		print '</td>';
3174 3174
 		if ($action != 'editavailability' && $usercancreate && $caneditfield) {
3175
-			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>';
3175
+			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>';
3176 3176
 		}
3177 3177
 		print '</tr></table>';
3178 3178
 		print '</td><td class="valuefield">';
3179 3179
 		if ($action == 'editavailability' && $usercancreate && $caneditfield) {
3180
-			$form->form_availability($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->availability_id, 'availability_id', 1);
3180
+			$form->form_availability($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->availability_id, 'availability_id', 1);
3181 3181
 		} else {
3182
-			$form->form_availability($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->availability_id, 'none', 1);
3182
+			$form->form_availability($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->availability_id, 'none', 1);
3183 3183
 		}
3184 3184
 
3185 3185
 		print '</td>';
@@ -3192,14 +3192,14 @@  discard block
 block discarded – undo
3192 3192
 			print $langs->trans('SendingMethod');
3193 3193
 			print '</td>';
3194 3194
 			if ($action != 'editshippingmethod' && $usercancreate && $caneditfield) {
3195
-				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>';
3195
+				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>';
3196 3196
 			}
3197 3197
 			print '</tr></table>';
3198 3198
 			print '</td><td class="valuefield">';
3199 3199
 			if ($action == 'editshippingmethod' && $usercancreate && $caneditfield) {
3200
-				$form->formSelectShippingMethod($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->shipping_method_id, 'shipping_method_id', 1);
3200
+				$form->formSelectShippingMethod($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->shipping_method_id, 'shipping_method_id', 1);
3201 3201
 			} else {
3202
-				$form->formSelectShippingMethod($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->shipping_method_id, 'none');
3202
+				$form->formSelectShippingMethod($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->shipping_method_id, 'none');
3203 3203
 			}
3204 3204
 			print '</td>';
3205 3205
 			print '</tr>';
@@ -3208,16 +3208,16 @@  discard block
 block discarded – undo
3208 3208
 		// Warehouse
3209 3209
 		if (isModEnabled('stock') && getDolGlobalString('WAREHOUSE_ASK_WAREHOUSE_DURING_PROPAL')) {
3210 3210
 			$langs->load('stocks');
3211
-			require_once DOL_DOCUMENT_ROOT . '/product/class/html.formproduct.class.php';
3211
+			require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
3212 3212
 			$formproduct = new FormProduct($db);
3213 3213
 			print '<tr class="field_warehouse_id"><td>';
3214 3214
 			$editenable = $usercancreate;
3215 3215
 			print $form->editfieldkey("Warehouse", 'warehouse', '', $object, $editenable);
3216 3216
 			print '</td><td class="valuefieldcreate">';
3217 3217
 			if ($action == 'editwarehouse') {
3218
-				$formproduct->formSelectWarehouses($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->warehouse_id, 'warehouse_id', 1);
3218
+				$formproduct->formSelectWarehouses($_SERVER['PHP_SELF'].'?id='.$object->id, $object->warehouse_id, 'warehouse_id', 1);
3219 3219
 			} else {
3220
-				$formproduct->formSelectWarehouses($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->warehouse_id, 'none');
3220
+				$formproduct->formSelectWarehouses($_SERVER['PHP_SELF'].'?id='.$object->id, $object->warehouse_id, 'none');
3221 3221
 			}
3222 3222
 			print '</td>';
3223 3223
 			print '</tr>';
@@ -3229,14 +3229,14 @@  discard block
 block discarded – undo
3229 3229
 		print $langs->trans('Source');
3230 3230
 		print '</td>';
3231 3231
 		if ($action != 'editdemandreason' && $usercancreate) {
3232
-			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>';
3232
+			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>';
3233 3233
 		}
3234 3234
 		print '</tr></table>';
3235 3235
 		print '</td><td class="valuefield">';
3236 3236
 		if ($action == 'editdemandreason' && $usercancreate) {
3237
-			$form->formInputReason($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->demand_reason_id, 'demand_reason_id', 1);
3237
+			$form->formInputReason($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->demand_reason_id, 'demand_reason_id', 1);
3238 3238
 		} else {
3239
-			$form->formInputReason($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->demand_reason_id, 'none');
3239
+			$form->formInputReason($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->demand_reason_id, 'none');
3240 3240
 		}
3241 3241
 		print '</td>';
3242 3242
 		print '</tr>';
@@ -3248,7 +3248,7 @@  discard block
 block discarded – undo
3248 3248
 			print '</td><td class="valuefield">';
3249 3249
 			$arrayoutstandingbills = $soc->getOutstandingBills();
3250 3250
 			print($arrayoutstandingbills['opened'] > $soc->outstanding_limit ? img_warning() : '');
3251
-			print price($arrayoutstandingbills['opened']) . ' / ';
3251
+			print price($arrayoutstandingbills['opened']).' / ';
3252 3252
 			print price($soc->outstanding_limit, 0, $langs, 1, -1, -1, $conf->currency);
3253 3253
 			print '</td>';
3254 3254
 			print '</tr>';
@@ -3261,14 +3261,14 @@  discard block
 block discarded – undo
3261 3261
 			print $langs->trans('BankAccount');
3262 3262
 			print '</td>';
3263 3263
 			if ($action != 'editbankaccount' && $usercancreate) {
3264
-				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>';
3264
+				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>';
3265 3265
 			}
3266 3266
 			print '</tr></table>';
3267 3267
 			print '</td><td class="valuefield">';
3268 3268
 			if ($action == 'editbankaccount') {
3269
-				$form->formSelectAccount($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->fk_account, 'fk_account', 1);
3269
+				$form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->fk_account, 'fk_account', 1);
3270 3270
 			} else {
3271
-				$form->formSelectAccount($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->fk_account, 'none');
3271
+				$form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->fk_account, 'none');
3272 3272
 			}
3273 3273
 			print '</td>';
3274 3274
 			print '</tr>';
@@ -3279,13 +3279,13 @@  discard block
 block discarded – undo
3279 3279
 			$totalWeight = isset($tmparray['weight']) ? $tmparray['weight'] : 0;
3280 3280
 			$totalVolume = isset($tmparray['volume']) ? $tmparray['volume'] : 0;
3281 3281
 			if ($totalWeight) {
3282
-				print '<tr><td>' . $langs->trans("CalculatedWeight") . '</td>';
3282
+				print '<tr><td>'.$langs->trans("CalculatedWeight").'</td>';
3283 3283
 				print '<td class="valuefield">';
3284 3284
 				print showDimensionInBestUnit($totalWeight, 0, "weight", $langs, getDolGlobalInt('MAIN_WEIGHT_DEFAULT_ROUND', -1), getDolGlobalString('MAIN_WEIGHT_DEFAULT_UNIT', 'no'), 1);
3285 3285
 				print '</td></tr>';
3286 3286
 			}
3287 3287
 			if ($totalVolume) {
3288
-				print '<tr><td>' . $langs->trans("CalculatedVolume") . '</td>';
3288
+				print '<tr><td>'.$langs->trans("CalculatedVolume").'</td>';
3289 3289
 				print '<td class="valuefield">';
3290 3290
 				print showDimensionInBestUnit($totalVolume, 0, "volume", $langs, getDolGlobalInt('MAIN_VOLUME_DEFAULT_ROUND', -1), getDolGlobalString('MAIN_VOLUME_DEFAULT_UNIT', 'no'), 1);
3291 3291
 				print '</td></tr>';
@@ -3299,7 +3299,7 @@  discard block
 block discarded – undo
3299 3299
 			print $langs->trans('IncotermLabel');
3300 3300
 			print '<td><td class="right">';
3301 3301
 			if ($action != 'editincoterm' && $usercancreate && $caneditfield) {
3302
-				print '<a class="editfielda" href="' . DOL_URL_ROOT . '/comm/propal/card.php?id=' . $object->id . '&action=editincoterm&token=' . newToken() . '">' . img_edit() . '</a>';
3302
+				print '<a class="editfielda" href="'.DOL_URL_ROOT.'/comm/propal/card.php?id='.$object->id.'&action=editincoterm&token='.newToken().'">'.img_edit().'</a>';
3303 3303
 			} else {
3304 3304
 				print '&nbsp;';
3305 3305
 			}
@@ -3307,7 +3307,7 @@  discard block
 block discarded – undo
3307 3307
 			print '</td>';
3308 3308
 			print '<td class="valuefield">';
3309 3309
 			if ($action == 'editincoterm' && $usercancreate && $caneditfield) {
3310
-				print $form->select_incoterms((!empty($object->fk_incoterms) ? $object->fk_incoterms : ''), (!empty($object->location_incoterms) ? $object->location_incoterms : ''), $_SERVER['PHP_SELF'] . '?id=' . $object->id);
3310
+				print $form->select_incoterms((!empty($object->fk_incoterms) ? $object->fk_incoterms : ''), (!empty($object->location_incoterms) ? $object->location_incoterms : ''), $_SERVER['PHP_SELF'].'?id='.$object->id);
3311 3311
 			} else {
3312 3312
 				print $form->textwithpicto($object->display_incoterms(), $object->label_incoterms, 1);
3313 3313
 			}
@@ -3315,7 +3315,7 @@  discard block
 block discarded – undo
3315 3315
 		}
3316 3316
 
3317 3317
 		// Other attributes
3318
-		include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
3318
+		include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
3319 3319
 
3320 3320
 		print '</table>';
3321 3321
 
@@ -3325,53 +3325,53 @@  discard block
 block discarded – undo
3325 3325
 
3326 3326
 		print '<table class="border tableforfield centpercent">';
3327 3327
 
3328
-		include DOL_DOCUMENT_ROOT . '/core/tpl/object_currency_amount.tpl.php';
3328
+		include DOL_DOCUMENT_ROOT.'/core/tpl/object_currency_amount.tpl.php';
3329 3329
 
3330 3330
 		print '<tr>';
3331
-		print '<td class="titlefieldmiddle">' . $langs->trans('AmountHT') . '</td>';
3332
-		print '<td class="nowrap amountcard right">' . price($object->total_ht, 0, $langs, 1, -1, -1, $conf->currency) . '</td>';
3331
+		print '<td class="titlefieldmiddle">'.$langs->trans('AmountHT').'</td>';
3332
+		print '<td class="nowrap amountcard right">'.price($object->total_ht, 0, $langs, 1, -1, -1, $conf->currency).'</td>';
3333 3333
 		if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
3334
-			print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_ht, 0, $langs, 1, -1, -1, $object->multicurrency_code) . '</td>';
3334
+			print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_ht, 0, $langs, 1, -1, -1, $object->multicurrency_code).'</td>';
3335 3335
 		}
3336 3336
 		print '</tr>';
3337 3337
 
3338 3338
 		print '<tr>';
3339
-		print '<td>' . $langs->trans('AmountVAT') . '</td>';
3340
-		print '<td class="nowrap amountcard right">' . price($object->total_tva, 0, $langs, 1, -1, -1, $conf->currency) . '</td>';
3339
+		print '<td>'.$langs->trans('AmountVAT').'</td>';
3340
+		print '<td class="nowrap amountcard right">'.price($object->total_tva, 0, $langs, 1, -1, -1, $conf->currency).'</td>';
3341 3341
 		if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
3342
-			print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_tva, 0, $langs, 1, -1, -1, $object->multicurrency_code) . '</td>';
3342
+			print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_tva, 0, $langs, 1, -1, -1, $object->multicurrency_code).'</td>';
3343 3343
 		}
3344 3344
 		print '</tr>';
3345 3345
 
3346 3346
 		if ($mysoc->localtax1_assuj == "1" || $object->total_localtax1 != 0) {
3347 3347
 			print '<tr>';
3348
-			print '<td>' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '</td>';
3349
-			print '<td class="nowrap amountcard right">' . price($object->total_localtax1, 0, $langs, 1, -1, -1, $conf->currency) . '</td>';
3348
+			print '<td>'.$langs->transcountry("AmountLT1", $mysoc->country_code).'</td>';
3349
+			print '<td class="nowrap amountcard right">'.price($object->total_localtax1, 0, $langs, 1, -1, -1, $conf->currency).'</td>';
3350 3350
 			if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
3351 3351
 				$object->multicurrency_total_localtax1 = price2num($object->total_localtax1 * $object->multicurrency_tx, 'MT');
3352 3352
 
3353
-				print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_localtax1, 0, $langs, 1, -1, -1, $object->multicurrency_code) . '</td>';
3353
+				print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_localtax1, 0, $langs, 1, -1, -1, $object->multicurrency_code).'</td>';
3354 3354
 			}
3355 3355
 			print '</tr>';
3356 3356
 		}
3357 3357
 
3358 3358
 		if ($mysoc->localtax2_assuj == "1" || $object->total_localtax2 != 0) {
3359 3359
 			print '<tr>';
3360
-			print '<td>' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '</td>';
3361
-			print '<td class="nowrap amountcard right">' . price($object->total_localtax2, 0, $langs, 1, -1, -1, $conf->currency) . '</td>';
3360
+			print '<td>'.$langs->transcountry("AmountLT2", $mysoc->country_code).'</td>';
3361
+			print '<td class="nowrap amountcard right">'.price($object->total_localtax2, 0, $langs, 1, -1, -1, $conf->currency).'</td>';
3362 3362
 			if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
3363 3363
 				$object->multicurrency_total_localtax2 = price2num($object->total_localtax2 * $object->multicurrency_tx, 'MT');
3364 3364
 
3365
-				print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_localtax2, 0, $langs, 1, -1, -1, $object->multicurrency_code) . '</td>';
3365
+				print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_localtax2, 0, $langs, 1, -1, -1, $object->multicurrency_code).'</td>';
3366 3366
 			}
3367 3367
 			print '</tr>';
3368 3368
 		}
3369 3369
 
3370 3370
 		print '<tr>';
3371
-		print '<td>' . $langs->trans('AmountTTC') . '</td>';
3372
-		print '<td class="nowrap amountcard right">' . price($object->total_ttc, 0, $langs, 1, -1, -1, $conf->currency) . '</td>';
3371
+		print '<td>'.$langs->trans('AmountTTC').'</td>';
3372
+		print '<td class="nowrap amountcard right">'.price($object->total_ttc, 0, $langs, 1, -1, -1, $conf->currency).'</td>';
3373 3373
 		if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
3374
-			print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_ttc, 0, $langs, 1, -1, -1, $object->multicurrency_code) . '</td>';
3374
+			print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_ttc, 0, $langs, 1, -1, -1, $object->multicurrency_code).'</td>';
3375 3375
 		}
3376 3376
 		print '</tr>';
3377 3377
 
@@ -3390,13 +3390,13 @@  discard block
 block discarded – undo
3390 3390
 		if (getDolGlobalString('MAIN_DISABLE_CONTACTS_TAB')) {
3391 3391
 			$blocname = 'contacts';
3392 3392
 			$title = $langs->trans('ContactsAddresses');
3393
-			include DOL_DOCUMENT_ROOT . '/core/tpl/bloc_showhide.tpl.php';
3393
+			include DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php';
3394 3394
 		}
3395 3395
 
3396 3396
 		if (getDolGlobalString('MAIN_DISABLE_NOTES_TAB')) {
3397 3397
 			$blocname = 'notes';
3398 3398
 			$title = $langs->trans('Notes');
3399
-			include DOL_DOCUMENT_ROOT . '/core/tpl/bloc_showhide.tpl.php';
3399
+			include DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php';
3400 3400
 		}
3401 3401
 
3402 3402
 		/*
@@ -3411,20 +3411,20 @@  discard block
 block discarded – undo
3411 3411
 		global $inputalsopricewithtax;
3412 3412
 		$inputalsopricewithtax = 1;
3413 3413
 
3414
-		print '	<form name="addproduct" id="addproduct" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '" method="POST">
3415
-		<input type="hidden" name="token" value="' . newToken() . '">
3416
-		<input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline') . '">
3414
+		print '	<form name="addproduct" id="addproduct" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="POST">
3415
+		<input type="hidden" name="token" value="' . newToken().'">
3416
+		<input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline').'">
3417 3417
 		<input type="hidden" name="mode" value="">
3418 3418
 		<input type="hidden" name="page_y" value="">
3419
-		<input type="hidden" name="backtopage" value="' . $backtopage . '">
3420
-		<input type="hidden" name="id" value="' . $object->id . '">
3419
+		<input type="hidden" name="backtopage" value="' . $backtopage.'">
3420
+		<input type="hidden" name="id" value="' . $object->id.'">
3421 3421
 		';
3422 3422
 
3423 3423
 		if (!empty($conf->use_javascript_ajax) && $object->status == Propal::STATUS_DRAFT) {
3424 3424
 			if (isModEnabled('subtotals')) {
3425
-				include DOL_DOCUMENT_ROOT . '/core/tpl/subtotal_ajaxrow.tpl.php';
3425
+				include DOL_DOCUMENT_ROOT.'/core/tpl/subtotal_ajaxrow.tpl.php';
3426 3426
 			} else {
3427
-				include DOL_DOCUMENT_ROOT . '/core/tpl/ajaxrow.tpl.php';
3427
+				include DOL_DOCUMENT_ROOT.'/core/tpl/ajaxrow.tpl.php';
3428 3428
 			}
3429 3429
 		}
3430 3430
 
@@ -3479,7 +3479,7 @@  discard block
 block discarded – undo
3479 3479
 		if (empty($reshook)) {
3480 3480
 			if ($action != 'editline') {
3481 3481
 				// Subtotal
3482
-				if ($object->status == Propal::STATUS_DRAFT && isModEnabled('subtotals') && getDolGlobalString('SUBTOTAL_TITLE_' . strtoupper($object->element))) {
3482
+				if ($object->status == Propal::STATUS_DRAFT && isModEnabled('subtotals') && getDolGlobalString('SUBTOTAL_TITLE_'.strtoupper($object->element))) {
3483 3483
 					$langs->load('subtotals');
3484 3484
 
3485 3485
 					$url_button = array();
@@ -3489,7 +3489,7 @@  discard block
 block discarded – undo
3489 3489
 						'enabled' => (isModEnabled('propal') && $object->status == Propal::STATUS_DRAFT),
3490 3490
 						'perm' => (bool) $usercancreate,
3491 3491
 						'label' => $langs->trans('AddTitleLine'),
3492
-						'url' => '/comm/propal/card.php?id=' . $object->id . '&action=add_title_line&token=' . newToken()
3492
+						'url' => '/comm/propal/card.php?id='.$object->id.'&action=add_title_line&token='.newToken()
3493 3493
 					);
3494 3494
 
3495 3495
 					$url_button[] = array(
@@ -3497,7 +3497,7 @@  discard block
 block discarded – undo
3497 3497
 						'enabled' => (isModEnabled('propal') && $object->status == Propal::STATUS_DRAFT),
3498 3498
 						'perm' => (bool) $usercancreate,
3499 3499
 						'label' => $langs->trans('AddSubtotalLine'),
3500
-						'url' => '/comm/propal/card.php?id=' . $object->id . '&action=add_subtotal_line&token=' . newToken()
3500
+						'url' => '/comm/propal/card.php?id='.$object->id.'&action=add_subtotal_line&token='.newToken()
3501 3501
 					);
3502 3502
 
3503 3503
 					print dolGetButtonAction('', $langs->trans('Subtotal'), 'default', $url_button, '', true);
@@ -3508,9 +3508,9 @@  discard block
 block discarded – undo
3508 3508
 					|| ($object->status == Propal::STATUS_DRAFT && getDolGlobalString('PROPAL_ENABLE_NEGATIVE') && count($object->lines) > 0)
3509 3509
 				) {
3510 3510
 					if ($usercanvalidate) {
3511
-						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>';
3511
+						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>';
3512 3512
 					} else {
3513
-						print '<a class="butActionRefused classfortooltip" href="#">' . $langs->trans('Validate') . '</a>';
3513
+						print '<a class="butActionRefused classfortooltip" href="#">'.$langs->trans('Validate').'</a>';
3514 3514
 					}
3515 3515
 				}
3516 3516
 				// Create event
@@ -3520,23 +3520,23 @@  discard block
 block discarded – undo
3520 3520
 				}*/
3521 3521
 				// Edit
3522 3522
 				if ($object->status == Propal::STATUS_VALIDATED && $usercancreate) {
3523
-					print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=modif&token=' . newToken() . '">' . $langs->trans('Modify') . '</a>';
3523
+					print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=modif&token='.newToken().'">'.$langs->trans('Modify').'</a>';
3524 3524
 				}
3525 3525
 
3526 3526
 				// ReOpen
3527 3527
 				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)))) {
3528 3528
 					if ($usercanreopen) {
3529
-						print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=reopen&token=' . newToken() . (!getDolGlobalString('MAIN_JUMP_TAG') ? '' : '#reopen') . '"';
3530
-						print '>' . $langs->trans('ReOpen') . '</a>';
3529
+						print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=reopen&token='.newToken().(!getDolGlobalString('MAIN_JUMP_TAG') ? '' : '#reopen').'"';
3530
+						print '>'.$langs->trans('ReOpen').'</a>';
3531 3531
 					} else {
3532
-						print '<a class="butActionRefused classfortooltip" href="#" title="' . $langs->trans("NotEnoughPermissions") . '">' . $langs->trans("ReOpen") . '</a>';
3532
+						print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("NotEnoughPermissions").'">'.$langs->trans("ReOpen").'</a>';
3533 3533
 					}
3534 3534
 				}
3535 3535
 
3536 3536
 				// Send
3537 3537
 				if (empty($user->socid)) {
3538 3538
 					if ($object->status == Propal::STATUS_VALIDATED || $object->status == Propal::STATUS_SIGNED || getDolGlobalString('PROPOSAL_SENDBYEMAIL_FOR_ALL_STATUS')) {
3539
-						print dolGetButtonAction('', $langs->trans('SendMail'), 'default', $_SERVER["PHP_SELF"] . '?action=presend&token=' . newToken() . '&id=' . $object->id . '&mode=init#formmailbeforetitle', '', $usercansend);
3539
+						print dolGetButtonAction('', $langs->trans('SendMail'), 'default', $_SERVER["PHP_SELF"].'?action=presend&token='.newToken().'&id='.$object->id.'&mode=init#formmailbeforetitle', '', $usercansend);
3540 3540
 					}
3541 3541
 				}
3542 3542
 
@@ -3548,7 +3548,7 @@  discard block
 block discarded – undo
3548 3548
 					'enabled' => (isModEnabled('order') && $object->status == Propal::STATUS_SIGNED),
3549 3549
 					'perm' => $usercancreateorder,
3550 3550
 					'label' => 'AddOrder',
3551
-					'url' => '/commande/card.php?action=create&origin=' . urlencode($object->element) . '&originid=' . ((int) $object->id) . '&socid=' . ((int) $object->socid)
3551
+					'url' => '/commande/card.php?action=create&origin='.urlencode($object->element).'&originid='.((int) $object->id).'&socid='.((int) $object->socid)
3552 3552
 				);
3553 3553
 				/*if (isModEnabled('order') && $object->status == Propal::STATUS_SIGNED) {
3554 3554
 					if ($usercancreateorder) {
@@ -3563,7 +3563,7 @@  discard block
 block discarded – undo
3563 3563
 						'enabled' => ($object->status == Propal::STATUS_SIGNED && isModEnabled("supplier_order")),
3564 3564
 						'perm' => $usercancreatepurchaseorder,
3565 3565
 						'label' => 'AddPurchaseOrder',
3566
-						'url' => '/fourn/commande/card.php?action=create&origin=' . urlencode($object->element) . '&originid=' . ((int) $object->id) . '&socid=' . ((int) $object->socid)
3566
+						'url' => '/fourn/commande/card.php?action=create&origin='.urlencode($object->element).'&originid='.((int) $object->id).'&socid='.((int) $object->socid)
3567 3567
 					);
3568 3568
 					/*if ($object->status == Propal::STATUS_SIGNED && isModEnabled("supplier_order")) {
3569 3569
 						if ($usercancreatepurchaseorder) {
@@ -3578,7 +3578,7 @@  discard block
 block discarded – undo
3578 3578
 					'enabled' => (isModEnabled("service") && isModEnabled('intervention') && $object->status == Propal::STATUS_SIGNED),
3579 3579
 					'perm' => $usercancreateintervention,
3580 3580
 					'label' => 'AddIntervention',
3581
-					'url' => '/fichinter/card.php?action=create&origin=' . urlencode($object->element) . '&originid=' . ((int) $object->id) . '&socid=' . ((int) $object->socid)
3581
+					'url' => '/fichinter/card.php?action=create&origin='.urlencode($object->element).'&originid='.((int) $object->id).'&socid='.((int) $object->socid)
3582 3582
 				);
3583 3583
 				/*if (isModEnabled("service") && isModEnabled('intervention') && $object->status == Propal::STATUS_SIGNED) {
3584 3584
 					if ($usercancreateintervention) {
@@ -3593,7 +3593,7 @@  discard block
 block discarded – undo
3593 3593
 					'enabled' => (isModEnabled('contract') && $object->status == Propal::STATUS_SIGNED),
3594 3594
 					'perm' => $usercancreatecontract,
3595 3595
 					'label' => 'AddContract',
3596
-					'url' => '/contrat/card.php?action=create&origin=' . urlencode($object->element) . '&originid=' . ((int) $object->id) . '&socid=' . ((int) $object->socid)
3596
+					'url' => '/contrat/card.php?action=create&origin='.urlencode($object->element).'&originid='.((int) $object->id).'&socid='.((int) $object->socid)
3597 3597
 				);
3598 3598
 				/*if (isModEnabled('contract') && $object->status == Propal::STATUS_SIGNED) {
3599 3599
 					$langs->load("contracts");
@@ -3610,7 +3610,7 @@  discard block
 block discarded – undo
3610 3610
 						'enabled' => isModEnabled('invoice'),
3611 3611
 						'perm' => $usercancreateinvoice,
3612 3612
 						'label' => 'CreateBill',
3613
-						'url' => '/compta/facture/card.php?action=create&origin=' . urlencode($object->element) . '&originid=' . ((int) $object->id) . '&socid=' . ((int) $object->socid),
3613
+						'url' => '/compta/facture/card.php?action=create&origin='.urlencode($object->element).'&originid='.((int) $object->id).'&socid='.((int) $object->socid),
3614 3614
 					];
3615 3615
 					/*if (isModEnabled('invoice') && $usercancreateinvoice) {
3616 3616
 						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>';
@@ -3619,7 +3619,7 @@  discard block
 block discarded – undo
3619 3619
 
3620 3620
 				$actionButtonsParameters = [
3621 3621
 					"areDropdownButtons" => !getDolGlobalInt("MAIN_REMOVE_DROPDOWN_CREATE_BUTTONS_ON_ORDER"),
3622
-					"backtopage" => $_SERVER["PHP_SELF"] . "?id=" . ((int) $id)
3622
+					"backtopage" => $_SERVER["PHP_SELF"]."?id=".((int) $id)
3623 3623
 				];
3624 3624
 
3625 3625
 				if ($numlines > 0) {
@@ -3632,9 +3632,9 @@  discard block
 block discarded – undo
3632 3632
 					$arrayofinvoiceforpropal = $object->getInvoiceArrayList();
3633 3633
 					if ((is_array($arrayofinvoiceforpropal) && count($arrayofinvoiceforpropal) > 0) || !getDolGlobalString('WORKFLOW_PROPAL_NEED_INVOICE_TO_BE_CLASSIFIED_BILLED')) {
3634 3634
 						if ($usercanclose) {
3635
-							print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=classifybilled&token=' . newToken() . '&socid=' . $object->socid . '">' . $langs->trans("ClassifyBilled") . '</a>';
3635
+							print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=classifybilled&token='.newToken().'&socid='.$object->socid.'">'.$langs->trans("ClassifyBilled").'</a>';
3636 3636
 						} else {
3637
-							print '<a class="butActionRefused classfortooltip" href="#" title="' . $langs->trans("NotEnoughPermissions") . '">' . $langs->trans("ClassifyBilled") . '</a>';
3637
+							print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("NotEnoughPermissions").'">'.$langs->trans("ClassifyBilled").'</a>';
3638 3638
 						}
3639 3639
 					}
3640 3640
 				}
@@ -3643,33 +3643,33 @@  discard block
 block discarded – undo
3643 3643
 					// Close as accepted/refused
3644 3644
 					if ($object->status == Propal::STATUS_VALIDATED) {
3645 3645
 						if ($usercanclose) {
3646
-							print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=closeas&token=' . newToken() . (!getDolGlobalString('MAIN_JUMP_TAG') ? '' : '#close') . '"';
3647
-							print '>' . $langs->trans('SetAcceptedRefused') . '</a>';
3646
+							print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=closeas&token='.newToken().(!getDolGlobalString('MAIN_JUMP_TAG') ? '' : '#close').'"';
3647
+							print '>'.$langs->trans('SetAcceptedRefused').'</a>';
3648 3648
 						} else {
3649
-							print '<a class="butActionRefused classfortooltip" href="#" title="' . $langs->trans("NotEnoughPermissions") . '"';
3650
-							print '>' . $langs->trans('SetAcceptedRefused') . '</a>';
3649
+							print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("NotEnoughPermissions").'"';
3650
+							print '>'.$langs->trans('SetAcceptedRefused').'</a>';
3651 3651
 						}
3652 3652
 					}
3653 3653
 				} else {
3654 3654
 					// Set not signed (close)
3655 3655
 					if ($object->status == Propal::STATUS_DRAFT && $usercanclose) {
3656
-						print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&token=' . newToken() . '&action=closeas&token=' . newToken() . (!getDolGlobalString('MAIN_JUMP_TAG') ? '' : '#close') . '"';
3657
-						print '>' . $langs->trans('SetRefusedAndClose') . '</a>';
3656
+						print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&token='.newToken().'&action=closeas&token='.newToken().(!getDolGlobalString('MAIN_JUMP_TAG') ? '' : '#close').'"';
3657
+						print '>'.$langs->trans('SetRefusedAndClose').'</a>';
3658 3658
 					}
3659 3659
 				}
3660 3660
 
3661 3661
 				// Cancel propal
3662 3662
 				if ($object->status > Propal::STATUS_DRAFT && $usercanclose) {
3663
-					print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=cancel&token=' . newToken() . '">' . $langs->trans("CancelPropal") . '</a>';
3663
+					print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=cancel&token='.newToken().'">'.$langs->trans("CancelPropal").'</a>';
3664 3664
 				}
3665 3665
 
3666 3666
 				// Clone
3667 3667
 				if ($usercancreate) {
3668
-					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>';
3668
+					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>';
3669 3669
 				}
3670 3670
 
3671 3671
 				// Delete
3672
-				print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=delete&token=' . newToken(), 'delete', $usercandelete);
3672
+				print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', $usercandelete);
3673 3673
 			}
3674 3674
 		}
3675 3675
 
@@ -3688,8 +3688,8 @@  discard block
 block discarded – undo
3688 3688
 		 * Generated documents
3689 3689
 		 */
3690 3690
 		$objref = dol_sanitizeFileName($object->ref);
3691
-		$filedir = $conf->propal->multidir_output[$object->entity ?? $conf->entity] . "/" . dol_sanitizeFileName($object->ref);
3692
-		$urlsource = $_SERVER["PHP_SELF"] . "?id=" . $object->id;
3691
+		$filedir = $conf->propal->multidir_output[$object->entity ?? $conf->entity]."/".dol_sanitizeFileName($object->ref);
3692
+		$urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id;
3693 3693
 		$genallowed = $usercanread;
3694 3694
 		$delallowed = $usercancreate;
3695 3695
 
@@ -3712,19 +3712,19 @@  discard block
 block discarded – undo
3712 3712
 
3713 3713
 		if ($object->status != Propal::STATUS_DRAFT && $useonlinesignature) {
3714 3714
 			print '<br><!-- Link to sign -->';
3715
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/signature.lib.php';
3716
-			print showOnlineSignatureUrl('proposal', $object->ref, $object) . '<br>';
3715
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/signature.lib.php';
3716
+			print showOnlineSignatureUrl('proposal', $object->ref, $object).'<br>';
3717 3717
 		}
3718 3718
 
3719 3719
 		print '</div><div class="fichehalfright">';
3720 3720
 
3721 3721
 		$MAXEVENT = 10;
3722 3722
 
3723
-		$morehtmlcenter = dolGetButtonTitle($langs->trans('FullConversation'), '', 'fa fa-comments imgforviewmode', DOL_URL_ROOT . '/comm/propal/messaging.php?id=' . $object->id);
3724
-		$morehtmlcenter .= dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', DOL_URL_ROOT . '/comm/propal/agenda.php?id=' . $object->id);
3723
+		$morehtmlcenter = dolGetButtonTitle($langs->trans('FullConversation'), '', 'fa fa-comments imgforviewmode', DOL_URL_ROOT.'/comm/propal/messaging.php?id='.$object->id);
3724
+		$morehtmlcenter .= dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', DOL_URL_ROOT.'/comm/propal/agenda.php?id='.$object->id);
3725 3725
 
3726 3726
 		// List of actions on element
3727
-		include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
3727
+		include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
3728 3728
 		$formactions = new FormActions($db);
3729 3729
 		$somethingshown = $formactions->showactions($object, 'propal', $socid, 1, '', $MAXEVENT, '', $morehtmlcenter); // Show all action for thirdparty
3730 3730
 
@@ -3735,9 +3735,9 @@  discard block
 block discarded – undo
3735 3735
 	$modelmail = 'propal_send';
3736 3736
 	$defaulttopic = 'SendPropalRef';
3737 3737
 	$diroutput = $conf->propal->multidir_output[$object->entity ?? $conf->entity];
3738
-	$trackid = 'pro' . $object->id;
3738
+	$trackid = 'pro'.$object->id;
3739 3739
 
3740
-	include DOL_DOCUMENT_ROOT . '/core/tpl/card_presend.tpl.php';
3740
+	include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php';
3741 3741
 }
3742 3742
 
3743 3743
 // End of page
Please login to merge, or discard this patch.
htdocs/comm/propal/class/propaleligne.class.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -421,9 +421,9 @@  discard block
 block discarded – undo
421 421
 				$this->libelle = $objp->product_label; // deprecated
422 422
 				$this->product_label	= $objp->product_label;
423 423
 				$this->product_desc		= $objp->product_desc;
424
-				$this->fk_unit          = $objp->fk_unit;
424
+				$this->fk_unit = $objp->fk_unit;
425 425
 
426
-				$this->packaging      	= $objp->packaging;
426
+				$this->packaging = $objp->packaging;
427 427
 
428 428
 				$this->date_start       = $this->db->jdate($objp->date_start);
429 429
 				$this->date_end         = $this->db->jdate($objp->date_end);
@@ -649,7 +649,7 @@  discard block
 block discarded – undo
649 649
 		// End call triggers
650 650
 
651 651
 		if (!$error) {
652
-			$sql = "DELETE FROM " . MAIN_DB_PREFIX . "propaldet WHERE rowid = " . ((int) $this->rowid);
652
+			$sql = "DELETE FROM ".MAIN_DB_PREFIX."propaldet WHERE rowid = ".((int) $this->rowid);
653 653
 			dol_syslog("PropaleLigne::delete", LOG_DEBUG);
654 654
 			if ($this->db->query($sql)) {
655 655
 				// Remove extrafields
@@ -657,10 +657,10 @@  discard block
 block discarded – undo
657 657
 				$result = $this->deleteExtraFields();
658 658
 				if ($result < 0) {
659 659
 					$error++;
660
-					dol_syslog(get_class($this) . "::delete error -4 " . $this->error, LOG_ERR);
660
+					dol_syslog(get_class($this)."::delete error -4 ".$this->error, LOG_ERR);
661 661
 				}
662 662
 			} else {
663
-				$this->error = $this->db->error() . " sql=" . $sql;
663
+				$this->error = $this->db->error()." sql=".$sql;
664 664
 				$error++;
665 665
 			}
666 666
 		}
Please login to merge, or discard this patch.
htdocs/comm/propal/class/propal.class.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -699,7 +699,7 @@  discard block
 block discarded – undo
699 699
 			}
700 700
 			$txlocaltax1 = price2num($txlocaltax1);
701 701
 			$txlocaltax2 = price2num($txlocaltax2);
702
-			$pa_ht = price2num($pa_ht);  // do not convert to float here, it breaks the functioning of $pa_ht is empty string
702
+			$pa_ht = price2num($pa_ht); // do not convert to float here, it breaks the functioning of $pa_ht is empty string
703 703
 			if ($price_base_type == 'HT') {
704 704
 				$pu = $pu_ht;
705 705
 			} else {
@@ -941,7 +941,7 @@  discard block
 block discarded – undo
941 941
 		}
942 942
 		$txlocaltax1 = price2num($txlocaltax1);
943 943
 		$txlocaltax2 = price2num($txlocaltax2);
944
-		$pa_ht = price2num($pa_ht);  // do not convert to float here, it breaks the functioning of $pa_ht_isemptystring
944
+		$pa_ht = price2num($pa_ht); // do not convert to float here, it breaks the functioning of $pa_ht_isemptystring
945 945
 		if (empty($qty) && empty($special_code)) {
946 946
 			$special_code = 3; // Set option tag
947 947
 		}
@@ -1528,7 +1528,7 @@  discard block
 block discarded – undo
1528 1528
 			if ($objsoc->id > 0 && !empty($object->lines)) {
1529 1529
 				if ($update_prices === true && getDolGlobalString('PRODUIT_CUSTOMER_PRICES')) {
1530 1530
 					// If price per customer
1531
-					require_once DOL_DOCUMENT_ROOT . '/product/class/productcustomerprice.class.php';
1531
+					require_once DOL_DOCUMENT_ROOT.'/product/class/productcustomerprice.class.php';
1532 1532
 				}
1533 1533
 
1534 1534
 				foreach ($object->lines as $line) {
@@ -1561,9 +1561,9 @@  discard block
 block discarded – undo
1561 1561
 											foreach ($prodcustprice->lines as $k => $custprice_line) {
1562 1562
 												if ($custprice_line->date_begin <= $date_now && (empty($custprice_line->date_end) || $date_now <= $custprice_line->date_end)) {
1563 1563
 													$pu_ht = price($custprice_line->price);
1564
-													$tva_tx = ($custprice_line->default_vat_code ? $custprice_line->tva_tx . ' (' . $custprice_line->default_vat_code . ' )' : $custprice_line->tva_tx);
1564
+													$tva_tx = ($custprice_line->default_vat_code ? $custprice_line->tva_tx.' ('.$custprice_line->default_vat_code.' )' : $custprice_line->tva_tx);
1565 1565
 													if ($custprice_line->default_vat_code && !preg_match('/\(.*\)/', $tva_tx)) {
1566
-														$tva_tx .= ' (' . $custprice_line->default_vat_code . ')';
1566
+														$tva_tx .= ' ('.$custprice_line->default_vat_code.')';
1567 1567
 													}
1568 1568
 													$remise_percent = $custprice_line->discount_percent;
1569 1569
 													break;
@@ -1729,7 +1729,7 @@  discard block
 block discarded – undo
1729 1729
 				$this->ref_customer         = $obj->ref_client;
1730 1730
 				$this->ref_ext              = $obj->ref_ext;
1731 1731
 
1732
-				$this->total                = $obj->total_ttc;			// TODO deprecated
1732
+				$this->total                = $obj->total_ttc; // TODO deprecated
1733 1733
 				$this->total_ttc            = $obj->total_ttc;
1734 1734
 				$this->total_ht             = $obj->total_ht;
1735 1735
 				$this->total_tva            = $obj->total_tva;
@@ -2650,7 +2650,7 @@  discard block
 block discarded – undo
2650 2650
 	 */
2651 2651
 	public function closeProposal($user, $status, $note_private = '', $notrigger = 0, $note_public = '')
2652 2652
 	{
2653
-		global $langs,$conf;
2653
+		global $langs, $conf;
2654 2654
 
2655 2655
 		$error = 0;
2656 2656
 		$now = dol_now();
@@ -2685,10 +2685,10 @@  discard block
 block discarded – undo
2685 2685
 		if ($resql) {
2686 2686
 			// Status self::STATUS_REFUSED by default
2687 2687
 			$modelpdf = getDolGlobalString('PROPALE_ADDON_PDF_ODT_CLOSED', $this->model_pdf);
2688
-			$triggerName = 'PROPAL_CLOSE_REFUSED';		// used later in call_trigger()
2688
+			$triggerName = 'PROPAL_CLOSE_REFUSED'; // used later in call_trigger()
2689 2689
 
2690 2690
 			if ($status == self::STATUS_SIGNED) {			// Status self::STATUS_SIGNED
2691
-				$triggerName = 'PROPAL_CLOSE_SIGNED';	// used later in call_trigger()
2691
+				$triggerName = 'PROPAL_CLOSE_SIGNED'; // used later in call_trigger()
2692 2692
 				$modelpdf = getDolGlobalString('PROPALE_ADDON_PDF_ODT_TOBILL', $this->model_pdf);
2693 2693
 
2694 2694
 				// The connected company is classified as a client
@@ -2722,7 +2722,7 @@  discard block
 block discarded – undo
2722 2722
 			}
2723 2723
 
2724 2724
 			$this->oldcopy = clone $this;
2725
-			$this->statut = $status;	// deprecated
2725
+			$this->statut = $status; // deprecated
2726 2726
 			$this->status = $status;
2727 2727
 			$this->date_signature = $date_signature;
2728 2728
 			$this->note_private = $newprivatenote;
@@ -2740,7 +2740,7 @@  discard block
 block discarded – undo
2740 2740
 				$this->db->commit();
2741 2741
 				return 1;
2742 2742
 			} else {
2743
-				$this->statut = $this->oldcopy->status;	// deprecated
2743
+				$this->statut = $this->oldcopy->status; // deprecated
2744 2744
 				$this->status = $this->oldcopy->status;
2745 2745
 				$this->date_signature = $this->oldcopy->date_signature;
2746 2746
 				$this->note_private = $this->oldcopy->note_private;
@@ -2854,10 +2854,10 @@  discard block
 block discarded – undo
2854 2854
 
2855 2855
 		$this->db->begin();
2856 2856
 
2857
-		$sql = "UPDATE ". MAIN_DB_PREFIX . $this->table_element;
2858
-		$sql .= " SET fk_statut = " . self::STATUS_CANCELED . ",";
2859
-		$sql .= " fk_user_modif = " . ((int) $user->id);
2860
-		$sql .= " WHERE rowid = " . ((int) $this->id);
2857
+		$sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element;
2858
+		$sql .= " SET fk_statut = ".self::STATUS_CANCELED.",";
2859
+		$sql .= " fk_user_modif = ".((int) $user->id);
2860
+		$sql .= " WHERE rowid = ".((int) $this->id);
2861 2861
 
2862 2862
 		dol_syslog(get_class($this)."::cancel", LOG_DEBUG);
2863 2863
 		if ($this->db->query($sql)) {
@@ -2869,7 +2869,7 @@  discard block
 block discarded – undo
2869 2869
 			// End call triggers
2870 2870
 
2871 2871
 			if (!$error) {
2872
-				$this->statut = self::STATUS_CANCELED;	// deprecated
2872
+				$this->statut = self::STATUS_CANCELED; // deprecated
2873 2873
 				$this->status = self::STATUS_CANCELED;
2874 2874
 				$this->db->commit();
2875 2875
 				return 1;
@@ -2935,7 +2935,7 @@  discard block
 block discarded – undo
2935 2935
 		}
2936 2936
 
2937 2937
 		if (!$error) {
2938
-			$this->statut = self::STATUS_DRAFT;	// deprecated
2938
+			$this->statut = self::STATUS_DRAFT; // deprecated
2939 2939
 			$this->status = self::STATUS_DRAFT;
2940 2940
 
2941 2941
 			$this->db->commit();
@@ -3218,7 +3218,7 @@  discard block
 block discarded – undo
3218 3218
 					}
3219 3219
 				}
3220 3220
 				if (file_exists($dir)) {
3221
-					$res = @dol_delete_dir_recursive($dir);		// delete files physically + into ecm tables
3221
+					$res = @dol_delete_dir_recursive($dir); // delete files physically + into ecm tables
3222 3222
 					if (!$res) {
3223 3223
 						$this->error = 'ErrorFailToDeleteDir';
3224 3224
 						$this->errors[] = $this->error;
@@ -3625,7 +3625,7 @@  discard block
 block discarded – undo
3625 3625
 		$this->multicurrency_code = $conf->currency;
3626 3626
 
3627 3627
 		// Lines
3628
-		$nbp = min(1000, GETPOSTINT('nblines') ? GETPOSTINT('nblines') : 5);	// We can force the nb of lines to test from command line (but not more than 1000)
3628
+		$nbp = min(1000, GETPOSTINT('nblines') ? GETPOSTINT('nblines') : 5); // We can force the nb of lines to test from command line (but not more than 1000)
3629 3629
 		$xnbp = 0;
3630 3630
 		while ($xnbp < $nbp) {
3631 3631
 			$line = new PropaleLigne($this->db);
@@ -3958,7 +3958,7 @@  discard block
 block discarded – undo
3958 3958
 		}
3959 3959
 
3960 3960
 		global $action;
3961
-		$hookmanager->initHooks(array($this->element . 'dao'));
3961
+		$hookmanager->initHooks(array($this->element.'dao'));
3962 3962
 		$parameters = array('id' => $this->id, 'getnomurl' => &$result);
3963 3963
 		$reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
3964 3964
 		if ($reshook > 0) {
@@ -4063,7 +4063,7 @@  discard block
 block discarded – undo
4063 4063
 		$return .= img_picto('', $this->picto);
4064 4064
 		$return .= '</div>';
4065 4065
 		$return .= '<div class="info-box-content">';
4066
-		$return .= '<span class="info-box-ref inline-block tdoverflowmax150 valignmiddle">' . $this->getNomUrl() . '</span>';
4066
+		$return .= '<span class="info-box-ref inline-block tdoverflowmax150 valignmiddle">'.$this->getNomUrl().'</span>';
4067 4067
 		if ($selected >= 0) {
4068 4068
 			$return .= '<input id="cb'.$this->id.'" class="flat checkforselect fright" type="checkbox" name="toselect[]" value="'.$this->id.'"'.($selected ? ' checked="checked"' : '').'>';
4069 4069
 		}
Please login to merge, or discard this patch.