Completed
Branch develop (bd1927)
by
unknown
22:42
created
htdocs/hrm/evaluation_note.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -77,8 +77,12 @@
 block discarded – undo
77 77
 //if ($user->socid > 0) $socid = $user->socid;
78 78
 $isdraft = (($object->status == Evaluation::STATUS_DRAFT) ? 1 : 0);
79 79
 restrictedArea($user, $object->element, $object, $object->table_element, '', 'fk_soc', 'rowid', $isdraft);
80
-if (empty($conf->hrm->enabled)) accessforbidden();
81
-if (!$permissiontoread) accessforbidden();
80
+if (empty($conf->hrm->enabled)) {
81
+	accessforbidden();
82
+}
83
+if (!$permissiontoread) {
84
+	accessforbidden();
85
+}
82 86
 
83 87
 
84 88
 /*
Please login to merge, or discard this patch.
htdocs/hrm/class/evaluation.class.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -28,8 +28,8 @@  discard block
 block discarded – undo
28 28
  */
29 29
 
30 30
 // Put here all includes required by your class file
31
-require_once DOL_DOCUMENT_ROOT . '/core/class/commonobject.class.php';
32
-require_once DOL_DOCUMENT_ROOT . '/hrm/class/evaluationdet.class.php';
31
+require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php';
32
+require_once DOL_DOCUMENT_ROOT.'/hrm/class/evaluationdet.class.php';
33 33
 
34 34
 
