Completed
Branch develop (ad830a)
by
unknown
24:51
created
test/phpunit/CodingPhpTest.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
  *      \remarks    To run this script as CLI:  phpunit filename.php
27 27
  */
28 28
 
29
-global $conf,$user,$langs,$db;
29
+global $conf, $user, $langs, $db;
30 30
 //define('TEST_DB_FORCE_TYPE','mysql');	// This is to force using mysql driver
31 31
 //require_once 'PHPUnit/Autoload.php';
32 32
 require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
@@ -34,35 +34,35 @@  discard block
 block discarded – undo
34 34
 require_once dirname(__FILE__).'/../../htdocs/core/lib/security2.lib.php';
35 35
 require_once dirname(__FILE__).'/CommonClassTest.class.php';
36 36
 
37
-if (! defined('NOREQUIREUSER')) {
37
+if (!defined('NOREQUIREUSER')) {
38 38
 	define('NOREQUIREUSER', '1');
39 39
 }
40
-if (! defined('NOREQUIREDB')) {
40
+if (!defined('NOREQUIREDB')) {
41 41
 	define('NOREQUIREDB', '1');
42 42
 }
43
-if (! defined('NOREQUIRESOC')) {
43
+if (!defined('NOREQUIRESOC')) {
44 44
 	define('NOREQUIRESOC', '1');
45 45
 }
46
-if (! defined('NOREQUIRETRAN')) {
46
+if (!defined('NOREQUIRETRAN')) {
47 47
 	define('NOREQUIRETRAN', '1');
48 48
 }
49
-if (! defined('NOCSRFCHECK')) {
49
+if (!defined('NOCSRFCHECK')) {
50 50
 	define('NOCSRFCHECK', '1');
51 51
 }
52
-if (! defined('NOTOKENRENEWAL')) {
52
+if (!defined('NOTOKENRENEWAL')) {
53 53
 	define('NOTOKENRENEWAL', '1');
54 54
 }
55
-if (! defined('NOREQUIREMENU')) {
55
+if (!defined('NOREQUIREMENU')) {
56 56
 	define('NOREQUIREMENU', '1'); // If there is no menu to show
57 57
 }
58
-if (! defined('NOREQUIREHTML')) {
58
+if (!defined('NOREQUIREHTML')) {
59 59
 	define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php
60 60
 }
61
-if (! defined('NOREQUIREAJAX')) {
61
+if (!defined('NOREQUIREAJAX')) {
62 62
 	define('NOREQUIREAJAX', '1');
63 63
 }
64
-if (! defined("NOLOGIN")) {
65
-	define("NOLOGIN", '1');       // If this page is public (can be called outside logged session)
64
+if (!defined("NOLOGIN")) {
65
+	define("NOLOGIN", '1'); // If this page is public (can be called outside logged session)
66 66
 }
67 67
 
68 68
 if (empty($user->id)) {
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
 		 }
112 112
 		 ));
113 113
 		 */
114
-		return array_map(function ($value) {
114
+		return array_map(function($value) {
115 115
 			return array($value);
116 116
 		}, $filesarray);
117 117
 	}
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
 			|| preg_match('/modules\/(import|mailings|printing)\//', $file['relativename'])
156 156
 			|| in_array($file['name'], array('modules_boxes.php', 'TraceableDB.php'))) {
157 157
 			// Check Class files
158
-			if (! in_array($file['name'], array(
158
+			if (!in_array($file['name'], array(
159 159
 					'api.class.php',
160 160
 					'commonobject.class.php',
161 161
 					'conf.class.php',
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
 				//exit;
180 180
 			}
181 181
 
182
-			if (preg_match('/\.class\.php$/', $file['relativename']) && ! in_array($file['relativename'], array(
182
+			if (preg_match('/\.class\.php$/', $file['relativename']) && !in_array($file['relativename'], array(
183 183
 					'adherents/class/adherent.class.php',
184 184
 					'adherents/canvas/actions_adherentcard_common.class.php',
185 185
 					'contact/canvas/actions_contactcard_common.class.php',
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
 			}
225 225
 		} else {
226 226
 			// Check Include files
227
-			if (! in_array($file['name'], array(
227
+			if (!in_array($file['name'], array(
228 228
 				'objectline_view.tpl.php',
229 229
 				'extrafieldsinexport.inc.php',
230 230
 				'extrafieldsinimport.inc.php',
@@ -436,9 +436,9 @@  discard block
 block discarded – undo
436 436
 		$found = "";
437 437
 		preg_match_all('/(sql|SET|WHERE|where|INSERT|insert|VALUES|LIKE).+\s*\'"\s*\.\s*\$(.......)/', $filecontent, $matches, PREG_SET_ORDER);
438 438
 		foreach ($matches as $key => $val) {
439
-			if (! in_array($val[2], array('this->d', 'this->e', 'db->esc', 'dbs->es', 'dbs->id', 'mydb->e', 'dbsessi', 'db->ida', 'escaped', 'exclude', 'include'))) {
439
+			if (!in_array($val[2], array('this->d', 'this->e', 'db->esc', 'dbs->es', 'dbs->id', 'mydb->e', 'dbsessi', 'db->ida', 'escaped', 'exclude', 'include'))) {
440 440
 				$found = $val[0];
441
-				$ok = false;	// This will generate error
441
+				$ok = false; // This will generate error
442 442
 				break;
443 443
 			}
444 444
 			//if ($reg[0] != 'db') $ok=false;
@@ -453,7 +453,7 @@  discard block
 block discarded – undo
453 453
 		$found = "";
454 454
 		preg_match_all('/(\$sql|SET\s|WHERE\s|INSERT\s|VALUES\s|VALUES\().+\s*\'\s*\.\s*\$(.........)/', $filecontent, $matches, PREG_SET_ORDER);
455 455
 		foreach ($matches as $key => $val) {
456
-			if (! in_array($val[2], array('this->db-', 'db->prefi', 'db->sanit', 'dbs->pref', 'dbs->sani', 'conf->ent', 'key : \'\')', 'key])."\')', 'excludefi', 'regexstri', ''))) {
456
+			if (!in_array($val[2], array('this->db-', 'db->prefi', 'db->sanit', 'dbs->pref', 'dbs->sani', 'conf->ent', 'key : \'\')', 'key])."\')', 'excludefi', 'regexstri', ''))) {
457 457
 				$found = $val[0];
458 458
 				$ok = false;
459 459
 				var_dump($matches);
@@ -744,7 +744,7 @@  discard block
 block discarded – undo
744 744
 					&& !preg_match('/not required/i', $val[0])) {
745 745
 					$ok = false;
746 746
 
747
-					var_dump($file['fullname'].' '.$val[0].' '.$filecontentaction);exit;
747
+					var_dump($file['fullname'].' '.$val[0].' '.$filecontentaction); exit;
748 748
 
749 749
 					print "File ".$file['relativename']." - Line: ".$val[0]."\n";
750 750
 					break;
@@ -896,7 +896,7 @@  discard block
 block discarded – undo
896 896
 	{
897 897
 		return preg_replace_callback(
898 898
 			'{(//.*?$)|(/\*.*?\*/)}ms',
899
-			static function ($match) {
899
+			static function($match) {
900 900
 				if (isset($match[2])) {
901 901
 					// Count the number of newline characters in the comment
902 902
 					$num_newlines = substr_count($match[0], "\n");
Please login to merge, or discard this patch.
htdocs/hrm/job_card.php 1 patch
Spacing   +66 added lines, -66 removed lines patch added patch discarded remove patch
@@ -31,12 +31,12 @@  discard block
 block discarded – undo
31 31
 // Load Dolibarr environment
32 32
 require '../main.inc.php';
33 33
 
34
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formcompany.class.php';
35
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formfile.class.php';
36
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php';
37
-require_once DOL_DOCUMENT_ROOT . '/hrm/class/job.class.php';
38
-require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_job.lib.php';
39
-require_once DOL_DOCUMENT_ROOT . '/hrm/class/skillrank.class.php';
34
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
35
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
36
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
37
+require_once DOL_DOCUMENT_ROOT.'/hrm/class/job.class.php';
38
+require_once DOL_DOCUMENT_ROOT.'/hrm/lib/hrm_job.lib.php';
39
+require_once DOL_DOCUMENT_ROOT.'/hrm/class/skillrank.class.php';
40 40
 
41 41
 /**
42 42
  * @var Conf $conf
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
  */
49 49
 
50 50
 // Load translation files required by the page
51
-$langs->loadLangs(array('hrm', 'other', 'products'));   // why products?
51
+$langs->loadLangs(array('hrm', 'other', 'products')); // why products?
52 52
 
53 53
 // Get parameters
54 54
 $id = GETPOSTINT('id');
@@ -59,12 +59,12 @@  discard block
 block discarded – undo
59 59
 $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'jobcard'; // To manage different context of search
60 60
 $backtopage = GETPOST('backtopage', 'alpha');
61 61
 $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha');
62
-$lineid   = GETPOSTINT('lineid');
62
+$lineid = GETPOSTINT('lineid');
63 63
 
64 64
 // Initialize a technical objects
65 65
 $object = new Job($db);
66 66
 $extrafields = new ExtraFields($db);
67
-$diroutputmassaction = $conf->hrm->dir_output . '/temp/massgeneration/' . $user->id;
67
+$diroutputmassaction = $conf->hrm->dir_output.'/temp/massgeneration/'.$user->id;
68 68
 $hookmanager->initHooks(array('jobcard', 'globalcard')); // Note that conf->hooks_modules contains array
69 69
 
70 70
 // Fetch optionals attributes and labels
@@ -76,8 +76,8 @@  discard block
 block discarded – undo
76 76
 $search_all = GETPOST("search_all", 'alpha');
77 77
 $search = array();
78 78
 foreach ($object->fields as $key => $val) {
79
-	if (GETPOST('search_' . $key, 'alpha')) {
80
-		$search[$key] = GETPOST('search_' . $key, 'alpha');
79
+	if (GETPOST('search_'.$key, 'alpha')) {
80
+		$search[$key] = GETPOST('search_'.$key, 'alpha');
81 81
 	}
82 82
 }
83 83
 
@@ -86,13 +86,13 @@  discard block
 block discarded – undo
86 86
 }
87 87
 
88 88
 // Load object
89
-include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'.
89
+include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'.
90 90
 
91 91
 // Permissions
92 92
 $permissiontoread = $user->hasRight('hrm', 'all', 'read');
93 93
 $permissiontoadd  = $user->hasRight('hrm', 'all', 'write'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
94 94
 $permissiontodelete = $user->hasRight('hrm', 'all', 'delete');
95
-$upload_dir = $conf->hrm->multidir_output[isset($object->entity) ? $object->entity : 1] . '/job';
95
+$upload_dir = $conf->hrm->multidir_output[isset($object->entity) ? $object->entity : 1].'/job';
96 96
 
97 97
 // Security check (enable the most restrictive one)
98 98
 //if ($user->socid > 0) accessforbidden();
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
 			if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) {		// Test on permission not required
128 128
 				$backtopage = $backurlforlist;
129 129
 			} else {
130
-				$backtopage = dol_buildpath('/hrm/job_card.php', 1) . '?id=' . ($id > 0 ? $id : '__ID__');
130
+				$backtopage = dol_buildpath('/hrm/job_card.php', 1).'?id='.($id > 0 ? $id : '__ID__');
131 131
 			}
132 132
 		}
133 133
 	}
@@ -137,20 +137,20 @@  discard block
 block discarded – undo
137 137
 
138 138
 	// Actions cancel, add, update, update_extras, confirm_validate, confirm_delete, confirm_deleteline, confirm_clone, confirm_close, confirm_setdraft, confirm_reopen
139 139
 	if ($action != 'confirm_clone') {
140
-		include DOL_DOCUMENT_ROOT . '/core/actions_addupdatedelete.inc.php';
140
+		include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php';
141 141
 	}
142 142
 
143 143
 	// Actions when linking object each other
144
-	include DOL_DOCUMENT_ROOT . '/core/actions_dellink.inc.php';
144
+	include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php';
145 145
 
146 146
 	// Actions when printing a doc from card
147
-	include DOL_DOCUMENT_ROOT . '/core/actions_printing.inc.php';
147
+	include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
148 148
 
149 149
 	// Action to move up and down lines of object
150 150
 	//include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php';
151 151
 
152 152
 	// Action to build doc
153
-	include DOL_DOCUMENT_ROOT . '/core/actions_builddoc.inc.php';
153
+	include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
154 154
 
155 155
 	if ($action == 'set_thirdparty' && $permissiontoadd) {
156 156
 		$object->setValueFrom('fk_soc', GETPOSTINT('fk_soc'), '', null, 'date', '', $user, $triggermodname);
@@ -162,8 +162,8 @@  discard block
 block discarded – undo
162 162
 	// Actions to send emails
163 163
 	$triggersendname = 'HRM_JOB_SENTBYMAIL';
164 164
 	$autocopy = 'MAIN_MAIL_AUTOCOPY_JOB_TO';
165
-	$trackid = 'job' . $object->id;
166
-	include DOL_DOCUMENT_ROOT . '/core/actions_sendmails.inc.php';
165
+	$trackid = 'job'.$object->id;
166
+	include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
167 167
 
168 168
 	if ($action == 'confirm_clone' && $confirm != 'yes') {	// Test on permission not required
169 169
 		$action = '';
@@ -235,36 +235,36 @@  discard block
 block discarded – undo
235 235
 
236 236
 // Part to create
237 237
 if ($action == 'create') {
238
-	print load_fiche_titre($langs->trans("NewJobProfile", $langs->transnoentities('Job')), '', 'object_' . $object->picto);
238
+	print load_fiche_titre($langs->trans("NewJobProfile", $langs->transnoentities('Job')), '', 'object_'.$object->picto);
239 239
 
240
-	print '<form method="POST" action="' . $_SERVER["PHP_SELF"] . '">';
241
-	print '<input type="hidden" name="token" value="' . newToken() . '">';
240
+	print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
241
+	print '<input type="hidden" name="token" value="'.newToken().'">';
242 242
 	print '<input type="hidden" name="action" value="add">';
243 243
 	if ($backtopage) {
244
-		print '<input type="hidden" name="backtopage" value="' . $backtopage . '">';
244
+		print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
245 245
 	}
246 246
 	if ($backtopageforcancel) {
247
-		print '<input type="hidden" name="backtopageforcancel" value="' . $backtopageforcancel . '">';
247
+		print '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">';
248 248
 	}
249 249
 
250 250
 	print dol_get_fiche_head(array(), '');
251 251
 
252
-	print '<table class="border centpercent tableforfieldcreate">' . "\n";
252
+	print '<table class="border centpercent tableforfieldcreate">'."\n";
253 253
 
254 254
 	// Common attributes
255
-	include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_add.tpl.php';
255
+	include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_add.tpl.php';
256 256
 
257 257
 	// Other attributes
258
-	include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_add.tpl.php';
258
+	include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php';
259 259
 
260
-	print '</table>' . "\n";
260
+	print '</table>'."\n";
261 261
 
262 262
 	print dol_get_fiche_end();
263 263
 
264 264
 	print '<div class="center">';
265
-	print '<input type="submit" class="button" name="add" value="' . dol_escape_htmltag($langs->trans("Create")) . '">';
265
+	print '<input type="submit" class="button" name="add" value="'.dol_escape_htmltag($langs->trans("Create")).'">';
266 266
 	print '&nbsp; ';
267
-	print '<input type="' . ($backtopage ? "submit" : "button") . '" class="button button-cancel" name="cancel" value="' . dol_escape_htmltag($langs->trans("Cancel")) . '"' . ($backtopage ? '' : ' onclick="history.go(-1)"') . '>'; // Cancel for create does not post form if we don't know the backtopage
267
+	print '<input type="'.($backtopage ? "submit" : "button").'" class="button button-cancel" name="cancel" value="'.dol_escape_htmltag($langs->trans("Cancel")).'"'.($backtopage ? '' : ' onclick="history.go(-1)"').'>'; // Cancel for create does not post form if we don't know the backtopage
268 268
 	print '</div>';
269 269
 
270 270
 	print '</form>';
@@ -274,35 +274,35 @@  discard block
 block discarded – undo
274 274
 
275 275
 // Part to edit record
276 276
 if (($id || $ref) && $action == 'edit') {
277
-	print load_fiche_titre($langs->trans("JobProfile"), '', 'object_' . $object->picto);
277
+	print load_fiche_titre($langs->trans("JobProfile"), '', 'object_'.$object->picto);
278 278
 
279
-	print '<form method="POST" action="' . $_SERVER["PHP_SELF"] . '">';
280
-	print '<input type="hidden" name="token" value="' . newToken() . '">';
279
+	print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
280
+	print '<input type="hidden" name="token" value="'.newToken().'">';
281 281
 	print '<input type="hidden" name="action" value="update">';
282
-	print '<input type="hidden" name="id" value="' . $object->id . '">';
282
+	print '<input type="hidden" name="id" value="'.$object->id.'">';
283 283
 	if ($backtopage) {
284
-		print '<input type="hidden" name="backtopage" value="' . $backtopage . '">';
284
+		print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
285 285
 	}
286 286
 	if ($backtopageforcancel) {
287
-		print '<input type="hidden" name="backtopageforcancel" value="' . $backtopageforcancel . '">';
287
+		print '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">';
288 288
 	}
289 289
 
290 290
 	print dol_get_fiche_head();
291 291
 
292
-	print '<table class="border centpercent tableforfieldedit">' . "\n";
292
+	print '<table class="border centpercent tableforfieldedit">'."\n";
293 293
 
294 294
 	// Common attributes
295
-	include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_edit.tpl.php';
295
+	include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_edit.tpl.php';
296 296
 
297 297
 	// Other attributes
298
-	include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_edit.tpl.php';
298
+	include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_edit.tpl.php';
299 299
 
300 300
 	print '</table>';
301 301
 
302 302
 	print dol_get_fiche_end();
303 303
 
304
-	print '<div class="center"><input type="submit" class="button button-save" name="save" value="' . $langs->trans("Save") . '">';
305
-	print ' &nbsp; <input type="submit" class="button button-cancel" name="cancel" value="' . $langs->trans("Cancel") . '">';
304
+	print '<div class="center"><input type="submit" class="button button-save" name="save" value="'.$langs->trans("Save").'">';
305
+	print ' &nbsp; <input type="submit" class="button button-cancel" name="cancel" value="'.$langs->trans("Cancel").'">';
306 306
 	print '</div>';
307 307
 
308 308
 	print '</form>';
@@ -320,11 +320,11 @@  discard block
 block discarded – undo
320 320
 
321 321
 	// Confirmation to delete
322 322
 	if ($action == 'delete') {
323
-		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('DeleteJob'), $langs->trans('ConfirmDeleteObject'), 'confirm_delete', '', 0, 1);
323
+		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteJob'), $langs->trans('ConfirmDeleteObject'), 'confirm_delete', '', 0, 1);
324 324
 	}
325 325
 	// Confirmation to delete line
326 326
 	if ($action == 'deleteline') {
327
-		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id . '&lineid=' . $lineid, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_deleteline', '', 0, 1);
327
+		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_deleteline', '', 0, 1);
328 328
 	}
329 329
 	// Clone confirmation
330 330
 	if ($action == 'clone') {
@@ -352,7 +352,7 @@  discard block
 block discarded – undo
352 352
 
353 353
 	// Object card
354 354
 	// ------------------------------------------------------------
355
-	$linkback = '<a href="' . dol_buildpath('/hrm/job_list.php', 1) . '?restore_lastsearch_values=1' . (!empty($socid) ? '&socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';
355
+	$linkback = '<a href="'.dol_buildpath('/hrm/job_list.php', 1).'?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>';
356 356
 
357 357
 	$morehtmlref = '<div class="refid">';
358 358
 	$morehtmlref .= $object->label;
@@ -372,10 +372,10 @@  discard block
 block discarded – undo
372 372
 	//unset($object->fields['fk_project']);				// Hide field already shown in banner
373 373
 	//unset($object->fields['fk_soc']);					// Hide field already shown in banner
374 374
 	$object->fields['label']['visible'] = 0; // Already in banner
375
-	include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_view.tpl.php';
375
+	include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php';
376 376
 
377 377
 	// Other attributes. Fields from hook formObjectOptions and Extrafields.
378
-	include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
378
+	include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
379 379
 
380 380
 	print '</table>';
381 381
 	print '</div>';
@@ -394,16 +394,16 @@  discard block
 block discarded – undo
394 394
 		// Show object lines
395 395
 		$result = $object->getLinesArray();
396 396
 
397
-		print '	<form name="addproduct" id="addproduct" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . (($action != 'editline') ? '' : '#line_' . GETPOSTINT('lineid')) . '" method="POST">
398
-		<input type="hidden" name="token" value="' . newToken() . '">
399
-		<input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline') . '">
397
+		print '	<form name="addproduct" id="addproduct" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.(($action != 'editline') ? '' : '#line_'.GETPOSTINT('lineid')).'" method="POST">
398
+		<input type="hidden" name="token" value="' . newToken().'">
399
+		<input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline').'">
400 400
 		<input type="hidden" name="mode" value="">
401 401
 		<input type="hidden" name="page_y" value="">
402
-		<input type="hidden" name="id" value="' . $object->id . '">
402
+		<input type="hidden" name="id" value="' . $object->id.'">
403 403
 		';
404 404
 
405 405
 		if (!empty($conf->use_javascript_ajax) && $object->status == 0) {
406
-			include DOL_DOCUMENT_ROOT . '/core/tpl/ajaxrow.tpl.php';
406
+			include DOL_DOCUMENT_ROOT.'/core/tpl/ajaxrow.tpl.php';
407 407
 		}
408 408
 
409 409
 		print '<div class="div-table-responsive-no-min">';
@@ -443,7 +443,7 @@  discard block
 block discarded – undo
443 443
 	// Buttons for actions
444 444
 
445 445
 	if ($action != 'presend' && $action != 'editline') {
446
-		print '<div class="tabsAction">' . "\n";
446
+		print '<div class="tabsAction">'."\n";
447 447
 		$parameters = array();
448 448
 		$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
449 449
 		if ($reshook < 0) {
@@ -453,17 +453,17 @@  discard block
 block discarded – undo
453 453
 		if (empty($reshook)) {
454 454
 			// Back to draft
455 455
 			if ($object->status == $object::STATUS_VALIDATED) {
456
-				print dolGetButtonAction($langs->trans('SetToDraft'), '', 'default', $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=confirm_setdraft&confirm=yes&token=' . newToken(), '', $permissiontoadd);
456
+				print dolGetButtonAction($langs->trans('SetToDraft'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=confirm_setdraft&confirm=yes&token='.newToken(), '', $permissiontoadd);
457 457
 			}
458 458
 
459
-			print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=edit&token=' . newToken(), '', $permissiontoadd);
459
+			print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit&token='.newToken(), '', $permissiontoadd);
460 460
 
461
-			print dolGetButtonAction($langs->trans('ToClone'), '', 'default', $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=clone&token=' . newToken(), '', $permissiontoadd);
461
+			print dolGetButtonAction($langs->trans('ToClone'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=clone&token='.newToken(), '', $permissiontoadd);
462 462
 
463 463
 			// Delete (need delete permission, or if draft, just need create/modify permission)
464
-			print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=delete&token=' . newToken(), '', $permissiontodelete);
464
+			print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=delete&token='.newToken(), '', $permissiontodelete);
465 465
 		}
466
-		print '</div>' . "\n";
466
+		print '</div>'."\n";
467 467
 	}
468 468
 
469 469
 
@@ -481,12 +481,12 @@  discard block
 block discarded – undo
481 481
 		// Documents
482 482
 		if ($includedocgeneration) {
483 483
 			$objref = dol_sanitizeFileName($object->ref);
484
-			$relativepath = $objref . '/' . $objref . '.pdf';
485
-			$filedir = $conf->hrm->dir_output . '/' . $object->element . '/' . $objref;
486
-			$urlsource = $_SERVER["PHP_SELF"] . "?id=" . $object->id;
484
+			$relativepath = $objref.'/'.$objref.'.pdf';
485
+			$filedir = $conf->hrm->dir_output.'/'.$object->element.'/'.$objref;
486
+			$urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id;
487 487
 			$genallowed = $user->hasRight('hrm', 'job', 'read'); // If you can read, you can build the PDF to read content
488 488
 			$delallowed = $user->hasRight('hrm', 'job', 'write'); // If you can create/edit, you can remove a file on card
489
-			print $formfile->showdocuments('hrm:Job', $object->element . '/' . $objref, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 28, 0, '', '', '', $langs->defaultlang);
489
+			print $formfile->showdocuments('hrm:Job', $object->element.'/'.$objref, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 28, 0, '', '', '', $langs->defaultlang);
490 490
 		}
491 491
 
492 492
 		// Show links to link elements
@@ -504,9 +504,9 @@  discard block
 block discarded – undo
504 504
 		$morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', DOL_URL_ROOT.'/hrm/job_agenda.php?id='.$object->id);
505 505
 
506 506
 		// List of actions on element
507
-		include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
507
+		include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
508 508
 		$formactions = new FormActions($db);
509
-		$somethingshown = $formactions->showactions($object, $object->element . '@' . $object->module, (is_object($object->thirdparty) ? $object->thirdparty->id : 0), 1, '', $MAXEVENT, '', $morehtmlcenter);
509
+		$somethingshown = $formactions->showactions($object, $object->element.'@'.$object->module, (is_object($object->thirdparty) ? $object->thirdparty->id : 0), 1, '', $MAXEVENT, '', $morehtmlcenter);
510 510
 
511 511
 		print '</div></div>';
512 512
 	}
@@ -515,9 +515,9 @@  discard block
 block discarded – undo
515 515
 	$modelmail = 'job';
516 516
 	$defaulttopic = 'InformationMessage';
517 517
 	$diroutput = $conf->hrm->dir_output;
518
-	$trackid = 'job' . $object->id;
518
+	$trackid = 'job'.$object->id;
519 519
 
520
-	include DOL_DOCUMENT_ROOT . '/core/tpl/card_presend.tpl.php';
520
+	include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php';
521 521
 }
522 522
 
523 523
 // End of page
Please login to merge, or discard this patch.
htdocs/hrm/skill_card.php 1 patch
Spacing   +98 added lines, -98 removed lines patch added patch discarded remove patch
@@ -30,11 +30,11 @@  discard block
 block discarded – undo
30 30
 
31 31
 // Load Dolibarr environment
32 32
 require '../main.inc.php';
33
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formcompany.class.php';
34
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formfile.class.php';
35
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php';
36
-require_once DOL_DOCUMENT_ROOT . '/hrm/class/skill.class.php';
37
-require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_skill.lib.php';
33
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
34
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
35
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
36
+require_once DOL_DOCUMENT_ROOT.'/hrm/class/skill.class.php';
37
+require_once DOL_DOCUMENT_ROOT.'/hrm/lib/hrm_skill.lib.php';
38 38
 
39 39
 
40 40
 /**
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
  */
47 47
 
48 48
 // Load translation files required by the page
49
-$langs->loadLangs(array('hrm', 'other', 'products'));  // why products?
49
+$langs->loadLangs(array('hrm', 'other', 'products')); // why products?
50 50
 
51 51
 // Get parameters
52 52
 $id = GETPOSTINT('id');
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'skillcard'; // To manage different context of search
58 58
 $backtopage = GETPOST('backtopage', 'alpha');
59 59
 $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha');
60
-$lineid   = GETPOSTINT('lineid');
60
+$lineid = GETPOSTINT('lineid');
61 61
 
62 62
 // Initialize a technical objects
63 63
 $object = new Skill($db);
@@ -75,8 +75,8 @@  discard block
 block discarded – undo
75 75
 $search_all = GETPOST("search_all", 'alpha');
76 76
 $search = array();
77 77
 foreach ($object->fields as $key => $val) {
78
-	if (GETPOST('search_' . $key, 'alpha')) {
79
-		$search[$key] = GETPOST('search_' . $key, 'alpha');
78
+	if (GETPOST('search_'.$key, 'alpha')) {
79
+		$search[$key] = GETPOST('search_'.$key, 'alpha');
80 80
 	}
81 81
 }
82 82
 
@@ -85,14 +85,14 @@  discard block
 block discarded – undo
85 85
 }
86 86
 
87 87
 // Load object
88
-include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'.
88
+include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'.
89 89
 
90 90
 // Permissions
91 91
 $permissiontoread   = $user->hasRight('hrm', 'all', 'read');
92 92
 $permissiontoadd    = $user->hasRight('hrm', 'all', 'write'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
93 93
 $permissiontodelete = $user->hasRight('hrm', 'all', 'delete');
94 94
 
95
-$upload_dir = $conf->hrm->multidir_output[isset($object->entity) ? $object->entity : 1] . '/skill';
95
+$upload_dir = $conf->hrm->multidir_output[isset($object->entity) ? $object->entity : 1].'/skill';
96 96
 
97 97
 // Security check (enable the most restrictive one)
98 98
 //if ($user->socid > 0) accessforbidden();
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
 			if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) {
130 130
 				$backtopage = $backurlforlist;
131 131
 			} else {
132
-				$backtopage = DOL_URL_ROOT.'/hrm/skill_card.php?id=' . ($id > 0 ? $id : '__ID__');
132
+				$backtopage = DOL_URL_ROOT.'/hrm/skill_card.php?id='.($id > 0 ? $id : '__ID__');
133 133
 			}
134 134
 		}
135 135
 	}
@@ -194,16 +194,16 @@  discard block
 block discarded – undo
194 194
 
195 195
 
196 196
 	// Actions when linking object each other
197
-	include DOL_DOCUMENT_ROOT . '/core/actions_dellink.inc.php';
197
+	include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php';
198 198
 
199 199
 	// Actions when printing a doc from card
200
-	include DOL_DOCUMENT_ROOT . '/core/actions_printing.inc.php';
200
+	include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
201 201
 
202 202
 	// Action to move up and down lines of object
203 203
 	//include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php';
204 204
 
205 205
 	// Action to build doc
206
-	include DOL_DOCUMENT_ROOT . '/core/actions_builddoc.inc.php';
206
+	include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
207 207
 
208 208
 	if ($action == 'set_thirdparty' && $permissiontoadd) {
209 209
 		$object->setValueFrom('fk_soc', GETPOSTINT('fk_soc'), '', null, 'date', '', $user, $triggermodname);
@@ -215,8 +215,8 @@  discard block
 block discarded – undo
215 215
 	// Actions to send emails
216 216
 	$triggersendname = 'HRM_SKILL_SENTBYMAIL';
217 217
 	$autocopy = 'MAIN_MAIL_AUTOCOPY_SKILL_TO';
218
-	$trackid = 'skill' . $object->id;
219
-	include DOL_DOCUMENT_ROOT . '/core/actions_sendmails.inc.php';
218
+	$trackid = 'skill'.$object->id;
219
+	include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
220 220
 
221 221
 	if ($action == 'confirm_clone' && $confirm != 'yes') {		// Test on permission not required
222 222
 		$action = '';
@@ -245,25 +245,25 @@  discard block
 block discarded – undo
245 245
 
246 246
 // Part to create
247 247
 if ($action == 'create') {
248
-	print load_fiche_titre($langs->trans("NewSkill"), '', 'object_' . $object->picto);
248
+	print load_fiche_titre($langs->trans("NewSkill"), '', 'object_'.$object->picto);
249 249
 
250
-	print '<form method="POST" action="' . $_SERVER["PHP_SELF"] . '">';
251
-	print '<input type="hidden" name="token" value="' . newToken() . '">';
250
+	print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
251
+	print '<input type="hidden" name="token" value="'.newToken().'">';
252 252
 	print '<input type="hidden" name="action" value="add">';
253
-	$backtopage .= (strpos($backtopage, '?') > 0 ? '&' : '?') ."objecttype=job";
253
+	$backtopage .= (strpos($backtopage, '?') > 0 ? '&' : '?')."objecttype=job";
254 254
 	if ($backtopage) {
255
-		print '<input type="hidden" name="backtopage" value="' . $backtopage . '">';
255
+		print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
256 256
 	}
257 257
 	if ($backtopageforcancel) {
258
-		print '<input type="hidden" name="backtopageforcancel" value="' . $backtopageforcancel . '">';
258
+		print '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">';
259 259
 	}
260 260
 
261 261
 	print dol_get_fiche_head(array(), '');
262 262
 
263
-	print '<table class="border centpercent tableforfieldcreate">' . "\n";
263
+	print '<table class="border centpercent tableforfieldcreate">'."\n";
264 264
 
265 265
 	// Common attributes
266
-	include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_add.tpl.php';
266
+	include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_add.tpl.php';
267 267
 
268 268
 	// Other attributes
269 269
 	include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php';
@@ -273,12 +273,12 @@  discard block
 block discarded – undo
273 273
 	//@todo je stop ici ... à continuer  (affichage des 5 skilled input pour create action
274 274
 	//print $object->showInputField($val, $key, $value, '', '['']', '', 0);
275 275
 
276
-	print '</table>' . "\n";
276
+	print '</table>'."\n";
277 277
 	print '<hr>';
278 278
 
279
-	print '<table class="border centpercent =">' . "\n";
279
+	print '<table class="border centpercent =">'."\n";
280 280
 	for ($i = 1; $i <= $MaxNumberSkill; $i++) {
281
-		print '<tr><td class="titlefieldcreate tdtop">'. $langs->trans('Description') . ' ' . $langs->trans('rank') . ' ' . $i . '</td>';
281
+		print '<tr><td class="titlefieldcreate tdtop">'.$langs->trans('Description').' '.$langs->trans('rank').' '.$i.'</td>';
282 282
 		print '<td class="valuefieldcreate"><textarea name="descriptionline[]" rows="5"  class="flat minwidth100" style="margin-top: 5px; width: 90%"></textarea></td>';
283 283
 	}
284 284
 	print '</table>';
@@ -286,9 +286,9 @@  discard block
 block discarded – undo
286 286
 	print dol_get_fiche_end();
287 287
 
288 288
 	print '<div class="center">';
289
-	print '<input type="submit" class="button" name="add" value="' . dol_escape_htmltag($langs->trans("Create")) . '">';
289
+	print '<input type="submit" class="button" name="add" value="'.dol_escape_htmltag($langs->trans("Create")).'">';
290 290
 	print '&nbsp; ';
291
-	print '<input type="' . ($backtopage ? "submit" : "button") . '" class="button button-cancel" name="cancel" value="' . dol_escape_htmltag($langs->trans("Cancel")) . '"' . ($backtopage ? '' : ' onclick="history.go(-1)"') . '>';
291
+	print '<input type="'.($backtopage ? "submit" : "button").'" class="button button-cancel" name="cancel" value="'.dol_escape_htmltag($langs->trans("Cancel")).'"'.($backtopage ? '' : ' onclick="history.go(-1)"').'>';
292 292
 	print '</div>';
293 293
 
294 294
 	print '</form>';
@@ -299,25 +299,25 @@  discard block
 block discarded – undo
299 299
 // Part to edit record
300 300
 // and skilldet edition
301 301
 if (($id || $ref) && $action == 'edit') {
302
-	print load_fiche_titre($langs->trans("Skill"), '', 'object_' . $object->picto);
302
+	print load_fiche_titre($langs->trans("Skill"), '', 'object_'.$object->picto);
303 303
 
304
-	print '<form method="POST" action="' . $_SERVER["PHP_SELF"] . '">';
305
-	print '<input type="hidden" name="token" value="' . newToken() . '">';
304
+	print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
305
+	print '<input type="hidden" name="token" value="'.newToken().'">';
306 306
 	print '<input type="hidden" name="action" value="update">';
307
-	print '<input type="hidden" name="id" value="' . $object->id . '">';
307
+	print '<input type="hidden" name="id" value="'.$object->id.'">';
308 308
 	if ($backtopage) {
309
-		print '<input type="hidden" name="backtopage" value="' . $backtopage . '">';
309
+		print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
310 310
 	}
311 311
 	if ($backtopageforcancel) {
312
-		print '<input type="hidden" name="backtopageforcancel" value="' . $backtopageforcancel . '">';
312
+		print '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">';
313 313
 	}
314 314
 
315 315
 	print dol_get_fiche_head();
316 316
 
317
-	print '<table class="border centpercent tableforfieldedit">' . "\n";
317
+	print '<table class="border centpercent tableforfieldedit">'."\n";
318 318
 
319 319
 	// Common attributes
320
-	include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_edit.tpl.php';
320
+	include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_edit.tpl.php';
321 321
 
322 322
 	// Other attributes
323 323
 	include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_edit.tpl.php';
@@ -341,7 +341,7 @@  discard block
 block discarded – undo
341 341
 				continue;
342 342
 			}
343 343
 
344
-			print '<table class="border centpercent =">' . "\n";
344
+			print '<table class="border centpercent =">'."\n";
345 345
 			$sk->fields = dol_sort_array($sk->fields, 'position');
346 346
 			foreach ($sk->fields as $key => $val) {
347 347
 				if (abs($val['visible']) != 1 && abs($val['visible']) != 3 && abs($val['visible']) != 4) {
@@ -352,7 +352,7 @@  discard block
 block discarded – undo
352 352
 					continue; // We don't want this field
353 353
 				}
354 354
 
355
-				print '<tr class="field_' . $key . '"><td';
355
+				print '<tr class="field_'.$key.'"><td';
356 356
 				print ' class="titlefieldcreate';
357 357
 				if (isset($val['notnull']) && $val['notnull'] > 0) {
358 358
 					print ' fieldrequired';
@@ -401,7 +401,7 @@  discard block
 block discarded – undo
401 401
 					print $sk->showOutputField($val, $key, $value, '', '', '', 0);
402 402
 				} else {
403 403
 					/** @var Skilldet $sk */
404
-					print $sk->showInputField($val, $key, $value, "", "line[" . $sk->id . "]", "", "");
404
+					print $sk->showInputField($val, $key, $value, "", "line[".$sk->id."]", "", "");
405 405
 				}
406 406
 				print '</td>';
407 407
 				print '</tr>';
@@ -413,8 +413,8 @@  discard block
 block discarded – undo
413 413
 
414 414
 	print dol_get_fiche_end();
415 415
 
416
-	print '<div class="center"><input type="submit" class="button button-save" name="save" value="' . $langs->trans("Save") . '">';
417
-	print ' &nbsp; <input type="submit" class="button button-cancel" name="cancel" value="' . $langs->trans("Cancel") . '">';
416
+	print '<div class="center"><input type="submit" class="button button-save" name="save" value="'.$langs->trans("Save").'">';
417
+	print ' &nbsp; <input type="submit" class="button button-cancel" name="cancel" value="'.$langs->trans("Cancel").'">';
418 418
 	print '</div>';
419 419
 
420 420
 	print '</form>';
@@ -432,11 +432,11 @@  discard block
 block discarded – undo
432 432
 
433 433
 	// Confirmation to delete
434 434
 	if ($action == 'delete') {
435
-		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('DeleteSkill'), $langs->trans('ConfirmDeleteObject'), 'confirm_delete', '', 0, 1);
435
+		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteSkill'), $langs->trans('ConfirmDeleteObject'), 'confirm_delete', '', 0, 1);
436 436
 	}
437 437
 	// Confirmation to delete line
438 438
 	if ($action == 'deleteline') {
439
-		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id . '&lineid=' . $lineid, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_deleteline', '', 0, 1);
439
+		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_deleteline', '', 0, 1);
440 440
 	}
441 441
 	// Confirmation clone
442 442
 	if ($action === 'clone') {
@@ -461,7 +461,7 @@  discard block
 block discarded – undo
461 461
 
462 462
 	// Object card
463 463
 	// ------------------------------------------------------------
464
-	$linkback = '<a href="' . DOL_URL_ROOT.'/hrm/skill_list.php?restore_lastsearch_values=1' . (!empty($socid) ? '&socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';
464
+	$linkback = '<a href="'.DOL_URL_ROOT.'/hrm/skill_list.php?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>';
465 465
 
466 466
 
467 467
 	$morehtmlref = '<div class="refid">';
@@ -473,10 +473,10 @@  discard block
 block discarded – undo
473 473
 	print '<div class="fichecenter">';
474 474
 	print '<div class="fichehalfleft">';
475 475
 	print '<div class="underbanner clearboth"></div>';
476
-	print '<table class="border centpercent tableforfield">' . "\n";
476
+	print '<table class="border centpercent tableforfield">'."\n";
477 477
 
478 478
 	$object->fields['label']['visible'] = 0; // Already in banner
479
-	include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_view.tpl.php';
479
+	include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php';
480 480
 
481 481
 	// Other attributes. Fields from hook formObjectOptions and Extrafields.
482 482
 	include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
@@ -496,7 +496,7 @@  discard block
 block discarded – undo
496 496
 	// Buttons for actions
497 497
 
498 498
 	if ($action != 'presend' && $action != 'editline') {
499
-		print '<div class="tabsAction">' . "\n";
499
+		print '<div class="tabsAction">'."\n";
500 500
 		$parameters = array();
501 501
 		$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
502 502
 		if ($reshook < 0) {
@@ -506,19 +506,19 @@  discard block
 block discarded – undo
506 506
 		if (empty($reshook)) {
507 507
 			// Back to draft
508 508
 			if ($object->status == $object::STATUS_VALIDATED) {
509
-				print dolGetButtonAction($langs->trans('SetToDraft'), '', 'default', $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=confirm_setdraft&confirm=yes&token=' . newToken(), '', $permissiontoadd);
509
+				print dolGetButtonAction($langs->trans('SetToDraft'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=confirm_setdraft&confirm=yes&token='.newToken(), '', $permissiontoadd);
510 510
 			}
511 511
 
512
-			print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=edit&token=' . newToken(), '', $permissiontoadd);
512
+			print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit&token='.newToken(), '', $permissiontoadd);
513 513
 
514 514
 			// Clone
515 515
 			if ($permissiontoadd) {
516 516
 				print dolGetButtonAction('', $langs->trans('ToClone'), 'default', $_SERVER["PHP_SELF"].'?action=clone&token='.newToken().'&id='.$object->id, '');
517 517
 			}
518 518
 			// Delete (need delete permission, or if draft, just need create/modify permission)
519
-			print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=delete&token=' . newToken(), '', $permissiontodelete);
519
+			print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=delete&token='.newToken(), '', $permissiontodelete);
520 520
 		}
521
-		print '</div>' . "\n";
521
+		print '</div>'."\n";
522 522
 	}
523 523
 }
524 524
 
@@ -526,12 +526,12 @@  discard block
 block discarded – undo
526 526
 //*---------------------------------------------------------------------------
527 527
 
528 528
 if ($action != "create" && $action != "edit") {
529
-	require_once DOL_DOCUMENT_ROOT . '/core/class/html.formcompany.class.php';
530
-	require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
531
-	require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php';
529
+	require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
530
+	require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
531
+	require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
532 532
 
533 533
 	// load hrm libraries
534
-	require_once __DIR__ . '/class/skilldet.class.php';
534
+	require_once __DIR__.'/class/skilldet.class.php';
535 535
 
536 536
 	// for other modules
537 537
 	//dol_include_once('/othermodule/class/otherobject.class.php');
@@ -568,8 +568,8 @@  discard block
 block discarded – undo
568 568
 
569 569
 	// Default sort order (if not yet defined by previous GETPOST)
570 570
 	if (!$sortfield) {
571
-		reset($objectline->fields);                    // Reset is required to avoid key() to return null.
572
-		$sortfield = "t." . key($objectline->fields); // Set here default search field. By default 1st field in definition.
571
+		reset($objectline->fields); // Reset is required to avoid key() to return null.
572
+		$sortfield = "t.".key($objectline->fields); // Set here default search field. By default 1st field in definition.
573 573
 	}
574 574
 	if (!$sortorder) {
575 575
 		$sortorder = "ASC";
@@ -579,12 +579,12 @@  discard block
 block discarded – undo
579 579
 	$search_all = GETPOST('search_all', 'alphanohtml');
580 580
 	$search = array();
581 581
 	foreach ($objectline->fields as $key => $val) {
582
-		if (GETPOST('search_' . $key, 'alpha') !== '') {
583
-			$search[$key] = GETPOST('search_' . $key, 'alpha');
582
+		if (GETPOST('search_'.$key, 'alpha') !== '') {
583
+			$search[$key] = GETPOST('search_'.$key, 'alpha');
584 584
 		}
585 585
 		if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) {
586
-			$search[$key . '_dtstart'] = dol_mktime(0, 0, 0, GETPOSTINT('search_' . $key . '_dtstartmonth'), GETPOSTINT('search_' . $key . '_dtstartday'), GETPOSTINT('search_' . $key . '_dtstartyear'));
587
-			$search[$key . '_dtend'] = dol_mktime(23, 59, 59, GETPOSTINT('search_' . $key . '_dtendmonth'), GETPOSTINT('search_' . $key . '_dtendday'), GETPOSTINT('search_' . $key . '_dtendyear'));
586
+			$search[$key.'_dtstart'] = dol_mktime(0, 0, 0, GETPOSTINT('search_'.$key.'_dtstartmonth'), GETPOSTINT('search_'.$key.'_dtstartday'), GETPOSTINT('search_'.$key.'_dtstartyear'));
587
+			$search[$key.'_dtend'] = dol_mktime(23, 59, 59, GETPOSTINT('search_'.$key.'_dtendmonth'), GETPOSTINT('search_'.$key.'_dtendday'), GETPOSTINT('search_'.$key.'_dtendyear'));
588 588
 		}
589 589
 	}
590 590
 
@@ -592,7 +592,7 @@  discard block
 block discarded – undo
592 592
 	$fieldstosearchall = array();
593 593
 	foreach ($objectline->fields as $key => $val) {
594 594
 		if (!empty($val['searchall'])) {
595
-			$fieldstosearchall['t.' . $key] = $val['label'];
595
+			$fieldstosearchall['t.'.$key] = $val['label'];
596 596
 		}
597 597
 	}
598 598
 
@@ -602,7 +602,7 @@  discard block
 block discarded – undo
602 602
 		// If $val['visible']==0, then we never show the field
603 603
 		if (!empty($val['visible'])) {
604 604
 			$visible = (int) dol_eval((string) $val['visible'], 1, 1, '1');
605
-			$arrayfields['t.' . $key] = array(
605
+			$arrayfields['t.'.$key] = array(
606 606
 				'label' => $val['label'],
607 607
 				'checked' => (($visible < 0) ? 0 : 1),
608 608
 				'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)),
@@ -632,9 +632,9 @@  discard block
 block discarded – undo
632 632
 	// --------------------------------------------------------------------
633 633
 	$sql = 'SELECT ';
634 634
 	$sql .= $objectline->getFieldList('t');
635
-	$sql .= " FROM " . MAIN_DB_PREFIX . $objectline->table_element . " as t";
635
+	$sql .= " FROM ".MAIN_DB_PREFIX.$objectline->table_element." as t";
636 636
 	if ($objectline->ismultientitymanaged == 1) {
637
-		$sql .= " WHERE t.entity IN (" . getEntity($objectline->element) . ")";
637
+		$sql .= " WHERE t.entity IN (".getEntity($objectline->element).")";
638 638
 	} else {
639 639
 		$sql .= " WHERE 1 = 1 ";
640 640
 	}
@@ -645,41 +645,41 @@  discard block
 block discarded – undo
645 645
 	$nbtotalofrecords = $db->num_rows($resql);
646 646
 	$num = $db->num_rows($resql);
647 647
 
648
-	print '<form method="POST" id="searchFormList" action="' . $_SERVER["PHP_SELF"] . '">' . "\n";
648
+	print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">'."\n";
649 649
 	if ($optioncss != '') {
650
-		print '<input type="hidden" name="optioncss" value="' . $optioncss . '">';
650
+		print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
651 651
 	}
652
-	print '<input type="hidden" name="token" value="' . newToken() . '">';
652
+	print '<input type="hidden" name="token" value="'.newToken().'">';
653 653
 	print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
654 654
 	print '<input type="hidden" name="action" value="list">';
655
-	print '<input type="hidden" name="sortfield" value="' . $sortfield . '">';
656
-	print '<input type="hidden" name="sortorder" value="' . $sortorder . '">';
657
-	print '<input type="hidden" name="page" value="' . $page . '">';
658
-	print '<input type="hidden" name="contextpage" value="' . $contextpage . '">';
655
+	print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
656
+	print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
657
+	print '<input type="hidden" name="page" value="'.$page.'">';
658
+	print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
659 659
 	if (!empty($id)) {
660
-		print '<input type="hidden" name="id" value="' . $id . '">';
660
+		print '<input type="hidden" name="id" value="'.$id.'">';
661 661
 	}
662 662
 
663
-	$param_fk = "&fk_skill=" . $id . "&fk_user_creat=" . (!empty($user->rowid) ? $user->rowid : 0);
664
-	$backtopage = dol_buildpath('/hrm/skill_card.php', 1) . '?id=' . $id;
663
+	$param_fk = "&fk_skill=".$id."&fk_user_creat=".(!empty($user->rowid) ? $user->rowid : 0);
664
+	$backtopage = dol_buildpath('/hrm/skill_card.php', 1).'?id='.$id;
665 665
 	$param = "";
666 666
 	$massactionbutton = "";
667 667
 	//$newcardbutton = dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', dol_buildpath('/hrm/skilldet_card.php', 1) . '?action=create&backtopage=' . urlencode($_SERVER['PHP_SELF']) . $param_fk . '&backtopage=' . $backtopage, '', $permissiontoadd);
668 668
 
669
-	print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'object_' . $object->picto, 0, '', '', 0, 0, 0, 1);
669
+	print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'object_'.$object->picto, 0, '', '', 0, 0, 0, 1);
670 670
 
671 671
 	// Add code for pre mass action (confirmation or email presend form)
672 672
 	$topicmail = "SendSkilldetRef";
673 673
 	$modelmail = "skilldet";
674 674
 	$objecttmp = new Skilldet($db);
675
-	$trackid = 'xxxx' . $object->id;
675
+	$trackid = 'xxxx'.$object->id;
676 676
 	//include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php';
677 677
 
678 678
 	if ($search_all) {
679 679
 		foreach ($fieldstosearchall as $key => $val) {
680 680
 			$fieldstosearchall[$key] = $langs->trans($val);
681 681
 		}
682
-		print '<div class="divsearchfieldfilter">' . $langs->trans("FilterOnInto", $search_all) . implode(', ', $fieldstosearchall) . '</div>';
682
+		print '<div class="divsearchfieldfilter">'.$langs->trans("FilterOnInto", $search_all).implode(', ', $fieldstosearchall).'</div>';
683 683
 	}
684 684
 
685 685
 	$moreforfilter = '';
@@ -706,7 +706,7 @@  discard block
 block discarded – undo
706 706
 	//  $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
707 707
 
708 708
 	print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you don't need reserved height for your table
709
-	print '<table class="tagtable nobottomiftotal liste' . ($moreforfilter ? " listwithfilterbefore" : "") . '">' . "\n";
709
+	print '<table class="tagtable nobottomiftotal liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
710 710
 
711 711
 
712 712
 	// Fields title label
@@ -723,13 +723,13 @@  discard block
 block discarded – undo
723 723
 		//      } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) {
724 724
 		//          $cssforfield .= ($cssforfield ? ' ' : '') . 'right';
725 725
 		//      }
726
-		if (!empty($arrayfields['t.' . $key]['checked'])) {
727
-			print getTitleFieldOfList($arrayfields['t.' . $key]['label'], 0, $_SERVER['PHP_SELF'], 't.' . $key, '', $param, (!empty($cssforfield) ? 'class="' . $cssforfield . '"' : ''), $sortfield, $sortorder, (!empty($cssforfield) ? $cssforfield . ' ' : '')) . "\n";
726
+		if (!empty($arrayfields['t.'.$key]['checked'])) {
727
+			print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, (!empty($cssforfield) ? 'class="'.$cssforfield.'"' : ''), $sortfield, $sortorder, (!empty($cssforfield) ? $cssforfield.' ' : ''))."\n";
728 728
 		}
729 729
 	}
730 730
 	//print '<td></td>';
731 731
 	print '<td></td>';
732
-	print '</tr>' . "\n";
732
+	print '</tr>'."\n";
733 733
 
734 734
 
735 735
 	// Display all ranks of skill
@@ -772,14 +772,14 @@  discard block
 block discarded – undo
772 772
 			//          }
773 773
 			//if (in_array($key, array('fk_soc', 'fk_user', 'fk_warehouse'))) $cssforfield = 'tdoverflowmax100';
774 774
 
775
-			if (!empty($arrayfields['t.' . $key]['checked'])) {
776
-				print '<td' . (empty($cssforfield) ? '' : ' class="' . $cssforfield . '"') . '>';
775
+			if (!empty($arrayfields['t.'.$key]['checked'])) {
776
+				print '<td'.(empty($cssforfield) ? '' : ' class="'.$cssforfield.'"').'>';
777 777
 				if ($key == 'status') {
778 778
 					print $objectline->getLibStatut(5);
779 779
 				} elseif ($key == 'rowid') {
780 780
 					print $objectline->showOutputField($val, $key, (string) $objectline->id, '');
781 781
 					// ajout pencil
782
-					print '<a class="timeline-btn" href="' . DOL_MAIN_URL_ROOT . '/comm/action/skilldet_card.php?action=edit&id=' . $objectline->id . '"><i class="fa fa-pencil" title="' . $langs->trans("Modify") . '" ></i></a>';
782
+					print '<a class="timeline-btn" href="'.DOL_MAIN_URL_ROOT.'/comm/action/skilldet_card.php?action=edit&id='.$objectline->id.'"><i class="fa fa-pencil" title="'.$langs->trans("Modify").'" ></i></a>';
783 783
 				} else {
784 784
 					print $objectline->showOutputField($val, $key, $objectline->$key, '');
785 785
 				}
@@ -791,15 +791,15 @@  discard block
 block discarded – undo
791 791
 				}
792 792
 				if (!empty($val['isameasure']) && $val['isameasure'] == 1) {
793 793
 					if (!$i) {
794
-						$totalarray['pos'][$totalarray['nbfield']] = 't.' . $key;
794
+						$totalarray['pos'][$totalarray['nbfield']] = 't.'.$key;
795 795
 					}
796 796
 					if (!isset($totalarray['val'])) {
797 797
 						$totalarray['val'] = array();
798 798
 					}
799
-					if (!isset($totalarray['val']['t.' . $key])) {
800
-						$totalarray['val']['t.' . $key] = 0;
799
+					if (!isset($totalarray['val']['t.'.$key])) {
800
+						$totalarray['val']['t.'.$key] = 0;
801 801
 					}
802
-					$totalarray['val']['t.' . $key] += $objectline->$key;
802
+					$totalarray['val']['t.'.$key] += $objectline->$key;
803 803
 				}
804 804
 			}
805 805
 		}
@@ -832,7 +832,7 @@  discard block
 block discarded – undo
832 832
 			$totalarray['nbfield']++;
833 833
 		}
834 834
 
835
-		print '</tr>' . "\n";
835
+		print '</tr>'."\n";
836 836
 
837 837
 		$i++;
838 838
 	}
@@ -847,7 +847,7 @@  discard block
 block discarded – undo
847 847
 				$colspan++;
848 848
 			}
849 849
 		}
850
-		print '<tr><td colspan="' . $colspan . '"><span class="opacitymedium">' . $langs->trans("NoRecordFound") . '</span></td></tr>';
850
+		print '<tr><td colspan="'.$colspan.'"><span class="opacitymedium">'.$langs->trans("NoRecordFound").'</span></td></tr>';
851 851
 	}
852 852
 
853 853
 	if (!empty($resql)) {
@@ -858,10 +858,10 @@  discard block
 block discarded – undo
858 858
 	$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $objectline); // Note that $action and $objectline may have been modified by hook
859 859
 	print $hookmanager->resPrint;
860 860
 
861
-	print '</table>' . "\n";
862
-	print '</div>' . "\n";
861
+	print '</table>'."\n";
862
+	print '</div>'."\n";
863 863
 
864
-	print '</form>' . "\n";
864
+	print '</form>'."\n";
865 865
 
866 866
 	//  if (in_array('builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords === '' || $nbtotalofrecords)) {
867 867
 	//      $hidegeneratedfilelistifempty = 1;
@@ -900,9 +900,9 @@  discard block
 block discarded – undo
900 900
 	$morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', DOL_URL_ROOT.'/hrm/skill_agenda.php?id='.$object->id);
901 901
 
902 902
 	// List of actions on element
903
-	include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
903
+	include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
904 904
 	$formactions = new FormActions($db);
905
-	$somethingshown = $formactions->showactions($object, $object->element . '@' . $object->module, (is_object($object->thirdparty) ? $object->thirdparty->id : 0), 1, '', $MAXEVENT, '', $morehtmlcenter);
905
+	$somethingshown = $formactions->showactions($object, $object->element.'@'.$object->module, (is_object($object->thirdparty) ? $object->thirdparty->id : 0), 1, '', $MAXEVENT, '', $morehtmlcenter);
906 906
 
907 907
 	print '</div></div>';
908 908
 }
Please login to merge, or discard this patch.
htdocs/core/class/cregion.class.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -112,11 +112,11 @@
 block discarded – undo
112 112
 		$sql .= "active";
113 113
 		$sql .= ") VALUES (";
114 114
 		$sql .= (int) $this->id;
115
-		$sql .= ", " . (!isset($this->code_region) ? 'NULL' : (int) $this->code_region);
116
-		$sql .= ", " . (int) $this->fk_pays;
117
-		$sql .= ", " . (!isset($this->name) ? 'NULL' : "'".$this->db->escape($this->name) . "'");
118
-		$sql .= ", " . (!isset($this->cheflieu) ? 'NULL' : "'".$this->db->escape($this->cheflieu) . "'");
119
-		$sql .= ", " . (int) $this->active;
115
+		$sql .= ", ".(!isset($this->code_region) ? 'NULL' : (int) $this->code_region);
116
+		$sql .= ", ".(int) $this->fk_pays;
117
+		$sql .= ", ".(!isset($this->name) ? 'NULL' : "'".$this->db->escape($this->name)."'");
118
+		$sql .= ", ".(!isset($this->cheflieu) ? 'NULL' : "'".$this->db->escape($this->cheflieu)."'");
119
+		$sql .= ", ".(int) $this->active;
120 120
 		$sql .= ")";
121 121
 
122 122
 		$this->db->begin();
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 ($action == 'addline' && !GETPOST('submitforalllines', 'alpha') && !GETPOST('submitforallmargins', 'alpha') && !GETPOST('markforalllines', 'alpha') && $usercancreate) {
1215 1215
 		// Add line
@@ -1251,8 +1251,8 @@  discard block
 block discarded – undo
1251 1251
 
1252 1252
 		$tva_tx = GETPOST('tva_tx', 'alpha');
1253 1253
 
1254
-		$qty = price2num(GETPOST('qty' . $predef, 'alpha'), 'MS', 2);
1255
-		$remise_percent = (GETPOSTISSET('remise_percent' . $predef) ? price2num(GETPOST('remise_percent' . $predef, 'alpha'), '', 2) : 0);
1254
+		$qty = price2num(GETPOST('qty'.$predef, 'alpha'), 'MS', 2);
1255
+		$remise_percent = (GETPOSTISSET('remise_percent'.$predef) ? price2num(GETPOST('remise_percent'.$predef, 'alpha'), '', 2) : 0);
1256 1256
 		if (empty($remise_percent)) {
1257 1257
 			$remise_percent = 0;
1258 1258
 		}
@@ -1264,7 +1264,7 @@  discard block
 block discarded – undo
1264 1264
 		if (is_array($extralabelsline)) {
1265 1265
 			// Get extra fields
1266 1266
 			foreach ($extralabelsline as $key => $value) {
1267
-				unset($_POST["options_" . $key]);
1267
+				unset($_POST["options_".$key]);
1268 1268
 			}
1269 1269
 		}
1270 1270
 
@@ -1336,7 +1336,7 @@  discard block
 block discarded – undo
1336 1336
 
1337 1337
 				if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES')) {
1338 1338
 					// If price per customer
1339
-					require_once DOL_DOCUMENT_ROOT . '/product/class/productcustomerprice.class.php';
1339
+					require_once DOL_DOCUMENT_ROOT.'/product/class/productcustomerprice.class.php';
1340 1340
 					$prodcustprice = new ProductCustomerPrice($db);
1341 1341
 					$filter = array('t.fk_product' => (string) $prod->id, 't.fk_soc' => (string) $object->thirdparty->id);
1342 1342
 
@@ -1400,7 +1400,7 @@  discard block
 block discarded – undo
1400 1400
 					}
1401 1401
 				} elseif (getDolGlobalString('PRODUIT_CUSTOMER_PRICES')) {
1402 1402
 					// If price per customer
1403
-					require_once DOL_DOCUMENT_ROOT . '/product/class/productcustomerprice.class.php';
1403
+					require_once DOL_DOCUMENT_ROOT.'/product/class/productcustomerprice.class.php';
1404 1404
 
1405 1405
 					$prodcustprice = new ProductCustomerPrice($db);
1406 1406
 
@@ -1547,23 +1547,23 @@  discard block
 block discarded – undo
1547 1547
 							$outputlangs->load('products');
1548 1548
 						}
1549 1549
 						if (!empty($prod->customcode)) {
1550
-							$tmptxt .= $outputlangs->transnoentitiesnoconv("CustomsCode") . ': ' . $prod->customcode;
1550
+							$tmptxt .= $outputlangs->transnoentitiesnoconv("CustomsCode").': '.$prod->customcode;
1551 1551
 						}
1552 1552
 						if (!empty($prod->customcode) && !empty($prod->country_code)) {
1553 1553
 							$tmptxt .= ' - ';
1554 1554
 						}
1555 1555
 						if (!empty($prod->country_code)) {
1556
-							$tmptxt .= $outputlangs->transnoentitiesnoconv("CountryOrigin") . ': ' . getCountry($prod->country_code, '', $db, $outputlangs, 0);
1556
+							$tmptxt .= $outputlangs->transnoentitiesnoconv("CountryOrigin").': '.getCountry($prod->country_code, '', $db, $outputlangs, 0);
1557 1557
 						}
1558 1558
 					} else {
1559 1559
 						if (!empty($prod->customcode)) {
1560
-							$tmptxt .= $langs->transnoentitiesnoconv("CustomsCode") . ': ' . $prod->customcode;
1560
+							$tmptxt .= $langs->transnoentitiesnoconv("CustomsCode").': '.$prod->customcode;
1561 1561
 						}
1562 1562
 						if (!empty($prod->customcode) && !empty($prod->country_code)) {
1563 1563
 							$tmptxt .= ' - ';
1564 1564
 						}
1565 1565
 						if (!empty($prod->country_code)) {
1566
-							$tmptxt .= $langs->transnoentitiesnoconv("CountryOrigin") . ': ' . getCountry($prod->country_code, '', $db, $langs, 0);
1566
+							$tmptxt .= $langs->transnoentitiesnoconv("CountryOrigin").': '.getCountry($prod->country_code, '', $db, $langs, 0);
1567 1567
 						}
1568 1568
 					}
1569 1569
 					$tmptxt .= ')';
@@ -1602,11 +1602,11 @@  discard block
 block discarded – undo
1602 1602
 			$localtax2_tx = get_localtax($tva_tx, 2, $object->thirdparty, $mysoc, $tva_npr);
1603 1603
 
1604 1604
 			// Margin
1605
-			$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
1606
-			$buyingprice = price2num((GETPOST('buying_price' . $predef) != '' ? GETPOST('buying_price' . $predef) : ''), '', 2); // If buying_price is '0', we must keep this value
1605
+			$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
1606
+			$buyingprice = price2num((GETPOST('buying_price'.$predef) != '' ? GETPOST('buying_price'.$predef) : ''), '', 2); // If buying_price is '0', we must keep this value
1607 1607
 
1608
-			$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'));
1609
-			$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'));
1608
+			$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'));
1609
+			$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'));
1610 1610
 
1611 1611
 			// Prepare a price equivalent for minimum price check
1612 1612
 			$pu_equivalent = $pu_ht;
@@ -1737,7 +1737,7 @@  discard block
 block discarded – undo
1737 1737
 				if ($prod->price_min > $line->subprice) {
1738 1738
 					$price_subprice = price($line->subprice, 0, $outlangs, 1, -1, -1, 'auto');
1739 1739
 					$price_price_min = price($prod->price_min, 0, $outlangs, 1, -1, -1, 'auto');
1740
-					setEventMessages($prod->ref . ' - ' . $prod->label . ' (' . $price_subprice . ' < ' . $price_price_min . ' ' . strtolower($langs->trans("MinPrice")) . ')' . "\n", null, 'warnings');
1740
+					setEventMessages($prod->ref.' - '.$prod->label.' ('.$price_subprice.' < '.$price_price_min.' '.strtolower($langs->trans("MinPrice")).')'."\n", null, 'warnings');
1741 1741
 				} else {
1742 1742
 					setEventMessages($prod->error, $prod->errors, 'errors');
1743 1743
 				}
@@ -1875,7 +1875,7 @@  discard block
 block discarded – undo
1875 1875
 		$pu_ttc = price2num(GETPOST('price_ttc'), '', 2);
1876 1876
 
1877 1877
 		// Add buying price
1878
-		$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
1878
+		$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
1879 1879
 		$buyingprice = price2num((GETPOST('buying_price') != '' ? GETPOST('buying_price') : ''), '', 2); // If buying_price is '0', we must keep this value
1880 1880
 
1881 1881
 		$pu_ht_devise = price2num(GETPOST('multicurrency_subprice'), '', 2);
@@ -1922,7 +1922,7 @@  discard block
 block discarded – undo
1922 1922
 		if (is_array($extralabelsline)) {
1923 1923
 			// Get extra fields
1924 1924
 			foreach ($extralabelsline as $key => $value) {
1925
-				unset($_POST["options_" . $key]);
1925
+				unset($_POST["options_".$key]);
1926 1926
 			}
1927 1927
 		}
1928 1928
 
@@ -2054,7 +2054,7 @@  discard block
 block discarded – undo
2054 2054
 			}
2055 2055
 		}
2056 2056
 	} elseif ($action == 'updateline' && $usercancreate && GETPOST('cancel', 'alpha')) {
2057
-		header('Location: ' . $_SERVER['PHP_SELF'] . '?id=' . $object->id); //  To re-display card in edit mode
2057
+		header('Location: '.$_SERVER['PHP_SELF'].'?id='.$object->id); //  To re-display card in edit mode
2058 2058
 		exit();
2059 2059
 	} elseif ($action == 'classin' && $usercancreate) {
2060 2060
 		// Set project
@@ -2068,8 +2068,8 @@  discard block
 block discarded – undo
2068 2068
 	} elseif ($action == 'setconditions' && $usercancreate) {
2069 2069
 		// Terms of payment
2070 2070
 		$sql = "SELECT code ";
2071
-		$sql .= "FROM " . $db->prefix() . "c_payment_term";
2072
-		$sql .= " WHERE rowid = " . ((int) GETPOST('cond_reglement_id', 'int'));
2071
+		$sql .= "FROM ".$db->prefix()."c_payment_term";
2072
+		$sql .= " WHERE rowid = ".((int) GETPOST('cond_reglement_id', 'int'));
2073 2073
 		$result = $db->query($sql);
2074 2074
 		if ($result) {
2075 2075
 			$obj = $db->fetch_object($result);
@@ -2134,7 +2134,7 @@  discard block
 block discarded – undo
2134 2134
 			}
2135 2135
 
2136 2136
 			if ($result >= 0) {
2137
-				header("Location: " . $_SERVER['PHP_SELF'] . "?id=" . $object->id);
2137
+				header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
2138 2138
 				exit();
2139 2139
 			} else {
2140 2140
 				if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') {
@@ -2157,7 +2157,7 @@  discard block
 block discarded – undo
2157 2157
 			$result = $object->delete_contact($lineid);
2158 2158
 
2159 2159
 			if ($result >= 0) {
2160
-				header("Location: " . $_SERVER['PHP_SELF'] . "?id=" . $object->id);
2160
+				header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
2161 2161
 				exit();
2162 2162
 			} else {
2163 2163
 				dol_print_error($db);
@@ -2168,7 +2168,7 @@  discard block
 block discarded – undo
2168 2168
 	// Actions to build doc
2169 2169
 	$upload_dir = !empty($conf->propal->multidir_output[$object->entity ?? $conf->entity]) ? $conf->propal->multidir_output[$object->entity ?? $conf->entity] : $conf->propal->dir_output;
2170 2170
 	$permissiontoadd = $usercancreate;
2171
-	include DOL_DOCUMENT_ROOT . '/core/actions_builddoc.inc.php';
2171
+	include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
2172 2172
 }
2173 2173
 
2174 2174
 
@@ -2185,7 +2185,7 @@  discard block
 block discarded – undo
2185 2185
 	$formproject = new FormProjets($db);
2186 2186
 }
2187 2187
 
2188
-$title = $object->ref . " - " . $langs->trans('Card');
2188
+$title = $object->ref." - ".$langs->trans('Card');
2189 2189
 if ($action == 'create') {
2190 2190
 	$title = $langs->trans("NewPropal");
2191 2191
 }
@@ -2251,11 +2251,11 @@  discard block
 block discarded – undo
2251 2251
 				$element = $subelement = 'expedition';
2252 2252
 			}
2253 2253
 
2254
-			dol_include_once('/' . $element . '/class/' . $subelement . '.class.php');
2254
+			dol_include_once('/'.$element.'/class/'.$subelement.'.class.php');
2255 2255
 
2256 2256
 			$classname = ucfirst($subelement);
2257 2257
 			$objectsrc = new $classname($db);
2258
-			'@phan-var-force Commande|Propal|Contrat|Expedition $objectsrc';  // Can be other class, but CommonObject is too generic
2258
+			'@phan-var-force Commande|Propal|Contrat|Expedition $objectsrc'; // Can be other class, but CommonObject is too generic
2259 2259
 			/** @var Commande|Propal|Contrat|Expedition $objectsrc */
2260 2260
 			$objectsrc->fetch($originid);
2261 2261
 			if (empty($objectsrc->lines) && method_exists($objectsrc, 'fetch_lines')) {
@@ -2331,19 +2331,19 @@  discard block
 block discarded – undo
2331 2331
 		}
2332 2332
 	}
2333 2333
 
2334
-	print '<form name="addprop" action="' . $_SERVER["PHP_SELF"] . '" method="POST">';
2335
-	print '<input type="hidden" name="token" value="' . newToken() . '">';
2334
+	print '<form name="addprop" action="'.$_SERVER["PHP_SELF"].'" method="POST">';
2335
+	print '<input type="hidden" name="token" value="'.newToken().'">';
2336 2336
 	print '<input type="hidden" name="action" value="add">';
2337
-	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
2338
-	print '<input type="hidden" name="backtopage" value="' . $backtopage . '">';
2337
+	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
2338
+	print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
2339 2339
 	if ($origin != 'project' && $originid) {
2340
-		print '<input type="hidden" name="origin" value="' . $origin . '">';
2341
-		print '<input type="hidden" name="originid" value="' . $originid . '">';
2340
+		print '<input type="hidden" name="origin" value="'.$origin.'">';
2341
+		print '<input type="hidden" name="originid" value="'.$originid.'">';
2342 2342
 		if ($origin == 'contrat' && !empty($renewal)) {
2343
-			print '<input type="hidden" name="renewal" value="' . $renewal . '">';
2343
+			print '<input type="hidden" name="renewal" value="'.$renewal.'">';
2344 2344
 		}
2345 2345
 	} elseif ($origin == 'project' && !empty($projectid)) {
2346
-		print '<input type="hidden" name="projectid" value="' . $projectid . '">';
2346
+		print '<input type="hidden" name="projectid" value="'.$projectid.'">';
2347 2347
 	}
2348 2348
 
2349 2349
 	print dol_get_fiche_head();
@@ -2356,22 +2356,22 @@  discard block
 block discarded – undo
2356 2356
 		print '<table class="border centpercent">';
2357 2357
 
2358 2358
 		// Reference
2359
-		print '<tr class="field_ref"><td class="titlefieldcreate fieldrequired">' . $langs->trans('Ref') . '</td><td class="valuefieldcreate">' . $langs->trans("Draft") . '</td></tr>';
2359
+		print '<tr class="field_ref"><td class="titlefieldcreate fieldrequired">'.$langs->trans('Ref').'</td><td class="valuefieldcreate">'.$langs->trans("Draft").'</td></tr>';
2360 2360
 
2361 2361
 		// Ref customer
2362
-		print '<tr class="field_ref_client"><td class="titlefieldcreate">' . $langs->trans('RefCustomer') . '</td><td class="valuefieldcreate">';
2363
-		print '<input type="text" name="ref_client" value="' . (!empty($ref_client) ? $ref_client : GETPOST('ref_client')) . '"></td>';
2362
+		print '<tr class="field_ref_client"><td class="titlefieldcreate">'.$langs->trans('RefCustomer').'</td><td class="valuefieldcreate">';
2363
+		print '<input type="text" name="ref_client" value="'.(!empty($ref_client) ? $ref_client : GETPOST('ref_client')).'"></td>';
2364 2364
 		print '</tr>';
2365 2365
 
2366 2366
 		// Third party
2367 2367
 		print '<tr class="field_socid">';
2368
-		print '<td class="titlefieldcreate fieldrequired">' . $langs->trans('Customer') . '</td>';
2368
+		print '<td class="titlefieldcreate fieldrequired">'.$langs->trans('Customer').'</td>';
2369 2369
 		$shipping_method_id = 0;
2370 2370
 		$warehouse_id = 0;
2371 2371
 		if ($socid > 0) {
2372 2372
 			print '<td class="valuefieldcreate">';
2373 2373
 			print $soc->getNomUrl(1, 'customer');
2374
-			print '<input type="hidden" name="socid" value="' . $soc->id . '">';
2374
+			print '<input type="hidden" name="socid" value="'.$soc->id.'">';
2375 2375
 			print '</td>';
2376 2376
 			if (getDolGlobalString('SOCIETE_ASK_FOR_SHIPPING_METHOD') && !empty($soc->shipping_method_id)) {
2377 2377
 				$shipping_method_id = $soc->shipping_method_id;
@@ -2380,7 +2380,7 @@  discard block
 block discarded – undo
2380 2380
 		} else {
2381 2381
 			print '<td class="valuefieldcreate">';
2382 2382
 			$filter = '((s.client:IN:1,2,3) AND (s.status:=:1))';
2383
-			print img_picto('', 'company', 'class="pictofixedwidth"') . $form->select_company('', 'socid', $filter, 'SelectThirdParty', 1, 0, array(), 0, 'minwidth300 maxwidth500 widthcentpercentminusxx');
2383
+			print img_picto('', 'company', 'class="pictofixedwidth"').$form->select_company('', 'socid', $filter, 'SelectThirdParty', 1, 0, array(), 0, 'minwidth300 maxwidth500 widthcentpercentminusxx');
2384 2384
 			// reload page to retrieve customer information
2385 2385
 			if (!getDolGlobalString('RELOAD_PAGE_ON_CUSTOMER_CHANGE_DISABLED')) {
2386 2386
 				print '<script>
@@ -2396,63 +2396,63 @@  discard block
 block discarded – undo
2396 2396
 				});
2397 2397
 				</script>';
2398 2398
 			}
2399
-			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>';
2399
+			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>';
2400 2400
 			print '</td>';
2401 2401
 		}
2402
-		print '</tr>' . "\n";
2402
+		print '</tr>'."\n";
2403 2403
 
2404 2404
 		if ($socid > 0) {
2405 2405
 			// Contacts (ask contact only if thirdparty already defined).
2406
-			print '<tr class="field_contactid"><td class="titlefieldcreate">' . $langs->trans("DefaultContact") . '</td><td class="valuefieldcreate">';
2406
+			print '<tr class="field_contactid"><td class="titlefieldcreate">'.$langs->trans("DefaultContact").'</td><td class="valuefieldcreate">';
2407 2407
 			print img_picto('', 'contact', 'class="pictofixedwidth"');
2408 2408
 			//print $form->selectcontacts($soc->id, $contactid, 'contactid', 1, '', '', 0, 'minwidth300 widthcentpercentminusx');
2409 2409
 			print $form->select_contact($soc->id, $contactid, 'contactid', 1, '', '', 1, 'maxwidth300 widthcentpercentminusx', true);
2410 2410
 			print '</td></tr>';
2411 2411
 
2412 2412
 			// Third party discounts info line
2413
-			print '<tr class="field_discount_info"><td class="titlefieldcreate">' . $langs->trans('Discounts') . '</td><td class="valuefieldcreate">';
2413
+			print '<tr class="field_discount_info"><td class="titlefieldcreate">'.$langs->trans('Discounts').'</td><td class="valuefieldcreate">';
2414 2414
 
2415 2415
 			$absolute_discount = $soc->getAvailableDiscounts();
2416 2416
 
2417 2417
 			$thirdparty = $soc;
2418 2418
 			$discount_type = 0;
2419
-			$backtopage = $_SERVER["PHP_SELF"] . '?socid=' . $thirdparty->id . '&action=' . $action . '&origin=' . urlencode((string) (GETPOST('origin'))) . '&originid=' . urlencode((string) (GETPOSTINT('originid')));
2420
-			include DOL_DOCUMENT_ROOT . '/core/tpl/object_discounts.tpl.php';
2419
+			$backtopage = $_SERVER["PHP_SELF"].'?socid='.$thirdparty->id.'&action='.$action.'&origin='.urlencode((string) (GETPOST('origin'))).'&originid='.urlencode((string) (GETPOSTINT('originid')));
2420
+			include DOL_DOCUMENT_ROOT.'/core/tpl/object_discounts.tpl.php';
2421 2421
 			print '</td></tr>';
2422 2422
 		}
2423 2423
 
2424 2424
 		$newdatepropal = dol_mktime(0, 0, 0, GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear'), 'tzserver');
2425 2425
 		// Date
2426
-		print '<tr class="field_addprop"><td class="titlefieldcreate fieldrequired">' . $langs->trans('DatePropal') . '</td><td class="valuefieldcreate">';
2426
+		print '<tr class="field_addprop"><td class="titlefieldcreate fieldrequired">'.$langs->trans('DatePropal').'</td><td class="valuefieldcreate">';
2427 2427
 		print img_picto('', 'action', 'class="pictofixedwidth"');
2428 2428
 		print $form->selectDate($newdatepropal ? $newdatepropal : $datepropal, '', 0, 0, 0, "addprop", 1, 1);
2429 2429
 		print '</td></tr>';
2430 2430
 
2431 2431
 		// Validaty duration
2432
-		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>';
2432
+		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>';
2433 2433
 
2434 2434
 		// Terms of payment
2435
-		print '<tr class="field_cond_reglement_id"><td class="nowrap">' . $langs->trans('PaymentConditionsShort') . '</td><td>';
2435
+		print '<tr class="field_cond_reglement_id"><td class="nowrap">'.$langs->trans('PaymentConditionsShort').'</td><td>';
2436 2436
 		print img_picto('', 'payment', 'class="pictofixedwidth"');
2437 2437
 		// at last resort we take the payment term id which may be filled by default values set (if not getpostisset)
2438 2438
 		print $form->getSelectConditionsPaiements((int) $cond_reglement_id, 'cond_reglement_id', 1, 1, 0, '', $deposit_percent);
2439 2439
 		print '</td></tr>';
2440 2440
 
2441 2441
 		// Mode of payment
2442
-		print '<tr class="field_mode_reglement_id"><td class="titlefieldcreate">' . $langs->trans('PaymentMode') . '</td><td class="valuefieldcreate">';
2442
+		print '<tr class="field_mode_reglement_id"><td class="titlefieldcreate">'.$langs->trans('PaymentMode').'</td><td class="valuefieldcreate">';
2443 2443
 		print img_picto('', 'bank', 'class="pictofixedwidth"');
2444 2444
 		print $form->select_types_paiements((string) $mode_reglement_id, 'mode_reglement_id', 'CRDT', 0, 1, 0, 0, 1, 'maxwidth200 widthcentpercentminusx', 1);
2445 2445
 		print '</td></tr>';
2446 2446
 
2447 2447
 		// Bank Account
2448 2448
 		if (getDolGlobalString('BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL') && isModEnabled("bank")) {
2449
-			print '<tr class="field_fk_account"><td class="titlefieldcreate">' . $langs->trans('BankAccount') . '</td><td class="valuefieldcreate">';
2450
-			print img_picto('', 'bank_account', 'class="pictofixedwidth"') . $form->select_comptes((int) $fk_account, 'fk_account', 0, '', 1, '', 0, 'maxwidth200 widthcentpercentminusx', 1);
2449
+			print '<tr class="field_fk_account"><td class="titlefieldcreate">'.$langs->trans('BankAccount').'</td><td class="valuefieldcreate">';
2450
+			print img_picto('', 'bank_account', 'class="pictofixedwidth"').$form->select_comptes((int) $fk_account, 'fk_account', 0, '', 1, '', 0, 'maxwidth200 widthcentpercentminusx', 1);
2451 2451
 			print '</td></tr>';
2452 2452
 		}
2453 2453
 
2454 2454
 		// Source / Channel - What trigger creation
2455
-		print '<tr class="field_demand_reason_id"><td class="titlefieldcreate">' . $langs->trans('Source') . '</td><td class="valuefieldcreate">';
2455
+		print '<tr class="field_demand_reason_id"><td class="titlefieldcreate">'.$langs->trans('Source').'</td><td class="valuefieldcreate">';
2456 2456
 		print img_picto('', 'question', 'class="pictofixedwidth"');
2457 2457
 		$form->selectInputReason((GETPOSTISSET('demand_reason_id') ? GETPOSTINT('demand_reason_id') : ''), 'demand_reason_id', "SRC_PROP", 1, 'maxwidth200 widthcentpercentminusx');
2458 2458
 		print '</td></tr>';
@@ -2462,7 +2462,7 @@  discard block
 block discarded – undo
2462 2462
 			if (getDolGlobalString('SOCIETE_ASK_FOR_SHIPPING_METHOD') && !empty($soc->shipping_method_id)) {
2463 2463
 				$shipping_method_id = $soc->shipping_method_id;
2464 2464
 			}
2465
-			print '<tr class="field_shipping_method_id"><td class="titlefieldcreate">' . $langs->trans('SendingMethod') . '</td><td class="valuefieldcreate">';
2465
+			print '<tr class="field_shipping_method_id"><td class="titlefieldcreate">'.$langs->trans('SendingMethod').'</td><td class="valuefieldcreate">';
2466 2466
 			print img_picto('', 'dolly', 'class="pictofixedwidth"');
2467 2467
 			$form->selectShippingMethod((string) (GETPOSTISSET('shipping_method_id') ? GETPOSTINT('shipping_method_id') : $shipping_method_id), 'shipping_method_id', '', 1, '', 0, 'maxwidth200 widthcentpercentminusx');
2468 2468
 			print '</td></tr>';
@@ -2471,17 +2471,17 @@  discard block
 block discarded – undo
2471 2471
 		$formproduct = null;
2472 2472
 		// Warehouse
2473 2473
 		if (isModEnabled('stock') && getDolGlobalString('WAREHOUSE_ASK_WAREHOUSE_DURING_PROPAL')) {
2474
-			require_once DOL_DOCUMENT_ROOT . '/product/class/html.formproduct.class.php';
2474
+			require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
2475 2475
 			$formproduct = new FormProduct($db);
2476
-			print '<tr class="field_warehouse_id"><td class="titlefieldcreate">' . $langs->trans('Warehouse') . '</td><td class="valuefieldcreate">';
2477
-			print img_picto('', 'stock', 'class="pictofixedwidth"') . $formproduct->selectWarehouses($warehouse_id, 'warehouse_id', '', 1, 0, 0, '', 0, 0, array(), 'maxwidth500 widthcentpercentminusxx');
2476
+			print '<tr class="field_warehouse_id"><td class="titlefieldcreate">'.$langs->trans('Warehouse').'</td><td class="valuefieldcreate">';
2477
+			print img_picto('', 'stock', 'class="pictofixedwidth"').$formproduct->selectWarehouses($warehouse_id, 'warehouse_id', '', 1, 0, 0, '', 0, 0, array(), 'maxwidth500 widthcentpercentminusxx');
2478 2478
 			print '</td></tr>';
2479 2479
 		}
2480 2480
 
2481 2481
 		// Delivery delay
2482
-		print '<tr class="field_availability_id"><td class="titlefieldcreate">' . $langs->trans('AvailabilityPeriod');
2482
+		print '<tr class="field_availability_id"><td class="titlefieldcreate">'.$langs->trans('AvailabilityPeriod');
2483 2483
 		if (isModEnabled('order')) {
2484
-			print ' (' . $langs->trans('AfterOrder') . ')';
2484
+			print ' ('.$langs->trans('AfterOrder').')';
2485 2485
 		}
2486 2486
 		print '</td><td class="valuefieldcreate">';
2487 2487
 		print img_picto('', 'clock', 'class="pictofixedwidth"');
@@ -2489,7 +2489,7 @@  discard block
 block discarded – undo
2489 2489
 		print '</td></tr>';
2490 2490
 
2491 2491
 		// Delivery date (or manufacturing)
2492
-		print '<tr class="field_date_livraison"><td class="titlefieldcreate">' . $langs->trans("DeliveryDate") . '</td>';
2492
+		print '<tr class="field_date_livraison"><td class="titlefieldcreate">'.$langs->trans("DeliveryDate").'</td>';
2493 2493
 		print '<td class="valuefieldcreate">';
2494 2494
 		print img_picto('', 'action', 'class="pictofixedwidth"');
2495 2495
 		if (is_numeric(getDolGlobalString('DATE_LIVRAISON_WEEK_DELAY'))) {	// If value set to 0 or a num, not empty
@@ -2497,7 +2497,7 @@  discard block
 block discarded – undo
2497 2497
 			$syear = date("Y", $tmpdte);
2498 2498
 			$smonth = date("m", $tmpdte);
2499 2499
 			$sday = date("d", $tmpdte);
2500
-			print $form->selectDate($syear . "-" . $smonth . "-" . $sday, 'date_livraison', 0, 0, 0, "addprop");
2500
+			print $form->selectDate($syear."-".$smonth."-".$sday, 'date_livraison', 0, 0, 0, "addprop");
2501 2501
 		} else {
2502 2502
 			$tmp_date_delivery = GETPOST('date_delivery') ?: -1;
2503 2503
 			print $form->selectDate($tmp_date_delivery, 'date_livraison', 0, 0, 0, "addprop", 1, 1);
@@ -2508,9 +2508,9 @@  discard block
 block discarded – undo
2508 2508
 		if (isModEnabled('project') && is_object($formproject)) {
2509 2509
 			$langs->load("projects");
2510 2510
 			print '<tr class="field_projectid">';
2511
-			print '<td class="titlefieldcreate">' . $langs->trans("Project") . '</td><td class="valuefieldcreate">';
2512
-			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');
2513
-			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>';
2511
+			print '<td class="titlefieldcreate">'.$langs->trans("Project").'</td><td class="valuefieldcreate">';
2512
+			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');
2513
+			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 2514
 			print '</td>';
2515 2515
 			print '</tr>';
2516 2516
 		}
@@ -2518,7 +2518,7 @@  discard block
 block discarded – undo
2518 2518
 		// Incoterms
2519 2519
 		if (isModEnabled('incoterm')) {
2520 2520
 			print '<tr class="field_incoterm_id">';
2521
-			print '<td class="titlefieldcreate"><label for="incoterm_id">' . $form->textwithpicto($langs->trans("IncotermLabel"), $soc->label_incoterms, 1) . '</label></td>';
2521
+			print '<td class="titlefieldcreate"><label for="incoterm_id">'.$form->textwithpicto($langs->trans("IncotermLabel"), $soc->label_incoterms, 1).'</label></td>';
2522 2522
 			print '<td  class="valuefieldcreate maxwidthonsmartphone">';
2523 2523
 			print img_picto('', 'incoterm', 'class="pictofixedwidth"');
2524 2524
 			print $form->select_incoterms((!empty($soc->fk_incoterms) ? $soc->fk_incoterms : ''), (!empty($soc->location_incoterms) ? $soc->location_incoterms : ''));
@@ -2527,7 +2527,7 @@  discard block
 block discarded – undo
2527 2527
 
2528 2528
 		// Template to use by default
2529 2529
 		print '<tr class="field_model">';
2530
-		print '<td class="titlefieldcreate">' . $langs->trans("DefaultModel") . '</td>';
2530
+		print '<td class="titlefieldcreate">'.$langs->trans("DefaultModel").'</td>';
2531 2531
 		print '<td class="valuefieldcreate">';
2532 2532
 		print img_picto('', 'pdf', 'class="pictofixedwidth"');
2533 2533
 		$liste = ModelePDFPropales::liste_modeles($db);
@@ -2538,15 +2538,15 @@  discard block
 block discarded – undo
2538 2538
 		// Multicurrency
2539 2539
 		if (isModEnabled("multicurrency")) {
2540 2540
 			print '<tr class="field_currency">';
2541
-			print '<td class="titlefieldcreate">' . $form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0) . '</td>';
2541
+			print '<td class="titlefieldcreate">'.$form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0).'</td>';
2542 2542
 			print '<td class="valuefieldcreate maxwidthonsmartphone">';
2543
-			print img_picto('', 'currency', 'class="pictofixedwidth"') . $form->selectMultiCurrency(((GETPOSTISSET('multicurrency_code') && !GETPOST('changecompany')) ? GETPOST('multicurrency_code') : $currency_code), 'multicurrency_code', 0, '', false, 'maxwidth200 widthcentpercentminusx');
2543
+			print img_picto('', 'currency', 'class="pictofixedwidth"').$form->selectMultiCurrency(((GETPOSTISSET('multicurrency_code') && !GETPOST('changecompany')) ? GETPOST('multicurrency_code') : $currency_code), 'multicurrency_code', 0, '', false, 'maxwidth200 widthcentpercentminusx');
2544 2544
 			print '</td></tr>';
2545 2545
 		}
2546 2546
 
2547 2547
 		// Public note
2548 2548
 		print '<tr class="field_note_public">';
2549
-		print '<td class="titlefieldcreate tdtop">' . $langs->trans('NotePublic') . '</td>';
2549
+		print '<td class="titlefieldcreate tdtop">'.$langs->trans('NotePublic').'</td>';
2550 2550
 		print '<td class="valuefieldcreate">';
2551 2551
 		$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');
2552 2552
 		$doleditor = new DolEditor('note_public', $note_public, '', 80, 'dolibarr_notes', 'In', false, false, !getDolGlobalString('FCKEDITOR_ENABLE_NOTE_PUBLIC') ? 0 : 1, ROWS_3, '90%');
@@ -2555,7 +2555,7 @@  discard block
 block discarded – undo
2555 2555
 		// Private note
2556 2556
 		if (empty($user->socid)) {
2557 2557
 			print '<tr class="field_note_private">';
2558
-			print '<td class="titlefieldcreate tdtop">' . $langs->trans('NotePrivate') . '</td>';
2558
+			print '<td class="titlefieldcreate tdtop">'.$langs->trans('NotePrivate').'</td>';
2559 2559
 			print '<td class="valuefieldcreate">';
2560 2560
 			$note_private = $object->getDefaultCreateValueFor('note_private', ((!empty($origin) && !empty($originid) && is_object($objectsrc)) ? $objectsrc->note_private : null));
2561 2561
 			$doleditor = new DolEditor('note_private', $note_private, '', 80, 'dolibarr_notes', 'In', false, false, !getDolGlobalString('FCKEDITOR_ENABLE_NOTE_PRIVATE') ? 0 : 1, ROWS_3, '90%');
@@ -2565,7 +2565,7 @@  discard block
 block discarded – undo
2565 2565
 		}
2566 2566
 
2567 2567
 		// Other attributes
2568
-		include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_add.tpl.php';
2568
+		include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php';
2569 2569
 
2570 2570
 		// Lines from source
2571 2571
 		if (!empty($origin) && !empty($originid) && is_object($objectsrc)) {
@@ -2577,13 +2577,13 @@  discard block
 block discarded – undo
2577 2577
 				$objectsrc->update_price(1, 'auto', 1);
2578 2578
 			}
2579 2579
 
2580
-			print "\n<!-- " . $classname . " info -->";
2580
+			print "\n<!-- ".$classname." info -->";
2581 2581
 			print "\n";
2582
-			print '<input type="hidden" name="amount"         value="' . $objectsrc->total_ht . '">' . "\n";
2583
-			print '<input type="hidden" name="total"          value="' . $objectsrc->total_ttc . '">' . "\n";
2584
-			print '<input type="hidden" name="tva"            value="' . $objectsrc->total_tva . '">' . "\n";
2585
-			print '<input type="hidden" name="origin"         value="' . $objectsrc->element . '">';
2586
-			print '<input type="hidden" name="originid"       value="' . $objectsrc->id . '">';
2582
+			print '<input type="hidden" name="amount"         value="'.$objectsrc->total_ht.'">'."\n";
2583
+			print '<input type="hidden" name="total"          value="'.$objectsrc->total_ttc.'">'."\n";
2584
+			print '<input type="hidden" name="tva"            value="'.$objectsrc->total_tva.'">'."\n";
2585
+			print '<input type="hidden" name="origin"         value="'.$objectsrc->element.'">';
2586
+			print '<input type="hidden" name="originid"       value="'.$objectsrc->id.'">';
2587 2587
 
2588 2588
 			$newclassname = $classname;
2589 2589
 			if ($newclassname == 'Propal') {
@@ -2596,22 +2596,22 @@  discard block
 block discarded – undo
2596 2596
 				$newclassname = 'Intervention';
2597 2597
 			}
2598 2598
 
2599
-			print '<tr><td>' . $langs->trans($newclassname) . '</td><td>' . $objectsrc->getNomUrl(1) . '</td></tr>';
2600
-			print '<tr><td>' . $langs->trans('AmountHT') . '</td><td>' . price($objectsrc->total_ht, 0, $langs, 1, -1, -1, $conf->currency) . '</td></tr>';
2601
-			print '<tr><td>' . $langs->trans('AmountVAT') . '</td><td>' . price($objectsrc->total_tva, 0, $langs, 1, -1, -1, $conf->currency) . "</td></tr>";
2599
+			print '<tr><td>'.$langs->trans($newclassname).'</td><td>'.$objectsrc->getNomUrl(1).'</td></tr>';
2600
+			print '<tr><td>'.$langs->trans('AmountHT').'</td><td>'.price($objectsrc->total_ht, 0, $langs, 1, -1, -1, $conf->currency).'</td></tr>';
2601
+			print '<tr><td>'.$langs->trans('AmountVAT').'</td><td>'.price($objectsrc->total_tva, 0, $langs, 1, -1, -1, $conf->currency)."</td></tr>";
2602 2602
 			if ($mysoc->localtax1_assuj == "1" || $objectsrc->total_localtax1 != 0) { 		// Localtax1
2603
-				print '<tr><td>' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '</td><td>' . price($objectsrc->total_localtax1, 0, $langs, 1, -1, -1, $conf->currency) . "</td></tr>";
2603
+				print '<tr><td>'.$langs->transcountry("AmountLT1", $mysoc->country_code).'</td><td>'.price($objectsrc->total_localtax1, 0, $langs, 1, -1, -1, $conf->currency)."</td></tr>";
2604 2604
 			}
2605 2605
 
2606 2606
 			if ($mysoc->localtax2_assuj == "1" || $objectsrc->total_localtax2 != 0) { 		// Localtax2
2607
-				print '<tr><td>' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '</td><td>' . price($objectsrc->total_localtax2, 0, $langs, 1, -1, -1, $conf->currency) . "</td></tr>";
2607
+				print '<tr><td>'.$langs->transcountry("AmountLT2", $mysoc->country_code).'</td><td>'.price($objectsrc->total_localtax2, 0, $langs, 1, -1, -1, $conf->currency)."</td></tr>";
2608 2608
 			}
2609
-			print '<tr><td>' . $langs->trans('AmountTTC') . '</td><td>' . price($objectsrc->total_ttc, 0, $langs, 1, -1, -1, $conf->currency) . "</td></tr>";
2609
+			print '<tr><td>'.$langs->trans('AmountTTC').'</td><td>'.price($objectsrc->total_ttc, 0, $langs, 1, -1, -1, $conf->currency)."</td></tr>";
2610 2610
 
2611 2611
 			if (isModEnabled("multicurrency")) {
2612
-				print '<tr><td>' . $langs->trans('MulticurrencyAmountHT') . '</td><td>' . price($objectsrc->multicurrency_total_ht) . '</td></tr>';
2613
-				print '<tr><td>' . $langs->trans('MulticurrencyAmountVAT') . '</td><td>' . price($objectsrc->multicurrency_total_tva) . "</td></tr>";
2614
-				print '<tr><td>' . $langs->trans('MulticurrencyAmountTTC') . '</td><td>' . price($objectsrc->multicurrency_total_ttc) . "</td></tr>";
2612
+				print '<tr><td>'.$langs->trans('MulticurrencyAmountHT').'</td><td>'.price($objectsrc->multicurrency_total_ht).'</td></tr>';
2613
+				print '<tr><td>'.$langs->trans('MulticurrencyAmountVAT').'</td><td>'.price($objectsrc->multicurrency_total_tva)."</td></tr>";
2614
+				print '<tr><td>'.$langs->trans('MulticurrencyAmountTTC').'</td><td>'.price($objectsrc->multicurrency_total_ttc)."</td></tr>";
2615 2615
 			}
2616 2616
 		}
2617 2617
 
@@ -2632,16 +2632,16 @@  discard block
 block discarded – undo
2632 2632
 			// For backward compatibility
2633 2633
 			print '<tr>';
2634 2634
 			print '<td><input type="radio" name="createmode" value="copy"></td>';
2635
-			print '<td>' . $langs->trans("CopyPropalFrom") . ' </td>';
2635
+			print '<td>'.$langs->trans("CopyPropalFrom").' </td>';
2636 2636
 			print '<td>';
2637 2637
 			$liste_propal = array();
2638 2638
 			$liste_propal[0] = '';
2639 2639
 
2640 2640
 			$sql = "SELECT p.rowid as id, p.ref, s.nom";
2641
-			$sql .= " FROM " . MAIN_DB_PREFIX . "propal p";
2642
-			$sql .= ", " . MAIN_DB_PREFIX . "societe s";
2641
+			$sql .= " FROM ".MAIN_DB_PREFIX."propal p";
2642
+			$sql .= ", ".MAIN_DB_PREFIX."societe s";
2643 2643
 			$sql .= " WHERE s.rowid = p.fk_soc";
2644
-			$sql .= " AND p.entity IN (" . getEntity('propal') . ")";
2644
+			$sql .= " AND p.entity IN (".getEntity('propal').")";
2645 2645
 			$sql .= " AND p.fk_statut <> 0";
2646 2646
 			$sql .= " ORDER BY Id";
2647 2647
 
@@ -2651,7 +2651,7 @@  discard block
 block discarded – undo
2651 2651
 				$i = 0;
2652 2652
 				while ($i < $num) {
2653 2653
 					$row = $db->fetch_row($resql);
2654
-					$propalRefAndSocName = $row[1] . " - " . $row[2];
2654
+					$propalRefAndSocName = $row[1]." - ".$row[2];
2655 2655
 					$liste_propal[$row[0]] = $propalRefAndSocName;
2656 2656
 					$i++;
2657 2657
 				}
@@ -2662,7 +2662,7 @@  discard block
 block discarded – undo
2662 2662
 			print '</td></tr>';
2663 2663
 
2664 2664
 			print '<tr><td class="tdtop"><input type="radio" name="createmode" value="empty" checked></td>';
2665
-			print '<td valign="top" colspan="2">' . $langs->trans("CreateEmptyPropal") . '</td></tr>';
2665
+			print '<td valign="top" colspan="2">'.$langs->trans("CreateEmptyPropal").'</td></tr>';
2666 2666
 			print '</table>';
2667 2667
 		}
2668 2668
 	}
@@ -2722,7 +2722,7 @@  discard block
 block discarded – undo
2722 2722
 			$formquestion[] = array('type' => 'date', 'name' => 'date_delivery', 'label' => $langs->trans("DeliveryDate"), 'value' => $object->delivery_date);
2723 2723
 		}
2724 2724
 		// Incomplete payment. We ask if reason = discount or other
2725
-		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('ToClone'), $langs->trans('ConfirmClonePropal', $object->ref), 'confirm_clone', $formquestion, 'yes', 1, 250, 600);
2725
+		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmClonePropal', $object->ref), 'confirm_clone', $formquestion, 'yes', 1, 250, 600);
2726 2726
 	}
2727 2727
 
2728 2728
 	// Subtotal line form
@@ -2742,9 +2742,9 @@  discard block
 block discarded – undo
2742 2742
 		//Form to close proposal (signed or not)
2743 2743
 		$formquestion = array();
2744 2744
 		if (!getDolGlobalString('PROPAL_SKIP_ACCEPT_REFUSE')) {
2745
-			$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)));
2745
+			$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)));
2746 2746
 		}
2747
-		$formquestion[] = array('type' => 'text', 'name' => 'note_private', 'label' => $langs->trans("Note"), 'value' => '');				// Field to complete private note (not replace)
2747
+		$formquestion[] = array('type' => 'text', 'name' => 'note_private', 'label' => $langs->trans("Note"), 'value' => ''); // Field to complete private note (not replace)
2748 2748
 
2749 2749
 		if (getDolGlobalInt('PROPOSAL_SUGGEST_DOWN_PAYMENT_INVOICE_CREATION')) {
2750 2750
 			// This is a hidden option:
@@ -2754,7 +2754,7 @@  discard block
 block discarded – undo
2754 2754
 			$deposit_percent_from_payment_terms = getDictionaryValue('c_payment_term', 'deposit_percent', $object->cond_reglement_id);
2755 2755
 
2756 2756
 			if (!empty($deposit_percent_from_payment_terms) && isModEnabled('invoice') && $user->hasRight('facture', 'creer')) {
2757
-				require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
2757
+				require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
2758 2758
 
2759 2759
 				$object->fetchObjectLinked();
2760 2760
 
@@ -2840,7 +2840,7 @@  discard block
 block discarded – undo
2840 2840
 						'type' => 'onecolumn',
2841 2841
 						'value' => '
2842 2842
 							<script>
2843
-								let signedValue = ' . $object::STATUS_SIGNED . ';
2843
+								let signedValue = ' . $object::STATUS_SIGNED.';
2844 2844
 
2845 2845
 								$(document).ready(function() {
2846 2846
 									$("[name=generate_deposit]").change(function () {
@@ -2880,7 +2880,7 @@  discard block
 block discarded – undo
2880 2880
 		}
2881 2881
 
2882 2882
 		if (isModEnabled('notification')) {
2883
-			require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php';
2883
+			require_once DOL_DOCUMENT_ROOT.'/core/class/notify.class.php';
2884 2884
 			$notify = new Notify($db);
2885 2885
 			$formquestion = array_merge($formquestion, array(
2886 2886
 				array('type' => 'onecolumn', 'value' => $notify->confirmMessage('PROPAL_CLOSE_SIGNED', $object->socid, $object)),
@@ -2888,22 +2888,22 @@  discard block
 block discarded – undo
2888 2888
 		}
2889 2889
 
2890 2890
 		if (!getDolGlobalString('PROPAL_SKIP_ACCEPT_REFUSE')) {
2891
-			$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('SetAcceptedRefused'), '', 'confirm_closeas', $formquestion, '', 1, 250);
2891
+			$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('SetAcceptedRefused'), '', 'confirm_closeas', $formquestion, '', 1, 250);
2892 2892
 		} else {
2893
-			$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?statut=3&id=' . $object->id, $langs->trans('Close'), '', 'confirm_closeas', $formquestion, '', 1, 250);
2893
+			$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?statut=3&id='.$object->id, $langs->trans('Close'), '', 'confirm_closeas', $formquestion, '', 1, 250);
2894 2894
 		}
2895 2895
 	} elseif ($action == 'cancel') {
2896 2896
 		// Confirm cancel
2897
-		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans("CancelPropal"), $langs->trans('ConfirmCancelPropal', $object->ref), 'confirm_cancel', '', 0, 1);
2897
+		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans("CancelPropal"), $langs->trans('ConfirmCancelPropal', $object->ref), 'confirm_cancel', '', 0, 1);
2898 2898
 	} elseif ($action == 'delete') {
2899 2899
 		// Confirm delete
2900
-		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('DeleteProp'), $langs->trans('ConfirmDeleteProp', $object->ref), 'confirm_delete', '', 0, 1);
2900
+		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteProp'), $langs->trans('ConfirmDeleteProp', $object->ref), 'confirm_delete', '', 0, 1);
2901 2901
 	} elseif ($action == 'reopen') {
2902 2902
 		// Confirm reopen
2903
-		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('ReOpen'), $langs->trans('ConfirmReOpenProp', $object->ref), 'confirm_reopen', '', 0, 1);
2903
+		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ReOpen'), $langs->trans('ConfirmReOpenProp', $object->ref), 'confirm_reopen', '', 0, 1);
2904 2904
 	} elseif ($action == 'ask_deleteline') {
2905 2905
 		// Confirmation delete product/service line
2906
-		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id . '&lineid=' . $lineid, $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteline', '', 0, 1);
2906
+		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteline', '', 0, 1);
2907 2907
 	} elseif ($action == 'ask_subtotal_deleteline') {
2908 2908
 		// Confirmation de la suppression d'une ligne subtotal
2909 2909
 		$langs->load("subtotals");
@@ -2914,7 +2914,7 @@  discard block
 block discarded – undo
2914 2914
 			$title = "DeleteTitleLine";
2915 2915
 			$question = "ConfirmDeleteTitleLine";
2916 2916
 		}
2917
-		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id . '&lineid=' . $lineid, $langs->trans($title), $langs->trans($question), 'confirm_delete_subtotalline', $formconfirm, 'no', 1);
2917
+		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans($title), $langs->trans($question), 'confirm_delete_subtotalline', $formconfirm, 'no', 1);
2918 2918
 	} elseif ($action == 'validate') {
2919 2919
 		// Confirm validate proposal
2920 2920
 		$error = 0;
@@ -2933,7 +2933,7 @@  discard block
 block discarded – undo
2933 2933
 
2934 2934
 		$text = $langs->trans('ConfirmValidateProp', $numref);
2935 2935
 		if (isModEnabled('notification')) {
2936
-			require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php';
2936
+			require_once DOL_DOCUMENT_ROOT.'/core/class/notify.class.php';
2937 2937
 			$notify = new Notify($db);
2938 2938
 			$text .= '<br>';
2939 2939
 			$text .= $notify->confirmMessage('PROPAL_VALIDATE', $object->socid, $object);
@@ -2943,7 +2943,7 @@  discard block
 block discarded – undo
2943 2943
 		$nbMandated = 0;
2944 2944
 		foreach ($object->lines as $line) {
2945 2945
 			$res = $line->fetch_product();
2946
-			if ($res  > 0) {
2946
+			if ($res > 0) {
2947 2947
 				if ($line->product->isService() && $line->product->isMandatoryPeriod() && (empty($line->date_start) || empty($line->date_end))) {
2948 2948
 					$nbMandated++;
2949 2949
 					break;
@@ -2955,12 +2955,12 @@  discard block
 block discarded – undo
2955 2955
 				setEventMessages($langs->trans("mandatoryPeriodNeedTobeSetMsgValidate"), null, 'errors');
2956 2956
 				$error++;
2957 2957
 			} else {
2958
-				$text .= '<div><span class="clearboth nowraponall warning">' . img_warning() . $langs->trans("mandatoryPeriodNeedTobeSetMsgValidate") . '</span></div>';
2958
+				$text .= '<div><span class="clearboth nowraponall warning">'.img_warning().$langs->trans("mandatoryPeriodNeedTobeSetMsgValidate").'</span></div>';
2959 2959
 			}
2960 2960
 		}
2961 2961
 
2962 2962
 		if (!$error) {
2963
-			$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('ValidateProp'), $text, 'confirm_validate', '', 0, 1, 240);
2963
+			$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ValidateProp'), $text, 'confirm_validate', '', 0, 1, 240);
2964 2964
 		}
2965 2965
 	}
2966 2966
 
@@ -2979,16 +2979,16 @@  discard block
 block discarded – undo
2979 2979
 
2980 2980
 	// Proposal card
2981 2981
 
2982
-	$linkback = '<a href="' . DOL_URL_ROOT . '/comm/propal/list.php?restore_lastsearch_values=1' . (!empty($socid) ? '&socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';
2982
+	$linkback = '<a href="'.DOL_URL_ROOT.'/comm/propal/list.php?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>';
2983 2983
 
2984 2984
 	$morehtmlref = '<div class="refidno">';
2985 2985
 	// Ref customer
2986 2986
 	$morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, $usercancreate, 'string', '', 0, 1);
2987
-	$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);
2987
+	$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);
2988 2988
 	// Thirdparty
2989
-	$morehtmlref .= '<br>' . $soc->getNomUrl(1, 'customer');
2989
+	$morehtmlref .= '<br>'.$soc->getNomUrl(1, 'customer');
2990 2990
 	if (!getDolGlobalString('MAIN_DISABLE_OTHER_LINK') && $soc->id > 0) {
2991
-		$morehtmlref .= ' (<a href="' . DOL_URL_ROOT . '/comm/propal/list.php?socid=' . $soc->id . '&search_societe=' . urlencode($soc->name) . '">' . $langs->trans("OtherProposals") . '</a>)';
2991
+		$morehtmlref .= ' (<a href="'.DOL_URL_ROOT.'/comm/propal/list.php?socid='.$soc->id.'&search_societe='.urlencode($soc->name).'">'.$langs->trans("OtherProposals").'</a>)';
2992 2992
 	}
2993 2993
 	// Project
2994 2994
 	if (isModEnabled('project')) {
@@ -2997,16 +2997,16 @@  discard block
 block discarded – undo
2997 2997
 		if ($usercancreate) {
2998 2998
 			$morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"');
2999 2999
 			if ($action != 'classify') {
3000
-				$morehtmlref .= '<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&token=' . newToken() . '&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> ';
3000
+				$morehtmlref .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> ';
3001 3001
 			}
3002
-			$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');
3002
+			$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');
3003 3003
 		} else {
3004 3004
 			if (!empty($object->fk_project)) {
3005 3005
 				$proj = new Project($db);
3006 3006
 				$proj->fetch($object->fk_project);
3007 3007
 				$morehtmlref .= $proj->getNomUrl(1);
3008 3008
 				if ($proj->title) {
3009
-					$morehtmlref .= '<span class="opacitymedium"> - ' . dol_escape_htmltag($proj->title) . '</span>';
3009
+					$morehtmlref .= '<span class="opacitymedium"> - '.dol_escape_htmltag($proj->title).'</span>';
3010 3010
 				}
3011 3011
 			}
3012 3012
 		}
@@ -3036,7 +3036,7 @@  discard block
 block discarded – undo
3036 3036
 			$filtercreditnote = "fk_facture_source IS NOT NULL AND (description NOT LIKE '(DEPOSIT)%' OR description LIKE '(EXCESS RECEIVED)%')";
3037 3037
 		}
3038 3038
 
3039
-		print '<tr><td class="titlefieldmax45">' . $langs->trans('Discounts') . '</td><td>';
3039
+		print '<tr><td class="titlefieldmax45">'.$langs->trans('Discounts').'</td><td>';
3040 3040
 
3041 3041
 		$absolute_discount = $soc->getAvailableDiscounts(null, $filterabsolutediscount);
3042 3042
 		$absolute_creditnote = $soc->getAvailableDiscounts(null, $filtercreditnote);
@@ -3047,8 +3047,8 @@  discard block
 block discarded – undo
3047 3047
 
3048 3048
 		$thirdparty = $soc;
3049 3049
 		$discount_type = 0;
3050
-		$backtopage = $_SERVER["PHP_SELF"] . '?id=' . $object->id;
3051
-		include DOL_DOCUMENT_ROOT . '/core/tpl/object_discounts.tpl.php';
3050
+		$backtopage = $_SERVER["PHP_SELF"].'?id='.$object->id;
3051
+		include DOL_DOCUMENT_ROOT.'/core/tpl/object_discounts.tpl.php';
3052 3052
 
3053 3053
 		print '</td></tr>';
3054 3054
 
@@ -3067,12 +3067,12 @@  discard block
 block discarded – undo
3067 3067
 		print $form->editfieldkey("DatePropal", 'date', '', $object, (int) $editenable);
3068 3068
 		print '</td><td class="valuefield">';
3069 3069
 		if ($action == 'editdate' && $usercancreate && $caneditfield) {
3070
-			print '<form name="editdate" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '" method="post">';
3071
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
3070
+			print '<form name="editdate" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="post">';
3071
+			print '<input type="hidden" name="token" value="'.newToken().'">';
3072 3072
 			print '<input type="hidden" name="action" value="setdate">';
3073
-			print '<input type="hidden" name="backtopage" value="' . $backtopage . '">';
3073
+			print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
3074 3074
 			print $form->selectDate($object->date, 're', 0, 0, 0, "editdate");
3075
-			print '<input type="submit" class="button button-edit" value="' . $langs->trans('Modify') . '">';
3075
+			print '<input type="submit" class="button button-edit" value="'.$langs->trans('Modify').'">';
3076 3076
 			print '</form>';
3077 3077
 		} else {
3078 3078
 			if ($object->date) {
@@ -3090,17 +3090,17 @@  discard block
 block discarded – undo
3090 3090
 		print $langs->trans('DateEndPropal');
3091 3091
 		print '</td>';
3092 3092
 		if ($action != 'editecheance' && $usercancreate && $caneditfield) {
3093
-			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>';
3093
+			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>';
3094 3094
 		}
3095 3095
 		print '</tr></table>';
3096 3096
 		print '</td><td class="valuefield">';
3097 3097
 		if ($action == 'editecheance' && $usercancreate && $caneditfield) {
3098
-			print '<form name="editecheance" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '" method="post">';
3099
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
3098
+			print '<form name="editecheance" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="post">';
3099
+			print '<input type="hidden" name="token" value="'.newToken().'">';
3100 3100
 			print '<input type="hidden" name="action" value="setecheance">';
3101
-			print '<input type="hidden" name="backtopage" value="' . $backtopage . '">';
3101
+			print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
3102 3102
 			print $form->selectDate($object->fin_validite, 'ech', 0, 0, 0, "editecheance");
3103
-			print '<input type="submit" class="button button-edit" value="' . $langs->trans('Modify') . '">';
3103
+			print '<input type="submit" class="button button-edit" value="'.$langs->trans('Modify').'">';
3104 3104
 			print '</form>';
3105 3105
 		} else {
3106 3106
 			if (!empty($object->fin_validite)) {
@@ -3121,14 +3121,14 @@  discard block
 block discarded – undo
3121 3121
 		print $langs->trans('PaymentConditionsShort');
3122 3122
 		print '</td>';
3123 3123
 		if ($action != 'editconditions' && $usercancreate && $caneditfield) {
3124
-			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>';
3124
+			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>';
3125 3125
 		}
3126 3126
 		print '</tr></table>';
3127 3127
 		print '</td><td class="valuefield">';
3128 3128
 		if ($action == 'editconditions' && $usercancreate && $caneditfield) {
3129
-			$form->form_conditions_reglement($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->cond_reglement_id, 'cond_reglement_id', 0, '', 1, $object->deposit_percent);
3129
+			$form->form_conditions_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->cond_reglement_id, 'cond_reglement_id', 0, '', 1, $object->deposit_percent);
3130 3130
 		} else {
3131
-			$form->form_conditions_reglement($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->cond_reglement_id, 'none', 0, '', 1, $object->deposit_percent);
3131
+			$form->form_conditions_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->cond_reglement_id, 'none', 0, '', 1, $object->deposit_percent);
3132 3132
 		}
3133 3133
 		print '</td>';
3134 3134
 		print '</tr>';
@@ -3140,14 +3140,14 @@  discard block
 block discarded – undo
3140 3140
 		print $langs->trans('PaymentMode');
3141 3141
 		print '</td>';
3142 3142
 		if ($action != 'editmode' && $usercancreate && $caneditfield) {
3143
-			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>';
3143
+			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>';
3144 3144
 		}
3145 3145
 		print '</tr></table>';
3146 3146
 		print '</td><td class="valuefieldcreate">';
3147 3147
 		if ($action == 'editmode' && $usercancreate && $caneditfield) {
3148
-			$form->form_modes_reglement($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->mode_reglement_id, 'mode_reglement_id', 'CRDT', 1, 1);
3148
+			$form->form_modes_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->mode_reglement_id, 'mode_reglement_id', 'CRDT', 1, 1);
3149 3149
 		} else {
3150
-			$form->form_modes_reglement($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->mode_reglement_id, 'none');
3150
+			$form->form_modes_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->mode_reglement_id, 'none');
3151 3151
 		}
3152 3152
 		print '</td></tr>';
3153 3153
 
@@ -3163,20 +3163,20 @@  discard block
 block discarded – undo
3163 3163
 		print '<tr class="fielddeliverydelay"><td>';
3164 3164
 		print '<table class="nobordernopadding centpercent"><tr><td>';
3165 3165
 		if (isModEnabled('order')) {
3166
-			print $form->textwithpicto($langs->trans('AvailabilityPeriod'), $langs->trans('AvailabilityPeriod') . ' (' . $langs->trans('AfterOrder') . ')');
3166
+			print $form->textwithpicto($langs->trans('AvailabilityPeriod'), $langs->trans('AvailabilityPeriod').' ('.$langs->trans('AfterOrder').')');
3167 3167
 		} else {
3168 3168
 			print $langs->trans('AvailabilityPeriod');
3169 3169
 		}
3170 3170
 		print '</td>';
3171 3171
 		if ($action != 'editavailability' && $usercancreate && $caneditfield) {
3172
-			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>';
3172
+			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>';
3173 3173
 		}
3174 3174
 		print '</tr></table>';
3175 3175
 		print '</td><td class="valuefield">';
3176 3176
 		if ($action == 'editavailability' && $usercancreate && $caneditfield) {
3177
-			$form->form_availability($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->availability_id, 'availability_id', 1);
3177
+			$form->form_availability($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->availability_id, 'availability_id', 1);
3178 3178
 		} else {
3179
-			$form->form_availability($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->availability_id, 'none', 1);
3179
+			$form->form_availability($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->availability_id, 'none', 1);
3180 3180
 		}
3181 3181
 
3182 3182
 		print '</td>';
@@ -3189,14 +3189,14 @@  discard block
 block discarded – undo
3189 3189
 			print $langs->trans('SendingMethod');
3190 3190
 			print '</td>';
3191 3191
 			if ($action != 'editshippingmethod' && $usercancreate && $caneditfield) {
3192
-				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>';
3192
+				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>';
3193 3193
 			}
3194 3194
 			print '</tr></table>';
3195 3195
 			print '</td><td class="valuefield">';
3196 3196
 			if ($action == 'editshippingmethod' && $usercancreate && $caneditfield) {
3197
-				$form->formSelectShippingMethod($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->shipping_method_id, 'shipping_method_id', 1);
3197
+				$form->formSelectShippingMethod($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->shipping_method_id, 'shipping_method_id', 1);
3198 3198
 			} else {
3199
-				$form->formSelectShippingMethod($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->shipping_method_id, 'none');
3199
+				$form->formSelectShippingMethod($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->shipping_method_id, 'none');
3200 3200
 			}
3201 3201
 			print '</td>';
3202 3202
 			print '</tr>';
@@ -3205,16 +3205,16 @@  discard block
 block discarded – undo
3205 3205
 		// Warehouse
3206 3206
 		if (isModEnabled('stock') && getDolGlobalString('WAREHOUSE_ASK_WAREHOUSE_DURING_PROPAL')) {
3207 3207
 			$langs->load('stocks');
3208
-			require_once DOL_DOCUMENT_ROOT . '/product/class/html.formproduct.class.php';
3208
+			require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
3209 3209
 			$formproduct = new FormProduct($db);
3210 3210
 			print '<tr class="field_warehouse_id"><td>';
3211 3211
 			$editenable = $usercancreate;
3212 3212
 			print $form->editfieldkey("Warehouse", 'warehouse', '', $object, $editenable);
3213 3213
 			print '</td><td class="valuefieldcreate">';
3214 3214
 			if ($action == 'editwarehouse') {
3215
-				$formproduct->formSelectWarehouses($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->warehouse_id, 'warehouse_id', 1);
3215
+				$formproduct->formSelectWarehouses($_SERVER['PHP_SELF'].'?id='.$object->id, $object->warehouse_id, 'warehouse_id', 1);
3216 3216
 			} else {
3217
-				$formproduct->formSelectWarehouses($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->warehouse_id, 'none');
3217
+				$formproduct->formSelectWarehouses($_SERVER['PHP_SELF'].'?id='.$object->id, $object->warehouse_id, 'none');
3218 3218
 			}
3219 3219
 			print '</td>';
3220 3220
 			print '</tr>';
@@ -3226,14 +3226,14 @@  discard block
 block discarded – undo
3226 3226
 		print $langs->trans('Source');
3227 3227
 		print '</td>';
3228 3228
 		if ($action != 'editdemandreason' && $usercancreate) {
3229
-			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>';
3229
+			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>';
3230 3230
 		}
3231 3231
 		print '</tr></table>';
3232 3232
 		print '</td><td class="valuefield">';
3233 3233
 		if ($action == 'editdemandreason' && $usercancreate) {
3234
-			$form->formInputReason($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->demand_reason_id, 'demand_reason_id', 1);
3234
+			$form->formInputReason($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->demand_reason_id, 'demand_reason_id', 1);
3235 3235
 		} else {
3236
-			$form->formInputReason($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->demand_reason_id, 'none');
3236
+			$form->formInputReason($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->demand_reason_id, 'none');
3237 3237
 		}
3238 3238
 		print '</td>';
3239 3239
 		print '</tr>';
@@ -3245,7 +3245,7 @@  discard block
 block discarded – undo
3245 3245
 			print '</td><td class="valuefield">';
3246 3246
 			$arrayoutstandingbills = $soc->getOutstandingBills();
3247 3247
 			print($arrayoutstandingbills['opened'] > $soc->outstanding_limit ? img_warning() : '');
3248
-			print price($arrayoutstandingbills['opened']) . ' / ';
3248
+			print price($arrayoutstandingbills['opened']).' / ';
3249 3249
 			print price($soc->outstanding_limit, 0, $langs, 1, -1, -1, $conf->currency);
3250 3250
 			print '</td>';
3251 3251
 			print '</tr>';
@@ -3258,14 +3258,14 @@  discard block
 block discarded – undo
3258 3258
 			print $langs->trans('BankAccount');
3259 3259
 			print '</td>';
3260 3260
 			if ($action != 'editbankaccount' && $usercancreate) {
3261
-				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>';
3261
+				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>';
3262 3262
 			}
3263 3263
 			print '</tr></table>';
3264 3264
 			print '</td><td class="valuefield">';
3265 3265
 			if ($action == 'editbankaccount') {
3266
-				$form->formSelectAccount($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->fk_account, 'fk_account', 1);
3266
+				$form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->fk_account, 'fk_account', 1);
3267 3267
 			} else {
3268
-				$form->formSelectAccount($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->fk_account, 'none');
3268
+				$form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->fk_account, 'none');
3269 3269
 			}
3270 3270
 			print '</td>';
3271 3271
 			print '</tr>';
@@ -3276,13 +3276,13 @@  discard block
 block discarded – undo
3276 3276
 			$totalWeight = isset($tmparray['weight']) ? $tmparray['weight'] : 0;
3277 3277
 			$totalVolume = isset($tmparray['volume']) ? $tmparray['volume'] : 0;
3278 3278
 			if ($totalWeight) {
3279
-				print '<tr><td>' . $langs->trans("CalculatedWeight") . '</td>';
3279
+				print '<tr><td>'.$langs->trans("CalculatedWeight").'</td>';
3280 3280
 				print '<td class="valuefield">';
3281 3281
 				print showDimensionInBestUnit($totalWeight, 0, "weight", $langs, getDolGlobalInt('MAIN_WEIGHT_DEFAULT_ROUND', -1), getDolGlobalString('MAIN_WEIGHT_DEFAULT_UNIT', 'no'), 1);
3282 3282
 				print '</td></tr>';
3283 3283
 			}
3284 3284
 			if ($totalVolume) {
3285
-				print '<tr><td>' . $langs->trans("CalculatedVolume") . '</td>';
3285
+				print '<tr><td>'.$langs->trans("CalculatedVolume").'</td>';
3286 3286
 				print '<td class="valuefield">';
3287 3287
 				print showDimensionInBestUnit($totalVolume, 0, "volume", $langs, getDolGlobalInt('MAIN_VOLUME_DEFAULT_ROUND', -1), getDolGlobalString('MAIN_VOLUME_DEFAULT_UNIT', 'no'), 1);
3288 3288
 				print '</td></tr>';
@@ -3296,7 +3296,7 @@  discard block
 block discarded – undo
3296 3296
 			print $langs->trans('IncotermLabel');
3297 3297
 			print '<td><td class="right">';
3298 3298
 			if ($action != 'editincoterm' && $usercancreate && $caneditfield) {
3299
-				print '<a class="editfielda" href="' . DOL_URL_ROOT . '/comm/propal/card.php?id=' . $object->id . '&action=editincoterm&token=' . newToken() . '">' . img_edit() . '</a>';
3299
+				print '<a class="editfielda" href="'.DOL_URL_ROOT.'/comm/propal/card.php?id='.$object->id.'&action=editincoterm&token='.newToken().'">'.img_edit().'</a>';
3300 3300
 			} else {
3301 3301
 				print '&nbsp;';
3302 3302
 			}
@@ -3304,7 +3304,7 @@  discard block
 block discarded – undo
3304 3304
 			print '</td>';
3305 3305
 			print '<td class="valuefield">';
3306 3306
 			if ($action == 'editincoterm' && $usercancreate && $caneditfield) {
3307
-				print $form->select_incoterms((!empty($object->fk_incoterms) ? $object->fk_incoterms : ''), (!empty($object->location_incoterms) ? $object->location_incoterms : ''), $_SERVER['PHP_SELF'] . '?id=' . $object->id);
3307
+				print $form->select_incoterms((!empty($object->fk_incoterms) ? $object->fk_incoterms : ''), (!empty($object->location_incoterms) ? $object->location_incoterms : ''), $_SERVER['PHP_SELF'].'?id='.$object->id);
3308 3308
 			} else {
3309 3309
 				print $form->textwithpicto($object->display_incoterms(), $object->label_incoterms, 1);
3310 3310
 			}
@@ -3312,7 +3312,7 @@  discard block
 block discarded – undo
3312 3312
 		}
3313 3313
 
3314 3314
 		// Other attributes
3315
-		include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
3315
+		include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
3316 3316
 
3317 3317
 		print '</table>';
3318 3318
 
@@ -3322,53 +3322,53 @@  discard block
 block discarded – undo
3322 3322
 
3323 3323
 		print '<table class="border tableforfield centpercent">';
3324 3324
 
3325
-		include DOL_DOCUMENT_ROOT . '/core/tpl/object_currency_amount.tpl.php';
3325
+		include DOL_DOCUMENT_ROOT.'/core/tpl/object_currency_amount.tpl.php';
3326 3326
 
3327 3327
 		print '<tr>';
3328
-		print '<td class="titlefieldmiddle">' . $langs->trans('AmountHT') . '</td>';
3329
-		print '<td class="nowrap amountcard right">' . price($object->total_ht, 0, $langs, 1, -1, -1, $conf->currency) . '</td>';
3328
+		print '<td class="titlefieldmiddle">'.$langs->trans('AmountHT').'</td>';
3329
+		print '<td class="nowrap amountcard right">'.price($object->total_ht, 0, $langs, 1, -1, -1, $conf->currency).'</td>';
3330 3330
 		if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
3331
-			print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_ht, 0, $langs, 1, -1, -1, $object->multicurrency_code) . '</td>';
3331
+			print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_ht, 0, $langs, 1, -1, -1, $object->multicurrency_code).'</td>';
3332 3332
 		}
3333 3333
 		print '</tr>';
3334 3334
 
3335 3335
 		print '<tr>';
3336
-		print '<td>' . $langs->trans('AmountVAT') . '</td>';
3337
-		print '<td class="nowrap amountcard right">' . price($object->total_tva, 0, $langs, 1, -1, -1, $conf->currency) . '</td>';
3336
+		print '<td>'.$langs->trans('AmountVAT').'</td>';
3337
+		print '<td class="nowrap amountcard right">'.price($object->total_tva, 0, $langs, 1, -1, -1, $conf->currency).'</td>';
3338 3338
 		if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
3339
-			print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_tva, 0, $langs, 1, -1, -1, $object->multicurrency_code) . '</td>';
3339
+			print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_tva, 0, $langs, 1, -1, -1, $object->multicurrency_code).'</td>';
3340 3340
 		}
3341 3341
 		print '</tr>';
3342 3342
 
3343 3343
 		if ($mysoc->localtax1_assuj == "1" || $object->total_localtax1 != 0) {
3344 3344
 			print '<tr>';
3345
-			print '<td>' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '</td>';
3346
-			print '<td class="nowrap amountcard right">' . price($object->total_localtax1, 0, $langs, 1, -1, -1, $conf->currency) . '</td>';
3345
+			print '<td>'.$langs->transcountry("AmountLT1", $mysoc->country_code).'</td>';
3346
+			print '<td class="nowrap amountcard right">'.price($object->total_localtax1, 0, $langs, 1, -1, -1, $conf->currency).'</td>';
3347 3347
 			if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
3348 3348
 				$object->multicurrency_total_localtax1 = price2num($object->total_localtax1 * $object->multicurrency_tx, 'MT');
3349 3349
 
3350
-				print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_localtax1, 0, $langs, 1, -1, -1, $object->multicurrency_code) . '</td>';
3350
+				print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_localtax1, 0, $langs, 1, -1, -1, $object->multicurrency_code).'</td>';
3351 3351
 			}
3352 3352
 			print '</tr>';
3353 3353
 		}
3354 3354
 
3355 3355
 		if ($mysoc->localtax2_assuj == "1" || $object->total_localtax2 != 0) {
3356 3356
 			print '<tr>';
3357
-			print '<td>' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '</td>';
3358
-			print '<td class="nowrap amountcard right">' . price($object->total_localtax2, 0, $langs, 1, -1, -1, $conf->currency) . '</td>';
3357
+			print '<td>'.$langs->transcountry("AmountLT2", $mysoc->country_code).'</td>';
3358
+			print '<td class="nowrap amountcard right">'.price($object->total_localtax2, 0, $langs, 1, -1, -1, $conf->currency).'</td>';
3359 3359
 			if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
3360 3360
 				$object->multicurrency_total_localtax2 = price2num($object->total_localtax2 * $object->multicurrency_tx, 'MT');
3361 3361
 
3362
-				print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_localtax2, 0, $langs, 1, -1, -1, $object->multicurrency_code) . '</td>';
3362
+				print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_localtax2, 0, $langs, 1, -1, -1, $object->multicurrency_code).'</td>';
3363 3363
 			}
3364 3364
 			print '</tr>';
3365 3365
 		}
3366 3366
 
3367 3367
 		print '<tr>';
3368
-		print '<td>' . $langs->trans('AmountTTC') . '</td>';
3369
-		print '<td class="nowrap amountcard right">' . price($object->total_ttc, 0, $langs, 1, -1, -1, $conf->currency) . '</td>';
3368
+		print '<td>'.$langs->trans('AmountTTC').'</td>';
3369
+		print '<td class="nowrap amountcard right">'.price($object->total_ttc, 0, $langs, 1, -1, -1, $conf->currency).'</td>';
3370 3370
 		if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
3371
-			print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_ttc, 0, $langs, 1, -1, -1, $object->multicurrency_code) . '</td>';
3371
+			print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_ttc, 0, $langs, 1, -1, -1, $object->multicurrency_code).'</td>';
3372 3372
 		}
3373 3373
 		print '</tr>';
3374 3374
 
@@ -3387,13 +3387,13 @@  discard block
 block discarded – undo
3387 3387
 		if (getDolGlobalString('MAIN_DISABLE_CONTACTS_TAB')) {
3388 3388
 			$blocname = 'contacts';
3389 3389
 			$title = $langs->trans('ContactsAddresses');
3390
-			include DOL_DOCUMENT_ROOT . '/core/tpl/bloc_showhide.tpl.php';
3390
+			include DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php';
3391 3391
 		}
3392 3392
 
3393 3393
 		if (getDolGlobalString('MAIN_DISABLE_NOTES_TAB')) {
3394 3394
 			$blocname = 'notes';
3395 3395
 			$title = $langs->trans('Notes');
3396
-			include DOL_DOCUMENT_ROOT . '/core/tpl/bloc_showhide.tpl.php';
3396
+			include DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php';
3397 3397
 		}
3398 3398
 
3399 3399
 		/*
@@ -3408,20 +3408,20 @@  discard block
 block discarded – undo
3408 3408
 		global $inputalsopricewithtax;
3409 3409
 		$inputalsopricewithtax = 1;
3410 3410
 
3411
-		print '	<form name="addproduct" id="addproduct" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '" method="POST">
3412
-		<input type="hidden" name="token" value="' . newToken() . '">
3413
-		<input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline') . '">
3411
+		print '	<form name="addproduct" id="addproduct" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="POST">
3412
+		<input type="hidden" name="token" value="' . newToken().'">
3413
+		<input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline').'">
3414 3414
 		<input type="hidden" name="mode" value="">
3415 3415
 		<input type="hidden" name="page_y" value="">
3416
-		<input type="hidden" name="backtopage" value="' . $backtopage . '">
3417
-		<input type="hidden" name="id" value="' . $object->id . '">
3416
+		<input type="hidden" name="backtopage" value="' . $backtopage.'">
3417
+		<input type="hidden" name="id" value="' . $object->id.'">
3418 3418
 		';
3419 3419
 
3420 3420
 		if (!empty($conf->use_javascript_ajax) && $object->status == Propal::STATUS_DRAFT) {
3421 3421
 			if (isModEnabled('subtotals')) {
3422
-				include DOL_DOCUMENT_ROOT . '/core/tpl/subtotal_ajaxrow.tpl.php';
3422
+				include DOL_DOCUMENT_ROOT.'/core/tpl/subtotal_ajaxrow.tpl.php';
3423 3423
 			} else {
3424
-				include DOL_DOCUMENT_ROOT . '/core/tpl/ajaxrow.tpl.php';
3424
+				include DOL_DOCUMENT_ROOT.'/core/tpl/ajaxrow.tpl.php';
3425 3425
 			}
3426 3426
 		}
3427 3427
 
@@ -3476,7 +3476,7 @@  discard block
 block discarded – undo
3476 3476
 		if (empty($reshook)) {
3477 3477
 			if ($action != 'editline') {
3478 3478
 				// Subtotal
3479
-				if ($object->status == Propal::STATUS_DRAFT && isModEnabled('subtotals') && getDolGlobalString('SUBTOTAL_TITLE_' . strtoupper($object->element))) {
3479
+				if ($object->status == Propal::STATUS_DRAFT && isModEnabled('subtotals') && getDolGlobalString('SUBTOTAL_TITLE_'.strtoupper($object->element))) {
3480 3480
 					$langs->load('subtotals');
3481 3481
 
3482 3482
 					$url_button = array();
@@ -3486,7 +3486,7 @@  discard block
 block discarded – undo
3486 3486
 						'enabled' => (isModEnabled('propal') && $object->status == Propal::STATUS_DRAFT),
3487 3487
 						'perm' => (bool) $usercancreate,
3488 3488
 						'label' => $langs->trans('AddTitleLine'),
3489
-						'url' => '/comm/propal/card.php?id=' . $object->id . '&action=add_title_line&token=' . newToken()
3489
+						'url' => '/comm/propal/card.php?id='.$object->id.'&action=add_title_line&token='.newToken()
3490 3490
 					);
3491 3491
 
3492 3492
 					$url_button[] = array(
@@ -3494,7 +3494,7 @@  discard block
 block discarded – undo
3494 3494
 						'enabled' => (isModEnabled('propal') && $object->status == Propal::STATUS_DRAFT),
3495 3495
 						'perm' => (bool) $usercancreate,
3496 3496
 						'label' => $langs->trans('AddSubtotalLine'),
3497
-						'url' => '/comm/propal/card.php?id=' . $object->id . '&action=add_subtotal_line&token=' . newToken()
3497
+						'url' => '/comm/propal/card.php?id='.$object->id.'&action=add_subtotal_line&token='.newToken()
3498 3498
 					);
3499 3499
 
3500 3500
 					print dolGetButtonAction('', $langs->trans('Subtotal'), 'default', $url_button, '', true);
@@ -3505,9 +3505,9 @@  discard block
 block discarded – undo
3505 3505
 					|| ($object->status == Propal::STATUS_DRAFT && getDolGlobalString('PROPAL_ENABLE_NEGATIVE') && count($object->lines) > 0)
3506 3506
 				) {
3507 3507
 					if ($usercanvalidate) {
3508
-						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>';
3508
+						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>';
3509 3509
 					} else {
3510
-						print '<a class="butActionRefused classfortooltip" href="#">' . $langs->trans('Validate') . '</a>';
3510
+						print '<a class="butActionRefused classfortooltip" href="#">'.$langs->trans('Validate').'</a>';
3511 3511
 					}
3512 3512
 				}
3513 3513
 				// Create event
@@ -3517,23 +3517,23 @@  discard block
 block discarded – undo
3517 3517
 				}*/
3518 3518
 				// Edit
3519 3519
 				if ($object->status == Propal::STATUS_VALIDATED && $usercancreate) {
3520
-					print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=modif&token=' . newToken() . '">' . $langs->trans('Modify') . '</a>';
3520
+					print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=modif&token='.newToken().'">'.$langs->trans('Modify').'</a>';
3521 3521
 				}
3522 3522
 
3523 3523
 				// ReOpen
3524 3524
 				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)))) {
3525 3525
 					if ($usercanreopen) {
3526
-						print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=reopen&token=' . newToken() . (!getDolGlobalString('MAIN_JUMP_TAG') ? '' : '#reopen') . '"';
3527
-						print '>' . $langs->trans('ReOpen') . '</a>';
3526
+						print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=reopen&token='.newToken().(!getDolGlobalString('MAIN_JUMP_TAG') ? '' : '#reopen').'"';
3527
+						print '>'.$langs->trans('ReOpen').'</a>';
3528 3528
 					} else {
3529
-						print '<a class="butActionRefused classfortooltip" href="#" title="' . $langs->trans("NotEnoughPermissions") . '">' . $langs->trans("ReOpen") . '</a>';
3529
+						print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("NotEnoughPermissions").'">'.$langs->trans("ReOpen").'</a>';
3530 3530
 					}
3531 3531
 				}
3532 3532
 
3533 3533
 				// Send
3534 3534
 				if (empty($user->socid)) {
3535 3535
 					if ($object->status == Propal::STATUS_VALIDATED || $object->status == Propal::STATUS_SIGNED || getDolGlobalString('PROPOSAL_SENDBYEMAIL_FOR_ALL_STATUS')) {
3536
-						print dolGetButtonAction('', $langs->trans('SendMail'), 'default', $_SERVER["PHP_SELF"] . '?action=presend&token=' . newToken() . '&id=' . $object->id . '&mode=init#formmailbeforetitle', '', $usercansend);
3536
+						print dolGetButtonAction('', $langs->trans('SendMail'), 'default', $_SERVER["PHP_SELF"].'?action=presend&token='.newToken().'&id='.$object->id.'&mode=init#formmailbeforetitle', '', $usercansend);
3537 3537
 					}
3538 3538
 				}
3539 3539
 
@@ -3545,7 +3545,7 @@  discard block
 block discarded – undo
3545 3545
 					'enabled' => (isModEnabled('order') && $object->status == Propal::STATUS_SIGNED),
3546 3546
 					'perm' => $usercancreateorder,
3547 3547
 					'label' => 'AddOrder',
3548
-					'url' => '/commande/card.php?action=create&origin=' . urlencode($object->element) . '&originid=' . ((int) $object->id) . '&socid=' . ((int) $object->socid)
3548
+					'url' => '/commande/card.php?action=create&origin='.urlencode($object->element).'&originid='.((int) $object->id).'&socid='.((int) $object->socid)
3549 3549
 				);
3550 3550
 				/*if (isModEnabled('order') && $object->status == Propal::STATUS_SIGNED) {
3551 3551
 					if ($usercancreateorder) {
@@ -3560,7 +3560,7 @@  discard block
 block discarded – undo
3560 3560
 						'enabled' => ($object->status == Propal::STATUS_SIGNED && isModEnabled("supplier_order")),
3561 3561
 						'perm' => $usercancreatepurchaseorder,
3562 3562
 						'label' => 'AddPurchaseOrder',
3563
-						'url' => '/fourn/commande/card.php?action=create&origin=' . urlencode($object->element) . '&originid=' . ((int) $object->id) . '&socid=' . ((int) $object->socid)
3563
+						'url' => '/fourn/commande/card.php?action=create&origin='.urlencode($object->element).'&originid='.((int) $object->id).'&socid='.((int) $object->socid)
3564 3564
 					);
3565 3565
 					/*if ($object->status == Propal::STATUS_SIGNED && isModEnabled("supplier_order")) {
3566 3566
 						if ($usercancreatepurchaseorder) {
@@ -3575,7 +3575,7 @@  discard block
 block discarded – undo
3575 3575
 					'enabled' => (isModEnabled("service") && isModEnabled('intervention') && $object->status == Propal::STATUS_SIGNED),
3576 3576
 					'perm' => $usercancreateintervention,
3577 3577
 					'label' => 'AddIntervention',
3578
-					'url' => '/fichinter/card.php?action=create&origin=' . urlencode($object->element) . '&originid=' . ((int) $object->id) . '&socid=' . ((int) $object->socid)
3578
+					'url' => '/fichinter/card.php?action=create&origin='.urlencode($object->element).'&originid='.((int) $object->id).'&socid='.((int) $object->socid)
3579 3579
 				);
3580 3580
 				/*if (isModEnabled("service") && isModEnabled('intervention') && $object->status == Propal::STATUS_SIGNED) {
3581 3581
 					if ($usercancreateintervention) {
@@ -3590,7 +3590,7 @@  discard block
 block discarded – undo
3590 3590
 					'enabled' => (isModEnabled('contract') && $object->status == Propal::STATUS_SIGNED),
3591 3591
 					'perm' => $usercancreatecontract,
3592 3592
 					'label' => 'AddContract',
3593
-					'url' => '/contrat/card.php?action=create&origin=' . urlencode($object->element) . '&originid=' . ((int) $object->id) . '&socid=' . ((int) $object->socid)
3593
+					'url' => '/contrat/card.php?action=create&origin='.urlencode($object->element).'&originid='.((int) $object->id).'&socid='.((int) $object->socid)
3594 3594
 				);
3595 3595
 				/*if (isModEnabled('contract') && $object->status == Propal::STATUS_SIGNED) {
3596 3596
 					$langs->load("contracts");
@@ -3607,7 +3607,7 @@  discard block
 block discarded – undo
3607 3607
 						'enabled' => isModEnabled('invoice'),
3608 3608
 						'perm' => $usercancreateinvoice,
3609 3609
 						'label' => 'CreateBill',
3610
-						'url' => '/compta/facture/card.php?action=create&origin=' . urlencode($object->element) . '&originid=' . ((int) $object->id) . '&socid=' . ((int) $object->socid),
3610
+						'url' => '/compta/facture/card.php?action=create&origin='.urlencode($object->element).'&originid='.((int) $object->id).'&socid='.((int) $object->socid),
3611 3611
 					];
3612 3612
 					/*if (isModEnabled('invoice') && $usercancreateinvoice) {
3613 3613
 						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>';
@@ -3616,7 +3616,7 @@  discard block
 block discarded – undo
3616 3616
 
3617 3617
 				$actionButtonsParameters = [
3618 3618
 					"areDropdownButtons" => !getDolGlobalInt("MAIN_REMOVE_DROPDOWN_CREATE_BUTTONS_ON_ORDER"),
3619
-					"backtopage" => $_SERVER["PHP_SELF"] . "?id=" . ((int) $id)
3619
+					"backtopage" => $_SERVER["PHP_SELF"]."?id=".((int) $id)
3620 3620
 				];
3621 3621
 
3622 3622
 				if ($numlines > 0) {
@@ -3629,9 +3629,9 @@  discard block
 block discarded – undo
3629 3629
 					$arrayofinvoiceforpropal = $object->getInvoiceArrayList();
3630 3630
 					if ((is_array($arrayofinvoiceforpropal) && count($arrayofinvoiceforpropal) > 0) || !getDolGlobalString('WORKFLOW_PROPAL_NEED_INVOICE_TO_BE_CLASSIFIED_BILLED')) {
3631 3631
 						if ($usercanclose) {
3632
-							print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=classifybilled&token=' . newToken() . '&socid=' . $object->socid . '">' . $langs->trans("ClassifyBilled") . '</a>';
3632
+							print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=classifybilled&token='.newToken().'&socid='.$object->socid.'">'.$langs->trans("ClassifyBilled").'</a>';
3633 3633
 						} else {
3634
-							print '<a class="butActionRefused classfortooltip" href="#" title="' . $langs->trans("NotEnoughPermissions") . '">' . $langs->trans("ClassifyBilled") . '</a>';
3634
+							print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("NotEnoughPermissions").'">'.$langs->trans("ClassifyBilled").'</a>';
3635 3635
 						}
3636 3636
 					}
3637 3637
 				}
@@ -3640,33 +3640,33 @@  discard block
 block discarded – undo
3640 3640
 					// Close as accepted/refused
3641 3641
 					if ($object->status == Propal::STATUS_VALIDATED) {
3642 3642
 						if ($usercanclose) {
3643
-							print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=closeas&token=' . newToken() . (!getDolGlobalString('MAIN_JUMP_TAG') ? '' : '#close') . '"';
3644
-							print '>' . $langs->trans('SetAcceptedRefused') . '</a>';
3643
+							print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=closeas&token='.newToken().(!getDolGlobalString('MAIN_JUMP_TAG') ? '' : '#close').'"';
3644
+							print '>'.$langs->trans('SetAcceptedRefused').'</a>';
3645 3645
 						} else {
3646
-							print '<a class="butActionRefused classfortooltip" href="#" title="' . $langs->trans("NotEnoughPermissions") . '"';
3647
-							print '>' . $langs->trans('SetAcceptedRefused') . '</a>';
3646
+							print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("NotEnoughPermissions").'"';
3647
+							print '>'.$langs->trans('SetAcceptedRefused').'</a>';
3648 3648
 						}
3649 3649
 					}
3650 3650
 				} else {
3651 3651
 					// Set not signed (close)
3652 3652
 					if ($object->status == Propal::STATUS_DRAFT && $usercanclose) {
3653
-						print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&token=' . newToken() . '&action=closeas&token=' . newToken() . (!getDolGlobalString('MAIN_JUMP_TAG') ? '' : '#close') . '"';
3654
-						print '>' . $langs->trans('SetRefusedAndClose') . '</a>';
3653
+						print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&token='.newToken().'&action=closeas&token='.newToken().(!getDolGlobalString('MAIN_JUMP_TAG') ? '' : '#close').'"';
3654
+						print '>'.$langs->trans('SetRefusedAndClose').'</a>';
3655 3655
 					}
3656 3656
 				}
3657 3657
 
3658 3658
 				// Cancel propal
3659 3659
 				if ($object->status > Propal::STATUS_DRAFT && $usercanclose) {
3660
-					print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=cancel&token=' . newToken() . '">' . $langs->trans("CancelPropal") . '</a>';
3660
+					print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=cancel&token='.newToken().'">'.$langs->trans("CancelPropal").'</a>';
3661 3661
 				}
3662 3662
 
3663 3663
 				// Clone
3664 3664
 				if ($usercancreate) {
3665
-					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>';
3665
+					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>';
3666 3666
 				}
3667 3667
 
3668 3668
 				// Delete
3669
-				print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=delete&token=' . newToken(), 'delete', $usercandelete);
3669
+				print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', $usercandelete);
3670 3670
 			}
3671 3671
 		}
3672 3672
 
@@ -3685,8 +3685,8 @@  discard block
 block discarded – undo
3685 3685
 		 * Generated documents
3686 3686
 		 */
3687 3687
 		$objref = dol_sanitizeFileName($object->ref);
3688
-		$filedir = $conf->propal->multidir_output[$object->entity ?? $conf->entity] . "/" . dol_sanitizeFileName($object->ref);
3689
-		$urlsource = $_SERVER["PHP_SELF"] . "?id=" . $object->id;
3688
+		$filedir = $conf->propal->multidir_output[$object->entity ?? $conf->entity]."/".dol_sanitizeFileName($object->ref);
3689
+		$urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id;
3690 3690
 		$genallowed = $usercanread;
3691 3691
 		$delallowed = $usercancreate;
3692 3692
 
@@ -3709,19 +3709,19 @@  discard block
 block discarded – undo
3709 3709
 
3710 3710
 		if ($object->status != Propal::STATUS_DRAFT && $useonlinesignature) {
3711 3711
 			print '<br><!-- Link to sign -->';
3712
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/signature.lib.php';
3713
-			print showOnlineSignatureUrl('proposal', $object->ref, $object) . '<br>';
3712
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/signature.lib.php';
3713
+			print showOnlineSignatureUrl('proposal', $object->ref, $object).'<br>';
3714 3714
 		}
3715 3715
 
3716 3716
 		print '</div><div class="fichehalfright">';
3717 3717
 
3718 3718
 		$MAXEVENT = 10;
3719 3719
 
3720
-		$morehtmlcenter = dolGetButtonTitle($langs->trans('FullConversation'), '', 'fa fa-comments imgforviewmode', DOL_URL_ROOT . '/comm/propal/messaging.php?id=' . $object->id);
3721
-		$morehtmlcenter .= dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', DOL_URL_ROOT . '/comm/propal/agenda.php?id=' . $object->id);
3720
+		$morehtmlcenter = dolGetButtonTitle($langs->trans('FullConversation'), '', 'fa fa-comments imgforviewmode', DOL_URL_ROOT.'/comm/propal/messaging.php?id='.$object->id);
3721
+		$morehtmlcenter .= dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', DOL_URL_ROOT.'/comm/propal/agenda.php?id='.$object->id);
3722 3722
 
3723 3723
 		// List of actions on element
3724
-		include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
3724
+		include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
3725 3725
 		$formactions = new FormActions($db);
3726 3726
 		$somethingshown = $formactions->showactions($object, 'propal', $socid, 1, '', $MAXEVENT, '', $morehtmlcenter); // Show all action for thirdparty
3727 3727
 
@@ -3732,9 +3732,9 @@  discard block
 block discarded – undo
3732 3732
 	$modelmail = 'propal_send';
3733 3733
 	$defaulttopic = 'SendPropalRef';
3734 3734
 	$diroutput = $conf->propal->multidir_output[$object->entity ?? $conf->entity];
3735
-	$trackid = 'pro' . $object->id;
3735
+	$trackid = 'pro'.$object->id;
3736 3736
 
3737
-	include DOL_DOCUMENT_ROOT . '/core/tpl/card_presend.tpl.php';
3737
+	include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php';
3738 3738
 }
3739 3739
 
3740 3740
 // End of page
Please login to merge, or discard this patch.
htdocs/comm/action/card.php 1 patch
Spacing   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 $offsetunit = GETPOST('offsetunittype_duration', 'aZ09');
83 83
 $remindertype = GETPOST('selectremindertype', 'aZ09');
84 84
 $modelmail = GETPOSTINT('actioncommsendmodel_mail');
85
-$complete = GETPOST('complete', 'alpha');	// 'na' must be allowed
85
+$complete = GETPOST('complete', 'alpha'); // 'na' must be allowed
86 86
 $private = GETPOST('private', 'alphanohtml');
87 87
 if ($complete == 'na' || $complete == -2) {
88 88
 	$complete = -1;
@@ -576,7 +576,7 @@  discard block
 block discarded – undo
576 576
 				if (is_array($listofresourceid) && count($listofresourceid)) {
577 577
 					foreach ($listofresourceid as $resource_id => $val) {
578 578
 						$resource_type = 'dolresource';
579
-						$busy = 1;//GETPOSTINT('busy');
579
+						$busy = 1; //GETPOSTINT('busy');
580 580
 
581 581
 						// Resources association
582 582
 						if (getDolGlobalString('RESOURCE_USED_IN_EVENT_CHECK')) {
@@ -592,24 +592,24 @@  discard block
 block discarded – undo
592 592
 							}
593 593
 
594 594
 							$sql = "SELECT er.rowid, r.ref as r_ref, ac.id as ac_id, ac.label as ac_label";
595
-							$sql .= " FROM " . MAIN_DB_PREFIX . "element_resources as er";
596
-							$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "resource as r ON r.rowid = er.resource_id AND er.resource_type = '" . $db->escape($resource_type) . "'";
597
-							$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "actioncomm as ac ON ac.id = er.element_id AND er.element_type = '" . $db->escape($object->element) . "'";
598
-							$sql .= " WHERE er.resource_id = " . ((int) $resource_id);
595
+							$sql .= " FROM ".MAIN_DB_PREFIX."element_resources as er";
596
+							$sql .= " INNER JOIN ".MAIN_DB_PREFIX."resource as r ON r.rowid = er.resource_id AND er.resource_type = '".$db->escape($resource_type)."'";
597
+							$sql .= " INNER JOIN ".MAIN_DB_PREFIX."actioncomm as ac ON ac.id = er.element_id AND er.element_type = '".$db->escape($object->element)."'";
598
+							$sql .= " WHERE er.resource_id = ".((int) $resource_id);
599 599
 							$sql .= " AND er.busy = 1";
600 600
 							$sql .= " AND (";
601 601
 
602 602
 							// event date start between ac.datep and ac.datep2 (if datep2 is null we consider there is no end)
603
-							$sql .= " (ac.datep <= '" . $db->idate($eventDateStart) . "' AND (ac.datep2 IS NULL OR ac.datep2 >= '" . $db->idate($eventDateStart) . "'))";
603
+							$sql .= " (ac.datep <= '".$db->idate($eventDateStart)."' AND (ac.datep2 IS NULL OR ac.datep2 >= '".$db->idate($eventDateStart)."'))";
604 604
 							// event date end between ac.datep and ac.datep2
605 605
 							if (!empty($eventDateEnd)) {
606
-								$sql .= " OR (ac.datep <= '" . $db->idate($eventDateEnd) . "' AND (ac.datep2 >= '" . $db->idate($eventDateEnd) . "'))";
606
+								$sql .= " OR (ac.datep <= '".$db->idate($eventDateEnd)."' AND (ac.datep2 >= '".$db->idate($eventDateEnd)."'))";
607 607
 							}
608 608
 							// event date start before ac.datep and event date end after ac.datep2
609 609
 							$sql .= " OR (";
610
-							$sql .= "ac.datep >= '" . $db->idate($eventDateStart) . "'";
610
+							$sql .= "ac.datep >= '".$db->idate($eventDateStart)."'";
611 611
 							if (!empty($eventDateEnd)) {
612
-								$sql .= " AND (ac.datep2 IS NOT NULL AND ac.datep2 <= '" . $db->idate($eventDateEnd) . "')";
612
+								$sql .= " AND (ac.datep2 IS NOT NULL AND ac.datep2 <= '".$db->idate($eventDateEnd)."')";
613 613
 							}
614 614
 							$sql .= ")";
615 615
 
@@ -623,9 +623,9 @@  discard block
 block discarded – undo
623 623
 								if ($db->num_rows($resql) > 0) {
624 624
 									// Resource already in use
625 625
 									$error++;
626
-									$object->error = $langs->trans('ErrorResourcesAlreadyInUse') . ' : ';
626
+									$object->error = $langs->trans('ErrorResourcesAlreadyInUse').' : ';
627 627
 									while ($obj = $db->fetch_object($resql)) {
628
-										$object->error .= '<br> - ' . $langs->trans('ErrorResourceUseInEvent', $obj->r_ref, $obj->ac_label . ' [' . $obj->ac_id . ']');
628
+										$object->error .= '<br> - '.$langs->trans('ErrorResourceUseInEvent', $obj->r_ref, $obj->ac_label.' ['.$obj->ac_id.']');
629 629
 									}
630 630
 									$object->errors[] = $object->error;
631 631
 
@@ -736,12 +736,12 @@  discard block
 block discarded – undo
736 736
 			if ($selectedrecurrulefreq == 'WEEKLY' && !empty($selectedrecurrulebyday)) {
737 737
 				$firstdatearray = dol_get_first_day_week(GETPOSTINT("apday"), GETPOSTINT("apmonth"), GETPOSTINT("apyear"));
738 738
 				$datep = dol_mktime($fulldayevent ? 0 : GETPOSTINT("aphour"), $fulldayevent ? 0 : GETPOSTINT("apmin"), $fulldayevent ? 0 : GETPOSTINT("apsec"), $firstdatearray['month'], $firstdatearray['first_day'], $firstdatearray['year'], $tzforfullday ? $tzforfullday : 'tzuserrel');
739
-				$datep = dol_time_plus_duree($datep, $selectedrecurrulebyday + 6, 'd');//We begin the week after
739
+				$datep = dol_time_plus_duree($datep, $selectedrecurrulebyday + 6, 'd'); //We begin the week after
740 740
 				$dayoffset = 7;
741 741
 				$monthoffset = 0;
742 742
 			} elseif ($selectedrecurrulefreq == 'MONTHLY' && !empty($selectedrecurrulebymonthday)) {
743 743
 				$firstday = $selectedrecurrulebymonthday;
744
-				$firstmonth = GETPOST("apday") > $selectedrecurrulebymonthday ? GETPOSTINT("apmonth") + 1 : GETPOSTINT("apmonth");//We begin the week after
744
+				$firstmonth = GETPOST("apday") > $selectedrecurrulebymonthday ? GETPOSTINT("apmonth") + 1 : GETPOSTINT("apmonth"); //We begin the week after
745 745
 				$datep = dol_mktime($fulldayevent ? 0 : GETPOSTINT("aphour"), $fulldayevent ? 0 : GETPOSTINT("apmin"), $fulldayevent ? 0 : GETPOSTINT("apsec"), $firstmonth, $firstday, GETPOSTINT("apyear"), $tzforfullday ? $tzforfullday : 'tzuserrel');
746 746
 				$dayoffset = 0;
747 747
 				$monthoffset = 1;
@@ -845,9 +845,9 @@  discard block
 block discarded – undo
845 845
 
846 846
 				// increment date for recurrent events
847 847
 				$datep = dol_time_plus_duree($datep, $dayoffset, 'd');
848
-				$datep = dol_time_plus_duree($datep, $monthoffset, 'm');  // @phan-suppress-current-line PhanPluginSuspiciousParamOrder
848
+				$datep = dol_time_plus_duree($datep, $monthoffset, 'm'); // @phan-suppress-current-line PhanPluginSuspiciousParamOrder
849 849
 				$datef = dol_time_plus_duree($datef, $dayoffset, 'd');
850
-				$datef = dol_time_plus_duree($datef, $monthoffset, 'm');  // @phan-suppress-current-line PhanPluginSuspiciousParamOrder
850
+				$datef = dol_time_plus_duree($datef, $monthoffset, 'm'); // @phan-suppress-current-line PhanPluginSuspiciousParamOrder
851 851
 			}
852 852
 		}
853 853
 		if (!empty($backtopage) && !$error) {
@@ -889,7 +889,7 @@  discard block
 block discarded – undo
889 889
 		$object->fetch($id);
890 890
 		$object->fetch_optionals();
891 891
 		$object->fetch_userassigned();
892
-		$object->oldcopy = dol_clone($object, 2);  // @phan-suppress-current-line PhanTypeMismatchProperty
892
+		$object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty
893 893
 
894 894
 		// Clean parameters
895 895
 		if ($fulldayevent) {
@@ -1189,7 +1189,7 @@  discard block
 block discarded – undo
1189 1189
 	$object->fetch($id);
1190 1190
 	$object->fetch_optionals();
1191 1191
 	$object->fetch_userassigned();
1192
-	$object->oldcopy = dol_clone($object, 2);  // @phan-suppress-current-line PhanTypeMismatchProperty
1192
+	$object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty
1193 1193
 
1194 1194
 	if ($user->hasRight('agenda', 'myactions', 'delete')
1195 1195
 		|| $user->hasRight('agenda', 'allactions', 'delete')) {
@@ -1211,7 +1211,7 @@  discard block
 block discarded – undo
1211 1211
 if (empty($reshook) && GETPOST('actionmove', 'alpha') == 'mupdate' && $usercancreate) {
1212 1212
 	$error = 0;
1213 1213
 
1214
-	$shour = (int) dol_print_date($object->datep, "%H", 'tzuserrel');		// We take the date visible by user $newdate is also date visible by user.
1214
+	$shour = (int) dol_print_date($object->datep, "%H", 'tzuserrel'); // We take the date visible by user $newdate is also date visible by user.
1215 1215
 	$smin = (int) dol_print_date($object->datep, "%M", 'tzuserrel');
1216 1216
 
1217 1217
 	$newdate = GETPOST('newdate', 'alpha');
@@ -1385,7 +1385,7 @@  discard block
 block discarded – undo
1385 1385
 								if (new_startdate > old_enddate) {
1386 1386
 									var timeDiff = old_enddate - old_startdate;
1387 1387
 									var new_enddate = new Date(new_startdate.getTime() + timeDiff);
1388
-									$("#p2").val(formatDate(new_enddate, "' . $langs->trans('FormatDateShortJavaInput') . '"));
1388
+									$("#p2").val(formatDate(new_enddate, "' . $langs->trans('FormatDateShortJavaInput').'"));
1389 1389
 									$("#p2day").val(new_enddate.getDate());
1390 1390
 									$("#p2month").val(new_enddate.getMonth() + 1);
1391 1391
 									$("#p2year").val(new_enddate.getFullYear());
@@ -1453,7 +1453,7 @@  discard block
 block discarded – undo
1453 1453
 		$default = getDolGlobalString('AGENDA_USE_EVENT_TYPE_DEFAULT', 'AC_RDV');
1454 1454
 		print img_picto($langs->trans("ActionType"), 'square', 'class="fawidth30 inline-block" style="color: #ddd;"');
1455 1455
 		$selectedvalue = GETPOSTISSET("actioncode") ? GETPOST("actioncode", 'aZ09') : ($object->type_code ? $object->type_code : $default);
1456
-		print $formactions->select_type_actions($selectedvalue, "actioncode", "systemauto", 0, -1, 0, 1);	// TODO Replace 0 with -2 in onlyautoornot
1456
+		print $formactions->select_type_actions($selectedvalue, "actioncode", "systemauto", 0, -1, 0, 1); // TODO Replace 0 with -2 in onlyautoornot
1457 1457
 		print '</td></tr>';
1458 1458
 	}
1459 1459
 
@@ -1538,7 +1538,7 @@  discard block
 block discarded – undo
1538 1538
 		*/
1539 1539
 
1540 1540
 		// limit date
1541
-		$repeateventlimitdate = empty($repeateventlimitdate) ?  (dol_now() + ((24 * 3600 * 365) + 1)) : $repeateventlimitdate;
1541
+		$repeateventlimitdate = empty($repeateventlimitdate) ? (dol_now() + ((24 * 3600 * 365) + 1)) : $repeateventlimitdate;
1542 1542
 
1543 1543
 		print '<div class="hidden marginrightonly inline-block repeateventlimitdate">';
1544 1544
 		print $langs->trans("Until")." ";
@@ -1803,7 +1803,7 @@  discard block
 block discarded – undo
1803 1803
 		}
1804 1804
 		//var_dump('origin='.$origin.' originid='.$originid.' hasPermissionOnLinkedObject='.$hasPermissionOnLinkedObject);
1805 1805
 
1806
-		if (! in_array($origin, array('societe', 'project', 'task', 'user'))) {
1806
+		if (!in_array($origin, array('societe', 'project', 'task', 'user'))) {
1807 1807
 			// We do not use link for object that already contains a hard coded field to make links with agenda events
1808 1808
 			print '<tr><td class="titlefieldcreate">'.$langs->trans("LinkedObject").'</td>';
1809 1809
 			print '<td colspan="3">';
@@ -1892,7 +1892,7 @@  discard block
 block discarded – undo
1892 1892
 						$("#addreminder").prop("checked", true);
1893 1893
 
1894 1894
 						// Set period with default reminder period
1895
-						$("[name=\"offsetvalue\"]").val(\'' . dol_escape_js((string) $reminderDefaultOffset) . '\');
1895
+						$("[name=\"offsetvalue\"]").val(\'' . dol_escape_js((string) $reminderDefaultOffset).'\');
1896 1896
 						$("#select_offsetunittype_duration").select2("destroy");
1897 1897
 						$("#select_offsetunittype_duration").val(\''.dol_escape_js($reminderDefaultUnit).'\');
1898 1898
 						$("#select_offsetunittype_duration").select2();
@@ -2052,7 +2052,7 @@  discard block
 block discarded – undo
2052 2052
 									if (new_startdate > old_enddate) {
2053 2053
 										var timeDiff = old_enddate - old_startdate;
2054 2054
 										var new_enddate = new Date(new_startdate.getTime() + timeDiff);
2055
-										$("#p2").val(formatDate(new_enddate, "' . $langs->trans('FormatDateShortJavaInput') . '"));
2055
+										$("#p2").val(formatDate(new_enddate, "' . $langs->trans('FormatDateShortJavaInput').'"));
2056 2056
 										$("#p2day").val(new_enddate.getDate());
2057 2057
 										$("#p2month").val(new_enddate.getMonth() + 1);
2058 2058
 										$("#p2year").val(new_enddate.getFullYear());
@@ -2077,7 +2077,7 @@  discard block
 block discarded – undo
2077 2077
 		if ($backtopage) {
2078 2078
 			print '<input type="hidden" name="backtopage" value="'.($backtopage != '1' ? $backtopage : '').'">';
2079 2079
 		}
2080
-		if (!getDolGlobalString('AGENDA_USE_EVENT_TYPE') && ! preg_match('/^TICKET_MSG_PRIVATE/', $object->code)) {
2080
+		if (!getDolGlobalString('AGENDA_USE_EVENT_TYPE') && !preg_match('/^TICKET_MSG_PRIVATE/', $object->code)) {
2081 2081
 			print '<input type="hidden" name="actioncode" value="'.$object->type_code.'">';
2082 2082
 		}
2083 2083
 
@@ -2523,7 +2523,7 @@  discard block
 block discarded – undo
2523 2523
 					});
2524 2524
 			   })';
2525 2525
 			print '</script>'."\n";
2526
-			print '</div>';		// End of div for reminderparameters
2526
+			print '</div>'; // End of div for reminderparameters
2527 2527
 		}
2528 2528
 
2529 2529
 		print dol_get_fiche_end();
@@ -2801,7 +2801,7 @@  discard block
 block discarded – undo
2801 2801
 
2802 2802
 		// Priority
2803 2803
 		if (getDolGlobalString('AGENDA_SUPPORT_PRIORITY_IN_EVENTS')) {
2804
-			print '<tr><td class="nowrap" class="titlefield">' . $langs->trans("Priority") . '</td><td>';
2804
+			print '<tr><td class="nowrap" class="titlefield">'.$langs->trans("Priority").'</td><td>';
2805 2805
 			print($object->priority ? $object->priority : '');
2806 2806
 			print '</td></tr>';
2807 2807
 		}
Please login to merge, or discard this patch.
htdocs/holiday/card.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -319,7 +319,7 @@  discard block
 block discarded – undo
319 319
 	if ($action == 'update' && GETPOSTISSET('savevalidator') && $permissiontoapprove) {
320 320
 		$object->fetch($id);
321 321
 
322
-		$object->oldcopy = dol_clone($object, 2);  // @phan-suppress-current-line PhanTypeMismatchProperty
322
+		$object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty
323 323
 
324 324
 		$object->fk_validator = GETPOSTINT('valideur');
325 325
 
@@ -478,7 +478,7 @@  discard block
 block discarded – undo
478 478
 
479 479
 		// If draft and owner of leave
480 480
 		if ($object->status == Holiday::STATUS_DRAFT && $permissiontoadd) {
481
-			$object->oldcopy = dol_clone($object, 2);  // @phan-suppress-current-line PhanTypeMismatchProperty
481
+			$object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty
482 482
 
483 483
 			$object->status = Holiday::STATUS_VALIDATED;
484 484
 
@@ -519,7 +519,7 @@  discard block
 block discarded – undo
519 519
 
520 520
 				// option to warn the validator in case of too short delay
521 521
 				if (!getDolGlobalString('HOLIDAY_HIDE_APPROVER_ABOUT_TOO_LOW_DELAY')) {
522
-					$delayForRequest = 0;		// TODO Set delay depending of holiday leave type
522
+					$delayForRequest = 0; // TODO Set delay depending of holiday leave type
523 523
 					if ($delayForRequest) {
524 524
 						$nowplusdelay = dol_time_plus_duree($now, $delayForRequest, 'd');
525 525
 
@@ -561,7 +561,7 @@  discard block
 block discarded – undo
561 561
 					$endhalfdaykey = "";
562 562
 				}
563 563
 
564
-				$link = dol_buildpath("/holiday/card.php", 3) . '?id='.$object->id;
564
+				$link = dol_buildpath("/holiday/card.php", 3).'?id='.$object->id;
565 565
 
566 566
 				$message .= "<ul>";
567 567
 				$message .= "<li>".$langs->transnoentitiesnoconv("Name")." : ".dolGetFirstLastname($expediteur->firstname, $expediteur->lastname)."</li>\n";
@@ -594,7 +594,7 @@  discard block
 block discarded – undo
594 594
 	}
595 595
 
596 596
 	if ($action == 'update_extras' && $permissiontoeditextra) {
597
-		$object->oldcopy = dol_clone($object, 2);  // @phan-suppress-current-line PhanTypeMismatchProperty
597
+		$object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty
598 598
 
599 599
 		$attribute_name = GETPOST('attribute', 'aZ09');
600 600
 
@@ -623,7 +623,7 @@  discard block
 block discarded – undo
623 623
 
624 624
 		// If status is waiting approval and approver is also user
625 625
 		if ($object->status == Holiday::STATUS_VALIDATED && ($user->id == $object->fk_validator || $permissiontoaddall) && $permissiontoapprove) {
626
-			$object->oldcopy = dol_clone($object, 2);  // @phan-suppress-current-line PhanTypeMismatchProperty
626
+			$object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty
627 627
 
628 628
 			$object->date_approval = dol_now();
629 629
 			$object->fk_user_approve = $user->id;
@@ -1259,7 +1259,7 @@  discard block
 block discarded – undo
1259 1259
 			$result = $object->fetch($id, $ref);
1260 1260
 
1261 1261
 			$approverexpected = new User($db);
1262
-			$approverexpected->fetch($object->fk_validator);	// Use that should be the approver
1262
+			$approverexpected->fetch($object->fk_validator); // Use that should be the approver
1263 1263
 
1264 1264
 			$userRequest = new User($db);
1265 1265
 			$userRequest->fetch($object->fk_user);
@@ -1494,7 +1494,7 @@  discard block
 block discarded – undo
1494 1494
 					print '</tr>';
1495 1495
 				} else {
1496 1496
 					print '<tr>';
1497
-					print '<td class="titlefield">'.$langs->trans('ReviewedByCP').'</td>';	// Will be approved by
1497
+					print '<td class="titlefield">'.$langs->trans('ReviewedByCP').'</td>'; // Will be approved by
1498 1498
 					print '<td>';
1499 1499
 					$include_users = $object->fetch_users_approver_holiday();
1500 1500
 					if (!in_array($object->fk_validator, $include_users)) {  // Add the current validator to the list to not lose it when editing.
Please login to merge, or discard this patch.
htdocs/ticket/card.php 1 patch
Spacing   +47 added lines, -47 removed lines patch added patch discarded remove patch
@@ -180,31 +180,31 @@  discard block
 block discarded – undo
180 180
 		$search_agenda_label = '';
181 181
 	}
182 182
 
183
-	$backurlforlist = DOL_URL_ROOT . '/ticket/list.php';
183
+	$backurlforlist = DOL_URL_ROOT.'/ticket/list.php';
184 184
 
185 185
 	if (empty($backtopage) || ($cancel && empty($id))) {
186 186
 		if (empty($backtopage) || ($cancel && strpos($backtopage, '__ID__'))) {
187 187
 			if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) {
188 188
 				$backtopage = $backurlforlist;
189 189
 			} else {
190
-				$backtopage = DOL_URL_ROOT . '/ticket/card.php?id=' . ((!empty($id) && $id > 0) ? $id : '__ID__');
190
+				$backtopage = DOL_URL_ROOT.'/ticket/card.php?id='.((!empty($id) && $id > 0) ? $id : '__ID__');
191 191
 			}
192 192
 		}
193 193
 	}
194 194
 
195 195
 	if ($cancel) {
196 196
 		if (!empty($backtopageforcancel)) {
197
-			header("Location: " . $backtopageforcancel);
197
+			header("Location: ".$backtopageforcancel);
198 198
 			exit;
199 199
 		} elseif (!empty($backtopage)) {
200
-			header("Location: " . $backtopage);
200
+			header("Location: ".$backtopage);
201 201
 			exit;
202 202
 		}
203 203
 		$action = 'view';
204 204
 	}
205 205
 
206 206
 	if ((($action == 'add' && GETPOST('save', 'alpha')) || ($action == 'update' && $object->status < Ticket::STATUS_CLOSED)) && $permissiontoadd) {
207
-		$ifErrorAction = ($action == 'add' ? 'create' : 'edit');	// Test on permission not required here
207
+		$ifErrorAction = ($action == 'add' ? 'create' : 'edit'); // Test on permission not required here
208 208
 		if ($action == 'add') {		// Test on permission already done
209 209
 			$object->track_id = null;
210 210
 		}
@@ -337,7 +337,7 @@  discard block
 block discarded – undo
337 337
 
338 338
 				if (!$error) {
339 339
 					// File transfer
340
-					$object->copyFilesForTicket('');        // trackid is forced to '' because files were uploaded when no id for ticket exists yet and trackid was ''
340
+					$object->copyFilesForTicket(''); // trackid is forced to '' because files were uploaded when no id for ticket exists yet and trackid was ''
341 341
 				}
342 342
 			}
343 343
 			if (!$error) {
@@ -347,13 +347,13 @@  discard block
 block discarded – undo
347 347
 					if (empty($id)) {
348 348
 						$url = $backtopage;
349 349
 					} else {
350
-						$url = 'card.php?track_id=' . urlencode($object->track_id);
350
+						$url = 'card.php?track_id='.urlencode($object->track_id);
351 351
 					}
352 352
 				} else {
353
-					$url = 'card.php?track_id=' . urlencode($object->track_id);
353
+					$url = 'card.php?track_id='.urlencode($object->track_id);
354 354
 				}
355 355
 
356
-				header("Location: " . $url);
356
+				header("Location: ".$url);
357 357
 				exit;
358 358
 			} else {
359 359
 				$db->rollback();
@@ -371,7 +371,7 @@  discard block
 block discarded – undo
371 371
 		if ($object->markAsRead($user) > 0) {
372 372
 			setEventMessages($langs->trans('TicketMarkedAsRead'), null, 'mesgs');
373 373
 
374
-			header("Location: card.php?track_id=" . $object->track_id);
374
+			header("Location: card.php?track_id=".$object->track_id);
375 375
 			exit;
376 376
 		} else {
377 377
 			setEventMessages($object->error, $object->errors, 'errors');
@@ -427,7 +427,7 @@  discard block
 block discarded – undo
427 427
 			$object->fetch_user($usertoassign);
428 428
 
429 429
 			setEventMessages($langs->trans('TicketAssigned'), null, 'mesgs');
430
-			header("Location: card.php?track_id=" . $object->track_id);
430
+			header("Location: card.php?track_id=".$object->track_id);
431 431
 			exit;
432 432
 		} else {
433 433
 			array_push($object->errors, $object->error);
@@ -444,10 +444,10 @@  discard block
 block discarded – undo
444 444
 			if (!empty($backtopage)) {
445 445
 				$url = $backtopage;
446 446
 			} else {
447
-				$url = 'card.php?track_id=' . urlencode($object->track_id);
447
+				$url = 'card.php?track_id='.urlencode($object->track_id);
448 448
 			}
449 449
 
450
-			header("Location: " . $url);
450
+			header("Location: ".$url);
451 451
 			exit;
452 452
 		} else {
453 453
 			setEventMessages($object->error, $object->errors, 'errors');
@@ -461,8 +461,8 @@  discard block
 block discarded – undo
461 461
 		if ($object->close($user, ($action == "confirm_abandon" ? 1 : 0))) {	// Test on pemrission already done
462 462
 			setEventMessages($langs->trans('TicketMarkedAsClosed'), null, 'mesgs');
463 463
 
464
-			$url = 'card.php?track_id=' . GETPOST('track_id', 'alpha');
465
-			header("Location: " . $url);
464
+			$url = 'card.php?track_id='.GETPOST('track_id', 'alpha');
465
+			header("Location: ".$url);
466 466
 			exit;
467 467
 		} else {
468 468
 			$action = '';
@@ -477,10 +477,10 @@  discard block
 block discarded – undo
477 477
 
478 478
 			$object->close($user);
479 479
 
480
-			setEventMessages('<div class="confirm">' . $langs->trans('TicketMarkedAsClosed') . '</div>', null, 'mesgs');
480
+			setEventMessages('<div class="confirm">'.$langs->trans('TicketMarkedAsClosed').'</div>', null, 'mesgs');
481 481
 
482
-			$url = 'card.php?track_id=' . GETPOST('track_id', 'alpha');
483
-			header("Location: " . $url);
482
+			$url = 'card.php?track_id='.GETPOST('track_id', 'alpha');
483
+			header("Location: ".$url);
484 484
 			exit;
485 485
 		} else {
486 486
 			setEventMessages($object->error, $object->errors, 'errors');
@@ -491,12 +491,12 @@  discard block
 block discarded – undo
491 491
 	if ($action == 'confirm_delete_ticket' && GETPOST('confirm', 'alpha') == "yes" && $permissiontodelete) {
492 492
 		if ($object->fetch(GETPOSTINT('id'), '', GETPOST('track_id', 'alpha')) >= 0) {
493 493
 			if ($object->delete($user) > 0) {
494
-				setEventMessages('<div class="confirm">' . $langs->trans('TicketDeletedSuccess') . '</div>', null, 'mesgs');
495
-				header("Location: " . DOL_URL_ROOT . "/ticket/list.php");
494
+				setEventMessages('<div class="confirm">'.$langs->trans('TicketDeletedSuccess').'</div>', null, 'mesgs');
495
+				header("Location: ".DOL_URL_ROOT."/ticket/list.php");
496 496
 				exit;
497 497
 			} else {
498 498
 				$langs->load("errors");
499
-				$mesg = '<div class="error">' . $langs->trans($object->error) . '</div>';
499
+				$mesg = '<div class="error">'.$langs->trans($object->error).'</div>';
500 500
 				$action = '';
501 501
 			}
502 502
 		}
@@ -506,8 +506,8 @@  discard block
 block discarded – undo
506 506
 	if ($action == 'set_thirdparty' && $user->hasRight('ticket', 'write')) {
507 507
 		if ($object->fetch(GETPOSTINT('id'), '', GETPOST('track_id', 'alpha')) >= 0) {
508 508
 			$result = $object->setCustomer(GETPOSTINT('editcustomer'));
509
-			$url = $_SERVER["PHP_SELF"] . '?track_id=' . GETPOST('track_id', 'alpha');
510
-			header("Location: " . $url);
509
+			$url = $_SERVER["PHP_SELF"].'?track_id='.GETPOST('track_id', 'alpha');
510
+			header("Location: ".$url);
511 511
 			exit();
512 512
 		}
513 513
 	}
@@ -517,8 +517,8 @@  discard block
 block discarded – undo
517 517
 		if ($object->fetch(GETPOSTINT('id'), '', GETPOST('track_id', 'alpha')) >= 0) {
518 518
 			$result = $object->setProgression(GETPOSTINT('progress'));
519 519
 
520
-			$url = 'card.php?track_id=' . $object->track_id;
521
-			header("Location: " . $url);
520
+			$url = 'card.php?track_id='.$object->track_id;
521
+			header("Location: ".$url);
522 522
 			exit();
523 523
 		}
524 524
 	}
@@ -528,8 +528,8 @@  discard block
 block discarded – undo
528 528
 		if ($object->fetch(GETPOSTINT('id'), '', GETPOST('track_id', 'alpha')) >= 0) {
529 529
 			$result = $object->setCategories(GETPOST('categories', 'array'));
530 530
 
531
-			$url = 'card.php?track_id=' . $object->track_id;
532
-			header("Location: " . $url);
531
+			$url = 'card.php?track_id='.$object->track_id;
532
+			header("Location: ".$url);
533 533
 			exit();
534 534
 		}
535 535
 	}
@@ -553,7 +553,7 @@  discard block
 block discarded – undo
553 553
 				}
554 554
 			}
555 555
 
556
-			header("Location: " . $_SERVER['PHP_SELF'] . "?track_id=" . $object->track_id);
556
+			header("Location: ".$_SERVER['PHP_SELF']."?track_id=".$object->track_id);
557 557
 			exit;
558 558
 		}
559 559
 	}
@@ -568,8 +568,8 @@  discard block
 block discarded – undo
568 568
 					$res = $object->setStatut(Ticket::STATUS_NOT_READ, null, '', $triggermodname);
569 569
 				}
570 570
 				if ($res) {
571
-					$url = 'card.php?track_id=' . $object->track_id;
572
-					header("Location: " . $url);
571
+					$url = 'card.php?track_id='.$object->track_id;
572
+					header("Location: ".$url);
573 573
 					exit();
574 574
 				} else {
575 575
 					$error++;
@@ -581,16 +581,16 @@  discard block
 block discarded – undo
581 581
 		// Categorisation dans projet
582 582
 		if ($object->fetch(GETPOSTINT('id'), '', GETPOST('track_id', 'alpha')) >= 0) {
583 583
 			$object->setProject($projectid);
584
-			$url = 'card.php?track_id=' . $object->track_id;
585
-			header("Location: " . $url);
584
+			$url = 'card.php?track_id='.$object->track_id;
585
+			header("Location: ".$url);
586 586
 			exit();
587 587
 		}
588 588
 	} elseif ($action == 'setcontract' && $permissiontoadd) {
589 589
 		// Categorisation dans contrat
590 590
 		if ($object->fetch(GETPOSTINT('id'), '', GETPOST('track_id', 'alpha')) >= 0) {
591 591
 			$object->setContract(GETPOSTINT('contractid'));
592
-			$url = 'card.php?track_id=' . $object->track_id;
593
-			header("Location: " . $url);
592
+			$url = 'card.php?track_id='.$object->track_id;
593
+			header("Location: ".$url);
594 594
 			exit();
595 595
 		}
596 596
 	} elseif ($action == "set_message" && $user->hasRight('ticket', 'manage')) {
@@ -621,8 +621,8 @@  discard block
 block discarded – undo
621 621
 			//$old_status = $object->status;
622 622
 			$res = $object->setStatut($new_status);
623 623
 			if ($res) {
624
-				$url = 'card.php?track_id=' . $object->track_id;
625
-				header("Location: " . $url);
624
+				$url = 'card.php?track_id='.$object->track_id;
625
+				header("Location: ".$url);
626 626
 				exit();
627 627
 			} else {
628 628
 				$error++;
@@ -674,17 +674,17 @@  discard block
 block discarded – undo
674 674
 
675 675
 
676 676
 	$permissiondellink = $user->hasRight('ticket', 'write');
677
-	include DOL_DOCUMENT_ROOT . '/core/actions_dellink.inc.php'; // Must be 'include', not 'include_once'
677
+	include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be 'include', not 'include_once'
678 678
 
679 679
 	// Actions to build doc
680
-	include DOL_DOCUMENT_ROOT . '/core/actions_builddoc.inc.php';
680
+	include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
681 681
 
682 682
 	// Actions to send emails
683 683
 	$triggersendname = 'TICKET_SENTBYMAIL';
684 684
 	$paramname = 'id';
685 685
 	$autocopy = 'MAIN_MAIL_AUTOCOPY_TICKET_TO'; // used to know the automatic BCC to add
686
-	$trackid = 'tic' . $object->id;
687
-	include DOL_DOCUMENT_ROOT . '/core/actions_sendmails.inc.php';
686
+	$trackid = 'tic'.$object->id;
687
+	include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
688 688
 
689 689
 	// Set $action to correct value for the case we used presend action to add a message
690 690
 	if (GETPOSTISSET('actionbis') && $action == 'presend') {	// Test on permission not required here
@@ -720,7 +720,7 @@  discard block
 block discarded – undo
720 720
 
721 721
 	print load_fiche_titre($langs->trans('NewTicket'), '', 'ticket');
722 722
 
723
-	$formticket->trackid = '';		// TODO Use a unique key 'tic' to avoid conflict in upload file feature
723
+	$formticket->trackid = ''; // TODO Use a unique key 'tic' to avoid conflict in upload file feature
724 724
 	$formticket->withfromsocid = $socid ? $socid : $user->socid;
725 725
 	$formticket->withfromcontactid = $contactid ? $contactid : '';
726 726
 	$formticket->withtitletopic = 1;
@@ -753,7 +753,7 @@  discard block
 block discarded – undo
753 753
 
754 754
 	print dol_get_fiche_head($head, 'tabTicket', $langs->trans('Ticket'), -1, 'ticket');
755 755
 
756
-	$formticket->trackid = $object->track_id;        // TODO Use a unique key 'tic' to avoid conflict in upload file feature
756
+	$formticket->trackid = $object->track_id; // TODO Use a unique key 'tic' to avoid conflict in upload file feature
757 757
 	$formticket->withfromsocid = $object->socid;
758 758
 	$formticket->withtitletopic = 1;
759 759
 	//  $formticket->withnotifytiersatcreate = ($notifyTiers ? 1 : (getDolGlobalString('TICKET_CHECK_NOTIFY_THIRDPARTY_AT_CREATION') ? 1 : 0));
@@ -788,7 +788,7 @@  discard block
 block discarded – undo
788 788
 				'-3' => $langs->trans('TicketNotNotifyTiersAtClose')
789 789
 			);
790 790
 			foreach ($thirdparty_contacts as $thirdparty_contact) {
791
-				$contacts_select[$thirdparty_contact['id']] = $thirdparty_contact['civility'] . ' ' . $thirdparty_contact['lastname'] . ' ' . $thirdparty_contact['firstname'];
791
+				$contacts_select[$thirdparty_contact['id']] = $thirdparty_contact['civility'].' '.$thirdparty_contact['lastname'].' '.$thirdparty_contact['firstname'];
792 792
 			}
793 793
 
794 794
 			// Default select all or no contact
@@ -1039,8 +1039,8 @@  discard block
 block discarded – undo
1039 1039
 						$morehtmlref .= $formcontract->formSelectContract($_SERVER["PHP_SELF"].'?id='.$object->id, $object->socid, $object->fk_contract, 'contratid', 0, 1, 1, 1);
1040 1040
 					} else {
1041 1041
 						$morehtmlref .= '<a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=edit_contrat&token='.newToken().'&id='.$object->id.'">';
1042
-						$morehtmlref .=  img_edit($langs->trans('SetContract'));
1043
-						$morehtmlref .=  '</a>';
1042
+						$morehtmlref .= img_edit($langs->trans('SetContract'));
1043
+						$morehtmlref .= '</a>';
1044 1044
 					}
1045 1045
 				} else {
1046 1046
 					if (!empty($object->fk_contract)) {
@@ -1482,10 +1482,10 @@  discard block
 block discarded – undo
1482 1482
 				// Link to create an intervention
1483 1483
 				// socid is needed otherwise fichinter ask it and forgot origin after form submit :\
1484 1484
 				if (!$object->fk_soc && $user->hasRight("ficheinter", "creer")) {
1485
-					print dolGetButtonAction($langs->trans('UnableToCreateInterIfNoSocid'), $langs->trans('TicketAddIntervention'), 'default', $_SERVER['PHP_SELF']. '#', '', false);
1485
+					print dolGetButtonAction($langs->trans('UnableToCreateInterIfNoSocid'), $langs->trans('TicketAddIntervention'), 'default', $_SERVER['PHP_SELF'].'#', '', false);
1486 1486
 				}
1487 1487
 				if ($object->fk_soc > 0 && isset($object->status) && $object->status < Ticket::STATUS_CLOSED && $user->hasRight('ficheinter', 'creer')) {
1488
-					print dolGetButtonAction('', $langs->trans('TicketAddIntervention'), 'default', DOL_URL_ROOT.'/fichinter/card.php?action=create&token='.newToken().'&socid='. $object->fk_soc.'&origin=ticket_ticket&originid='. $object->id, '');
1488
+					print dolGetButtonAction('', $langs->trans('TicketAddIntervention'), 'default', DOL_URL_ROOT.'/fichinter/card.php?action=create&token='.newToken().'&socid='.$object->fk_soc.'&origin=ticket_ticket&originid='.$object->id, '');
1489 1489
 				}
1490 1490
 
1491 1491
 				// Close ticket if status is read
Please login to merge, or discard this patch.
htdocs/compta/sociales/class/cchargesociales.class.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -153,7 +153,7 @@
 block discarded – undo
153 153
 		$sql .= ') VALUES (';
154 154
 		$sql .= ' '.(!isset($this->libelle) ? 'NULL' : "'".$this->db->escape($this->libelle)."'").',';
155 155
 		$sql .= ' '.(!isset($this->deductible) ? 'NULL' : $this->deductible).',';
156
-		$sql .= ' ' . (int) $this->active . ',';
156
+		$sql .= ' '.(int) $this->active.',';
157 157
 		$sql .= ' '.(!isset($this->code) ? 'NULL' : "'".$this->db->escape($this->code)."'").',';
158 158
 		$sql .= ' '.(!isset($this->fk_pays) ? 'NULL' : $this->fk_pays).',';
159 159
 		$sql .= ' '.(!isset($this->module) ? 'NULL' : "'".$this->db->escape($this->module)."'").',';
Please login to merge, or discard this patch.