Completed
Branch develop (b5f2d2)
by
unknown
20:52
created
htdocs/societe/consumption.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -52,10 +52,10 @@
 block discarded – undo
52 52
 }
53 53
 
54 54
 // Sort & Order fields
55
-$limit 		= GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
55
+$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
56 56
 $sortfield 	= GETPOST('sortfield', 'aZ09comma');
57 57
 $sortorder 	= GETPOST('sortorder', 'aZ09comma');
58
-$page 		= GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
58
+$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
59 59
 $optioncss 	= GETPOST('optioncss', 'alpha');
60 60
 
61 61
 if (empty($page) || $page == -1) {
Please login to merge, or discard this patch.
htdocs/societe/document.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -39,21 +39,21 @@
 block discarded – undo
39 39
 
40 40
 
41 41
 // Get parameters
42
-$action 	= GETPOST('action', 'aZ09');
43
-$confirm 	= GETPOST('confirm');
44
-$id 		= (GETPOST('socid', 'int') ? GETPOST('socid', 'int') : GETPOST('id', 'int'));
45
-$ref 		= GETPOST('ref', 'alpha');
42
+$action = GETPOST('action', 'aZ09');
43
+$confirm = GETPOST('confirm');
44
+$id = (GETPOST('socid', 'int') ? GETPOST('socid', 'int') : GETPOST('id', 'int'));
45
+$ref = GETPOST('ref', 'alpha');
46 46
 
47
-$limit 		= GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
47
+$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
48 48
 $sortfield 	= GETPOST('sortfield', 'aZ09comma');
49 49
 $sortorder 	= GETPOST('sortorder', 'aZ09comma');
50
-$page 		= GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
50
+$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
51 51
 
52 52
 if (empty($page) || $page == -1) {
53 53
 	$page = 0;
54 54
 }     // If $page is not defined, or '' or -1
55 55
 
56
-$offset 	= $limit * $page;
56
+$offset = $limit * $page;
57 57
 $pageprev 	= $page - 1;
58 58
 $pagenext 	= $page + 1;
59 59
 
Please login to merge, or discard this patch.
htdocs/resource/agenda.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -95,7 +95,7 @@
 block discarded – undo
95 95
  */
96 96
 
97 97
 $parameters = array('id'=>$id);
98
-$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action);    // Note that $action and $object may have been modified by some hooks
98
+$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
99 99
 if ($reshook < 0) {
100 100
 	setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
101 101
 }
Please login to merge, or discard this patch.
htdocs/compta/stats/cabyprodserv.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -98,8 +98,8 @@  discard block
 block discarded – undo
98 98
 	$month_current = dol_print_date(dol_now(), '%m');
99 99
 	$year_start = $year;
100 100
 }
101
-$date_start = dol_mktime(0, 0, 0, GETPOST("date_startmonth"), GETPOST("date_startday"), GETPOST("date_startyear"), 'tzserver');	// We use timezone of server so report is same from everywhere
102
-$date_end = dol_mktime(23, 59, 59, GETPOST("date_endmonth"), GETPOST("date_endday"), GETPOST("date_endyear"), 'tzserver');		// We use timezone of server so report is same from everywhere
101
+$date_start = dol_mktime(0, 0, 0, GETPOST("date_startmonth"), GETPOST("date_startday"), GETPOST("date_startyear"), 'tzserver'); // We use timezone of server so report is same from everywhere
102
+$date_end = dol_mktime(23, 59, 59, GETPOST("date_endmonth"), GETPOST("date_endday"), GETPOST("date_endyear"), 'tzserver'); // We use timezone of server so report is same from everywhere
103 103
 // Quarter
104 104
 if (empty($date_start) || empty($date_end)) { // We define date_start and date_end
105 105
 	$q = GETPOST("q", "int");
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
 $headerparams = array_merge($commonparams, $headerparams);
209 209
 $tableparams = array_merge($commonparams, $tableparams);
210 210
 
211
-$paramslink="";
211
+$paramslink = "";
212 212
 foreach ($allparams as $key => $value) {
213 213
 	$paramslink .= '&'.$key.'='.$value;
214 214
 }
@@ -231,8 +231,8 @@  discard block
 block discarded – undo
231 231
 	$modecompta = "RECETTES-DEPENSES";
232 232
 }
233 233
 
234
-$exportlink="";
235
-$namelink="";
234
+$exportlink = "";
235
+$namelink = "";
236 236
 
237 237
 // Show report header
238 238
 if ($modecompta == "CREANCES-DETTES") {
Please login to merge, or discard this patch.
htdocs/compta/stats/byratecountry.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -53,8 +53,8 @@  discard block
 block discarded – undo
53 53
 	$month_current = dol_print_date(dol_now(), '%m');
54 54
 	$year_start = $year;
55 55
 }
56
-$date_start = dol_mktime(0, 0, 0, GETPOST("date_startmonth"), GETPOST("date_startday"), GETPOST("date_startyear"), 'tzserver');	// We use timezone of server so report is same from everywhere
57
-$date_end = dol_mktime(23, 59, 59, GETPOST("date_endmonth"), GETPOST("date_endday"), GETPOST("date_endyear"), 'tzserver');		// We use timezone of server so report is same from everywhere
56
+$date_start = dol_mktime(0, 0, 0, GETPOST("date_startmonth"), GETPOST("date_startday"), GETPOST("date_startyear"), 'tzserver'); // We use timezone of server so report is same from everywhere
57
+$date_end = dol_mktime(23, 59, 59, GETPOST("date_endmonth"), GETPOST("date_endday"), GETPOST("date_endyear"), 'tzserver'); // We use timezone of server so report is same from everywhere
58 58
 
59 59
 // Quarter
60 60
 $q = '';
@@ -158,8 +158,8 @@  discard block
 block discarded – undo
158 158
 
159 159
 llxHeader('', $langs->trans("TurnoverReport"), '', '', 0, 0, '', '', $morequerystring);
160 160
 
161
-$exportlink="";
162
-$namelink="";
161
+$exportlink = "";
162
+$namelink = "";
163 163
 //print load_fiche_titre($langs->trans("VAT"),"");
164 164
 
165 165
 //$fsearch.='<br>';
Please login to merge, or discard this patch.
htdocs/compta/stats/cabyuser.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -79,8 +79,8 @@  discard block
 block discarded – undo
79 79
 	$month_current = dol_print_date(dol_now(), '%m');
80 80
 	$year_start = $year;
81 81
 }
82
-$date_start = dol_mktime(0, 0, 0, GETPOST("date_startmonth"), GETPOST("date_startday"), GETPOST("date_startyear"), 'tzserver');	// We use timezone of server so report is same from everywhere
83
-$date_end = dol_mktime(23, 59, 59, GETPOST("date_endmonth"), GETPOST("date_endday"), GETPOST("date_endyear"), 'tzserver');		// We use timezone of server so report is same from everywhere
82
+$date_start = dol_mktime(0, 0, 0, GETPOST("date_startmonth"), GETPOST("date_startday"), GETPOST("date_startyear"), 'tzserver'); // We use timezone of server so report is same from everywhere
83
+$date_end = dol_mktime(23, 59, 59, GETPOST("date_endmonth"), GETPOST("date_endday"), GETPOST("date_endyear"), 'tzserver'); // We use timezone of server so report is same from everywhere
84 84
 // Quarter
85 85
 if (empty($date_start) || empty($date_end)) { // We define date_start and date_end
86 86
 	$q = GETPOST("q") ?GETPOST("q") : 0;
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
 $headerparams = array_merge($commonparams, $headerparams);
166 166
 $tableparams = array_merge($commonparams, $tableparams);
167 167
 
168
-$paramslink="";
168
+$paramslink = "";
169 169
 foreach ($allparams as $key => $value) {
170 170
 	$paramslink .= '&'.$key.'='.$value;
171 171
 }
@@ -186,8 +186,8 @@  discard block
 block discarded – undo
186 186
 	$modecompta = "RECETTES-DEPENSES";
187 187
 }
188 188
 
189
-$exportlink="";
190
-$namelink="";
189
+$exportlink = "";
190
+$namelink = "";
191 191
 
192 192
 // Show report header