35 35
 /**
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
 		}
218 218
 
219 219
 		if (!$user->hasRight('hrm', 'evaluation', 'readall')) {
220
-			$this->fields['fk_user']['type'] .= ' AND (t.rowid:IN:'.$this->db->sanitize(implode(",", $user->getAllChildIds(1))) .')';
220
+			$this->fields['fk_user']['type'] .= ' AND (t.rowid:IN:'.$this->db->sanitize(implode(",", $user->getAllChildIds(1))).')';
221 221
 		}
222 222
 
223 223
 		$this->date_eval = dol_now();
@@ -253,7 +253,7 @@  discard block
 block discarded – undo
253 253
 		$resultcreate = $this->createCommon($user, $notrigger);
254 254
 
255 255
 		if ($resultcreate > 0) {
256
-			require_once DOL_DOCUMENT_ROOT . '/hrm/class/skillrank.class.php';
256
+			require_once DOL_DOCUMENT_ROOT.'/hrm/class/skillrank.class.php';
257 257
 			$skillRank = new SkillRank($this->db);
258 258
 			$TRequiredRanks = $skillRank->fetchAll('ASC', 't.rowid', 0, 0, '(fk_object:=:'.((int) $this->fk_job).") AND (objecttype:=:'job')");
259 259
 
@@ -646,9 +646,9 @@  discard block
 block discarded – undo
646 646
 	public function getLastEvaluationForUser($fk_user)
647 647
 	{
648 648
 		$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."hrm_evaluation ";
649
-		$sql .=	"WHERE fk_user=".((int) $fk_user)." ";
650
-		$sql .=	"ORDER BY date_eval DESC ";
651
-		$sql .=	"LIMIT 1 ";
649
+		$sql .= "WHERE fk_user=".((int) $fk_user)." ";
650
+		$sql .= "ORDER BY date_eval DESC ";
651
+		$sql .= "LIMIT 1 ";
652 652
 
653 653
 		$res = $this->db->query($sql);
654 654
 		if (!$res) {
@@ -960,7 +960,7 @@  discard block
 block discarded – undo
960 960
 		if (getDolGlobalString('HRMTEST_EVALUATION_ADDON')) {
961 961
 			$mybool = false;
962 962
 
963
-			$file = getDolGlobalString('HRMTEST_EVALUATION_ADDON') . ".php";
963
+			$file = getDolGlobalString('HRMTEST_EVALUATION_ADDON').".php";
964 964
 			$classname = getDolGlobalString('HRMTEST_EVALUATION_ADDON');
965 965
 
966 966
 			// Include file with class
@@ -1057,7 +1057,7 @@  discard block
 block discarded – undo
1057 1057
 		$return .= img_picto('', $this->picto);
1058 1058
 		$return .= '</span>';
1059 1059
 		$return .= '<div class="info-box-content">';
1060
-		$return .= '<span class="info-box-ref inline-block tdoverflowmax150 valignmiddle">' . $this->getNomUrl(1) . '</span>';
1060
+		$return .= '<span class="info-box-ref inline-block tdoverflowmax150 valignmiddle">'.$this->getNomUrl(1).'</span>';
1061 1061
 		$return .= '<input class="fright" id="cb'.$this->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$this->id.'"'.($selected ? ' checked="checked"' : '').'>';
1062 1062
 		if (!empty($arraydata['user'])) {
1063 1063
 			$return .= '<br><span class="info-box-label ">'.$arraydata['user'].'</span>';
Please login to merge, or discard this patch.
htdocs/hrm/evaluation_document.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -99,8 +99,12 @@
 block discarded – undo
99 99
 $isdraft = $object->status == Evaluation::STATUS_DRAFT ? 1 : 0;
100 100
 restrictedArea($user, $object->element, $object, $object->table_element, '', 'fk_soc', 'rowid', $isdraft);
101 101
 
102
-if (!isModEnabled('hrm')) accessforbidden();
103
-if (!$permissiontoread) accessforbidden();
102
+if (!isModEnabled('hrm')) {
103
+	accessforbidden();
104
+}
105
+if (!$permissiontoread) {
106
+	accessforbidden();
107
+}
104 108
 
105 109
 
106 110
 /*
Please login to merge, or discard this patch.
htdocs/core/lib/company.lib.php 1 patch
Spacing   +372 added lines, -372 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 	$h = 0;
49 49
 	$head = array();
50 50
 
51
-	$head[$h][0] = DOL_URL_ROOT . '/societe/card.php?socid=' . $object->id;
51
+	$head[$h][0] = DOL_URL_ROOT.'/societe/card.php?socid='.$object->id;
52 52
 	$head[$h][1] = $langs->trans("ThirdParty");
53 53
 	$head[$h][2] = 'card';
54 54
 	$h++;
@@ -58,21 +58,21 @@  discard block
 block discarded – undo
58 58
 		//$nbContact = count($object->liste_contact(-1,'internal')) + count($object->liste_contact(-1,'external'));
59 59
 		$nbContact = 0;
60 60
 		// Enable caching of thirdrparty count Contacts
61
-		require_once DOL_DOCUMENT_ROOT . '/core/lib/memory.lib.php';
62
-		$cachekey = 'count_contacts_thirdparty_' . $object->id;
61
+		require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php';
62
+		$cachekey = 'count_contacts_thirdparty_'.$object->id;
63 63
 		$dataretrieved = dol_getcache($cachekey);
64 64
 
65 65
 		if (!is_null($dataretrieved)) {
66 66
 			$nbContact = $dataretrieved;
67 67
 		} else {
68 68
 			$sql = "SELECT COUNT(p.rowid) as nb";
69
-			$sql .= " FROM " . MAIN_DB_PREFIX . "socpeople as p";
69
+			$sql .= " FROM ".MAIN_DB_PREFIX."socpeople as p";
70 70
 			// Add table from hooks
71 71
 			$parameters = array('contacttab' => true);
72 72
 			$reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object); // Note that $action and $object may have been modified by hook
73 73
 			$sql .= $hookmanager->resPrint;
74
-			$sql .= " WHERE p.fk_soc = " . ((int) $object->id);
75
-			$sql .= " AND p.entity IN (" . getEntity($object->element) . ")";
74
+			$sql .= " WHERE p.fk_soc = ".((int) $object->id);
75
+			$sql .= " AND p.entity IN (".getEntity($object->element).")";
76 76
 			// Add where from hooks
77 77
 			$parameters = array('contacttab' => true);
78 78
 			$reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters, $object); // Note that $action and $object may have been modified by hook
@@ -83,31 +83,31 @@  discard block
 block discarded – undo
83 83
 				$nbContact = $obj->nb;
84 84
 			}
85 85
 
86
-			dol_setcache($cachekey, $nbContact, 120);	// If setting cache fails, this is not a problem, so we do not test result.
86
+			dol_setcache($cachekey, $nbContact, 120); // If setting cache fails, this is not a problem, so we do not test result.
87 87
 		}
88 88
 
89
-		$head[$h][0] = DOL_URL_ROOT . '/societe/contact.php?socid=' . $object->id;
89
+		$head[$h][0] = DOL_URL_ROOT.'/societe/contact.php?socid='.$object->id;
90 90
 		$head[$h][1] = $langs->trans('ContactsAddresses');
91 91
 		if ($nbContact > 0) {
92
-			$head[$h][1] .= '<span class="badge marginleftonlyshort">' . $nbContact . '</span>';
92
+			$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbContact.'</span>';
93 93
 		}
94 94
 		$head[$h][2] = 'contact';
95 95
 		$h++;
96 96
 	}
97 97
 	if (getDolGlobalString('MAIN_SUPPORT_SHARED_CONTACT_BETWEEN_THIRDPARTIES')) {
98 98
 		// Some features may be unstable with this option, like permissions rules, import contact, ...
99
-		$head[$h][0] = DOL_URL_ROOT . '/societe/societecontact.php?socid=' . $object->id;
99
+		$head[$h][0] = DOL_URL_ROOT.'/societe/societecontact.php?socid='.$object->id;
100 100
 		$nbContact = count($object->liste_contact(-1, 'internal')) + count($object->liste_contact(-1, 'external'));
101 101
 		$head[$h][1] = $langs->trans("ContactsAddressesExt");
102 102
 		if ($nbContact > 0) {
103
-			$head[$h][1] .= '<span class="badge marginleftonlyshort">' . $nbContact . '</span>';
103
+			$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbContact.'</span>';
104 104
 		}
105 105
 		$head[$h][2] = 'contactext';
106 106
 		$h++;
107 107
 	}
108 108
 
109 109
 	if ($object->client == 1 || $object->client == 2 || $object->client == 3) {
110
-		$head[$h][0] = DOL_URL_ROOT . '/comm/card.php?socid=' . $object->id;
110
+		$head[$h][0] = DOL_URL_ROOT.'/comm/card.php?socid='.$object->id;
111 111
 		$head[$h][1] = '';
112 112
 		if (!getDolGlobalString('SOCIETE_DISABLE_PROSPECTS') && ($object->client == 2 || $object->client == 3)) {
113 113
 			$head[$h][1] .= $langs->trans("Prospect");
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
 		if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES')) {
125 125
 			$langs->load("products");
126 126
 			// price
127
-			$head[$h][0] = DOL_URL_ROOT . '/societe/price.php?socid=' . $object->id;
127
+			$head[$h][0] = DOL_URL_ROOT.'/societe/price.php?socid='.$object->id;
128 128
 			$head[$h][1] = $langs->trans("CustomerPrices");
129 129
 			$head[$h][2] = 'price';
130 130
 			$h++;
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
 		$supplier_module_enabled = 1;
136 136
 	}
137 137
 	if ($supplier_module_enabled == 1 && $object->fournisseur && $user->hasRight('fournisseur', 'lire')) {
138
-		$head[$h][0] = DOL_URL_ROOT . '/fourn/card.php?socid=' . $object->id;
138
+		$head[$h][0] = DOL_URL_ROOT.'/fourn/card.php?socid='.$object->id;
139 139
 		$head[$h][1] = $langs->trans("Supplier");
140 140
 		$head[$h][2] = 'supplier';
141 141
 		$h++;
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
 			$mode = 'customer';
155 155
 		}
156 156
 
157
-		$head[$h][0] = DOL_URL_ROOT . '/accountancy/bookkeeping/listbyaccount.php?socid=' . $object->id . '&mode=' . $mode . '&type=sub&search_accountancy_code_start=' . $subledger_start_account . '&search_accountancy_code_end=' . $subledger_end_account;
157
+		$head[$h][0] = DOL_URL_ROOT.'/accountancy/bookkeeping/listbyaccount.php?socid='.$object->id.'&mode='.$mode.'&type=sub&search_accountancy_code_start='.$subledger_start_account.'&search_accountancy_code_end='.$subledger_end_account;
158 158
 		$head[$h][1] = $langs->trans("Accounting");
159 159
 		$head[$h][2] = 'accounting';
160 160
 		$h++;
@@ -163,17 +163,17 @@  discard block
 block discarded – undo
163 163
 	if (isModEnabled('project') && ($user->hasRight('projet', 'lire'))) {
164 164
 		$nbProject = 0;
165 165
 		// Enable caching of thirdrparty count projects
166
-		require_once DOL_DOCUMENT_ROOT . '/core/lib/memory.lib.php';
167
-		$cachekey = 'count_projects_thirdparty_' . $object->id;
166
+		require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php';
167
+		$cachekey = 'count_projects_thirdparty_'.$object->id;
168 168
 		$dataretrieved = dol_getcache($cachekey);
169 169
 
170 170
 		if (!is_null($dataretrieved)) {
171 171
 			$nbProject = $dataretrieved;
172 172
 		} else {
173 173
 			$sql = "SELECT COUNT(n.rowid) as nb";
174
-			$sql .= " FROM " . MAIN_DB_PREFIX . "projet as n";
175
-			$sql .= " WHERE fk_soc = " . ((int) $object->id);
176
-			$sql .= " AND entity IN (" . getEntity('project') . ")";
174
+			$sql .= " FROM ".MAIN_DB_PREFIX."projet as n";
175
+			$sql .= " WHERE fk_soc = ".((int) $object->id);
176
+			$sql .= " AND entity IN (".getEntity('project').")";
177 177
 			$resql = $db->query($sql);
178 178
 			if ($resql) {
179 179
 				$obj = $db->fetch_object($resql);
@@ -181,12 +181,12 @@  discard block
 block discarded – undo
181 181
 			} else {
182 182
 				dol_print_error($db);
183 183
 			}
184
-			dol_setcache($cachekey, $nbProject, 120);	// If setting cache fails, this is not a problem, so we do not test result.
184
+			dol_setcache($cachekey, $nbProject, 120); // If setting cache fails, this is not a problem, so we do not test result.
185 185
 		}
186
-		$head[$h][0] = DOL_URL_ROOT . '/societe/project.php?socid=' . $object->id;
186
+		$head[$h][0] = DOL_URL_ROOT.'/societe/project.php?socid='.$object->id;
187 187
 		$head[$h][1] = $langs->trans("Projects");
188 188
 		if ($nbProject > 0) {
189
-			$head[$h][1] .= '<span class="badge marginleftonlyshort">' . $nbProject . '</span>';
189
+			$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbProject.'</span>';
190 190
 		}
191 191
 		$head[$h][2] = 'project';
192 192
 		$h++;
@@ -194,7 +194,7 @@  discard block
 block discarded – undo
194 194
 
195 195
 	// Tab to link resources
196 196
 	if (isModEnabled('resource') && getDolGlobalString('RESOURCE_ON_THIRDPARTIES')) {
197
-		$head[$h][0] = DOL_URL_ROOT . '/resource/element_resource.php?element=societe&element_id=' . $object->id;
197
+		$head[$h][0] = DOL_URL_ROOT.'/resource/element_resource.php?element=societe&element_id='.$object->id;
198 198
 		$head[$h][1] = $langs->trans("Resources");
199 199
 		$head[$h][2] = 'resources';
200 200
 		$h++;
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
 	if ((isModEnabled('order') || isModEnabled('propal') || isModEnabled('invoice') || isModEnabled('intervention') || isModEnabled("supplier_proposal") || isModEnabled("supplier_order") || isModEnabled("supplier_invoice"))
205 205
 		&& !getDolGlobalString('THIRDPARTIES_DISABLE_RELATED_OBJECT_TAB')
206 206
 	) {
207
-		$head[$h][0] = DOL_URL_ROOT . '/societe/consumption.php?socid=' . $object->id;
207
+		$head[$h][0] = DOL_URL_ROOT.'/societe/consumption.php?socid='.$object->id;
208 208
 		$head[$h][1] = $langs->trans("Referers");
209 209
 		$head[$h][2] = 'consumption';
210 210
 		$h++;
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
 				$servicestatus = 1;
225 225
 			}
226 226
 
227
-			include_once DOL_DOCUMENT_ROOT . '/societe/class/societeaccount.class.php';
227
+			include_once DOL_DOCUMENT_ROOT.'/societe/class/societeaccount.class.php';
228 228
 			$societeaccount = new SocieteAccount($db);
229 229
 			$stripecu = $societeaccount->getCustomerAccount($object->id, 'stripe', $servicestatus); // Get thirdparty cu_...
230 230
 			if ($stripecu) {
@@ -233,12 +233,12 @@  discard block
 block discarded – undo
233 233
 		}
234 234
 
235 235
 		$sql = "SELECT COUNT(n.rowid) as nb";
236
-		$sql .= " FROM " . MAIN_DB_PREFIX . "societe_rib as n";
237
-		$sql .= " WHERE n.fk_soc = " . ((int) $object->id);
236
+		$sql .= " FROM ".MAIN_DB_PREFIX."societe_rib as n";
237
+		$sql .= " WHERE n.fk_soc = ".((int) $object->id);
238 238
 		if (!isModEnabled('stripe')) {
239 239
 			$sql .= " AND (n.stripe_card_ref IS NULL OR n.stripe_card_ref ='')";
240 240
 		} else {
241
-			$sql .= " AND (n.stripe_card_ref IS NULL OR (n.stripe_card_ref IS NOT NULL AND n.status = " . ((int) $servicestatus) . "))";
241
+			$sql .= " AND (n.stripe_card_ref IS NULL OR (n.stripe_card_ref IS NOT NULL AND n.status = ".((int) $servicestatus)."))";
242 242
 		}
243 243
 
244 244
 		$resql = $db->query($sql);
@@ -251,12 +251,12 @@  discard block
 block discarded – undo
251 251
 
252 252
 		//if (isModEnabled('stripe') && $nbBankAccount > 0) $nbBankAccount = '...';	// No way to know exact number
253 253
 
254
-		$head[$h][0] = DOL_URL_ROOT . '/societe/paymentmodes.php?socid=' . urlencode((string) ($object->id));
254
+		$head[$h][0] = DOL_URL_ROOT.'/societe/paymentmodes.php?socid='.urlencode((string) ($object->id));
255 255
 		$head[$h][1] = $title;
256 256
 		if ($foundonexternalonlinesystem) {
257 257
 			$head[$h][1] .= '<span class="badge marginleftonlyshort">...</span>';
258 258
 		} elseif ($nbBankAccount > 0) {
259
-			$head[$h][1] .= '<span class="badge marginleftonlyshort">' . $nbBankAccount . '</span>';
259
+			$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbBankAccount.'</span>';
260 260
 		}
261 261
 		$head[$h][2] = 'rib';
262 262
 		$h++;
@@ -271,15 +271,15 @@  discard block
 block discarded – undo
271 271
 			$site_filter_list[] = 'dolibarr_portal';
272 272
 		}
273 273
 
274
-		$head[$h][0] = DOL_URL_ROOT . '/societe/website.php?id=' . urlencode((string) ($object->id));
274
+		$head[$h][0] = DOL_URL_ROOT.'/societe/website.php?id='.urlencode((string) ($object->id));
275 275
 		$head[$h][1] = $langs->trans("WebSiteAccounts");
276 276
 		$nbNote = 0;
277 277
 		$sql = "SELECT COUNT(n.rowid) as nb";
278
-		$sql .= " FROM " . MAIN_DB_PREFIX . "societe_account as n";
279
-		$sql .= " WHERE fk_soc = " . ((int) $object->id);
280
-		$sql .= " AND entity IN (" . getEntity('thirdpartyaccount') . ")";
278
+		$sql .= " FROM ".MAIN_DB_PREFIX."societe_account as n";
279
+		$sql .= " WHERE fk_soc = ".((int) $object->id);
280
+		$sql .= " AND entity IN (".getEntity('thirdpartyaccount').")";
281 281
 		if (!empty($site_filter_list)) {
282
-			$sql .= " AND n.site IN (" . $db->sanitize("'" . implode("','", $site_filter_list) . "'", 1) . ")";
282
+			$sql .= " AND n.site IN (".$db->sanitize("'".implode("','", $site_filter_list)."'", 1).")";
283 283
 		}
284 284
 		$resql = $db->query($sql);
285 285
 		if ($resql) {
@@ -289,7 +289,7 @@  discard block
 block discarded – undo
289 289
 			dol_print_error($db);
290 290
 		}
291 291
 		if ($nbNote > 0) {
292
-			$head[$h][1] .= '<span class="badge marginleftonlyshort">' . $nbNote . '</span>';
292
+			$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbNote.'</span>';
293 293
 		}
294 294
 		$head[$h][2] = 'website';
295 295
 		$h++;
@@ -299,13 +299,13 @@  discard block
 block discarded – undo
299 299
 		if ($user->hasRight('partnership', 'read')) {
300 300
 			$langs->load("partnership");
301 301
 			$nbPartnership = is_array($object->partnerships) ? count($object->partnerships) : 0;
302
-			$head[$h][0] = DOL_URL_ROOT . '/partnership/partnership_list.php?socid=' . $object->id;
302
+			$head[$h][0] = DOL_URL_ROOT.'/partnership/partnership_list.php?socid='.$object->id;
303 303
 			$head[$h][1] = $langs->trans("Partnerships");
304 304
 			$nbNote = 0;
305 305
 			$sql = "SELECT COUNT(n.rowid) as nb";
306
-			$sql .= " FROM " . MAIN_DB_PREFIX . "partnership as n";
307
-			$sql .= " WHERE fk_soc = " . ((int) $object->id);
308
-			$sql .= " AND entity IN (" . getEntity('partnership') . ")";
306
+			$sql .= " FROM ".MAIN_DB_PREFIX."partnership as n";
307
+			$sql .= " WHERE fk_soc = ".((int) $object->id);
308
+			$sql .= " AND entity IN (".getEntity('partnership').")";
309 309
 			$resql = $db->query($sql);
310 310
 			if ($resql) {
311 311
 				$obj = $db->fetch_object($resql);
@@ -314,11 +314,11 @@  discard block
 block discarded – undo
314 314
 				dol_print_error($db);
315 315
 			}
316 316
 			if ($nbNote > 0) {
317
-				$head[$h][1] .= '<span class="badge marginleftonlyshort">' . $nbNote . '</span>';
317
+				$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbNote.'</span>';
318 318
 			}
319 319
 			$head[$h][2] = 'partnerships';
320 320
 			if ($nbPartnership > 0) {
321
-				$head[$h][1] .= '<span class="badge marginleftonlyshort">' . $nbPartnership . '</span>';
321
+				$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbPartnership.'</span>';
322 322
 			}
323 323
 			$h++;
324 324
 		}
@@ -329,16 +329,16 @@  discard block
 block discarded – undo
329 329
 		//$langs->load('ticket');
330 330
 		$nbTicket = 0;
331 331
 		// Enable caching of thirdparty count notifications
332
-		require_once DOL_DOCUMENT_ROOT . '/core/lib/memory.lib.php';
333
-		$cachekey = 'count_ticket_thirdparty_' . $object->id;
332
+		require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php';
333
+		$cachekey = 'count_ticket_thirdparty_'.$object->id;
334 334
 		$nbticketretreived = dol_getcache($cachekey);
335 335
 		if (!is_null($nbticketretreived)) {
336 336
 			$nbTicket = $nbticketretreived;
337 337
 		} else {
338 338
 			// List of notifications enabled for contacts of the third party
339 339
 			$sql = "SELECT COUNT(t.rowid) as nb";
340
-			$sql .= " FROM " . MAIN_DB_PREFIX . "ticket as t";
341
-			$sql .= " WHERE t.fk_soc = " . ((int) $object->id);
340
+			$sql .= " FROM ".MAIN_DB_PREFIX."ticket as t";
341
+			$sql .= " WHERE t.fk_soc = ".((int) $object->id);
342 342
 			$resql = $db->query($sql);
343 343
 			if ($resql) {
344 344
 				$obj = $db->fetch_object($resql);
@@ -346,13 +346,13 @@  discard block
 block discarded – undo
346 346
 			} else {
347 347
 				dol_print_error($db);
348 348
 			}
349
-			dol_setcache($cachekey, $nbTicket, 120);		// If setting cache fails, this is not a problem, so we do not test result.
349
+			dol_setcache($cachekey, $nbTicket, 120); // If setting cache fails, this is not a problem, so we do not test result.
350 350
 		}
351 351
 
352
-		$head[$h][0] = DOL_URL_ROOT . '/ticket/list.php?socid=' . urlencode((string) ($object->id));
352
+		$head[$h][0] = DOL_URL_ROOT.'/ticket/list.php?socid='.urlencode((string) ($object->id));
353 353
 		$head[$h][1] = $langs->trans("Tickets");
354 354
 		if ($nbTicket > 0) {
355
-			$head[$h][1] .= '<span class="badge marginleftonlyshort">' . $nbTicket . '</span>';
355
+			$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbTicket.'</span>';
356 356
 		}
357 357
 		$head[$h][2] = 'ticket';
358 358
 		$h++;
@@ -371,20 +371,20 @@  discard block
 block discarded – undo
371 371
 			$langs->load('mails');
372 372
 			$nbNotif = 0;
373 373
 			// Enable caching of thirdparty count notifications
374
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/memory.lib.php';
375
-			$cachekey = 'count_notifications_thirdparty_' . $object->id;
374
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php';
375
+			$cachekey = 'count_notifications_thirdparty_'.$object->id;
376 376
 			$dataretrieved = dol_getcache($cachekey);
377 377
 			if (!is_null($dataretrieved)) {
378 378
 				$nbNotif = $dataretrieved;
379 379
 			} else {
380 380
 				// List of notifications enabled for contacts of the third party
381 381
 				$sql = "SELECT COUNT(n.rowid) as nb";
382
-				$sql .= " FROM " . MAIN_DB_PREFIX . "c_action_trigger as a,";
383
-				$sql .= " " . MAIN_DB_PREFIX . "notify_def as n,";
384
-				$sql .= " " . MAIN_DB_PREFIX . "socpeople as c";
382
+				$sql .= " FROM ".MAIN_DB_PREFIX."c_action_trigger as a,";
383
+				$sql .= " ".MAIN_DB_PREFIX."notify_def as n,";
384
+				$sql .= " ".MAIN_DB_PREFIX."socpeople as c";
385 385
 				$sql .= " WHERE a.rowid = n.fk_action";
386 386
 				$sql .= " AND c.rowid = n.fk_contact";
387
-				$sql .= " AND c.fk_soc = " . ((int) $object->id);
387
+				$sql .= " AND c.fk_soc = ".((int) $object->id);
388 388
 				$resql = $db->query($sql);
389 389
 				if ($resql) {
390 390
 					$obj = $db->fetch_object($resql);
@@ -392,13 +392,13 @@  discard block
 block discarded – undo
392 392
 				} else {
393 393
 					dol_print_error($db);
394 394
 				}
395
-				dol_setcache($cachekey, $nbNotif, 120);		// If setting cache fails, this is not a problem, so we do not test result.
395
+				dol_setcache($cachekey, $nbNotif, 120); // If setting cache fails, this is not a problem, so we do not test result.
396 396
 			}
397 397
 
398
-			$head[$h][0] = DOL_URL_ROOT . '/societe/notify/card.php?socid=' . urlencode((string) ($object->id));
398
+			$head[$h][0] = DOL_URL_ROOT.'/societe/notify/card.php?socid='.urlencode((string) ($object->id));
399 399
 			$head[$h][1] = $langs->trans("Notifications");
400 400
 			if ($nbNotif > 0) {
401
-				$head[$h][1] .= '<span class="badge marginleftonlyshort">' . $nbNotif . '</span>';
401
+				$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbNotif.'</span>';
402 402
 			}
403 403
 			$head[$h][2] = 'notify';
404 404
 			$h++;
@@ -412,10 +412,10 @@  discard block
 block discarded – undo
412 412
 		if (!empty($object->note_public)) {
413 413
 			$nbNote++;
414 414
 		}
415
-		$head[$h][0] = DOL_URL_ROOT . '/societe/note.php?id=' . urlencode((string) ($object->id));
415
+		$head[$h][0] = DOL_URL_ROOT.'/societe/note.php?id='.urlencode((string) ($object->id));
416 416
 		$head[$h][1] = $langs->trans("Notes");
417 417
 		if ($nbNote > 0) {
418
-			$head[$h][1] .= '<span class="badge marginleftonlyshort">' . $nbNote . '</span>';
418
+			$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbNote.'</span>';
419 419
 		}
420 420
 		$head[$h][2] = 'note';
421 421
 		$h++;
@@ -423,59 +423,59 @@  discard block
 block discarded – undo
423 423
 		// Attached files and Links
424 424
 		$totalAttached = 0;
425 425
 		// Enable caching of thirdrparty count attached files and links
426
-		require_once DOL_DOCUMENT_ROOT . '/core/lib/memory.lib.php';
427
-		$cachekey = 'count_attached_thirdparty_' . $object->id;
426
+		require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php';
427
+		$cachekey = 'count_attached_thirdparty_'.$object->id;
428 428
 		$dataretrieved = dol_getcache($cachekey);
429 429
 		if (!is_null($dataretrieved)) {
430 430
 			$totalAttached = $dataretrieved;
431 431
 		} else {
432
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
433
-			require_once DOL_DOCUMENT_ROOT . '/core/class/link.class.php';
434
-			$upload_dir = $conf->societe->multidir_output[$object->entity ?? $conf->entity] . "/" . $object->id;
432
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
433
+			require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php';
434
+			$upload_dir = $conf->societe->multidir_output[$object->entity ?? $conf->entity]."/".$object->id;
435 435
 			$nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png)$'));
436 436
 			$nbLinks = Link::count($db, $object->element, $object->id);
437 437
 			$totalAttached = $nbFiles + $nbLinks;
438
-			dol_setcache($cachekey, $totalAttached, 120);		// If setting cache fails, this is not a problem, so we do not test result.
438
+			dol_setcache($cachekey, $totalAttached, 120); // If setting cache fails, this is not a problem, so we do not test result.
439 439
 		}
440 440
 
441
-		$head[$h][0] = DOL_URL_ROOT . '/societe/document.php?socid=' . $object->id;
441
+		$head[$h][0] = DOL_URL_ROOT.'/societe/document.php?socid='.$object->id;
442 442
 		$head[$h][1] = $langs->trans("Documents");
443 443
 		if (($totalAttached) > 0) {
444
-			$head[$h][1] .= '<span class="badge marginleftonlyshort">' . ($totalAttached) . '</span>';
444
+			$head[$h][1] .= '<span class="badge marginleftonlyshort">'.($totalAttached).'</span>';
445 445
 		}
446 446
 		$head[$h][2] = 'document';
447 447
 		$h++;
448 448
 	}
449 449
 
450
-	$head[$h][0] = DOL_URL_ROOT . '/societe/messaging.php?socid=' . $object->id;
450
+	$head[$h][0] = DOL_URL_ROOT.'/societe/messaging.php?socid='.$object->id;
451 451
 	$head[$h][1] = $langs->trans("Events");
452 452
 	if (isModEnabled('agenda') && ($user->hasRight('agenda', 'myactions', 'read') || $user->hasRight('agenda', 'allactions', 'read'))) {
453 453
 		$nbEvent = 0;
454 454
 		// Enable caching of thirdparty count actioncomm
455
-		require_once DOL_DOCUMENT_ROOT . '/core/lib/memory.lib.php';
456
-		$cachekey = 'count_events_thirdparty_' . $object->id;
455
+		require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php';
456
+		$cachekey = 'count_events_thirdparty_'.$object->id;
457 457
 		$dataretrieved = dol_getcache($cachekey);
458 458
 		if (!is_null($dataretrieved)) {
459 459
 			$nbEvent = $dataretrieved;
460 460
 		} else {
461 461
 			$sql = "SELECT COUNT(id) as nb";
462
-			$sql .= " FROM " . MAIN_DB_PREFIX . "actioncomm";
463
-			$sql .= " WHERE fk_soc = " . ((int) $object->id);
464
-			$sql .= " AND entity IN (" . getEntity('agenda') . ")";
462
+			$sql .= " FROM ".MAIN_DB_PREFIX."actioncomm";
463
+			$sql .= " WHERE fk_soc = ".((int) $object->id);
464
+			$sql .= " AND entity IN (".getEntity('agenda').")";
465 465
 			$resql = $db->query($sql);
466 466
 			if ($resql) {
467 467
 				$obj = $db->fetch_object($resql);
468 468
 				$nbEvent = $obj->nb;
469 469
 			} else {
470
-				dol_syslog('Failed to count actioncomm ' . $db->lasterror(), LOG_ERR);
470
+				dol_syslog('Failed to count actioncomm '.$db->lasterror(), LOG_ERR);
471 471
 			}
472
-			dol_setcache($cachekey, $nbEvent, 120);		// If setting cache fails, this is not a problem, so we do not test result.
472
+			dol_setcache($cachekey, $nbEvent, 120); // If setting cache fails, this is not a problem, so we do not test result.
473 473
 		}
474 474
 
475 475
 		$head[$h][1] .= '/';
476 476
 		$head[$h][1] .= $langs->trans("Agenda");
477 477
 		if ($nbEvent > 0) {
478
-			$head[$h][1] .= '<span class="badge marginleftonlyshort">' . $nbEvent . '</span>';
478
+			$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbEvent.'</span>';
479 479
 		}
480 480
 	}
481 481
 	$head[$h][2] = 'agenda';
@@ -505,12 +505,12 @@  discard block
 block discarded – undo
505 505
 	$h = 0;
506 506
 	$head = array();
507 507
 
508
-	$head[$h][0] = DOL_URL_ROOT . '/societe/card.php?socid=' . $object->id;
508
+	$head[$h][0] = DOL_URL_ROOT.'/societe/card.php?socid='.$object->id;
509 509
 	$head[$h][1] = $langs->trans("ThirdParty");
510 510
 	$head[$h][2] = 'company';
511 511
 	$h++;
512 512
 
513
-	$head[$h][0] = 'commerciaux.php?socid=' . $object->id;
513
+	$head[$h][0] = 'commerciaux.php?socid='.$object->id;
514 514
 	$head[$h][1] = $langs->trans("SalesRepresentative");
515 515
 	$head[$h][2] = 'salesrepresentative';
516 516
 	$h++;
@@ -536,7 +536,7 @@  discard block
 block discarded – undo
536 536
 	$h = 0;
537 537
 	$head = array();
538 538
 
539
-	$head[$h][0] = DOL_URL_ROOT . '/societe/admin/societe.php';
539
+	$head[$h][0] = DOL_URL_ROOT.'/societe/admin/societe.php';
540 540
 	$head[$h][1] = $langs->trans("Miscellaneous");
541 541
 	$head[$h][2] = 'general';
542 542
 	$h++;
@@ -547,26 +547,26 @@  discard block
 block discarded – undo
547 547
 	// $this->tabs = array('entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__');   to remove a tab
548 548
 	complete_head_from_modules($conf, $langs, null, $head, $h, 'company_admin');
549 549
 
550
-	$head[$h][0] = DOL_URL_ROOT . '/societe/admin/societe_extrafields.php';
550
+	$head[$h][0] = DOL_URL_ROOT.'/societe/admin/societe_extrafields.php';
551 551
 	$head[$h][1] = $langs->trans("ExtraFieldsThirdParties");
552 552
 	$nbExtrafields = $extrafields->attributes['societe']['count'];
553 553
 	if ($nbExtrafields > 0) {
554
-		$head[$h][1] .= '<span class="badge marginleftonlyshort">' . $nbExtrafields . '</span>';
554
+		$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbExtrafields.'</span>';
555 555
 	}
556 556
 	$head[$h][2] = 'attributes';
557 557
 	$h++;
558 558
 
559
-	$head[$h][0] = DOL_URL_ROOT . '/societe/admin/contact_extrafields.php';
559
+	$head[$h][0] = DOL_URL_ROOT.'/societe/admin/contact_extrafields.php';
560 560
 	$head[$h][1] = $langs->trans("ExtraFieldsContacts");
561 561
 	$nbExtrafields = $extrafields->attributes['socpeople']['count'];
562 562
 	if ($nbExtrafields > 0) {
563
-		$head[$h][1] .= '<span class="badge marginleftonlyshort">' . $nbExtrafields . '</span>';
563
+		$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbExtrafields.'</span>';
564 564
 	}
565 565
 	$head[$h][2] = 'attributes_contacts';
566 566
 	$h++;
567 567
 
568 568
 	if (getDolGlobalString('MAIN_FEATURES_LEVEL') >= 1) {
569
-		$head[$h][0] = DOL_URL_ROOT . '/societe/admin/public_interface.php';
569
+		$head[$h][0] = DOL_URL_ROOT.'/societe/admin/public_interface.php';
570 570
 		$head[$h][1] = $langs->trans("PublicUrl");
571 571
 		$head[$h][2] = 'publicurl';
572 572
 		$h++;
@@ -615,13 +615,13 @@  discard block
 block discarded – undo
615 615
 		$outputlangs = $langs;
616 616
 	}
617 617
 
618
-	$sql = "SELECT rowid, code, label FROM " . MAIN_DB_PREFIX . "c_country";
618
+	$sql = "SELECT rowid, code, label FROM ".MAIN_DB_PREFIX."c_country";
619 619
 	if (is_numeric($searchkey)) {
620
-		$sql .= " WHERE rowid = " . ((int) $searchkey);
620
+		$sql .= " WHERE rowid = ".((int) $searchkey);
621 621
 	} elseif (!empty($searchkey)) {
622
-		$sql .= " WHERE code = '" . $db->escape($searchkey) . "'";
622
+		$sql .= " WHERE code = '".$db->escape($searchkey)."'";
623 623
 	} else {
624
-		$sql .= " WHERE label = '" . $db->escape($searchlabel) . "'";
624
+		$sql .= " WHERE label = '".$db->escape($searchlabel)."'";
625 625
 	}
626 626
 
627 627
 	$resql = $dbtouse->query($sql);
@@ -632,9 +632,9 @@  discard block
 block discarded – undo
632 632
 			if (is_object($outputlangs)) {
633 633
 				$outputlangs->load("dict");
634 634
 				if ($entconv) {
635
-					$label = ($obj->code && ($outputlangs->trans("Country" . $obj->code) != "Country" . $obj->code)) ? $outputlangs->trans("Country" . $obj->code) : $label;
635
+					$label = ($obj->code && ($outputlangs->trans("Country".$obj->code) != "Country".$obj->code)) ? $outputlangs->trans("Country".$obj->code) : $label;
636 636
 				} else {
637
-					$label = ($obj->code && ($outputlangs->transnoentitiesnoconv("Country" . $obj->code) != "Country" . $obj->code)) ? $outputlangs->transnoentitiesnoconv("Country" . $obj->code) : $label;
637
+					$label = ($obj->code && ($outputlangs->transnoentitiesnoconv("Country".$obj->code) != "Country".$obj->code)) ? $outputlangs->transnoentitiesnoconv("Country".$obj->code) : $label;
638 638
 				}
639 639
 			}
640 640
 			if ($withcode == '1') {
@@ -683,8 +683,8 @@  discard block
 block discarded – undo
683 683
 	}
684 684
 
685 685
 	$sql = "SELECT d.rowid as id, d.code_departement as code, d.nom as name, d.active, c.label as country, c.code as country_code, r.code_region as region_code, r.nom as region_name FROM";
686
-	$sql .= " " . MAIN_DB_PREFIX . "c_departements as d, " . MAIN_DB_PREFIX . "c_regions as r," . MAIN_DB_PREFIX . "c_country as c";
687
-	$sql .= " WHERE d.fk_region=r.code_region and r.fk_pays=c.rowid and d.rowid=" . ((int) $id);
686
+	$sql .= " ".MAIN_DB_PREFIX."c_departements as d, ".MAIN_DB_PREFIX."c_regions as r,".MAIN_DB_PREFIX."c_country as c";
687
+	$sql .= " WHERE d.fk_region=r.code_region and r.fk_pays=c.rowid and d.rowid=".((int) $id);
688 688
 	$sql .= " AND d.active = 1 AND r.active = 1 AND c.active = 1";
689 689
 	$sql .= " ORDER BY c.code, d.code_departement";
690 690
 
@@ -697,21 +697,21 @@  discard block
 block discarded – undo
697 697
 			if (is_object($outputlangs)) {
698 698
 				$outputlangs->load("dict");
699 699
 				if ($entconv) {
700
-					$label = ($obj->code && ($outputlangs->trans("State" . $obj->code) != "State" . $obj->code)) ? $outputlangs->trans("State" . $obj->code) : $label;
700
+					$label = ($obj->code && ($outputlangs->trans("State".$obj->code) != "State".$obj->code)) ? $outputlangs->trans("State".$obj->code) : $label;
701 701
 				} else {
702
-					$label = ($obj->code && ($outputlangs->transnoentitiesnoconv("State" . $obj->code) != "State" . $obj->code)) ? $outputlangs->transnoentitiesnoconv("State" . $obj->code) : $label;
702
+					$label = ($obj->code && ($outputlangs->transnoentitiesnoconv("State".$obj->code) != "State".$obj->code)) ? $outputlangs->transnoentitiesnoconv("State".$obj->code) : $label;
703 703
 				}
704 704
 			}
705 705
 
706 706
 			if ($withcode == 1) {
707 707
 				if ($withregion == 1) {
708
-					return $label = $obj->region_name . ' - ' . $obj->code . ' - ' . ($langs->trans($obj->code) != $obj->code ? $langs->trans($obj->code) : ($obj->name != '-' ? $obj->name : ''));
708
+					return $label = $obj->region_name.' - '.$obj->code.' - '.($langs->trans($obj->code) != $obj->code ? $langs->trans($obj->code) : ($obj->name != '-' ? $obj->name : ''));
709 709
 				} else {
710
-					return $label = $obj->code . ' - ' . ($langs->trans($obj->code) != $obj->code ? $langs->trans($obj->code) : ($obj->name != '-' ? $obj->name : ''));
710
+					return $label = $obj->code.' - '.($langs->trans($obj->code) != $obj->code ? $langs->trans($obj->code) : ($obj->name != '-' ? $obj->name : ''));
711 711
 				}
712 712
 			} elseif ($withcode == 2) {
713 713
 				if ($withregion == 1) {
714
-					return $label = $obj->region_name . ' - ' . ($langs->trans($obj->code) != $obj->code ? $langs->trans($obj->code) : ($obj->name != '-' ? $obj->name : ''));
714
+					return $label = $obj->region_name.' - '.($langs->trans($obj->code) != $obj->code ? $langs->trans($obj->code) : ($obj->name != '-' ? $obj->name : ''));
715 715
 				} else {
716 716
 					return $label = ($langs->trans($obj->code) != $obj->code ? $langs->trans($obj->code) : ($obj->name != '-' ? $obj->name : ''));
717 717
 				}
@@ -723,7 +723,7 @@  discard block
 block discarded – undo
723 723
 				}
724 724
 			} else {
725 725
 				if ($withregion == 1) {
726
-					return $label = $obj->region_name . ' - ' . $label;
726
+					return $label = $obj->region_name.' - '.$label;
727 727
 				} else {
728 728
 					return $label;
729 729
 				}
@@ -757,13 +757,13 @@  discard block
 block discarded – undo
757 757
 	$outputlangs->load("dict");
758 758
 
759 759
 	// If there is a translation, we can send immediately the label
760
-	if ($outputlangs->trans("Currency" . $code_iso) != "Currency" . $code_iso) {
761
-		return ($withcode ? $code_iso . ' - ' : '') . $outputlangs->trans("Currency" . $code_iso);
760
+	if ($outputlangs->trans("Currency".$code_iso) != "Currency".$code_iso) {
761
+		return ($withcode ? $code_iso.' - ' : '').$outputlangs->trans("Currency".$code_iso);
762 762
 	}
763 763
 
764 764
 	// If no translation, we read table to get label by default
765
-	$sql = "SELECT label FROM " . MAIN_DB_PREFIX . "c_currencies";
766
-	$sql .= " WHERE code_iso='" . $db->escape($code_iso) . "'";
765
+	$sql = "SELECT label FROM ".MAIN_DB_PREFIX."c_currencies";
766
+	$sql .= " WHERE code_iso='".$db->escape($code_iso)."'";
767 767
 
768 768
 	$resql = $db->query($sql);
769 769
 	if ($resql) {
@@ -799,12 +799,12 @@  discard block
 block discarded – undo
799 799
 		return '';
800 800
 	}
801 801
 
802
-	if (!empty($conf->cache["legalform_" . $langs->defaultlang . '_' . $code])) {
803
-		return $conf->cache["legalform_" . $langs->defaultlang . '_' . $code];
802
+	if (!empty($conf->cache["legalform_".$langs->defaultlang.'_'.$code])) {
803
+		return $conf->cache["legalform_".$langs->defaultlang.'_'.$code];
804 804
 	}
805 805
 
806
-	$sql = "SELECT libelle as label FROM " . MAIN_DB_PREFIX . "c_forme_juridique";
807
-	$sql .= " WHERE code = '" . $db->escape($code) . "'";
806
+	$sql = "SELECT libelle as label FROM ".MAIN_DB_PREFIX."c_forme_juridique";
807
+	$sql .= " WHERE code = '".$db->escape($code)."'";
808 808
 
809 809
 	dol_syslog("Company.lib::getFormeJuridiqueLabel", LOG_DEBUG);
810 810
 
@@ -816,14 +816,14 @@  discard block
 block discarded – undo
816 816
 
817 817
 			$label = ($obj->label != '-' ? $obj->label : '');
818 818
 
819
-			$conf->cache["legalform_" . $langs->defaultlang . '_' . $code] = $label;
819
+			$conf->cache["legalform_".$langs->defaultlang.'_'.$code] = $label;
820 820
 
821 821
 			return $langs->trans($label);
822 822
 		} else {
823 823
 			return $langs->trans("NotDefined");
824 824
 		}
825 825
 	} else {
826
-		return 'Error ' . $db->lasterror();
826
+		return 'Error '.$db->lasterror();
827 827
 	}
828 828
 }
829 829
 
@@ -845,7 +845,7 @@  discard block
 block discarded – undo
845 845
 		// Use of cache to reduce number of database requests
846 846
 		$country_code_in_EEC = $conf->cache['country_code_in_EEC'];
847 847
 	} else {
848
-		$sql = "SELECT cc.code FROM " . MAIN_DB_PREFIX . "c_country as cc";
848
+		$sql = "SELECT cc.code FROM ".MAIN_DB_PREFIX."c_country as cc";
849 849
 		$sql .= " WHERE cc.eec = 1";
850 850
 
851 851
 		$resql = $db->query($sql);
@@ -877,7 +877,7 @@  discard block
 block discarded – undo
877 877
 		return false;
878 878
 	}
879 879
 
880
-	$country_code_in_EEC = getCountriesInEEC();		// This make a database call but there is a cache done into $conf->cache['country_code_in_EEC']
880
+	$country_code_in_EEC = getCountriesInEEC(); // This make a database call but there is a cache done into $conf->cache['country_code_in_EEC']
881 881
 
882 882
 	//print "dd".$object->country_code;
883 883
 	return in_array($object->country_code, $country_code_in_EEC);
@@ -900,7 +900,7 @@  discard block
 block discarded – undo
900 900
 		// Use of cache to reduce number of database requests
901 901
 		$country_code_in_SEPA = $conf->cache['country_code_in_SEPA'];
902 902
 	} else {
903
-		$sql = "SELECT cc.code FROM " . MAIN_DB_PREFIX . "c_country as cc";
903
+		$sql = "SELECT cc.code FROM ".MAIN_DB_PREFIX."c_country as cc";
904 904
 		$sql .= " WHERE cc.sepa = 1";
905 905
 
906 906
 		$resql = $db->query($sql);
@@ -932,7 +932,7 @@  discard block
 block discarded – undo
932 932
 		return false;
933 933
 	}
934 934
 
935
-	$country_code_in_SEPA = getCountriesInSEPA();		// This make a database call but there is a cache done into $conf->cache['country_code_in_SEPA']
935
+	$country_code_in_SEPA = getCountriesInSEPA(); // This make a database call but there is a cache done into $conf->cache['country_code_in_SEPA']
936 936
 
937 937
 	//print "dd".$object->country_code;
938 938
 	return in_array($object->country_code, $country_code_in_SEPA);
@@ -962,21 +962,21 @@  discard block
 block discarded – undo
962 962
 
963 963
 		$newcardbutton = '';
964 964
 		if ($user->hasRight('projet', 'creer') && empty($nocreatelink)) {
965
-			$newcardbutton .= dolGetButtonTitle($langs->trans('AddProject'), '', 'fa fa-plus-circle', DOL_URL_ROOT . '/projet/card.php?socid=' . $object->id . '&action=create&backtopage=' . urlencode($backtopage));
965
+			$newcardbutton .= dolGetButtonTitle($langs->trans('AddProject'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/projet/card.php?socid='.$object->id.'&action=create&backtopage='.urlencode($backtopage));
966 966
 		}
967 967
 
968 968
 		print "\n";
969
-		print load_fiche_titre($langs->trans("ProjectsDedicatedToThisThirdParty"), $newcardbutton . $morehtmlright, '');
969
+		print load_fiche_titre($langs->trans("ProjectsDedicatedToThisThirdParty"), $newcardbutton.$morehtmlright, '');
970 970
 
971
-		print '<div class="div-table-responsive">' . "\n";
971
+		print '<div class="div-table-responsive">'."\n";
972 972
 		print '<table class="noborder centpercent">';
973 973
 
974 974
 		$sql  = "SELECT p.rowid as id, p.entity, p.title, p.ref, p.public, p.dateo as do, p.datee as de, p.fk_statut as status, p.fk_opp_status, p.opp_amount, p.opp_percent, p.tms as date_modification, p.budget_amount";
975 975
 		$sql .= ", cls.code as opp_status_code";
976
-		$sql .= " FROM " . MAIN_DB_PREFIX . "projet as p";
977
-		$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_lead_status as cls on p.fk_opp_status = cls.rowid";
978
-		$sql .= " WHERE p.fk_soc = " . ((int) $object->id);
979
-		$sql .= " AND p.entity IN (" . getEntity('project') . ")";
976
+		$sql .= " FROM ".MAIN_DB_PREFIX."projet as p";
977
+		$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_lead_status as cls on p.fk_opp_status = cls.rowid";
978
+		$sql .= " WHERE p.fk_soc = ".((int) $object->id);
979
+		$sql .= " AND p.entity IN (".getEntity('project').")";
980 980
 		$sql .= " ORDER BY p.dateo DESC";
981 981
 
982 982
 		$result = $db->query($sql);
@@ -990,14 +990,14 @@  discard block
 block discarded – undo
990 990
 				print $selectedfields;
991 991
 				print '</td>';
992 992
 			}
993
-			print '<td>' . $langs->trans("Ref") . '</td>';
994
-			print '<td>' . $langs->trans("Name") . '</td>';
995
-			print '<td class="center">' . $langs->trans("DateStart") . '</td>';
996
-			print '<td class="center">' . $langs->trans("DateEnd") . '</td>';
997
-			print '<td class="right">' . $langs->trans("OpportunityAmountShort") . '</td>';
998
-			print '<td class="center">' . $langs->trans("OpportunityStatusShort") . '</td>';
999
-			print '<td class="right">' . $langs->trans("OpportunityProbabilityShort") . '</td>';
1000
-			print '<td class="right">' . $langs->trans("Status") . '</td>';
993
+			print '<td>'.$langs->trans("Ref").'</td>';
994
+			print '<td>'.$langs->trans("Name").'</td>';
995
+			print '<td class="center">'.$langs->trans("DateStart").'</td>';
996
+			print '<td class="center">'.$langs->trans("DateEnd").'</td>';
997
+			print '<td class="right">'.$langs->trans("OpportunityAmountShort").'</td>';
998
+			print '<td class="center">'.$langs->trans("OpportunityStatusShort").'</td>';
999
+			print '<td class="right">'.$langs->trans("OpportunityProbabilityShort").'</td>';
1000
+			print '<td class="right">'.$langs->trans("Status").'</td>';
1001 1001
 			if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
1002 1002
 				print '<td class="center">';
1003 1003
 				$selectedfields = (is_array($arrayofmassactions) && count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
@@ -1007,7 +1007,7 @@  discard block
 block discarded – undo
1007 1007
 			print '</tr>';
1008 1008
 
1009 1009
 			if ($num > 0) {
1010
-				require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
1010
+				require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
1011 1011
 
1012 1012
 				$projecttmp = new Project($db);
1013 1013
 
@@ -1030,41 +1030,41 @@  discard block
 block discarded – undo
1030 1030
 								if (in_array($obj->id, $arrayofselected)) {
1031 1031
 									$selected = 1;
1032 1032
 								}
1033
-								print '<input id="cb' . $obj->id . '" class="flat checkforselect" type="checkbox" name="toselect[]" value="' . $obj->id . '"' . ($selected ? ' checked="checked"' : '') . '>';
1033
+								print '<input id="cb'.$obj->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->id.'"'.($selected ? ' checked="checked"' : '').'>';
1034 1034
 							}
1035 1035
 							print '</td>';
1036 1036
 						}
1037 1037
 						// Ref
1038 1038
 						print '<td class="nowraponall">';
1039
-						print $projecttmp->getNomUrl(1, '', 0, '', '-', 0, 1, '', 'project:' . $_SERVER["PHP_SELF"] . '?socid=__SOCID__');
1039
+						print $projecttmp->getNomUrl(1, '', 0, '', '-', 0, 1, '', 'project:'.$_SERVER["PHP_SELF"].'?socid=__SOCID__');
1040 1040
 						print '</td>';
1041 1041
 
1042 1042
 						// Label
1043
-						print '<td class="tdoverflowmax200" title="' . dol_escape_htmltag($obj->title) . '">' . dol_escape_htmltag($obj->title) . '</td>';
1043
+						print '<td class="tdoverflowmax200" title="'.dol_escape_htmltag($obj->title).'">'.dol_escape_htmltag($obj->title).'</td>';
1044 1044
 						// Date start
1045
-						print '<td class="center">' . dol_print_date($db->jdate($obj->do), "day") . '</td>';
1045
+						print '<td class="center">'.dol_print_date($db->jdate($obj->do), "day").'</td>';
1046 1046
 						// Date end
1047
-						print '<td class="center">' . dol_print_date($db->jdate($obj->de), "day") . '</td>';
1047
+						print '<td class="center">'.dol_print_date($db->jdate($obj->de), "day").'</td>';
1048 1048
 						// Opp amount
1049 1049
 						print '<td class="right">';
1050 1050
 						if ($obj->opp_status_code) {
1051
-							print '<span class="amount">' . price($obj->opp_amount, 1, '', 1, -1, -1, '') . '</span>';
1051
+							print '<span class="amount">'.price($obj->opp_amount, 1, '', 1, -1, -1, '').'</span>';
1052 1052
 						}
1053 1053
 						print '</td>';
1054 1054
 						// Opp status
1055 1055
 						print '<td class="center">';
1056 1056
 						if ($obj->opp_status_code) {
1057
-							print $langs->trans("OppStatus" . $obj->opp_status_code);
1057
+							print $langs->trans("OppStatus".$obj->opp_status_code);
1058 1058
 						}
1059 1059
 						print '</td>';
1060 1060
 						// Opp percent
1061 1061
 						print '<td class="right">';
1062 1062
 						if ($obj->opp_percent) {
1063
-							print price($obj->opp_percent, 1, '', 1, 0) . '%';
1063
+							print price($obj->opp_percent, 1, '', 1, 0).'%';
1064 1064
 						}
1065 1065
 						print '</td>';
1066 1066
 						// Status
1067
-						print '<td class="right">' . $projecttmp->getLibStatut(5) . '</td>';
1067
+						print '<td class="right">'.$projecttmp->getLibStatut(5).'</td>';
1068 1068
 
1069 1069
 						// Action column
1070 1070
 						if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
@@ -1074,7 +1074,7 @@  discard block
 block discarded – undo
1074 1074
 								if (in_array($obj->id, $arrayofselected)) {
1075 1075
 									$selected = 1;
1076 1076
 								}
1077
-								print '<input id="cb' . $obj->id . '" class="flat checkforselect" type="checkbox" name="toselect[]" value="' . $obj->id . '"' . ($selected ? ' checked="checked"' : '') . '>';
1077
+								print '<input id="cb'.$obj->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->id.'"'.($selected ? ' checked="checked"' : '').'>';
1078 1078
 							}
1079 1079
 							print '</td>';
1080 1080
 						}
@@ -1083,7 +1083,7 @@  discard block
 block discarded – undo
1083 1083
 					$i++;
1084 1084
 				}
1085 1085
 			} else {
1086
-				print '<tr class="oddeven"><td colspan="9"><span class="opacitymedium">' . $langs->trans("None") . '</span></td></tr>';
1086
+				print '<tr class="oddeven"><td colspan="9"><span class="opacitymedium">'.$langs->trans("None").'</span></td></tr>';
1087 1087
 			}
1088 1088
 			$db->free($result);
1089 1089
 		} else {
@@ -1096,18 +1096,18 @@  discard block
 block discarded – undo
1096 1096
 			print load_fiche_titre($langs->trans("ProjectsLinkedToThisThirdParty"), '', '');
1097 1097
 
1098 1098
 
1099
-			print '<div class="div-table-responsive">' . "\n";
1099
+			print '<div class="div-table-responsive">'."\n";
1100 1100
 			print '<table class="noborder centpercent">';
1101 1101
 
1102 1102
 			$sql  = "SELECT p.rowid as id, p.entity, p.title, p.ref, p.public, p.dateo as do, p.datee as de, p.fk_statut as status, p.fk_opp_status, p.opp_amount, p.opp_percent, p.tms as date_update, p.budget_amount";
1103 1103
 			$sql .= ", cls.code as opp_status_code";
1104
-			$sql .= " FROM " . MAIN_DB_PREFIX . "projet as p";
1105
-			$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_lead_status as cls on p.fk_opp_status = cls.rowid";
1106
-			$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "element_contact as ec on p.rowid = ec.element_id";
1107
-			$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "socpeople as sc on ec.fk_socpeople = sc.rowid";
1108
-			$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_type_contact as tc on ec.fk_c_type_contact = tc.rowid";
1109
-			$sql .= " WHERE sc.fk_soc = " . ((int) $object->id);
1110
-			$sql .= " AND p.entity IN (" . getEntity('project') . ")";
1104
+			$sql .= " FROM ".MAIN_DB_PREFIX."projet as p";
1105
+			$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_lead_status as cls on p.fk_opp_status = cls.rowid";
1106
+			$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."element_contact as ec on p.rowid = ec.element_id";
1107
+			$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople as sc on ec.fk_socpeople = sc.rowid";
1108
+			$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_type_contact as tc on ec.fk_c_type_contact = tc.rowid";
1109
+			$sql .= " WHERE sc.fk_soc = ".((int) $object->id);
1110
+			$sql .= " AND p.entity IN (".getEntity('project').")";
1111 1111
 			$sql .= " AND tc.element = 'project' AND tc.source = 'external'";
1112 1112
 			$sql .= " ORDER BY p.dateo DESC";
1113 1113
 
@@ -1116,18 +1116,18 @@  discard block
 block discarded – undo
1116 1116
 				$num = $db->num_rows($result);
1117 1117
 
1118 1118
 				print '<tr class="liste_titre">';
1119
-				print '<td>' . $langs->trans("Ref") . '</td>';
1120
-				print '<td>' . $langs->trans("Name") . '</td>';
1121
-				print '<td class="center">' . $langs->trans("DateStart") . '</td>';
1122
-				print '<td class="center">' . $langs->trans("DateEnd") . '</td>';
1123
-				print '<td class="right">' . $langs->trans("OpportunityAmountShort") . '</td>';
1124
-				print '<td class="center">' . $langs->trans("OpportunityStatusShort") . '</td>';
1125
-				print '<td class="right">' . $langs->trans("OpportunityProbabilityShort") . '</td>';
1126
-				print '<td class="right">' . $langs->trans("Status") . '</td>';
1119
+				print '<td>'.$langs->trans("Ref").'</td>';
1120
+				print '<td>'.$langs->trans("Name").'</td>';
1121
+				print '<td class="center">'.$langs->trans("DateStart").'</td>';
1122
+				print '<td class="center">'.$langs->trans("DateEnd").'</td>';
1123
+				print '<td class="right">'.$langs->trans("OpportunityAmountShort").'</td>';
1124
+				print '<td class="center">'.$langs->trans("OpportunityStatusShort").'</td>';
1125
+				print '<td class="right">'.$langs->trans("OpportunityProbabilityShort").'</td>';
1126
+				print '<td class="right">'.$langs->trans("Status").'</td>';
1127 1127
 				print '</tr>';
1128 1128
 
1129 1129
 				if ($num > 0) {
1130
-					require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
1130
+					require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
1131 1131
 
1132 1132
 					$projecttmp = new Project($db);
1133 1133
 
@@ -1145,42 +1145,42 @@  discard block
 block discarded – undo
1145 1145
 
1146 1146
 							// Ref
1147 1147
 							print '<td class="nowraponall">';
1148
-							print $projecttmp->getNomUrl(1, '', 0, '', '-', 0, 1, '', 'project:' . $_SERVER["PHP_SELF"] . '?socid=__SOCID__');
1148
+							print $projecttmp->getNomUrl(1, '', 0, '', '-', 0, 1, '', 'project:'.$_SERVER["PHP_SELF"].'?socid=__SOCID__');
1149 1149
 							print '</td>';
1150 1150
 
1151 1151
 							// Label
1152
-							print '<td class="tdoverflowmax200" title="' . dol_escape_htmltag($obj->title) . '">' . dol_escape_htmltag($obj->title) . '</td>';
1152
+							print '<td class="tdoverflowmax200" title="'.dol_escape_htmltag($obj->title).'">'.dol_escape_htmltag($obj->title).'</td>';
1153 1153
 							// Date start
1154
-							print '<td class="center">' . dol_print_date($db->jdate($obj->do), "day") . '</td>';
1154
+							print '<td class="center">'.dol_print_date($db->jdate($obj->do), "day").'</td>';
1155 1155
 							// Date end
1156
-							print '<td class="center">' . dol_print_date($db->jdate($obj->de), "day") . '</td>';
1156
+							print '<td class="center">'.dol_print_date($db->jdate($obj->de), "day").'</td>';
1157 1157
 							// Opp amount
1158 1158
 							print '<td class="right">';
1159 1159
 							if ($obj->opp_status_code) {
1160
-								print '<span class="amount">' . price($obj->opp_amount, 1, '', 1, -1, -1, '') . '</span>';
1160
+								print '<span class="amount">'.price($obj->opp_amount, 1, '', 1, -1, -1, '').'</span>';
1161 1161
 							}
1162 1162
 							print '</td>';
1163 1163
 							// Opp status
1164 1164
 							print '<td class="center">';
1165 1165
 							if ($obj->opp_status_code) {
1166
-								print $langs->trans("OppStatus" . $obj->opp_status_code);
1166
+								print $langs->trans("OppStatus".$obj->opp_status_code);
1167 1167
 							}
1168 1168
 							print '</td>';
1169 1169
 							// Opp percent
1170 1170
 							print '<td class="right">';
1171 1171
 							if ($obj->opp_percent) {
1172
-								print price($obj->opp_percent, 1, '', 1, 0) . '%';
1172
+								print price($obj->opp_percent, 1, '', 1, 0).'%';
1173 1173
 							}
1174 1174
 							print '</td>';
1175 1175
 							// Status
1176
-							print '<td class="right">' . $projecttmp->getLibStatut(5) . '</td>';
1176
+							print '<td class="right">'.$projecttmp->getLibStatut(5).'</td>';
1177 1177
 
1178 1178
 							print '</tr>';
1179 1179
 						}
1180 1180
 						$i++;
1181 1181
 					}
1182 1182
 				} else {
1183
-					print '<tr class="oddeven"><td colspan="8"><span class="opacitymedium">' . $langs->trans("None") . '</span></td></tr>';
1183
+					print '<tr class="oddeven"><td colspan="8"><span class="opacitymedium">'.$langs->trans("None").'</span></td></tr>';
1184 1184
 				}
1185 1185
 				$db->free($result);
1186 1186
 			} else {
@@ -1218,7 +1218,7 @@  discard block
 block discarded – undo
1218 1218
 	global $user, $extrafields, $hookmanager;
1219 1219
 	global $contextpage;
1220 1220
 
1221
-	require_once DOL_DOCUMENT_ROOT . '/core/class/html.formcompany.class.php';
1221
+	require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
1222 1222
 	$formcompany = new FormCompany($db);
1223 1223
 	$form = new Form($db);
1224 1224
 
@@ -1303,7 +1303,7 @@  discard block
 block discarded – undo
1303 1303
 		't.rowid' => array('label' => "TechnicalID", 'checked' => (getDolGlobalString('MAIN_SHOW_TECHNICAL_ID') ? '1' : '0'), 'enabled' => (getDolGlobalString('MAIN_SHOW_TECHNICAL_ID') ? '1' : '0'), 'position' => 1),
1304 1304
 		't.name' => array('label' => "Name", 'checked' => '1', 'position' => 10),
1305 1305
 		't.poste' => array('label' => "PostOrFunction", 'checked' => '1', 'position' => 20),
1306
-		't.address' => array('label' => (empty($conf->dol_optimize_smallscreen) ? $langs->trans("Address") . ' / ' . $langs->trans("Phone") . ' / ' . $langs->trans("Email") : $langs->trans("Address")), 'checked' => '1', 'position' => 30),
1306
+		't.address' => array('label' => (empty($conf->dol_optimize_smallscreen) ? $langs->trans("Address").' / '.$langs->trans("Phone").' / '.$langs->trans("Email") : $langs->trans("Address")), 'checked' => '1', 'position' => 30),
1307 1307
 		't.note_private' => array('label' => 'NotePrivate', 'checked' => '0', 'position' => 35),
1308 1308
 		'sc.role' => array('label' => "ContactByDefaultFor", 'checked' => '1', 'position' => 40),
1309 1309
 		't.birthday' => array('label' => "Birthday", 'checked' => '0', 'position' => 45),
@@ -1314,12 +1314,12 @@  discard block
 block discarded – undo
1314 1314
 	$extrafieldsobjectkey = $contactstatic->table_element;
1315 1315
 	$extrafieldsobjectprefix = 'ef.';
1316 1316
 	$extrafieldspositionoffset = 1000;
1317
-	include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_array_fields.tpl.php';
1317
+	include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
1318 1318
 
1319 1319
 	// Initialize array of search criteria
1320 1320
 	$search = array();
1321 1321
 	foreach ($arrayfields as $key => $val) {
1322
-		$queryName = 'search_' . substr($key, 2);
1322
+		$queryName = 'search_'.substr($key, 2);
1323 1323
 		if (GETPOST($queryName, 'alpha')) {
1324 1324
 			$search[substr($key, 2)] = GETPOST($queryName, 'alpha');
1325 1325
 		}
@@ -1354,7 +1354,7 @@  discard block
 block discarded – undo
1354 1354
 	if (empty($reshook)) {
1355 1355
 		if ($user->hasRight('societe', 'contact', 'creer')) {
1356 1356
 			$addcontact = (getDolGlobalString('SOCIETE_ADDRESSES_MANAGEMENT') ? $langs->trans("AddContact") : $langs->trans("AddContactAddress"));
1357
-			$newcardbutton .= dolGetButtonTitle($addcontact, '', 'fa fa-plus-circle', DOL_URL_ROOT . '/contact/card.php?socid=' . $object->id . '&action=create&backtopage=' . urlencode($backtopage));
1357
+			$newcardbutton .= dolGetButtonTitle($addcontact, '', 'fa fa-plus-circle', DOL_URL_ROOT.'/contact/card.php?socid='.$object->id.'&action=create&backtopage='.urlencode($backtopage));
1358 1358
 		}
1359 1359
 	} else {
1360 1360
 		$newcardbutton = $hookmanager->resPrint;
@@ -1365,75 +1365,75 @@  discard block
 block discarded – undo
1365 1365
 	$title = (getDolGlobalString('SOCIETE_ADDRESSES_MANAGEMENT') ? $langs->trans("ContactsForCompany") : $langs->trans("ContactsAddressesForCompany"));
1366 1366
 	print load_fiche_titre($title, $newcardbutton, 'contact');
1367 1367
 
1368
-	print '<form method="POST" id="searchFormList" action="' . $_SERVER["PHP_SELF"] . '" name="formfilter">';
1369
-	print '<input type="hidden" name="token" value="' . newToken() . '">';
1368
+	print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'" name="formfilter">';
1369
+	print '<input type="hidden" name="token" value="'.newToken().'">';
1370 1370
 	print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
1371
-	print '<input type="hidden" name="socid" value="' . $object->id . '">';
1372
-	print '<input type="hidden" name="sortorder" value="' . $sortorder . '">';
1373
-	print '<input type="hidden" name="sortfield" value="' . $sortfield . '">';
1374
-	print '<input type="hidden" name="page" value="' . $page . '">';
1371
+	print '<input type="hidden" name="socid" value="'.$object->id.'">';
1372
+	print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
1373
+	print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
1374
+	print '<input type="hidden" name="page" value="'.$page.'">';
1375 1375
 
1376 1376
 	$arrayofmassactions = array();
1377 1377
 	$mode = 'view';
1378 1378
 
1379 1379
 	$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
1380
-	$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN'));  // This also change content of $arrayfields with user setup
1380
+	$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup
1381 1381
 	$selectedfields = ($mode != 'kanban' ? $htmlofselectarray : '');
1382 1382
 	$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
1383 1383
 
1384 1384
 	print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you don't need reserved height for your table
1385
-	print "\n" . '<table class="tagtable liste noborder">' . "\n";
1385
+	print "\n".'<table class="tagtable liste noborder">'."\n";
1386 1386
 
1387
-	$param = "socid=" . urlencode((string) ($object->id));
1387
+	$param = "socid=".urlencode((string) ($object->id));
1388 1388
 	if ($search_rowid != '') {
1389
-		$param .= '&search_rowid=' . urlencode((string) ($search_rowid));
1389
+		$param .= '&search_rowid='.urlencode((string) ($search_rowid));
1390 1390
 	}
1391 1391
 	if ($search_status != '') {
1392
-		$param .= '&search_status=' . urlencode((string) ($search_status));
1392
+		$param .= '&search_status='.urlencode((string) ($search_status));
1393 1393
 	}
1394 1394
 	if (count($search_roles) > 0) {
1395 1395
 		$param .= implode('&search_roles[]=', $search_roles);
1396 1396
 	}
1397 1397
 	if ($search_name != '') {
1398
-		$param .= '&search_name=' . urlencode($search_name);
1398
+		$param .= '&search_name='.urlencode($search_name);
1399 1399
 	}
1400 1400
 	if ($search_poste != '') {
1401
-		$param .= '&search_poste=' . urlencode($search_poste);
1401
+		$param .= '&search_poste='.urlencode($search_poste);
1402 1402
 	}
1403 1403
 	if ($search_address != '') {
1404
-		$param .= '&search_address=' . urlencode($search_address);
1404
+		$param .= '&search_address='.urlencode($search_address);
1405 1405
 	}
1406 1406
 	if ($search_note_private != '') {
1407
-		$param .= '&search_note_private=' . urlencode($search_note_private);
1407
+		$param .= '&search_note_private='.urlencode($search_note_private);
1408 1408
 	}
1409 1409
 	if ($search_birthday_dtstart != '') {
1410
-		$param .= '&search_birthday_dtstart=' . urlencode((string) $search_birthday_dtstart);
1410
+		$param .= '&search_birthday_dtstart='.urlencode((string) $search_birthday_dtstart);
1411 1411
 	}
1412 1412
 	if ($search_birthday_dtend != '') {
1413
-		$param .= '&search_birthday_dtend=' . urlencode((string) $search_birthday_dtend);
1413
+		$param .= '&search_birthday_dtend='.urlencode((string) $search_birthday_dtend);
1414 1414
 	}
1415 1415
 	if ($optioncss != '') {
1416
-		$param .= '&optioncss=' . urlencode($optioncss);
1416
+		$param .= '&optioncss='.urlencode($optioncss);
1417 1417
 	}
1418 1418
 
1419 1419
 	// Add $param from extra fields
1420 1420
 	$extrafieldsobjectkey = $contactstatic->table_element;
1421
-	include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_search_param.tpl.php';
1421
+	include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
1422 1422
 
1423 1423
 	$sql = "SELECT t.rowid, t.entity, t.lastname, t.firstname, t.fk_pays as country_id, t.civility, t.poste,";
1424 1424
 	$sql .= " t.phone as phone_pro, t.phone_mobile, t.phone_perso, t.fax, t.email, t.socialnetworks, t.statut, t.photo, t.fk_soc,";
1425 1425
 	$sql .= " t.civility as civility_id, t.address, t.zip, t.town, t.birthday,";
1426 1426
 	$sql .= " t.note_private";
1427
-	$sql .= " FROM " . MAIN_DB_PREFIX . "socpeople as t";
1428
-	$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "socpeople_extrafields as ef on (t.rowid = ef.fk_object)";
1429
-	$sql .= " WHERE t.fk_soc = " . ((int) $object->id);
1430
-	$sql .= " AND t.entity IN (" . getEntity('socpeople') . ")";
1431
-	$sql .= " AND ((t.fk_user_creat = " . ((int) $user->id) . " AND t.priv = 1) OR t.priv = 0)";
1427
+	$sql .= " FROM ".MAIN_DB_PREFIX."socpeople as t";
1428
+	$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople_extrafields as ef on (t.rowid = ef.fk_object)";
1429
+	$sql .= " WHERE t.fk_soc = ".((int) $object->id);
1430
+	$sql .= " AND t.entity IN (".getEntity('socpeople').")";
1431
+	$sql .= " AND ((t.fk_user_creat = ".((int) $user->id)." AND t.priv = 1) OR t.priv = 0)";
1432 1432
 	if ($search_rowid) {
1433 1433
 		$sql .= natural_search('t.rowid', $search_rowid);
1434 1434
 	}
1435 1435
 	if ($search_status != '' && $search_status != '-1') {
1436
-		$sql .= " AND t.statut = " . ((int) $search_status);
1436
+		$sql .= " AND t.statut = ".((int) $search_status);
1437 1437
 	}
1438 1438
 	if ($search_name) {
1439 1439
 		$sql .= natural_search(array('t.lastname', 't.firstname'), $search_name);
@@ -1448,17 +1448,17 @@  discard block
 block discarded – undo
1448 1448
 		$sql .= natural_search('t.note_private', $search_note_private);
1449 1449
 	}
1450 1450
 	if ($search_birthday_dtstart != '') {
1451
-		$sql .= " AND t.birthday >= '" . $db->idate($search_birthday_dtstart) . "'";
1451
+		$sql .= " AND t.birthday >= '".$db->idate($search_birthday_dtstart)."'";
1452 1452
 	}
1453 1453
 	if ($search_birthday_dtend != '') {
1454
-		$sql .= " AND t.birthday <= '" . $db->idate($search_birthday_dtend) . "'";
1454
+		$sql .= " AND t.birthday <= '".$db->idate($search_birthday_dtend)."'";
1455 1455
 	}
1456 1456
 	if (count($search_roles) > 0) {
1457
-		$sql .= " AND t.rowid IN (SELECT sc.fk_socpeople FROM " . MAIN_DB_PREFIX . "societe_contacts as sc WHERE sc.fk_c_type_contact IN (" . $db->sanitize(implode(',', $search_roles)) . "))";
1457
+		$sql .= " AND t.rowid IN (SELECT sc.fk_socpeople FROM ".MAIN_DB_PREFIX."societe_contacts as sc WHERE sc.fk_c_type_contact IN (".$db->sanitize(implode(',', $search_roles))."))";
1458 1458
 	}
1459 1459
 	// Add where from extra fields
1460 1460
 	$extrafieldsobjectkey = $contactstatic->table_element;
1461
-	include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_search_sql.tpl.php';
1461
+	include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php';
1462 1462
 	// Add where from hooks
1463 1463
 	$parameters = array('socid' => $object->id);
1464 1464
 	$reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters, $object); // Note that $action and $object may have been modified by hook
@@ -1489,16 +1489,16 @@  discard block
 block discarded – undo
1489 1489
 	foreach ($contactstatic->fields as $key => $val) {
1490 1490
 		$align = '';
1491 1491
 		if (in_array($val['type'], array('date', 'datetime', 'timestamp'))) {
1492
-			$align .= ($align ? ' ' : '') . 'center';
1492
+			$align .= ($align ? ' ' : '').'center';
1493 1493
 		}
1494 1494
 		if (in_array($val['type'], array('timestamp'))) {
1495
-			$align .= ($align ? ' ' : '') . 'nowrap';
1495
+			$align .= ($align ? ' ' : '').'nowrap';
1496 1496
 		}
1497 1497
 		if ($key == 'status' || $key == 'statut') {
1498
-			$align .= ($align ? ' ' : '') . 'center';
1498
+			$align .= ($align ? ' ' : '').'center';
1499 1499
 		}
1500
-		if (!empty($arrayfields['t.' . $key]['checked']) || !empty($arrayfields['sc.' . $key]['checked'])) {
1501
-			print '<td class="liste_titre' . ($align ? ' ' . $align : '') . '">';
1500
+		if (!empty($arrayfields['t.'.$key]['checked']) || !empty($arrayfields['sc.'.$key]['checked'])) {
1501
+			print '<td class="liste_titre'.($align ? ' '.$align : '').'">';
1502 1502
 			if (in_array($key, array('statut'))) {
1503 1503
 				print $form->selectarray('search_status', array('-1' => '', '0' => $contactstatic->LibStatut(0, 1), '1' => $contactstatic->LibStatut(1, 1)), $search_status, 0, 0, 0, '', 0, 0, 0, '', 'onrightofpage');
1504 1504
 			} elseif (in_array($key, array('role'))) {
@@ -1511,7 +1511,7 @@  discard block
 block discarded – undo
1511 1511
 				print $form->selectDate($search_birthday_dtend ? $search_birthday_dtend : '', "search_birthday_dtend", 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to'));
1512 1512
 				print '</div>';
1513 1513
 			} else {
1514
-				print '<input type="text" class="flat maxwidth75" name="search_' . $key . '" value="' . (!empty($search[$key]) ? dol_escape_htmltag($search[$key]) : '') . '">';
1514
+				print '<input type="text" class="flat maxwidth75" name="search_'.$key.'" value="'.(!empty($search[$key]) ? dol_escape_htmltag($search[$key]) : '').'">';
1515 1515
 			}
1516 1516
 			print '</td>';
1517 1517
 		}
@@ -1521,7 +1521,7 @@  discard block
 block discarded – undo
1521 1521
 	}
1522 1522
 	// Extra fields
1523 1523
 	$extrafieldsobjectkey = $contactstatic->table_element;
1524
-	include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_search_input.tpl.php';
1524
+	include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php';
1525 1525
 
1526 1526
 	// Fields from hook
1527 1527
 	$parameters = array('arrayfields' => $arrayfields);
@@ -1533,7 +1533,7 @@  discard block
 block discarded – undo
1533 1533
 		print $form->showFilterButtons();
1534 1534
 		print '</td>';
1535 1535
 	}
1536
-	print '</tr>' . "\n";
1536
+	print '</tr>'."\n";
1537 1537
 
1538 1538
 
1539 1539
 	// Fields title label
@@ -1541,44 +1541,44 @@  discard block
 block discarded – undo
1541 1541
 	print '<tr class="liste_titre">';
1542 1542
 	// Action column
1543 1543
 	if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
1544
-		print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'maxwidthsearch center ') . "\n";
1544
+		print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'maxwidthsearch center ')."\n";
1545 1545
 	}
1546 1546
 	foreach ($contactstatic->fields as $key => $val) {
1547 1547
 		$align = '';
1548 1548
 		if (in_array($val['type'], array('date', 'datetime', 'timestamp'))) {
1549
-			$align .= ($align ? ' ' : '') . 'center';
1549
+			$align .= ($align ? ' ' : '').'center';
1550 1550
 		}
1551 1551
 		if (in_array($val['type'], array('timestamp'))) {
1552
-			$align .= ($align ? ' ' : '') . 'nowrap';
1552
+			$align .= ($align ? ' ' : '').'nowrap';
1553 1553
 		}
1554 1554
 		if ($key == 'status' || $key == 'statut') {
1555
-			$align .= ($align ? ' ' : '') . 'center';
1555
+			$align .= ($align ? ' ' : '').'center';
1556 1556
 		}
1557
-		if (!empty($arrayfields['t.' . $key]['checked'])) {
1558
-			print getTitleFieldOfList($val['label'], 0, $_SERVER['PHP_SELF'], 't.' . $key, '', $param, ($align ? 'class="' . $align . '"' : ''), $sortfield, $sortorder, $align . ' ') . "\n";
1557
+		if (!empty($arrayfields['t.'.$key]['checked'])) {
1558
+			print getTitleFieldOfList($val['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, ($align ? 'class="'.$align.'"' : ''), $sortfield, $sortorder, $align.' ')."\n";
1559 1559
 		}
1560 1560
 		if ($key == 'role') {
1561
-			$align .= ($align ? ' ' : '') . 'left';
1561
+			$align .= ($align ? ' ' : '').'left';
1562 1562
 		}
1563
-		if (!empty($arrayfields['sc.' . $key]['checked'])) {
1564
-			print getTitleFieldOfList($arrayfields['sc.' . $key]['label'], 0, $_SERVER['PHP_SELF'], '', '', $param, ($align ? 'class="' . $align . '"' : ''), $sortfield, $sortorder, $align . ' ') . "\n";
1563
+		if (!empty($arrayfields['sc.'.$key]['checked'])) {
1564
+			print getTitleFieldOfList($arrayfields['sc.'.$key]['label'], 0, $_SERVER['PHP_SELF'], '', '', $param, ($align ? 'class="'.$align.'"' : ''), $sortfield, $sortorder, $align.' ')."\n";
1565 1565
 		}
1566 1566
 	}
1567 1567
 	if ($showuserlogin) {
1568
-		print '<th class="wrapcolumntitle liste_titre">' . $langs->trans("DolibarrLogin") . '</th>';
1568
+		print '<th class="wrapcolumntitle liste_titre">'.$langs->trans("DolibarrLogin").'</th>';
1569 1569
 	}
1570 1570
 	// Extra fields
1571 1571
 	$extrafieldsobjectkey = $contactstatic->table_element;
1572
-	include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_search_title.tpl.php';
1572
+	include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
1573 1573
 	// Hook fields
1574 1574
 	$parameters = array('arrayfields' => $arrayfields, 'param' => $param, 'sortfield' => $sortfield, 'sortorder' => $sortorder);
1575 1575
 	$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook
1576 1576
 	print $hookmanager->resPrint;
1577 1577
 	// Action column
1578 1578
 	if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
1579
-		print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'maxwidthsearch center ') . "\n";
1579
+		print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'maxwidthsearch center ')."\n";
1580 1580
 	}
1581
-	print '</tr>' . "\n";
1581
+	print '</tr>'."\n";
1582 1582
 
1583 1583
 	$i = -1;
1584 1584
 
@@ -1634,21 +1634,21 @@  discard block
 block discarded – undo
1634 1634
 
1635 1635
 				// Add to agenda
1636 1636
 				if (isModEnabled('agenda') && $user->hasRight('agenda', 'myactions', 'create')) {
1637
-					print '<a href="' . DOL_URL_ROOT . '/comm/action/card.php?action=create&actioncode=&contactid=' . $obj->rowid . '&socid=' . $object->id . '&backtopage=' . urlencode($backtopage) . '">';
1637
+					print '<a href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create&actioncode=&contactid='.$obj->rowid.'&socid='.$object->id.'&backtopage='.urlencode($backtopage).'">';
1638 1638
 					print img_object($langs->trans("Event"), "action");
1639 1639
 					print '</a> &nbsp; ';
1640 1640
 				}
1641 1641
 
1642 1642
 				// Edit
1643 1643
 				if ($user->hasRight('societe', 'contact', 'creer')) {
1644
-					print '<a class="editfielda paddingleft" href="' . DOL_URL_ROOT . '/contact/card.php?action=edit&token=' . newToken() . '&id=' . $obj->rowid . '&backtopage=' . urlencode($backtopage) . '">';
1644
+					print '<a class="editfielda paddingleft" href="'.DOL_URL_ROOT.'/contact/card.php?action=edit&token='.newToken().'&id='.$obj->rowid.'&backtopage='.urlencode($backtopage).'">';
1645 1645
 					print img_edit();
1646 1646
 					print '</a>';
1647 1647
 				}
1648 1648
 
1649 1649
 				// Delete
1650 1650
 				if ($user->hasRight('societe', 'contact', 'delete')) {
1651
-					print '<a class="marginleftonly right" href="' . DOL_URL_ROOT . '/societe/contact.php?action=delete&token=' . newToken() . '&id=' . $obj->rowid . '&socid=' . $object->id . '&backtopage=' . urlencode($backtopage) . '">';
1651
+					print '<a class="marginleftonly right" href="'.DOL_URL_ROOT.'/societe/contact.php?action=delete&token='.newToken().'&id='.$obj->rowid.'&socid='.$object->id.'&backtopage='.urlencode($backtopage).'">';
1652 1652
 					print img_delete();
1653 1653
 					print '</a>';
1654 1654
 				}
@@ -1667,13 +1667,13 @@  discard block
 block discarded – undo
1667 1667
 			if (!empty($arrayfields['t.name']['checked'])) {
1668 1668
 				print '<td class="tdoverflowmax150">';
1669 1669
 				print $form->showphoto('contact', $contactstatic, 0, 0, 0, 'photorefnoborder valignmiddle marginrightonly', 'small', 1, 0, 'user');
1670
-				print $contactstatic->getNomUrl(0, '', 0, '&backtopage=' . urlencode($backtopage));
1670
+				print $contactstatic->getNomUrl(0, '', 0, '&backtopage='.urlencode($backtopage));
1671 1671
 				print '</td>';
1672 1672
 			}
1673 1673
 
1674 1674
 			// Job position
1675 1675
 			if (!empty($arrayfields['t.poste']['checked'])) {
1676
-				print '<td class="tdoverflowmax100" title="' . dol_escape_htmltag($obj->poste) . '">';
1676
+				print '<td class="tdoverflowmax100" title="'.dol_escape_htmltag($obj->poste).'">';
1677 1677
 				if ($obj->poste) {
1678 1678
 					print dol_escape_htmltag($obj->poste);
1679 1679
 				}
@@ -1711,7 +1711,7 @@  discard block
 block discarded – undo
1711 1711
 
1712 1712
 			// Status
1713 1713
 			if (!empty($arrayfields['t.statut']['checked'])) {
1714
-				print '<td class="center">' . $contactstatic->getLibStatut(5) . '</td>';
1714
+				print '<td class="center">'.$contactstatic->getLibStatut(5).'</td>';
1715 1715
 			}
1716 1716
 
1717 1717
 			if ($showuserlogin) {
@@ -1727,7 +1727,7 @@  discard block
 block discarded – undo
1727 1727
 
1728 1728
 			// Extra fields
1729 1729
 			$extrafieldsobjectkey = $contactstatic->table_element;
1730
-			include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_print_fields.tpl.php';
1730
+			include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
1731 1731
 
1732 1732
 			// Actions
1733 1733
 			if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
@@ -1735,21 +1735,21 @@  discard block
 block discarded – undo
1735 1735
 
1736 1736
 				// Add to agenda
1737 1737
 				if (isModEnabled('agenda') && $user->hasRight('agenda', 'myactions', 'create')) {
1738
-					print '<a href="' . DOL_URL_ROOT . '/comm/action/card.php?action=create&actioncode=&contactid=' . $obj->rowid . '&socid=' . $object->id . '&backtopage=' . urlencode($backtopage) . '">';
1738
+					print '<a href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create&actioncode=&contactid='.$obj->rowid.'&socid='.$object->id.'&backtopage='.urlencode($backtopage).'">';
1739 1739
 					print img_object($langs->trans("Event"), "action");
1740 1740
 					print '</a> &nbsp; ';
1741 1741
 				}
1742 1742
 
1743 1743
 				// Edit
1744 1744
 				if ($user->hasRight('societe', 'contact', 'creer')) {
1745
-					print '<a class="editfielda paddingleft" href="' . DOL_URL_ROOT . '/contact/card.php?action=edit&token=' . newToken() . '&id=' . $obj->rowid . '&backtopage=' . urlencode($backtopage) . '">';
1745
+					print '<a class="editfielda paddingleft" href="'.DOL_URL_ROOT.'/contact/card.php?action=edit&token='.newToken().'&id='.$obj->rowid.'&backtopage='.urlencode($backtopage).'">';
1746 1746
 					print img_edit();
1747 1747
 					print '</a>';
1748 1748
 				}
1749 1749
 
1750 1750
 				// Delete
1751 1751
 				if ($user->hasRight('societe', 'contact', 'delete')) {
1752
-					print '<a class="marginleftonly right" href="' . DOL_URL_ROOT . '/societe/contact.php?action=delete&token=' . newToken() . '&id=' . $obj->rowid . '&socid=' . $object->id . '&backtopage=' . urlencode($backtopage) . '">';
1752
+					print '<a class="marginleftonly right" href="'.DOL_URL_ROOT.'/societe/contact.php?action=delete&token='.newToken().'&id='.$obj->rowid.'&socid='.$object->id.'&backtopage='.urlencode($backtopage).'">';
1753 1753
 					print img_delete();
1754 1754
 					print '</a>';
1755 1755
 				}
@@ -1768,7 +1768,7 @@  discard block
 block discarded – undo
1768 1768
 					$colspan++;
1769 1769
 				}
1770 1770
 			}
1771
-			print '<tr><td colspan="' . $colspan . '"><span class="opacitymedium">' . $langs->trans("NoRecordFound") . '</span></td></tr>';
1771
+			print '<tr><td colspan="'.$colspan.'"><span class="opacitymedium">'.$langs->trans("NoRecordFound").'</span></td></tr>';
1772 1772
 		}
1773 1773
 	} else {
1774 1774
 		$colspan = 1 + ($showuserlogin ? 1 : 0);
@@ -1777,12 +1777,12 @@  discard block
 block discarded – undo
1777 1777
 				$colspan++;
1778 1778
 			}
1779 1779
 		}
1780
-		print '<tr><td colspan="' . $colspan . '"><span class="opacitymedium">' . $langs->trans("None") . '</span></td></tr>';
1780
+		print '<tr><td colspan="'.$colspan.'"><span class="opacitymedium">'.$langs->trans("None").'</span></td></tr>';
1781 1781
 	}
1782 1782
 	print "\n</table>\n";
1783 1783
 	print '</div>';
1784 1784
 
1785
-	print '</form>' . "\n";
1785
+	print '</form>'."\n";
1786 1786
 
1787 1787
 	return $i;
1788 1788
 }
@@ -1855,7 +1855,7 @@  discard block
 block discarded – undo
1855 1855
 		$tms_start = '';
1856 1856
 		$tms_end = '';
1857 1857
 	}
1858
-	require_once DOL_DOCUMENT_ROOT . '/comm/action/class/actioncomm.class.php';
1858
+	require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
1859 1859
 
1860 1860
 	// Check parameters
1861 1861
 	if (!is_object($filterobj) && !is_object($objcon)) {
@@ -1876,7 +1876,7 @@  discard block
 block discarded – undo
1876 1876
 	}
1877 1877
 	$sortfield_new = implode(',', $sortfield_new_list);
1878 1878
 
1879
-	$complete = (string) $filters['search_complete'];	// Can be 'na', '0', '50', '100'
1879
+	$complete = (string) $filters['search_complete']; // Can be 'na', '0', '50', '100'
1880 1880
 	$percent = $complete !== '' ? $complete : -1;
1881 1881
 	if ((string) $complete == '0') {
1882 1882
 		$percent = '0';
@@ -1929,16 +1929,16 @@  discard block
 block discarded – undo
1929 1929
 
1930 1930
 		// Fields from hook
1931 1931
 		$parameters = array('sql' => &$sql, 'filterobj' => $filterobj, 'objcon' => $objcon);
1932
-		$reshook = $hookmanager->executeHooks('showActionsDoneListSelect', $parameters);    // Note that $action and $object may have been modified by hook
1932
+		$reshook = $hookmanager->executeHooks('showActionsDoneListSelect', $parameters); // Note that $action and $object may have been modified by hook
1933 1933
 		if (!empty($hookmanager->resPrint)) {
1934 1934
 			$sql .= $hookmanager->resPrint;
1935 1935
 		}
1936 1936
 
1937
-		$sql .= " FROM " . MAIN_DB_PREFIX . "actioncomm as a";
1937
+		$sql .= " FROM ".MAIN_DB_PREFIX."actioncomm as a";
1938 1938
 		// Link to the owner of action
1939
-		$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "user as u on u.rowid = a.fk_user_action";
1939
+		$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."user as u on u.rowid = a.fk_user_action";
1940 1940
 		// Link to action types
1941
-		$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_actioncomm as c ON a.fk_action = c.id";
1941
+		$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_actioncomm as c ON a.fk_action = c.id";
1942 1942
 
1943 1943
 		// Set $force_filter_contact:
1944 1944
 		// - true for a filter on a user or a contact, so a link on table llx_actioncomm_resources or llx_actioncomm.fk_user_action
@@ -1953,101 +1953,101 @@  discard block
 block discarded – undo
1953 1953
 
1954 1954
 		// Fields from hook
1955 1955
 		$parameters = array('sql' => &$sql, 'filterobj' => $filterobj, 'objcon' => $objcon);
1956
-		$reshook = $hookmanager->executeHooks('showActionsDoneListFrom', $parameters);    // Note that $action and $object may have been modified by hook
1956
+		$reshook = $hookmanager->executeHooks('showActionsDoneListFrom', $parameters); // Note that $action and $object may have been modified by hook
1957 1957
 		if (!empty($hookmanager->resPrint)) {
1958 1958
 			$sql .= $hookmanager->resPrint;
1959 1959
 		}
1960 1960
 		if (is_object($filterobj) && in_array(get_class($filterobj), array('Societe', 'Client', 'Fournisseur'))) {
1961
-			$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "socpeople as sp ON a.fk_contact = sp.rowid";
1961
+			$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople as sp ON a.fk_contact = sp.rowid";
1962 1962
 		} elseif (is_object($filterobj) && get_class($filterobj) == 'Dolresource') {
1963
-			$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "element_resources as er";
1963
+			$sql .= " INNER JOIN ".MAIN_DB_PREFIX."element_resources as er";
1964 1964
 			$sql .= " ON er.resource_type = 'dolresource'";
1965 1965
 			$sql .= " AND er.element_type = 'action'";
1966 1966
 			$sql .= " AND er.element_id = a.id";
1967
-			$sql .= " AND er.resource_id = " . ((int) $filterobj->id);
1967
+			$sql .= " AND er.resource_id = ".((int) $filterobj->id);
1968 1968
 		} elseif (is_object($filterobj) && get_class($filterobj) == 'Project') {
1969 1969
 			/* Nothing */
1970 1970
 		} elseif (is_object($filterobj) && get_class($filterobj) == 'Adherent') {
1971
-			$sql .= ", " . MAIN_DB_PREFIX . "adherent as m";
1971
+			$sql .= ", ".MAIN_DB_PREFIX."adherent as m";
1972 1972
 		} elseif (is_object($filterobj) && get_class($filterobj) == 'CommandeFournisseur') {
1973
-			$sql .= ", " . MAIN_DB_PREFIX . "commande_fournisseur as o";
1973
+			$sql .= ", ".MAIN_DB_PREFIX."commande_fournisseur as o";
1974 1974
 		} elseif (is_object($filterobj) && get_class($filterobj) == 'Product') {
1975
-			$sql .= ", " . MAIN_DB_PREFIX . "product as o";
1975
+			$sql .= ", ".MAIN_DB_PREFIX."product as o";
1976 1976
 		} elseif (is_object($filterobj) && get_class($filterobj) == 'Ticket') {
1977
-			$sql .= ", " . MAIN_DB_PREFIX . "ticket as o";
1977
+			$sql .= ", ".MAIN_DB_PREFIX."ticket as o";
1978 1978
 		} elseif (is_object($filterobj) && get_class($filterobj) == 'BOM') {
1979
-			$sql .= ", " . MAIN_DB_PREFIX . "bom_bom as o";
1979
+			$sql .= ", ".MAIN_DB_PREFIX."bom_bom as o";
1980 1980
 		} elseif (is_object($filterobj) && get_class($filterobj) == 'Contrat') {
1981
-			$sql .= ", " . MAIN_DB_PREFIX . "contrat as o";
1981
+			$sql .= ", ".MAIN_DB_PREFIX."contrat as o";
1982 1982
 		} elseif (is_object($filterobj) && get_class($filterobj) == 'Expedition') {
1983
-			$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "expedition as s ON a.fk_element = s.rowid AND a.elementtype = 'shipping'"; // Jointure sur la table des expéditions avec condition ON
1983
+			$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."expedition as s ON a.fk_element = s.rowid AND a.elementtype = 'shipping'"; // Jointure sur la table des expéditions avec condition ON
1984 1984
 		} elseif (is_object($filterobj) && get_class($filterobj) == 'Propal') {
1985
-			$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "propal as o ON a.fk_element = o.rowid AND a.elementtype = 'propal'";
1985
+			$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."propal as o ON a.fk_element = o.rowid AND a.elementtype = 'propal'";
1986 1986
 		} elseif (
1987 1987
 			is_object($filterobj) && is_array($filterobj->fields) && is_array($filterobj->fields['rowid'])
1988 1988
 			&& ((!empty($filterobj->fields['ref']) && is_array($filterobj->fields['ref'])) || (!empty($filterobj->fields['label']) && is_array($filterobj->fields['label'])) || (!empty($filterobj->fields['titre']) && is_array($filterobj->fields['titre'])))  // @phan-suppress-current-line PhanTypeInvalidDimOffset
1989 1989
 			&& $filterobj->table_element && $filterobj->element
1990 1990
 		) {
1991
-			$sql .= ", " . MAIN_DB_PREFIX . $filterobj->table_element . " as o";
1991
+			$sql .= ", ".MAIN_DB_PREFIX.$filterobj->table_element." as o";
1992 1992
 		}
1993 1993
 
1994
-		$sql .= " WHERE a.entity IN (" . getEntity('agenda') . ")";
1994
+		$sql .= " WHERE a.entity IN (".getEntity('agenda').")";
1995 1995
 		if (!$force_filter_contact) {
1996 1996
 			if (is_object($filterobj) && in_array(get_class($filterobj), array('Societe', 'Client', 'Fournisseur')) && $filterobj->id) {
1997
-				$sql .= " AND a.fk_soc = " . ((int) $filterobj->id);
1997
+				$sql .= " AND a.fk_soc = ".((int) $filterobj->id);
1998 1998
 			} elseif (is_object($filterobj) && get_class($filterobj) == 'Dolresource') {
1999 1999
 				/* Nothing */
2000 2000
 			} elseif (is_object($filterobj) && get_class($filterobj) == 'Project' && $filterobj->id) {
2001
-				$sql .= " AND a.fk_project = " . ((int) $filterobj->id);
2001
+				$sql .= " AND a.fk_project = ".((int) $filterobj->id);
2002 2002
 			} elseif (is_object($filterobj) && get_class($filterobj) == 'Adherent') {
2003 2003
 				$sql .= " AND a.fk_element = m.rowid AND a.elementtype = 'member'";
2004 2004
 				if ($filterobj->id) {
2005
-					$sql .= " AND a.fk_element = " . ((int) $filterobj->id);
2005
+					$sql .= " AND a.fk_element = ".((int) $filterobj->id);
2006 2006
 				}
2007 2007
 			} elseif (is_object($filterobj) && get_class($filterobj) == 'Commande') {
2008 2008
 				$sql .= " AND a.fk_element = o.rowid AND a.elementtype = 'order'";
2009 2009
 				if ($filterobj->id) {
2010
-					$sql .= " AND a.fk_element = " . ((int) $filterobj->id);
2010
+					$sql .= " AND a.fk_element = ".((int) $filterobj->id);
2011 2011
 				}
2012 2012
 			} elseif (is_object($filterobj) && get_class($filterobj) == 'CommandeFournisseur') {
2013 2013
 				$sql .= " AND a.fk_element = o.rowid AND a.elementtype = 'order_supplier'";
2014 2014
 				if ($filterobj->id) {
2015
-					$sql .= " AND a.fk_element = " . ((int) $filterobj->id);
2015
+					$sql .= " AND a.fk_element = ".((int) $filterobj->id);
2016 2016
 				}
2017 2017
 			} elseif (is_object($filterobj) && get_class($filterobj) == 'Facture') {
2018 2018
 				$sql .= " AND a.fk_element = o.rowid AND a.elementtype = 'invoice'";
2019 2019
 				if ($filterobj->id) {
2020
-					$sql .= " AND a.fk_element = " . ((int) $filterobj->id);
2020
+					$sql .= " AND a.fk_element = ".((int) $filterobj->id);
2021 2021
 				}
2022 2022
 			} elseif (is_object($filterobj) && get_class($filterobj) == 'FactureFournisseur') {
2023 2023
 				$sql .= " AND a.fk_element = o.rowid AND a.elementtype = 'invoice_supplier'";
2024 2024
 				if ($filterobj->id) {
2025
-					$sql .= " AND a.fk_element = " . ((int) $filterobj->id);
2025
+					$sql .= " AND a.fk_element = ".((int) $filterobj->id);
2026 2026
 				}
2027 2027
 			} elseif (is_object($filterobj) && get_class($filterobj) == 'Product') {
2028 2028
 				$sql .= " AND a.fk_element = o.rowid AND a.elementtype = 'product'";
2029 2029
 				if ($filterobj->id) {
2030
-					$sql .= " AND a.fk_element = " . ((int) $filterobj->id);
2030
+					$sql .= " AND a.fk_element = ".((int) $filterobj->id);
2031 2031
 				}
2032 2032
 			} elseif (is_object($filterobj) && get_class($filterobj) == 'Ticket') {
2033 2033
 				$sql .= " AND a.fk_element = o.rowid AND a.elementtype = 'ticket'";
2034 2034
 				if ($filterobj->id) {
2035
-					$sql .= " AND a.fk_element = " . ((int) $filterobj->id);
2035
+					$sql .= " AND a.fk_element = ".((int) $filterobj->id);
2036 2036
 				}
2037 2037
 			} elseif (is_object($filterobj) && get_class($filterobj) == 'BOM') {
2038 2038
 				$sql .= " AND a.fk_element = o.rowid AND a.elementtype = 'bom'";
2039 2039
 				if ($filterobj->id) {
2040
-					$sql .= " AND a.fk_element = " . ((int) $filterobj->id);
2040
+					$sql .= " AND a.fk_element = ".((int) $filterobj->id);
2041 2041
 				}
2042 2042
 			} elseif (is_object($filterobj) && get_class($filterobj) == 'Contrat') {
2043 2043
 				$sql .= " AND a.fk_element = o.rowid AND a.elementtype = 'contract'";
2044 2044
 				if ($filterobj->id) {
2045
-					$sql .= " AND a.fk_element = " . ((int) $filterobj->id);
2045
+					$sql .= " AND a.fk_element = ".((int) $filterobj->id);
2046 2046
 				}
2047 2047
 			} elseif (is_object($filterobj) && get_class($filterobj) == 'Expedition') {
2048 2048
 				$sql .= " AND a.fk_element = s.rowid AND a.elementtype = 'shipping'"; //expedition filter
2049 2049
 				if ($filterobj->id) {
2050
-					$sql .= " AND a.fk_element = " . ((int) $filterobj->id);
2050
+					$sql .= " AND a.fk_element = ".((int) $filterobj->id);
2051 2051
 				}
2052 2052
 			} elseif (
2053 2053
 				is_object($filterobj) && is_array($filterobj->fields) && is_array($filterobj->fields['rowid'])
@@ -2055,32 +2055,32 @@  discard block
 block discarded – undo
2055 2055
 				&& $filterobj->table_element && $filterobj->element
2056 2056
 			) {
2057 2057
 				// Generic case (if there is a $filterobj and a field rowid and (ref or label) exists.
2058
-				$sql .= " AND a.fk_element = o.rowid AND a.elementtype = '" . $db->escape($filterobj->element) . ($module ? "@" . $module : "") . "'";
2058
+				$sql .= " AND a.fk_element = o.rowid AND a.elementtype = '".$db->escape($filterobj->element).($module ? "@".$module : "")."'";
2059 2059
 				if ($filterobj->id) {
2060
-					$sql .= " AND a.fk_element = " . ((int) $filterobj->id);
2060
+					$sql .= " AND a.fk_element = ".((int) $filterobj->id);
2061 2061
 				}
2062 2062
 			} elseif (is_object($filterobj)) {
2063 2063
 				return 'Bad value for $filterobj';
2064 2064
 			}
2065 2065
 		} else {
2066 2066
 			if (is_object($filterobj) && $filterobj->id > 0 && get_class($filterobj) == 'User') {
2067
-				$sql .= " AND (u.rowid = " . ((int) $filterobj->id) . ' OR ';
2068
-				$sql .= " EXISTS (SELECT r.rowid FROM " . MAIN_DB_PREFIX . "actioncomm_resources as r WHERE a.id = r.fk_actioncomm";
2069
-				$sql .= " AND r.element_type = '" . $db->escape($filterobj->table_element) . "' AND r.fk_element = " . ((int) $filterobj->id) . ')';
2067
+				$sql .= " AND (u.rowid = ".((int) $filterobj->id).' OR ';
2068
+				$sql .= " EXISTS (SELECT r.rowid FROM ".MAIN_DB_PREFIX."actioncomm_resources as r WHERE a.id = r.fk_actioncomm";
2069
+				$sql .= " AND r.element_type = '".$db->escape($filterobj->table_element)."' AND r.fk_element = ".((int) $filterobj->id).')';
2070 2070
 				$sql .= ")";
2071 2071
 			}
2072 2072
 			if (is_object($objcon) && $objcon->id > 0) {
2073
-				$sql .= " AND EXISTS (SELECT r.rowid FROM " . MAIN_DB_PREFIX . "actioncomm_resources as r WHERE a.id = r.fk_actioncomm";
2074
-				$sql .= " AND r.element_type = '" . $db->escape($objcon->table_element) . "' AND r.fk_element = " . ((int) $objcon->id) . ')';
2073
+				$sql .= " AND EXISTS (SELECT r.rowid FROM ".MAIN_DB_PREFIX."actioncomm_resources as r WHERE a.id = r.fk_actioncomm";
2074
+				$sql .= " AND r.element_type = '".$db->escape($objcon->table_element)."' AND r.fk_element = ".((int) $objcon->id).')';
2075 2075
 			}
2076 2076
 		}
2077 2077
 
2078 2078
 		if (!empty($tms_start) && !empty($tms_end)) {
2079
-			$sql .= " AND ((a.datep BETWEEN '" . $db->idate($tms_start) . "' AND '" . $db->idate($tms_end) . "') OR (a.datep2 BETWEEN '" . $db->idate($tms_start) . "' AND '" . $db->idate($tms_end) . "'))";
2079
+			$sql .= " AND ((a.datep BETWEEN '".$db->idate($tms_start)."' AND '".$db->idate($tms_end)."') OR (a.datep2 BETWEEN '".$db->idate($tms_start)."' AND '".$db->idate($tms_end)."'))";
2080 2080
 		} elseif (empty($tms_start) && !empty($tms_end)) {
2081
-			$sql .= " AND ((a.datep <= '" . $db->idate($tms_end) . "') OR (a.datep2 <= '" . $db->idate($tms_end) . "'))";
2081
+			$sql .= " AND ((a.datep <= '".$db->idate($tms_end)."') OR (a.datep2 <= '".$db->idate($tms_end)."'))";
2082 2082
 		} elseif (!empty($tms_start) && empty($tms_end)) {
2083
-			$sql .= " AND ((a.datep >= '" . $db->idate($tms_start) . "') OR (a.datep2 >= '" . $db->idate($tms_start) . "'))";
2083
+			$sql .= " AND ((a.datep >= '".$db->idate($tms_start)."') OR (a.datep2 >= '".$db->idate($tms_start)."'))";
2084 2084
 		}
2085 2085
 