193 193
 if ($modecompta == "CREANCES-DETTES") {
Please login to merge, or discard this patch.
htdocs/product/stock/stocktransfer/stocktransfer_document.php 1 patch
Braces   +9 added lines, -3 removed lines patch added patch discarded remove patch
@@ -48,8 +48,12 @@  discard block
 block discarded – undo
48 48
 $offset = $limit * $page;
49 49
 $pageprev = $page - 1;
50 50
 $pagenext = $page + 1;
51
-if (!$sortorder) $sortorder = "ASC";
52
-if (!$sortfield) $sortfield = "name";
51
+if (!$sortorder) {
52
+	$sortorder = "ASC";
53
+}
54
+if (!$sortfield) {
55
+	$sortfield = "name";
56
+}
53 57
 //if (! $sortfield) $sortfield="position_name";
54 58
 
55 59
 // Initialize technical objects
@@ -64,7 +68,9 @@  discard block
 block discarded – undo
64 68
 include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once  // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals
65 69
 
66 70
 //if ($id > 0 || !empty($ref)) $upload_dir = $conf->stocktransfer->multidir_output[$object->entity?$object->entity:$conf->entity] . "/stocktransfer/" . dol_sanitizeFileName($object->id);
67
-if ($id > 0 || !empty($ref)) $upload_dir = $conf->stocktransfer->multidir_output[$object->entity ? $object->entity : $conf->entity]."/stocktransfer/".dol_sanitizeFileName($object->ref);
71
+if ($id > 0 || !empty($ref)) {
72
+	$upload_dir = $conf->stocktransfer->multidir_output[$object->entity ? $object->entity : $conf->entity]."/stocktransfer/".dol_sanitizeFileName($object->ref);
73
+}
68 74
 
69 75
 // Security check - Protection if external user
70 76
 //if ($user->socid > 0) accessforbidden();
Please login to merge, or discard this patch.
htdocs/fourn/facture/card-rec.php 2 patches
Braces   +12 added lines, -5 removed lines patch added patch discarded remove patch
@@ -898,8 +898,12 @@  discard block
 block discarded – undo
898 898
 		print dol_get_fiche_head(null, '', '', 0);
899 899
 
900 900
 		$rowspan = 4;
901
-		if (isModEnabled('project')) $rowspan++;
902
-		if ($object->fk_account > 0) $rowspan++;
901
+		if (isModEnabled('project')) {
902
+			$rowspan++;
903
+		}
904
+		if ($object->fk_account > 0) {
905
+			$rowspan++;
906
+		}
903 907
 
904 908
 		print '<table class="border centpercent">';
905 909
 
@@ -1576,9 +1580,12 @@  discard block
 block discarded – undo
1576 1580
 
1577 1581
 				$parameters = array();
1578 1582
 				$reshook = $hookmanager->executeHooks('formAddObjectLine', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
1579
-				if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
1580
-				if (empty($reshook))
1581
-					global $senderissupplier;
1583
+				if ($reshook < 0) {
1584
+					setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
1585
+				}
1586
+				if (empty($reshook)) {
1587
+									global $senderissupplier;
1588
+				}
1582 1589
 				$senderissupplier = 2;
1583 1590
 				$object->formAddObjectLine(0, $object->thirdparty, $mysoc); // No date selector for template invoice
1584 1591
 			}
Please login to merge, or discard this patch.
Spacing   +170 added lines, -170 removed lines patch added patch discarded remove patch
@@ -32,17 +32,17 @@  discard block
 block discarded – undo
32 32
 
33 33
 // Load Dolibarr environment
34 34
 require '../../main.inc.php';
35
-require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.facture-rec.class.php';
36
-require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.product.class.php';
37
-require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
38
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php';
35
+require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture-rec.class.php';
36
+require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php';
37
+require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
38
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
39 39
 if (isModEnabled('project')) {
40
-	include_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
40
+	include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
41 41
 }
42
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php';
43
-require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php';
44
-require_once DOL_DOCUMENT_ROOT . '/core/lib/invoice.lib.php';
45
-require_once DOL_DOCUMENT_ROOT . '/core/class/extrafields.class.php';
42
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
43
+require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
44
+require_once DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php';
45
+require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
46 46
 
47 47
 // Load translation files required by the page
48 48
 $langs->loadLangs(array('bills', 'companies', 'compta', 'admin', 'other', 'products', 'banks', 'suppliers'));
@@ -83,10 +83,10 @@  discard block
 block discarded – undo
83 83
 	$page = 0;
84 84
 }     // If $page is not defined, or '' or -1
85 85
 $offset = $limit * $page;