2086 2086
 		if (is_array($actioncode) && !empty($actioncode)) {
@@ -2110,7 +2110,7 @@  discard block
 block discarded – undo
2110 2110
 
2111 2111
 		// Fields from hook
2112 2112
 		$parameters = array('sql' => &$sql, 'filterobj' => $filterobj, 'objcon' => $objcon, 'module' => $module);
2113
-		$reshook = $hookmanager->executeHooks('showActionsDoneListWhere', $parameters);    // Note that $action and $object may have been modified by hook
2113
+		$reshook = $hookmanager->executeHooks('showActionsDoneListWhere', $parameters); // Note that $action and $object may have been modified by hook
2114 2114
 		if (!empty($hookmanager->resPrint)) {
2115 2115
 			$sql .= $hookmanager->resPrint;
2116 2116
 		}
@@ -2121,7 +2121,7 @@  discard block
 block discarded – undo
2121 2121
 				$sql2 = addMailingEventTypeSQL($code, $objcon, $filterobj);
2122 2122
 				if (!empty($sql2)) {
2123 2123
 					if (!empty($sql)) {
2124
-						$sql = $sql . " UNION " . $sql2;
2124
+						$sql = $sql." UNION ".$sql2;
2125 2125
 					} elseif (empty($sql)) {
2126 2126
 						$sql = $sql2;
2127 2127
 					}
@@ -2131,7 +2131,7 @@  discard block
 block discarded – undo
2131 2131
 		} else {
2132 2132
 			$sql2 = addMailingEventTypeSQL($actioncode, $objcon, $filterobj);
2133 2133
 			if (!empty($sql) && !empty($sql2)) {
2134
-				$sql = $sql . " UNION " . $sql2;
2134
+				$sql = $sql." UNION ".$sql2;
2135 2135
 			} elseif (empty($sql) && !empty($sql2)) {
2136 2136
 				$sql = $sql2;
2137 2137
 			}
@@ -2245,10 +2245,10 @@  discard block
 block discarded – undo
2245 2245
 	if (isModEnabled('agenda') || (isModEnabled('mailing') && !empty($objcon->email))) {
2246 2246
 		$delay_warning = getDolGlobalInt('MAIN_DELAY_ACTIONS_TODO') * 24 * 60 * 60;
2247 2247
 
2248
-		require_once DOL_DOCUMENT_ROOT . '/comm/action/class/actioncomm.class.php';
2249
-		include_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php';
2250
-		require_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
2251
-		require_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php';
2248
+		require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
2249
+		include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
2250
+		require_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
2251
+		require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
2252 2252
 
2253 2253
 		$formactions = new FormActions($db);
2254 2254
 
@@ -2258,20 +2258,20 @@  discard block
 block discarded – undo
2258 2258
 		$contactstatic = new Contact($db);
2259 2259
 		$elementlinkcache = array();
2260 2260
 
2261
-		$out .= '<form name="listactionsfilter" class="listactionsfilter" action="' . $_SERVER["PHP_SELF"] . '" method="POST">';
2262
-		$out .= '<input type="hidden" name="token" value="' . newToken() . '">';
2261
+		$out .= '<form name="listactionsfilter" class="listactionsfilter" action="'.$_SERVER["PHP_SELF"].'" method="POST">';
2262
+		$out .= '<input type="hidden" name="token" value="'.newToken().'">';
2263 2263
 		if (
2264 2264
 			$objcon && get_class($objcon) == 'Contact' &&
2265 2265
 			(is_null($filterobj) || get_class($filterobj) == 'Societe')
2266 2266
 		) {
2267
-			$out .= '<input type="hidden" name="id" value="' . $objcon->id . '" />';
2267
+			$out .= '<input type="hidden" name="id" value="'.$objcon->id.'" />';
2268 2268
 		} else {
2269
-			$out .= '<input type="hidden" name="id" value="' . $filterobj->id . '" />';
2269
+			$out .= '<input type="hidden" name="id" value="'.$filterobj->id.'" />';
2270 2270
 		}
2271 2271
 		if ($filterobj && get_class($filterobj) == 'Societe') {
2272
-			$out .= '<input type="hidden" name="socid" value="' . $filterobj->id . '" />';
2272
+			$out .= '<input type="hidden" name="socid" value="'.$filterobj->id.'" />';
2273 2273
 		} else {
2274
-			$out .= '<input type="hidden" name="userid" value="' . $filterobj->id . '" />';
2274
+			$out .= '<input type="hidden" name="userid" value="'.$filterobj->id.'" />';
2275 2275
 		}
2276 2276
 
2277 2277
 		$out .= "\n";
@@ -2294,7 +2294,7 @@  discard block
 block discarded – undo
2294 2294
 		}
2295 2295
 
2296 2296
 		// ID
2297
-		$out .= '<td class="liste_titre"><input type="text" class="width50" name="search_rowid" value="' . (isset($filters['search_rowid']) ? $filters['search_rowid'] : '') . '"></td>';
2297
+		$out .= '<td class="liste_titre"><input type="text" class="width50" name="search_rowid" value="'.(isset($filters['search_rowid']) ? $filters['search_rowid'] : '').'"></td>';
2298 2298
 		// Date
2299 2299
 		$out .= '<td class="liste_titre center">';
2300 2300
 		$out .= $form->selectDateToDate($tms_start, $tms_end, 'dateevent', 1);
@@ -2306,7 +2306,7 @@  discard block
 block discarded – undo
2306 2306
 		$out .= $formactions->select_type_actions($actioncode, "actioncode", '', getDolGlobalString('AGENDA_USE_EVENT_TYPE') ? -1 : 1, 0, (getDolGlobalString('AGENDA_USE_MULTISELECT_TYPE') ? 1 : 0), 1, 'selecttype combolargeelem minwidth100 maxwidth150', 1);
2307 2307
 		$out .= '</td>';
2308 2308
 		// Label
2309
-		$out .= '<td class="liste_titre maxwidth100onsmartphone"><input type="text" class="maxwidth100onsmartphone" name="search_agenda_label" value="' . $filters['search_agenda_label'] . '"></td>';
2309
+		$out .= '<td class="liste_titre maxwidth100onsmartphone"><input type="text" class="maxwidth100onsmartphone" name="search_agenda_label" value="'.$filters['search_agenda_label'].'"></td>';
2310 2310
 		$out .= '<td class="liste_titre"></td>';
2311 2311
 		$out .= '<td class="liste_titre"></td>';
2312 2312
 		// Status ($percent can be 'na'or < 100 or 100)
@@ -2330,10 +2330,10 @@  discard block
 block discarded – undo
2330 2330
 		if ($donetodo && $filterobj !== null) {
2331 2331
 			$tmp = '';
2332 2332
 			if (get_class($filterobj) == 'Societe') {
2333
-				$tmp .= '<a href="' . DOL_URL_ROOT . '/comm/action/list.php?mode=show_list&socid=' . $filterobj->id . '&status=done">';
2333
+				$tmp .= '<a href="'.DOL_URL_ROOT.'/comm/action/list.php?mode=show_list&socid='.$filterobj->id.'&status=done">';
2334 2334
 			}
2335 2335
 			if (get_class($filterobj) == 'User') {
2336
-				$tmp .= '<a href="' . DOL_URL_ROOT . '/comm/action/list.php?mode=show_list&userid=' . $filterobj->id . '&status=done">';
2336
+				$tmp .= '<a href="'.DOL_URL_ROOT.'/comm/action/list.php?mode=show_list&userid='.$filterobj->id.'&status=done">';
2337 2337
 			}
2338 2338
 			$tmp .= ($donetodo != 'done' ? $langs->trans("ActionsToDoShort") : '');
2339 2339
 			$tmp .= ($donetodo != 'done' && $donetodo != 'todo' ? ' / ' : '');
@@ -2361,7 +2361,7 @@  discard block
 block discarded – undo
2361 2361
 		}
2362 2362
 		$out .= '</tr>';
2363 2363
 
2364
-		require_once DOL_DOCUMENT_ROOT . '/comm/action/class/cactioncomm.class.php';
2364
+		require_once DOL_DOCUMENT_ROOT.'/comm/action/class/cactioncomm.class.php';
2365 2365
 		$caction = new CActionComm($db);
2366 2366
 		$arraylist = $caction->liste_array(1, 'code', '', (getDolGlobalString('AGENDA_USE_EVENT_TYPE') ? 0 : 1), '', 1);
2367 2367
 
@@ -2390,7 +2390,7 @@  discard block
 block discarded – undo
2390 2390
 			// Ref
2391 2391
 			$out .= '<td class="nowraponall">';
2392 2392
 			if (isset($histo[$key]['type']) && $histo[$key]['type'] == 'mailing') {
2393
-				$out .= '<a href="' . DOL_URL_ROOT . '/comm/mailing/card.php?id=' . $histo[$key]['id'] . '">' . img_object($langs->trans("ShowEMailing"), "email") . ' ';
2393
+				$out .= '<a href="'.DOL_URL_ROOT.'/comm/mailing/card.php?id='.$histo[$key]['id'].'">'.img_object($langs->trans("ShowEMailing"), "email").' ';
2394 2394
 				$out .= $histo[$key]['id'];
2395 2395
 				$out .= '</a>';
2396 2396
 			} else {
@@ -2399,7 +2399,7 @@  discard block
 block discarded – undo
2399 2399
 			$out .= '</td>';
2400 2400
 
2401 2401
 			// Date
2402
-			$out .=  '<td class="center nowraponall nopaddingtopimp nopaddingbottomimp">';
2402
+			$out .= '<td class="center nowraponall nopaddingtopimp nopaddingbottomimp">';
2403 2403
 			if ($histo[$key]['dateend']) {	// There is also a end date
2404 2404
 				$tmpa = dol_getdate($histo[$key]['datestart']);
2405 2405
 				$tmpb = dol_getdate($histo[$key]['dateend']);
@@ -2423,19 +2423,19 @@  discard block
 block discarded – undo
2423 2423
 					}
2424 2424
 				} else {
2425 2425
 					// Not the same day
2426
-					$out .=  '<div class="center inline-block lineheightsmall">';
2427
-					$out .=  dol_print_date($histo[$key]['datestart'], 'dayreduceformat', 'tzuserrel');
2428
-					$out .=  '<br><span class="opacitymedium hourspan">';
2429
-					$out .=  dol_print_date($histo[$key]['datestart'], 'hourreduceformat', 'tzuserrel');
2430
-					$out .=  '</span>';
2431
-					$out .=  '</div>';
2432
-					$out .=  ' ';
2433
-					$out .=  '<div class="center inline-block lineheightsmall">';
2434
-					$out .=  dol_print_date($histo[$key]['dateend'], 'dayreduceformat', 'tzuserrel');
2435
-					$out .=  '<br><span class="opacitymedium hourspan">';
2436
-					$out .=  dol_print_date($histo[$key]['dateend'], 'hourreduceformat', 'tzuserrel');
2437
-					$out .=  '</span>';
2438
-					$out .=  '</div>';
2426
+					$out .= '<div class="center inline-block lineheightsmall">';
2427
+					$out .= dol_print_date($histo[$key]['datestart'], 'dayreduceformat', 'tzuserrel');
2428
+					$out .= '<br><span class="opacitymedium hourspan">';
2429
+					$out .= dol_print_date($histo[$key]['datestart'], 'hourreduceformat', 'tzuserrel');
2430
+					$out .= '</span>';
2431
+					$out .= '</div>';
2432
+					$out .= ' ';
2433
+					$out .= '<div class="center inline-block lineheightsmall">';
2434
+					$out .= dol_print_date($histo[$key]['dateend'], 'dayreduceformat', 'tzuserrel');
2435
+					$out .= '<br><span class="opacitymedium hourspan">';
2436
+					$out .= dol_print_date($histo[$key]['dateend'], 'hourreduceformat', 'tzuserrel');
2437
+					$out .= '</span>';
2438
+					$out .= '</div>';
2439 2439
 				}
2440 2440
 			}
2441 2441
 			// Add the late warning
@@ -2453,9 +2453,9 @@  discard block
 block discarded – undo
2453 2453
 				$late = 1;
2454 2454
 			}
2455 2455
 			if ($late) {
2456
-				$out .= img_warning($langs->trans("Late")) . ' ';
2456
+				$out .= img_warning($langs->trans("Late")).' ';
2457 2457
 			}
2458
-			$out .=  '</td>';
2458
+			$out .= '</td>';
2459 2459
 
2460 2460
 			/*
2461 2461
 			$out .= '<td class="center nowraponall">';
@@ -2523,7 +2523,7 @@  discard block
 block discarded – undo
2523 2523
 					$labelOfTypeToShow = $langs->trans("Emailing");
2524 2524
 				}
2525 2525
 				if ($actionstatic->type_code == 'AC_OTH_AUTO' && ($actionstatic->type_code != $actionstatic->code) && $labelOfTypeToShow && !empty($arraylist[$actionstatic->code])) {
2526
-					$labelOfTypeToShow .= ' - ' . $arraylist[$actionstatic->code]; // Show also detailed code
2526
+					$labelOfTypeToShow .= ' - '.$arraylist[$actionstatic->code]; // Show also detailed code
2527 2527
 				}
2528 2528
 			}
2529 2529
 
@@ -2532,7 +2532,7 @@  discard block
 block discarded – undo
2532 2532
 				$labelOfTypeToShowLong .= ' (auto)';
2533 2533
 			}
2534 2534
 
2535
-			$out .= '<td class="tdoverflowmax125" title="' . $labelOfTypeToShowLong . '">';
2535
+			$out .= '<td class="tdoverflowmax125" title="'.$labelOfTypeToShowLong.'">';
2536 2536
 			$out .= $actionstatic->getTypePicto();
2537 2537
 			$out .= $labelOfTypeToShow;
2538 2538
 			$out .= '</td>';
@@ -2540,19 +2540,19 @@  discard block
 block discarded – undo
2540 2540
 			// Title/Label of event
2541 2541
 			$out .= '<td class="tdoverflowmax300"';
2542 2542
 			if (isset($histo[$key]['type']) && $histo[$key]['type'] == 'action') {
2543
-				$transcode = $langs->trans("Action" . $histo[$key]['acode']);
2543
+				$transcode = $langs->trans("Action".$histo[$key]['acode']);
2544 2544
 				//$libelle = ($transcode != "Action".$histo[$key]['acode'] ? $transcode : $histo[$key]['alabel']);
2545 2545
 				$label = $histo[$key]['note'];
2546 2546
 				$actionstatic->id = $histo[$key]['id'];
2547
-				$out .= ' title="' . dol_escape_htmltag($label) . '">';
2547
+				$out .= ' title="'.dol_escape_htmltag($label).'">';
2548 2548
 				$out .= dol_trunc($label, 120);
2549 2549
 			}
2550 2550
 			if (isset($histo[$key]['type']) && $histo[$key]['type'] == 'mailing') {
2551
-				$transcode = $langs->trans("Action" . $histo[$key]['acode']);
2552
-				$label = ($transcode != "Action" . $histo[$key]['acode'] ? $transcode : 'Send mass mailing');
2553
-				$label .= ' - ' . $histo[$key]['note'];
2554
-				$out .= '<a href="' . DOL_URL_ROOT . '/comm/mailing/card.php?id=' . $histo[$key]['id'] . '"';
2555
-				$out .= ' title="' . dol_escape_htmltag($label) . '">';
2551
+				$transcode = $langs->trans("Action".$histo[$key]['acode']);
2552
+				$label = ($transcode != "Action".$histo[$key]['acode'] ? $transcode : 'Send mass mailing');
2553
+				$label .= ' - '.$histo[$key]['note'];
2554
+				$out .= '<a href="'.DOL_URL_ROOT.'/comm/mailing/card.php?id='.$histo[$key]['id'].'"';
2555
+				$out .= ' title="'.dol_escape_htmltag($label).'">';
2556 2556
 				//$out .= img_object($langs->trans("EMailing").'<br>'.$histo[$key]['note'], "email").' ';
2557 2557
 				$out .= dol_trunc($label, 120);
2558 2558
 				$out .= '</a>';
@@ -2590,7 +2590,7 @@  discard block
 block discarded – undo
2590 2590
 						$out .= $contact->getNomUrl(-3, '', 10, '', -1, 0, 'paddingright');
2591 2591
 						if (isset($histo[$key]['acode']) && $histo[$key]['acode'] == 'AC_TEL') {
2592 2592
 							if (!empty($contact->phone_pro)) {
2593
-								$out .= '(' . dol_print_phone($contact->phone_pro) . ')';
2593
+								$out .= '('.dol_print_phone($contact->phone_pro).')';
2594 2594
 							}
2595 2595
 						}
2596 2596
 						$out .= '<div class="paddingright"></div>';
@@ -2602,7 +2602,7 @@  discard block
 block discarded – undo
2602 2602
 				$contactstatic->firstname = $histo[$key]['firstname'];
2603 2603
 				$contactstatic->id = $histo[$key]['contact_id'];
2604 2604
 				$contactstatic->photo = $histo[$key]['contact_photo'];
2605
-				$out .= '<td width="120">' . $contactstatic->getNomUrl(-1, '', 10) . '</td>';
2605
+				$out .= '<td width="120">'.$contactstatic->getNomUrl(-1, '', 10).'</td>';
2606 2606
 			} else {
2607 2607
 				$out .= '<td>&nbsp;</td>';
2608 2608
 			}
@@ -2621,7 +2621,7 @@  discard block
 block discarded – undo
2621 2621
 		}
2622 2622
 		if (empty($histo)) {
2623 2623
 			$colspan = 9;
2624
-			$out .= '<tr><td colspan="' . $colspan . '"><span class="opacitymedium">' . $langs->trans("NoRecordFound") . '</span></td></tr>';
2624
+			$out .= '<tr><td colspan="'.$colspan.'"><span class="opacitymedium">'.$langs->trans("NoRecordFound").'</span></td></tr>';
2625 2625
 		}
2626 2626
 
2627 2627
 		$out .= "</table>\n";
@@ -2652,9 +2652,9 @@  discard block
 block discarded – undo
2652 2652
 	$i = -1;
2653 2653
 
2654 2654
 	$sql = "SELECT s.rowid, s.client, s.fournisseur, s.nom as name, s.name_alias, s.email, s.address, s.zip, s.town, s.code_client, s.code_fournisseur, s.code_compta, s.code_compta_fournisseur, s.canvas, s.status";
2655
-	$sql .= " FROM " . MAIN_DB_PREFIX . "societe as s";
2656
-	$sql .= " WHERE s.parent = " . ((int) $object->id);
2657
-	$sql .= " AND s.entity IN (" . getEntity('societe') . ")";
2655
+	$sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
2656
+	$sql .= " WHERE s.parent = ".((int) $object->id);
2657
+	$sql .= " AND s.entity IN (".getEntity('societe').")";
2658 2658
 	$sql .= " ORDER BY s.nom";
2659 2659
 
2660 2660
 	$result = $db->query($sql);
@@ -2665,12 +2665,12 @@  discard block
 block discarded – undo
2665 2665
 
2666 2666
 		print load_fiche_titre($langs->trans("Subsidiaries"), '', '');
2667 2667
 
2668
-		print "\n" . '<div class="div-table-responsive-no-min">' . "\n";
2669
-		print '<table class="noborder centpercent">' . "\n";
2668
+		print "\n".'<div class="div-table-responsive-no-min">'."\n";
2669
+		print '<table class="noborder centpercent">'."\n";
2670 2670
 
2671
-		print '<tr class="liste_titre"><td>' . $langs->trans("Company") . '</td>';
2672
-		print '<td>' . $langs->trans("Address") . '</td><td>' . $langs->trans("Zip") . '</td>';
2673
-		print '<td>' . $langs->trans("Town") . '</td><td>' . $langs->trans("CustomerCode") . '</td>';
2671
+		print '<tr class="liste_titre"><td>'.$langs->trans("Company").'</td>';
2672
+		print '<td>'.$langs->trans("Address").'</td><td>'.$langs->trans("Zip").'</td>';
2673
+		print '<td>'.$langs->trans("Town").'</td><td>'.$langs->trans("CustomerCode").'</td>';
2674 2674
 		print "<td>&nbsp;</td>";
2675 2675
 		print "</tr>";
2676 2676
 
@@ -2700,13 +2700,13 @@  discard block
 block discarded – undo
2700 2700
 			print $socstatic->getNomUrl(1);
2701 2701
 			print '</td>';
2702 2702
 
2703
-			print '<td class="tdoverflowmax400" title="' . dol_escape_htmltag($obj->address) . '">' . dol_escape_htmltag($obj->address) . '</td>';
2704
-			print '<td class="tdoverflowmax100" title="' . dol_escape_htmltag($obj->zip) . '">' . $obj->zip . '</td>';
2705
-			print '<td class="tdoverflowmax200" title="' . dol_escape_htmltag($obj->town) . '">' . $obj->town . '</td>';
2706
-			print '<td class="tdoverflowmax200" title="' . dol_escape_htmltag($obj->code_client) . '">' . $obj->code_client . '</td>';
2703
+			print '<td class="tdoverflowmax400" title="'.dol_escape_htmltag($obj->address).'">'.dol_escape_htmltag($obj->address).'</td>';
2704
+			print '<td class="tdoverflowmax100" title="'.dol_escape_htmltag($obj->zip).'">'.$obj->zip.'</td>';
2705
+			print '<td class="tdoverflowmax200" title="'.dol_escape_htmltag($obj->town).'">'.$obj->town.'</td>';
2706
+			print '<td class="tdoverflowmax200" title="'.dol_escape_htmltag($obj->code_client).'">'.$obj->code_client.'</td>';
2707 2707
 
2708 2708
 			print '<td class="center">';
2709
-			print '<a class="editfielda" href="' . DOL_URL_ROOT . '/societe/card.php?socid=' . ((int) $obj->rowid) . '&action=edit&token=' . newToken() . '">';
2709
+			print '<a class="editfielda" href="'.DOL_URL_ROOT.'/societe/card.php?socid='.((int) $obj->rowid).'&action=edit&token='.newToken().'">';
2710 2710
 			print img_edit();
2711 2711
 			print '</a></td>';
2712 2712
 
@@ -2714,7 +2714,7 @@  discard block
 block discarded – undo
2714 2714
 			$i++;
2715 2715
 		}
2716 2716
 		print "\n</table>\n";
2717
-		print '</div>' . "\n";
2717
+		print '</div>'."\n";
2718 2718
 	}
2719 2719
 
2720 2720
 	print "<br>\n";
@@ -2757,7 +2757,7 @@  discard block
 block discarded – undo
2757 2757
 		} elseif ($actioncode == 'AC_ALL_AUTO') {
2758 2758
 			$sql .= " $sqlANDOR c.type = 'systemauto'";
2759 2759
 		} else {
2760
-			$sql .= " $sqlANDOR c.code = '" . $db->escape($actioncode) . "'";
2760
+			$sql .= " $sqlANDOR c.code = '".$db->escape($actioncode)."'";
2761 2761
 		}
2762 2762
 	}
2763 2763
 
@@ -2778,9 +2778,9 @@  discard block
 block discarded – undo
2778 2778
 	global $db;
2779 2779
 
2780 2780
 	if ($donetodo == 'todo') {
2781
-		$sql .= " AND ((a.percent >= 0 AND a.percent < 100) OR (a.percent = -1 AND a.datep > '" . $db->idate($now) . "'))";
2781
+		$sql .= " AND ((a.percent >= 0 AND a.percent < 100) OR (a.percent = -1 AND a.datep > '".$db->idate($now)."'))";
2782 2782
 	} elseif ($donetodo == 'done') {
2783
-		$sql .= " AND (a.percent = 100 OR (a.percent = -1 AND a.datep <= '" . $db->idate($now) . "'))";
2783
+		$sql .= " AND (a.percent = 100 OR (a.percent = -1 AND a.datep <= '".$db->idate($now)."'))";
2784 2784
 	}
2785 2785
 	if (is_array($filters) && isset($filters['search_complete']) && $filters['search_complete'] === 'na') {
2786 2786
 		$sql .= " AND a.percent = -1";
@@ -2836,8 +2836,8 @@  discard block
 block discarded – undo
2836 2836
 		} elseif (is_object($filterobj) && get_class($filterobj) == 'Ticket') {
2837 2837
 			$sql2 .= ", '' as ref";
2838 2838
 		}
2839
-		$sql2 .= " FROM " . MAIN_DB_PREFIX . "mailing as m, " . MAIN_DB_PREFIX . "mailing_cibles as mc, " . MAIN_DB_PREFIX . "user as u";
2840
-		$sql2 .= " WHERE mc.email = '" . $db->escape($objcon->email) . "'"; // Search is done on email.
2839
+		$sql2 .= " FROM ".MAIN_DB_PREFIX."mailing as m, ".MAIN_DB_PREFIX."mailing_cibles as mc, ".MAIN_DB_PREFIX."user as u";
2840
+		$sql2 .= " WHERE mc.email = '".$db->escape($objcon->email)."'"; // Search is done on email.
2841 2841
 		$sql2 .= " AND mc.statut = 1";
2842 2842
 		$sql2 .= " AND u.rowid = m.fk_user_valid";
2843 2843
 		$sql2 .= " AND mc.fk_mailing=m.rowid";
@@ -2879,15 +2879,15 @@  discard block
 block discarded – undo
2879 2879
 	//$urllogo = '';
2880 2880
 	$urllogopublic = '';
2881 2881
 	if ($showlogo) {
2882
-		if (!empty($mysoc->logo_small) && is_readable($conf->mycompany->dir_output . '/logos/thumbs/' . $logosmall)) {
2882
+		if (!empty($mysoc->logo_small) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$logosmall)) {
2883 2883
 			//$urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&amp;modulepart=mycompany&amp;file='.urlencode('logos/thumbs/'.$logosmall);
2884
-			$urllogopublic = $dolibarr_main_url_root . '/viewimage.php?modulepart=mycompany&entity=' . $conf->entity . '&file=' . urlencode('logos/thumbs/' . $logosmall);
2885
-		} elseif (!empty($mysoc->logo) && is_readable($conf->mycompany->dir_output . '/logos/' . $logo)) {
2884
+			$urllogopublic = $dolibarr_main_url_root.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/thumbs/'.$logosmall);
2885
+		} elseif (!empty($mysoc->logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$logo)) {
2886 2886
 			//$urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&amp;modulepart=mycompany&amp;file='.urlencode('logos/'.$logo);
2887
-			$urllogopublic = $dolibarr_main_url_root . '/viewimage.php?modulepart=mycompany&entity=' . $conf->entity . '&file=' . urlencode('logos/' . $logo);
2888
-		} elseif (is_readable(DOL_DOCUMENT_ROOT . '/theme/dolibarr_logo.svg')) {
2887
+			$urllogopublic = $dolibarr_main_url_root.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/'.$logo);
2888
+		} elseif (is_readable(DOL_DOCUMENT_ROOT.'/theme/dolibarr_logo.svg')) {
2889 2889
 			//$urllogo = DOL_URL_ROOT.'/theme/dolibarr_logo.svg';
2890
-			$urllogopublic = $dolibarr_main_url_root . '/theme/dolibarr_logo.svg';
2890
+			$urllogopublic = $dolibarr_main_url_root.'/theme/dolibarr_logo.svg';
2891 2891
 		}
2892 2892
 	}
2893 2893
 
@@ -2899,19 +2899,19 @@  discard block
 block discarded – undo
2899 2899
 		print '<div class="logopublicpayment">';
2900 2900
 		if ($urllogopublic) {
2901 2901
 			if (!is_numeric($showlogo)) {
2902
-				print '<a href="' . $showlogo . '">';
2902
+				print '<a href="'.$showlogo.'">';
2903 2903
 			}
2904
-			print '<img id="dolpaymentlogo" src="' . $urllogopublic . '">';
2904
+			print '<img id="dolpaymentlogo" src="'.$urllogopublic.'">';
2905 2905
 			if (!is_numeric($showlogo)) {
2906 2906
 				print '</a>';
2907 2907
 			}
2908 2908
 		}
2909 2909
 		if ($alttext) {
2910
-			print '<div class="clearboth"></div><strong>' . $alttext . '</strong>';
2910
+			print '<div class="clearboth"></div><strong>'.$alttext.'</strong>';
2911 2911
 		}
2912 2912
 		print '</div>';
2913 2913
 		if (!getDolGlobalString('MAIN_HIDE_POWERED_BY')) {
2914
-			print '<div class="poweredbypublicpayment opacitymedium right hideonsmartphone"><a class="poweredbyhref" href="https://www.dolibarr.org?utm_medium=website&utm_source=poweredby" target="dolibarr" rel="noopener">' . $langs->trans("PoweredBy") . '<br><img class="poweredbyimg" src="' . DOL_URL_ROOT . '/theme/dolibarr_logo.svg" width="80px"></a></div>';
2914
+			print '<div class="poweredbypublicpayment opacitymedium right hideonsmartphone"><a class="poweredbyhref" href="https://www.dolibarr.org?utm_medium=website&utm_source=poweredby" target="dolibarr" rel="noopener">'.$langs->trans("PoweredBy").'<br><img class="poweredbyimg" src="'.DOL_URL_ROOT.'/theme/dolibarr_logo.svg" width="80px"></a></div>';
2915 2915
 		}
2916 2916
 		print '</div>';
2917 2917
 	}
@@ -2919,7 +2919,7 @@  discard block
 block discarded – undo
2919 2919
 	// Add an optional image under the ban with logo/title
2920 2920
 	if (getDolGlobalString($subimageconst)) {
2921 2921
 		print '<div class="backimagepublicsubimage">';
2922
-		print '<img id="id' . $subimageconst . '" src="' . getDolGlobalString($subimageconst) . '">';
2922
+		print '<img id="id'.$subimageconst.'" src="'.getDolGlobalString($subimageconst).'">';
2923 2923
 		print '</div>';
2924 2924
 	}
2925 2925
 
@@ -2946,11 +2946,11 @@  discard block
 block discarded – undo
2946 2946
 	// Juridical status
2947 2947
 	$line1 = "";
2948 2948
 	if ($fromcompany->forme_juridique_code) {
2949
-		$line1 .= ($line1 ? " - " : "") . getFormeJuridiqueLabel((string) $fromcompany->forme_juridique_code);
2949
+		$line1 .= ($line1 ? " - " : "").getFormeJuridiqueLabel((string) $fromcompany->forme_juridique_code);
2950 2950
 	}
2951 2951
 	// Capital
2952 2952
 	if ($fromcompany->capital) {
2953
-		$line1 .= ($line1 ? " - " : "") . $langs->transnoentities("CapitalOf", (string) $fromcompany->capital) . " " . $langs->transnoentities("Currency" . getDolCurrency());
2953
+		$line1 .= ($line1 ? " - " : "").$langs->transnoentities("CapitalOf", (string) $fromcompany->capital)." ".$langs->transnoentities("Currency".getDolCurrency());
2954 2954
 	}
2955 2955
 	// Prof Id 1
2956 2956
 	if ($fromcompany->idprof1 && ($fromcompany->country_code != 'FR' || !$fromcompany->idprof2)) {
@@ -2958,7 +2958,7 @@  discard block
 block discarded – undo
2958 2958
 		if (preg_match('/\((.*)\)/i', $field, $reg)) {
2959 2959
 			$field = $reg[1];
2960 2960
 		}
2961
-		$line1 .= ($line1 ? " - " : "") . $field . ": " . $fromcompany->idprof1;
2961
+		$line1 .= ($line1 ? " - " : "").$field.": ".$fromcompany->idprof1;
2962 2962
 	}
2963 2963
 	// Prof Id 2
2964 2964
 	if ($fromcompany->idprof2) {
@@ -2966,7 +2966,7 @@  discard block
 block discarded – undo
2966 2966
 		if (preg_match('/\((.*)\)/i', $field, $reg)) {
2967 2967
 			$field = $reg[1];
2968 2968
 		}
2969
-		$line1 .= ($line1 ? " - " : "") . $field . ": " . $fromcompany->idprof2;
2969
+		$line1 .= ($line1 ? " - " : "").$field.": ".$fromcompany->idprof2;
2970 2970
 	}
2971 2971
 
2972 2972
 	// Second line of company infos
@@ -2977,7 +2977,7 @@  discard block
 block discarded – undo
2977 2977
 		if (preg_match('/\((.*)\)/i', $field, $reg)) {
2978 2978
 			$field = $reg[1];
2979 2979
 		}
2980
-		$line2 .= ($line2 ? " - " : "") . $field . ": " . $fromcompany->idprof3;
2980
+		$line2 .= ($line2 ? " - " : "").$field.": ".$fromcompany->idprof3;
2981 2981
 	}
2982 2982
 	// Prof Id 4
2983 2983
 	if ($fromcompany->idprof4) {
@@ -2985,33 +2985,33 @@  discard block
 block discarded – undo
2985 2985
 		if (preg_match('/\((.*)\)/i', $field, $reg)) {
2986 2986
 			$field = $reg[1];
2987 2987
 		}
2988
-		$line2 .= ($line2 ? " - " : "") . $field . ": " . $fromcompany->idprof4;
2988
+		$line2 .= ($line2 ? " - " : "").$field.": ".$fromcompany->idprof4;
2989 2989
 	}
2990 2990
 	// IntraCommunautary VAT
2991 2991
 	if ($fromcompany->tva_intra != '') {
2992
-		$line2 .= ($line2 ? " - " : "") . $langs->transnoentities("VATIntraShort") . ": " . $fromcompany->tva_intra;
2992
+		$line2 .= ($line2 ? " - " : "").$langs->transnoentities("VATIntraShort").": ".$fromcompany->tva_intra;
2993 2993
 	}
2994 2994
 
2995
-	print '<!-- htmlPrintOnlineFooter -->' . "\n";
2995
+	print '<!-- htmlPrintOnlineFooter -->'."\n";
2996 2996
 
2997 2997
 	// css centpercent has been removed from class="..." because not compatible with paddingleft/right and there is an horizontal scroll appearring on payment page for example.
2998
-	print '<footer class="center centpercent opacitymedium">' . "\n";
2998
+	print '<footer class="center centpercent opacitymedium">'."\n";
2999 2999
 	print '<br>';
3000 3000
 	if ($addformmessage) {
3001
-		print '<!-- object = ' . (empty($object) ? 'undefined' : $object->element) . ' -->';
3001
+		print '<!-- object = '.(empty($object) ? 'undefined' : $object->element).' -->';
3002 3002
 		print '<br>';
3003 3003
 
3004
-		$parammessageform = 'ONLINE_PAYMENT_MESSAGE_FORM_' . $suffix;
3004
+		$parammessageform = 'ONLINE_PAYMENT_MESSAGE_FORM_'.$suffix;
3005 3005
 		if (getDolGlobalString($parammessageform) !== '') {
3006 3006
 			print $langs->transnoentities(getDolGlobalString($parammessageform));
3007
-		} elseif (getDolGlobalString('ONLINE_PAYMENT_MESSAGE_FORM')  !== '') {
3007
+		} elseif (getDolGlobalString('ONLINE_PAYMENT_MESSAGE_FORM') !== '') {
3008 3008
 			print $langs->transnoentities(getDolGlobalString('ONLINE_PAYMENT_MESSAGE_FORM'));
3009 3009
 		}
3010 3010
 
3011 3011
 		// Add other message if VAT exists
3012 3012
 		if (!empty($object->total_vat) || !empty($object->total_tva)) {
3013
-			$parammessageform = 'ONLINE_PAYMENT_MESSAGE_FORMIFVAT_' . $suffix;
3014
-			if (getDolGlobalString($parammessageform)  !== '') {
3013
+			$parammessageform = 'ONLINE_PAYMENT_MESSAGE_FORMIFVAT_'.$suffix;
3014
+			if (getDolGlobalString($parammessageform) !== '') {
3015 3015
 				print $langs->transnoentities(getDolGlobalString($parammessageform));
3016 3016
 			} elseif (getDolGlobalString('ONLINE_PAYMENT_MESSAGE_FORMIFVAT') !== '') {
3017 3017
 				print $langs->transnoentities(getDolGlobalString('ONLINE_PAYMENT_MESSAGE_FORMIFVAT'));
@@ -3019,15 +3019,15 @@  discard block
 block discarded – undo
3019 3019
 		}
3020 3020
 	}
3021 3021
 
3022
-	print '<span style="font-size: 10px;"><br><hr>' . "\n";
3023
-	print $fromcompany->name . '<br>';
3022
+	print '<span style="font-size: 10px;"><br><hr>'."\n";
3023
+	print $fromcompany->name.'<br>';
3024 3024
 	print $line1;
3025
-	if (strlen($line1 . $line2) > 50) {
3025
+	if (strlen($line1.$line2) > 50) {
3026 3026
 		print '<br>';
3027 3027
 	} else {
3028 3028
 		print ' - ';
3029 3029
 	}
3030 3030
 	print $line2;
3031 3031
 	print '</span>';
3032
-	print '</footer>' . "\n";
3032
+	print '</footer>'."\n";
3033 3033
 }
Please login to merge, or discard this patch.
htdocs/core/lib/price.lib.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -142,8 +142,8 @@  discard block
 block discarded – undo
142 142
 	// Now we search localtaxes information ourself (rates and types).
143 143
 	$localtax1_type = 0;
144 144
 	$localtax2_type = 0;
145
-	$localtax1_rate = 1000;  // For static analysis, exaggerated value to help detect bugs
146
-	$localtax2_rate = 1000;  // For static analysis, exaggerated value to help detect bugs
145
+	$localtax1_rate = 1000; // For static analysis, exaggerated value to help detect bugs
146
+	$localtax2_rate = 1000; // For static analysis, exaggerated value to help detect bugs
147 147
 
148 148
 	if (is_array($localtaxes_array) && count($localtaxes_array)) {
149 149
 		$localtax1_type = $localtaxes_array[0];
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
 		$tot_sans_remise = $pu * $qty * ($progress / 100);
206 206
 		$tot_avec_remise_ligne = $tot_sans_remise * (1 - ((float) $remise_percent_ligne / 100));
207 207
 	}
208
-	$tot_avec_remise       = $tot_avec_remise_ligne * (1 - ((float) $remise_percent_global / 100));
208
+	$tot_avec_remise = $tot_avec_remise_ligne * (1 - ((float) $remise_percent_global / 100));
209 209
 
210 210
 	// initialize result array
211 211
 	for ($i = 0; $i <= 15; $i++) {
@@ -420,13 +420,13 @@  discard block
 block discarded – undo
420 420
 		}
421 421
 
422 422
 		// Recall function using the multicurrency price as reference price. We must set param $multicurrency_tx to 1 to avoid infinite loop.
423
-		$newresult = calcul_price_total($qty, $pu_devise, $remise_percent_ligne, $txtva, $uselocaltax1_rate, $uselocaltax2_rate, $remise_percent_global, $price_base_type, $info_bits, $type, $seller, $localtaxes_array, $progress, 1, 0, '');  // pu_devise is normally arg#15, here as arg#2 @phan-suppress-current-line PhanPluginSuspiciousParamPosition
423
+		$newresult = calcul_price_total($qty, $pu_devise, $remise_percent_ligne, $txtva, $uselocaltax1_rate, $uselocaltax2_rate, $remise_percent_global, $price_base_type, $info_bits, $type, $seller, $localtaxes_array, $progress, 1, 0, ''); // pu_devise is normally arg#15, here as arg#2 @phan-suppress-current-line PhanPluginSuspiciousParamPosition
424 424
 
425 425
 		if ($multicurrency_code) {
426 426
 			// Restore setup of currency accurency
427
-			$conf->global->MAIN_MAX_DECIMALS_UNIT = $savMAIN_MAX_DECIMALS_UNIT;  // @phan-suppress-current-line PhanPossiblyUndeclaredVariable
428
-			$conf->global->MAIN_MAX_DECIMALS_TOT = $savMAIN_MAX_DECIMALS_TOT;  // @phan-suppress-current-line PhanPossiblyUndeclaredVariable
429
-			$conf->global->MAIN_ROUNDING_RULE_TOT = $savMAIN_ROUNDING_RULE_TOT;  // @phan-suppress-current-line PhanPossiblyUndeclaredVariable
427
+			$conf->global->MAIN_MAX_DECIMALS_UNIT = $savMAIN_MAX_DECIMALS_UNIT; // @phan-suppress-current-line PhanPossiblyUndeclaredVariable
428
+			$conf->global->MAIN_MAX_DECIMALS_TOT = $savMAIN_MAX_DECIMALS_TOT; // @phan-suppress-current-line PhanPossiblyUndeclaredVariable
429
+			$conf->global->MAIN_ROUNDING_RULE_TOT = $savMAIN_ROUNDING_RULE_TOT; // @phan-suppress-current-line PhanPossiblyUndeclaredVariable
430 430
 		}
431 431
 
432 432
 		$result[16] = $newresult[0];
@@ -461,7 +461,7 @@  discard block
 block discarded – undo
461 461
 	$tmpobject = null;
462 462
 	$tmpaction = '';
463 463
 	// @phan-suppress-next-line PhanPluginConstantVariableNull
464
-	$reshook = $hookmanager->executeHooks('calcul_price_total', $parameters, $tmpobject, $tmpaction);	// @phan-suppress-current-line PhanPluginConstantVariableNull
464
+	$reshook = $hookmanager->executeHooks('calcul_price_total', $parameters, $tmpobject, $tmpaction); // @phan-suppress-current-line PhanPluginConstantVariableNull
465 465
 	if ($reshook > 0 && !empty($hookmanager->resArray['result'])) {
466 466
 		$result = $hookmanager->resArray['result'];
467 467
 	}
Please login to merge, or discard this patch.
htdocs/core/lib/security.lib.php 1 patch
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -103,10 +103,10 @@  discard block
 block discarded – undo
103 103
 function dolGetRandomBytes($length)
104 104
 {
105 105
 	if (function_exists('random_bytes')) {	// Available with PHP 7 only.
106
-		return bin2hex(random_bytes((int) floor($length / 2)));	// the bin2hex will double the number of bytes so we take length / 2
106
+		return bin2hex(random_bytes((int) floor($length / 2))); // the bin2hex will double the number of bytes so we take length / 2
107 107
 	}
108 108
 
109
-	return bin2hex(openssl_random_pseudo_bytes((int) floor($length / 2)));		// the bin2hex will double the number of bytes so we take length / 2. May be very slow on Windows.
109
+	return bin2hex(openssl_random_pseudo_bytes((int) floor($length / 2))); // the bin2hex will double the number of bytes so we take length / 2. May be very slow on Windows.
110 110
 }
111 111
 
112 112
 
@@ -276,7 +276,7 @@  discard block
 block discarded – undo
276 276
 
277 277
 	// Salt value
278 278
 	if (getDolGlobalString('MAIN_SECURITY_SALT') && $type != '4' && $type !== 'openldap' && empty($nosalt)) {
279
-		$chain = getDolGlobalString('MAIN_SECURITY_SALT') . $chain;
279
+		$chain = getDolGlobalString('MAIN_SECURITY_SALT').$chain;
280 280
 	}
281 281
 
282 282
 	if ($type == '1' || $type == 'sha1') {
@@ -353,7 +353,7 @@  discard block
 block discarded – undo
353 353
 {
354 354
 	if ($type == '0' && getDolGlobalString('MAIN_SECURITY_HASH_ALGO') == 'password_hash' && function_exists('password_verify')) {
355 355
 		// Try to autodetect which algo we used
356
-		if (! empty($hash[0]) && $hash[0] == '$') {
356
+		if (!empty($hash[0]) && $hash[0] == '$') {
357 357
 			return password_verify($chain, $hash);
358 358
 		} elseif (dol_strlen($hash) == 32) {
359 359
 			return dol_verifyHash($chain, $hash, '3'); // md5
@@ -383,31 +383,31 @@  discard block
 block discarded – undo
383 383
 	$salt = substr(sha1((string) time()), 0, 8);
384 384
 
385 385
 	if ($type === 'md5') {
386
-		return '{MD5}' . base64_encode(hash("md5", $password, true)); //For OpenLdap with md5 (based on an unencrypted password in base)
386
+		return '{MD5}'.base64_encode(hash("md5", $password, true)); //For OpenLdap with md5 (based on an unencrypted password in base)
387 387
 	} elseif ($type === 'md5frommd5') {
388
-		return '{MD5}' . base64_encode(hex2bin($password)); // Create OpenLDAP MD5 password from Dolibarr MD5 password
388
+		return '{MD5}'.base64_encode(hex2bin($password)); // Create OpenLDAP MD5 password from Dolibarr MD5 password
389 389
 	} elseif ($type === 'smd5') {
390
-		return "{SMD5}" . base64_encode(hash("md5", $password . $salt, true) . $salt);
390
+		return "{SMD5}".base64_encode(hash("md5", $password.$salt, true).$salt);
391 391
 	} elseif ($type === 'sha') {
392
-		return '{SHA}' . base64_encode(hash("sha1", $password, true));
392
+		return '{SHA}'.base64_encode(hash("sha1", $password, true));
393 393
 	} elseif ($type === 'ssha') {
394
-		return "{SSHA}" . base64_encode(hash("sha1", $password . $salt, true) . $salt);
394
+		return "{SSHA}".base64_encode(hash("sha1", $password.$salt, true).$salt);
395 395
 	} elseif ($type === 'sha256') {
396
-		return "{SHA256}" . base64_encode(hash("sha256", $password, true));
396
+		return "{SHA256}".base64_encode(hash("sha256", $password, true));
397 397
 	} elseif ($type === 'ssha256') {
398
-		return "{SSHA256}" . base64_encode(hash("sha256", $password . $salt, true) . $salt);
398
+		return "{SSHA256}".base64_encode(hash("sha256", $password.$salt, true).$salt);
399 399
 	} elseif ($type === 'sha384') {
400
-		return "{SHA384}" . base64_encode(hash("sha384", $password, true));
400
+		return "{SHA384}".base64_encode(hash("sha384", $password, true));
401 401
 	} elseif ($type === 'ssha384') {
402
-		return "{SSHA384}" . base64_encode(hash("sha384", $password . $salt, true) . $salt);
402
+		return "{SSHA384}".base64_encode(hash("sha384", $password.$salt, true).$salt);
403 403
 	} elseif ($type === 'sha512') {
404
-		return "{SHA512}" . base64_encode(hash("sha512", $password, true));
404
+		return "{SHA512}".base64_encode(hash("sha512", $password, true));
405 405
 	} elseif ($type === 'ssha512') {
406
-		return "{SSHA512}" . base64_encode(hash("sha512", $password . $salt, true) . $salt);
406
+		return "{SSHA512}".base64_encode(hash("sha512", $password.$salt, true).$salt);
407 407
 	} elseif ($type === 'crypt') {
408
-		return '{CRYPT}' . crypt($password, $salt);
408
+		return '{CRYPT}'.crypt($password, $salt);
409 409
 	} elseif ($type === 'clear') {
410
-		return '{CLEAR}' . $password;  // Just for test, plain text password is not secured !
410
+		return '{CLEAR}'.$password; // Just for test, plain text password is not secured !
411 411
 	}
412 412
 	return "";
413 413
 }
@@ -440,13 +440,13 @@  discard block
 block discarded – undo
440 440
 	if (is_object($object)) {
441 441
 		$objectid = $object->id;
442 442
 	} else {
443
-		$objectid = $object;		// $objectid can be X or 'X,Y,Z'
443
+		$objectid = $object; // $objectid can be X or 'X,Y,Z'
444 444
 	}
445 445
 	if ($objectid == "-1") {
446 446
 		$objectid = 0;
447 447
 	}
448 448
 	if ($objectid) {
449
-		$objectid = preg_replace('/[^0-9\.\,]/', '', (string) $objectid);	// For the case value is coming from a non sanitized user input
449
+		$objectid = preg_replace('/[^0-9\.\,]/', '', (string) $objectid); // For the case value is coming from a non sanitized user input
450 450
 	}
451 451
 
452 452
 	//dol_syslog("functions.lib:restrictedArea $feature, $objectid, $dbtablename, $feature2, $dbt_socfield, $dbt_select, $isdraft");
@@ -970,9 +970,9 @@  discard block
 block discarded – undo
970 970
 	if (is_object($object)) {
971 971
 		$objectid = $object->id;
972 972
 	} else {
973
-		$objectid = $object;		// $objectid can be X or 'X,Y,Z'
973
+		$objectid = $object; // $objectid can be X or 'X,Y,Z'
974 974
 	}
975
-	$objectid = preg_replace('/[^0-9\.\,]/', '', $objectid);	// For the case value is coming from a non sanitized user input
975
+	$objectid = preg_replace('/[^0-9\.\,]/', '', $objectid); // For the case value is coming from a non sanitized user input
976 976
 
977 977
 	//dol_syslog("functions.lib:restrictedArea $feature, $objectid, $dbtablename, $feature2, $dbt_socfield, $dbt_select, $isdraft");
978 978
 	//print "user_id=".$user->id.", features=".join(',', $featuresarray).", objectid=".$objectid;
@@ -1026,8 +1026,8 @@  discard block
 block discarded – undo
1026 1026
 		$checkparentsoc = array('agenda', 'contact', 'contrat'); // Test on entity + link to third party on field $dbt_keyfield. Allowed if link is empty (Ex: contacts...).
1027 1027
 		$checkproject = array('projet', 'project'); // Test for project object
1028 1028
 		$checktask = array('projet_task', 'project_task'); // Test for task object
1029
-		$checkhierarchy = array('expensereport', 'holiday', 'hrm');	// check permission among the hierarchy of user
1030
-		$checkuser = array('bookmark');	// check permission among the fk_user (must be myself or null)
1029
+		$checkhierarchy = array('expensereport', 'holiday', 'hrm'); // check permission among the hierarchy of user
1030
+		$checkuser = array('bookmark'); // check permission among the fk_user (must be myself or null)
1031 1031
 		$nocheck = array('barcode', 'webhook'); // No test
1032 1032
 
1033 1033
 		//$checkdefault = 'all other not already defined'; // Test on entity + link to third party on field $dbt_keyfield. Not allowed if link is empty (Ex: invoice, orders...).
@@ -1040,7 +1040,7 @@  discard block
 block discarded – undo
1040 1040
 
1041 1041
 		// To avoid an access forbidden with a numeric ref
1042 1042
 		if ($dbt_select != 'rowid' && $dbt_select != 'id') {
1043
-			$objectid = "'".$objectid."'";	// Note: $objectid was already cast into int at begin of this method.
1043
+			$objectid = "'".$objectid."'"; // Note: $objectid was already cast into int at begin of this method.
1044 1044
 		}
1045 1045
 		// Check permission for objectid on entity only
1046 1046
 		if (in_array($feature, $check) && $objectid > 0) {		// For $objectid = 0, no check
Please login to merge, or discard this patch.
htdocs/core/lib/pdf.lib.php 1 patch
Spacing   +20 added lines, -23 removed lines patch added patch discarded remove patch
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
 	//$metric=$arrayformat['unit'];
183 183
 
184 184
 	//$pdfa = false; // PDF default version
185
-	$pdfa = getDolGlobalInt('PDF_USE_A', 0); 	// PDF/A-1 ou PDF/A-3
185
+	$pdfa = getDolGlobalInt('PDF_USE_A', 0); // PDF/A-1 ou PDF/A-3
186 186
 
187 187
 	if (!getDolGlobalString('MAIN_DISABLE_TCPDI') && class_exists('TCPDI')) {
188 188
 		$pdf = new TCPDI($pagetype, $metric, $format, true, 'UTF-8', false, $pdfa);
@@ -546,7 +546,7 @@  discard block
 block discarded – undo
546 546
 				$stringaddress .= ($stringaddress ? "\n" : '').$tmp.': '.$outputlangs->convToOutputCharset($sourcecompany->idprof6);
547 547
 			}
548 548
 			if (getDolGlobalString('PDF_ADD_MORE_AFTER_SOURCE_ADDRESS')) {
549
-				$stringaddress .= ($stringaddress ? "\n" : '') . getDolGlobalString('PDF_ADD_MORE_AFTER_SOURCE_ADDRESS');
549
+				$stringaddress .= ($stringaddress ? "\n" : '').getDolGlobalString('PDF_ADD_MORE_AFTER_SOURCE_ADDRESS');
550 550
 			}
551 551
 		}
552 552
 
@@ -662,7 +662,7 @@  discard block
 block discarded – undo
662 662
 				if ($usecontact && is_object($targetcontact) && getDolGlobalInt('MAIN_USE_COMPANY_NAME_OF_CONTACT')) {
663 663
 					$targetcontact->fetch_thirdparty();
664 664
 					if (!empty($targetcontact->thirdparty->id) && $targetcontact->thirdparty->tva_intra) {
665
-						$stringaddress .= ($stringaddress ? "\n" : '') . $outputlangs->transnoentities("VATIntraShort") . ': ' . $outputlangs->convToOutputCharset($targetcontact->thirdparty->tva_intra);
665
+						$stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->transnoentities("VATIntraShort").': '.$outputlangs->convToOutputCharset($targetcontact->thirdparty->tva_intra);
666 666
 					}
667 667
 				} elseif (!empty($targetcompany->tva_intra)) {
668 668
 					$stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->transnoentities("VATIntraShort").': '.$outputlangs->convToOutputCharset($targetcompany->tva_intra);
@@ -749,7 +749,7 @@  discard block
 block discarded – undo
749 749
 
750 750
 	// Add a background image on document only if good setup of const
751 751
 	if (getDolGlobalString('MAIN_USE_BACKGROUND_ON_PDF') && (getDolGlobalString('MAIN_USE_BACKGROUND_ON_PDF') != '-1')) {		// Warning, this option make TCPDF generation being crazy and some content disappeared behind the image
752
-		$filepath = $conf->mycompany->dir_output.'/logos/' . getDolGlobalString('MAIN_USE_BACKGROUND_ON_PDF');
752
+		$filepath = $conf->mycompany->dir_output.'/logos/'.getDolGlobalString('MAIN_USE_BACKGROUND_ON_PDF');
753 753
 		if (file_exists($filepath)) {
754 754
 			$pdf->setAutoPageBreak(false, 0); // Disable auto pagebreak before adding image
755 755
 			if (getDolGlobalString('MAIN_USE_BACKGROUND_ON_PDF_ALPHA')) {
@@ -1072,7 +1072,7 @@  discard block
 block discarded – undo
1072 1072
 	$outputlangs->load("dict");
1073 1073
 	$line = '';
1074 1074
 	$reg = array();
1075
-	$marginwithfooter = 0;  // Return value
1075
+	$marginwithfooter = 0; // Return value
1076 1076
 
1077 1077
 	$dims = $pdf->getPageDimensions();
1078 1078
 
@@ -1245,7 +1245,7 @@  discard block
 block discarded – undo
1245 1245
 		$line4 .= ($line4 ? " - " : "").$field.": ".$outputlangs->convToOutputCharset($fromcompany->idprof10);
1246 1246
 	}
1247 1247
 	// IntraCommunautary VAT
1248
-	if (!empty($fromcompany->tva_intra)  && $fromcompany->tva_intra != '') {
1248
+	if (!empty($fromcompany->tva_intra) && $fromcompany->tva_intra != '') {
1249 1249
 		$line4 .= ($line4 ? " - " : "").$outputlangs->transnoentities("VATIntraShort").": ".$outputlangs->convToOutputCharset($fromcompany->tva_intra);
1250 1250
 	}
1251 1251
 
@@ -1416,7 +1416,7 @@  discard block
 block discarded – undo
1416 1416
 
1417 1417
 	$pagination = $pdf->PageNo().' / '.$pdf->getAliasNbPages();
1418 1418
 	$fontRenderCorrection = 0;
1419
-	if (in_array(pdf_getPDFFont($outputlangs), array('freemono',  'DejaVuSans'))) {
1419
+	if (in_array(pdf_getPDFFont($outputlangs), array('freemono', 'DejaVuSans'))) {
1420 1420
 		$fontRenderCorrection = 10;
1421 1421
 	}
1422 1422
 	$pdf->MultiCell(18 + $fontRenderCorrection, 2, $pagination, 0, 'R', false);
@@ -1445,7 +1445,7 @@  discard block
 block discarded – undo
1445 1445
  */
1446 1446
 function pdf_writeLinkedObjects(&$pdf, $object, $outputlangs, $posx, $posy, $w, $h, $align, $default_font_size)
1447 1447
 {
1448
-	$linkedobjects = pdf_getLinkedObjects($object, $outputlangs);	// May update $object->note_public
1448
+	$linkedobjects = pdf_getLinkedObjects($object, $outputlangs); // May update $object->note_public
1449 1449
 
1450 1450
 	if (!empty($linkedobjects)) {
1451 1451
 		foreach ($linkedobjects as $linkedobject) {
@@ -1516,7 +1516,7 @@  discard block
 block discarded – undo
1516 1516
 
1517 1517
 		if (getDolGlobalString('MARGIN_TOP_ZERO_UL')) {
1518 1518
 			$pdf->setListIndentWidth(5);
1519
-			$TMarginList = ['ul' => [['h' => 0.1, ],['h' => 0.1, ]], 'li' => [['h' => 0.1, ],],];
1519
+			$TMarginList = ['ul' => [['h' => 0.1, ], ['h' => 0.1, ]], 'li' => [['h' => 0.1, ], ], ];
1520 1520
 			$pdf->setHtmlVSpace($TMarginList);
1521 1521
 		}
1522 1522
 
@@ -1560,7 +1560,7 @@  discard block
 block discarded – undo
1560 1560
 		$prodser = new Product($db);
1561 1561
 
1562 1562
 		if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES')) {
1563
-			include_once DOL_DOCUMENT_ROOT . '/product/class/productcustomerprice.class.php';
1563
+			include_once DOL_DOCUMENT_ROOT.'/product/class/productcustomerprice.class.php';
1564 1564
 		}
1565 1565
 	}
1566 1566
 
@@ -1651,7 +1651,7 @@  discard block
 block discarded – undo
1651 1651
 		$desc = str_replace('(DEPOSIT)', $outputlangs->trans('Deposit'), $desc);
1652 1652
 	}
1653 1653
 
1654
-	$libelleproduitservice = '';  // Default value
1654
+	$libelleproduitservice = ''; // Default value
1655 1655
 	if (!getDolGlobalString('PDF_HIDE_PRODUCT_LABEL_IN_SUPPLIER_LINES')) {
1656 1656
 		// Description short of product line
1657 1657
 		$libelleproduitservice = $label;
@@ -1685,8 +1685,7 @@  discard block
 block discarded – undo
1685 1685
 					$libelleproduitservice = dol_concatdesc(
1686 1686
 						dol_concatdesc($libelleproduitservice, " * ".$subprodval[3]),
1687 1687
 						(!empty($qtyText) ?
1688
-							$outputlangs->trans('Qty').':'.$qtyText.' x '.$outputlangs->trans('AssociatedProducts').':'.$subprodval[1].'= '.$outputlangs->trans('QtyTot').':'.$subprodval[1] * $qtyText :
1689
-							$outputlangs->trans('Qty').' '.$outputlangs->trans('AssociatedProducts').':'.$subprodval[1])
1688
+							$outputlangs->trans('Qty').':'.$qtyText.' x '.$outputlangs->trans('AssociatedProducts').':'.$subprodval[1].'= '.$outputlangs->trans('QtyTot').':'.$subprodval[1] * $qtyText : $outputlangs->trans('Qty').' '.$outputlangs->trans('AssociatedProducts').':'.$subprodval[1])
1690 1689
 					);
1691 1690
 				}
1692 1691
 			} else {
@@ -1694,8 +1693,7 @@  discard block
 block discarded – undo
1694 1693
 					$libelleproduitservice = dol_concatdesc(
1695 1694
 						dol_concatdesc($libelleproduitservice, " * ".$subprodval[5].(($subprodval[5] && $subprodval[3]) ? ' - ' : '').$subprodval[3]),
1696 1695
 						(!empty($qtyText) ?
1697
-							$outputlangs->trans('Qty').':'.$qtyText.' x '.$outputlangs->trans('AssociatedProducts').':'.$subprodval[1].'= '.$outputlangs->trans('QtyTot').':'.$subprodval[1] * $qtyText :
1698
-							$outputlangs->trans('Qty').' '.$outputlangs->trans('AssociatedProducts').':'.$subprodval[1])
1696
+							$outputlangs->trans('Qty').':'.$qtyText.' x '.$outputlangs->trans('AssociatedProducts').':'.$subprodval[1].'= '.$outputlangs->trans('QtyTot').':'.$subprodval[1] * $qtyText : $outputlangs->trans('Qty').' '.$outputlangs->trans('AssociatedProducts').':'.$subprodval[1])
1699 1697
 					);
1700 1698
 				}
1701 1699
 			}
@@ -1807,11 +1805,11 @@  discard block
 block discarded – undo
1807 1805
 								break;
1808 1806
 
1809 1807
 							case 2:
1810
-								$ref_prodserv = $productCustomerPrice->ref_customer . ' (' . $outputlangs->transnoentitiesnoconv('InternalRef') . ' ' . $ref_prodserv . ')';
1808
+								$ref_prodserv = $productCustomerPrice->ref_customer.' ('.$outputlangs->transnoentitiesnoconv('InternalRef').' '.$ref_prodserv.')';
1811 1809
 								break;
1812 1810
 
1813 1811
 							default:
1814
-								$ref_prodserv = $ref_prodserv . ' (' . $outputlangs->transnoentitiesnoconv('RefCustomer') . ' ' . $productCustomerPrice->ref_customer . ')';
1812
+								$ref_prodserv = $ref_prodserv.' ('.$outputlangs->transnoentitiesnoconv('RefCustomer').' '.$productCustomerPrice->ref_customer.')';
1815 1813
 						}
1816 1814
 					}
1817 1815
 				}
@@ -2476,8 +2474,7 @@  discard block
 block discarded – undo
2476 2474
 				}
2477 2475
 				$result = $isCumulative ?
2478 2476
 					// old mode: we need to compute the delta (total - sum of previous)
2479
-					$object->lines[$i]->situation_percent - $prev_progress :
2480
-					// new mode: we need to compute the total (sum of previous + delta)
2477
+					$object->lines[$i]->situation_percent - $prev_progress : // new mode: we need to compute the total (sum of previous + delta)
2481 2478
 					$prev_progress + $object->lines[$i]->situation_percent;
2482 2479
 			}
2483 2480
 			$result = round($result, 1).'%';
@@ -2676,7 +2673,7 @@  discard block
 block discarded – undo
2676 2673
 						}
2677 2674
 					}
2678 2675
 					$refListsTxt .= (!empty($refListsTxt) ? ' ' : '');
2679
-					if (! is_object($order)) {
2676
+					if (!is_object($order)) {
2680 2677
 						$refListsTxt .= $outputlangs->transnoentities($elementobject->ref);
2681 2678
 					} else {
2682 2679
 						$refListsTxt .= $outputlangs->convToOutputCharset($order->ref).($order->ref_client ? ' ('.$order->ref_client.')' : '');
@@ -2703,7 +2700,7 @@  discard block
 block discarded – undo
2703 2700
 					}
2704 2701
 				}
2705 2702
 
2706
-				if (! is_object($order)) {
2703
+				if (!is_object($order)) {
2707 2704
 					$linkedobjects[$objecttype]['ref_title'] = $outputlangs->transnoentities("RefSending");
2708 2705
 					if (empty($linkedobjects[$objecttype]['ref_value'])) {
2709 2706
 						$linkedobjects[$objecttype]['ref_value'] = '';
@@ -2813,7 +2810,7 @@  discard block
 block discarded – undo
2813 2810
 				if (isset($hookmanager->resArray['linetotalremise'])) {
2814 2811
 					return (float) $hookmanager->resArray['linetotalremise'];
2815 2812
 				} else {
2816
-					return (float) $hookmanager->resPrint;	// For backward compatibility
2813
+					return (float) $hookmanager->resPrint; // For backward compatibility
2817 2814
 				}
2818 2815
 			}
2819 2816
 		}
@@ -2851,7 +2848,7 @@  discard block
 block discarded – undo
2851 2848
 
2852 2849
 		// Remove non printablecaracters
2853 2850
 		$content = preg_replace('/[^(\x20-\x7F)]*/', '', $content);
2854
-		if (preg_match('/\/' . preg_quote($field, '/') . '\s*\((.*?)\)/', $content, $matches)) {
2851
+		if (preg_match('/\/'.preg_quote($field, '/').'\s*\((.*?)\)/', $content, $matches)) {
2855 2852
 			return trim($matches[1]);
2856 2853
 		}
2857 2854
 		return "ERROR: NOT FOUND";
Please login to merge, or discard this patch.
htdocs/projet/class/api_tasks.class.php 1 patch
Spacing   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
 		}
82 82
 
83 83
 		if (!DolibarrApi::_checkAccessToResource('task', $this->task->id)) {
84
-			throw new RestException(403, 'Access not allowed for login ' . DolibarrApiAccess::$user->login);
84
+			throw new RestException(403, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
85 85
 		}
86 86
 
87 87
 		if ($includetimespent == 1) {
@@ -131,19 +131,19 @@  discard block
 block discarded – undo
131 131
 		}
132 132
 
133 133
 		$sql = "SELECT t.rowid";
134
-		$sql .= " FROM " . MAIN_DB_PREFIX . "projet_task AS t";
135
-		$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "projet_task_extrafields AS ef ON (ef.fk_object = t.rowid)"; // Modification VMR Global Solutions to include extrafields as search parameters in the API GET call, so we will be able to filter on extrafields
136
-		$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "projet AS p ON p.rowid = t.fk_projet";
137
-		$sql .= ' WHERE t.entity IN (' . getEntity('project') . ')';
134
+		$sql .= " FROM ".MAIN_DB_PREFIX."projet_task AS t";
135
+		$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."projet_task_extrafields AS ef ON (ef.fk_object = t.rowid)"; // Modification VMR Global Solutions to include extrafields as search parameters in the API GET call, so we will be able to filter on extrafields
136
+		$sql .= " INNER JOIN ".MAIN_DB_PREFIX."projet AS p ON p.rowid = t.fk_projet";
137
+		$sql .= ' WHERE t.entity IN ('.getEntity('project').')';
138 138
 		if ($socids) {
139
-			$sql .= " AND t.fk_soc IN (" . $this->db->sanitize((string) $socids) . ")";
139
+			$sql .= " AND t.fk_soc IN (".$this->db->sanitize((string) $socids).")";
140 140
 		}
141 141
 		// Search on sale representative
142 142
 		if ($search_sale && $search_sale != '-1') {
143 143
 			if ($search_sale == -2) {
144
-				$sql .= " AND NOT EXISTS (SELECT sc.fk_soc FROM " . MAIN_DB_PREFIX . "societe_commerciaux as sc WHERE sc.fk_soc = p.fk_soc)";
144
+				$sql .= " AND NOT EXISTS (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX."societe_commerciaux as sc WHERE sc.fk_soc = p.fk_soc)";
145 145
 			} elseif ($search_sale > 0) {
146
-				$sql .= " AND EXISTS (SELECT sc.fk_soc FROM " . MAIN_DB_PREFIX . "societe_commerciaux as sc WHERE sc.fk_soc = p.fk_soc AND sc.fk_user = " . ((int) $search_sale) . ")";
146
+				$sql .= " AND EXISTS (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX."societe_commerciaux as sc WHERE sc.fk_soc = p.fk_soc AND sc.fk_user = ".((int) $search_sale).")";
147 147
 			}
148 148
 		}
149 149
 		// Add sql filters
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
 			$errormessage = '';
152 152
 			$sql .= forgeSQLFromUniversalSearchCriteria($sqlfilters, $errormessage);
153 153
 			if ($errormessage) {
154
-				throw new RestException(400, 'Error when validating parameter sqlfilters -> ' . $errormessage);
154
+				throw new RestException(400, 'Error when validating parameter sqlfilters -> '.$errormessage);
155 155
 			}
156 156
 		}
157 157
 
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
 				$i++;
182 182
 			}
183 183
 		} else {
184
-			throw new RestException(503, 'Error when retrieve task list : ' . $this->db->lasterror());
184
+			throw new RestException(503, 'Error when retrieve task list : '.$this->db->lasterror());
185 185
 		}
186 186
 
187 187
 		return $obj_ret;
@@ -240,16 +240,16 @@  discard block
 block discarded – undo
240 240
 				}
241 241
 			}
242 242
 			if ($filefound && !empty($classname)) {
243
-				$result = dol_include_once($reldir . "core/modules/project/task/" . $modele . '.php');
243
+				$result = dol_include_once($reldir."core/modules/project/task/".$modele.'.php');
244 244
 				if ($result !== false && class_exists($classname)) {
245 245
 					$modTask = new $classname();
246 246
 					'@phan-var-force ModeleNumRefTask $modTask';
247 247
 					$defaultref = $modTask->getNextValue(null, $this->task);
248 248
 				} else {
249
-					dol_syslog("Failed to include module file or invalid classname: " . $reldir . "core/modules/project/task/" . $modele . '.php', LOG_ERR);
249
+					dol_syslog("Failed to include module file or invalid classname: ".$reldir."core/modules/project/task/".$modele.'.php', LOG_ERR);
250 250
 				}
251 251
 			} else {
252
-				dol_syslog("Module file not found or classname is empty: " . $modele, LOG_ERR);
252
+				dol_syslog("Module file not found or classname is empty: ".$modele, LOG_ERR);
253 253
 			}
254 254
 
255 255
 			if (is_numeric($defaultref) && $defaultref <= 0) {
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
 			}
258 258
 
259 259
 			if (empty($defaultref)) {
260
-				$defaultref = 'TK' . dol_print_date(dol_now(), 'dayrfc');
260
+				$defaultref = 'TK'.dol_print_date(dol_now(), 'dayrfc');
261 261
 			}
262 262
 
263 263
 			$this->task->ref = $defaultref;
@@ -290,7 +290,7 @@  discard block
 block discarded – undo
290 290
 		}
291 291
 
292 292
 		if (!DolibarrApi::_checkAccessToResource('tasks', $this->task->id)) {
293
-			throw new RestException(403, 'Access not allowed for login ' . DolibarrApiAccess::$user->login);
293
+			throw new RestException(403, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
294 294
 		}
295 295
 
296 296
 		$this->task->fetchTimeSpentOnTask();
@@ -328,7 +328,7 @@  discard block
 block discarded – undo
328 328
 		}
329 329
 
330 330
 		if (!DolibarrApi::_checkAccessToResource('tasks', $this->task->id)) {
331
-			throw new RestException(403, 'Access not allowed for login ' . DolibarrApiAccess::$user->login);
331
+			throw new RestException(403, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
332 332
 		}
333 333
 
334 334
 		$usert = DolibarrApiAccess::$user;
@@ -501,7 +501,7 @@  discard block
 block discarded – undo
501 501
 		}
502 502
 