86
-if (! $sortorder) {
86
+if (!$sortorder) {
87 87
 	$sortorder = 'DESC';
88 88
 }
89
-if (! $sortfield) {
89
+if (!$sortfield) {
90 90
 	$sortfield = 'f.titre';
91 91
 }
92 92
 $pageprev = $page - 1;
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 $object = new FactureFournisseurRec($db);
96 96
 if (($id > 0 || $title) && $action != 'create' && $action != 'add') {
97 97
 	$ret = $object->fetch($id, $title);
98
-	if (! $ret) {
98
+	if (!$ret) {
99 99
 		setEventMessages($langs->trans("ErrorRecordNotFound"), null, 'errors');
100 100
 	}
101 101
 }
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
 	$action = 'list';
140 140
 	$massaction = '';
141 141
 }
142
-if (! GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') {
142
+if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') {
143 143
 	$massaction = '';
144 144
 }
145 145
 
@@ -155,18 +155,18 @@  discard block
 block discarded – undo
155 155
 	}
156 156
 
157 157
 	// Selection of new fields
158
-	include DOL_DOCUMENT_ROOT . '/core/actions_changeselectedfields.inc.php';
158
+	include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
159 159
 
160 160
 	// Set note
161
-	include DOL_DOCUMENT_ROOT . '/core/actions_setnotes.inc.php'; // Must be include, not include_once
161
+	include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once
162 162
 
163
-	include DOL_DOCUMENT_ROOT . '/core/actions_dellink.inc.php'; // Must be include, not include_once
163
+	include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be include, not include_once
164 164
 
165
-	include DOL_DOCUMENT_ROOT . '/core/actions_lineupdown.inc.php'; // Must be include, not include_once
165
+	include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; // Must be include, not include_once
166 166
 
167 167
 	// Create predefined invoice
168 168
 	if ($action == 'add') {
169
-		if (! GETPOST('title', 'alphanohtml')) {
169
+		if (!GETPOST('title', 'alphanohtml')) {
170 170
 			setEventMessages($langs->transnoentities("ErrorFieldRequired", $langs->trans("Title")), null, 'errors');
171 171
 			$action = "create";
172 172
 			$error++;
@@ -189,10 +189,10 @@  discard block
 block discarded – undo
189 189
 			}
190 190
 		}
191 191
 
192
-		if (! $error) {
192
+		if (!$error) {
193 193
 			$object->titre = GETPOST('title', 'alphanohtml'); // deprecated
194 194
 			$object->title = GETPOST('title', 'alphanohtml');
195
-			$object->libelle = GETPOST('libelle', 'alpha');	// deprecated
195
+			$object->libelle = GETPOST('libelle', 'alpha'); // deprecated
196 196
 			$object->label = GETPOST('libelle', 'alpha');
197 197
 			$object->fk_project = GETPOST('projectid', 'int');
198 198
 			$object->ref_supplier = GETPOST('ref_supplier', 'alphanohtml');
@@ -238,10 +238,10 @@  discard block
 block discarded – undo
238 238
 				$action = "create";
239 239
 			}
240 240
 
241
-			if (! $error) {
241
+			if (!$error) {
242 242
 				$db->commit();
243 243
 
244
-				header("Location: " . $_SERVER['PHP_SELF'] . '?facid=' . $object->id);
244
+				header("Location: ".$_SERVER['PHP_SELF'].'?facid='.$object->id);
245 245
 				exit;
246 246
 			} else {
247 247
 				$db->rollback();
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
 	if ($action == 'confirm_deleteinvoice' && $confirm == 'yes' && ($user->hasRight("fournisseur", "facture", "supprimer") || $user->hasRight("supplier_invoice", "supprimer"))) {
259 259
 		$object->delete($user);
260 260
 
261
-		header('Location: ' . DOL_URL_ROOT . '/fourn/facture/list-rec.php');
261
+		header('Location: '.DOL_URL_ROOT.'/fourn/facture/list-rec.php');
262 262
 		exit;
263 263
 	}
264 264
 
@@ -288,7 +288,7 @@  discard block
 block discarded – undo
288 288
 		$result = $object->setValueFrom('titre', $title, '', null, 'text', '', $user);
289 289
 
290 290
 		if ($result > 0) {
291
-			$object->titre = $title;	// deprecated
291
+			$object->titre = $title; // deprecated
292 292
 			$object->title = $title;
293 293
 			$object->ref = $object->title;
294 294
 		} else {
@@ -335,7 +335,7 @@  discard block
 block discarded – undo
335 335
 			$error++;
336 336
 		}
337 337
 
338
-		if (! $error) {
338
+		if (!$error) {
339 339
 			$db->commit();
340 340
 		} else {
341 341
 			$db->rollback();
@@ -352,7 +352,7 @@  discard block
 block discarded – undo
352 352
 			$error++;
353 353
 		}
354 354
 
355
-		if (! $error) {
355
+		if (!$error) {
356 356
 			$db->commit();
357 357
 		} else {
358 358
 			$db->rollback();
@@ -411,7 +411,7 @@  discard block
 block discarded – undo
411 411
 			$error++;
412 412
 		}
413 413
 
414
-		if (! $error) {
414
+		if (!$error) {
415 415
 			$result = $object->insertExtraFields('BILLREC_MODIFY');
416 416
 			if ($result < 0) {
417 417
 				setEventMessages($object->error, $object->errors, 'errors');
@@ -440,8 +440,8 @@  discard block
 block discarded – undo
440 440
 			$tva_tx = '';
441 441
 		}
442 442
 
443
-		$qty = price2num(GETPOST('qty' . $predef, 'alpha'), 'MS', 2);
444
-		$remise_percent = price2num(GETPOST('remise_percent' . $predef), '', 2);
443
+		$qty = price2num(GETPOST('qty'.$predef, 'alpha'), 'MS', 2);
444
+		$remise_percent = price2num(GETPOST('remise_percent'.$predef), '', 2);
445 445
 
446 446
 		// Extrafields
447 447
 		$extralabelsline = $extrafields->fetch_name_optionals_label($object->table_element_line);
@@ -450,7 +450,7 @@  discard block
 block discarded – undo
450 450
 		if (is_array($extralabelsline)) {
451 451
 			// Get extra fields
452 452
 			foreach ($extralabelsline as $key => $value) {
453
-				unset($_POST["options_" . $key . $predef]);
453
+				unset($_POST["options_".$key.$predef]);
454 454
 			}
455 455
 		}
456 456
 
@@ -462,7 +462,7 @@  discard block
 block discarded – undo
462 462
 			setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Type')), null, 'errors');
463 463
 			$error++;
464 464
 		}
465
-		if ($prod_entry_mode == 'free' && (empty($idprod) || $idprod < 0) && (! ($price_ht >= 0) || $price_ht == '')) {    // Unit price can be 0 but not ''
465
+		if ($prod_entry_mode == 'free' && (empty($idprod) || $idprod < 0) && (!($price_ht >= 0) || $price_ht == '')) {    // Unit price can be 0 but not ''
466 466
 			setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("UnitPriceHT")), null, 'errors');
467 467
 			$error++;
468 468
 		}
@@ -511,7 +511,7 @@  discard block
 block discarded – undo
511 511
 			}
512 512
 		}
513 513
 
514
-		if (! $error && ($qty >= 0) && (!empty($product_desc) || (!empty($idprod) && $idprod > 0))) {
514
+		if (!$error && ($qty >= 0) && (!empty($product_desc) || (!empty($idprod) && $idprod > 0))) {
515 515
 			$ret = $object->fetch($id);
516 516
 			if ($ret < 0) {
517 517
 				dol_print_error($db, $object->error);
@@ -520,8 +520,8 @@  discard block
 block discarded – undo
520 520
 			$ret = $object->fetch_thirdparty();
521 521
 
522 522
 			// Clean parameters
523
-			$date_start = dol_mktime(GETPOST('date_start' . $predef . 'hour'), GETPOST('date_start' . $predef . 'min'), GETPOST('date_start' . $predef . 'sec'), GETPOST('date_start' . $predef . 'month'), GETPOST('date_start' . $predef . 'day'), GETPOST('date_start' . $predef . 'year'));
524
-			$date_end = dol_mktime(GETPOST('date_end' . $predef . 'hour'), GETPOST('date_end' . $predef . 'min'), GETPOST('date_end' . $predef . 'sec'), GETPOST('date_end' . $predef . 'month'), GETPOST('date_end' . $predef . 'day'), GETPOST('date_end' . $predef . 'year'));
523
+			$date_start = dol_mktime(GETPOST('date_start'.$predef.'hour'), GETPOST('date_start'.$predef.'min'), GETPOST('date_start'.$predef.'sec'), GETPOST('date_start'.$predef.'month'), GETPOST('date_start'.$predef.'day'), GETPOST('date_start'.$predef.'year'));
524
+			$date_end = dol_mktime(GETPOST('date_end'.$predef.'hour'), GETPOST('date_end'.$predef.'min'), GETPOST('date_end'.$predef.'sec'), GETPOST('date_end'.$predef.'month'), GETPOST('date_end'.$predef.'day'), GETPOST('date_end'.$predef.'year'));
525 525
 			$price_base_type = (GETPOST('price_base_type', 'alpha') ? GETPOST('price_base_type', 'alpha') : 'HT');
526 526
 
527 527
 			// Define special_code for special lines
@@ -618,23 +618,23 @@  discard block
 block discarded – undo
618 618
 							$outputlangs->load('products');
619 619
 						}
620 620
 						if (!empty($prod->customcode)) {
621
-							$tmptxt .= $outputlangs->transnoentitiesnoconv("CustomCode") . ': ' . $prod->customcode;
621
+							$tmptxt .= $outputlangs->transnoentitiesnoconv("CustomCode").': '.$prod->customcode;
622 622
 						}
623 623
 						if (!empty($prod->customcode) && !empty($prod->country_code)) {
624 624
 							$tmptxt .= ' - ';
625 625
 						}
626 626
 						if (!empty($prod->country_code)) {
627
-							$tmptxt .= $outputlangs->transnoentitiesnoconv("CountryOrigin") . ': ' . getCountry($prod->country_code, 0, $db, $outputlangs, 0);
627
+							$tmptxt .= $outputlangs->transnoentitiesnoconv("CountryOrigin").': '.getCountry($prod->country_code, 0, $db, $outputlangs, 0);
628 628
 						}
629 629
 					} else {
630 630
 						if (!empty($prod->customcode)) {
631
-							$tmptxt .= $langs->transnoentitiesnoconv("CustomCode") . ': ' . $prod->customcode;
631
+							$tmptxt .= $langs->transnoentitiesnoconv("CustomCode").': '.$prod->customcode;
632 632
 						}
633 633
 						if (!empty($prod->customcode) && !empty($prod->country_code)) {
634 634
 							$tmptxt .= ' - ';
635 635
 						}
636 636
 						if (!empty($prod->country_code)) {
637
-							$tmptxt .= $langs->transnoentitiesnoconv("CountryOrigin") . ': ' . getCountry($prod->country_code, 0, $db, $langs, 0);
637
+							$tmptxt .= $langs->transnoentitiesnoconv("CountryOrigin").': '.getCountry($prod->country_code, 0, $db, $langs, 0);
638 638
 						}
639 639
 					}
640 640
 					$tmptxt .= ')';
@@ -660,8 +660,8 @@  discard block
 block discarded – undo
660 660
 			$date_end_fill = !empty(GETPOST('date_end_fill', 'int')) ? GETPOST('date_end_fill', 'int') : null;
661 661
 
662 662
 			// Margin
663
-			$fournprice = price2num(GETPOST('fournprice' . $predef) ? GETPOST('fournprice' . $predef) : '');
664
-			$buyingprice = price2num(GETPOST('buying_price' . $predef) != '' ? GETPOST('buying_price' . $predef) : ''); // If buying_price is '0', we must keep this value
663
+			$fournprice = price2num(GETPOST('fournprice'.$predef) ? GETPOST('fournprice'.$predef) : '');
664
+			$buyingprice = price2num(GETPOST('buying_price'.$predef) != '' ? GETPOST('buying_price'.$predef) : ''); // If buying_price is '0', we must keep this value
665 665
 
666 666
 			// Local Taxes
667 667
 			$localtax1_tx = get_localtax($tva_tx, 1, $object->thirdparty, $mysoc, $tva_npr);
@@ -727,8 +727,8 @@  discard block
 block discarded – undo
727 727
 				$action = '';
728 728
 			}
729 729
 		}
730
-	} elseif ($action == 'updateline' && $usercancreate && ! GETPOST('cancel', 'alpha')) {
731
-		if (! $object->fetch($id) > 0) {
730
+	} elseif ($action == 'updateline' && $usercancreate && !GETPOST('cancel', 'alpha')) {
731
+		if (!$object->fetch($id) > 0) {
732 732
 			dol_print_error($db);
733 733
 		}
734 734
 		$object->fetch_thirdparty();
@@ -763,7 +763,7 @@  discard block
 block discarded – undo
763 763
 			$objectline->array_options = $array_options;
764 764
 			$result = $objectline->insertExtraFields();
765 765
 			if ($result < 0) {
766
-				setEventMessages($langs->trans('Error') . $result, null, 'errors');
766
+				setEventMessages($langs->trans('Error').$result, null, 'errors');
767 767
 			}
768 768
 		}
769 769
 
@@ -773,13 +773,13 @@  discard block
 block discarded – undo
773 773
 		if (is_array($extralabelsline)) {
774 774
 			// Get extra fields
775 775
 			foreach ($extralabelsline as $key => $value) {
776
-				unset($_POST["options_" . $key]);
776
+				unset($_POST["options_".$key]);
777 777
 			}
778 778
 		}
779 779
 
780 780
 		// Define special_code for special lines
781 781
 		$special_code = GETPOST('special_code', 'int');
782
-		if (! GETPOST('qty', 'alpha')) {
782
+		if (!GETPOST('qty', 'alpha')) {
783 783
 			$special_code = 3;
784 784
 		}
785 785
 
@@ -825,7 +825,7 @@  discard block
 block discarded – undo
825 825
 		$date_end_fill = !empty(GETPOST('date_end_fill', 'int')) ? GETPOST('date_end_fill', 'int') : 'NULL';
826 826
 
827 827
 		// Update line
828
-		if (! $error) {
828
+		if (!$error) {
829 829
 			$result = $object->updateline(GETPOST('lineid', 'int'), GETPOST('productid', 'int'), $ref_fourn, $label, $description, $pu_ht, $qty, $remise_percent, $vat_rate, $localtax1_rate, $localtax1_rate, 'HT', $type, $date_start_fill, $date_end_fill, $info_bits, $special_code, -1);
830 830
 			if ($result >= 0) {
831 831
 				$object->fetch($object->id); // Reload lines
@@ -899,10 +899,10 @@  discard block
 block discarded – undo
899 899
 	if ($object->fetch($id) > 0) {
900 900
 		$result = $object->fetch_lines();
901 901
 
902
-		print '<form action="' . $_SERVER["PHP_SELF"] . '" method="POST">';
903
-		print '<input type="hidden" name="token" value="' . newToken() . '">';
902
+		print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
903
+		print '<input type="hidden" name="token" value="'.newToken().'">';
904 904
 		print '<input type="hidden" name="action" value="add">';
905
-		print '<input type="hidden" name="facid" value="' . $object->id . '">';
905
+		print '<input type="hidden" name="facid" value="'.$object->id.'">';
906 906
 
907 907
 		print dol_get_fiche_head(null, '', '', 0);
908 908
 
@@ -915,17 +915,17 @@  discard block
 block discarded – undo
915 915
 		$object->fetch_thirdparty();
916 916
 
917 917
 		// Title
918
-		print '<tr><td class="titlefieldcreate fieldrequired">' . $langs->trans("Title") . '</td><td>';
919
-		print '<input class="flat quatrevingtpercent" type="text" name="title" value="' . dol_escape_htmltag(GETPOST("title", 'alphanohtml')) . '" autofocus>';
918
+		print '<tr><td class="titlefieldcreate fieldrequired">'.$langs->trans("Title").'</td><td>';
919
+		print '<input class="flat quatrevingtpercent" type="text" name="title" value="'.dol_escape_htmltag(GETPOST("title", 'alphanohtml')).'" autofocus>';
920 920
 		print '</td></tr>';
921 921
 
922 922
 		// Ref supplier
923
-		print '<tr><td class="titlefieldcreate fieldrequired">' . $langs->trans("RefSupplier") . '</td><td>';
924
-		print '<input class="flat maxwidth500" type="text" name="ref_supplier" value="' . $object->ref_supplier . '">';
923
+		print '<tr><td class="titlefieldcreate fieldrequired">'.$langs->trans("RefSupplier").'</td><td>';
924
+		print '<input class="flat maxwidth500" type="text" name="ref_supplier" value="'.$object->ref_supplier.'">';
925 925
 		print '</td></tr>';
926 926
 
927 927
 		// Third party
928
-		print '<tr><td class="titlefieldcreate">' . $langs->trans("Customer") . '</td><td>' . $object->thirdparty->getNomUrl(1, 'customer') . '</td>';
928
+		print '<tr><td class="titlefieldcreate">'.$langs->trans("Customer").'</td><td>'.$object->thirdparty->getNomUrl(1, 'customer').'</td>';
929 929
 		print '</tr>';
930 930
 
931 931
 		$note_public = GETPOSTISSET('note_public') ? GETPOST('note_public', 'restricthtml') : $object->note_public;
@@ -934,30 +934,30 @@  discard block
 block discarded – undo
934 934
 		// Help of substitution key
935 935
 		$substitutionarray = getCommonSubstitutionArray($langs, 2, null, $object);
936 936
 
937
-		$substitutionarray['__INVOICE_PREVIOUS_MONTH__'] = $langs->trans("PreviousMonthOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date(dol_time_plus_duree($object->date, -1, 'm'), '%m') . ')';
938
-		$substitutionarray['__INVOICE_MONTH__'] = $langs->trans("MonthOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date($object->date, '%m') . ')';
939
-		$substitutionarray['__INVOICE_NEXT_MONTH__'] = $langs->trans("NextMonthOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date(dol_time_plus_duree($object->date, 1, 'm'), '%m') . ')';
940
-		$substitutionarray['__INVOICE_PREVIOUS_MONTH_TEXT__'] = $langs->trans("TextPreviousMonthOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date(dol_time_plus_duree($object->date, -1, 'm'), '%B') . ')';
941
-		$substitutionarray['__INVOICE_MONTH_TEXT__'] = $langs->trans("TextMonthOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date($object->date, '%B') . ')';
942
-		$substitutionarray['__INVOICE_NEXT_MONTH_TEXT__'] = $langs->trans("TextNextMonthOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date(dol_time_plus_duree($object->date, 1, 'm'), '%B') . ')';
943
-		$substitutionarray['__INVOICE_PREVIOUS_YEAR__'] = $langs->trans("PreviousYearOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date(dol_time_plus_duree($object->date, -1, 'y'), '%Y') . ')';
944
-		$substitutionarray['__INVOICE_YEAR__'] = $langs->trans("YearOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date($object->date, '%Y') . ')';
945
-		$substitutionarray['__INVOICE_NEXT_YEAR__'] = $langs->trans("NextYearOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date(dol_time_plus_duree($object->date, 1, 'y'), '%Y') . ')';
937
+		$substitutionarray['__INVOICE_PREVIOUS_MONTH__'] = $langs->trans("PreviousMonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($object->date, -1, 'm'), '%m').')';
938
+		$substitutionarray['__INVOICE_MONTH__'] = $langs->trans("MonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date($object->date, '%m').')';
939
+		$substitutionarray['__INVOICE_NEXT_MONTH__'] = $langs->trans("NextMonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($object->date, 1, 'm'), '%m').')';
940
+		$substitutionarray['__INVOICE_PREVIOUS_MONTH_TEXT__'] = $langs->trans("TextPreviousMonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($object->date, -1, 'm'), '%B').')';
941
+		$substitutionarray['__INVOICE_MONTH_TEXT__'] = $langs->trans("TextMonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date($object->date, '%B').')';
942
+		$substitutionarray['__INVOICE_NEXT_MONTH_TEXT__'] = $langs->trans("TextNextMonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($object->date, 1, 'm'), '%B').')';
943
+		$substitutionarray['__INVOICE_PREVIOUS_YEAR__'] = $langs->trans("PreviousYearOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($object->date, -1, 'y'), '%Y').')';
944
+		$substitutionarray['__INVOICE_YEAR__'] = $langs->trans("YearOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date($object->date, '%Y').')';
945
+		$substitutionarray['__INVOICE_NEXT_YEAR__'] = $langs->trans("NextYearOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($object->date, 1, 'y'), '%Y').')';
946 946
 		// Only on template invoices
947
-		$substitutionarray['__INVOICE_DATE_NEXT_INVOICE_BEFORE_GEN__'] = $langs->trans("DateNextInvoiceBeforeGen") . (isset($object->date_when)?' (' . $langs->trans("Example") . ': ' .dol_print_date($object->date_when, 'dayhour') . ')':'');
948
-		$substitutionarray['__INVOICE_DATE_NEXT_INVOICE_AFTER_GEN__'] = $langs->trans("DateNextInvoiceAfterGen") . (isset($object->date_when)?' (' . $langs->trans("Example") . ': ' . dol_print_date(dol_time_plus_duree($object->date_when, $object->frequency, $object->unit_frequency), 'dayhour') . ')':'');
947
+		$substitutionarray['__INVOICE_DATE_NEXT_INVOICE_BEFORE_GEN__'] = $langs->trans("DateNextInvoiceBeforeGen").(isset($object->date_when) ? ' ('.$langs->trans("Example").': '.dol_print_date($object->date_when, 'dayhour').')' : '');
948
+		$substitutionarray['__INVOICE_DATE_NEXT_INVOICE_AFTER_GEN__'] = $langs->trans("DateNextInvoiceAfterGen").(isset($object->date_when) ? ' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($object->date_when, $object->frequency, $object->unit_frequency), 'dayhour').')' : '');
949 949
 		$substitutionarray['__INVOICE_COUNTER_CURRENT__'] = $langs->trans("Count");
950 950
 		$substitutionarray['__INVOICE_COUNTER_MAX__'] = $langs->trans("MaxPeriodNumber");
951 951
 
952
-		$htmltext = '<i>' . $langs->trans("FollowingConstantsWillBeSubstituted") . ':<br>';
952
+		$htmltext = '<i>'.$langs->trans("FollowingConstantsWillBeSubstituted").':<br>';
953 953
 		foreach ($substitutionarray as $key => $val) {
954
-			$htmltext .= $key . ' = ' . $langs->trans($val) . '<br>';
954
+			$htmltext .= $key.' = '.$langs->trans($val).'<br>';
955 955
 		}
956 956
 		$htmltext .= '</i>';
957 957
 
958 958
 		// Label
959
-		print '<tr><td class="titlefieldcreate">' . $langs->trans("Label") . '</td><td>';
960
-		print '<input class="flat quatrevingtpercent" type="text" name="libelle" value="' . $object->label . '">';
959
+		print '<tr><td class="titlefieldcreate">'.$langs->trans("Label").'</td><td>';
960
+		print '<input class="flat quatrevingtpercent" type="text" name="libelle" value="'.$object->label.'">';
961 961
 		print '</td></tr>';
962 962
 
963 963
 		// Public note
@@ -982,38 +982,38 @@  discard block
 block discarded – undo
982 982
 		}
983 983
 
984 984
 		// Author
985
-		print "<tr><td>" . $langs->trans("Author") . "</td><td>" . $user->getFullName($langs) . "</td></tr>";
985
+		print "<tr><td>".$langs->trans("Author")."</td><td>".$user->getFullName($langs)."</td></tr>";
986 986
 
987 987
 		// Payment term
988
-		print "<tr><td>" . $langs->trans("PaymentConditions") . "</td><td>";
989
-		$form->form_conditions_reglement($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->cond_reglement_id, 'none');
988
+		print "<tr><td>".$langs->trans("PaymentConditions")."</td><td>";
989
+		$form->form_conditions_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, $object->cond_reglement_id, 'none');
990 990
 		print "</td></tr>";
991 991
 
992 992
 		// Payment mode
993
-		print "<tr><td>" . $langs->trans("PaymentMode") . "</td><td>";
994
-		$form->form_modes_reglement($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->mode_reglement_id, 'none', '', 1);
993
+		print "<tr><td>".$langs->trans("PaymentMode")."</td><td>";
994
+		$form->form_modes_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, $object->mode_reglement_id, 'none', '', 1);
995 995
 		print "</td></tr>";
996 996
 
997 997
 		// Project
998 998
 		if (isModEnabled('project') && is_object($object->thirdparty) && $object->thirdparty->id > 0) {
999 999
 			$projectid = GETPOST('projectid') ? GETPOST('projectid') : $object->fk_project;
1000 1000
 			$langs->load('projects');
1001
-			print '<tr><td>' . $langs->trans('Project') . '</td><td>';
1001
+			print '<tr><td>'.$langs->trans('Project').'</td><td>';
1002 1002
 			$numprojet = $formproject->select_projects($object->thirdparty->id, $projectid, 'projectid', 0, 0, 1, 0, 0, 0, 0, '', 0, 0, '');
1003
-			print ' &nbsp; <a href="' . DOL_URL_ROOT . '/projet/card.php?socid=' . $object->thirdparty->id . '&action=create&status=1&backtopage=' . urlencode($_SERVER["PHP_SELF"] . '?action=create&socid=' . $object->thirdparty->id . (!empty($id) ? '&id=' . $id : '')) . '">' . $langs->trans("AddProject") . '</a>';
1003
+			print ' &nbsp; <a href="'.DOL_URL_ROOT.'/projet/card.php?socid='.$object->thirdparty->id.'&action=create&status=1&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create&socid='.$object->thirdparty->id.(!empty($id) ? '&id='.$id : '')).'">'.$langs->trans("AddProject").'</a>';
1004 1004
 			print '</td></tr>';
1005 1005
 		}
1006 1006
 
1007 1007
 		// Bank account
1008 1008
 		if ($object->fk_account > 0) {
1009
-			print "<tr><td>" . $langs->trans('BankAccount') . "</td><td>";
1010
-			$form->formSelectAccount($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->fk_account, 'none');
1009
+			print "<tr><td>".$langs->trans('BankAccount')."</td><td>";
1010
+			$form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_account, 'none');
1011 1011
 			print "</td></tr>";
1012 1012
 		}
1013 1013
 
1014 1014
 		// Model pdf
1015
-		print "<tr><td>" . $langs->trans('Model') . "</td><td>";
1016
-		include_once DOL_DOCUMENT_ROOT . '/core/modules/supplier_invoice/modules_facturefournisseur.php';
1015
+		print "<tr><td>".$langs->trans('Model')."</td><td>";
1016
+		include_once DOL_DOCUMENT_ROOT.'/core/modules/supplier_invoice/modules_facturefournisseur.php';
1017 1017
 		$list = ModelePDFSuppliersInvoices::liste_modeles($db);
1018 1018
 		print $form->selectarray('modelpdf', $list, $conf->global->INVOICE_SUPPLIER_ADDON_PDF);
1019 1019
 		print "</td></tr>";
@@ -1024,7 +1024,7 @@  discard block
 block discarded – undo
1024 1024
 
1025 1025
 		// Autogeneration
1026 1026
 		$title = $langs->trans("Recurrence");
1027
-		print load_fiche_titre(img_picto('', 'recurring', 'class="pictofixedwidth"') . $title, '', '');
1027
+		print load_fiche_titre(img_picto('', 'recurring', 'class="pictofixedwidth"').$title, '', '');
1028 1028
 
1029 1029
 		print '<span class="opacitymedium">'.$langs->trans("ToCreateARecurringInvoiceGeneAuto", $langs->transnoentitiesnoconv('Module2300Name')).'</span><br><br>';
1030 1030
 
@@ -1033,30 +1033,30 @@  discard block
 block discarded – undo
1033 1033
 		print '<table class="border centpercent">';
1034 1034
 
1035 1035
 		// Frequency + unit
1036
-		print '<tr><td class="titlefieldcreate">' . $form->textwithpicto($langs->trans("Frequency"), $langs->transnoentitiesnoconv('toolTipFrequency')) . "</td><td>";
1037
-		print "<input type='text' name='frequency' value='" . GETPOST('frequency', 'int') . "' size='4' />&nbsp;" . $form->selectarray('unit_frequency', array('d' => $langs->trans('Day'), 'm' => $langs->trans('Month'), 'y' => $langs->trans('Year')), (GETPOST('unit_frequency') ? GETPOST('unit_frequency') : 'm'));
1036
+		print '<tr><td class="titlefieldcreate">'.$form->textwithpicto($langs->trans("Frequency"), $langs->transnoentitiesnoconv('toolTipFrequency'))."</td><td>";
1037
+		print "<input type='text' name='frequency' value='".GETPOST('frequency', 'int')."' size='4' />&nbsp;".$form->selectarray('unit_frequency', array('d' => $langs->trans('Day'), 'm' => $langs->trans('Month'), 'y' => $langs->trans('Year')), (GETPOST('unit_frequency') ? GETPOST('unit_frequency') : 'm'));
1038 1038
 		print "</td></tr>";
1039 1039
 
1040 1040
 		// Date next run
1041
-		print "<tr><td>" . $langs->trans('NextDateToExecution') . "</td><td>";
1041
+		print "<tr><td>".$langs->trans('NextDateToExecution')."</td><td>";
1042 1042
 		$date_next_execution = isset($date_next_execution) ? $date_next_execution : (GETPOST('remonth') ? dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear')) : -1);
1043 1043
 		print $form->selectDate($date_next_execution, '', 1, 1, '', "add", 1, 1);
1044 1044
 		print "</td></tr>";
1045 1045
 
1046 1046
 		// Number max of generation
1047
-		print "<tr><td>" . $langs->trans("MaxPeriodNumber") . "</td><td>";
1048
-		print '<input type="text" name="nb_gen_max" value="' . GETPOST('nb_gen_max') . '" size="5" />';
1047
+		print "<tr><td>".$langs->trans("MaxPeriodNumber")."</td><td>";
1048
+		print '<input type="text" name="nb_gen_max" value="'.GETPOST('nb_gen_max').'" size="5" />';
1049 1049
 		print "</td></tr>";
1050 1050
 
1051 1051
 		// Auto validate the invoice
1052
-		print "<tr><td>" . $langs->trans("StatusOfGeneratedInvoices") . "</td><td>";
1052
+		print "<tr><td>".$langs->trans("StatusOfGeneratedInvoices")."</td><td>";
1053 1053
 		$select = array('0' => $langs->trans('BillStatusDraft'), '1' => $langs->trans('BillStatusValidated'));
1054 1054
 		print $form->selectarray('auto_validate', $select, GETPOST('auto_validate'));
1055 1055
 		print "</td></tr>";
1056 1056
 
1057 1057
 		// Auto generate document
1058 1058
 		if (getDolGlobalString('INVOICE_REC_CAN_DISABLE_DOCUMENT_FILE_GENERATION')) {
1059
-			print "<tr><td>" . $langs->trans("StatusOfAutoGeneratedDocuments") . "</td><td>";
1059
+			print "<tr><td>".$langs->trans("StatusOfAutoGeneratedDocuments")."</td><td>";
1060 1060
 			$select = array('0' => $langs->trans('DoNotGenerateDoc'), '1' => $langs->trans('AutoGenerateDoc'));
1061 1061
 			print $form->selectarray('generate_pdf', $select, GETPOST('generate_pdf'));
1062 1062
 			print "</td></tr>";
@@ -1099,7 +1099,7 @@  discard block
 block discarded – undo
1099 1099
 
1100 1100
 		print "</form>\n";
1101 1101
 	} else {
1102
-		dol_print_error('', "Error, no invoice " . $object->id);
1102
+		dol_print_error('', "Error, no invoice ".$object->id);
1103 1103
 	}
1104 1104
 } else {
1105 1105
 	/*
@@ -1113,12 +1113,12 @@  discard block
 block discarded – undo
1113 1113
 
1114 1114
 		// Confirmation de la suppression d'une ligne produit
1115 1115
 		if ($action == 'ask_deleteline') {
1116
-			$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id . '&lineid=' . $lineid, $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteline', '', 'no', 1);
1116
+			$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteline', '', 'no', 1);
1117 1117
 		}
1118 1118
 
1119 1119
 		// Confirm delete of repeatable invoice
1120 1120
 		if ($action == 'ask_deleteinvoice') {
1121
-			$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('DeleteRepeatableInvoice'), $langs->trans('ConfirmDeleteRepeatableInvoice'), 'confirm_deleteinvoice', '', 'no', 1);
1121
+			$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteRepeatableInvoice'), $langs->trans('ConfirmDeleteRepeatableInvoice'), 'confirm_deleteinvoice', '', 'no', 1);
1122 1122
 		}
1123 1123
 
1124 1124
 		print $formconfirm;
@@ -1132,7 +1132,7 @@  discard block
 block discarded – undo
1132 1132
 
1133 1133
 		// Recurring invoice content
1134 1134
 
1135
-		$linkback = '<a href="' . DOL_URL_ROOT . '/fourn/facture/list-rec.php?restore_lastsearch_values=1' . (!empty($socid) ? '&socid=' . $socid : '') . '">' . $langs->trans('BackToList') . '</a>';
1135
+		$linkback = '<a href="'.DOL_URL_ROOT.'/fourn/facture/list-rec.php?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans('BackToList').'</a>';
1136 1136
 
1137 1137
 		$morehtmlref = '';
1138 1138
 		if ($action != 'edittitle') {
@@ -1145,33 +1145,33 @@  discard block
 block discarded – undo
1145 1145
 		$morehtmlref .= $form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $usercancreate, 'string', '', 0, 1);
1146 1146
 		$morehtmlref .= $form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $usercancreate, 'string', '', null, null, '', 1);
1147 1147
 		// Thirdparty
1148
-		$morehtmlref .= '<br>' . $langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1);
1148
+		$morehtmlref .= '<br>'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1);
1149 1149
 
1150 1150
 		// Project
1151 1151
 		if (isModEnabled('project')) {
1152 1152
 			$langs->load('projects');
1153
-			$morehtmlref .= '<br>' . $langs->trans('Project') . ' ';
1153
+			$morehtmlref .= '<br>'.$langs->trans('Project').' ';
1154 1154
 			if ($usercancreate) {
1155 1155
 				if ($action != 'classify') {
1156
-					$morehtmlref .= '<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&token=' . newToken() . '&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
1156
+					$morehtmlref .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> : ';
1157 1157
 				}
1158 1158
 				if ($action == 'classify') {
1159
-					$morehtmlref .= '<form method="post" action="' . $_SERVER['PHP_SELF'] . '?id=' . $object->id . '">';
1159
+					$morehtmlref .= '<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
1160 1160
 					$morehtmlref .= '<input type="hidden" name="action" value="classin">';
1161
-					$morehtmlref .= '<input type="hidden" name="token" value="' . newToken() . '">';
1161
+					$morehtmlref .= '<input type="hidden" name="token" value="'.newToken().'">';
1162 1162
 					$morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
1163
-					$morehtmlref .= '<input type="submit" class="button valignmiddle" value="' . $langs->trans("Modify") . '">';
1163
+					$morehtmlref .= '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
1164 1164
 					$morehtmlref .= '</form>';
1165 1165
 				} else {
1166
-					$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1, '', 'maxwidth300');
1166
+					$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1, '', 'maxwidth300');
1167 1167
 				}
1168 1168
 			} else {
1169 1169
 				if (!empty($object->fk_project)) {
1170 1170
 					$project = new Project($db);
1171 1171
 					$project->fetch($object->fk_project);
1172
-					$morehtmlref .= ' : ' . $project->getNomUrl(1);
1172
+					$morehtmlref .= ' : '.$project->getNomUrl(1);
1173 1173
 					if ($project->title) {
1174
-						$morehtmlref .= ' - ' . $project->title;
1174
+						$morehtmlref .= ' - '.$project->title;
1175 1175
 					}
1176 1176
 				} else {
1177 1177
 					$morehtmlref .= '';
@@ -1190,34 +1190,34 @@  discard block
 block discarded – undo
1190 1190
 
1191 1191
 		print '<table class="border centpercent tableforfield">';
1192 1192
 
1193
-		print '<tr><td class="titlefield">' . $langs->trans('Author') . '</td><td>';
1193
+		print '<tr><td class="titlefield">'.$langs->trans('Author').'</td><td>';
1194 1194
 		print $author->getNomUrl(-1);
1195 1195
 		print "</td></tr>";
1196 1196
 
1197 1197
 		// Label
1198 1198
 		print '<tr>';
1199
-		print '<td>' . $form->editfieldkey("Label", 'libelle', $object->libelle, $object, $usercancreate) . '</td>';
1200
-		print '<td>' . $form->editfieldval("Label", 'libelle', $object->libelle, $object, $usercancreate) . '</td>';
1199
+		print '<td>'.$form->editfieldkey("Label", 'libelle', $object->libelle, $object, $usercancreate).'</td>';
1200
+		print '<td>'.$form->editfieldval("Label", 'libelle', $object->libelle, $object, $usercancreate).'</td>';
1201 1201
 		print '</tr>';
1202 1202
 
1203
-		print '<tr><td>' . $langs->trans('AmountHT') . '</td>';
1204
-		print '<td>' . price($object->total_ht, '', $langs, 1, -1, -1, $conf->currency) . '</td>';
1203
+		print '<tr><td>'.$langs->trans('AmountHT').'</td>';
1204
+		print '<td>'.price($object->total_ht, '', $langs, 1, -1, -1, $conf->currency).'</td>';
1205 1205
 		print '</tr>';
1206 1206
 
1207
-		print '<tr><td>' . $langs->trans("AmountVAT") . '</td><td>' . price($object->total_tva, '', $langs, 1, -1, -1, $conf->currency) . '</td>';
1207
+		print '<tr><td>'.$langs->trans("AmountVAT").'</td><td>'.price($object->total_tva, '', $langs, 1, -1, -1, $conf->currency).'</td>';
1208 1208
 		print '</tr>';
1209 1209
 
1210 1210
 		// Amount Local Taxes
1211 1211
 		if (($mysoc->localtax1_assuj == "1" && $mysoc->useLocalTax(1)) || $object->total_localtax1 != 0) {    // Localtax1
1212
-			print '<tr><td>' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '</td>';
1213
-			print '<td class="nowrap">' . price($object->total_localtax1, 1, '', 1, -1, -1, $conf->currency) . '</td></tr>';
1212
+			print '<tr><td>'.$langs->transcountry("AmountLT1", $mysoc->country_code).'</td>';
1213
+			print '<td class="nowrap">'.price($object->total_localtax1, 1, '', 1, -1, -1, $conf->currency).'</td></tr>';
1214 1214
 		}
1215 1215
 		if (($mysoc->localtax2_assuj == "1" && $mysoc->useLocalTax(2)) || $object->total_localtax2 != 0) {    // Localtax2
1216
-			print '<tr><td>' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '</td>';
1217
-			print '<td class=nowrap">' . price($object->total_localtax2, 1, '', 1, -1, -1, $conf->currency) . '</td></tr>';
1216
+			print '<tr><td>'.$langs->transcountry("AmountLT2", $mysoc->country_code).'</td>';
1217
+			print '<td class=nowrap">'.price($object->total_localtax2, 1, '', 1, -1, -1, $conf->currency).'</td></tr>';
1218 1218
 		}
1219 1219
 
1220
-		print '<tr><td>' . $langs->trans("AmountTTC") . '</td><td colspan="3">' . price($object->total_ttc, '', $langs, 1, -1, -1, $conf->currency) . '</td>';
1220
+		print '<tr><td>'.$langs->trans("AmountTTC").'</td><td colspan="3">'.price($object->total_ttc, '', $langs, 1, -1, -1, $conf->currency).'</td>';
1221 1221
 		print '</tr>';
1222 1222
 
1223 1223
 		// Payment term
@@ -1226,14 +1226,14 @@  discard block
 block discarded – undo
1226 1226
 		print $langs->trans('PaymentConditionsShort');
1227 1227
 		print '</td>';
1228 1228
 		if ($action != 'editconditions' && $usercancreate) {
1229
-			print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editconditions&token=' . newToken() . '&facid=' . $object->id . '">' . img_edit($langs->trans('SetConditions'), 1) . '</a></td>';
1229
+			print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editconditions&token='.newToken().'&facid='.$object->id.'">'.img_edit($langs->trans('SetConditions'), 1).'</a></td>';
1230 1230
 		}
1231 1231
 		print '</tr></table>';
1232 1232
 		print '</td><td>';
1233 1233
 		if ($action == 'editconditions') {
1234
-			$form->form_conditions_reglement($_SERVER['PHP_SELF'] . '?facid=' . $object->id, $object->cond_reglement_id, 'cond_reglement_id');
1234
+			$form->form_conditions_reglement($_SERVER['PHP_SELF'].'?facid='.$object->id, $object->cond_reglement_id, 'cond_reglement_id');
1235 1235
 		} else {
1236
-			$form->form_conditions_reglement($_SERVER['PHP_SELF'] . '?facid=' . $object->id, $object->cond_reglement_id, 'none');
1236
+			$form->form_conditions_reglement($_SERVER['PHP_SELF'].'?facid='.$object->id, $object->cond_reglement_id, 'none');
1237 1237
 		}
1238 1238
 
1239 1239
 		print '</td></tr>';
@@ -1244,14 +1244,14 @@  discard block
 block discarded – undo
1244 1244
 		print $langs->trans('PaymentMode');
1245 1245
 		print '</td>';
1246 1246
 		if ($action != 'editmode' && $usercancreate) {
1247
-			print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editmode&token=' . newToken() . '&facid=' . $object->id . '">' . img_edit($langs->trans('SetMode'), 1) . '</a></td>';
1247
+			print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editmode&token='.newToken().'&facid='.$object->id.'">'.img_edit($langs->trans('SetMode'), 1).'</a></td>';
1248 1248
 		}
1249 1249
 		print '</tr></table>';
1250 1250
 		print '</td><td>';
1251 1251
 		if ($action == 'editmode') {
1252
-			$form->form_modes_reglement($_SERVER['PHP_SELF'] . '?facid=' . $object->id, $object->mode_reglement_id, 'mode_reglement_id', 'CRDT', 1, 1);
1252
+			$form->form_modes_reglement($_SERVER['PHP_SELF'].'?facid='.$object->id, $object->mode_reglement_id, 'mode_reglement_id', 'CRDT', 1, 1);
1253 1253
 		} else {
1254
-			$form->form_modes_reglement($_SERVER['PHP_SELF'] . '?facid=' . $object->id, $object->mode_reglement_id, 'none');
1254
+			$form->form_modes_reglement($_SERVER['PHP_SELF'].'?facid='.$object->id, $object->mode_reglement_id, 'none');
1255 1255
 		}
1256 1256
 		print '</td></tr>';
1257 1257
 
@@ -1264,12 +1264,12 @@  discard block
 block discarded – undo
1264 1264
 			print $form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0);
1265 1265
 			print '</td>';
1266 1266
 			if ($usercancreate && $action != 'editmulticurrencycode' && $object->suspended == $object::STATUS_SUSPENDED) {
1267
-				print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editmulticurrencycode&token=' . newToken() . '&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1) . '</a></td>';
1267
+				print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editmulticurrencycode&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1).'</a></td>';
1268 1268
 			}
1269 1269
 			print '</tr></table>';
1270 1270
 			print '</td><td>';
1271 1271
 			$htmlname = (($usercancreate && $action == 'editmulticurrencycode') ? 'multicurrency_code' : 'none');
1272
-			$form->form_multicurrency_code($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_code, $htmlname);
1272
+			$form->form_multicurrency_code($_SERVER['PHP_SELF'].'?id='.$object->id, $object->multicurrency_code, $htmlname);
1273 1273
 			print '</td></tr>';
1274 1274
 
1275 1275
 			// Multicurrency rate
@@ -1280,7 +1280,7 @@  discard block
 block discarded – undo
1280 1280
 				print $form->editfieldkey('CurrencyRate', 'multicurrency_tx', '', $object, 0);
1281 1281
 				print '</td>';
1282 1282
 				if ($usercancreate && $action != 'editmulticurrencyrate' && $object->suspended == $object::STATUS_SUSPENDED && $object->multicurrency_code && $object->multicurrency_code != $conf->currency) {
1283
-					print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editmulticurrencyrate&token=' . newToken() . '&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1) . '</a></td>';
1283
+					print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editmulticurrencyrate&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1).'</a></td>';
1284 1284
 				}
1285 1285
 				print '</tr></table>';
1286 1286
 				print '</td><td>';
@@ -1288,12 +1288,12 @@  discard block
 block discarded – undo
1288 1288
 					if ($action == 'actualizemulticurrencyrate') {
1289 1289
 						list($object->fk_multicurrency, $object->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($object->db, $object->multicurrency_code);
1290 1290
 					}
1291
-					$form->form_multicurrency_rate($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_tx, ($usercancreate ? 'multicurrency_tx' : 'none'), $object->multicurrency_code);
1291
+					$form->form_multicurrency_rate($_SERVER['PHP_SELF'].'?id='.$object->id, $object->multicurrency_tx, ($usercancreate ? 'multicurrency_tx' : 'none'), $object->multicurrency_code);
1292 1292
 				} else {
1293
-					$form->form_multicurrency_rate($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_tx, 'none', $object->multicurrency_code);
1293
+					$form->form_multicurrency_rate($_SERVER['PHP_SELF'].'?id='.$object->id, $object->multicurrency_tx, 'none', $object->multicurrency_code);
1294 1294
 					if ($object->statut == $object::STATUS_DRAFT && $object->multicurrency_code && $object->multicurrency_code != $conf->currency) {
1295 1295
 						print '<div class="inline-block"> &nbsp; &nbsp; &nbsp; &nbsp; ';
1296
-						print '<a href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=actualizemulticurrencyrate">' . $langs->trans("ActualizeCurrency") . '</a>';
1296
+						print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=actualizemulticurrencyrate">'.$langs->trans("ActualizeCurrency").'</a>';
1297 1297
 						print '</div>';
1298 1298
 					}
1299 1299
 				}
@@ -1309,24 +1309,24 @@  discard block
 block discarded – undo
1309 1309
 
1310 1310
 		$substitutionarray = getCommonSubstitutionArray($langs, 2, null, $object);
1311 1311
 
1312
-		$substitutionarray['__INVOICE_PREVIOUS_MONTH__'] = $langs->trans("PreviousMonthOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date(dol_time_plus_duree($dateexample, -1, 'm'), '%m') . ')';
1313
-		$substitutionarray['__INVOICE_MONTH__'] = $langs->trans("MonthOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date($dateexample, '%m') . ')';
1314
-		$substitutionarray['__INVOICE_NEXT_MONTH__'] = $langs->trans("NextMonthOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date(dol_time_plus_duree($dateexample, 1, 'm'), '%m') . ')';
1315
-		$substitutionarray['__INVOICE_PREVIOUS_MONTH_TEXT__'] = $langs->trans("TextPreviousMonthOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date(dol_time_plus_duree($dateexample, -1, 'm'), '%B') . ')';
1316
-		$substitutionarray['__INVOICE_MONTH_TEXT__'] = $langs->trans("TextMonthOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date($dateexample, '%B') . ')';
1317
-		$substitutionarray['__INVOICE_NEXT_MONTH_TEXT__'] = $langs->trans("TextNextMonthOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date(dol_time_plus_duree($dateexample, 1, 'm'), '%B') . ')';
1318
-		$substitutionarray['__INVOICE_PREVIOUS_YEAR__'] = $langs->trans("PreviousYearOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date(dol_time_plus_duree($dateexample, -1, 'y'), '%Y') . ')';
1319
-		$substitutionarray['__INVOICE_YEAR__'] = $langs->trans("YearOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date($dateexample, '%Y') . ')';
1320
-		$substitutionarray['__INVOICE_NEXT_YEAR__'] = $langs->trans("NextYearOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date(dol_time_plus_duree($dateexample, 1, 'y'), '%Y') . ')';
1312
+		$substitutionarray['__INVOICE_PREVIOUS_MONTH__'] = $langs->trans("PreviousMonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($dateexample, -1, 'm'), '%m').')';
1313
+		$substitutionarray['__INVOICE_MONTH__'] = $langs->trans("MonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date($dateexample, '%m').')';
1314
+		$substitutionarray['__INVOICE_NEXT_MONTH__'] = $langs->trans("NextMonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($dateexample, 1, 'm'), '%m').')';
1315
+		$substitutionarray['__INVOICE_PREVIOUS_MONTH_TEXT__'] = $langs->trans("TextPreviousMonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($dateexample, -1, 'm'), '%B').')';
1316
+		$substitutionarray['__INVOICE_MONTH_TEXT__'] = $langs->trans("TextMonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date($dateexample, '%B').')';
1317
+		$substitutionarray['__INVOICE_NEXT_MONTH_TEXT__'] = $langs->trans("TextNextMonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($dateexample, 1, 'm'), '%B').')';
1318
+		$substitutionarray['__INVOICE_PREVIOUS_YEAR__'] = $langs->trans("PreviousYearOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($dateexample, -1, 'y'), '%Y').')';
1319
+		$substitutionarray['__INVOICE_YEAR__'] = $langs->trans("YearOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date($dateexample, '%Y').')';
1320
+		$substitutionarray['__INVOICE_NEXT_YEAR__'] = $langs->trans("NextYearOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($dateexample, 1, 'y'), '%Y').')';
1321 1321
 		// Only on template invoices
1322
-		$substitutionarray['__INVOICE_DATE_NEXT_INVOICE_BEFORE_GEN__'] = $langs->trans("DateNextInvoiceBeforeGen") . ' (' . $langs->trans("Example") . ': ' . dol_print_date(($object->date_when ? $object->date_when : dol_now()), 'dayhour') . ')';
1323
-		$substitutionarray['__INVOICE_DATE_NEXT_INVOICE_AFTER_GEN__'] = $langs->trans("DateNextInvoiceAfterGen") . ' (' . $langs->trans("Example") . ': ' . dol_print_date(dol_time_plus_duree(($object->date_when ? $object->date_when : dol_now()), $object->frequency, $object->unit_frequency), 'dayhour') . ')';
1322
+		$substitutionarray['__INVOICE_DATE_NEXT_INVOICE_BEFORE_GEN__'] = $langs->trans("DateNextInvoiceBeforeGen").' ('.$langs->trans("Example").': '.dol_print_date(($object->date_when ? $object->date_when : dol_now()), 'dayhour').')';
1323
+		$substitutionarray['__INVOICE_DATE_NEXT_INVOICE_AFTER_GEN__'] = $langs->trans("DateNextInvoiceAfterGen").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree(($object->date_when ? $object->date_when : dol_now()), $object->frequency, $object->unit_frequency), 'dayhour').')';
1324 1324
 		$substitutionarray['__INVOICE_COUNTER_CURRENT__'] = $object->nb_gen_done;
1325 1325
 		$substitutionarray['__INVOICE_COUNTER_MAX__'] = $object->nb_gen_max;
1326 1326
 
1327
-		$htmltext = '<i>' . $langs->trans("FollowingConstantsWillBeSubstituted") . ':<br>';
1327
+		$htmltext = '<i>'.$langs->trans("FollowingConstantsWillBeSubstituted").':<br>';
1328 1328
 		foreach ($substitutionarray as $key => $val) {
1329
-			$htmltext .= $key . ' = ' . $langs->trans($val) . '<br>';
1329
+			$htmltext .= $key.' = '.$langs->trans($val).'<br>';
1330 1330
 		}
1331 1331
 		$htmltext .= '</i>';
1332 1332
 
@@ -1334,7 +1334,7 @@  discard block
 block discarded – undo
1334 1334
 		print '<tr><td>';
1335 1335
 		print $form->editfieldkey($form->textwithpicto($langs->trans('NotePublic'), $htmltext, 1, 'help', '', 0, 2, 'notepublic'), 'note_public', $object->note_public, $object, $usercancreate);
1336 1336
 		print '</td><td class="wordbreak">';
1337
-		print $form->editfieldval($langs->trans("NotePublic"), 'note_public', $object->note_public, $object, $usercancreate, 'textarea:' . ROWS_4 . ':90%', '', null, null, '', 1);
1337
+		print $form->editfieldval($langs->trans("NotePublic"), 'note_public', $object->note_public, $object, $usercancreate, 'textarea:'.ROWS_4.':90%', '', null, null, '', 1);
1338 1338
 		print '</td>';
1339 1339
 		print '</tr>';
1340 1340
 
@@ -1342,7 +1342,7 @@  discard block
 block discarded – undo
1342 1342
 		print '<tr><td>';
1343 1343
 		print $form->editfieldkey($form->textwithpicto($langs->trans("NotePrivate"), $htmltext, 1, 'help', '', 0, 2, 'noteprivate'), 'note_private', $object->note_private, $object, $usercancreate);
1344 1344
 		print '</td><td class="wordbreak">';
1345
-		print $form->editfieldval($langs->trans("NotePrivate"), 'note_private', $object->note_private, $object, $usercancreate, 'textarea:' . ROWS_4 . ':90%', '', null, null, '', 1);
1345
+		print $form->editfieldval($langs->trans("NotePrivate"), 'note_private', $object->note_private, $object, $usercancreate, 'textarea:'.ROWS_4.':90%', '', null, null, '', 1);
1346 1346
 		print '</td>';
1347 1347
 		print '</tr>';
1348 1348
 
@@ -1352,14 +1352,14 @@  discard block
 block discarded – undo
1352 1352
 		print $langs->trans('BankAccount');
1353 1353
 		print '<td>';
1354 1354
 		if ($action != 'editbankaccount' && $usercancreate && $object->statut == FactureFournisseurRec::STATUS_NOTSUSPENDED) {
1355
-			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>';
1355
+			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>';
1356 1356
 		}
1357 1357
 		print '</tr></table>';
1358 1358
 		print '</td><td>';
1359 1359
 		if ($action == 'editbankaccount') {
1360
-			$form->formSelectAccount($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->fk_account, 'fk_account', 1);
1360
+			$form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_account, 'fk_account', 1);
1361 1361
 		} else {
1362
-			$form->formSelectAccount($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->fk_account, 'none');
1362
+			$form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_account, 'none');
1363 1363
 		}
1364 1364
 		print "</td>";
1365 1365
 		print '</tr>';
@@ -1370,18 +1370,18 @@  discard block
 block discarded – undo
1370 1370
 		print $langs->trans('Model');
1371 1371
 		print '<td>';
1372 1372
 		if ($action != 'editmodelpdf' && $usercancreate && $object->statut == FactureFournisseurRec::STATUS_NOTSUSPENDED) {
1373
-			print '<td class="right"><a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=editmodelpdf&token=' . newToken() . '&id=' . $object->id . '">' . img_edit($langs->trans('SetModel'), 1) . '</a></td>';
1373
+			print '<td class="right"><a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=editmodelpdf&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->trans('SetModel'), 1).'</a></td>';
1374 1374
 		}
1375 1375
 		print '</tr></table>';
1376 1376
 		print '</td><td>';
1377 1377
 		if ($action == 'editmodelpdf') {
1378
-			include_once DOL_DOCUMENT_ROOT . '/core/modules/supplier_invoice/modules_facturefournisseur.php';
1378
+			include_once DOL_DOCUMENT_ROOT.'/core/modules/supplier_invoice/modules_facturefournisseur.php';
1379 1379
 			$list = array();
1380 1380
 			$models = ModelePDFSuppliersInvoices::liste_modeles($db);
1381 1381
 			foreach ($models as $k => $model) {
1382
-				$list[] = str_replace(':', '|', $k) . ':' . $model;
1382
+				$list[] = str_replace(':', '|', $k).':'.$model;
1383 1383
 			}
1384
-			$select = 'select;' . implode(',', $list);
1384
+			$select = 'select;'.implode(',', $list);
1385 1385
 			//TODO : Droits
1386 1386
 			print $form->editfieldval($langs->trans('Model'), 'modelpdf', $object->model_pdf, $object, $usercancreate, $select);
1387 1387
 		} else {
@@ -1392,7 +1392,7 @@  discard block
 block discarded – undo
1392 1392
 
1393 1393
 		// Other attributes
1394 1394
 		$cols = 2;
1395
-		include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
1395
+		include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
1396 1396
 
1397 1397
 		print '</table>';
1398 1398
 
@@ -1408,7 +1408,7 @@  discard block
 block discarded – undo
1408 1408
 
1409 1409
 		print '<table class="border centpercent tableforfield">';
1410 1410
 
1411
-		print '<tr><td colspan="2">' . img_picto('', 'recurring', 'class="pictofixedwidth"') . $title . '</td></tr>';
1411
+		print '<tr><td colspan="2">'.img_picto('', 'recurring', 'class="pictofixedwidth"').$title.'</td></tr>';
1412 1412
 
1413 1413
 		// if "frequency" is empty or = 0, the reccurence is disabled
1414 1414
 		print '<tr><td style="width: 50%">';
@@ -1416,23 +1416,23 @@  discard block
 block discarded – undo
1416 1416
 		print $langs->trans('Frequency');
1417 1417
 		print '</td>';
1418 1418
 		if ($action != 'editfrequency' && $usercancreate) {
1419
-			print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editfrequency&token=' . newToken() . '&facid=' . $object->id . '">' . img_edit($langs->trans('Edit'), 1) . '</a></td>';
1419
+			print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editfrequency&token='.newToken().'&facid='.$object->id.'">'.img_edit($langs->trans('Edit'), 1).'</a></td>';
1420 1420
 		}
1421 1421
 		print '</tr></table>';
1422 1422
 		print '</td><td>';
1423 1423
 		if ($action == 'editfrequency') {
1424
-			print '<form method="post" action="' . $_SERVER["PHP_SELF"] . '?facid=' . $object->id . '">';
1424
+			print '<form method="post" action="'.$_SERVER["PHP_SELF"].'?facid='.$object->id.'">';
1425 1425
 			print '<input type="hidden" name="action" value="setfrequency">';
1426
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
1426
+			print '<input type="hidden" name="token" value="'.newToken().'">';
1427 1427
 			print '<table class="nobordernopadding">';
1428 1428
 			print '<tr><td>';
1429
-			print "<input type='text' name='frequency' value='" . $object->frequency . "' size='5' />&nbsp;" . $form->selectarray('unit_frequency', array('d' => $langs->trans('Day'), 'm' => $langs->trans('Month'), 'y' => $langs->trans('Year')), ($object->unit_frequency ? $object->unit_frequency : 'm'));
1429
+			print "<input type='text' name='frequency' value='".$object->frequency."' size='5' />&nbsp;".$form->selectarray('unit_frequency', array('d' => $langs->trans('Day'), 'm' => $langs->trans('Month'), 'y' => $langs->trans('Year')), ($object->unit_frequency ? $object->unit_frequency : 'm'));
1430 1430
 			print '</td>';
1431
-			print '<td class="left"><input type="submit" class="button button-edit" value="' . $langs->trans("Modify") . '"></td>';
1431
+			print '<td class="left"><input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'"></td>';
1432 1432
 			print '</tr></table></form>';
1433 1433
 		} else {
1434 1434
 			if ($object->frequency > 0) {
1435
-				print $langs->trans('FrequencyPer_' . $object->unit_frequency, $object->frequency);
1435
+				print $langs->trans('FrequencyPer_'.$object->unit_frequency, $object->frequency);
1436 1436
 			} else {
1437 1437
 				print $langs->trans("NotARecurringInvoiceTemplate");
1438 1438
 			}
@@ -1451,8 +1451,8 @@  discard block
 block discarded – undo
1451 1451
 			print $form->editfieldval($langs->trans("NextDateToExecution"), 'date_when', $object->date_when, $object, $usercancreate, 'day', $object->date_when, null, '', '', 0, 'strikeIfMaxNbGenReached');
1452 1452
 		}
1453 1453
 		//var_dump(dol_print_date($object->date_when+60, 'dayhour').' - '.dol_print_date($now, 'dayhour'));
1454
-		if (! $object->isMaxNbGenReached()) {
1455
-			if (! $object->suspended && $action != 'editdate_when' && $object->frequency > 0 && $object->date_when && $object->date_when < $now) {
1454
+		if (!$object->isMaxNbGenReached()) {
1455
+			if (!$object->suspended && $action != 'editdate_when' && $object->frequency > 0 && $object->date_when && $object->date_when < $now) {
1456 1456
 				print img_warning($langs->trans("Late"));
1457 1457
 			}
1458 1458
 		} else {
@@ -1485,7 +1485,7 @@  discard block
 block discarded – undo
1485 1485
 			print $langs->trans("StatusOfGeneratedInvoices");
1486 1486
 		}
1487 1487
 		print '</td><td>';
1488
-		$select = 'select;0:' . $langs->trans('BillStatusDraft') . ',1:' . $langs->trans('BillStatusValidated');
1488
+		$select = 'select;0:'.$langs->trans('BillStatusDraft').',1:'.$langs->trans('BillStatusValidated');
1489 1489
 		if ($action == 'auto_validate' || $object->frequency > 0) {
1490 1490
 			print $form->editfieldval($langs->trans("StatusOfGeneratedInvoices"), 'auto_validate', $object->auto_validate, $object, $usercancreate, $select);
1491 1491
 		}
@@ -1501,7 +1501,7 @@  discard block
 block discarded – undo
1501 1501
 			}
1502 1502
 			print '</td>';
1503 1503
 			print '<td>';
1504
-			$select = 'select;0:' . $langs->trans('DoNotGenerateDoc') . ',1:' . $langs->trans('AutogenerateDoc');
1504
+			$select = 'select;0:'.$langs->trans('DoNotGenerateDoc').',1:'.$langs->trans('AutogenerateDoc');
1505 1505
 			if ($action == 'generate_pdf' || $object->frequency > 0) {
1506 1506
 				print $form->editfieldval($langs->trans("StatusOfGeneratedDocuments"), 'generate_pdf', $object->generate_pdf, $object, $usercancreate, $select);
1507 1507
 			}
@@ -1525,7 +1525,7 @@  discard block
 block discarded – undo
1525 1525
 			print '<table class="border centpercent tableforfield">';
1526 1526
 
1527 1527
 			// Nb of generation already done
1528
-			print '<tr><td style="width: 50%">' . $langs->trans("NbOfGenerationDone") . '</td>';
1528
+			print '<tr><td style="width: 50%">'.$langs->trans("NbOfGenerationDone").'</td>';
1529 1529
 			print '<td>';
1530 1530
 			print $object->nb_gen_done ? $object->nb_gen_done : '0';
1531 1531
 			print '</td>';
@@ -1550,15 +1550,15 @@  discard block
 block discarded – undo
1550 1550
 		print '<div class="clearboth"></div><br>';
1551 1551
 
1552 1552
 		// Lines
1553
-		print '	<form name="addproduct" id="addproduct" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . (($action != 'editline') ? '#add' : '#line_' . GETPOST('lineid', 'int')) . '" method="POST">
1554
-        	<input type="hidden" name="token" value="' . newToken() . '">
1555
-        	<input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline') . '">
1553
+		print '	<form name="addproduct" id="addproduct" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.(($action != 'editline') ? '#add' : '#line_'.GETPOST('lineid', 'int')).'" method="POST">
1554
+        	<input type="hidden" name="token" value="' . newToken().'">
1555
+        	<input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline').'">
1556 1556
         	<input type="hidden" name="mode" value="">
1557
-        	<input type="hidden" name="id" value="' . $object->id . '">
1557
+        	<input type="hidden" name="id" value="' . $object->id.'">
1558 1558
         	';
1559 1559
 
1560 1560
 		if (!empty($conf->use_javascript_ajax) && $object->statut == 0) {
1561
-			include DOL_DOCUMENT_ROOT . '/core/tpl/ajaxrow.tpl.php';
1561
+			include DOL_DOCUMENT_ROOT.'/core/tpl/ajaxrow.tpl.php';
1562 1562
 		}
1563 1563
 
1564 1564
 		print '<div class="div-table-responsive-no-min">';
@@ -1612,24 +1612,24 @@  discard block
 block discarded – undo
1612 1612
 		if (empty($object->suspended)) {
1613 1613
 			if ($usercancreate) {
1614 1614
 				if (!empty($object->frequency) && $object->nb_gen_max > 0 && ($object->nb_gen_done >= $object->nb_gen_max)) {
1615
-					print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="' . dol_escape_htmltag($langs->trans("MaxGenerationReached")) . '">' . $langs->trans("CreateBill") . '</a></div>';
1615
+					print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("MaxGenerationReached")).'">'.$langs->trans("CreateBill").'</a></div>';
1616 1616
 				} else {
1617 1617
 					if (empty($object->frequency) || $object->date_when <= $nowlasthour) {
1618
-						print '<div class="inline-block divButAction"><a class="butAction" href="' . DOL_URL_ROOT . '/fourn/facture/card.php?action=create&socid=' . $object->thirdparty->id . '&fac_rec=' . $object->id . '">' . $langs->trans("CreateBill") . '</a></div>';
1618
+						print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/fourn/facture/card.php?action=create&socid='.$object->thirdparty->id.'&fac_rec='.$object->id.'">'.$langs->trans("CreateBill").'</a></div>';
1619 1619
 					} else {
1620
-						print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="' . dol_escape_htmltag($langs->trans("DateIsNotEnough")) . '">' . $langs->trans("CreateBill") . '</a></div>';
1620
+						print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("DateIsNotEnough")).'">'.$langs->trans("CreateBill").'</a></div>';
1621 1621
 					}
1622 1622
 				}
1623 1623
 			} else {
1624
-				print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#">' . $langs->trans("CreateBill") . '</a></div>';
1624
+				print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#">'.$langs->trans("CreateBill").'</a></div>';
1625 1625
 			}
1626 1626
 		}
1627 1627
 
1628 1628
 		if ($usercancreate) {
1629 1629
 			if (empty($object->suspended)) {
1630
-				print '<div class="inline-block divButAction"><a class="butActionDelete" href="' . $_SERVER["PHP_SELF"] . '?action=disable&id=' . $object->id . '&token=' . newToken() . '">' . $langs->trans("Disable") . '</a></div>';
1630
+				print '<div class="inline-block divButAction"><a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?action=disable&id='.$object->id.'&token='.newToken().'">'.$langs->trans("Disable").'</a></div>';
1631 1631
 			} else {
1632
-				print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?action=enable&id=' . $object->id . '&token=' . newToken() . '">' . $langs->trans("Enable") . '</a></div>';
1632
+				print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=enable&id='.$object->id.'&token='.newToken().'">'.$langs->trans("Enable").'</a></div>';
1633 1633
 			}
1634 1634
 		}
1635 1635
 
Please login to merge, or discard this patch.
htdocs/admin/emailcollector_card.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -493,7 +493,7 @@
 block discarded – undo
493 493
 
494 494
 					dol_syslog("imap_open connectstring=".$connectstringsource." login=".$object->login." password=".$object->password." timeoutconnect=".$timeoutconnect." timeoutread=".$timeoutread);
495 495
 
496
-					$result1 = imap_timeout(IMAP_OPENTIMEOUT, $timeoutconnect);	// timeout seems ignored with ssl connect
496
+					$result1 = imap_timeout(IMAP_OPENTIMEOUT, $timeoutconnect); // timeout seems ignored with ssl connect
497 497
 					$result2 = imap_timeout(IMAP_READTIMEOUT, $timeoutread);
498 498
 					$result3 = imap_timeout(IMAP_WRITETIMEOUT, 5);
499 499
 					$result4 = imap_timeout(IMAP_CLOSETIMEOUT, 5);
Please login to merge, or discard this patch.