503 503
 		if (!DolibarrApi::_checkAccessToResource('task', $this->task->id)) {
504
-			throw new RestException(403, 'Access not allowed for login ' . DolibarrApiAccess::$user->login);
504
+			throw new RestException(403, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
505 505
 		}
506 506
 		foreach ($request_data as $field => $value) {
507 507
 			if ($field == 'id') {
@@ -550,11 +550,11 @@  discard block
 block discarded – undo
550 550
 		}
551 551
 
552 552
 		if (!DolibarrApi::_checkAccessToResource('task', $this->task->id)) {
553
-			throw new RestException(403, 'Access not allowed for login ' . DolibarrApiAccess::$user->login);
553
+			throw new RestException(403, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
554 554
 		}
555 555
 
556 556
 		if ($this->task->delete(DolibarrApiAccess::$user) <= 0) {
557
-			throw new RestException(500, 'Error when delete task : ' . $this->task->error);
557
+			throw new RestException(500, 'Error when delete task : '.$this->task->error);
558 558
 		}
559 559
 
560 560
 		return array(
@@ -580,12 +580,12 @@  discard block
 block discarded – undo
580 580
 	public function getTimeSpentByID($id, $timespent_id)
581 581
 	{
582 582
 		dol_syslog("API Rest request::getTimeSpent", LOG_DEBUG);
583
-		if (! DolibarrApiAccess::$user->hasRight('projet', 'lire')) {
583
+		if (!DolibarrApiAccess::$user->hasRight('projet', 'lire')) {
584 584
 			throw new RestException(403);
585 585
 		}
586 586
 
587 587
 		$taskresult = $this->task->fetch($id);
588
-		if (!$taskresult ) {
588
+		if (!$taskresult) {
589 589
 			throw new RestException(404, 'Task with id='.$id.' not found');
590 590
 		}
591 591
 		if (!DolibarrApi::_checkAccessToResource('task', $this->task->id)) {
@@ -594,7 +594,7 @@  discard block
 block discarded – undo
594 594
 
595 595
 		$timespent = new TimeSpent($this->db);
596 596
 		$timeresult = $timespent->fetch($timespent_id);
597
-		if (!$timeresult ) {
597
+		if (!$timeresult) {
598 598
 			throw new RestException(404, 'Timespent with id='.$timespent_id.' not found');
599 599
 		}
600 600
 		if (!DolibarrApi::_checkAccessToResource('time', $timespent->id)) {
@@ -635,7 +635,7 @@  discard block
 block discarded – undo
635 635
 		}
636 636
 
637 637
 		if (!DolibarrApi::_checkAccessToResource('project', $this->task->fk_project)) {
638
-			throw new RestException(403, 'Access not allowed for login ' . DolibarrApiAccess::$user->login);
638
+			throw new RestException(403, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
639 639
 		}
640 640
 
641 641
 		$uid = $user_id;
@@ -649,11 +649,11 @@  discard block
 block discarded – undo
649 649
 		$this->task->timespent_datehour = $newdate;
650 650
 		$this->task->timespent_withhour = 1;
651 651
 		$this->task->timespent_duration = $duration;
652
-		$this->task->timespent_fk_product  = $product_id;
652
+		$this->task->timespent_fk_product = $product_id;
653 653
 		$this->task->timespent_fk_user  = $uid;
654 654
 		$this->task->timespent_note     = $note;
655 655
 		if (!empty($progress) && $progress >= 0 && $progress <= 100) {
656
-			$this->task->progress  		= $progress;
656
+			$this->task->progress = $progress;
657 657
 		}
658 658
 
659 659
 		$result = $this->task->addTimeSpent(DolibarrApiAccess::$user, 0);
@@ -661,7 +661,7 @@  discard block
 block discarded – undo
661 661
 			throw new RestException(304, 'Error nothing done. May be object is already validated');
662 662
 		}
663 663
 		if ($result < 0) {
664
-			throw new RestException(500, 'Error when adding time: ' . $this->task->error);
664
+			throw new RestException(500, 'Error when adding time: '.$this->task->error);
665 665
 		}
666 666
 
667 667
 		return array(
@@ -700,7 +700,7 @@  discard block
 block discarded – undo
700 700
 		$this->timespentRecordChecks($id, $timespent_id);
701 701
 
702 702
 		if (!DolibarrApi::_checkAccessToResource('task', $this->task->id)) {
703
-			throw new RestException(403, 'Access not allowed for login ' . DolibarrApiAccess::$user->login);
703
+			throw new RestException(403, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
704 704
 		}
705 705
 
706 706
 		$newdate = dol_stringtotime($date, 1);
@@ -708,7 +708,7 @@  discard block
 block discarded – undo
708 708
 		$this->task->timespent_datehour = $newdate;
709 709
 		$this->task->timespent_withhour = 1;
710 710
 		$this->task->timespent_duration = $duration;
711
-		$this->task->timespent_fk_product  = $product_id;
711
+		$this->task->timespent_fk_product = $product_id;
712 712
 		$this->task->timespent_fk_user  = $user_id ?? DolibarrApiAccess::$user->id;
713 713
 		$this->task->timespent_note     = $note;
714 714
 
@@ -717,7 +717,7 @@  discard block
 block discarded – undo
717 717
 			throw new RestException(304, 'Error nothing done.');
718 718
 		}
719 719
 		if ($result < 0) {
720
-			throw new RestException(500, 'Error when updating time spent: ' . $this->task->error);
720
+			throw new RestException(500, 'Error when updating time spent: '.$this->task->error);
721 721
 		}
722 722
 
723 723
 		return array(
@@ -748,11 +748,11 @@  discard block
 block discarded – undo
748 748
 		$this->timespentRecordChecks($id, $timespent_id);
749 749
 
750 750
 		if (!DolibarrApi::_checkAccessToResource('task', $this->task->id)) {
751
-			throw new RestException(403, 'Access not allowed for login ' . DolibarrApiAccess::$user->login);
751
+			throw new RestException(403, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
752 752
 		}
753 753
 
754 754
 		if ($this->task->delTimeSpent(DolibarrApiAccess::$user, 0) < 0) {
755
-			throw new RestException(500, 'Error when deleting time spent: ' . $this->task->error);
755
+			throw new RestException(500, 'Error when deleting time spent: '.$this->task->error);
756 756
 		}
757 757
 
758 758
 		return array(
@@ -1012,7 +1012,7 @@  discard block
 block discarded – undo
1012 1012
 		}
1013 1013
 
1014 1014
 		if (!DolibarrApi::_checkAccessToResource('task', $this->task->id)) {
1015
-			throw new RestException(403, 'Access not allowed for login ' . DolibarrApiAccess::$user->login);
1015
+			throw new RestException(403, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
1016 1016
 		}
1017 1017
 
1018 1018
 		$contacts = $this->task->liste_contact(-1, 'external', 0, $type);
@@ -1020,7 +1020,7 @@  discard block
 block discarded – undo
1020 1020
 
1021 1021
 		$contacts = array_merge($contacts, $socpeoples);
1022 1022
 
1023
-		return $contacts;	// Return array
1023
+		return $contacts; // Return array
1024 1024
 	}
1025 1025
 
1026 1026
 	/**
@@ -1053,12 +1053,12 @@  discard block
 block discarded – undo
1053 1053
 		}
1054 1054
 
1055 1055
 		if (!DolibarrApi::_checkAccessToResource('task', $this->task->id)) {
1056
-			throw new RestException(403, 'Access not allowed for login ' . DolibarrApiAccess::$user->login);
1056
+			throw new RestException(403, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
1057 1057
 		}
1058 1058
 
1059 1059
 		$result = $this->task->add_contact($fk_socpeople, $type_contact, $source, $notrigger);
1060 1060
 		if ($result <= 0) {
1061
-			throw new RestException(500, 'Error : ' . $this->task->error);
1061
+			throw new RestException(500, 'Error : '.$this->task->error);
1062 1062
 		}
1063 1063
 
1064 1064
 		$result = $this->task->fetch($id);
@@ -1096,7 +1096,7 @@  discard block
 block discarded – undo
1096 1096
 		}
1097 1097
 
1098 1098
 		if (!DolibarrApi::_checkAccessToResource('task', $this->task->id)) {
1099
-			throw new RestException(403, 'Access not allowed for login ' . DolibarrApiAccess::$user->login);
1099
+			throw new RestException(403, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
1100 1100
 		}
1101 1101
 
1102 1102
 		foreach (array('internal', 'external') as $source) {
Please login to merge, or discard this patch.
htdocs/comm/propal/card.php 1 patch
Spacing   +257 added lines, -257 removed lines patch added patch discarded remove patch
@@ -45,24 +45,24 @@  discard block
 block discarded – undo
45 45
 // Load Dolibarr environment
46 46
 require '../../main.inc.php';
47 47
 require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
48
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php';
49
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formfile.class.php';
50
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formpropal.class.php';
51
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formmargin.class.php';
52
-require_once DOL_DOCUMENT_ROOT . '/comm/propal/class/propal.class.php';
53
-require_once DOL_DOCUMENT_ROOT . '/comm/action/class/actioncomm.class.php';
54
-require_once DOL_DOCUMENT_ROOT . '/core/modules/propale/modules_propale.php';
55
-require_once DOL_DOCUMENT_ROOT . '/core/lib/propal.lib.php';
56
-require_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php';
57
-require_once DOL_DOCUMENT_ROOT . '/core/class/extrafields.class.php';
58
-require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php';
48
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
49
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
50
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formpropal.class.php';
51
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formmargin.class.php';
52
+require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
53
+require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
54
+require_once DOL_DOCUMENT_ROOT.'/core/modules/propale/modules_propale.php';
55
+require_once DOL_DOCUMENT_ROOT.'/core/lib/propal.lib.php';
56
+require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
57
+require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
58
+require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
59 59
 if (isModEnabled('project')) {
60
-	require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
61
-	require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php';
60
+	require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
61
+	require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
62 62
 }
63 63
 
64 64
 if (isModEnabled('variants')) {
65
-	require_once DOL_DOCUMENT_ROOT . '/variants/class/ProductCombination.class.php';
65
+	require_once DOL_DOCUMENT_ROOT.'/variants/class/ProductCombination.class.php';
66 66
 }
67 67
 
68 68
 /**
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
 $cancel = GETPOST('cancel', 'alpha');
95 95
 $origin = GETPOST('origin', 'alpha');
96 96
 $originid = GETPOSTINT('originid');
97
-$renewal = GETPOST('renewal');	// for contract renewal
97
+$renewal = GETPOST('renewal'); // for contract renewal
98 98
 $confirm = GETPOST('confirm', 'alpha');
99 99
 $backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page
100 100
 $lineid = GETPOSTINT('lineid');
@@ -179,34 +179,34 @@  discard block
 block discarded – undo
179 179
 	setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
180 180
 }
181 181
 if (empty($reshook)) {
182
-	$backurlforlist = DOL_URL_ROOT . '/comm/propal/list.php';
182
+	$backurlforlist = DOL_URL_ROOT.'/comm/propal/list.php';
183 183
 
184 184
 	if (empty($backtopage) || ($cancel && empty($id))) {
185 185
 		if (empty($backtopage) || ($cancel && strpos($backtopage, '__ID__'))) {
186 186
 			if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) {
187 187
 				$backtopage = $backurlforlist;
188 188
 			} else {
189
-				$backtopage = DOL_URL_ROOT . '/comm/propal/card.php?id=' . ((!empty($id) && $id > 0) ? $id : '__ID__');
189
+				$backtopage = DOL_URL_ROOT.'/comm/propal/card.php?id='.((!empty($id) && $id > 0) ? $id : '__ID__');
190 190
 			}
191 191
 		}
192 192
 	}
193 193
 
194 194
 	if ($cancel) {
195 195
 		if (!empty($backtopageforcancel)) {
196
-			header("Location: " . $backtopageforcancel);
196
+			header("Location: ".$backtopageforcancel);
197 197
 			exit;
198 198
 		} elseif (!empty($backtopage)) {
199
-			header("Location: " . $backtopage);
199
+			header("Location: ".$backtopage);
200 200
 			exit;
201 201
 		}
202 202
 		$action = '';
203 203
 	}
204 204
 
205
-	include DOL_DOCUMENT_ROOT . '/core/actions_setnotes.inc.php'; // Must be include, not includ_once
205
+	include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not includ_once
206 206
 
207
-	include DOL_DOCUMENT_ROOT . '/core/actions_dellink.inc.php'; // Must be 'include', not 'include_once'
207
+	include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be 'include', not 'include_once'
208 208
 
209
-	include DOL_DOCUMENT_ROOT . '/core/actions_lineupdown.inc.php'; // Must be 'include', not 'include_once'
209
+	include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; // Must be 'include', not 'include_once'
210 210
 	// Action clone object
211 211
 	if ($action == 'confirm_clone' && $confirm == 'yes' && $usercancreate) {
212 212
 		if (!($socid > 0)) {
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
 							$object->delivery_date = $date_delivery;
241 241
 							foreach ($object->lines as $line) {
242 242
 								if (isset($line->date_start)) {
243
-									$line->date_start +=  $difference;
243
+									$line->date_start += $difference;
244 244
 								}
245 245
 								if (isset($line->date_end)) {
246 246
 									$line->date_end += $difference;
@@ -268,7 +268,7 @@  discard block
 block discarded – undo
268 268
 						setEventMessages('', $warningMsgLineList, 'warnings');
269 269
 					}
270 270
 
271
-					header("Location: " . $_SERVER['PHP_SELF'] . '?id=' . $result);
271
+					header("Location: ".$_SERVER['PHP_SELF'].'?id='.$result);
272 272
 					exit();
273 273
 				} else {
274 274
 					if (count($object->errors) > 0) {
@@ -282,7 +282,7 @@  discard block
 block discarded – undo
282 282
 		// Cancel proposal
283 283
 		$result = $object->setCancel($user);
284 284
 		if ($result > 0) {
285
-			header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object->id);
285
+			header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id);
286 286
 			exit();
287 287
 		} else {
288 288
 			$langs->load("errors");
@@ -292,7 +292,7 @@  discard block
 block discarded – undo
292 292
 		// Delete proposal
293 293
 		$result = $object->delete($user);
294 294
 		if ($result > 0) {
295
-			header('Location: ' . DOL_URL_ROOT . '/comm/propal/list.php?restore_lastsearch_values=1');
295
+			header('Location: '.DOL_URL_ROOT.'/comm/propal/list.php?restore_lastsearch_values=1');
296 296
 			exit();
297 297
 		} else {
298 298
 			$langs->load("errors");
@@ -324,7 +324,7 @@  discard block
 block discarded – undo
324 324
 			$object->generateDocument($object->model_pdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
325 325
 		}
326 326
 
327
-		header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object->id);
327
+		header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id);
328 328
 		exit();
329 329
 	} elseif ($action == 'confirm_delete_subtotalline' && $confirm == 'yes' && $usercancreate) {
330 330
 		// Delete line
@@ -354,7 +354,7 @@  discard block
 block discarded – undo
354 354
 				$result = $object->generateDocument($object->model_pdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
355 355
 			}
356 356
 			if ($result >= 0) {
357
-				header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $id);
357
+				header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id);
358 358
 				exit();
359 359
 			}
360 360
 		} else {
@@ -626,14 +626,14 @@  discard block
 block discarded – undo
626 626
 
627 627
 					$id = $object->create($user);
628 628
 					if ($id > 0) {
629
-						dol_include_once('/' . $element . '/class/' . $subelement . '.class.php');
629
+						dol_include_once('/'.$element.'/class/'.$subelement.'.class.php');
630 630
 
631 631
 						$classname = ucfirst($subelement);
632 632
 						$srcobject = new $classname($db);
633
-						'@phan-var-force Commande|Propal|Contrat|Fichinter|Expedition $srcobject';  // Can be other class, but CommonObject is too generic
633
+						'@phan-var-force Commande|Propal|Contrat|Fichinter|Expedition $srcobject'; // Can be other class, but CommonObject is too generic
634 634
 						/** @var Commande|Propal|Contrat|Fichinter|Expedition $srcobject */
635 635
 
636
-						dol_syslog("Try to find source object origin=" . $object->origin . " originid=" . $object->origin_id . " to add lines");
636
+						dol_syslog("Try to find source object origin=".$object->origin." originid=".$object->origin_id." to add lines");
637 637
 						$result = $srcobject->fetch($object->origin_id);
638 638
 
639 639
 						if ($result > 0) {
@@ -698,7 +698,7 @@  discard block
 block discarded – undo
698 698
 
699 699
 								$tva_tx = $lines[$i]->tva_tx;
700 700
 								if (!empty($lines[$i]->vat_src_code) && !preg_match('/\(/', $tva_tx)) {
701
-									$tva_tx .= ' (' . $lines[$i]->vat_src_code . ')';
701
+									$tva_tx .= ' ('.$lines[$i]->vat_src_code.')';
702 702
 								}
703 703
 
704 704
 								$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);
@@ -788,7 +788,7 @@  discard block
 block discarded – undo
788 788
 							}
789 789
 						}
790 790
 
791
-						header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $id);
791
+						header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id);
792 792
 						exit();
793 793
 					} else {
794 794
 						$db->rollback();
@@ -836,7 +836,7 @@  discard block
 block discarded – undo
836 836
 					$error++;
837 837
 				} else {
838 838
 					// Needed if object linked modified by trigger (because linked objects can't be fetched two times : linkedObjectsFullLoaded)
839
-					$locationTarget = DOL_URL_ROOT . '/comm/propal/card.php?id=' . $object->id;
839
+					$locationTarget = DOL_URL_ROOT.'/comm/propal/card.php?id='.$object->id;
840 840
 				}
841 841
 
842 842
 				$deposit = null;
@@ -847,7 +847,7 @@  discard block
 block discarded – undo
847 847
 					!$error && GETPOSTINT('statut') == $object::STATUS_SIGNED && GETPOST('generate_deposit') == 'on'
848 848
 					&& !empty($deposit_percent_from_payment_terms) && isModEnabled('invoice') && $user->hasRight('facture', 'creer')
849 849
 				) {
850
-					require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
850
+					require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
851 851
 
852 852
 					$date = dol_mktime(0, 0, 0, GETPOSTINT('datefmonth'), GETPOSTINT('datefday'), GETPOSTINT('datefyear'));
853 853
 					$forceFields = array();
@@ -860,10 +860,10 @@  discard block
 block discarded – undo
860 860
 
861 861
 					if ($deposit) {
862 862
 						setEventMessage('DepositGenerated');
863
-						$locationTarget = DOL_URL_ROOT . '/compta/facture/card.php?id=' . $deposit->id;
863
+						$locationTarget = DOL_URL_ROOT.'/compta/facture/card.php?id='.$deposit->id;
864 864
 					} else {
865 865
 						$error++;
866
-						setEventMessages("Failed to create down payment - " . $object->error, $object->errors, 'errors');
866
+						setEventMessages("Failed to create down payment - ".$object->error, $object->errors, 'errors');
867 867
 					}
868 868
 				}
869 869
 
@@ -888,12 +888,12 @@  discard block
 block discarded – undo
888 888
 					}
889 889
 
890 890
 					if ($locationTarget) {
891
-						header('Location: ' . $locationTarget);
891
+						header('Location: '.$locationTarget);
892 892
 						exit;
893 893
 					}
894 894
 				} else {
895 895
 					$object->status = $oldstatus;
896
-					$object->statut = $oldstatus;	// deprecated
896
+					$object->statut = $oldstatus; // deprecated
897 897
 
898 898
 					$db->rollback();
899 899
 					$action = '';
@@ -912,7 +912,7 @@  discard block
 block discarded – undo
912 912
 				setEventMessages($object->error, $object->errors, 'errors');
913 913
 				$error++;
914 914
 			} else {
915
-				$object->statut = $newstatus;	// deprecated
915
+				$object->statut = $newstatus; // deprecated
916 916
 				$object->status = $newstatus;
917 917
 			}
918 918
 
@@ -930,13 +930,13 @@  discard block
 block discarded – undo
930 930
 
931 931
 		if (!empty($importLines) && is_array($importLines) && !empty($fromElement) && ctype_alpha($fromElement) && !empty($fromElementid)) {
932 932
 			if ($fromElement == 'commande') {
933
-				dol_include_once('/' . $fromElement . '/class/' . $fromElement . '.class.php');
933
+				dol_include_once('/'.$fromElement.'/class/'.$fromElement.'.class.php');
934 934
 				$lineClassName = 'OrderLine';
935 935
 			} elseif ($fromElement == 'propal') {
936
-				dol_include_once('/comm/' . $fromElement . '/class/' . $fromElement . '.class.php');
936
+				dol_include_once('/comm/'.$fromElement.'/class/'.$fromElement.'.class.php');
937 937
 				$lineClassName = 'PropaleLigne';
938 938
 			} elseif ($fromElement == 'facture') {
939
-				dol_include_once('/compta/' . $fromElement . '/class/' . $fromElement . '.class.php');
939
+				dol_include_once('/compta/'.$fromElement.'/class/'.$fromElement.'.class.php');
940 940
 				$lineClassName = 'FactureLigne';
941 941
 			} else {
942 942
 				$lineClassName = null;
@@ -1003,14 +1003,14 @@  discard block
 block discarded – undo
1003 1003
 		$object->updateSubtotalLineBlockLines($langs, $object->getRangOfLine($lineid), 'discount', $discount);
1004 1004
 	}
1005 1005
 
1006
-	include DOL_DOCUMENT_ROOT . '/core/actions_printing.inc.php';
1006
+	include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
1007 1007
 
1008 1008
 	// Actions to send emails
1009 1009
 	$actiontypecode = 'AC_OTH_AUTO';
1010 1010
 	$triggersendname = 'PROPAL_SENTBYMAIL';
1011 1011
 	$autocopy = 'MAIN_MAIL_AUTOCOPY_PROPOSAL_TO';
1012
-	$trackid = 'pro' . $object->id;
1013
-	include DOL_DOCUMENT_ROOT . '/core/actions_sendmails.inc.php';
1012
+	$trackid = 'pro'.$object->id;
1013
+	include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
1014 1014
 
1015 1015
 
1016 1016
 	// Go back to draft
@@ -1079,7 +1079,7 @@  discard block
 block discarded – undo
1079 1079
 			}
1080 1080
 			$tvatx = $line->tva_tx;
1081 1081
 			if (!empty($line->vat_src_code)) {
1082
-				$tvatx .= ' (' . $line->vat_src_code . ')';
1082
+				$tvatx .= ' ('.$line->vat_src_code.')';
1083 1083
 			}
1084 1084
 			$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);
1085 1085
 			$object->lines[$key] = $object->line;
@@ -1097,7 +1097,7 @@  discard block
 block discarded – undo
1097 1097
 			if ($prod->price_min > $subprice) {
1098 1098
 				$price_subprice  = price($subprice, 0, $outlangs, 1, -1, -1, 'auto');
1099 1099
 				$price_price_min = price($prod->price_min, 0, $outlangs, 1, -1, -1, 'auto');
1100
-				setEventMessages($prod->ref . ' - ' . $prod->label . ' (' . $price_subprice . ' < ' . $price_price_min . ' ' . strtolower($langs->trans("MinPrice")) . ')' . "\n", null, 'warnings');
1100
+				setEventMessages($prod->ref.' - '.$prod->label.' ('.$price_subprice.' < '.$price_price_min.' '.strtolower($langs->trans("MinPrice")).')'."\n", null, 'warnings');
1101 1101
 			}
1102 1102
 			// Manage $line->subprice and $line->multicurrency_subprice
1103 1103
 			if ($line->subprice <> 0) {
@@ -1167,7 +1167,7 @@  discard block
 block discarded – undo
1167 1167
 		} else {
1168 1168
 			setEventMessages($object->error, $object->errors, 'errors');
1169 1169
 		}
1170
-		header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $id);
1170
+		header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id);
1171 1171
 		exit();
1172 1172
 	} elseif ($action == 'confirm_addsubtotalline' && $usercancreate) {
1173 1173
 		// Handling adding a new subtotal line for subtotals module
@@ -1219,7 +1219,7 @@  discard block
 block discarded – undo
1219 1219
 		} else {
1220 1220
 			setEventMessages($object->error, $object->errors, 'errors');
1221 1221
 		}
1222
-		header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $id);
1222
+		header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id);
1223 1223
 		exit();
1224 1224
 	} elseif ($action == 'addline' && !GETPOST('submitforalllines', 'alpha') && !GETPOST('submitforallmargins', 'alpha') && !GETPOST('markforalllines', 'alpha') && $usercancreate) {
1225 1225
 		// Add line
@@ -1261,8 +1261,8 @@  discard block
 block discarded – undo
1261 1261
 
1262 1262
 		$tva_tx = GETPOST('tva_tx', 'alpha');
1263 1263
 
1264
-		$qty = price2num(GETPOST('qty' . $predef, 'alpha'), 'MS', 2);
1265
-		$remise_percent = (GETPOSTISSET('remise_percent' . $predef) ? price2num(GETPOST('remise_percent' . $predef, 'alpha'), '', 2) : 0);
1264
+		$qty = price2num(GETPOST('qty'.$predef, 'alpha'), 'MS', 2);
1265
+		$remise_percent = (GETPOSTISSET('remise_percent'.$predef) ? price2num(GETPOST('remise_percent'.$predef, 'alpha'), '', 2) : 0);
1266 1266
 		if (empty($remise_percent)) {
1267 1267
 			$remise_percent = 0;
1268 1268
 		}
@@ -1274,7 +1274,7 @@  discard block
 block discarded – undo
1274 1274
 		if (is_array($extralabelsline)) {
1275 1275
 			// Get extra fields
1276 1276
 			foreach ($extralabelsline as $key => $value) {
1277
-				unset($_POST["options_" . $key]);
1277
+				unset($_POST["options_".$key]);
1278 1278
 			}
1279 1279
 		}
1280 1280
 
@@ -1346,7 +1346,7 @@  discard block
 block discarded – undo
1346 1346
 
1347 1347
 				if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES')) {
1348 1348
 					// If price per customer
1349
-					require_once DOL_DOCUMENT_ROOT . '/product/class/productcustomerprice.class.php';
1349
+					require_once DOL_DOCUMENT_ROOT.'/product/class/productcustomerprice.class.php';
1350 1350
 					$prodcustprice = new ProductCustomerPrice($db);
1351 1351
 					$filter = array('t.fk_product' => (string) $prod->id, 't.fk_soc' => (string) $object->thirdparty->id);
1352 1352
 
@@ -1410,7 +1410,7 @@  discard block
 block discarded – undo
1410 1410
 					}
1411 1411
 				} elseif (getDolGlobalString('PRODUIT_CUSTOMER_PRICES')) {
1412 1412
 					// If price per customer
1413
-					require_once DOL_DOCUMENT_ROOT . '/product/class/productcustomerprice.class.php';
1413
+					require_once DOL_DOCUMENT_ROOT.'/product/class/productcustomerprice.class.php';
1414 1414
 
1415 1415
 					$prodcustprice = new ProductCustomerPrice($db);
1416 1416
 
@@ -1557,23 +1557,23 @@  discard block
 block discarded – undo
1557 1557
 							$outputlangs->load('products');
1558 1558
 						}
1559 1559
 						if (!empty($prod->customcode)) {
1560
-							$tmptxt .= $outputlangs->transnoentitiesnoconv("CustomsCode") . ': ' . $prod->customcode;
1560
+							$tmptxt .= $outputlangs->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 .= $outputlangs->transnoentitiesnoconv("CountryOrigin") . ': ' . getCountry($prod->country_code, '', $db, $outputlangs, 0);
1566
+							$tmptxt .= $outputlangs->transnoentitiesnoconv("CountryOrigin").': '.getCountry($prod->country_code, '', $db, $outputlangs, 0);
1567 1567
 						}
1568 1568
 					} else {
1569 1569
 						if (!empty($prod->customcode)) {
1570
-							$tmptxt .= $langs->transnoentitiesnoconv("CustomsCode") . ': ' . $prod->customcode;
1570
+							$tmptxt .= $langs->transnoentitiesnoconv("CustomsCode").': '.$prod->customcode;
1571 1571
 						}
1572 1572
 						if (!empty($prod->customcode) && !empty($prod->country_code)) {
1573 1573
 							$tmptxt .= ' - ';
1574 1574
 						}
1575 1575
 						if (!empty($prod->country_code)) {
1576
-							$tmptxt .= $langs->transnoentitiesnoconv("CountryOrigin") . ': ' . getCountry($prod->country_code, '', $db, $langs, 0);
1576
+							$tmptxt .= $langs->transnoentitiesnoconv("CountryOrigin").': '.getCountry($prod->country_code, '', $db, $langs, 0);
1577 1577
 						}
1578 1578
 					}
1579 1579
 					$tmptxt .= ')';
@@ -1612,11 +1612,11 @@  discard block
 block discarded – undo
1612 1612
 			$localtax2_tx = get_localtax($tva_tx, 2, $object->thirdparty, $mysoc, $tva_npr);
1613 1613
 
1614 1614
 			// Margin
1615
-			$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
1616
-			$buyingprice = price2num((GETPOST('buying_price' . $predef) != '' ? GETPOST('buying_price' . $predef) : ''), '', 2); // If buying_price is '0', we must keep this value
1615
+			$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
1616
+			$buyingprice = price2num((GETPOST('buying_price'.$predef) != '' ? GETPOST('buying_price'.$predef) : ''), '', 2); // If buying_price is '0', we must keep this value
1617 1617
 
1618
-			$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'));
1619
-			$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'));
1618
+			$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'));
1619
+			$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'));
1620 1620
 
1621 1621
 			// Prepare a price equivalent for minimum price check
1622 1622
 			$pu_equivalent = $pu_ht;
@@ -1747,7 +1747,7 @@  discard block
 block discarded – undo
1747 1747
 				if ($prod->price_min > $line->subprice) {
1748 1748
 					$price_subprice = price($line->subprice, 0, $outlangs, 1, -1, -1, 'auto');
1749 1749
 					$price_price_min = price($prod->price_min, 0, $outlangs, 1, -1, -1, 'auto');
1750
-					setEventMessages($prod->ref . ' - ' . $prod->label . ' (' . $price_subprice . ' < ' . $price_price_min . ' ' . strtolower($langs->trans("MinPrice")) . ')' . "\n", null, 'warnings');
1750
+					setEventMessages($prod->ref.' - '.$prod->label.' ('.$price_subprice.' < '.$price_price_min.' '.strtolower($langs->trans("MinPrice")).')'."\n", null, 'warnings');
1751 1751
 				} else {
1752 1752
 					setEventMessages($prod->error, $prod->errors, 'errors');
1753 1753
 				}
@@ -1885,7 +1885,7 @@  discard block
 block discarded – undo
1885 1885
 		$pu_ttc = price2num(GETPOST('price_ttc'), '', 2);
1886 1886
 
1887 1887
 		// Add buying price
1888
-		$fournprice = (int) (GETPOST('fournprice') ? GETPOST('fournprice') : '');	// This can be id of supplier price, or 'pmpprice' or 'costprice', or 'inputprice', we force to keep ID only
1888
+		$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
1889 1889
 		$buyingprice = price2num((GETPOST('buying_price') != '' ? GETPOST('buying_price') : ''), '', 2); // If buying_price is '0', we must keep this value
1890 1890
 
1891 1891
 		$pu_ht_devise = price2num(GETPOST('multicurrency_subprice'), '', 2);
@@ -1932,7 +1932,7 @@  discard block
 block discarded – undo
1932 1932
 		if (is_array($extralabelsline)) {
1933 1933
 			// Get extra fields
1934 1934
 			foreach ($extralabelsline as $key => $value) {
1935
-				unset($_POST["options_" . $key]);
1935
+				unset($_POST["options_".$key]);
1936 1936
 			}
1937 1937
 		}
1938 1938
 
@@ -2070,7 +2070,7 @@  discard block
 block discarded – undo
2070 2070
 			}
2071 2071
 		}
2072 2072
 	} elseif ($action == 'updateline' && $usercancreate && GETPOST('cancel', 'alpha')) {
2073
-		header('Location: ' . $_SERVER['PHP_SELF'] . '?id=' . $object->id); //  To re-display card in edit mode
2073
+		header('Location: '.$_SERVER['PHP_SELF'].'?id='.$object->id); //  To re-display card in edit mode
2074 2074
 		exit();
2075 2075
 	} elseif ($action == 'classin' && $usercancreate) {
2076 2076
 		// Set project
@@ -2084,8 +2084,8 @@  discard block
 block discarded – undo
2084 2084
 	} elseif ($action == 'setconditions' && $usercancreate) {
2085 2085
 		// Terms of payment
2086 2086
 		$sql = "SELECT code ";
2087
-		$sql .= "FROM " . $db->prefix() . "c_payment_term";
2088
-		$sql .= " WHERE rowid = " . ((int) GETPOST('cond_reglement_id', 'int'));
2087
+		$sql .= "FROM ".$db->prefix()."c_payment_term";
2088
+		$sql .= " WHERE rowid = ".((int) GETPOST('cond_reglement_id', 'int'));
2089 2089
 		$result = $db->query($sql);
2090 2090
 		if ($result) {
2091 2091
 			$obj = $db->fetch_object($result);
@@ -2150,7 +2150,7 @@  discard block
 block discarded – undo
2150 2150
 			}
2151 2151
 
2152 2152
 			if ($result >= 0) {
2153
-				header("Location: " . $_SERVER['PHP_SELF'] . "?id=" . $object->id);
2153
+				header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
2154 2154
 				exit();
2155 2155
 			} else {
2156 2156
 				if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') {
@@ -2173,7 +2173,7 @@  discard block
 block discarded – undo
2173 2173
 			$result = $object->delete_contact($lineid);
2174 2174
 
2175 2175
 			if ($result >= 0) {
2176
-				header("Location: " . $_SERVER['PHP_SELF'] . "?id=" . $object->id);
2176
+				header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
2177 2177
 				exit();
2178 2178
 			} else {
2179 2179
 				dol_print_error($db);
@@ -2184,7 +2184,7 @@  discard block
 block discarded – undo
2184 2184
 	// Actions to build doc
2185 2185
 	$upload_dir = !empty($conf->propal->multidir_output[$object->entity ?? $conf->entity]) ? $conf->propal->multidir_output[$object->entity ?? $conf->entity] : $conf->propal->dir_output;
2186 2186
 	$permissiontoadd = $usercancreate;
2187
-	include DOL_DOCUMENT_ROOT . '/core/actions_builddoc.inc.php';
2187
+	include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
2188 2188
 }
2189 2189
 
2190 2190
 
@@ -2201,7 +2201,7 @@  discard block
 block discarded – undo
2201 2201
 	$formproject = new FormProjets($db);
2202 2202
 }
2203 2203
 
2204
-$title = $object->ref . " - " . $langs->trans('Card');
2204
+$title = $object->ref." - ".$langs->trans('Card');
2205 2205
 if ($action == 'create') {
2206 2206
 	$title = $langs->trans("NewPropal");
2207 2207
 }
@@ -2226,7 +2226,7 @@  discard block
 block discarded – undo
2226 2226
 	$deposit_percent = GETPOSTFLOAT('cond_reglement_id_deposit_percent');
2227 2227
 	$mode_reglement_id = GETPOSTINT('mode_reglement_id');
2228 2228
 	$fk_account = GETPOSTINT('fk_account');
2229
-	$datepropal = (getDolGlobalString('MAIN_DO_NOT_AUTOFILL_DATE_PROPOSAL') ? -1 : '');		// By default '' so we will autofill date. -1 means keep empty.
2229
+	$datepropal = (getDolGlobalString('MAIN_DO_NOT_AUTOFILL_DATE_PROPOSAL') ? -1 : ''); // By default '' so we will autofill date. -1 means keep empty.
2230 2230
 
2231 2231
 	// Load objectsrc
2232 2232
 	$objectsrc = null;
@@ -2265,11 +2265,11 @@  discard block
 block discarded – undo
2265 2265
 				$element = $subelement = 'expedition';
2266 2266
 			}
2267 2267
 
2268
-			dol_include_once('/' . $element . '/class/' . $subelement . '.class.php');
2268
+			dol_include_once('/'.$element.'/class/'.$subelement.'.class.php');
2269 2269
 
2270 2270
 			$classname = ucfirst($subelement);
2271 2271
 			$objectsrc = new $classname($db);
2272
-			'@phan-var-force Commande|Propal|Contrat|Expedition $objectsrc';  // Can be other class, but CommonObject is too generic
2272
+			'@phan-var-force Commande|Propal|Contrat|Expedition $objectsrc'; // Can be other class, but CommonObject is too generic
2273 2273
 			/** @var Commande|Propal|Contrat|Expedition $objectsrc */
2274 2274
 			$objectsrc->fetch($originid);
2275 2275
 			if (empty($objectsrc->lines) && method_exists($objectsrc, 'fetch_lines')) {
@@ -2345,19 +2345,19 @@  discard block
 block discarded – undo
2345 2345
 		}
2346 2346
 	}
2347 2347
 
2348
-	print '<form name="addprop" action="' . $_SERVER["PHP_SELF"] . '" method="POST">';
2349
-	print '<input type="hidden" name="token" value="' . newToken() . '">';
2348
+	print '<form name="addprop" action="'.$_SERVER["PHP_SELF"].'" method="POST">';
2349
+	print '<input type="hidden" name="token" value="'.newToken().'">';
2350 2350
 	print '<input type="hidden" name="action" value="add">';
2351
-	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
2352
-	print '<input type="hidden" name="backtopage" value="' . $backtopage . '">';
2351
+	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
2352
+	print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
2353 2353
 	if ($origin != 'project' && $originid) {
2354
-		print '<input type="hidden" name="origin" value="' . $origin . '">';
2355
-		print '<input type="hidden" name="originid" value="' . $originid . '">';
2354
+		print '<input type="hidden" name="origin" value="'.$origin.'">';
2355
+		print '<input type="hidden" name="originid" value="'.$originid.'">';
2356 2356
 		if ($origin == 'contrat' && !empty($renewal)) {
2357
-			print '<input type="hidden" name="renewal" value="' . $renewal . '">';
2357
+			print '<input type="hidden" name="renewal" value="'.$renewal.'">';
2358 2358
 		}
2359 2359
 	} elseif ($origin == 'project' && !empty($projectid)) {
2360
-		print '<input type="hidden" name="projectid" value="' . $projectid . '">';
2360
+		print '<input type="hidden" name="projectid" value="'.$projectid.'">';
2361 2361
 	}
2362 2362
 
2363 2363
 	print dol_get_fiche_head();
@@ -2370,22 +2370,22 @@  discard block
 block discarded – undo
2370 2370
 		print '<table class="border centpercent">';
2371 2371
 
2372 2372
 		// Reference
2373
-		print '<tr class="field_ref"><td class="titlefieldcreate fieldrequired">' . $langs->trans('Ref') . '</td><td class="valuefieldcreate">' . $langs->trans("Draft") . '</td></tr>';
2373
+		print '<tr class="field_ref"><td class="titlefieldcreate fieldrequired">'.$langs->trans('Ref').'</td><td class="valuefieldcreate">'.$langs->trans("Draft").'</td></tr>';
2374 2374
 
2375 2375
 		// Ref customer
2376
-		print '<tr class="field_ref_client"><td class="titlefieldcreate">' . $langs->trans('RefCustomer') . '</td><td class="valuefieldcreate">';
2377
-		print '<input type="text" name="ref_client" value="' . (!empty($ref_client) ? $ref_client : GETPOST('ref_client')) . '"></td>';
2376
+		print '<tr class="field_ref_client"><td class="titlefieldcreate">'.$langs->trans('RefCustomer').'</td><td class="valuefieldcreate">';
2377
+		print '<input type="text" name="ref_client" value="'.(!empty($ref_client) ? $ref_client : GETPOST('ref_client')).'"></td>';
2378 2378
 		print '</tr>';
2379 2379
 
2380 2380
 		// Third party
2381 2381
 		print '<tr class="field_socid">';
2382
-		print '<td class="titlefieldcreate fieldrequired">' . $langs->trans('Customer') . '</td>';
2382
+		print '<td class="titlefieldcreate fieldrequired">'.$langs->trans('Customer').'</td>';
2383 2383
 		$shipping_method_id = 0;
2384 2384
 		$warehouse_id = 0;
2385 2385
 		if ($socid > 0) {
2386 2386
 			print '<td class="valuefieldcreate">';
2387 2387
 			print $soc->getNomUrl(1, 'customer');
2388
-			print '<input type="hidden" name="socid" value="' . $soc->id . '">';
2388
+			print '<input type="hidden" name="socid" value="'.$soc->id.'">';
2389 2389
 			print '</td>';
2390 2390
 			if (getDolGlobalString('SOCIETE_ASK_FOR_SHIPPING_METHOD') && !empty($soc->shipping_method_id)) {
2391 2391
 				$shipping_method_id = $soc->shipping_method_id;
@@ -2394,7 +2394,7 @@  discard block
 block discarded – undo
2394 2394
 		} else {
2395 2395
 			print '<td class="valuefieldcreate">';
2396 2396
 			$filter = '((s.client:IN:1,2,3) AND (s.status:=:1))';
2397
-			print img_picto('', 'company', 'class="pictofixedwidth"') . $form->select_company('', 'socid', $filter, 'SelectThirdParty', 1, 0, array(), 0, 'minwidth300 maxwidth500 widthcentpercentminusxx');
2397
+			print img_picto('', 'company', 'class="pictofixedwidth"').$form->select_company('', 'socid', $filter, 'SelectThirdParty', 1, 0, array(), 0, 'minwidth300 maxwidth500 widthcentpercentminusxx');
2398 2398
 			// reload page to retrieve customer information
2399 2399
 			if (!getDolGlobalString('RELOAD_PAGE_ON_CUSTOMER_CHANGE_DISABLED')) {
2400 2400
 				print '<script>
@@ -2410,63 +2410,63 @@  discard block
 block discarded – undo
2410 2410
 				});
2411 2411
 				</script>';
2412 2412
 			}
2413
-			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>';
2413
+			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>';
2414 2414
 			print '</td>';
2415 2415
 		}
2416
-		print '</tr>' . "\n";
2416
+		print '</tr>'."\n";
2417 2417
 
2418 2418
 		if ($socid > 0) {
2419 2419
 			// Contacts (ask contact only if thirdparty already defined).
2420
-			print '<tr class="field_contactid"><td class="titlefieldcreate">' . $langs->trans("DefaultContact") . '</td><td class="valuefieldcreate">';
2420
+			print '<tr class="field_contactid"><td class="titlefieldcreate">'.$langs->trans("DefaultContact").'</td><td class="valuefieldcreate">';
2421 2421
 			print img_picto('', 'contact', 'class="pictofixedwidth"');
2422 2422
 			//print $form->selectcontacts($soc->id, $contactid, 'contactid', 1, '', '', 0, 'minwidth300 widthcentpercentminusx');
2423 2423
 			print $form->select_contact($soc->id, $contactid, 'contactid', 1, '', '', 1, 'maxwidth300 widthcentpercentminusx', true);
2424 2424
 			print '</td></tr>';
2425 2425
 
2426 2426
 			// Third party discounts info line
2427
-			print '<tr class="field_discount_info"><td class="titlefieldcreate">' . $langs->trans('Discounts') . '</td><td class="valuefieldcreate">';
2427
+			print '<tr class="field_discount_info"><td class="titlefieldcreate">'.$langs->trans('Discounts').'</td><td class="valuefieldcreate">';
2428 2428
 
2429 2429
 			$absolute_discount = $soc->getAvailableDiscounts();
2430 2430
 
2431 2431
 			$thirdparty = $soc;
2432 2432
 			$discount_type = 0;
2433
-			$backtopage = $_SERVER["PHP_SELF"] . '?socid=' . $thirdparty->id . '&action=' . $action . '&origin=' . urlencode((string) (GETPOST('origin'))) . '&originid=' . urlencode((string) (GETPOSTINT('originid')));
2434
-			include DOL_DOCUMENT_ROOT . '/core/tpl/object_discounts.tpl.php';
2433
+			$backtopage = $_SERVER["PHP_SELF"].'?socid='.$thirdparty->id.'&action='.$action.'&origin='.urlencode((string) (GETPOST('origin'))).'&originid='.urlencode((string) (GETPOSTINT('originid')));
2434
+			include DOL_DOCUMENT_ROOT.'/core/tpl/object_discounts.tpl.php';
2435 2435
 			print '</td></tr>';
2436 2436
 		}
2437 2437
 
2438 2438
 		$newdatepropal = dol_mktime(0, 0, 0, GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear'), 'tzserver');
2439 2439
 		// Date
2440
-		print '<tr class="field_addprop"><td class="titlefieldcreate fieldrequired">' . $langs->trans('DatePropal') . '</td><td class="valuefieldcreate">';
2440
+		print '<tr class="field_addprop"><td class="titlefieldcreate fieldrequired">'.$langs->trans('DatePropal').'</td><td class="valuefieldcreate">';
2441 2441
 		print img_picto('', 'action', 'class="pictofixedwidth"');
2442 2442
 		print $form->selectDate($newdatepropal ? $newdatepropal : $datepropal, '', 0, 0, 0, "addprop", 1, 1);
2443 2443
 		print '</td></tr>';
2444 2444
 
2445 2445
 		// Validaty duration
2446
-		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>';
2446
+		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>';
2447 2447
 
2448 2448
 		// Terms of payment
2449
-		print '<tr class="field_cond_reglement_id"><td class="nowrap">' . $langs->trans('PaymentConditionsShort') . '</td><td>';
2449
+		print '<tr class="field_cond_reglement_id"><td class="nowrap">'.$langs->trans('PaymentConditionsShort').'</td><td>';
2450 2450
 		print img_picto('', 'payment', 'class="pictofixedwidth"');
2451 2451
 		// at last resort we take the payment term id which may be filled by default values set (if not getpostisset)
2452 2452
 		print $form->getSelectConditionsPaiements((int) $cond_reglement_id, 'cond_reglement_id', 1, 1, 0, '', $deposit_percent);
2453 2453
 		print '</td></tr>';
2454 2454
 
2455 2455
 		// Mode of payment
2456
-		print '<tr class="field_mode_reglement_id"><td class="titlefieldcreate">' . $langs->trans('PaymentMode') . '</td><td class="valuefieldcreate">';
2456
+		print '<tr class="field_mode_reglement_id"><td class="titlefieldcreate">'.$langs->trans('PaymentMode').'</td><td class="valuefieldcreate">';
2457 2457
 		print img_picto('', 'bank', 'class="pictofixedwidth"');
2458 2458
 		print $form->select_types_paiements((string) $mode_reglement_id, 'mode_reglement_id', 'CRDT', 0, 1, 0, 0, 1, 'maxwidth200 widthcentpercentminusx', 1);
2459 2459
 		print '</td></tr>';
2460 2460
 
2461 2461
 		// Bank Account
2462 2462
 		if (getDolGlobalString('BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL') && isModEnabled("bank")) {
2463
-			print '<tr class="field_fk_account"><td class="titlefieldcreate">' . $langs->trans('BankAccount') . '</td><td class="valuefieldcreate">';
2464
-			print img_picto('', 'bank_account', 'class="pictofixedwidth"') . $form->select_comptes((int) $fk_account, 'fk_account', 0, '', 1, '', 0, 'maxwidth200 widthcentpercentminusx', 1);
2463
+			print '<tr class="field_fk_account"><td class="titlefieldcreate">'.$langs->trans('BankAccount').'</td><td class="valuefieldcreate">';
2464
+			print img_picto('', 'bank_account', 'class="pictofixedwidth"').$form->select_comptes((int) $fk_account, 'fk_account', 0, '', 1, '', 0, 'maxwidth200 widthcentpercentminusx', 1);
2465 2465
 			print '</td></tr>';
2466 2466
 		}
2467 2467
 
2468 2468
 		// Source / Channel - What trigger creation
2469
-		print '<tr class="field_demand_reason_id"><td class="titlefieldcreate">' . $langs->trans('Source') . '</td><td class="valuefieldcreate">';
2469
+		print '<tr class="field_demand_reason_id"><td class="titlefieldcreate">'.$langs->trans('Source').'</td><td class="valuefieldcreate">';
2470 2470
 		print img_picto('', 'question', 'class="pictofixedwidth"');
2471 2471
 		$form->selectInputReason((GETPOSTISSET('demand_reason_id') ? GETPOSTINT('demand_reason_id') : ''), 'demand_reason_id', "SRC_PROP", 1, 'maxwidth200 widthcentpercentminusx');
2472 2472
 		print '</td></tr>';
@@ -2476,7 +2476,7 @@  discard block
 block discarded – undo
2476 2476
 			if (getDolGlobalString('SOCIETE_ASK_FOR_SHIPPING_METHOD') && !empty($soc->shipping_method_id)) {
2477 2477
 				$shipping_method_id = $soc->shipping_method_id;
2478 2478
 			}
2479
-			print '<tr class="field_shipping_method_id"><td class="titlefieldcreate">' . $langs->trans('SendingMethod') . '</td><td class="valuefieldcreate">';
2479
+			print '<tr class="field_shipping_method_id"><td class="titlefieldcreate">'.$langs->trans('SendingMethod').'</td><td class="valuefieldcreate">';
2480 2480
 			print img_picto('', 'dolly', 'class="pictofixedwidth"');
2481 2481
 			$form->selectShippingMethod((string) (GETPOSTISSET('shipping_method_id') ? GETPOSTINT('shipping_method_id') : $shipping_method_id), 'shipping_method_id', '', 1, '', 0, 'maxwidth200 widthcentpercentminusx');
2482 2482
 			print '</td></tr>';
@@ -2485,17 +2485,17 @@  discard block
 block discarded – undo
2485 2485
 		$formproduct = null;
2486 2486
 		// Warehouse
2487 2487
 		if (isModEnabled('stock') && getDolGlobalString('WAREHOUSE_ASK_WAREHOUSE_DURING_PROPAL')) {
2488
-			require_once DOL_DOCUMENT_ROOT . '/product/class/html.formproduct.class.php';
2488
+			require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
2489 2489
 			$formproduct = new FormProduct($db);
2490
-			print '<tr class="field_warehouse_id"><td class="titlefieldcreate">' . $langs->trans('Warehouse') . '</td><td class="valuefieldcreate">';
2491
-			print img_picto('', 'stock', 'class="pictofixedwidth"') . $formproduct->selectWarehouses($warehouse_id, 'warehouse_id', '', 1, 0, 0, '', 0, 0, array(), 'maxwidth500 widthcentpercentminusxx');
2490
+			print '<tr class="field_warehouse_id"><td class="titlefieldcreate">'.$langs->trans('Warehouse').'</td><td class="valuefieldcreate">';
2491
+			print img_picto('', 'stock', 'class="pictofixedwidth"').$formproduct->selectWarehouses($warehouse_id, 'warehouse_id', '', 1, 0, 0, '', 0, 0, array(), 'maxwidth500 widthcentpercentminusxx');
2492 2492
 			print '</td></tr>';
2493 2493
 		}
2494 2494
 
2495 2495
 		// Delivery delay
2496
-		print '<tr class="field_availability_id"><td class="titlefieldcreate">' . $langs->trans('AvailabilityPeriod');
2496
+		print '<tr class="field_availability_id"><td class="titlefieldcreate">'.$langs->trans('AvailabilityPeriod');
2497 2497
 		if (isModEnabled('order')) {
2498
-			print ' (' . $langs->trans('AfterOrder') . ')';
2498
+			print ' ('.$langs->trans('AfterOrder').')';
2499 2499
 		}
2500 2500
 		print '</td><td class="valuefieldcreate">';
2501 2501
 		print img_picto('', 'clock', 'class="pictofixedwidth"');
@@ -2503,7 +2503,7 @@  discard block
 block discarded – undo
2503 2503
 		print '</td></tr>';
2504 2504
 
2505 2505
 		// Delivery date (or manufacturing)
2506
-		print '<tr class="field_date_livraison"><td class="titlefieldcreate">' . $langs->trans("DeliveryDate") . '</td>';
2506
+		print '<tr class="field_date_livraison"><td class="titlefieldcreate">'.$langs->trans("DeliveryDate").'</td>';
2507 2507
 		print '<td class="valuefieldcreate">';
2508 2508
 		print img_picto('', 'action', 'class="pictofixedwidth"');
2509 2509
 		if (is_numeric(getDolGlobalString('DATE_LIVRAISON_WEEK_DELAY'))) {	// If value set to 0 or a num, not empty
@@ -2511,7 +2511,7 @@  discard block
 block discarded – undo
2511 2511
 			$syear = date("Y", $tmpdte);
2512 2512
 			$smonth = date("m", $tmpdte);
2513 2513
 			$sday = date("d", $tmpdte);
2514
-			print $form->selectDate($syear . "-" . $smonth . "-" . $sday, 'date_livraison', 0, 0, 0, "addprop");
2514
+			print $form->selectDate($syear."-".$smonth."-".$sday, 'date_livraison', 0, 0, 0, "addprop");
2515 2515
 		} else {
2516 2516
 			$tmp_date_delivery = GETPOST('date_delivery') ?: -1;
2517 2517
 			print $form->selectDate($tmp_date_delivery, 'date_livraison', 0, 0, 0, "addprop", 1, 1);
@@ -2532,7 +2532,7 @@  discard block
 block discarded – undo
2532 2532
 		// Incoterms
2533 2533
 		if (isModEnabled('incoterm')) {
2534 2534
 			print '<tr class="field_incoterm_id">';
2535
-			print '<td class="titlefieldcreate"><label for="incoterm_id">' . $form->textwithpicto($langs->trans("IncotermLabel"), $soc->label_incoterms, 1) . '</label></td>';
2535
+			print '<td class="titlefieldcreate"><label for="incoterm_id">'.$form->textwithpicto($langs->trans("IncotermLabel"), $soc->label_incoterms, 1).'</label></td>';
2536 2536
 			print '<td  class="valuefieldcreate maxwidthonsmartphone">';
2537 2537
 			print img_picto('', 'incoterm', 'class="pictofixedwidth"');
2538 2538
 			print $form->select_incoterms((!empty($soc->fk_incoterms) ? $soc->fk_incoterms : ''), (!empty($soc->location_incoterms) ? $soc->location_incoterms : ''));
@@ -2546,7 +2546,7 @@  discard block
 block discarded – undo
2546 2546
 		}
2547 2547
 		// Template to use by default
2548 2548
 		print '<tr class="field_model">';
2549
-		print '<td class="titlefieldcreate">' . $langs->trans("DefaultModel") . '</td>';
2549
+		print '<td class="titlefieldcreate">'.$langs->trans("DefaultModel").'</td>';
2550 2550
 		print '<td class="valuefieldcreate">';
2551 2551
 		print img_picto('', 'pdf', 'class="pictofixedwidth"');
2552 2552
 		$liste = ModelePDFPropales::liste_modeles($db);
@@ -2557,15 +2557,15 @@  discard block
 block discarded – undo
2557 2557
 		// Multicurrency
2558 2558
 		if (isModEnabled("multicurrency")) {
2559 2559
 			print '<tr class="field_currency">';
2560
-			print '<td class="titlefieldcreate">' . $form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0) . '</td>';
2560
+			print '<td class="titlefieldcreate">'.$form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0).'</td>';
2561 2561
 			print '<td class="valuefieldcreate maxwidthonsmartphone">';
2562
-			print img_picto('', 'currency', 'class="pictofixedwidth"') . $form->selectMultiCurrency(((GETPOSTISSET('multicurrency_code') && !GETPOST('changecompany')) ? GETPOST('multicurrency_code') : $currency_code), 'multicurrency_code', 0, '', false, 'maxwidth200 widthcentpercentminusx');
2562
+			print img_picto('', 'currency', 'class="pictofixedwidth"').$form->selectMultiCurrency(((GETPOSTISSET('multicurrency_code') && !GETPOST('changecompany')) ? GETPOST('multicurrency_code') : $currency_code), 'multicurrency_code', 0, '', false, 'maxwidth200 widthcentpercentminusx');
2563 2563
 			print '</td></tr>';
2564 2564
 		}
2565 2565
 
2566 2566
 		// Public note
2567 2567
 		print '<tr class="field_note_public">';
2568
-		print '<td class="titlefieldcreate tdtop">' . $langs->trans('NotePublic') . '</td>';
2568
+		print '<td class="titlefieldcreate tdtop">'.$langs->trans('NotePublic').'</td>';
2569 2569
 		print '<td class="valuefieldcreate">';
2570 2570
 		$note_public = GETPOST('note_public', 'restricthtml');
2571 2571
 		if (!GETPOSTISSET('note_public') && empty($note_public) && !empty($objectsrc)) {
@@ -2577,7 +2577,7 @@  discard block
 block discarded – undo
2577 2577
 		// Private note
2578 2578
 		if (empty($user->socid)) {
2579 2579
 			print '<tr class="field_note_private">';
2580
-			print '<td class="titlefieldcreate tdtop">' . $langs->trans('NotePrivate') . '</td>';
2580
+			print '<td class="titlefieldcreate tdtop">'.$langs->trans('NotePrivate').'</td>';
2581 2581
 			print '<td class="valuefieldcreate">';
2582 2582
 			$note_private = GETPOST('note_private', 'restricthtml');
2583 2583
 			if (!GETPOSTISSET('note_private') && empty($note_private) && !empty($objectsrc)) {
@@ -2590,7 +2590,7 @@  discard block
 block discarded – undo
2590 2590
 		}
2591 2591
 
2592 2592
 		// Other attributes
2593
-		include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_add.tpl.php';
2593
+		include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php';
2594 2594
 
2595 2595
 		// Lines from source
2596 2596
 		if (!empty($origin) && !empty($originid) && is_object($objectsrc)) {
@@ -2602,13 +2602,13 @@  discard block
 block discarded – undo
2602 2602
 				$objectsrc->update_price(1, 'auto', 1);
2603 2603
 			}
2604 2604
 
2605
-			print "\n<!-- " . $classname . " info -->";
2605
+			print "\n<!-- ".$classname." info -->";
2606 2606
 			print "\n";
2607
-			print '<input type="hidden" name="amount"         value="' . $objectsrc->total_ht . '">' . "\n";
2608
-			print '<input type="hidden" name="total"          value="' . $objectsrc->total_ttc . '">' . "\n";
2609
-			print '<input type="hidden" name="tva"            value="' . $objectsrc->total_tva . '">' . "\n";
2610
-			print '<input type="hidden" name="origin"         value="' . $objectsrc->element . '">';
2611
-			print '<input type="hidden" name="originid"       value="' . $objectsrc->id . '">';
2607
+			print '<input type="hidden" name="amount"         value="'.$objectsrc->total_ht.'">'."\n";
2608
+			print '<input type="hidden" name="total"          value="'.$objectsrc->total_ttc.'">'."\n";
2609
+			print '<input type="hidden" name="tva"            value="'.$objectsrc->total_tva.'">'."\n";
2610
+			print '<input type="hidden" name="origin"         value="'.$objectsrc->element.'">';
2611
+			print '<input type="hidden" name="originid"       value="'.$objectsrc->id.'">';
2612 2612
 
2613 2613
 			$newclassname = $classname;
2614 2614
 			if ($newclassname == 'Propal') {
@@ -2621,22 +2621,22 @@  discard block
 block discarded – undo
2621 2621
 				$newclassname = 'Intervention';
2622 2622
 			}
2623 2623
 
2624
-			print '<tr><td>' . $langs->trans($newclassname) . '</td><td>' . $objectsrc->getNomUrl(1) . '</td></tr>';
2625
-			print '<tr><td>' . $langs->trans('AmountHT') . '</td><td>' . price($objectsrc->total_ht, 0, $langs, 1, -1, -1, $conf->currency) . '</td></tr>';
2626
-			print '<tr><td>' . $langs->trans('AmountVAT') . '</td><td>' . price($objectsrc->total_tva, 0, $langs, 1, -1, -1, $conf->currency) . "</td></tr>";
2624
+			print '<tr><td>'.$langs->trans($newclassname).'</td><td>'.$objectsrc->getNomUrl(1).'</td></tr>';
2625
+			print '<tr><td>'.$langs->trans('AmountHT').'</td><td>'.price($objectsrc->total_ht, 0, $langs, 1, -1, -1, $conf->currency).'</td></tr>';
2626
+			print '<tr><td>'.$langs->trans('AmountVAT').'</td><td>'.price($objectsrc->total_tva, 0, $langs, 1, -1, -1, $conf->currency)."</td></tr>";
2627 2627
 			if ($mysoc->localtax1_assuj == "1" || $objectsrc->total_localtax1 != 0) { 		// Localtax1
2628
-				print '<tr><td>' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '</td><td>' . price($objectsrc->total_localtax1, 0, $langs, 1, -1, -1, $conf->currency) . "</td></tr>";
2628
+				print '<tr><td>'.$langs->transcountry("AmountLT1", $mysoc->country_code).'</td><td>'.price($objectsrc->total_localtax1, 0, $langs, 1, -1, -1, $conf->currency)."</td></tr>";
2629 2629
 			}
2630 2630
 
2631 2631
 			if ($mysoc->localtax2_assuj == "1" || $objectsrc->total_localtax2 != 0) { 		// Localtax2
2632
-				print '<tr><td>' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '</td><td>' . price($objectsrc->total_localtax2, 0, $langs, 1, -1, -1, $conf->currency) . "</td></tr>";
2632
+				print '<tr><td>'.$langs->transcountry("AmountLT2", $mysoc->country_code).'</td><td>'.price($objectsrc->total_localtax2, 0, $langs, 1, -1, -1, $conf->currency)."</td></tr>";
2633 2633
 			}
2634
-			print '<tr><td>' . $langs->trans('AmountTTC') . '</td><td>' . price($objectsrc->total_ttc, 0, $langs, 1, -1, -1, $conf->currency) . "</td></tr>";
2634
+			print '<tr><td>'.$langs->trans('AmountTTC').'</td><td>'.price($objectsrc->total_ttc, 0, $langs, 1, -1, -1, $conf->currency)."</td></tr>";
2635 2635
 
2636 2636
 			if (isModEnabled("multicurrency")) {
2637
-				print '<tr><td>' . $langs->trans('MulticurrencyAmountHT') . '</td><td>' . price($objectsrc->multicurrency_total_ht) . '</td></tr>';
2638
-				print '<tr><td>' . $langs->trans('MulticurrencyAmountVAT') . '</td><td>' . price($objectsrc->multicurrency_total_tva) . "</td></tr>";
2639
-				print '<tr><td>' . $langs->trans('MulticurrencyAmountTTC') . '</td><td>' . price($objectsrc->multicurrency_total_ttc) . "</td></tr>";
2637
+				print '<tr><td>'.$langs->trans('MulticurrencyAmountHT').'</td><td>'.price($objectsrc->multicurrency_total_ht).'</td></tr>';
2638
+				print '<tr><td>'.$langs->trans('MulticurrencyAmountVAT').'</td><td>'.price($objectsrc->multicurrency_total_tva)."</td></tr>";
2639
+				print '<tr><td>'.$langs->trans('MulticurrencyAmountTTC').'</td><td>'.price($objectsrc->multicurrency_total_ttc)."</td></tr>";
2640 2640
 			}
2641 2641
 		}
2642 2642
 
@@ -2657,16 +2657,16 @@  discard block
 block discarded – undo
2657 2657
 			// For backward compatibility
2658 2658
 			print '<tr>';
2659 2659
 			print '<td><input type="radio" name="createmode" value="copy"></td>';
2660
-			print '<td>' . $langs->trans("CopyPropalFrom") . ' </td>';
2660
+			print '<td>'.$langs->trans("CopyPropalFrom").' </td>';
2661 2661
 			print '<td>';
2662 2662
 			$liste_propal = array();
2663 2663
 			$liste_propal[0] = '';
2664 2664
 
2665 2665
 			$sql = "SELECT p.rowid as id, p.ref, s.nom";
2666
-			$sql .= " FROM " . MAIN_DB_PREFIX . "propal p";
2667
-			$sql .= ", " . MAIN_DB_PREFIX . "societe s";
2666
+			$sql .= " FROM ".MAIN_DB_PREFIX."propal p";
2667
+			$sql .= ", ".MAIN_DB_PREFIX."societe s";
2668 2668
 			$sql .= " WHERE s.rowid = p.fk_soc";
2669
-			$sql .= " AND p.entity IN (" . getEntity('propal') . ")";
2669
+			$sql .= " AND p.entity IN (".getEntity('propal').")";
2670 2670
 			$sql .= " AND p.fk_statut <> 0";
2671 2671
 			$sql .= " ORDER BY Id";
2672 2672
 
@@ -2676,7 +2676,7 @@  discard block
 block discarded – undo
2676 2676
 				$i = 0;
2677 2677
 				while ($i < $num) {
2678 2678
 					$row = $db->fetch_row($resql);
2679
-					$propalRefAndSocName = $row[1] . " - " . $row[2];
2679
+					$propalRefAndSocName = $row[1]." - ".$row[2];
2680 2680
 					$liste_propal[$row[0]] = $propalRefAndSocName;
2681 2681
 					$i++;
2682 2682
 				}
@@ -2687,7 +2687,7 @@  discard block
 block discarded – undo
2687 2687
 			print '</td></tr>';
2688 2688
 
2689 2689
 			print '<tr><td class="tdtop"><input type="radio" name="createmode" value="empty" checked></td>';
2690
-			print '<td valign="top" colspan="2">' . $langs->trans("CreateEmptyPropal") . '</td></tr>';
2690
+			print '<td valign="top" colspan="2">'.$langs->trans("CreateEmptyPropal").'</td></tr>';
2691 2691
 			print '</table>';
2692 2692
 		}
2693 2693
 	}
@@ -2767,9 +2767,9 @@  discard block
 block discarded – undo
2767 2767
 		//Form to close proposal (signed or not)
2768 2768
 		$formquestion = array();
2769 2769
 		if (!getDolGlobalString('PROPAL_SKIP_ACCEPT_REFUSE')) {
2770
-			$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)));
2770
+			$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)));
2771 2771
 		}
2772
-		$formquestion[] = array('type' => 'text', 'name' => 'note_private', 'label' => $langs->trans("Note"), 'value' => '');				// Field to complete private note (not replace)
2772
+		$formquestion[] = array('type' => 'text', 'name' => 'note_private', 'label' => $langs->trans("Note"), 'value' => ''); // Field to complete private note (not replace)
2773 2773
 
2774 2774
 		if (getDolGlobalInt('PROPOSAL_SUGGEST_DOWN_PAYMENT_INVOICE_CREATION')) {
2775 2775
 			// This is a hidden option:
@@ -2779,7 +2779,7 @@  discard block
 block discarded – undo
2779 2779
 			$deposit_percent_from_payment_terms = getDictionaryValue('c_payment_term', 'deposit_percent', $object->cond_reglement_id);
2780 2780
 
2781 2781
 			if (!empty($deposit_percent_from_payment_terms) && isModEnabled('invoice') && $user->hasRight('facture', 'creer')) {
2782
-				require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
2782
+				require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
2783 2783
 
2784 2784
 				$object->fetchObjectLinked();
2785 2785
 
@@ -2865,7 +2865,7 @@  discard block
 block discarded – undo
2865 2865
 						'type' => 'onecolumn',
2866 2866
 						'value' => '
2867 2867
 							<script>
2868
-								let signedValue = ' . $object::STATUS_SIGNED . ';
2868
+								let signedValue = ' . $object::STATUS_SIGNED.';
2869 2869
 
2870 2870
 								$(document).ready(function() {
2871 2871
 									$("[name=generate_deposit]").change(function () {
@@ -2905,7 +2905,7 @@  discard block
 block discarded – undo
2905 2905
 		}
2906 2906
 
2907 2907
 		if (isModEnabled('notification')) {
2908
-			require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php';
2908
+			require_once DOL_DOCUMENT_ROOT.'/core/class/notify.class.php';
2909 2909
 			$notify = new Notify($db);
2910 2910
 			$formquestion = array_merge($formquestion, array(
2911 2911
 				array('type' => 'onecolumn', 'value' => $notify->confirmMessage('PROPAL_CLOSE_SIGNED', $object->socid, $object)),
@@ -2915,7 +2915,7 @@  discard block
 block discarded – undo
2915 2915
 		if (!getDolGlobalString('PROPAL_SKIP_ACCEPT_REFUSE')) {
2916 2916
 			$formconfirm = $form->formconfirm(dolBuildUrl($_SERVER["PHP_SELF"], ['id' => $object->id]), $langs->trans('SetAcceptedRefused'), '', 'confirm_closeas', $formquestion, '', 1, 250);
2917 2917
 		} else {
2918
-			$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?statut=3&id=' . $object->id, $langs->trans('Close'), '', 'confirm_closeas', $formquestion, '', 1, 250);
2918
+			$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?statut=3&id='.$object->id, $langs->trans('Close'), '', 'confirm_closeas', $formquestion, '', 1, 250);
2919 2919
 		}
2920 2920
 	} elseif ($action == 'cancel') {
2921 2921
 		// Confirm cancel
@@ -2928,7 +2928,7 @@  discard block
 block discarded – undo
2928 2928
 		$formconfirm = $form->formconfirm(dolBuildUrl($_SERVER["PHP_SELF"], ['id' => $object->id]), $langs->trans('ReOpen'), $langs->trans('ConfirmReOpenProp', $object->ref), 'confirm_reopen', '', 0, 1);
2929 2929
 	} elseif ($action == 'ask_deleteline') {
2930 2930
 		// Confirmation delete product/service line
2931
-		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id . '&lineid=' . $lineid, $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteline', '', 0, 1);
2931
+		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteline', '', 0, 1);
2932 2932
 	} elseif ($action == 'ask_subtotal_deleteline') {
2933 2933
 		// Confirmation de la suppression d'une ligne subtotal
2934 2934
 		$langs->load("subtotals");
@@ -2939,7 +2939,7 @@  discard block
 block discarded – undo
2939 2939
 			$title = "DeleteTitleLine";
2940 2940
 			$question = "ConfirmDeleteTitleLine";
2941 2941
 		}
2942
-		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id . '&lineid=' . $lineid, $langs->trans($title), $langs->trans($question), 'confirm_delete_subtotalline', $formconfirm, 'no', 1);
2942
+		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans($title), $langs->trans($question), 'confirm_delete_subtotalline', $formconfirm, 'no', 1);
2943 2943
 	} elseif ($action == 'validate') {
2944 2944
 		// Confirm validate proposal
2945 2945
 		$error = 0;
@@ -2958,7 +2958,7 @@  discard block
 block discarded – undo
2958 2958
 
2959 2959
 		$text = $langs->trans('ConfirmValidateProp', $numref);
2960 2960
 		if (isModEnabled('notification')) {
2961
-			require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php';
2961
+			require_once DOL_DOCUMENT_ROOT.'/core/class/notify.class.php';
2962 2962
 			$notify = new Notify($db);
2963 2963
 			$text .= '<br>';
2964 2964
 			$text .= $notify->confirmMessage('PROPAL_VALIDATE', $object->socid, $object);
@@ -2968,7 +2968,7 @@  discard block
 block discarded – undo
2968 2968
 		$nbMandated = 0;
2969 2969
 		foreach ($object->lines as $line) {
2970 2970
 			$res = $line->fetch_product();
2971
-			if ($res  > 0) {
2971
+			if ($res > 0) {
2972 2972
 				if ($line->product->isService() && $line->product->isMandatoryPeriod() && (empty($line->date_start) || empty($line->date_end))) {
2973 2973
 					$nbMandated++;
2974 2974
 					break;
@@ -2980,7 +2980,7 @@  discard block
 block discarded – undo
2980 2980
 				setEventMessages($langs->trans("mandatoryPeriodNeedTobeSetMsgValidate"), null, 'errors');
2981 2981
 				$error++;
2982 2982
 			} else {
2983
-				$text .= '<div><span class="clearboth nowraponall warning">' . img_warning() . $langs->trans("mandatoryPeriodNeedTobeSetMsgValidate") . '</span></div>';
2983
+				$text .= '<div><span class="clearboth nowraponall warning">'.img_warning().$langs->trans("mandatoryPeriodNeedTobeSetMsgValidate").'</span></div>';
2984 2984
 			}
2985 2985
 		}
2986 2986
 
@@ -3004,16 +3004,16 @@  discard block
 block discarded – undo
3004 3004
 
3005 3005
 	// Proposal card
3006 3006
 
3007
-	$linkback = '<a href="' . DOL_URL_ROOT . '/comm/propal/list.php?restore_lastsearch_values=1' . (!empty($socid) ? '&socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';
3007
+	$linkback = '<a href="'.DOL_URL_ROOT.'/comm/propal/list.php?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>';
3008 3008
 
3009 3009
 	$morehtmlref = '<div class="refidno">';
3010 3010
 	// Ref customer
3011 3011
 	$morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, $usercancreate, 'string', '', 0, 1);
3012
-	$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);
3012
+	$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);
3013 3013
 	// Thirdparty
3014
-	$morehtmlref .= '<br>' . $soc->getNomUrl(1, 'customer');
3014
+	$morehtmlref .= '<br>'.$soc->getNomUrl(1, 'customer');
3015 3015
 	if (!getDolGlobalString('MAIN_DISABLE_OTHER_LINK') && $soc->id > 0) {
3016
-		$morehtmlref .= ' (<a href="' . DOL_URL_ROOT . '/comm/propal/list.php?socid=' . $soc->id . '&search_societe=' . urlencode($soc->name) . '">' . $langs->trans("OtherProposals") . '</a>)';
3016
+		$morehtmlref .= ' (<a href="'.DOL_URL_ROOT.'/comm/propal/list.php?socid='.$soc->id.'&search_societe='.urlencode($soc->name).'">'.$langs->trans("OtherProposals").'</a>)';
3017 3017
 	}
3018 3018
 	// Project
3019 3019
 	if (isModEnabled('project')) {
@@ -3022,16 +3022,16 @@  discard block
 block discarded – undo
3022 3022
 		if ($usercancreate) {
3023 3023
 			$morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"');
3024 3024
 			if ($action != 'classify') {
3025
-				$morehtmlref .= '<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&token=' . newToken() . '&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> ';
3025
+				$morehtmlref .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> ';
3026 3026
 			}
3027
-			$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');
3027
+			$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');
3028 3028
 		} else {
3029 3029
 			if (!empty($object->fk_project)) {
3030 3030
 				$proj = new Project($db);
3031 3031
 				$proj->fetch($object->fk_project);
3032 3032
 				$morehtmlref .= $proj->getNomUrl(1);
3033 3033
 				if ($proj->title) {
3034
-					$morehtmlref .= '<span class="opacitymedium"> - ' . dol_escape_htmltag($proj->title) . '</span>';
3034
+					$morehtmlref .= '<span class="opacitymedium"> - '.dol_escape_htmltag($proj->title).'</span>';
3035 3035
 				}
3036 3036
 			}
3037 3037
 		}
@@ -3061,7 +3061,7 @@  discard block
 block discarded – undo
3061 3061
 			$filtercreditnote = "fk_facture_source IS NOT NULL AND (description NOT LIKE '(DEPOSIT)%' OR description LIKE '(EXCESS RECEIVED)%')";
3062 3062
 		}
3063 3063
 
3064
-		print '<tr><td class="titlefieldmax45">' . $langs->trans('Discounts') . '</td><td>';
3064
+		print '<tr><td class="titlefieldmax45">'.$langs->trans('Discounts').'</td><td>';
3065 3065
 
3066 3066
 		$absolute_discount = $soc->getAvailableDiscounts(null, $filterabsolutediscount);
3067 3067
 		$absolute_creditnote = $soc->getAvailableDiscounts(null, $filtercreditnote);
@@ -3072,8 +3072,8 @@  discard block
 block discarded – undo
3072 3072
 
3073 3073
 		$thirdparty = $soc;
3074 3074
 		$discount_type = 0;
3075
-		$backtopage = $_SERVER["PHP_SELF"] . '?id=' . $object->id;
3076
-		include DOL_DOCUMENT_ROOT . '/core/tpl/object_discounts.tpl.php';
3075
+		$backtopage = $_SERVER["PHP_SELF"].'?id='.$object->id;
3076
+		include DOL_DOCUMENT_ROOT.'/core/tpl/object_discounts.tpl.php';
3077 3077
 
3078 3078
 		print '</td></tr>';
3079 3079
 
@@ -3092,12 +3092,12 @@  discard block
 block discarded – undo
3092 3092
 		print $form->editfieldkey("DatePropal", 'date', '', $object, (int) $editenable);
3093 3093
 		print '</td><td class="valuefield">';
3094 3094
 		if ($action == 'editdate' && $usercancreate && $caneditfield) {
3095
-			print '<form name="editdate" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '" method="post">';
3096
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
3095
+			print '<form name="editdate" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="post">';
3096
+			print '<input type="hidden" name="token" value="'.newToken().'">';
3097 3097
 			print '<input type="hidden" name="action" value="setdate">';
3098
-			print '<input type="hidden" name="backtopage" value="' . $backtopage . '">';
3098
+			print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
3099 3099
 			print $form->selectDate($object->date, 're', 0, 0, 0, "editdate");
3100
-			print '<input type="submit" class="button button-edit" value="' . $langs->trans('Modify') . '">';
3100
+			print '<input type="submit" class="button button-edit" value="'.$langs->trans('Modify').'">';
3101 3101
 			print '</form>';
3102 3102
 		} else {
3103 3103
 			if ($object->date) {
@@ -3115,17 +3115,17 @@  discard block
 block discarded – undo
3115 3115
 		print $langs->trans('DateEndPropal');
3116 3116
 		print '</td>';
3117 3117
 		if ($action != 'editecheance' && $usercancreate && $caneditfield) {
3118
-			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>';
3118
+			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>';
3119 3119
 		}
3120 3120
 		print '</tr></table>';
3121 3121
 		print '</td><td class="valuefield">';
3122 3122
 		if ($action == 'editecheance' && $usercancreate && $caneditfield) {
3123
-			print '<form name="editecheance" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '" method="post">';
3124
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
3123
+			print '<form name="editecheance" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="post">';
3124
+			print '<input type="hidden" name="token" value="'.newToken().'">';
3125 3125
 			print '<input type="hidden" name="action" value="setecheance">';
3126
-			print '<input type="hidden" name="backtopage" value="' . $backtopage . '">';
3126
+			print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
3127 3127
 			print $form->selectDate($object->fin_validite, 'ech', 0, 0, 0, "editecheance");
3128
-			print '<input type="submit" class="button button-edit" value="' . $langs->trans('Modify') . '">';
3128
+			print '<input type="submit" class="button button-edit" value="'.$langs->trans('Modify').'">';
3129 3129
 			print '</form>';
3130 3130
 		} else {
3131 3131
 			if (!empty($object->fin_validite)) {
@@ -3146,14 +3146,14 @@  discard block
 block discarded – undo
3146 3146
 		print $langs->trans('PaymentConditionsShort');
3147 3147
 		print '</td>';
3148 3148
 		if ($action != 'editconditions' && $usercancreate && $caneditfield) {
3149
-			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>';
3149
+			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>';
3150 3150
 		}
3151 3151
 		print '</tr></table>';
3152 3152
 		print '</td><td class="valuefield">';
3153 3153
 		if ($action == 'editconditions' && $usercancreate && $caneditfield) {
3154
-			$form->form_conditions_reglement($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->cond_reglement_id, 'cond_reglement_id', 0, '', 1, $object->deposit_percent);
3154
+			$form->form_conditions_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->cond_reglement_id, 'cond_reglement_id', 0, '', 1, $object->deposit_percent);
3155 3155
 		} else {
3156
-			$form->form_conditions_reglement($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->cond_reglement_id, 'none', 0, '', 1, $object->deposit_percent);
3156
+			$form->form_conditions_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->cond_reglement_id, 'none', 0, '', 1, $object->deposit_percent);
3157 3157
 		}
3158 3158
 		print '</td>';
3159 3159
 		print '</tr>';
@@ -3165,14 +3165,14 @@  discard block
 block discarded – undo
3165 3165
 		print $langs->trans('PaymentMode');
3166 3166
 		print '</td>';
3167 3167
 		if ($action != 'editmode' && $usercancreate && $caneditfield) {
3168
-			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>';
3168
+			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>';
3169 3169
 		}
3170 3170
 		print '</tr></table>';
3171 3171
 		print '</td><td class="valuefieldcreate">';
3172 3172
 		if ($action == 'editmode' && $usercancreate && $caneditfield) {
3173
-			$form->form_modes_reglement($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->mode_reglement_id, 'mode_reglement_id', 'CRDT', 1, 1);
3173
+			$form->form_modes_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->mode_reglement_id, 'mode_reglement_id', 'CRDT', 1, 1);
3174 3174
 		} else {
3175
-			$form->form_modes_reglement($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->mode_reglement_id, 'none');
3175
+			$form->form_modes_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->mode_reglement_id, 'none');
3176 3176
 		}
3177 3177
 		print '</td></tr>';
3178 3178
 
@@ -3188,20 +3188,20 @@  discard block
 block discarded – undo
3188 3188
 		print '<tr class="fielddeliverydelay"><td>';
3189 3189
 		print '<table class="nobordernopadding centpercent"><tr><td>';
3190 3190
 		if (isModEnabled('order')) {
3191
-			print $form->textwithpicto($langs->trans('AvailabilityPeriod'), $langs->trans('AvailabilityPeriod') . ' (' . $langs->trans('AfterOrder') . ')');
3191
+			print $form->textwithpicto($langs->trans('AvailabilityPeriod'), $langs->trans('AvailabilityPeriod').' ('.$langs->trans('AfterOrder').')');
3192 3192
 		} else {
3193 3193
 			print $langs->trans('AvailabilityPeriod');
3194 3194
 		}
3195 3195
 		print '</td>';
3196 3196
 		if ($action != 'editavailability' && $usercancreate && $caneditfield) {
3197
-			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>';
3197
+			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>';
3198 3198
 		}
3199 3199
 		print '</tr></table>';
3200 3200
 		print '</td><td class="valuefield">';
3201 3201
 		if ($action == 'editavailability' && $usercancreate && $caneditfield) {
3202
-			$form->form_availability($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->availability_id, 'availability_id', 1);
3202
+			$form->form_availability($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->availability_id, 'availability_id', 1);
3203 3203
 		} else {
3204
-			$form->form_availability($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->availability_id, 'none', 1);
3204
+			$form->form_availability($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->availability_id, 'none', 1);
3205 3205
 		}
3206 3206
 
3207 3207
 		print '</td>';
@@ -3214,14 +3214,14 @@  discard block
 block discarded – undo
3214 3214
 			print $langs->trans('SendingMethod');
3215 3215
 			print '</td>';
3216 3216
 			if ($action != 'editshippingmethod' && $usercancreate && $caneditfield) {
3217
-				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>';
3217
+				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>';
3218 3218
 			}
3219 3219
 			print '</tr></table>';
3220 3220
 			print '</td><td class="valuefield">';
3221 3221
 			if ($action == 'editshippingmethod' && $usercancreate && $caneditfield) {
3222
-				$form->formSelectShippingMethod($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->shipping_method_id, 'shipping_method_id', 1);
3222
+				$form->formSelectShippingMethod($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->shipping_method_id, 'shipping_method_id', 1);
3223 3223
 			} else {
3224
-				$form->formSelectShippingMethod($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->shipping_method_id, 'none');
3224
+				$form->formSelectShippingMethod($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->shipping_method_id, 'none');
3225 3225
 			}
3226 3226
 			print '</td>';
3227 3227
 			print '</tr>';
@@ -3230,16 +3230,16 @@  discard block
 block discarded – undo
3230 3230
 		// Warehouse
3231 3231
 		if (isModEnabled('stock') && getDolGlobalString('WAREHOUSE_ASK_WAREHOUSE_DURING_PROPAL')) {
3232 3232
 			$langs->load('stocks');
3233
-			require_once DOL_DOCUMENT_ROOT . '/product/class/html.formproduct.class.php';
3233
+			require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
3234 3234
 			$formproduct = new FormProduct($db);
3235 3235
 			print '<tr class="field_warehouse_id"><td>';
3236 3236
 			$editenable = $usercancreate;
3237 3237
 			print $form->editfieldkey("Warehouse", 'warehouse', '', $object, $editenable);
3238 3238
 			print '</td><td class="valuefieldcreate">';
3239 3239
 			if ($action == 'editwarehouse') {
3240
-				$formproduct->formSelectWarehouses($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->warehouse_id, 'warehouse_id', 1);
3240
+				$formproduct->formSelectWarehouses($_SERVER['PHP_SELF'].'?id='.$object->id, $object->warehouse_id, 'warehouse_id', 1);
3241 3241
 			} else {
3242
-				$formproduct->formSelectWarehouses($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->warehouse_id, 'none');
3242
+				$formproduct->formSelectWarehouses($_SERVER['PHP_SELF'].'?id='.$object->id, $object->warehouse_id, 'none');
3243 3243
 			}
3244 3244
 			print '</td>';
3245 3245
 			print '</tr>';
@@ -3251,14 +3251,14 @@  discard block
 block discarded – undo
3251 3251
 		print $langs->trans('Source');
3252 3252
 		print '</td>';
3253 3253
 		if ($action != 'editdemandreason' && $usercancreate) {
3254
-			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>';
3254
+			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>';
3255 3255
 		}
3256 3256
 		print '</tr></table>';
3257 3257
 		print '</td><td class="valuefield">';
3258 3258
 		if ($action == 'editdemandreason' && $usercancreate) {
3259
-			$form->formInputReason($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->demand_reason_id, 'demand_reason_id', 1);
3259
+			$form->formInputReason($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->demand_reason_id, 'demand_reason_id', 1);
3260 3260
 		} else {
3261
-			$form->formInputReason($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->demand_reason_id, 'none');
3261
+			$form->formInputReason($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->demand_reason_id, 'none');
3262 3262
 		}
3263 3263
 		print '</td>';
3264 3264
 		print '</tr>';
@@ -3270,7 +3270,7 @@  discard block
 block discarded – undo
3270 3270
 			print '</td><td class="valuefield">';
3271 3271
 			$arrayoutstandingbills = $soc->getOutstandingBills();
3272 3272
 			print($arrayoutstandingbills['opened'] > $soc->outstanding_limit ? img_warning() : '');
3273
-			print price($arrayoutstandingbills['opened']) . ' / ';
3273
+			print price($arrayoutstandingbills['opened']).' / ';
3274 3274
 			print price($soc->outstanding_limit, 0, $langs, 1, -1, -1, $conf->currency);
3275 3275
 			print '</td>';
3276 3276
 			print '</tr>';
@@ -3283,14 +3283,14 @@  discard block
 block discarded – undo
3283 3283
 			print $langs->trans('BankAccount');
3284 3284
 			print '</td>';
3285 3285
 			if ($action != 'editbankaccount' && $usercancreate) {
3286
-				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>';
3286
+				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>';
3287 3287
 			}
3288 3288
 			print '</tr></table>';
3289 3289
 			print '</td><td class="valuefield">';
3290 3290
 			if ($action == 'editbankaccount') {
3291
-				$form->formSelectAccount($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->fk_account, 'fk_account', 1);
3291
+				$form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->fk_account, 'fk_account', 1);
3292 3292
 			} else {
3293
-				$form->formSelectAccount($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->fk_account, 'none');
3293
+				$form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->fk_account, 'none');
3294 3294
 			}
3295 3295
 			print '</td>';
3296 3296
 			print '</tr>';
@@ -3301,13 +3301,13 @@  discard block
 block discarded – undo
3301 3301
 			$totalWeight = isset($tmparray['weight']) ? $tmparray['weight'] : 0;
3302 3302
 			$totalVolume = isset($tmparray['volume']) ? $tmparray['volume'] : 0;
3303 3303
 			if ($totalWeight) {
3304
-				print '<tr><td>' . $langs->trans("CalculatedWeight") . '</td>';
3304
+				print '<tr><td>'.$langs->trans("CalculatedWeight").'</td>';
3305 3305
 				print '<td class="valuefield">';
3306 3306
 				print showDimensionInBestUnit($totalWeight, 0, "weight", $langs, getDolGlobalInt('MAIN_WEIGHT_DEFAULT_ROUND', -1), getDolGlobalString('MAIN_WEIGHT_DEFAULT_UNIT', 'no'), 1);
3307 3307
 				print '</td></tr>';
3308 3308
 			}
3309 3309
 			if ($totalVolume) {
3310
-				print '<tr><td>' . $langs->trans("CalculatedVolume") . '</td>';
3310
+				print '<tr><td>'.$langs->trans("CalculatedVolume").'</td>';
3311 3311
 				print '<td class="valuefield">';
3312 3312
 				print showDimensionInBestUnit($totalVolume, 0, "volume", $langs, getDolGlobalInt('MAIN_VOLUME_DEFAULT_ROUND', -1), getDolGlobalString('MAIN_VOLUME_DEFAULT_UNIT', 'no'), 1);
3313 3313
 				print '</td></tr>';
@@ -3321,7 +3321,7 @@  discard block
 block discarded – undo
3321 3321
 			print $langs->trans('IncotermLabel');
3322 3322
 			print '<td><td class="right">';
3323 3323
 			if ($action != 'editincoterm' && $usercancreate && $caneditfield) {
3324
-				print '<a class="editfielda" href="' . DOL_URL_ROOT . '/comm/propal/card.php?id=' . $object->id . '&action=editincoterm&token=' . newToken() . '">' . img_edit() . '</a>';
3324
+				print '<a class="editfielda" href="'.DOL_URL_ROOT.'/comm/propal/card.php?id='.$object->id.'&action=editincoterm&token='.newToken().'">'.img_edit().'</a>';
3325 3325
 			} else {
3326 3326
 				print '&nbsp;';
3327 3327
 			}
@@ -3329,7 +3329,7 @@  discard block
 block discarded – undo
3329 3329
 			print '</td>';
3330 3330
 			print '<td class="valuefield">';
3331 3331
 			if ($action == 'editincoterm' && $usercancreate && $caneditfield) {
3332
-				print $form->select_incoterms((!empty($object->fk_incoterms) ? $object->fk_incoterms : ''), (!empty($object->location_incoterms) ? $object->location_incoterms : ''), $_SERVER['PHP_SELF'] . '?id=' . $object->id);
3332
+				print $form->select_incoterms((!empty($object->fk_incoterms) ? $object->fk_incoterms : ''), (!empty($object->location_incoterms) ? $object->location_incoterms : ''), $_SERVER['PHP_SELF'].'?id='.$object->id);
3333 3333
 			} else {
3334 3334
 				print $form->textwithpicto($object->display_incoterms(), $object->label_incoterms, 1);
3335 3335
 			}
@@ -3364,7 +3364,7 @@  discard block
 block discarded – undo
3364 3364
 		}
3365 3365
 
3366 3366
 		// Other attributes
3367
-		include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
3367
+		include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
3368 3368
 
3369 3369
 		print '</table>';
3370 3370
 
@@ -3374,53 +3374,53 @@  discard block
 block discarded – undo
3374 3374
 
3375 3375
 		print '<table class="border tableforfield centpercent">';
3376 3376
 
3377
-		include DOL_DOCUMENT_ROOT . '/core/tpl/object_currency_amount.tpl.php';
3377
+		include DOL_DOCUMENT_ROOT.'/core/tpl/object_currency_amount.tpl.php';
3378 3378
 
3379 3379
 		print '<tr>';
3380
-		print '<td class="titlefieldmiddle">' . $langs->trans('AmountHT') . '</td>';
3381
-		print '<td class="nowrap amountcard right">' . price($object->total_ht, 0, $langs, 1, -1, -1, $conf->currency) . '</td>';
3380
+		print '<td class="titlefieldmiddle">'.$langs->trans('AmountHT').'</td>';
3381
+		print '<td class="nowrap amountcard right">'.price($object->total_ht, 0, $langs, 1, -1, -1, $conf->currency).'</td>';
3382 3382
 		if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
3383
-			print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_ht, 0, $langs, 1, -1, -1, $object->multicurrency_code) . '</td>';
3383
+			print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_ht, 0, $langs, 1, -1, -1, $object->multicurrency_code).'</td>';
3384 3384
 		}
3385 3385
 		print '</tr>';
3386 3386
 
3387 3387
 		print '<tr>';
3388
-		print '<td>' . $langs->trans('AmountVAT') . '</td>';
3389
-		print '<td class="nowrap amountcard right">' . price($object->total_tva, 0, $langs, 1, -1, -1, $conf->currency) . '</td>';
3388
+		print '<td>'.$langs->trans('AmountVAT').'</td>';
3389
+		print '<td class="nowrap amountcard right">'.price($object->total_tva, 0, $langs, 1, -1, -1, $conf->currency).'</td>';
3390 3390
 		if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
3391
-			print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_tva, 0, $langs, 1, -1, -1, $object->multicurrency_code) . '</td>';
3391
+			print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_tva, 0, $langs, 1, -1, -1, $object->multicurrency_code).'</td>';
3392 3392
 		}
3393 3393
 		print '</tr>';
3394 3394
 
3395 3395
 		if ($mysoc->localtax1_assuj == "1" || $object->total_localtax1 != 0) {
3396 3396
 			print '<tr>';
3397
-			print '<td>' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '</td>';
3398
-			print '<td class="nowrap amountcard right">' . price($object->total_localtax1, 0, $langs, 1, -1, -1, $conf->currency) . '</td>';
3397
+			print '<td>'.$langs->transcountry("AmountLT1", $mysoc->country_code).'</td>';
3398
+			print '<td class="nowrap amountcard right">'.price($object->total_localtax1, 0, $langs, 1, -1, -1, $conf->currency).'</td>';
3399 3399
 			if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
3400 3400
 				$object->multicurrency_total_localtax1 = price2num($object->total_localtax1 * $object->multicurrency_tx, 'MT');
3401 3401
 
3402
-				print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_localtax1, 0, $langs, 1, -1, -1, $object->multicurrency_code) . '</td>';
3402
+				print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_localtax1, 0, $langs, 1, -1, -1, $object->multicurrency_code).'</td>';
3403 3403
 			}
3404 3404
 			print '</tr>';
3405 3405
 		}
3406 3406
 
3407 3407
 		if ($mysoc->localtax2_assuj == "1" || $object->total_localtax2 != 0) {
3408 3408
 			print '<tr>';
3409
-			print '<td>' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '</td>';
3410
-			print '<td class="nowrap amountcard right">' . price($object->total_localtax2, 0, $langs, 1, -1, -1, $conf->currency) . '</td>';
3409
+			print '<td>'.$langs->transcountry("AmountLT2", $mysoc->country_code).'</td>';
3410
+			print '<td class="nowrap amountcard right">'.price($object->total_localtax2, 0, $langs, 1, -1, -1, $conf->currency).'</td>';
3411 3411
 			if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
3412 3412
 				$object->multicurrency_total_localtax2 = price2num($object->total_localtax2 * $object->multicurrency_tx, 'MT');
3413 3413
 
3414
-				print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_localtax2, 0, $langs, 1, -1, -1, $object->multicurrency_code) . '</td>';
3414
+				print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_localtax2, 0, $langs, 1, -1, -1, $object->multicurrency_code).'</td>';
3415 3415
 			}
3416 3416
 			print '</tr>';
3417 3417
 		}
3418 3418
 
3419 3419
 		print '<tr>';
3420
-		print '<td>' . $langs->trans('AmountTTC') . '</td>';
3421
-		print '<td class="nowrap amountcard right">' . price($object->total_ttc, 0, $langs, 1, -1, -1, $conf->currency) . '</td>';
3420
+		print '<td>'.$langs->trans('AmountTTC').'</td>';
3421
+		print '<td class="nowrap amountcard right">'.price($object->total_ttc, 0, $langs, 1, -1, -1, $conf->currency).'</td>';
3422 3422
 		if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
3423
-			print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_ttc, 0, $langs, 1, -1, -1, $object->multicurrency_code) . '</td>';
3423
+			print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_ttc, 0, $langs, 1, -1, -1, $object->multicurrency_code).'</td>';
3424 3424
 		}
3425 3425
 		print '</tr>';
3426 3426
 
@@ -3439,13 +3439,13 @@  discard block
 block discarded – undo
3439 3439
 		if (getDolGlobalString('MAIN_DISABLE_CONTACTS_TAB')) {
3440 3440
 			$blocname = 'contacts';
3441 3441
 			$title = $langs->trans('ContactsAddresses');
3442
-			include DOL_DOCUMENT_ROOT . '/core/tpl/bloc_showhide.tpl.php';
3442
+			include DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php';
3443 3443
 		}
3444 3444
 
3445 3445
 		if (getDolGlobalString('MAIN_DISABLE_NOTES_TAB')) {
3446 3446
 			$blocname = 'notes';
3447 3447
 			$title = $langs->trans('Notes');
3448
-			include DOL_DOCUMENT_ROOT . '/core/tpl/bloc_showhide.tpl.php';
3448
+			include DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php';
3449 3449
 		}
3450 3450
 
3451 3451
 		/*
@@ -3460,20 +3460,20 @@  discard block
 block discarded – undo
3460 3460
 		global $inputalsopricewithtax;
3461 3461
 		$inputalsopricewithtax = 1;
3462 3462
 
3463
-		print '	<form name="addproduct" id="addproduct" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '" method="POST">
3464
-		<input type="hidden" name="token" value="' . newToken() . '">
3465
-		<input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline') . '">
3463
+		print '	<form name="addproduct" id="addproduct" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="POST">
3464
+		<input type="hidden" name="token" value="' . newToken().'">
3465
+		<input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline').'">
3466 3466
 		<input type="hidden" name="mode" value="">
3467 3467
 		<input type="hidden" name="page_y" value="">
3468
-		<input type="hidden" name="backtopage" value="' . $backtopage . '">
3469
-		<input type="hidden" name="id" value="' . $object->id . '">
3468
+		<input type="hidden" name="backtopage" value="' . $backtopage.'">
3469
+		<input type="hidden" name="id" value="' . $object->id.'">
3470 3470
 		';
3471 3471
 
3472 3472
 		if (!empty($conf->use_javascript_ajax) && $object->status == Propal::STATUS_DRAFT) {
3473 3473
 			if (isModEnabled('subtotals')) {
3474
-				include DOL_DOCUMENT_ROOT . '/core/tpl/subtotal_ajaxrow.tpl.php';
3474
+				include DOL_DOCUMENT_ROOT.'/core/tpl/subtotal_ajaxrow.tpl.php';
3475 3475
 			} else {
3476
-				include DOL_DOCUMENT_ROOT . '/core/tpl/ajaxrow.tpl.php';
3476
+				include DOL_DOCUMENT_ROOT.'/core/tpl/ajaxrow.tpl.php';
3477 3477
 			}
3478 3478
 		}
3479 3479
 
@@ -3539,7 +3539,7 @@  discard block
 block discarded – undo
3539 3539
 						'enabled' => (isModEnabled('propal') && $object->status == Propal::STATUS_DRAFT && getDolGlobalInt('SUBTOTAL_TITLE_'.strtoupper($object->element))),
3540 3540
 						'perm' => (bool) $usercancreate,
3541 3541
 						'label' => $langs->trans('AddTitleLine'),
3542
-						'url' => '/comm/propal/card.php?id=' . $object->id . '&action=add_title_line&token=' . newToken()
3542
+						'url' => '/comm/propal/card.php?id='.$object->id.'&action=add_title_line&token='.newToken()
3543 3543
 					);
3544 3544
 
3545 3545
 					$url_button[] = array(
@@ -3547,7 +3547,7 @@  discard block
 block discarded – undo
3547 3547
 						'enabled' => (isModEnabled('propal') && $object->status == Propal::STATUS_DRAFT && getDolGlobalInt('SUBTOTAL_'.strtoupper($object->element))),
3548 3548
 						'perm' => (bool) $usercancreate,
3549 3549
 						'label' => $langs->trans('AddSubtotalLine'),
3550
-						'url' => '/comm/propal/card.php?id=' . $object->id . '&action=add_subtotal_line&token=' . newToken()
3550
+						'url' => '/comm/propal/card.php?id='.$object->id.'&action=add_subtotal_line&token='.newToken()
3551 3551
 					);
3552 3552
 
3553 3553
 					print dolGetButtonAction('', $langs->trans('Subtotal'), 'default', $url_button, '', true);
@@ -3558,9 +3558,9 @@  discard block
 block discarded – undo
3558 3558
 					|| ($object->status == Propal::STATUS_DRAFT && getDolGlobalString('PROPAL_ENABLE_NEGATIVE') && count($object->lines) > 0)
3559 3559
 				) {
3560 3560
 					if ($usercanvalidate) {
3561
-						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>';
3561
+						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>';
3562 3562
 					} else {
3563
-						print '<a class="butActionRefused classfortooltip" href="#">' . $langs->trans('Validate') . '</a>';
3563
+						print '<a class="butActionRefused classfortooltip" href="#">'.$langs->trans('Validate').'</a>';
3564 3564
 					}
3565 3565
 				}
3566 3566
 				// Create event
@@ -3570,23 +3570,23 @@  discard block
 block discarded – undo
3570 3570
 				}*/
3571 3571
 				// Edit
3572 3572
 				if ($object->status == Propal::STATUS_VALIDATED && $usercancreate) {
3573
-					print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=modif&token=' . newToken() . '">' . $langs->trans('Modify') . '</a>';
3573
+					print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=modif&token='.newToken().'">'.$langs->trans('Modify').'</a>';
3574 3574
 				}
3575 3575
 
3576 3576
 				// ReOpen
3577 3577
 				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)))) {
3578 3578
 					if ($usercanreopen) {
3579
-						print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=reopen&token=' . newToken() . (!getDolGlobalString('MAIN_JUMP_TAG') ? '' : '#reopen') . '"';
3580
-						print '>' . $langs->trans('ReOpen') . '</a>';
3579
+						print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=reopen&token='.newToken().(!getDolGlobalString('MAIN_JUMP_TAG') ? '' : '#reopen').'"';
3580
+						print '>'.$langs->trans('ReOpen').'</a>';
3581 3581
 					} else {
3582
-						print '<a class="butActionRefused classfortooltip" href="#" title="' . $langs->trans("NotEnoughPermissions") . '">' . $langs->trans("ReOpen") . '</a>';
3582
+						print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("NotEnoughPermissions").'">'.$langs->trans("ReOpen").'</a>';
3583 3583
 					}
3584 3584
 				}
3585 3585
 
3586 3586
 				// Send
3587 3587
 				if (empty($user->socid)) {
3588 3588
 					if ($object->status == Propal::STATUS_VALIDATED || $object->status == Propal::STATUS_SIGNED || getDolGlobalString('PROPOSAL_SENDBYEMAIL_FOR_ALL_STATUS')) {
3589
-						print dolGetButtonAction('', $langs->trans('SendMail'), 'email', $_SERVER["PHP_SELF"] . '?action=presend&token=' . newToken() . '&id=' . $object->id . '&mode=init#formmailbeforetitle', '', $usercansend);
3589
+						print dolGetButtonAction('', $langs->trans('SendMail'), 'email', $_SERVER["PHP_SELF"].'?action=presend&token='.newToken().'&id='.$object->id.'&mode=init#formmailbeforetitle', '', $usercansend);
3590 3590
 					}
3591 3591
 				}
3592 3592
 
@@ -3598,7 +3598,7 @@  discard block
 block discarded – undo
3598 3598
 					'enabled' => (isModEnabled('order') && $object->status == Propal::STATUS_SIGNED),
3599 3599
 					'perm' => $usercancreateorder,
3600 3600
 					'label' => 'AddOrder',
3601
-					'url' => '/commande/card.php?action=create&origin=' . urlencode($object->element) . '&originid=' . ((int) $object->id) . '&socid=' . ((int) $object->socid)
3601
+					'url' => '/commande/card.php?action=create&origin='.urlencode($object->element).'&originid='.((int) $object->id).'&socid='.((int) $object->socid)
3602 3602
 				);
3603 3603
 				/*if (isModEnabled('order') && $object->status == Propal::STATUS_SIGNED) {
3604 3604
 					if ($usercancreateorder) {
@@ -3613,7 +3613,7 @@  discard block
 block discarded – undo
3613 3613
 						'enabled' => ($object->status == Propal::STATUS_SIGNED && isModEnabled("supplier_order")),
3614 3614
 						'perm' => $usercancreatepurchaseorder,
3615 3615
 						'label' => 'AddPurchaseOrder',
3616
-						'url' => '/fourn/commande/card.php?action=create&origin=' . urlencode($object->element) . '&originid=' . ((int) $object->id) . '&socid=' . ((int) $object->socid)
3616
+						'url' => '/fourn/commande/card.php?action=create&origin='.urlencode($object->element).'&originid='.((int) $object->id).'&socid='.((int) $object->socid)
3617 3617
 					);
3618 3618
 					/*if ($object->status == Propal::STATUS_SIGNED && isModEnabled("supplier_order")) {
3619 3619
 						if ($usercancreatepurchaseorder) {
@@ -3628,7 +3628,7 @@  discard block
 block discarded – undo
3628 3628
 					'enabled' => (isModEnabled("service") && isModEnabled('intervention') && $object->status == Propal::STATUS_SIGNED),
3629 3629
 					'perm' => $usercancreateintervention,
3630 3630
 					'label' => 'AddIntervention',
3631
-					'url' => '/fichinter/card.php?action=create&origin=' . urlencode($object->element) . '&originid=' . ((int) $object->id) . '&socid=' . ((int) $object->socid)
3631
+					'url' => '/fichinter/card.php?action=create&origin='.urlencode($object->element).'&originid='.((int) $object->id).'&socid='.((int) $object->socid)
3632 3632
 				);
3633 3633
 				/*if (isModEnabled("service") && isModEnabled('intervention') && $object->status == Propal::STATUS_SIGNED) {
3634 3634
 					if ($usercancreateintervention) {
@@ -3643,7 +3643,7 @@  discard block
 block discarded – undo
3643 3643
 					'enabled' => (isModEnabled('contract') && $object->status == Propal::STATUS_SIGNED),
3644 3644
 					'perm' => $usercancreatecontract,
3645 3645
 					'label' => 'AddContract',
3646
-					'url' => '/contrat/card.php?action=create&origin=' . urlencode($object->element) . '&originid=' . ((int) $object->id) . '&socid=' . ((int) $object->socid)
3646
+					'url' => '/contrat/card.php?action=create&origin='.urlencode($object->element).'&originid='.((int) $object->id).'&socid='.((int) $object->socid)
3647 3647
 				);
3648 3648
 				/*if (isModEnabled('contract') && $object->status == Propal::STATUS_SIGNED) {
3649 3649
 					$langs->load("contracts");
@@ -3660,7 +3660,7 @@  discard block
 block discarded – undo
3660 3660
 						'enabled' => isModEnabled('invoice'),
3661 3661
 						'perm' => $usercancreateinvoice,
3662 3662
 						'label' => 'CreateBill',
3663
-						'url' => '/compta/facture/card.php?action=create&origin=' . urlencode($object->element) . '&originid=' . ((int) $object->id) . '&socid=' . ((int) $object->socid),
3663
+						'url' => '/compta/facture/card.php?action=create&origin='.urlencode($object->element).'&originid='.((int) $object->id).'&socid='.((int) $object->socid),
3664 3664
 					];
3665 3665
 					/*if (isModEnabled('invoice') && $usercancreateinvoice) {
3666 3666
 						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>';
@@ -3669,7 +3669,7 @@  discard block
 block discarded – undo
3669 3669
 
3670 3670
 				$actionButtonsParameters = [
3671 3671
 					"areDropdownButtons" => !getDolGlobalInt("MAIN_REMOVE_DROPDOWN_CREATE_BUTTONS_ON_ORDER"),
3672
-					"backtopage" => $_SERVER["PHP_SELF"] . "?id=" . ((int) $id)
3672
+					"backtopage" => $_SERVER["PHP_SELF"]."?id=".((int) $id)
3673 3673
 				];
3674 3674
 
3675 3675
 				if ($numlines > 0) {
@@ -3682,9 +3682,9 @@  discard block
 block discarded – undo
3682 3682
 					$arrayofinvoiceforpropal = $object->getInvoiceArrayList();
3683 3683
 					if ((is_array($arrayofinvoiceforpropal) && count($arrayofinvoiceforpropal) > 0) || !getDolGlobalString('WORKFLOW_PROPAL_NEED_INVOICE_TO_BE_CLASSIFIED_BILLED')) {
3684 3684
 						if ($usercanclose) {
3685
-							print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=classifybilled&token=' . newToken() . '&socid=' . $object->socid . '">' . $langs->trans("ClassifyBilled") . '</a>';
3685
+							print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=classifybilled&token='.newToken().'&socid='.$object->socid.'">'.$langs->trans("ClassifyBilled").'</a>';
3686 3686
 						} else {
3687
-							print '<a class="butActionRefused classfortooltip" href="#" title="' . $langs->trans("NotEnoughPermissions") . '">' . $langs->trans("ClassifyBilled") . '</a>';
3687
+							print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("NotEnoughPermissions").'">'.$langs->trans("ClassifyBilled").'</a>';
3688 3688
 						}
3689 3689
 					}
3690 3690
 				}
@@ -3693,33 +3693,33 @@  discard block
 block discarded – undo
3693 3693
 					// Close as accepted/refused
3694 3694
 					if ($object->status == Propal::STATUS_VALIDATED) {
3695 3695
 						if ($usercanclose) {
3696
-							print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=closeas&token=' . newToken() . (!getDolGlobalString('MAIN_JUMP_TAG') ? '' : '#close') . '"';
3697
-							print '>' . $langs->trans('SetAcceptedRefused') . '</a>';
3696
+							print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=closeas&token='.newToken().(!getDolGlobalString('MAIN_JUMP_TAG') ? '' : '#close').'"';
3697
+							print '>'.$langs->trans('SetAcceptedRefused').'</a>';
3698 3698
 						} else {
3699
-							print '<a class="butActionRefused classfortooltip" href="#" title="' . $langs->trans("NotEnoughPermissions") . '"';
3700
-							print '>' . $langs->trans('SetAcceptedRefused') . '</a>';
3699
+							print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("NotEnoughPermissions").'"';
3700
+							print '>'.$langs->trans('SetAcceptedRefused').'</a>';
3701 3701
 						}
3702 3702
 					}
3703 3703
 				} else {
3704 3704
 					// Set not signed (close)
3705 3705
 					if ($object->status == Propal::STATUS_DRAFT && $usercanclose) {
3706
-						print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&token=' . newToken() . '&action=closeas&token=' . newToken() . (!getDolGlobalString('MAIN_JUMP_TAG') ? '' : '#close') . '"';
3707
-						print '>' . $langs->trans('SetRefusedAndClose') . '</a>';
3706
+						print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&token='.newToken().'&action=closeas&token='.newToken().(!getDolGlobalString('MAIN_JUMP_TAG') ? '' : '#close').'"';
3707
+						print '>'.$langs->trans('SetRefusedAndClose').'</a>';
3708 3708
 					}
3709 3709
 				}
3710 3710
 
3711 3711
 				// Cancel propal
3712 3712
 				if ($object->status > Propal::STATUS_DRAFT && $usercanclose) {
3713
-					print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=cancel&token=' . newToken() . '">' . $langs->trans("CancelPropal") . '</a>';
3713
+					print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=cancel&token='.newToken().'">'.$langs->trans("CancelPropal").'</a>';
3714 3714
 				}
3715 3715
 
3716 3716
 				// Clone
3717 3717
 				if ($usercancreate) {
3718
-					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>';
3718
+					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>';
3719 3719
 				}
3720 3720
 
3721 3721
 				// Delete
3722
-				print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=delete&token=' . newToken(), 'delete', $usercandelete);
3722
+				print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', $usercandelete);
3723 3723
 			}
3724 3724
 		}
3725 3725
 
@@ -3738,8 +3738,8 @@  discard block
 block discarded – undo
3738 3738
 		 * Generated documents
3739 3739
 		 */
3740 3740
 		$objref = dol_sanitizeFileName($object->ref);
3741
-		$filedir = $conf->propal->multidir_output[$object->entity ?? $conf->entity] . "/" . dol_sanitizeFileName($object->ref);
3742
-		$urlsource = $_SERVER["PHP_SELF"] . "?id=" . $object->id;
3741
+		$filedir = $conf->propal->multidir_output[$object->entity ?? $conf->entity]."/".dol_sanitizeFileName($object->ref);
3742
+		$urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id;
3743 3743
 		$genallowed = $usercanread;
3744 3744
 		$delallowed = $usercancreate;
3745 3745
 		$tooltipAfterComboOfModels = '';
@@ -3766,19 +3766,19 @@  discard block
 block discarded – undo
3766 3766
 
3767 3767
 		if ($object->status != Propal::STATUS_DRAFT && $useonlinesignature) {
3768 3768
 			print '<br><!-- Link to sign -->';
3769
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/signature.lib.php';
3770
-			print showOnlineSignatureUrl('proposal', $object->ref, $object) . '<br>';
3769
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/signature.lib.php';
3770
+			print showOnlineSignatureUrl('proposal', $object->ref, $object).'<br>';
3771 3771
 		}
3772 3772
 
3773 3773
 		print '</div><div class="fichehalfright">';
3774 3774
 
3775 3775
 		$MAXEVENT = 10;
3776 3776
 
3777
-		$morehtmlcenter = dolGetButtonTitle($langs->trans('FullConversation'), '', 'fa fa-comments imgforviewmode', DOL_URL_ROOT . '/comm/propal/messaging.php?id=' . $object->id);
3778
-		$morehtmlcenter .= dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', DOL_URL_ROOT . '/comm/propal/agenda.php?id=' . $object->id);
3777
+		$morehtmlcenter = dolGetButtonTitle($langs->trans('FullConversation'), '', 'fa fa-comments imgforviewmode', DOL_URL_ROOT.'/comm/propal/messaging.php?id='.$object->id);
3778
+		$morehtmlcenter .= dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', DOL_URL_ROOT.'/comm/propal/agenda.php?id='.$object->id);
3779 3779
 
3780 3780
 		// List of actions on element
3781
-		include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
3781
+		include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
3782 3782
 		$formactions = new FormActions($db);
3783 3783
 		$somethingshown = $formactions->showactions($object, 'propal', $socid, 1, '', $MAXEVENT, '', $morehtmlcenter); // Show all action for thirdparty
3784 3784
 
@@ -3789,9 +3789,9 @@  discard block
 block discarded – undo
3789 3789
 	$modelmail = 'propal_send';
3790 3790
 	$defaulttopic = 'SendPropalRef';
3791 3791
 	$diroutput = $conf->propal->multidir_output[$object->entity ?? $conf->entity];
3792
-	$trackid = 'pro' . $object->id;
3792
+	$trackid = 'pro'.$object->id;
3793 3793
 
3794
-	include DOL_DOCUMENT_ROOT . '/core/tpl/card_presend.tpl.php';
3794
+	include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php';
3795 3795
 }
3796 3796
 
3797 3797
 // End of page
Please login to merge, or discard this patch.