Completed
Branch develop (c46d20)
by
unknown
12:48
created
htdocs/admin/eventorganization.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -42,13 +42,13 @@  discard block
 block discarded – undo
42 42
 
43 43
 $value = GETPOST('value', 'alpha');
44 44
 $label = GETPOST('label', 'alpha');
45
-$modulepart = GETPOST('modulepart', 'aZ09');	// Used by actions_setmoduleoptions.inc.php
45
+$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php
46 46
 
47 47
 $scandir = GETPOST('scan_dir', 'alpha');
48 48
 $type = 'myobject';
49 49
 
50 50
 $arrayofparameters = array(
51
-	'EVENTORGANIZATION_TASK_LABEL' => array('type' => 'textarea','enabled' => 1, 'css' => ''),
51
+	'EVENTORGANIZATION_TASK_LABEL' => array('type' => 'textarea', 'enabled' => 1, 'css' => ''),
52 52
 	'EVENTORGANIZATION_CATEG_THIRDPARTY_CONF' => array('type' => 'category:'.Categorie::TYPE_CUSTOMER, 'enabled' => 1, 'css' => ''),
53 53
 	'EVENTORGANIZATION_CATEG_THIRDPARTY_BOOTH' => array('type' => 'category:'.Categorie::TYPE_CUSTOMER, 'enabled' => 1, 'css' => ''),
54 54
 	'EVENTORGANIZATION_FILTERATTENDEES_CAT' => array('type' => 'category:'.Categorie::TYPE_CUSTOMER, 'enabled' => 1, 'css' => ''),
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
  */
82 82
 
83 83
 if ($cancel) {
84
-	$action  = '';
84
+	$action = '';
85 85
 }
86 86
 
87 87
 include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
@@ -185,23 +185,23 @@  discard block
 block discarded – undo
185 185
 		if ($val['enabled'] == 1) {
186 186
 			$setupnotempty++;
187 187
 			print '<tr class="oddeven"><td><!-- '.$constname.' -->';
188
-			$tooltiphelp = (($langs->trans($constname . 'Tooltip') != $constname . 'Tooltip') ? $langs->trans($constname . 'Tooltip') : '');
189
-			$tooltiphelp .= (($langs->trans($constname . 'Tooltip2') && $langs->trans($constname . 'Tooltip2') != $constname . 'Tooltip2') ? '<br><br>'."\n".$langs->trans($constname . 'Tooltip2') : '');
188
+			$tooltiphelp = (($langs->trans($constname.'Tooltip') != $constname.'Tooltip') ? $langs->trans($constname.'Tooltip') : '');
189
+			$tooltiphelp .= (($langs->trans($constname.'Tooltip2') && $langs->trans($constname.'Tooltip2') != $constname.'Tooltip2') ? '<br><br>'."\n".$langs->trans($constname.'Tooltip2') : '');
190 190
 			print '<span id="helplink'.$constname.'" class="spanforparamtooltip">'.$form->textwithpicto($langs->trans($constname), $tooltiphelp, 1, 'info', '', 0, 3, 'tootips'.$constname).'</span>';
191 191
 			print '</td><td>';
192 192
 
193 193
 			if ($val['type'] == 'textarea') {
194
-				print '<textarea class="flat" name="'.$constname.'" id="'.$constname.'" cols="50" rows="5" wrap="soft">' . "\n";
194
+				print '<textarea class="flat" name="'.$constname.'" id="'.$constname.'" cols="50" rows="5" wrap="soft">'."\n";
195 195
 				print getDolGlobalString($constname);
196 196
 				print "</textarea>\n";
197 197
 			} elseif ($val['type'] == 'html') {
198
-				require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php';
198
+				require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
199 199
 				$doleditor = new DolEditor($constname, getDolGlobalString($constname), '', 160, 'dolibarr_notes', '', false, false, isModEnabled('fckeditor'), ROWS_5, '90%');
200 200
 				$doleditor->Create();
201 201
 			} elseif ($val['type'] == 'yesno') {
202 202
 				print $form->selectyesno($constname, getDolGlobalString($constname), 1);
203 203
 			} elseif (preg_match('/emailtemplate:/', $val['type'])) {
204
-				include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php';
204
+				include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
205 205
 				$formmail = new FormMail($db);
206 206
 
207 207
 				$tmp = explode(':', $val['type']);
@@ -213,10 +213,10 @@  discard block
 block discarded – undo
213 213
 						//var_dump($modelmail);
214 214
 						$moreonlabel = '';
215 215
 						if (!empty($arrayofmessagename[$modelmail->label])) {
216
-							$moreonlabel = ' <span class="opacitymedium">(' . $langs->trans("SeveralLangugeVariatFound") . ')</span>';
216
+							$moreonlabel = ' <span class="opacitymedium">('.$langs->trans("SeveralLangugeVariatFound").')</span>';
217 217
 						}
218 218
 						// The 'label' is the key that is unique if we exclude the language
219
-						$arrayofmessagename[$modelmail->id] = $langs->trans(preg_replace('/\(|\)/', '', $modelmail->label)) . $moreonlabel;
219
+						$arrayofmessagename[$modelmail->id] = $langs->trans(preg_replace('/\(|\)/', '', $modelmail->label)).$moreonlabel;
220 220
 					}
221 221
 				}
222 222
 				print $form->selectarray($constname, $arrayofmessagename, getDolGlobalString($constname), 'None', 0, 0, '', 0, 0, 0, '', '', 1);
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
 					print $form->select_produits($selected, $constname, '', 0, 0, 1, 2, '', 0, array(), 0, '1', 0, 'maxwidth500 widthcentpercentminusx', 0, '', null, 1);
249 249
 				}
250 250
 			} else {
251
-				print '<input name="' . $constname . '"  class="flat ' . (empty($val['css']) ? 'minwidth200' : $val['css']) . '" value="' . getDolGlobalString($constname) . '">';
251
+				print '<input name="'.$constname.'"  class="flat '.(empty($val['css']) ? 'minwidth200' : $val['css']).'" value="'.getDolGlobalString($constname).'">';
252 252
 			}
253 253
 			print '</td></tr>';
254 254
 		}
@@ -269,8 +269,8 @@  discard block
 block discarded – undo
269 269
 				$setupnotempty++;
270 270
 				print '<tr class="oddeven">';
271 271
 				print '<td><!-- '.$constname.' -->';
272
-				$tooltiphelp = (($langs->trans($constname . 'Tooltip') != $constname . 'Tooltip') ? $langs->trans($constname . 'Tooltip') : '');
273
-				$tooltiphelp .= (($langs->trans($constname . 'Tooltip2') && $langs->trans($constname . 'Tooltip2') != $constname . 'Tooltip2') ? '<br><br>'."\n".$langs->trans($constname . 'Tooltip2') : '');
272
+				$tooltiphelp = (($langs->trans($constname.'Tooltip') != $constname.'Tooltip') ? $langs->trans($constname.'Tooltip') : '');
273
+				$tooltiphelp .= (($langs->trans($constname.'Tooltip2') && $langs->trans($constname.'Tooltip2') != $constname.'Tooltip2') ? '<br><br>'."\n".$langs->trans($constname.'Tooltip2') : '');
274 274
 				print $form->textwithpicto($langs->trans($constname), $tooltiphelp);
275 275
 				print '</td><td>';
276 276
 
@@ -282,7 +282,7 @@  discard block
 block discarded – undo
282 282
 					print ajax_constantonoff($constname);
283 283
 				} elseif (preg_match('/emailtemplate:/', $val['type'])) {
284 284
 					if (getDolGlobalString($constname)) {
285
-						include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php';
285
+						include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
286 286
 						$formmail = new FormMail($db);
287 287
 
288 288
 						$tmp = explode(':', $val['type']);
@@ -308,9 +308,9 @@  discard block
 block discarded – undo
308 308
 						$ways = $c->print_all_ways(' &gt;&gt; ', 'none', 0, 1); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text
309 309
 						$toprint = array();
310 310
 						foreach ($ways as $way) {
311
-							$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #bbb"') . '>' . $way . '</li>';
311
+							$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ? ' style="background: #'.$c->color.';"' : ' style="background: #bbb"').'>'.$way.'</li>';
312 312
 						}
313
-						print '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">' . implode(' ', $toprint) . '</ul></div>';
313
+						print '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>';
314 314
 					}
315 315
 				} elseif (preg_match('/thirdparty_type/', $val['type'])) {
316 316
 					if (getDolGlobalString($constname) == 2) {
Please login to merge, or discard this patch.
htdocs/admin/agenda_extsites.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 	} else {
80 80
 		$db->commit();
81 81
 		setEventMessage($langs->trans('SetupSaved'));
82
-		header('Location: ' . $_SERVER["PHP_SELF"]);
82
+		header('Location: '.$_SERVER["PHP_SELF"]);
83 83
 		exit();
84 84
 	}
85 85
 } elseif (preg_match('/del_(.*)/', $action, $reg)) {
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
 	} else {
100 100
 		$db->commit();
101 101
 		setEventMessage($langs->trans('SetupSaved'));
102
-		header('Location: ' . $_SERVER["PHP_SELF"]);
102
+		header('Location: '.$_SERVER["PHP_SELF"]);
103 103
 		exit();
104 104
 	}
105 105
 } elseif ($action == 'save') {
@@ -242,7 +242,7 @@  discard block
 block discarded – undo
242 242
 print '<tr class="oddeven">';
243 243
 print "<td>".$langs->trans("ExtSitesNbOfAgenda")."</td>";
244 244
 print '<td class="center">';
245
-print '<input class="flat hideifnotset width50 center" type="text" id="AGENDA_EXT_NB" name="AGENDA_EXT_NB" value="' . getDolGlobalString('AGENDA_EXT_NB').'">';
245
+print '<input class="flat hideifnotset width50 center" type="text" id="AGENDA_EXT_NB" name="AGENDA_EXT_NB" value="'.getDolGlobalString('AGENDA_EXT_NB').'">';
246 246
 print "</td>";
247 247
 print "</tr>";
248 248
 
@@ -264,36 +264,36 @@  discard block
 block discarded – undo
264 264
 $i = 1;
265 265
 while ($i <= $MAXAGENDA) {
266 266
 	$key = $i;
267
-	$name = 'AGENDA_EXT_NAME' . $key;
268
-	$src = 'AGENDA_EXT_SRC' . $key;
269
-	$offsettz = 'AGENDA_EXT_OFFSETTZ' . $key;
270
-	$color = 'AGENDA_EXT_COLOR' . $key;
271
-	$enabled = 'AGENDA_EXT_ENABLED' . $key;
272
-	$default = 'AGENDA_EXT_ACTIVEBYDEFAULT' . $key;
267
+	$name = 'AGENDA_EXT_NAME'.$key;
268
+	$src = 'AGENDA_EXT_SRC'.$key;
269
+	$offsettz = 'AGENDA_EXT_OFFSETTZ'.$key;
270
+	$color = 'AGENDA_EXT_COLOR'.$key;
271
+	$enabled = 'AGENDA_EXT_ENABLED'.$key;
272
+	$default = 'AGENDA_EXT_ACTIVEBYDEFAULT'.$key;
273 273
 
274 274
 	print '<tr class="oddeven">';
275 275
 	// Nb  @phan-suppress-next-line PhanPluginSuspiciousParamPosition
276
-	print '<td width="180" class="nowrap">' . $langs->trans("AgendaExtNb", $key) . "</td>";
276
+	print '<td width="180" class="nowrap">'.$langs->trans("AgendaExtNb", $key)."</td>";
277 277
 	// Name
278
-	print '<td><input type="text" class="flat hideifnotset" name="AGENDA_EXT_NAME' . $key . '" value="' . (GETPOST('AGENDA_EXT_NAME' . $key) ? GETPOST('AGENDA_EXT_NAME' . $key, 'alpha') : getDolGlobalString($name)) . '" size="28"></td>';
278
+	print '<td><input type="text" class="flat hideifnotset" name="AGENDA_EXT_NAME'.$key.'" value="'.(GETPOST('AGENDA_EXT_NAME'.$key) ? GETPOST('AGENDA_EXT_NAME'.$key, 'alpha') : getDolGlobalString($name)).'" size="28"></td>';
279 279
 	// URL
280
-	print '<td><input type="url" class="flat hideifnotset" name="AGENDA_EXT_SRC' . $key . '" value="' . (GETPOST('AGENDA_EXT_SRC' . $key) ? GETPOST('AGENDA_EXT_SRC' . $key, 'alpha') : getDolGlobalString($src)) . '" size="60"></td>';
280
+	print '<td><input type="url" class="flat hideifnotset" name="AGENDA_EXT_SRC'.$key.'" value="'.(GETPOST('AGENDA_EXT_SRC'.$key) ? GETPOST('AGENDA_EXT_SRC'.$key, 'alpha') : getDolGlobalString($src)).'" size="60"></td>';
281 281
 	// Offset TZ
282
-	print '<td><input type="text" class="flat hideifnotset" name="AGENDA_EXT_OFFSETTZ' . $key . '" value="' . (GETPOST('AGENDA_EXT_OFFSETTZ' . $key) ? GETPOST('AGENDA_EXT_OFFSETTZ' . $key) : getDolGlobalString($offsettz)) . '" size="2"></td>';
282
+	print '<td><input type="text" class="flat hideifnotset" name="AGENDA_EXT_OFFSETTZ'.$key.'" value="'.(GETPOST('AGENDA_EXT_OFFSETTZ'.$key) ? GETPOST('AGENDA_EXT_OFFSETTZ'.$key) : getDolGlobalString($offsettz)).'" size="2"></td>';
283 283
 	// Color (Possible colors are limited by Google)
284 284
 	print '<td class="nowraponall right">';
285
-	print $formother->selectColor((GETPOST("AGENDA_EXT_COLOR" . $key) ? GETPOST("AGENDA_EXT_COLOR" . $key) : getDolGlobalString($color)), "AGENDA_EXT_COLOR" . $key, 'extsitesconfig', 1, '', 'hideifnotset');
285
+	print $formother->selectColor((GETPOST("AGENDA_EXT_COLOR".$key) ? GETPOST("AGENDA_EXT_COLOR".$key) : getDolGlobalString($color)), "AGENDA_EXT_COLOR".$key, 'extsitesconfig', 1, '', 'hideifnotset');
286 286
 	print '</td>';
287 287
 	// Calendar active by default
288 288
 	print '<td class="nowrap right">';
289 289
 	if (!empty($conf->use_javascript_ajax)) {
290
-		print ajax_constantonoff('AGENDA_EXT_ACTIVEBYDEFAULT' . $key);
290
+		print ajax_constantonoff('AGENDA_EXT_ACTIVEBYDEFAULT'.$key);
291 291
 	} else {
292 292
 		// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
293 293
 		if (getDolGlobalString($default)) {
294
-			print '<a href="' . $_SERVER['PHP_SELF'] . '?action=del_AGENDA_EXT_ACTIVEBYDEFAULT' . $key . '&token='.newToken().'">' . img_picto($langs->trans("Disabled"), 'off') . '</a>';
294
+			print '<a href="'.$_SERVER['PHP_SELF'].'?action=del_AGENDA_EXT_ACTIVEBYDEFAULT'.$key.'&token='.newToken().'">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
295 295
 		} else {
296
-			print '<a href="' . $_SERVER['PHP_SELF'] . '?action=set_AGENDA_EXT_ACTIVEBYDEFAULT' . $key . '&token='.newToken().'">' . img_picto($langs->trans("Enabled"), 'on') . '</a>';
296
+			print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_AGENDA_EXT_ACTIVEBYDEFAULT'.$key.'&token='.newToken().'">'.img_picto($langs->trans("Enabled"), 'on').'</a>';
297 297
 		}
298 298
 	}
299 299
 	print '</td>';
Please login to merge, or discard this patch.
htdocs/webportal/class/html.formlistwebportal.class.php 1 patch
Spacing   +76 added lines, -76 removed lines patch added patch discarded remove patch
@@ -26,9 +26,9 @@  discard block
 block discarded – undo
26 26
  * \brief      File of class with all html predefined components for WebPortal
27 27
  */
28 28
 
29
-require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
30
-require_once DOL_DOCUMENT_ROOT . '/core/class/discount.class.php';
31
-require_once DOL_DOCUMENT_ROOT . '/webportal/class/html.formwebportal.class.php';
29
+require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
30
+require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php';
31
+require_once DOL_DOCUMENT_ROOT.'/webportal/class/html.formwebportal.class.php';
32 32
 
33 33
 /**
34 34
  *    Class to manage generation of HTML components
@@ -135,10 +135,10 @@  discard block
 block discarded – undo
135 135
 		}
136 136
 
137 137
 		// load module libraries
138
-		dol_include_once('/webportal/class/webportal' . $elementEn . '.class.php');
138
+		dol_include_once('/webportal/class/webportal'.$elementEn.'.class.php');
139 139
 
140 140
 		// Initialize technical objects
141
-		$objectclass = 'WebPortal' . ucfirst($elementEn);
141
+		$objectclass = 'WebPortal'.ucfirst($elementEn);
142 142
 		$object = new $objectclass($this->db);
143 143
 
144 144
 		// set form list
@@ -148,18 +148,18 @@  discard block
 block discarded – undo
148 148
 		$this->sortfield = GETPOST('sortfield', 'aZ09comma');
149 149
 		$this->sortorder = GETPOST('sortorder', 'aZ09comma');
150 150
 		$this->page = GETPOSTISSET('page') ? GETPOSTINT('page') : 1;
151
-		$this->titleKey = $objectclass . 'ListTitle';
151
+		$this->titleKey = $objectclass.'ListTitle';
152 152
 
153 153
 		// Initialize array of search criteria
154 154
 		//$search_all = GETPOST('search_all', 'alphanohtml');
155 155
 		$search = array();
156 156
 		foreach ($object->fields as $key => $val) {
157
-			if (GETPOST('search_' . $key, 'alpha') !== '') {
158
-				$search[$key] = GETPOST('search_' . $key, 'alpha');
157
+			if (GETPOST('search_'.$key, 'alpha') !== '') {
158
+				$search[$key] = GETPOST('search_'.$key, 'alpha');
159 159
 			}
160 160
 			if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) {
161
-				$postDateStart = GETPOST('search_' . $key . '_dtstart', 'alphanohtml');
162
-				$postDateEnd = GETPOST('search_' . $key . '_dtend', 'alphanohtml');
161
+				$postDateStart = GETPOST('search_'.$key.'_dtstart', 'alphanohtml');
162
+				$postDateEnd = GETPOST('search_'.$key.'_dtend', 'alphanohtml');
163 163
 				// extract date YYYY-MM-DD for year, month and day
164 164
 				$dateStartArr = explode('-', $postDateStart);
165 165
 				$dateEndArr = explode('-', $postDateEnd);
@@ -167,13 +167,13 @@  discard block
 block discarded – undo
167 167
 					$dateStartYear = (int) $dateStartArr[0];
168 168
 					$dateStartMonth = (int) $dateStartArr[1];
169 169
 					$dateStartDay = (int) $dateStartArr[2];
170
-					$search[$key . '_dtstart'] = dol_mktime(0, 0, 0, $dateStartMonth, $dateStartDay, $dateStartYear);
170
+					$search[$key.'_dtstart'] = dol_mktime(0, 0, 0, $dateStartMonth, $dateStartDay, $dateStartYear);
171 171
 				}
172 172
 				if (count($dateEndArr) == 3) {
173 173
 					$dateEndYear = (int) $dateEndArr[0];
174 174
 					$dateEndMonth = (int) $dateEndArr[1];
175 175
 					$dateEndDay = (int) $dateEndArr[2];
176
-					$search[$key . '_dtend'] = dol_mktime(23, 59, 59, $dateEndMonth, $dateEndDay, $dateEndYear);
176
+					$search[$key.'_dtend'] = dol_mktime(23, 59, 59, $dateEndMonth, $dateEndDay, $dateEndYear);
177 177
 				}
178 178
 			}
179 179
 		}
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
 			// If $val['visible']==0, then we never show the field
189 189
 			if (!empty($val['visible'])) {
190 190
 				$visible = (int) dol_eval($val['visible'], 1);
191
-				$arrayfields['t.' . $key] = array(
191
+				$arrayfields['t.'.$key] = array(
192 192
 					'label' => $val['label'],
193 193
 					'checked' => (($visible < 0) ? 0 : 1),
194 194
 					'enabled' => (abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)),
@@ -224,8 +224,8 @@  discard block
 block discarded – undo
224 224
 			foreach ($object->fields as $key => $val) {
225 225
 				$search[$key] = '';
226 226
 				if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) {
227
-					$search[$key . '_dtstart'] = '';
228
-					$search[$key . '_dtend'] = '';
227
+					$search[$key.'_dtstart'] = '';
228
+					$search[$key.'_dtend'] = '';
229 229
 				}
230 230
 			}
231 231
 			$this->search = $search;
@@ -280,7 +280,7 @@  discard block
 block discarded – undo
280 280
 		$offset = $limit * ($page - 1);
281 281
 		if (!$sortfield) {
282 282
 			reset($object->fields); // Reset is required to avoid key() to return null.
283
-			$sortfield = 't.' . key($object->fields); // Set here default search field. By default 1st field in definition.
283
+			$sortfield = 't.'.key($object->fields); // Set here default search field. By default 1st field in definition.
284 284
 		}
285 285
 		if (!$sortorder) {
286 286
 			$sortorder = 'DESC';
@@ -301,18 +301,18 @@  discard block
 block discarded – undo
301 301
 
302 302
 		$sqlfields = $sql; // $sql fields to remove for count total
303 303
 
304
-		$sql .= " FROM " . $this->db->prefix() . $object->table_element . " as t";
304
+		$sql .= " FROM ".$this->db->prefix().$object->table_element." as t";
305 305
 		// Add table from hooks
306
-		$parameters = array();  // @phan-suppress-current-line PhanPluginRedundantAssignment
306
+		$parameters = array(); // @phan-suppress-current-line PhanPluginRedundantAssignment
307 307
 		$reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
308 308
 		$sql .= $hookmanager->resPrint;
309 309
 		if ($object->ismultientitymanaged == 1) {
310
-			$sql .= " WHERE t.entity IN (" . getEntity($object->element, (GETPOSTINT('search_current_entity') ? 0 : 1)) . ")";
310
+			$sql .= " WHERE t.entity IN (".getEntity($object->element, (GETPOSTINT('search_current_entity') ? 0 : 1)).")";
311 311
 		} else {
312 312
 			$sql .= " WHERE 1 = 1";
313 313
 		}
314 314
 		// filter on logged third-party
315
-		$sql .= " AND t.fk_soc = " . ((int) $socid);
315
+		$sql .= " AND t.fk_soc = ".((int) $socid);
316 316
 		// discard record with status draft
317 317
 		$sql .= " AND t.fk_statut <> 0";
318 318
 
@@ -329,17 +329,17 @@  discard block
 block discarded – undo
329 329
 					$mode_search = 2;
330 330
 				}
331 331
 				if ($search[$key] != '') {
332
-					$sql .= natural_search("t." . $this->db->escape($key), $search[$key], (($key == 'status' || $key == 'fk_statut') ? ($search[$key] < 0 ? 1 : 2) : $mode_search));
332
+					$sql .= natural_search("t.".$this->db->escape($key), $search[$key], (($key == 'status' || $key == 'fk_statut') ? ($search[$key] < 0 ? 1 : 2) : $mode_search));
333 333
 				}
334 334
 			} else {
335 335
 				if (preg_match('/(_dtstart|_dtend)$/', $key) && $search[$key] != '') {
336 336
 					$columnName = preg_replace('/(_dtstart|_dtend)$/', '', $key);
337 337
 					if (preg_match('/^(date|timestamp|datetime)/', $object->fields[$columnName]['type'])) {
338 338
 						if (preg_match('/_dtstart$/', $key)) {
339
-							$sql .= " AND t." . $this->db->escape($columnName) . " >= '" . $this->db->idate($search[$key]) . "'";
339
+							$sql .= " AND t.".$this->db->escape($columnName)." >= '".$this->db->idate($search[$key])."'";
340 340
 						}
341 341
 						if (preg_match('/_dtend$/', $key)) {
342
-							$sql .= " AND t." . $this->db->escape($columnName) . " <= '" . $this->db->idate($search[$key]) . "'";
342
+							$sql .= " AND t.".$this->db->escape($columnName)." <= '".$this->db->idate($search[$key])."'";
343 343
 						}
344 344
 					}
345 345
 				}
@@ -349,7 +349,7 @@  discard block
 block discarded – undo
349 349
 		//    $sql .= natural_search(array_keys($fieldstosearchall), $search_all);
350 350
 		//}
351 351
 		// Add where from hooks
352
-		$parameters = array();  // @phan-suppress-current-line PhanPluginRedundantAssignment
352
+		$parameters = array(); // @phan-suppress-current-line PhanPluginRedundantAssignment
353 353
 		$reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
354 354
 		$sql .= $hookmanager->resPrint;
355 355
 
@@ -357,7 +357,7 @@  discard block
 block discarded – undo
357 357
 		$nbtotalofrecords = 0;
358 358
 		if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
359 359
 			/* The fast and low memory method to get and count full list converts the sql into a sql count */
360
-			$sqlforcount = preg_replace('/^' . preg_quote($sqlfields, '/') . '/', 'SELECT COUNT(*) as nbtotalofrecords', $sql);
360
+			$sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql);
361 361
 			$sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount);
362 362
 			$resql = $this->db->query($sqlforcount);
363 363
 			if ($resql) {
@@ -410,52 +410,52 @@  discard block
 block discarded – undo
410 410
 		}
411 411
 
412 412
 		$param = '';
413
-		$param .= '&contextpage=' . urlencode($contextpage);
414
-		$param .= '&limit=' . $limit;
413
+		$param .= '&contextpage='.urlencode($contextpage);
414
+		$param .= '&limit='.$limit;
415 415
 		foreach ($search as $key => $val) {
416 416
 			if (is_array($search[$key])) {
417 417
 				foreach ($search[$key] as $skey) {
418 418
 					if ($skey != '') {
419
-						$param .= '&search_' . $key . '[]=' . urlencode($skey);
419
+						$param .= '&search_'.$key.'[]='.urlencode($skey);
420 420
 					}
421 421
 				}
422 422
 			} elseif (preg_match('/(_dtstart|_dtend)$/', $key) && !empty($val)) {
423
-				$param .= '&search_' . $key . 'month=' . (GETPOSTINT('search_' . $key . 'month'));
424
-				$param .= '&search_' . $key . 'day=' . (GETPOSTINT('search_' . $key . 'day'));
425
-				$param .= '&search_' . $key . 'year=' . (GETPOSTINT('search_' . $key . 'year'));
423
+				$param .= '&search_'.$key.'month='.(GETPOSTINT('search_'.$key.'month'));
424
+				$param .= '&search_'.$key.'day='.(GETPOSTINT('search_'.$key.'day'));
425
+				$param .= '&search_'.$key.'year='.(GETPOSTINT('search_'.$key.'year'));
426 426
 			} elseif ($search[$key] != '') {
427
-				$param .= '&search_' . $key . '=' . urlencode($search[$key]);
427
+				$param .= '&search_'.$key.'='.urlencode($search[$key]);
428 428
 			}
429 429
 		}
430 430
 		// Add $param from hooks
431
-		$parameters = array();  // @phan-suppress-current-line PhanPluginRedundantAssignment
431
+		$parameters = array(); // @phan-suppress-current-line PhanPluginRedundantAssignment
432 432
 		$reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
433 433
 		$param .= $hookmanager->resPrint;
434 434
 
435 435
 		$url_file = $context->getControllerUrl($context->controller);
436
-		$html .= '<form method="POST" id="searchFormList" action="' . $url_file . '">' . "\n";
436
+		$html .= '<form method="POST" id="searchFormList" action="'.$url_file.'">'."\n";
437 437
 		$html .= $context->getFormToken();
438 438
 		$html .= '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
439 439
 		$html .= '<input type="hidden" name="action" value="list">';
440
-		$html .= '<input type="hidden" name="sortfield" value="' . $sortfield . '">';
441
-		$html .= '<input type="hidden" name="sortorder" value="' . $sortorder . '">';
442
-		$html .= '<input type="hidden" name="page" value="' . $page . '">';
443
-		$html .= '<input type="hidden" name="contextpage" value="' . $contextpage . '">';
440
+		$html .= '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
441
+		$html .= '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
442
+		$html .= '<input type="hidden" name="page" value="'.$page.'">';
443
+		$html .= '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
444 444
 
445 445
 		// pagination
446
-		$pagination_param = $param . '&sortfield=' . $sortfield . '&sortorder=' . $sortorder;
447
-		$html .= '<nav id="webportal-' . $elementEn . '-pagination">';
446
+		$pagination_param = $param.'&sortfield='.$sortfield.'&sortorder='.$sortorder;
447
+		$html .= '<nav id="webportal-'.$elementEn.'-pagination">';
448 448
 		$html .= '<ul>';
449
-		$html .= '<li><strong>' . $langs->trans($titleKey) . '</strong> (' . $nbtotalofrecords . ')</li>';
449
+		$html .= '<li><strong>'.$langs->trans($titleKey).'</strong> ('.$nbtotalofrecords.')</li>';
450 450
 		$html .= '</ul>';
451 451
 
452 452
 		/* Generate pagination list */
453
-		$html .= static::generatePageListNav($url_file . $pagination_param, $nbpages, $page);
453
+		$html .= static::generatePageListNav($url_file.$pagination_param, $nbpages, $page);
454 454
 
455 455
 		$html .= '</nav>';
456 456
 
457 457
 		// table with search filters and column titles
458
-		$html .= '<table id="webportal-' . $elementEn . '-list" responsive="scroll" role="grid">';
458
+		$html .= '<table id="webportal-'.$elementEn.'-list" responsive="scroll" role="grid">';
459 459
 		// title and desc for table
460 460
 		//if ($titleKey != '') {
461 461
 		//    $html .= '<caption id="table-collapse-responsive">';
@@ -479,22 +479,22 @@  discard block
 block discarded – undo
479 479
 		$html .= '</td>';
480 480
 		// }
481 481
 		foreach ($object->fields as $key => $val) {
482
-			if (!empty($arrayfields['t.' . $key]['checked'])) {
483
-				$html .= '<td data-label="' . $arrayfields['t.' . $key]['label'] . '" data-col="'.dol_escape_htmltag($key).'" >';
482
+			if (!empty($arrayfields['t.'.$key]['checked'])) {
483
+				$html .= '<td data-label="'.$arrayfields['t.'.$key]['label'].'" data-col="'.dol_escape_htmltag($key).'" >';
484 484
 				if (!empty($val['arrayofkeyval']) && is_array($val['arrayofkeyval'])) {
485
-					$html .= $this->form->selectarray('search_' . $key, $val['arrayofkeyval'], (isset($search[$key]) ? $search[$key] : ''), $val['notnull'], 0, 0, '', 1, 0, 0, '', '');
485
+					$html .= $this->form->selectarray('search_'.$key, $val['arrayofkeyval'], (isset($search[$key]) ? $search[$key] : ''), $val['notnull'], 0, 0, '', 1, 0, 0, '', '');
486 486
 				} elseif (preg_match('/^(date|timestamp|datetime)/', $val['type'])) {
487
-					$postDateStart = GETPOST('search_' . $key . '_dtstart', 'alphanohtml');
488
-					$postDateEnd = GETPOST('search_' . $key . '_dtend', 'alphanohtml');
487
+					$postDateStart = GETPOST('search_'.$key.'_dtstart', 'alphanohtml');
488
+					$postDateEnd = GETPOST('search_'.$key.'_dtend', 'alphanohtml');
489 489
 
490 490
 					$html .= '<div class="grid">';
491
-					$html .= $this->form->inputDate('search_' . $key . '_dtstart', $postDateStart ? $postDateStart : '', $langs->trans('From'));
491
+					$html .= $this->form->inputDate('search_'.$key.'_dtstart', $postDateStart ? $postDateStart : '', $langs->trans('From'));
492 492
 					$html .= '</div>';
493 493
 					$html .= '<div class="grid">';
494
-					$html .= $this->form->inputDate('search_' . $key . '_dtend', $postDateEnd ? $postDateEnd : '', $langs->trans('to'));
494
+					$html .= $this->form->inputDate('search_'.$key.'_dtend', $postDateEnd ? $postDateEnd : '', $langs->trans('to'));
495 495
 					$html .= '</div>';
496 496
 				} else {
497
-					$html .= '<input type="text" name="search_' . $key . '" value="' . dol_escape_htmltag(isset($search[$key]) ? $search[$key] : '') . '">';
497
+					$html .= '<input type="text" name="search_'.$key.'" value="'.dol_escape_htmltag(isset($search[$key]) ? $search[$key] : '').'">';
498 498
 				}
499 499
 				$html .= '</td>';
500 500
 			}
@@ -505,12 +505,12 @@  discard block
 block discarded – undo
505 505
 		$html .= $hookmanager->resPrint;
506 506
 		// Remain to pay
507 507
 		if (!empty($arrayfields['remain_to_pay']['checked'])) {
508
-			$html .= '<td data-label="' . $arrayfields['remain_to_pay']['label'] . '">';
508
+			$html .= '<td data-label="'.$arrayfields['remain_to_pay']['label'].'">';
509 509
 			$html .= '</td>';
510 510
 		}
511 511
 		// Download link
512 512
 		if (!empty($arrayfields['download_link']['checked'])) {
513
-			$html .= '<td data-label="' . $arrayfields['download_link']['label'] . '">';
513
+			$html .= '<td data-label="'.$arrayfields['download_link']['label'].'">';
514 514
 			$html .= '</td>';
515 515
 		}
516 516
 		$html .= '</tr>';
@@ -528,16 +528,16 @@  discard block
 block discarded – undo
528 528
 		$totalarray['nbfield']++;
529 529
 		// }
530 530
 		foreach ($object->fields as $key => $val) {
531
-			$tableKey = 't.' . $key;
531
+			$tableKey = 't.'.$key;
532 532
 			if (!empty($arrayfields[$tableKey]['checked'])) {
533 533
 				$tableOrder = '';
534 534
 				if (array_key_exists($tableKey, $sortList)) {
535 535
 					$tableOrder = strtolower($sortList[$tableKey]);
536 536
 				}
537
-				$url_param = $url_file . '&sortfield=' . $tableKey . '&sortorder=' . ($tableOrder == 'desc' ? 'asc' : 'desc') . $param;
538
-				$html .= '<th data-col="'.dol_escape_htmltag($key).'"  scope="col"' . ($tableOrder != '' ? ' table-order="' . $tableOrder . '"' : '') . '>';
539
-				$html .= '<a href="' . $url_param . '">';
540
-				$html .= $langs->trans($arrayfields['t.' . $key]['label']);
537
+				$url_param = $url_file.'&sortfield='.$tableKey.'&sortorder='.($tableOrder == 'desc' ? 'asc' : 'desc').$param;
538
+				$html .= '<th data-col="'.dol_escape_htmltag($key).'"  scope="col"'.($tableOrder != '' ? ' table-order="'.$tableOrder.'"' : '').'>';
539
+				$html .= '<a href="'.$url_param.'">';
540
+				$html .= $langs->trans($arrayfields['t.'.$key]['label']);
541 541
 				$html .= '</a>';
542 542
 				$html .= '</th>';
543 543
 				$totalarray['nbfield']++;
@@ -607,13 +607,13 @@  discard block
 block discarded – undo
607 607
 					$remaintopay = 0;
608 608
 				}
609 609
 				if ($object->type == Facture::TYPE_CREDIT_NOTE && $obj->paye == 1 && $discount) {
610
-					$remaincreditnote = $discount->getAvailableDiscounts($companyStatic, '', 'rc.fk_facture_source=' . $object->id);
610
+					$remaincreditnote = $discount->getAvailableDiscounts($companyStatic, '', 'rc.fk_facture_source='.$object->id);
611 611
 					$remaintopay = -$remaincreditnote;
612 612
 				}
613 613
 			}
614 614
 
615 615
 			// Show line of result
616
-			$html .= '<tr data-rowid="' . $object->id . '">';
616
+			$html .= '<tr data-rowid="'.$object->id.'">';
617 617
 			// if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
618 618
 			$html .= '<td class="nowraponall">';
619 619
 			$html .= '</td>';
@@ -622,8 +622,8 @@  discard block
 block discarded – undo
622 622
 			}
623 623
 			// }
624 624
 			foreach ($object->fields as $key => $val) {
625
-				if (!empty($arrayfields['t.' . $key]['checked'])) {
626
-					$html .= '<td class="nowraponall" data-label="' . $arrayfields['t.' . $key]['label'] . '">';
625
+				if (!empty($arrayfields['t.'.$key]['checked'])) {
626
+					$html .= '<td class="nowraponall" data-label="'.$arrayfields['t.'.$key]['label'].'">';
627 627
 					if ($key == 'status' || $key == 'fk_statut') {
628 628
 						if ($elementEn == 'invoice') {
629 629
 							// specific to get invoice status (depends on payment)
@@ -644,21 +644,21 @@  discard block
 block discarded – undo
644 644
 					}
645 645
 					if (!empty($val['isameasure']) && $val['isameasure'] == 1) {
646 646
 						if (!$i) {
647
-							$totalarray['pos'][$totalarray['nbfield']] = 't.' . $key;
647
+							$totalarray['pos'][$totalarray['nbfield']] = 't.'.$key;
648 648
 						}
649 649
 						if (!isset($totalarray['val'])) {
650 650
 							$totalarray['val'] = array();
651 651
 						}
652
-						if (!isset($totalarray['val']['t.' . $key])) {
653
-							$totalarray['val']['t.' . $key] = 0;
652
+						if (!isset($totalarray['val']['t.'.$key])) {
653
+							$totalarray['val']['t.'.$key] = 0;
654 654
 						}
655
-						$totalarray['val']['t.' . $key] += $object->$key;
655
+						$totalarray['val']['t.'.$key] += $object->$key;
656 656
 					}
657 657
 				}
658 658
 			}
659 659
 			// Remain to pay
660 660
 			if (!empty($arrayfields['remain_to_pay']['checked'])) {
661
-				$html .= '<td class="nowraponall" data-label="' . $arrayfields['remain_to_pay']['label'] . '">';
661
+				$html .= '<td class="nowraponall" data-label="'.$arrayfields['remain_to_pay']['label'].'">';
662 662
 				$html .= $this->form->showOutputFieldForObject($object, $arrayfields['remain_to_pay'], 'remain_to_pay', $remaintopay, '');
663 663
 				//$html .= price($remaintopay);
664 664
 				$html .= '</td>';
@@ -669,9 +669,9 @@  discard block
 block discarded – undo
669 669
 			// Download link
670 670
 			if (!empty($arrayfields['download_link']['checked'])) {
671 671
 				$element = $object->element;
672
-				$html .= '<td class="nowraponall" data-label="' . $arrayfields['download_link']['label'] . '">';
672
+				$html .= '<td class="nowraponall" data-label="'.$arrayfields['download_link']['label'].'">';
673 673
 				$filename = dol_sanitizeFileName($obj->ref);
674
-				$filedir = $conf->{$element}->multidir_output[$obj->element_entity] . '/' . dol_sanitizeFileName($obj->ref);
674
+				$filedir = $conf->{$element}->multidir_output[$obj->element_entity].'/'.dol_sanitizeFileName($obj->ref);
675 675
 				$html .= $this->form->getDocumentsLink($element, $filename, $filedir);
676 676
 				$html .= '</td>';
677 677
 				if (!$i) {
@@ -708,7 +708,7 @@  discard block
 block discarded – undo
708 708
 					$html .= '</td>';
709 709
 				} else {
710 710
 					if ($i == 1) {
711
-						$html .= '<td>' . $langs->trans("Total") . '</td>';
711
+						$html .= '<td>'.$langs->trans("Total").'</td>';
712 712
 					} else {
713 713
 						$html .= '<td></td>';
714 714
 					}
@@ -725,7 +725,7 @@  discard block
 block discarded – undo
725 725
 					$colspan++;
726 726
 				}
727 727
 			}
728
-			$html .= '<tr><td colspan="' . $colspan . '"><span class="opacitymedium">' . $langs->trans("NoRecordFound") . '</span></td></tr>';
728
+			$html .= '<tr><td colspan="'.$colspan.'"><span class="opacitymedium">'.$langs->trans("NoRecordFound").'</span></td></tr>';
729 729
 		}
730 730
 
731 731
 		$html .= '</tbody>';
@@ -765,7 +765,7 @@  discard block
 block discarded – undo
765 765
 		$html = '<ul class="pages-nav-list">';
766 766
 
767 767
 		if ($currentPage > 1) {
768
-			$html .= '<li><a class="pages-nav-list__icon --prev" aria-label="' . dol_escape_htmltag($langs->trans('AriaPrevPage')) . '" href="' . $url . $pSep . 'page=' . ($currentPage - 1) . '" ' . ($currentPage <= 1 ? ' disabled' : '') . '></a></li>';
768
+			$html .= '<li><a class="pages-nav-list__icon --prev" aria-label="'.dol_escape_htmltag($langs->trans('AriaPrevPage')).'" href="'.$url.$pSep.'page='.($currentPage - 1).'" '.($currentPage <= 1 ? ' disabled' : '').'></a></li>';
769 769
 		}
770 770
 
771 771
 		$maxPaginItem = min($nbPages, 5);
@@ -773,21 +773,21 @@  discard block
 block discarded – undo
773 773
 		$maxPageNum = min($nbPages, $currentPage + 3);
774 774
 
775 775
 		if ($minPageNum > 1) {
776
-			$html .= '<li><a class="pages-nav-list__link ' . ($currentPage == 1 ? '--active' : '') . '" aria-label="' . dol_escape_htmltag($langs->trans('AriaPageX', 1)) . '" href="' . $url . $pSep . 'page=1" >1</a></li>';
776
+			$html .= '<li><a class="pages-nav-list__link '.($currentPage == 1 ? '--active' : '').'" aria-label="'.dol_escape_htmltag($langs->trans('AriaPageX', 1)).'" href="'.$url.$pSep.'page=1" >1</a></li>';
777 777
 			$html .= '<li>&hellip;</li>';
778 778
 		}
779 779
 
780 780
 		for ($p = $minPageNum; $p <= $maxPageNum; $p++) {
781
-			$html .= '<li><a class="pages-nav-list__link ' . ($currentPage === $p ? '--active' : '') . '" aria-label="' . dol_escape_htmltag($langs->trans('AriaPageX', $p)) . '"  href="' . $url . $pSep . 'page=' . $p . '">' . $p . '</a></li>';
781
+			$html .= '<li><a class="pages-nav-list__link '.($currentPage === $p ? '--active' : '').'" aria-label="'.dol_escape_htmltag($langs->trans('AriaPageX', $p)).'"  href="'.$url.$pSep.'page='.$p.'">'.$p.'</a></li>';
782 782
 		}
783 783
 
784 784
 		if ($maxPaginItem < $nbPages) {
785 785
 			$html .= '<li>&hellip;</li>';
786
-			$html .= '<li><a class="pages-nav-list__link ' . ($currentPage == $nbPages ? '--active' : '') . '" aria-label="' . dol_escape_htmltag($langs->trans('AriaPageX', $nbPages)) . '" href="' . $url . $pSep . 'page=' . $nbPages . '">' . $nbPages . '</a></li>';
786
+			$html .= '<li><a class="pages-nav-list__link '.($currentPage == $nbPages ? '--active' : '').'" aria-label="'.dol_escape_htmltag($langs->trans('AriaPageX', $nbPages)).'" href="'.$url.$pSep.'page='.$nbPages.'">'.$nbPages.'</a></li>';
787 787
 		}
788 788
 
789 789
 		if ($currentPage < $nbPages) {
790
-			$html .= '<li><a class="pages-nav-list__icon --next" aria-label="' . dol_escape_htmltag($langs->trans('AriaNextPage')) . '" href="' . $url . $pSep . 'page=' . ($currentPage + 1) . '" ' . ($currentPage >= $nbPages ? ' disabled' : '') . '></a></li>';
790
+			$html .= '<li><a class="pages-nav-list__icon --next" aria-label="'.dol_escape_htmltag($langs->trans('AriaNextPage')).'" href="'.$url.$pSep.'page='.($currentPage + 1).'" '.($currentPage >= $nbPages ? ' disabled' : '').'></a></li>';
791 791
 		}
792 792
 
793 793
 		$html .= '</ul>';
Please login to merge, or discard this patch.
htdocs/webportal/class/html.formcardwebportal.class.php 1 patch
Spacing   +42 added lines, -42 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
  * \brief      File of class with all html predefined components for WebPortal
26 26
  */
27 27
 
28
-require_once DOL_DOCUMENT_ROOT . '/webportal/class/html.formwebportal.class.php';
28
+require_once DOL_DOCUMENT_ROOT.'/webportal/class/html.formwebportal.class.php';
29 29
 
30 30
 /**
31 31
  *    Class to manage generation of HTML components
@@ -152,15 +152,15 @@  discard block
 block discarded – undo
152 152
 		global $hookmanager, $langs;
153 153
 
154 154
 		$elementEnUpper = strtoupper($elementEn);
155
-		$objectclass = 'WebPortal' . ucfirst($elementEn);
155
+		$objectclass = 'WebPortal'.ucfirst($elementEn);
156 156
 
157
-		$elementCardAccess = getDolGlobalString('WEBPORTAL_' . $elementEnUpper . '_CARD_ACCESS', 'hidden');
157
+		$elementCardAccess = getDolGlobalString('WEBPORTAL_'.$elementEnUpper.'_CARD_ACCESS', 'hidden');
158 158
 		if ($elementCardAccess == 'hidden' || $id <= 0) {
159 159
 			accessforbidden();
160 160
 		}
161 161
 
162 162
 		// load module libraries
163
-		dol_include_once('/webportal/class/webportal' . $elementEn . '.class.php');
163
+		dol_include_once('/webportal/class/webportal'.$elementEn.'.class.php');
164 164
 
165 165
 		// Load translation files required by the page
166 166
 		$langs->loadLangs(array('website', 'other'));
@@ -171,15 +171,15 @@  discard block
 block discarded – undo
171 171
 		$action = GETPOST('action', 'aZ09');
172 172
 		$confirm = GETPOST('confirm', 'alpha');
173 173
 		$cancel = GETPOST('cancel', 'aZ09');
174
-		$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'webportal' . $elementEn . 'card'; // To manage different context of search
175
-		$backtopage = GETPOST('backtopage', 'alpha');                    // if not set, a default page will be used
176
-		$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha');    // if not set, $backtopage will be used
174
+		$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'webportal'.$elementEn.'card'; // To manage different context of search
175
+		$backtopage = GETPOST('backtopage', 'alpha'); // if not set, a default page will be used
176
+		$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); // if not set, $backtopage will be used
177 177
 		$backtopagejsfields = GETPOST('backtopagejsfields', 'alpha');
178 178
 
179 179
 		// Initialize technical objects
180 180
 		$object = new $objectclass($this->db);
181 181
 		//$extrafields = new ExtraFields($db);
182
-		$hookmanager->initHooks(array('webportal' . $elementEn . 'card', 'globalcard')); // Note that conf->hooks_modules contains array
182
+		$hookmanager->initHooks(array('webportal'.$elementEn.'card', 'globalcard')); // Note that conf->hooks_modules contains array
183 183
 
184 184
 		// Fetch optionals attributes and labels
185 185
 		//$extrafields->fetch_name_optionals_label($object->table_element);
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
 		}
191 191
 
192 192
 		// Load object
193
-		include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be include, not include_once.
193
+		include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once.
194 194
 
195 195
 		// Security check (enable the most restrictive one)
196 196
 		if (!isModEnabled('webportal')) {
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
 		$this->permissiontodelete = $permissiontodelete;
215 215
 		$this->permissionnote = $permissionnote;
216 216
 		$this->permissiondellink = $permissiondellink;
217
-		$this->titleKey = $objectclass . 'CardTitle';
217
+		$this->titleKey = $objectclass.'CardTitle';
218 218
 		$this->ref = $ref;
219 219
 	}
220 220
 
@@ -247,17 +247,17 @@  discard block
 block discarded – undo
247 247
 
248 248
 		if (empty($backtopage) || ($cancel && empty($id))) {
249 249
 			if (empty($backtopage) || ($cancel && strpos($backtopage, '__ID__'))) {
250
-				$backtopage = $context->getControllerUrl($elementEn . 'card');
250
+				$backtopage = $context->getControllerUrl($elementEn.'card');
251 251
 			}
252 252
 		}
253 253
 
254 254
 		// Action to cancel record
255 255
 		if ($cancel) {
256 256
 			if (!empty($backtopageforcancel)) {
257
-				header("Location: " . $backtopageforcancel);
257
+				header("Location: ".$backtopageforcancel);
258 258
 				exit;
259 259
 			} elseif (!empty($backtopage)) {
260
-				header("Location: " . $backtopage);
260
+				header("Location: ".$backtopage);
261 261
 				exit;
262 262
 			}
263 263
 			$action = '';
@@ -268,7 +268,7 @@  discard block
 block discarded – undo
268 268
 			foreach ($object->fields as $key => $val) {
269 269
 				// Check if field was submitted to be edited
270 270
 				if ($object->fields[$key]['type'] == 'duration') {
271
-					if (!GETPOSTISSET($key . 'hour') || !GETPOSTISSET($key . 'min')) {
271
+					if (!GETPOSTISSET($key.'hour') || !GETPOSTISSET($key.'min')) {
272 272
 						continue; // The field was not submitted to be saved
273 273
 					}
274 274
 				} elseif ($object->fields[$key]['type'] == 'boolean') {
@@ -319,7 +319,7 @@  discard block
 block discarded – undo
319 319
 						$dateDay = (int) $dateArr[2];
320 320
 					}
321 321
 					// extract time HH:ii:ss for hours, minutes and seconds
322
-					$postTime = GETPOST($key . '_time', 'alphanohtml');
322
+					$postTime = GETPOST($key.'_time', 'alphanohtml');
323 323
 					$timeArr = explode(':', $postTime);
324 324
 					$timeHours = 12;
325 325
 					$timeMinutes = 0;
@@ -337,8 +337,8 @@  discard block
 block discarded – undo
337 337
 					}
338 338
 					$value = dol_mktime($timeHours, $timeMinutes, $timeSeconds, $dateMonth, $dateDay, $dateYear);
339 339
 				} elseif ($object->fields[$key]['type'] == 'duration') {
340
-					if (GETPOSTINT($key . 'hour') != '' || GETPOSTINT($key . 'min') != '') {
341
-						$value = 60 * 60 * GETPOSTINT($key . 'hour') + 60 * GETPOSTINT($key . 'min');
340
+					if (GETPOSTINT($key.'hour') != '' || GETPOSTINT($key.'min') != '') {
341
+						$value = 60 * 60 * GETPOSTINT($key.'hour') + 60 * GETPOSTINT($key.'min');
342 342
 					} else {
343 343
 						$value = '';
344 344
 					}
@@ -407,7 +407,7 @@  discard block
 block discarded – undo
407 407
 					$urltogo = $backtopage ? str_replace('__ID__', $result, $backtopage) : $backurlforlist;
408 408
 					$urltogo = preg_replace('/--IDFORBACKTOPAGE--/', (string) $object->id, $urltogo); // New method to autoselect project after a New on another form object creation
409 409
 					if ($urltogo && empty($noback)) {
410
-						header("Location: " . $urltogo);
410
+						header("Location: ".$urltogo);
411 411
 						exit;
412 412
 					}
413 413
 				} else {
@@ -474,7 +474,7 @@  discard block
 block discarded – undo
474 474
 		// main information - begin
475 475
 		$html .= '<div class="header-card-main-information inline-block valignmiddle">';
476 476
 		// ref
477
-		$html .= '<div><strong>' . $langs->trans("Ref").' : '.dol_escape_htmltag($object->ref) . '</strong></div>';
477
+		$html .= '<div><strong>'.$langs->trans("Ref").' : '.dol_escape_htmltag($object->ref).'</strong></div>';
478 478
 		// full name
479 479
 		$fullname = '';
480 480
 		if (method_exists($object, 'getFullName')) {
@@ -484,11 +484,11 @@  discard block
 block discarded – undo
484 484
 		if ($object->element == 'member') {
485 485
 			if ($object->morphy == 'mor' && !empty($object->societe)) {
486 486
 				$html .= dol_htmlentities($object->societe);
487
-				$html .= (!empty($fullname) && $object->societe != $fullname) ? ' (' . dol_htmlentities($fullname) . $addgendertxt . ')' : '';
487
+				$html .= (!empty($fullname) && $object->societe != $fullname) ? ' ('.dol_htmlentities($fullname).$addgendertxt.')' : '';
488 488
 			} else {
489
-				$html .= dol_htmlentities($fullname) . $addgendertxt;
489
+				$html .= dol_htmlentities($fullname).$addgendertxt;
490 490
 				if (empty($object->fk_soc)) {
491
-					$html .= (!empty($object->societe) && $object->societe != $fullname) ? ' (' . dol_htmlentities($object->societe) . ')' : '';
491
+					$html .= (!empty($object->societe) && $object->societe != $fullname) ? ' ('.dol_htmlentities($object->societe).')' : '';
492 492
 				}
493 493
 			}
494 494
 		} else {
@@ -578,23 +578,23 @@  discard block
 block discarded – undo
578 578
 
579 579
 			$value = $object->$key;
580 580
 
581
-			$html .= '<div class="grid field_' . $key . '">';
581
+			$html .= '<div class="grid field_'.$key.'">';
582 582
 
583
-			$html .= '<div class="' . (empty($val['tdcss']) ? '' : $val['tdcss']) . ' fieldname_' . $key;
583
+			$html .= '<div class="'.(empty($val['tdcss']) ? '' : $val['tdcss']).' fieldname_'.$key;
584 584
 			$html .= '">';
585 585
 			$labeltoshow = '';
586
-			$labeltoshow .= '<strong>' . $langs->trans($val['label']) . '</strong>';
586
+			$labeltoshow .= '<strong>'.$langs->trans($val['label']).'</strong>';
587 587
 			$html .= $labeltoshow;
588 588
 			$html .= '</div>';
589 589
 
590
-			$html .= '<div class="valuefield fieldname_' . $key;
590
+			$html .= '<div class="valuefield fieldname_'.$key;
591 591
 			if (!empty($val['cssview'])) {
592
-				$html .= ' ' . $val['cssview'];
592
+				$html .= ' '.$val['cssview'];
593 593
 			}
594 594
 			$html .= '">';
595 595
 			if ($key == 'lang') {
596 596
 				$langs->load('languages');
597
-				$labellang = ($value ? $langs->trans('Language_' . $value) : '');
597
+				$labellang = ($value ? $langs->trans('Language_'.$value) : '');
598 598
 				//$html .= picto_from_langcode($value, 'class="paddingrightonly saturatemedium opacitylow"');
599 599
 				$html .= $labellang;
600 600
 			} else {
@@ -654,7 +654,7 @@  discard block
 block discarded – undo
654 654
 				continue; // We don't want this field
655 655
 			}
656 656
 
657
-			$html .= '<div class="grid field_' . $key . '">';
657
+			$html .= '<div class="grid field_'.$key.'">';
658 658
 			$html .= '<div class="titlefieldcreate';
659 659
 			if (isset($val['notnull']) && $val['notnull'] > 0) {
660 660
 				$html .= ' required';
@@ -686,15 +686,15 @@  discard block
 block discarded – undo
686 686
 				$value = GETPOSTISSET($key) ? GETPOST($key, $check) : $object->$key;
687 687
 			} elseif (in_array($val['type'], array('date', 'datetime'))) {
688 688
 				$isPostDate = GETPOSTISSET($key);
689
-				$isPostTime = GETPOSTISSET($key . '_time');
689
+				$isPostTime = GETPOSTISSET($key.'_time');
690 690
 				if ($isPostDate) {
691 691
 					$postDate = GETPOST($key, 'alphanohtml');
692 692
 					if ($isPostTime) {
693
-						$postTime = GETPOST($key . '_time', 'alphanohtml') . ':00';
693
+						$postTime = GETPOST($key.'_time', 'alphanohtml').':00';
694 694
 					} else {
695 695
 						$postTime = '00:00:00';
696 696
 					}
697
-					$valueDateTimeStr = $postDate . ' ' . $postTime;
697
+					$valueDateTimeStr = $postDate.' '.$postTime;
698 698
 				} else {
699 699
 					// format date timestamp to YYYY-MM-DD HH:ii:ss
700 700
 					$valueDateTimeStr = dol_print_date($object->$key, '%Y-%m-%d %H:%M:%S');
@@ -766,19 +766,19 @@  discard block
 block discarded – undo
766 766
 			$html .= '<article>';
767 767
 			//$html .= load_fiche_titre($title, '', 'object_'.$object->picto);
768 768
 			$html .= '<header>';
769
-			$html .= '<h2>' . $title . '</h2>';
769
+			$html .= '<h2>'.$title.'</h2>';
770 770
 			$html .= '</header>';
771 771
 
772 772
 			$url_file = $context->getControllerUrl($context->controller, '', false);
773
-			$html .= '<form method="POST" action="' . $url_file . '">';
773
+			$html .= '<form method="POST" action="'.$url_file.'">';
774 774
 			$html .= $context->getFormToken();
775 775
 			$html .= '<input type="hidden" name="action" value="update">';
776
-			$html .= '<input type="hidden" name="id" value="' . $object->id . '">';
776
+			$html .= '<input type="hidden" name="id" value="'.$object->id.'">';
777 777
 			if ($backtopage) {
778
-				$html .= '<input type="hidden" name="backtopage" value="' . $backtopage . '">';
778
+				$html .= '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
779 779
 			}
780 780
 			if ($backtopageforcancel) {
781
-				$html .= '<input type="hidden" name="backtopageforcancel" value="' . $backtopageforcancel . '">';
781
+				$html .= '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">';
782 782
 			}
783 783
 
784 784
 			//$html .= '<table>'."\n";
@@ -792,8 +792,8 @@  discard block
 block discarded – undo
792 792
 
793 793
 			// Save and Cancel buttons
794 794
 			$html .= '<div class="grid">';
795
-			$html .= '<div><input type="submit" name="save" role="button" value="' . dol_escape_htmltag($langs->trans('Save')) . '" /></div>';
796
-			$html .= '<div><input type="submit" name="cancel" role="button" value="' . dol_escape_htmltag($langs->trans('Cancel')) . '" /></div>';
795
+			$html .= '<div><input type="submit" name="save" role="button" value="'.dol_escape_htmltag($langs->trans('Save')).'" /></div>';
796
+			$html .= '<div><input type="submit" name="cancel" role="button" value="'.dol_escape_htmltag($langs->trans('Cancel')).'" /></div>';
797 797
 			$html .= '</div>';
798 798
 
799 799
 			$html .= '</form>';
@@ -834,7 +834,7 @@  discard block
 block discarded – undo
834 834
 
835 835
 			// Buttons for actions
836 836
 			if ($action != 'presend' && $action != 'editline') {
837
-				$html .= '<div>' . "\n";
837
+				$html .= '<div>'."\n";
838 838
 				$parameters = array();
839 839
 				$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
840 840
 				if ($reshook < 0) {
@@ -844,10 +844,10 @@  discard block
 block discarded – undo
844 844
 				if (empty($reshook)) {
845 845
 					if ($permissiontoadd) {
846 846
 						$url_file = $context->getControllerUrl($context->controller, '', false);
847
-						$html .= '<a href="' . $url_file . '&id=' . $object->id . '&action=edit" role="button">' . $langs->trans('Modify') . '</a>';
847
+						$html .= '<a href="'.$url_file.'&id='.$object->id.'&action=edit" role="button">'.$langs->trans('Modify').'</a>';
848 848
 					}
849 849
 				}
850
-				$html .= '</div>' . "\n";
850
+				$html .= '</div>'."\n";
851 851
 			}
852 852
 		}
853 853
 
Please login to merge, or discard this patch.
htdocs/compta/prelevement/class/bonprelevement.class.php 1 patch
Spacing   +455 added lines, -455 removed lines patch added patch discarded remove patch
@@ -29,17 +29,17 @@  discard block
 block discarded – undo
29 29
  * \brief      File of withdrawal receipts class
30 30
  */
31 31
 
32
-require_once DOL_DOCUMENT_ROOT . '/core/class/commonobject.class.php';
33
-require_once DOL_DOCUMENT_ROOT . '/core/lib/bank.lib.php';
34
-require_once DOL_DOCUMENT_ROOT . '/compta/bank/class/account.class.php';
35
-require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
36
-require_once DOL_DOCUMENT_ROOT . '/compta/paiement/class/paiement.class.php';
37
-require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.facture.class.php';
38
-require_once DOL_DOCUMENT_ROOT . '/fourn/class/paiementfourn.class.php';
39
-require_once DOL_DOCUMENT_ROOT . '/salaries/class/salary.class.php';
40
-require_once DOL_DOCUMENT_ROOT . '/salaries/class/paymentsalary.class.php';
41
-require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
42
-require_once DOL_DOCUMENT_ROOT . '/user/class/userbankaccount.class.php';
32
+require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php';
33
+require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php';
34
+require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
35
+require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
36
+require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php';
37
+require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
38
+require_once DOL_DOCUMENT_ROOT.'/fourn/class/paiementfourn.class.php';
39
+require_once DOL_DOCUMENT_ROOT.'/salaries/class/salary.class.php';
40
+require_once DOL_DOCUMENT_ROOT.'/salaries/class/paymentsalary.class.php';
41
+require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
42
+require_once DOL_DOCUMENT_ROOT.'/user/class/userbankaccount.class.php';
43 43
 
44 44
 
45 45
 /**
@@ -104,8 +104,8 @@  discard block
 block discarded – undo
104 104
 
105 105
 	const STATUS_DRAFT = 0;
106 106
 	const STATUS_TRANSFERED = 1;
107
-	const STATUS_CREDITED = 2;		// STATUS_CREDITED and STATUS_DEBITED is same. Difference is in ->type
108
-	const STATUS_DEBITED = 2;		// STATUS_CREDITED and STATUS_DEBITED is same. Difference is in ->type
107
+	const STATUS_CREDITED = 2; // STATUS_CREDITED and STATUS_DEBITED is same. Difference is in ->type
108
+	const STATUS_DEBITED = 2; // STATUS_CREDITED and STATUS_DEBITED is same. Difference is in ->type
109 109
 
110 110
 
111 111
 	/**
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
 
259 259
 		if ($result == 0) {
260 260
 			if ($line_id > 0) {
261
-				$sql = "INSERT INTO " . MAIN_DB_PREFIX . "prelevement (";
261
+				$sql = "INSERT INTO ".MAIN_DB_PREFIX."prelevement (";
262 262
 				if ($type != 'bank-transfer') {
263 263
 					$sql .= "fk_facture";
264 264
 				} else {
@@ -271,24 +271,24 @@  discard block
 block discarded – undo
271 271
 				$sql .= ",fk_prelevement_lignes";
272 272
 				$sql .= ") VALUES (";
273 273
 				$sql .= ((int) $invoice_id);
274
-				$sql .= ", " . ((int) $line_id);
274
+				$sql .= ", ".((int) $line_id);
275 275
 				$sql .= ")";
276 276
 
277 277
 				if ($this->db->query($sql)) {
278 278
 					$result = 0;
279 279
 				} else {
280 280
 					$result = -1;
281
-					$this->errors[] = get_class($this) . "::AddFacture " . $this->db->lasterror;
282
-					dol_syslog(get_class($this) . "::AddFacture Error $result");
281
+					$this->errors[] = get_class($this)."::AddFacture ".$this->db->lasterror;
282
+					dol_syslog(get_class($this)."::AddFacture Error $result");
283 283
 				}
284 284
 			} else {
285 285
 				$result = -2;
286
-				$this->errors[] = get_class($this) . "::AddFacture linedid Empty";
287
-				dol_syslog(get_class($this) . "::AddFacture Error $result");
286
+				$this->errors[] = get_class($this)."::AddFacture linedid Empty";
287
+				dol_syslog(get_class($this)."::AddFacture Error $result");
288 288
 			}
289 289
 		} else {
290 290
 			$result = -3;
291
-			dol_syslog(get_class($this) . "::AddFacture Error $result");
291
+			dol_syslog(get_class($this)."::AddFacture Error $result");
292 292
 		}
293 293
 
294 294
 		return $result;
@@ -311,35 +311,35 @@  discard block
 block discarded – undo
311 311
 	public function addline(&$line_id, $client_id, $client_nom, $amount, $code_banque, $code_guichet, $number, $number_key, $sourcetype = '')
312 312
 	{
313 313
 		$result = -1;
314
-		$concat = 0;	// ??? what is this for. Seems not used.
314
+		$concat = 0; // ??? what is this for. Seems not used.
315 315
 
316 316
 		if ($concat == 1) {
317 317
 			/*
318 318
 			 * We aggregate the lines
319 319
 			 */
320 320
 			$sql = "SELECT rowid";
321
-			$sql .= " FROM  " . MAIN_DB_PREFIX . "prelevement_lignes";
322
-			$sql .= " WHERE fk_prelevement_bons = " . ((int) $this->id);
321
+			$sql .= " FROM  ".MAIN_DB_PREFIX."prelevement_lignes";
322
+			$sql .= " WHERE fk_prelevement_bons = ".((int) $this->id);
323 323
 			if ($sourcetype == 'salary') {
324
-				$sql .= " AND fk_soc = " . ((int) $client_id);
324
+				$sql .= " AND fk_soc = ".((int) $client_id);
325 325
 			} else {
326
-				$sql .= " AND fk_user = " . ((int) $client_id);
326
+				$sql .= " AND fk_user = ".((int) $client_id);
327 327
 			}
328
-			$sql .= " AND code_banque = '" . $this->db->escape($code_banque) . "'";
329
-			$sql .= " AND code_guichet = '" . $this->db->escape($code_guichet) . "'";
330
-			$sql .= " AND number = '" . $this->db->escape($number) . "'";
328
+			$sql .= " AND code_banque = '".$this->db->escape($code_banque)."'";
329
+			$sql .= " AND code_guichet = '".$this->db->escape($code_guichet)."'";
330
+			$sql .= " AND number = '".$this->db->escape($number)."'";
331 331
 
332 332
 			$resql = $this->db->query($sql);
333 333
 			if ($resql) {
334 334
 				$num = $this->db->num_rows($resql);
335 335
 			} else {
336
-				$result = -1;  // @phan-suppress-current-line PhanPluginRedundantAssignment
336
+				$result = -1; // @phan-suppress-current-line PhanPluginRedundantAssignment
337 337
 			}
338 338
 		} else {
339 339
 			/*
340 340
 			 * No aggregate
341 341
 			 */
342
-			$sql = "INSERT INTO " . MAIN_DB_PREFIX . "prelevement_lignes (";
342
+			$sql = "INSERT INTO ".MAIN_DB_PREFIX."prelevement_lignes (";
343 343
 			$sql .= "fk_prelevement_bons";
344 344
 			$sql .= ", fk_soc";
345 345
 			$sql .= ", client_nom";
@@ -351,21 +351,21 @@  discard block
 block discarded – undo
351 351
 			$sql .= ($sourcetype == 'salary' ? ", fk_user" : "");
352 352
 			$sql .= ") VALUES (";
353 353
 			$sql .= $this->id;
354
-			$sql .= ", " . (($sourcetype != 'salary') ? ((int) $client_id) : "0");	// fk_soc can't be null
355
-			$sql .= ", '" . $this->db->escape($client_nom) . "'";
356
-			$sql .= ", " . ((float) price2num($amount));
357
-			$sql .= ", '" . $this->db->escape($code_banque) . "'";
358
-			$sql .= ", '" . $this->db->escape($code_guichet) . "'";
359
-			$sql .= ", '" . $this->db->escape($number) . "'";
360
-			$sql .= ", '" . $this->db->escape($number_key) . "'";
361
-			$sql .= (($sourcetype == 'salary') ? ", " . ((int) $client_id) : '');
354
+			$sql .= ", ".(($sourcetype != 'salary') ? ((int) $client_id) : "0"); // fk_soc can't be null
355
+			$sql .= ", '".$this->db->escape($client_nom)."'";
356
+			$sql .= ", ".((float) price2num($amount));
357
+			$sql .= ", '".$this->db->escape($code_banque)."'";
358
+			$sql .= ", '".$this->db->escape($code_guichet)."'";
359
+			$sql .= ", '".$this->db->escape($number)."'";
360
+			$sql .= ", '".$this->db->escape($number_key)."'";
361
+			$sql .= (($sourcetype == 'salary') ? ", ".((int) $client_id) : '');
362 362
 			$sql .= ")";
363 363
 			if ($this->db->query($sql)) {
364
-				$line_id = $this->db->last_insert_id(MAIN_DB_PREFIX . "prelevement_lignes");
364
+				$line_id = $this->db->last_insert_id(MAIN_DB_PREFIX."prelevement_lignes");
365 365
 				$result = 0;
366 366
 			} else {
367
-				$this->errors[] = get_class($this) . "::addline Error -2 " . $this->db->lasterror;
368
-				dol_syslog(get_class($this) . "::addline Error -2");
367
+				$this->errors[] = get_class($this)."::addline Error -2 ".$this->db->lasterror;
368
+				dol_syslog(get_class($this)."::addline Error -2");
369 369
 				$result = -2;
370 370
 			}
371 371
 		}
@@ -408,15 +408,15 @@  discard block
 block discarded – undo
408 408
 		$sql .= ", p.type";
409 409
 		$sql .= ", p.fk_bank_account";
410 410
 		$sql .= ", p.statut as status";
411
-		$sql .= " FROM " . MAIN_DB_PREFIX . "prelevement_bons as p";
412
-		$sql .= " WHERE p.entity IN (" . getEntity('invoice') . ")";
411
+		$sql .= " FROM ".MAIN_DB_PREFIX."prelevement_bons as p";
412
+		$sql .= " WHERE p.entity IN (".getEntity('invoice').")";
413 413
 		if ($rowid > 0) {
414
-			$sql .= " AND p.rowid = " . ((int) $rowid);
414
+			$sql .= " AND p.rowid = ".((int) $rowid);
415 415
 		} else {
416
-			$sql .= " AND p.ref = '" . $this->db->escape($ref) . "'";
416
+			$sql .= " AND p.ref = '".$this->db->escape($ref)."'";
417 417
 		}
418 418
 
419
-		dol_syslog(get_class($this) . "::fetch", LOG_DEBUG);
419
+		dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
420 420
 		$result = $this->db->query($sql);
421 421
 		if ($result) {
422 422
 			if ($this->db->num_rows($result)) {
@@ -442,13 +442,13 @@  discard block
 block discarded – undo
442 442
 				if (empty($this->status)) {		// Value is sometimes null in database
443 443
 					$this->status = 0;
444 444
 				}
445
-				$this->statut         = $this->status; // For backward compatibility
445
+				$this->statut = $this->status; // For backward compatibility
446 446
 
447 447
 				$this->fetched = 1;
448 448
 
449 449
 				return 1;
450 450
 			} else {
451
-				dol_syslog(get_class($this) . "::Fetch Erreur aucune ligne retournee");
451
+				dol_syslog(get_class($this)."::Fetch Erreur aucune ligne retournee");
452 452
 				return -1;
453 453
 			}
454 454
 		} else {
@@ -489,19 +489,19 @@  discard block
 block discarded – undo
489 489
 			if ($date < $this->date_trans) {
490 490
 				$langs->load("errors");
491 491
 				$this->error = $langs->trans('ErrorDateOfMovementLowerThanDateOfFileTransmission');
492
-				dol_syslog("bon-prelevment::set_infocredit 1027 " . $this->error);
492
+				dol_syslog("bon-prelevment::set_infocredit 1027 ".$this->error);
493 493
 				return -1027;
494 494
 			}
495 495
 
496 496
 			$this->db->begin();
497 497
 
498
-			$sql = " UPDATE " . MAIN_DB_PREFIX . "prelevement_bons";
499
-			$sql .= " SET fk_user_credit = " . ((int) $user->id);
500
-			$sql .= ", statut = " . self::STATUS_CREDITED;
501
-			$sql .= ", date_credit = '" . $this->db->idate($date) . "'";
502
-			$sql .= " WHERE rowid = " . ((int) $this->id);
503
-			$sql .= " AND entity = " . ((int) $conf->entity);
504
-			$sql .= " AND statut = " . self::STATUS_TRANSFERED;
498
+			$sql = " UPDATE ".MAIN_DB_PREFIX."prelevement_bons";
499
+			$sql .= " SET fk_user_credit = ".((int) $user->id);
500
+			$sql .= ", statut = ".self::STATUS_CREDITED;
501
+			$sql .= ", date_credit = '".$this->db->idate($date)."'";
502
+			$sql .= " WHERE rowid = ".((int) $this->id);
503
+			$sql .= " AND entity = ".((int) $conf->entity);
504
+			$sql .= " AND statut = ".self::STATUS_TRANSFERED;
505 505
 
506 506
 			$resql = $this->db->query($sql);
507 507
 			if ($resql) {
@@ -616,7 +616,7 @@  discard block
 block discarded – undo
616 616
 						$error++;
617 617
 						$this->error = $paiement->error;
618 618
 						$this->errors = $paiement->errors;
619
-						dol_syslog(get_class($this) . "::set_infocredit AddPayment Error " . $this->error);
619
+						dol_syslog(get_class($this)."::set_infocredit AddPayment Error ".$this->error);
620 620
 					} else {
621 621
 						if ($this->type == 'bank-transfer') {
622 622
 							if ($type == 'salary') {
@@ -631,7 +631,7 @@  discard block
 block discarded – undo
631 631
 						} else {
632 632
 							$modeforaddpayment = 'payment';
633 633
 							$labelforaddpayment = '(CustomerInvoicePayment)';
634
-							$addbankurl = 'direct-debit';	// = 'directdebit'
634
+							$addbankurl = 'direct-debit'; // = 'directdebit'
635 635
 						}
636 636
 
637 637
 						$result = $paiement->addPaymentToBank($user, $modeforaddpayment, $labelforaddpayment, $fk_bank_account, '', '', 0, '', $addbankurl);
@@ -640,7 +640,7 @@  discard block
 block discarded – undo
640 640
 							$error++;
641 641
 							$this->error = $paiement->error;
642 642
 							$this->errors = $paiement->errors;
643
-							dol_syslog(get_class($this) . "::set_infocredit AddPaymentToBank Error " . $this->error);
643
+							dol_syslog(get_class($this)."::set_infocredit AddPaymentToBank Error ".$this->error);
644 644
 						}
645 645
 					}
646 646
 				}
@@ -648,24 +648,24 @@  discard block
 block discarded – undo
648 648
 				// Update withdrawal line
649 649
 				// TODO: Translate to ligneprelevement.class.php
650 650
 				if (!$error) {
651
-					$sql = " UPDATE " . MAIN_DB_PREFIX . "prelevement_lignes";
651
+					$sql = " UPDATE ".MAIN_DB_PREFIX."prelevement_lignes";
652 652
 					$sql .= " SET statut = 2";
653
-					$sql .= " WHERE fk_prelevement_bons = " . ((int) $this->id);
653
+					$sql .= " WHERE fk_prelevement_bons = ".((int) $this->id);
654 654
 
655 655
 					if (!$this->db->query($sql)) {
656
-						dol_syslog(get_class($this) . "::set_infocredit Update lines Error");
656
+						dol_syslog(get_class($this)."::set_infocredit Update lines Error");
657 657
 						$error++;
658 658
 					}
659 659
 				}
660 660
 			} else {
661 661
 				$this->error = $this->db->lasterror();
662
-				dol_syslog(get_class($this) . "::set_infocredit Update Bons Error");
662
+				dol_syslog(get_class($this)."::set_infocredit Update Bons Error");
663 663
 				$error++;
664 664
 			}
665 665
 
666 666
 			// End of procedure
667 667
 			if ($error == 0) {
668
-				$this->date_credit = $date;		// date credit or debit
668
+				$this->date_credit = $date; // date credit or debit
669 669
 				$this->statut = self::STATUS_CREDITED;
670 670
 				$this->status = self::STATUS_CREDITED;
671 671
 
@@ -696,17 +696,17 @@  discard block
 block discarded – undo
696 696
 
697 697
 		$error = 0;
698 698
 
699
-		dol_syslog(get_class($this) . "::set_infotrans Start", LOG_INFO);
699
+		dol_syslog(get_class($this)."::set_infotrans Start", LOG_INFO);
700 700
 
701 701
 		if ($this->db->begin()) {
702
-			$sql = "UPDATE " . MAIN_DB_PREFIX . "prelevement_bons ";
703
-			$sql .= " SET fk_user_trans = " . $user->id;
704
-			$sql .= " , date_trans = '" . $this->db->idate($date) . "'";
705
-			$sql .= " , method_trans = " . ((int) $method);
706
-			$sql .= " , statut = " . self::STATUS_TRANSFERED;
707
-			$sql .= " WHERE rowid = " . ((int) $this->id);
708
-			$sql .= " AND entity = " . ((int) $conf->entity);
709
-			$sql .= " AND statut = " . self::STATUS_DRAFT;
702
+			$sql = "UPDATE ".MAIN_DB_PREFIX."prelevement_bons ";
703
+			$sql .= " SET fk_user_trans = ".$user->id;
704
+			$sql .= " , date_trans = '".$this->db->idate($date)."'";
705
+			$sql .= " , method_trans = ".((int) $method);
706
+			$sql .= " , statut = ".self::STATUS_TRANSFERED;
707
+			$sql .= " WHERE rowid = ".((int) $this->id);
708
+			$sql .= " AND entity = ".((int) $conf->entity);
709
+			$sql .= " AND statut = ".self::STATUS_DRAFT;
710 710
 
711 711
 			if ($this->db->query($sql)) {
712 712
 				$this->method_trans = $method;
@@ -731,12 +731,12 @@  discard block
 block discarded – undo
731 731
 				return 0;
732 732
 			} else {
733 733
 				$this->db->rollback();
734
-				dol_syslog(get_class($this) . "::set_infotrans ROLLBACK", LOG_ERR);
734
+				dol_syslog(get_class($this)."::set_infotrans ROLLBACK", LOG_ERR);
735 735
 
736 736
 				return -1;
737 737
 			}
738 738
 		} else {
739
-			dol_syslog(get_class($this) . "::set_infotrans Ouverture transaction SQL impossible", LOG_CRIT);
739
+			dol_syslog(get_class($this)."::set_infotrans Ouverture transaction SQL impossible", LOG_CRIT);
740 740
 			return -2;
741 741
 		}
742 742
 	}
@@ -754,7 +754,7 @@  discard block
 block discarded – undo
754 754
 
755 755
 		$arr = array();
756 756
 
757
-		dol_syslog(get_class($this) . "::getListInvoices");
757
+		dol_syslog(get_class($this)."::getListInvoices");
758 758
 
759 759
 		// Returns all invoices presented within same order
760 760
 		$sql = "SELECT ";
@@ -770,13 +770,13 @@  discard block
 block discarded – undo
770 770
 		if ($amounts) {
771 771
 			$sql .= ", SUM(pl.amount)";
772 772
 		}
773
-		$sql .= " FROM " . MAIN_DB_PREFIX . "prelevement_bons as pb,";
774
-		$sql .= " " . MAIN_DB_PREFIX . "prelevement_lignes as pl,";
775
-		$sql .= " " . MAIN_DB_PREFIX . "prelevement as p";
773
+		$sql .= " FROM ".MAIN_DB_PREFIX."prelevement_bons as pb,";
774
+		$sql .= " ".MAIN_DB_PREFIX."prelevement_lignes as pl,";
775
+		$sql .= " ".MAIN_DB_PREFIX."prelevement as p";
776 776
 		$sql .= " WHERE p.fk_prelevement_lignes = pl.rowid";
777 777
 		$sql .= " AND pl.fk_prelevement_bons = pb.rowid";
778
-		$sql .= " AND pb.rowid = " . ((int) $this->id);
779
-		$sql .= " AND pb.entity = " . ((int) $conf->entity);
778
+		$sql .= " AND pb.rowid = ".((int) $this->id);
779
+		$sql .= " AND pb.entity = ".((int) $conf->entity);
780 780
 		if ($amounts) {
781 781
 			if ($this->type == 'bank-transfer') {
782 782
 				if ($type == 'salary') {
@@ -830,17 +830,17 @@  discard block
 block discarded – undo
830 830
 		$sql = "SELECT sum(pd.amount) as nb";
831 831
 		if ($type !== 'salary') {
832 832
 			if ($mode != 'bank-transfer') {
833
-				$sql .= " FROM " . MAIN_DB_PREFIX . "facture as f,";
833
+				$sql .= " FROM ".MAIN_DB_PREFIX."facture as f,";
834 834
 			} else {
835
-				$sql .= " FROM " . MAIN_DB_PREFIX . "facture_fourn as f,";
835
+				$sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f,";
836 836
 			}
837 837
 		} else {
838
-			$sql .= " FROM " . MAIN_DB_PREFIX . "salary as s,";
838
+			$sql .= " FROM ".MAIN_DB_PREFIX."salary as s,";
839 839
 		}
840
-		$sql .= " " . MAIN_DB_PREFIX . "prelevement_demande as pd";
841
-		$sql .= ($type !== 'salary' ? " WHERE f.entity IN (" . getEntity('invoice') . ")" : " WHERE s.entity IN (" . getEntity('salary') . ")");
840
+		$sql .= " ".MAIN_DB_PREFIX."prelevement_demande as pd";
841
+		$sql .= ($type !== 'salary' ? " WHERE f.entity IN (".getEntity('invoice').")" : " WHERE s.entity IN (".getEntity('salary').")");
842 842
 		if (!getDolGlobalString('WITHDRAWAL_ALLOW_ANY_INVOICE_STATUS')) {
843
-			$sql .= ($type !== 'salary' ? " AND f.fk_statut = " . Facture::STATUS_VALIDATED : " AND s.paye = " . Salary::STATUS_UNPAID);
843
+			$sql .= ($type !== 'salary' ? " AND f.fk_statut = ".Facture::STATUS_VALIDATED : " AND s.paye = ".Salary::STATUS_UNPAID);
844 844
 		}
845 845
 		if ($type !== 'salary') {
846 846
 			if ($mode != 'bank-transfer') {
@@ -865,7 +865,7 @@  discard block
 block discarded – undo
865 865
 			return $obj->nb;
866 866
 		} else {
867 867
 			$error = 1;
868
-			dol_syslog(get_class($this) . "::SommeAPrelever Erreur -1");
868
+			dol_syslog(get_class($this)."::SommeAPrelever Erreur -1");
869 869
 			dol_syslog($this->db->error());
870 870
 
871 871
 			return -1;
@@ -901,26 +901,26 @@  discard block
 block discarded – undo
901 901
 		// phpcs:enable
902 902
 		if ($forsalary == 1) {
903 903
 			$sql = "SELECT count(s.rowid) as nb";
904
-			$sql .= " FROM " . MAIN_DB_PREFIX . "salary as s";
904
+			$sql .= " FROM ".MAIN_DB_PREFIX."salary as s";
905 905
 		} else {
906 906
 			$sql = "SELECT count(f.rowid) as nb";
907 907
 
908 908
 			if ($type == 'bank-transfer') {
909
-				$sql .= " FROM " . MAIN_DB_PREFIX . "facture_fourn as f";
909
+				$sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f";
910 910
 			} else {
911
-				$sql .= " FROM " . MAIN_DB_PREFIX . "facture as f";
911
+				$sql .= " FROM ".MAIN_DB_PREFIX."facture as f";
912 912
 			}
913 913
 		}
914
-		$sql .= ", " . MAIN_DB_PREFIX . "prelevement_demande as pd";
914
+		$sql .= ", ".MAIN_DB_PREFIX."prelevement_demande as pd";
915 915
 		if ($forsalary == 1) {
916
-			$sql .= " WHERE s.entity IN (" . getEntity('invoice') . ")";
916
+			$sql .= " WHERE s.entity IN (".getEntity('invoice').")";
917 917
 			if (!getDolGlobalString('WITHDRAWAL_ALLOW_ANY_INVOICE_STATUS')) {
918 918
 				$sql .= " AND s.paye = 0";
919 919
 			}
920 920
 		} else {
921
-			$sql .= " WHERE f.entity IN (" . getEntity('invoice') . ")";
921
+			$sql .= " WHERE f.entity IN (".getEntity('invoice').")";
922 922
 			if (!getDolGlobalString('WITHDRAWAL_ALLOW_ANY_INVOICE_STATUS')) {
923
-				$sql .= " AND f.fk_statut = " . Facture::STATUS_VALIDATED;
923
+				$sql .= " AND f.fk_statut = ".Facture::STATUS_VALIDATED;
924 924
 			}
925 925
 		}
926 926
 		if ($forsalary == 1) {
@@ -940,7 +940,7 @@  discard block
 block discarded – undo
940 940
 			$sql .= " AND s.paye = 0";
941 941
 		}
942 942
 
943
-		dol_syslog(get_class($this) . "::NbFactureAPrelever");
943
+		dol_syslog(get_class($this)."::NbFactureAPrelever");
944 944
 		$resql = $this->db->query($sql);
945 945
 
946 946
 		if ($resql) {
@@ -949,7 +949,7 @@  discard block
 block discarded – undo
949 949
 
950 950
 			return $obj->nb;
951 951
 		} else {
952
-			$this->error = get_class($this) . "::NbFactureAPrelever Erreur -1 sql=" . $this->db->error();
952
+			$this->error = get_class($this)."::NbFactureAPrelever Erreur -1 sql=".$this->db->error();
953 953
 			return -1;
954 954
 		}
955 955
 	}
@@ -981,10 +981,10 @@  discard block
 block discarded – undo
981 981
 		// phpcs:enable
982 982
 		global $conf, $langs, $user;
983 983
 
984
-		dol_syslog(__METHOD__ . " Bank=" . $banque . " Office=" . $agence . " mode=" . $mode . " format=" . $format, LOG_DEBUG);
984
+		dol_syslog(__METHOD__." Bank=".$banque." Office=".$agence." mode=".$mode." format=".$format, LOG_DEBUG);
985 985
 
986
-		require_once DOL_DOCUMENT_ROOT . "/compta/facture/class/facture.class.php";
987
-		require_once DOL_DOCUMENT_ROOT . "/societe/class/societe.class.php";
986
+		require_once DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php";
987
+		require_once DOL_DOCUMENT_ROOT."/societe/class/societe.class.php";
988 988
 
989 989
 		// Check params
990 990
 		if ($type != 'bank-transfer') {
@@ -1020,7 +1020,7 @@  discard block
 block discarded – undo
1020 1020
 		$factures_prev_id = array();
1021 1021
 		$factures_errors = array();
1022 1022
 		if (!$error) {
1023
-			dol_syslog(__METHOD__ . " Read invoices for did=" . ((int) $did), LOG_DEBUG);
1023
+			dol_syslog(__METHOD__." Read invoices for did=".((int) $did), LOG_DEBUG);
1024 1024
 
1025 1025
 			$sql = "SELECT f.rowid, pd.rowid as pfdrowid";
1026 1026
 			if ($sourcetype != 'salary') {
@@ -1039,28 +1039,28 @@  discard block
 block discarded – undo
1039 1039
 			}
1040 1040
 			if ($sourcetype != 'salary') {
1041 1041
 				if ($type != 'bank-transfer') {
1042
-					$sql .= " FROM " . MAIN_DB_PREFIX . "facture as f";
1043
-					$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "prelevement_demande as pd ON f.rowid = pd.fk_facture";
1042
+					$sql .= " FROM ".MAIN_DB_PREFIX."facture as f";
1043
+					$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."prelevement_demande as pd ON f.rowid = pd.fk_facture";
1044 1044
 				} else {
1045
-					$sql .= " FROM " . MAIN_DB_PREFIX . "facture_fourn as f";
1046
-					$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "prelevement_demande as pd ON f.rowid = pd.fk_facture_fourn";
1045
+					$sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f";
1046
+					$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."prelevement_demande as pd ON f.rowid = pd.fk_facture_fourn";
1047 1047
 				}
1048
-				$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "societe as s ON s.rowid = f.fk_soc";
1049
-				$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "societe_rib as sr ON s.rowid = sr.fk_soc AND sr.default_rib = 1";
1048
+				$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = f.fk_soc";
1049
+				$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_rib as sr ON s.rowid = sr.fk_soc AND sr.default_rib = 1";
1050 1050
 			} else {
1051
-				$sql .= " FROM " . MAIN_DB_PREFIX . "salary as f";
1052
-				$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "prelevement_demande as pd ON f.rowid = pd.fk_salary";
1053
-				$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "user as s ON s.rowid = f.fk_user";
1054
-				$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "user_rib as sr ON s.rowid = sr.fk_user";	// TODO Add AND sr.default_rib = 1 here
1051
+				$sql .= " FROM ".MAIN_DB_PREFIX."salary as f";
1052
+				$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."prelevement_demande as pd ON f.rowid = pd.fk_salary";
1053
+				$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."user as s ON s.rowid = f.fk_user";
1054
+				$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."user_rib as sr ON s.rowid = sr.fk_user"; // TODO Add AND sr.default_rib = 1 here
1055 1055
 			}
1056 1056
 			if ($sourcetype != 'salary') {
1057 1057
 				if ($type != 'bank-transfer') {
1058
-					$sql .= " WHERE f.entity IN (" . getEntity('invoice') . ')';
1058
+					$sql .= " WHERE f.entity IN (".getEntity('invoice').')';
1059 1059
 				} else {
1060
-					$sql .= " WHERE f.entity IN (" . getEntity('supplier_invoice') . ')';
1060
+					$sql .= " WHERE f.entity IN (".getEntity('supplier_invoice').')';
1061 1061
 				}
1062 1062
 			} else {
1063
-				$sql .= " WHERE f.entity IN (" . getEntity('salary') . ')';
1063
+				$sql .= " WHERE f.entity IN (".getEntity('salary').')';
1064 1064
 			}
1065 1065
 			if ($sourcetype != 'salary') {
1066 1066
 				$sql .= " AND f.fk_statut = 1"; // Invoice validated
@@ -1074,10 +1074,10 @@  discard block
 block discarded – undo
1074 1074
 			$sql .= " AND pd.traite = 0";
1075 1075
 			$sql .= " AND pd.ext_payment_id IS NULL";
1076 1076
 			if ($sourcetype != 'salary') {
1077
-				$sql .= " AND sr.type = 'ban'";		// TODO Add AND sr.type = 'ban' for users too
1077
+				$sql .= " AND sr.type = 'ban'"; // TODO Add AND sr.type = 'ban' for users too
1078 1078
 			}
1079 1079
 			if ($did > 0) {
1080
-				$sql .= " AND pd.rowid = " . ((int) $did);
1080
+				$sql .= " AND pd.rowid = ".((int) $did);
1081 1081
 			}
1082 1082
 
1083 1083
 			$resql = $this->db->query($sql);
@@ -1086,41 +1086,41 @@  discard block
 block discarded – undo
1086 1086
 				$i = 0;
1087 1087
 
1088 1088
 				while ($i < $num) {
1089
-					$row = $this->db->fetch_row($resql);	// TODO Replace with fetch_object()
1089
+					$row = $this->db->fetch_row($resql); // TODO Replace with fetch_object()
1090 1090
 					$factures[$i] = $row; // All fields
1091 1091
 
1092 1092
 					if ($row[7] == 0) {
1093 1093
 						$error++;
1094
-						dol_syslog(__METHOD__ . " Read invoices/salary error Found a null amount", LOG_ERR);
1095
-						$this->invoice_in_error[$row[0]] = "Error for invoice or salary id " . $row[0] . ", found a null amount";
1094
+						dol_syslog(__METHOD__." Read invoices/salary error Found a null amount", LOG_ERR);
1095
+						$this->invoice_in_error[$row[0]] = "Error for invoice or salary id ".$row[0].", found a null amount";
1096 1096
 						break;
1097 1097
 					}
1098 1098
 					$i++;
1099 1099
 				}
1100 1100
 
1101 1101
 				$this->db->free($resql);
1102
-				dol_syslog(__METHOD__ . " Read invoices/salary, " . $i . " invoices/salary to withdraw", LOG_DEBUG);
1102
+				dol_syslog(__METHOD__." Read invoices/salary, ".$i." invoices/salary to withdraw", LOG_DEBUG);
1103 1103
 			} else {
1104 1104
 				$error++;
1105 1105
 				$this->error = $this->db->lasterror();
1106
-				dol_syslog(__METHOD__ . " Read invoices/salary error " . $this->db->lasterror(), LOG_ERR);
1106
+				dol_syslog(__METHOD__." Read invoices/salary error ".$this->db->lasterror(), LOG_ERR);
1107 1107
 				return -1;
1108 1108
 			}
1109 1109
 		}
1110 1110
 
1111 1111
 		if (!$error) {
1112 1112
 			// Make some checks
1113
-			require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
1114
-			require_once DOL_DOCUMENT_ROOT . '/user/class/user.class.php';
1115
-			require_once DOL_DOCUMENT_ROOT . '/societe/class/companybankaccount.class.php';
1116
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/bank.lib.php';
1113
+			require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
1114
+			require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
1115
+			require_once DOL_DOCUMENT_ROOT.'/societe/class/companybankaccount.class.php';
1116
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php';
1117 1117
 
1118 1118
 			$tmpsoc = new Societe($this->db);
1119 1119
 			$tmpuser = new User($this->db);
1120 1120
 
1121 1121
 			// Check BAN
1122 1122
 			$i = 0;
1123
-			dol_syslog(__METHOD__ . " Check BAN", LOG_DEBUG);
1123
+			dol_syslog(__METHOD__." Check BAN", LOG_DEBUG);
1124 1124
 
1125 1125
 			if (count($factures) > 0) {
1126 1126
 				foreach ($factures as $key => $fac) {
@@ -1160,31 +1160,31 @@  discard block
 block discarded – undo
1160 1160
 							if ($type != 'bank-transfer') {
1161 1161
 								$tmpsoc->id = $fac[2];
1162 1162
 								$tmpsoc->name = $fac[8];
1163
-								$invoice_url = "<a href='" . DOL_URL_ROOT . '/compta/facture/card.php?facid=' . $fac[0] . "'>" . $fac[9] . "</a>";
1164
-								$this->invoice_in_error[$fac[0]] = "Error on default bank number IBAN/BIC for invoice " . $invoice_url . " for thirdparty " . $tmpsoc->getNomUrl(0);
1165
-								$this->thirdparty_in_error[$tmpsoc->id] = "Error on default bank number IBAN/BIC for invoice " . $invoice_url . " for thirdparty " . $tmpsoc->getNomUrl(0);
1163
+								$invoice_url = "<a href='".DOL_URL_ROOT.'/compta/facture/card.php?facid='.$fac[0]."'>".$fac[9]."</a>";
1164
+								$this->invoice_in_error[$fac[0]] = "Error on default bank number IBAN/BIC for invoice ".$invoice_url." for thirdparty ".$tmpsoc->getNomUrl(0);
1165
+								$this->thirdparty_in_error[$tmpsoc->id] = "Error on default bank number IBAN/BIC for invoice ".$invoice_url." for thirdparty ".$tmpsoc->getNomUrl(0);
1166 1166
 								$error++;
1167 1167
 							}
1168 1168
 							if ($type == 'bank-transfer' && $sourcetype != 'salary') {
1169 1169
 								$tmpsoc->id = $fac[2];
1170 1170
 								$tmpsoc->name = $fac[8];
1171
-								$invoice_url = "<a href='" . DOL_URL_ROOT . '/fourn/facture/card.php?facid=' . $fac[0] . "'>" . $fac[9] . "</a>";
1172
-								$this->invoice_in_error[$fac[0]] = "Error on default bank number IBAN/BIC for invoice " . $invoice_url . " for thirdparty " . $tmpsoc->getNomUrl(0);
1173
-								$this->thirdparty_in_error[$tmpsoc->id] = "Error on default bank number IBAN/BIC for invoice " . $invoice_url . " for thirdparty " . $tmpsoc->getNomUrl(0);
1171
+								$invoice_url = "<a href='".DOL_URL_ROOT.'/fourn/facture/card.php?facid='.$fac[0]."'>".$fac[9]."</a>";
1172
+								$this->invoice_in_error[$fac[0]] = "Error on default bank number IBAN/BIC for invoice ".$invoice_url." for thirdparty ".$tmpsoc->getNomUrl(0);
1173
+								$this->thirdparty_in_error[$tmpsoc->id] = "Error on default bank number IBAN/BIC for invoice ".$invoice_url." for thirdparty ".$tmpsoc->getNomUrl(0);
1174 1174
 								$error++;
1175 1175
 							}
1176 1176
 							if ($type == 'bank-transfer' && $sourcetype == 'salary') {
1177 1177
 								$tmpuser->id = $fac[2];
1178 1178
 								$tmpuser->firstname = $fac[8];
1179
-								$salary_url = "<a href='" . DOL_URL_ROOT . '/salaries/card.php?id=' . $fac[0] . "'>" . $fac[0] . "</a>";
1180
-								$this->invoice_in_error[$fac[0]] = "Error on default bank number IBAN/BIC for salary " . $salary_url . " for employee " . $tmpuser->getNomUrl(0);
1181
-								$this->thirdparty_in_error[$tmpuser->id] = "Error on default bank number IBAN/BIC for salary " . $salary_url . " for employee " . $tmpuser->getNomUrl(0);
1179
+								$salary_url = "<a href='".DOL_URL_ROOT.'/salaries/card.php?id='.$fac[0]."'>".$fac[0]."</a>";
1180
+								$this->invoice_in_error[$fac[0]] = "Error on default bank number IBAN/BIC for salary ".$salary_url." for employee ".$tmpuser->getNomUrl(0);
1181
+								$this->thirdparty_in_error[$tmpuser->id] = "Error on default bank number IBAN/BIC for salary ".$salary_url." for employee ".$tmpuser->getNomUrl(0);
1182 1182
 								$error++;
1183 1183
 							}
1184
-							dol_syslog(__METHOD__ . " Check BAN Error on default bank number IBAN/BIC reported by verif(): " . implode(', ', $fac), LOG_WARNING);
1184
+							dol_syslog(__METHOD__." Check BAN Error on default bank number IBAN/BIC reported by verif(): ".implode(', ', $fac), LOG_WARNING);
1185 1185
 						}
1186 1186
 					} else {
1187
-						dol_syslog(__METHOD__ . " Check BAN Failed to read company", LOG_WARNING);
1187
+						dol_syslog(__METHOD__." Check BAN Failed to read company", LOG_WARNING);
1188 1188
 					}
1189 1189
 					/*
1190 1190
 					} else {
@@ -1193,14 +1193,14 @@  discard block
 block discarded – undo
1193 1193
 					*/
1194 1194
 				}
1195 1195
 			} else {
1196
-				dol_syslog(__METHOD__ . " Check BAN No invoice to process", LOG_WARNING);
1196
+				dol_syslog(__METHOD__." Check BAN No invoice to process", LOG_WARNING);
1197 1197
 			}
1198 1198
 		}
1199 1199
 
1200 1200
 		$ok = 0;
1201 1201
 
1202 1202
 		// Withdraw invoices in factures_prev array
1203
-		$out = count($factures_prev) . " invoices will be included.";
1203
+		$out = count($factures_prev)." invoices will be included.";
1204 1204
 		//print $out."\n";
1205 1205
 		dol_syslog($out);
1206 1206
 
@@ -1234,32 +1234,32 @@  discard block
 block discarded – undo
1234 1234
 			 * Process order generation
1235 1235
 			 */
1236 1236
 			if (!$error) {
1237
-				$ref = substr($year, -2) . $month;
1237
+				$ref = substr($year, -2).$month;
1238 1238
 
1239 1239
 				// Get next free number for the ref of bon prelevement
1240
-				$sql = "SELECT substring(ref from char_length(ref) - 1)";	// To extract "YYMMXX" from "TYYMMXX"
1241
-				$sql .= " FROM " . MAIN_DB_PREFIX . "prelevement_bons";
1242
-				$sql .= " WHERE ref LIKE '_" . $this->db->escape($ref) . "%'";
1243
-				$sql .= " AND entity = " . ((int) $conf->entity);
1240
+				$sql = "SELECT substring(ref from char_length(ref) - 1)"; // To extract "YYMMXX" from "TYYMMXX"
1241
+				$sql .= " FROM ".MAIN_DB_PREFIX."prelevement_bons";
1242
+				$sql .= " WHERE ref LIKE '_".$this->db->escape($ref)."%'";
1243
+				$sql .= " AND entity = ".((int) $conf->entity);
1244 1244
 				$sql .= " ORDER BY ref DESC LIMIT 1";
1245 1245
 
1246
-				dol_syslog(get_class($this) . " get next free number", LOG_DEBUG);
1246
+				dol_syslog(get_class($this)." get next free number", LOG_DEBUG);
1247 1247
 				$resql = $this->db->query($sql);
1248 1248
 
1249 1249
 				if ($resql) {
1250 1250
 					$row = $this->db->fetch_row($resql);
1251 1251
 
1252 1252
 					// Build the new ref
1253
-					$ref = "T" . $ref . sprintf("%02d", (intval($row[0]) + 1));
1253
+					$ref = "T".$ref.sprintf("%02d", (intval($row[0]) + 1));
1254 1254
 
1255 1255
 					// $conf->abc->dir_output may be:
1256 1256
 					// /home/ldestailleur/git/dolibarr_15.0/documents/abc/
1257 1257
 					// or
1258 1258
 					// /home/ldestailleur/git/dolibarr_15.0/documents/X/abc with X >= 2 with multicompany.
1259 1259
 					if ($type != 'bank-transfer') {
1260
-						$dir = $conf->prelevement->dir_output . '/receipts';
1260
+						$dir = $conf->prelevement->dir_output.'/receipts';
1261 1261
 					} else {
1262
-						$dir = $conf->paymentbybanktransfer->dir_output . '/receipts';
1262
+						$dir = $conf->paymentbybanktransfer->dir_output.'/receipts';
1263 1263
 					}
1264 1264
 					if (!is_dir($dir)) {
1265 1265
 						dol_mkdir($dir);
@@ -1267,41 +1267,41 @@  discard block
 block discarded – undo
1267 1267
 
1268 1268
 					if (isModEnabled('multicompany')) {
1269 1269
 						$labelentity = $conf->entity;
1270
-						$this->filename = $dir . '/' . $ref . '-' . $labelentity . '.xml';
1270
+						$this->filename = $dir.'/'.$ref.'-'.$labelentity.'.xml';
1271 1271
 					} else {
1272
-						$this->filename = $dir . '/' . $ref . '.xml';
1272
+						$this->filename = $dir.'/'.$ref.'.xml';
1273 1273
 					}
1274 1274
 
1275 1275
 					// Create withdraw order in database
1276
-					$sql = "INSERT INTO " . MAIN_DB_PREFIX . "prelevement_bons (";
1276
+					$sql = "INSERT INTO ".MAIN_DB_PREFIX."prelevement_bons (";
1277 1277
 					$sql .= "ref, entity, datec, type, fk_bank_account";
1278 1278
 					$sql .= ") VALUES (";
1279
-					$sql .= "'" . $this->db->escape($ref) . "'";
1280
-					$sql .= ", " . ((int) $conf->entity);
1281
-					$sql .= ", '" . $this->db->idate($now) . "'";
1282
-					$sql .= ", '" . ($type == 'bank-transfer' ? 'bank-transfer' : 'debit-order') . "'";
1283
-					$sql .= ", " . ((int) $fk_bank_account);
1279
+					$sql .= "'".$this->db->escape($ref)."'";
1280
+					$sql .= ", ".((int) $conf->entity);
1281
+					$sql .= ", '".$this->db->idate($now)."'";
1282
+					$sql .= ", '".($type == 'bank-transfer' ? 'bank-transfer' : 'debit-order')."'";
1283
+					$sql .= ", ".((int) $fk_bank_account);
1284 1284
 					$sql .= ")";
1285 1285
 
1286 1286
 					$resql = $this->db->query($sql);
1287 1287
 
1288 1288
 
1289 1289
 					if ($resql) {
1290
-						$prev_id = $this->db->last_insert_id(MAIN_DB_PREFIX . "prelevement_bons");
1290
+						$prev_id = $this->db->last_insert_id(MAIN_DB_PREFIX."prelevement_bons");
1291 1291
 						$this->id = $prev_id;
1292 1292
 						$this->ref = $ref;
1293 1293
 					} else {
1294 1294
 						$error++;
1295
-						dol_syslog(__METHOD__ . " Create withdraw receipt " . $this->db->lasterror(), LOG_ERR);
1295
+						dol_syslog(__METHOD__." Create withdraw receipt ".$this->db->lasterror(), LOG_ERR);
1296 1296
 					}
1297 1297
 				} else {
1298 1298
 					$error++;
1299
-					dol_syslog(__METHOD__ . " Get last withdraw receipt " . $this->db->lasterror(), LOG_ERR);
1299
+					dol_syslog(__METHOD__." Get last withdraw receipt ".$this->db->lasterror(), LOG_ERR);
1300 1300
 				}
1301 1301
 			}
1302 1302
 
1303 1303
 			if (!$error) {
1304
-				dol_syslog(__METHOD__ . " Now loop on each document to insert them in llx_prelevement_demande");
1304
+				dol_syslog(__METHOD__." Now loop on each document to insert them in llx_prelevement_demande");
1305 1305
 
1306 1306
 				// Add lines for the bon
1307 1307
 				if (count($factures_prev) > 0) {
@@ -1330,17 +1330,17 @@  discard block
 block discarded – undo
1330 1330
 						}
1331 1331
 
1332 1332
 						// Update invoice requests as done
1333
-						$sql = "UPDATE " . MAIN_DB_PREFIX . "prelevement_demande";
1333
+						$sql = "UPDATE ".MAIN_DB_PREFIX."prelevement_demande";
1334 1334
 						$sql .= " SET traite = 1";
1335
-						$sql .= ", date_traite = '" . $this->db->idate($now) . "'";
1336
-						$sql .= ", fk_prelevement_bons = " . ((int) $this->id);
1337
-						$sql .= " WHERE rowid = " . ((int) $fac[1]);
1335
+						$sql .= ", date_traite = '".$this->db->idate($now)."'";
1336
+						$sql .= ", fk_prelevement_bons = ".((int) $this->id);
1337
+						$sql .= " WHERE rowid = ".((int) $fac[1]);
1338 1338
 
1339 1339
 						$resql = $this->db->query($sql);
1340 1340
 						if (!$resql) {
1341 1341
 							$error++;
1342 1342
 							$this->errors[] = $this->db->lasterror();
1343
-							dol_syslog(__METHOD__ . " Update Error=" . $this->db->lasterror(), LOG_ERR);
1343
+							dol_syslog(__METHOD__." Update Error=".$this->db->lasterror(), LOG_ERR);
1344 1344
 						}
1345 1345
 					}
1346 1346
 				}
@@ -1351,7 +1351,7 @@  discard block
 block discarded – undo
1351 1351
 				 * Create file of type='direct-debit' for direct debit order or type='bank-transfer' for credit transfer into a XML file
1352 1352
 				 */
1353 1353
 
1354
-				dol_syslog(__METHOD__ . " Init direct debit or credit transfer file for " . count($factures_prev) . " invoices", LOG_DEBUG);
1354
+				dol_syslog(__METHOD__." Init direct debit or credit transfer file for ".count($factures_prev)." invoices", LOG_DEBUG);
1355 1355
 
1356 1356
 				if (count($factures_prev) > 0) {
1357 1357
 					$this->date_echeance = $datetimeprev;
@@ -1367,7 +1367,7 @@  discard block
 block discarded – undo
1367 1367
 						$this->emetteur_iban               = $account->iban;
1368 1368
 						$this->emetteur_bic                = $account->bic;
1369 1369
 
1370
-						$this->emetteur_ics = (($type == 'bank-transfer' && getDolGlobalString("SEPA_USE_IDS")) ? $account->ics_transfer : $account->ics);	// Example "FR78ZZZ123456"
1370
+						$this->emetteur_ics = (($type == 'bank-transfer' && getDolGlobalString("SEPA_USE_IDS")) ? $account->ics_transfer : $account->ics); // Example "FR78ZZZ123456"
1371 1371
 
1372 1372
 						$this->raison_sociale = $account->proprio;
1373 1373
 					}
@@ -1386,7 +1386,7 @@  discard block
 block discarded – undo
1386 1386
 						$error++;
1387 1387
 					}
1388 1388
 				}
1389
-				dol_syslog(__METHOD__ . " Bank order file has been generated under filename " . $this->filename, LOG_DEBUG);
1389
+				dol_syslog(__METHOD__." Bank order file has been generated under filename ".$this->filename, LOG_DEBUG);
1390 1390
 			}
1391 1391
 
1392 1392
 
@@ -1394,15 +1394,15 @@  discard block
 block discarded – undo
1394 1394
 			 * Update total defined after generation of file
1395 1395
 			 */
1396 1396
 			if (!$error) {
1397
-				$sql = "UPDATE " . MAIN_DB_PREFIX . "prelevement_bons";
1398
-				$sql .= " SET amount = " . price2num($this->total);
1399
-				$sql .= " WHERE rowid = " . ((int) $this->id);
1400
-				$sql .= " AND entity = " . ((int) $conf->entity);
1397
+				$sql = "UPDATE ".MAIN_DB_PREFIX."prelevement_bons";
1398
+				$sql .= " SET amount = ".price2num($this->total);
1399
+				$sql .= " WHERE rowid = ".((int) $this->id);
1400
+				$sql .= " AND entity = ".((int) $conf->entity);
1401 1401
 				$resql = $this->db->query($sql);
1402 1402
 
1403 1403
 				if (!$resql) {
1404 1404
 					$error++;
1405
-					dol_syslog(__METHOD__ . " Error update total: " . $this->db->error(), LOG_ERR);
1405
+					dol_syslog(__METHOD__." Error update total: ".$this->db->error(), LOG_ERR);
1406 1406
 				}
1407 1407
 			}
1408 1408
 
@@ -1422,7 +1422,7 @@  discard block
 block discarded – undo
1422 1422
 
1423 1423
 			if (!$error) {
1424 1424
 				$this->db->commit();
1425
-				return count($factures_prev);	// The error of failed lines are into $this->invoice_in_error and $this->thirdparty_in_error
1425
+				return count($factures_prev); // The error of failed lines are into $this->invoice_in_error and $this->thirdparty_in_error
1426 1426
 			} else {
1427 1427
 				$this->db->rollback();
1428 1428
 				return -1;
@@ -1461,7 +1461,7 @@  discard block
 block discarded – undo
1461 1461
 		}
1462 1462
 
1463 1463
 		if (!$error) {
1464
-			$sql = "DELETE FROM " . MAIN_DB_PREFIX . "prelevement WHERE fk_prelevement_lignes IN (SELECT rowid FROM " . MAIN_DB_PREFIX . "prelevement_lignes WHERE fk_prelevement_bons = " . ((int) $this->id) . ")";
1464
+			$sql = "DELETE FROM ".MAIN_DB_PREFIX."prelevement WHERE fk_prelevement_lignes IN (SELECT rowid FROM ".MAIN_DB_PREFIX."prelevement_lignes WHERE fk_prelevement_bons = ".((int) $this->id).")";
1465 1465
 			$resql1 = $this->db->query($sql);
1466 1466
 			if (!$resql1) {
1467 1467
 				dol_print_error($this->db);
@@ -1469,7 +1469,7 @@  discard block
 block discarded – undo
1469 1469
 		}
1470 1470
 
1471 1471
 		if (!$error) {
1472
-			$sql = "DELETE FROM " . MAIN_DB_PREFIX . "prelevement_lignes WHERE fk_prelevement_bons = " . ((int) $this->id);
1472
+			$sql = "DELETE FROM ".MAIN_DB_PREFIX."prelevement_lignes WHERE fk_prelevement_bons = ".((int) $this->id);
1473 1473
 			$resql2 = $this->db->query($sql);
1474 1474
 			if (!$resql2) {
1475 1475
 				dol_print_error($this->db);
@@ -1477,7 +1477,7 @@  discard block
 block discarded – undo
1477 1477
 		}
1478 1478
 
1479 1479
 		if (!$error) {
1480
-			$sql = "DELETE FROM " . MAIN_DB_PREFIX . "prelevement_bons WHERE rowid = " . ((int) $this->id);
1480
+			$sql = "DELETE FROM ".MAIN_DB_PREFIX."prelevement_bons WHERE rowid = ".((int) $this->id);
1481 1481
 			$resql3 = $this->db->query($sql);
1482 1482
 			if (!$resql3) {
1483 1483
 				dol_print_error($this->db);
@@ -1485,7 +1485,7 @@  discard block
 block discarded – undo
1485 1485
 		}
1486 1486
 
1487 1487
 		if (!$error) {
1488
-			$sql = "UPDATE " . MAIN_DB_PREFIX . "prelevement_demande SET fk_prelevement_bons = NULL, traite = 0 WHERE fk_prelevement_bons = " . ((int) $this->id);
1488
+			$sql = "UPDATE ".MAIN_DB_PREFIX."prelevement_demande SET fk_prelevement_bons = NULL, traite = 0 WHERE fk_prelevement_bons = ".((int) $this->id);
1489 1489
 			$resql4 = $this->db->query($sql);
1490 1490
 			if (!$resql4) {
1491 1491
 				dol_print_error($this->db);
@@ -1527,22 +1527,22 @@  discard block
 block discarded – undo
1527 1527
 			$labeltoshow = 'PaymentByBankTransfer';
1528 1528
 		}
1529 1529
 
1530
-		$label = img_picto('', $this->picto) . ' <u>' . $langs->trans($labeltoshow) . '</u> ' . $this->getLibStatut(5);
1530
+		$label = img_picto('', $this->picto).' <u>'.$langs->trans($labeltoshow).'</u> '.$this->getLibStatut(5);
1531 1531
 		$label .= '<br>';
1532
-		$label .= '<b>' . $langs->trans('Ref') . ':</b> ' . $this->ref;
1532
+		$label .= '<b>'.$langs->trans('Ref').':</b> '.$this->ref;
1533 1533
 		if (isset($this->amount)) {
1534
-			$label .= '<br><b>' . $langs->trans("Amount") . ":</b> " . price($this->amount);
1534
+			$label .= '<br><b>'.$langs->trans("Amount").":</b> ".price($this->amount);
1535 1535
 		}
1536 1536
 		if (isset($this->date_trans)) {
1537
-			$label .= '<br><b>' . $langs->trans("TransData") . ":</b> " . dol_print_date($this->date_trans, 'dayhour', 'tzuserrel');
1537
+			$label .= '<br><b>'.$langs->trans("TransData").":</b> ".dol_print_date($this->date_trans, 'dayhour', 'tzuserrel');
1538 1538
 		}
1539 1539
 		/*if (isset($this->date_credit)) {
1540 1540
 			$label .= '<br><b>'.$langs->trans("TransData").":</b> ".dol_print_date($this->date_credit, 'dayhour', 'tzuserrel');
1541 1541
 		}*/
1542 1542
 
1543
-		$url = DOL_URL_ROOT . '/compta/prelevement/card.php?id=' . $this->id;
1543
+		$url = DOL_URL_ROOT.'/compta/prelevement/card.php?id='.$this->id;
1544 1544
 		if (!empty($this->type) && $this->type == 'bank-transfer') {
1545
-			$url = DOL_URL_ROOT . '/compta/prelevement/card.php?id=' . $this->id;
1545
+			$url = DOL_URL_ROOT.'/compta/prelevement/card.php?id='.$this->id;
1546 1546
 		}
1547 1547
 
1548 1548
 		if ($option != 'nolink') {
@@ -1560,21 +1560,21 @@  discard block
 block discarded – undo
1560 1560
 		if (empty($notooltip)) {
1561 1561
 			if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
1562 1562
 				$label = $langs->trans("ShowMyObject");
1563
-				$linkclose .= ' alt="' . dol_escape_htmltag($label, 1) . '"';
1563
+				$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
1564 1564
 			}
1565
-			$linkclose .= ' title="' . dol_escape_htmltag($label, 1) . '"';
1566
-			$linkclose .= ' class="classfortooltip' . ($morecss ? ' ' . $morecss : '') . '"';
1565
+			$linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"';
1566
+			$linkclose .= ' class="classfortooltip'.($morecss ? ' '.$morecss : '').'"';
1567 1567
 		} else {
1568
-			$linkclose = ($morecss ? ' class="' . $morecss . '"' : '');
1568
+			$linkclose = ($morecss ? ' class="'.$morecss.'"' : '');
1569 1569
 		}
1570 1570
 
1571
-		$linkstart = '<a href="' . $url . '"';
1572
-		$linkstart .= $linkclose . '>';
1571
+		$linkstart = '<a href="'.$url.'"';
1572
+		$linkstart .= $linkclose.'>';
1573 1573
 		$linkend = '</a>';
1574 1574
 
1575 1575
 		$result .= $linkstart;
1576 1576
 		if ($withpicto) {
1577
-			$result .= img_object(($notooltip ? '' : $label), ($this->picto ? $this->picto : 'generic'), ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="' . (($withpicto != 2) ? 'paddingright ' : '') . 'classfortooltip"'), 0, 0, $notooltip ? 0 : 1);
1577
+			$result .= img_object(($notooltip ? '' : $label), ($this->picto ? $this->picto : 'generic'), ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip ? 0 : 1);
1578 1578
 		}
1579 1579
 		if ($withpicto != 2) {
1580 1580
 			$result .= $this->ref;
@@ -1603,8 +1603,8 @@  discard block
 block discarded – undo
1603 1603
 	 */
1604 1604
 	public function deleteNotificationById($rowid)
1605 1605
 	{
1606
-		$sql = "DELETE FROM " . MAIN_DB_PREFIX . "notify_def";
1607
-		$sql .= " WHERE rowid = " . ((int) $rowid);
1606
+		$sql = "DELETE FROM ".MAIN_DB_PREFIX."notify_def";
1607
+		$sql .= " WHERE rowid = ".((int) $rowid);
1608 1608
 
1609 1609
 		if ($this->db->query($sql)) {
1610 1610
 			return 0;
@@ -1628,8 +1628,8 @@  discard block
 block discarded – undo
1628 1628
 			$userid = $user;
1629 1629
 		}
1630 1630
 
1631
-		$sql = "DELETE FROM " . MAIN_DB_PREFIX . "notify_def";
1632
-		$sql .= " WHERE fk_user=" . ((int) $userid) . " AND fk_action='" . $this->db->escape($action) . "'";
1631
+		$sql = "DELETE FROM ".MAIN_DB_PREFIX."notify_def";
1632
+		$sql .= " WHERE fk_user=".((int) $userid)." AND fk_action='".$this->db->escape($action)."'";
1633 1633
 
1634 1634
 		if ($this->db->query($sql)) {
1635 1635
 			return 0;
@@ -1661,15 +1661,15 @@  discard block
 block discarded – undo
1661 1661
 		if ($this->deleteNotification($user, $action) == 0) {
1662 1662
 			$now = dol_now();
1663 1663
 
1664
-			$sql = "INSERT INTO " . MAIN_DB_PREFIX . "notify_def (datec,fk_user, fk_soc, fk_contact, fk_action)";
1665
-			$sql .= " VALUES ('" . $this->db->idate($now) . "', " . ((int) $userid) . ", 'NULL', 'NULL', '" . $this->db->escape($action) . "')";
1664
+			$sql = "INSERT INTO ".MAIN_DB_PREFIX."notify_def (datec,fk_user, fk_soc, fk_contact, fk_action)";
1665
+			$sql .= " VALUES ('".$this->db->idate($now)."', ".((int) $userid).", 'NULL', 'NULL', '".$this->db->escape($action)."')";
1666 1666
 
1667
-			dol_syslog("adnotiff: " . $sql);
1667
+			dol_syslog("adnotiff: ".$sql);
1668 1668
 			if ($this->db->query($sql)) {
1669
-				$result = 0;  // @phan-suppress-current-line PhanPluginRedundantAssignment
1669
+				$result = 0; // @phan-suppress-current-line PhanPluginRedundantAssignment
1670 1670
 			} else {
1671 1671
 				$result = -1;
1672
-				dol_syslog(get_class($this) . "::addNotification Error $result");
1672
+				dol_syslog(get_class($this)."::addNotification Error $result");
1673 1673
 			}
1674 1674
 		}
1675 1675
 
@@ -1704,7 +1704,7 @@  discard block
 block discarded – undo
1704 1704
 
1705 1705
 		$result = 0;
1706 1706
 
1707
-		dol_syslog(get_class($this) . "::generate build file=" . $this->filename . " type=" . $type);
1707
+		dol_syslog(get_class($this)."::generate build file=".$this->filename." type=".$type);
1708 1708
 
1709 1709
 		$this->file = fopen($this->filename, "w");
1710 1710
 		if (empty($this->file)) {
@@ -1750,13 +1750,13 @@  discard block
 block discarded – undo
1750 1750
 				$sql .= " f.ref as reffac, p.fk_facture as idfac,";
1751 1751
 				$sql .= " rib.rowid, rib.datec, rib.iban_prefix as iban, rib.bic as bic, rib.rowid as drum, rib.rum, rib.date_rum";
1752 1752
 				$sql .= " FROM";
1753
-				$sql .= " " . MAIN_DB_PREFIX . "prelevement_lignes as pl,";
1754
-				$sql .= " " . MAIN_DB_PREFIX . "facture as f,";
1755
-				$sql .= " " . MAIN_DB_PREFIX . "prelevement as p,";
1756
-				$sql .= " " . MAIN_DB_PREFIX . "societe as soc,";
1757
-				$sql .= " " . MAIN_DB_PREFIX . "c_country as c,";
1758
-				$sql .= " " . MAIN_DB_PREFIX . "societe_rib as rib";
1759
-				$sql .= " WHERE pl.fk_prelevement_bons = " . ((int) $this->id);
1753
+				$sql .= " ".MAIN_DB_PREFIX."prelevement_lignes as pl,";
1754
+				$sql .= " ".MAIN_DB_PREFIX."facture as f,";
1755
+				$sql .= " ".MAIN_DB_PREFIX."prelevement as p,";
1756
+				$sql .= " ".MAIN_DB_PREFIX."societe as soc,";
1757
+				$sql .= " ".MAIN_DB_PREFIX."c_country as c,";
1758
+				$sql .= " ".MAIN_DB_PREFIX."societe_rib as rib";
1759
+				$sql .= " WHERE pl.fk_prelevement_bons = ".((int) $this->id);
1760 1760
 				$sql .= " AND pl.rowid = p.fk_prelevement_lignes";
1761 1761
 				$sql .= " AND p.fk_facture = f.rowid";
1762 1762
 				$sql .= " AND f.fk_soc = soc.rowid";
@@ -1792,7 +1792,7 @@  discard block
 block discarded – undo
1792 1792
 					$nbtotalDrctDbtTxInf = $i;
1793 1793
 				} else {
1794 1794
 					$this->error = $this->db->lasterror();
1795
-					fwrite($this->file, 'ERROR DEBITOR ' . $sql . $CrLf); // DEBITOR = Customers
1795
+					fwrite($this->file, 'ERROR DEBITOR '.$sql.$CrLf); // DEBITOR = Customers
1796 1796
 					$result = -2;
1797 1797
 				}
1798 1798
 
@@ -1809,26 +1809,26 @@  discard block
 block discarded – undo
1809 1809
 				 * SECTION CREATION SEPA FILE - ISO200022
1810 1810
 				 */
1811 1811
 				// SEPA File Header
1812
-				fwrite($this->file, '<' . '?xml version="1.0" encoding="UTF-8" standalone="yes"?' . '>' . $CrLf);
1813
-				fwrite($this->file, '<Document xmlns="urn:iso:std:iso:20022:tech:xsd:pain.008.001.02" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">' . $CrLf);
1814
-				fwrite($this->file, '	<CstmrDrctDbtInitn>' . $CrLf);
1812
+				fwrite($this->file, '<'.'?xml version="1.0" encoding="UTF-8" standalone="yes"?'.'>'.$CrLf);
1813
+				fwrite($this->file, '<Document xmlns="urn:iso:std:iso:20022:tech:xsd:pain.008.001.02" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">'.$CrLf);
1814
+				fwrite($this->file, '	<CstmrDrctDbtInitn>'.$CrLf);
1815 1815
 				// SEPA Group header
1816
-				fwrite($this->file, '		<GrpHdr>' . $CrLf);
1817
-				fwrite($this->file, '			<MsgId>' . ('DD/' . $dateTime_YMD . '/REF' . $this->id) . '</MsgId>' . $CrLf);
1818
-				fwrite($this->file, '			<CreDtTm>' . $dateTime_ECMA . '</CreDtTm>' . $CrLf);
1819
-				fwrite($this->file, '			<NbOfTxs>' . $i . '</NbOfTxs>' . $CrLf);
1820
-				fwrite($this->file, '			<CtrlSum>' . $this->total . '</CtrlSum>' . $CrLf);
1821
-				fwrite($this->file, '			<InitgPty>' . $CrLf);
1822
-				fwrite($this->file, '				<Nm>' . dolEscapeXML(strtoupper(dol_string_nospecial(dol_string_unaccent($this->raison_sociale), ' '))) . '</Nm>' . $CrLf);
1823
-				fwrite($this->file, '				<Id>' . $CrLf);
1824
-				fwrite($this->file, '				    <PrvtId>' . $CrLf);
1825
-				fwrite($this->file, '					<Othr>' . $CrLf);
1826
-				fwrite($this->file, '						<Id>' . $this->emetteur_ics . '</Id>' . $CrLf);
1827
-				fwrite($this->file, '					</Othr>' . $CrLf);
1828
-				fwrite($this->file, '				    </PrvtId>' . $CrLf);
1829
-				fwrite($this->file, '				</Id>' . $CrLf);
1830
-				fwrite($this->file, '			</InitgPty>' . $CrLf);
1831
-				fwrite($this->file, '		</GrpHdr>' . $CrLf);
1816
+				fwrite($this->file, '		<GrpHdr>'.$CrLf);
1817
+				fwrite($this->file, '			<MsgId>'.('DD/'.$dateTime_YMD.'/REF'.$this->id).'</MsgId>'.$CrLf);
1818
+				fwrite($this->file, '			<CreDtTm>'.$dateTime_ECMA.'</CreDtTm>'.$CrLf);
1819
+				fwrite($this->file, '			<NbOfTxs>'.$i.'</NbOfTxs>'.$CrLf);
1820
+				fwrite($this->file, '			<CtrlSum>'.$this->total.'</CtrlSum>'.$CrLf);
1821
+				fwrite($this->file, '			<InitgPty>'.$CrLf);
1822
+				fwrite($this->file, '				<Nm>'.dolEscapeXML(strtoupper(dol_string_nospecial(dol_string_unaccent($this->raison_sociale), ' '))).'</Nm>'.$CrLf);
1823
+				fwrite($this->file, '				<Id>'.$CrLf);
1824
+				fwrite($this->file, '				    <PrvtId>'.$CrLf);
1825
+				fwrite($this->file, '					<Othr>'.$CrLf);
1826
+				fwrite($this->file, '						<Id>'.$this->emetteur_ics.'</Id>'.$CrLf);
1827
+				fwrite($this->file, '					</Othr>'.$CrLf);
1828
+				fwrite($this->file, '				    </PrvtId>'.$CrLf);
1829
+				fwrite($this->file, '				</Id>'.$CrLf);
1830
+				fwrite($this->file, '			</InitgPty>'.$CrLf);
1831
+				fwrite($this->file, '		</GrpHdr>'.$CrLf);
1832 1832
 				// SEPA File Emetteur
1833 1833
 				if ($result != -2) {
1834 1834
 					fwrite($this->file, $fileEmetteurSection);
@@ -1838,9 +1838,9 @@  discard block
 block discarded – undo
1838 1838
 					fwrite($this->file, $fileDebiteurSection);
1839 1839
 				}
1840 1840
 				// SEPA FILE FOOTER
1841
-				fwrite($this->file, '		</PmtInf>' . $CrLf);
1842
-				fwrite($this->file, '	</CstmrDrctDbtInitn>' . $CrLf);
1843
-				fwrite($this->file, '</Document>' . $CrLf);
1841
+				fwrite($this->file, '		</PmtInf>'.$CrLf);
1842
+				fwrite($this->file, '	</CstmrDrctDbtInitn>'.$CrLf);
1843
+				fwrite($this->file, '</Document>'.$CrLf);
1844 1844
 			} else {
1845 1845
 				/**
1846 1846
 				 * SECTION CREATION FICHIER SEPA - CREDIT TRANSFER
@@ -1872,13 +1872,13 @@  discard block
 block discarded – undo
1872 1872
 					$sql .= " s.ref as reffac, p.fk_salary as idfac,";
1873 1873
 					$sql .= " rib.rowid, rib.datec, rib.iban_prefix as iban, rib.bic as bic, rib.rowid as drum, '' as rum, '' as date_rum";
1874 1874
 					$sql .= " FROM";
1875
-					$sql .= " " . MAIN_DB_PREFIX . "prelevement_lignes as pl,";
1876
-					$sql .= " " . MAIN_DB_PREFIX . "salary as s,";
1877
-					$sql .= " " . MAIN_DB_PREFIX . "prelevement as p,";
1878
-					$sql .= " " . MAIN_DB_PREFIX . "user as u";
1879
-					$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_country as c ON u.fk_country = c.rowid,";
1880
-					$sql .= " " . MAIN_DB_PREFIX . "user_rib as rib";
1881
-					$sql .= " WHERE pl.fk_prelevement_bons=" . ((int) $this->id);
1875
+					$sql .= " ".MAIN_DB_PREFIX."prelevement_lignes as pl,";
1876
+					$sql .= " ".MAIN_DB_PREFIX."salary as s,";
1877
+					$sql .= " ".MAIN_DB_PREFIX."prelevement as p,";
1878
+					$sql .= " ".MAIN_DB_PREFIX."user as u";
1879
+					$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON u.fk_country = c.rowid,";
1880
+					$sql .= " ".MAIN_DB_PREFIX."user_rib as rib";
1881
+					$sql .= " WHERE pl.fk_prelevement_bons=".((int) $this->id);
1882 1882
 					$sql .= " AND pl.rowid = p.fk_prelevement_lignes";
1883 1883
 					$sql .= " AND p.fk_salary = s.rowid";
1884 1884
 					$sql .= " AND s.fk_user = u.rowid";
@@ -1889,13 +1889,13 @@  discard block
 block discarded – undo
1889 1889
 					$sql .= " f.ref as reffac, f.ref_supplier as fac_ref_supplier, p.fk_facture_fourn as idfac,";
1890 1890
 					$sql .= " rib.rowid, rib.datec, rib.iban_prefix as iban, rib.bic as bic, rib.rowid as drum, rib.rum, rib.date_rum";
1891 1891
 					$sql .= " FROM";
1892
-					$sql .= " " . MAIN_DB_PREFIX . "prelevement_lignes as pl,";
1893
-					$sql .= " " . MAIN_DB_PREFIX . "facture_fourn as f,";
1894
-					$sql .= " " . MAIN_DB_PREFIX . "prelevement as p,";
1895
-					$sql .= " " . MAIN_DB_PREFIX . "societe as soc";
1896
-					$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_country as c ON soc.fk_pays = c.rowid,";
1897
-					$sql .= " " . MAIN_DB_PREFIX . "societe_rib as rib";
1898
-					$sql .= " WHERE pl.fk_prelevement_bons = " . ((int) $this->id);
1892
+					$sql .= " ".MAIN_DB_PREFIX."prelevement_lignes as pl,";
1893
+					$sql .= " ".MAIN_DB_PREFIX."facture_fourn as f,";
1894
+					$sql .= " ".MAIN_DB_PREFIX."prelevement as p,";
1895
+					$sql .= " ".MAIN_DB_PREFIX."societe as soc";
1896
+					$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON soc.fk_pays = c.rowid,";
1897
+					$sql .= " ".MAIN_DB_PREFIX."societe_rib as rib";
1898
+					$sql .= " WHERE pl.fk_prelevement_bons = ".((int) $this->id);
1899 1899
 					$sql .= " AND pl.rowid = p.fk_prelevement_lignes";
1900 1900
 					$sql .= " AND p.fk_facture_fourn = f.rowid";
1901 1901
 					$sql .= " AND f.fk_soc = soc.rowid";
@@ -1922,7 +1922,7 @@  discard block
 block discarded – undo
1922 1922
 						$daterum = (!empty($obj->date_rum)) ? $this->db->jdate($obj->date_rum) : $this->db->jdate($obj->datec);
1923 1923
 						$refobj = $obj->reffac;
1924 1924
 						if (empty($refobj) && !empty($forsalary)) {	// If ref of salary not defined, we force a value
1925
-							$refobj = "SAL" . $obj->idfac;
1925
+							$refobj = "SAL".$obj->idfac;
1926 1926
 						}
1927 1927
 
1928 1928
 						$fileCrediteurSection .= $this->EnregDestinataireSEPA($obj->code, $obj->nom, $obj->address, $obj->zip, $obj->town, $obj->country_code, $obj->cb, $obj->cg, $obj->cc, $obj->somme, $refobj, $obj->idfac, $obj->iban, $obj->bic, $daterum, $obj->drum, $obj->rum, $type, $obj->fac_ref_supplier);
@@ -1933,7 +1933,7 @@  discard block
 block discarded – undo
1933 1933
 					$nbtotalDrctDbtTxInf = $i;
1934 1934
 				} else {
1935 1935
 					$this->error = $this->db->lasterror();
1936
-					fwrite($this->file, 'ERROR CREDITOR ' . $sql . $CrLf); // CREDITORS = Suppliers
1936
+					fwrite($this->file, 'ERROR CREDITOR '.$sql.$CrLf); // CREDITORS = Suppliers
1937 1937
 					$result = -2;
1938 1938
 				}
1939 1939
 				// Define $fileEmetteurSection. Start of block PmtInf. Will contains all $nbtotalDrctDbtTxInf
@@ -1949,26 +1949,26 @@  discard block
 block discarded – undo
1949 1949
 				 * SECTION CREATION SEPA FILE - CREDIT TRANSFER - ISO200022
1950 1950
 				 */
1951 1951
 				// SEPA File Header
1952
-				fwrite($this->file, '<' . '?xml version="1.0" encoding="UTF-8" standalone="yes"?' . '>' . $CrLf);
1953
-				fwrite($this->file, '<Document xmlns="urn:iso:std:iso:20022:tech:xsd:pain.001.001.03" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">' . $CrLf);
1954
-				fwrite($this->file, '	<CstmrCdtTrfInitn>' . $CrLf);
1952
+				fwrite($this->file, '<'.'?xml version="1.0" encoding="UTF-8" standalone="yes"?'.'>'.$CrLf);
1953
+				fwrite($this->file, '<Document xmlns="urn:iso:std:iso:20022:tech:xsd:pain.001.001.03" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">'.$CrLf);
1954
+				fwrite($this->file, '	<CstmrCdtTrfInitn>'.$CrLf);
1955 1955
 				// SEPA Group header
1956
-				fwrite($this->file, '		<GrpHdr>' . $CrLf);
1957
-				fwrite($this->file, '			<MsgId>' . ('TRF/' . $dateTime_YMD . '/REF' . $this->id) . '</MsgId>' . $CrLf);
1958
-				fwrite($this->file, '			<CreDtTm>' . $dateTime_ECMA . '</CreDtTm>' . $CrLf);
1959
-				fwrite($this->file, '			<NbOfTxs>' . $i . '</NbOfTxs>' . $CrLf);
1960
-				fwrite($this->file, '			<CtrlSum>' . $this->total . '</CtrlSum>' . $CrLf);
1961
-				fwrite($this->file, '			<InitgPty>' . $CrLf);
1962
-				fwrite($this->file, '				<Nm>' . dolEscapeXML(strtoupper(dol_string_nospecial(dol_string_unaccent($this->raison_sociale), ' '))) . '</Nm>' . $CrLf);
1963
-				fwrite($this->file, '				<Id>' . $CrLf);
1964
-				fwrite($this->file, '				    <PrvtId>' . $CrLf);
1965
-				fwrite($this->file, '					<Othr>' . $CrLf);
1966
-				fwrite($this->file, '						<Id>' . $this->emetteur_ics . '</Id>' . $CrLf);
1967
-				fwrite($this->file, '					</Othr>' . $CrLf);
1968
-				fwrite($this->file, '				    </PrvtId>' . $CrLf);
1969
-				fwrite($this->file, '				</Id>' . $CrLf);
1970
-				fwrite($this->file, '			</InitgPty>' . $CrLf);
1971
-				fwrite($this->file, '		</GrpHdr>' . $CrLf);
1956
+				fwrite($this->file, '		<GrpHdr>'.$CrLf);
1957
+				fwrite($this->file, '			<MsgId>'.('TRF/'.$dateTime_YMD.'/REF'.$this->id).'</MsgId>'.$CrLf);
1958
+				fwrite($this->file, '			<CreDtTm>'.$dateTime_ECMA.'</CreDtTm>'.$CrLf);
1959
+				fwrite($this->file, '			<NbOfTxs>'.$i.'</NbOfTxs>'.$CrLf);
1960
+				fwrite($this->file, '			<CtrlSum>'.$this->total.'</CtrlSum>'.$CrLf);
1961
+				fwrite($this->file, '			<InitgPty>'.$CrLf);
1962
+				fwrite($this->file, '				<Nm>'.dolEscapeXML(strtoupper(dol_string_nospecial(dol_string_unaccent($this->raison_sociale), ' '))).'</Nm>'.$CrLf);
1963
+				fwrite($this->file, '				<Id>'.$CrLf);
1964
+				fwrite($this->file, '				    <PrvtId>'.$CrLf);
1965
+				fwrite($this->file, '					<Othr>'.$CrLf);
1966
+				fwrite($this->file, '						<Id>'.$this->emetteur_ics.'</Id>'.$CrLf);
1967
+				fwrite($this->file, '					</Othr>'.$CrLf);
1968
+				fwrite($this->file, '				    </PrvtId>'.$CrLf);
1969
+				fwrite($this->file, '				</Id>'.$CrLf);
1970
+				fwrite($this->file, '			</InitgPty>'.$CrLf);
1971
+				fwrite($this->file, '		</GrpHdr>'.$CrLf);
1972 1972
 				// SEPA File Emetteur (mycompany)
1973 1973
 				if ($result != -2) {
1974 1974
 					fwrite($this->file, $fileEmetteurSection);
@@ -1978,9 +1978,9 @@  discard block
 block discarded – undo
1978 1978
 					fwrite($this->file, $fileCrediteurSection);
1979 1979
 				}
1980 1980
 				// SEPA FILE FOOTER
1981
-				fwrite($this->file, '		</PmtInf>' . $CrLf);
1982
-				fwrite($this->file, '	</CstmrCdtTrfInitn>' . $CrLf);
1983
-				fwrite($this->file, '</Document>' . $CrLf);
1981
+				fwrite($this->file, '		</PmtInf>'.$CrLf);
1982
+				fwrite($this->file, '	</CstmrCdtTrfInitn>'.$CrLf);
1983
+				fwrite($this->file, '</Document>'.$CrLf);
1984 1984
 			}
1985 1985
 		}
1986 1986
 
@@ -1989,10 +1989,10 @@  discard block
 block discarded – undo
1989 1989
 			if ($type != 'bank-transfer') {
1990 1990
 				$sql = "SELECT pl.amount";
1991 1991
 				$sql .= " FROM";
1992
-				$sql .= " " . MAIN_DB_PREFIX . "prelevement_lignes as pl,";
1993
-				$sql .= " " . MAIN_DB_PREFIX . "facture as f,";
1994
-				$sql .= " " . MAIN_DB_PREFIX . "prelevement as p";
1995
-				$sql .= " WHERE pl.fk_prelevement_bons = " . ((int) $this->id);
1992
+				$sql .= " ".MAIN_DB_PREFIX."prelevement_lignes as pl,";
1993
+				$sql .= " ".MAIN_DB_PREFIX."facture as f,";
1994
+				$sql .= " ".MAIN_DB_PREFIX."prelevement as p";
1995
+				$sql .= " WHERE pl.fk_prelevement_bons = ".((int) $this->id);
1996 1996
 				$sql .= " AND pl.rowid = p.fk_prelevement_lignes";
1997 1997
 				$sql .= " AND p.fk_facture = f.rowid";
1998 1998
 
@@ -2015,10 +2015,10 @@  discard block
 block discarded – undo
2015 2015
 			} else {
2016 2016
 				$sql = "SELECT pl.amount";
2017 2017
 				$sql .= " FROM";
2018
-				$sql .= " " . MAIN_DB_PREFIX . "prelevement_lignes as pl,";
2019
-				$sql .= " " . MAIN_DB_PREFIX . "facture_fourn as f,";
2020
-				$sql .= " " . MAIN_DB_PREFIX . "prelevement as p";
2021
-				$sql .= " WHERE pl.fk_prelevement_bons = " . ((int) $this->id);
2018
+				$sql .= " ".MAIN_DB_PREFIX."prelevement_lignes as pl,";
2019
+				$sql .= " ".MAIN_DB_PREFIX."facture_fourn as f,";
2020
+				$sql .= " ".MAIN_DB_PREFIX."prelevement as p";
2021
+				$sql .= " WHERE pl.fk_prelevement_bons = ".((int) $this->id);
2022 2022
 				$sql .= " AND pl.rowid = p.fk_prelevement_lignes";
2023 2023
 				$sql .= " AND p.fk_facture_fourn = f.rowid";
2024 2024
 				// Lines
@@ -2067,7 +2067,7 @@  discard block
 block discarded – undo
2067 2067
 		$pre = substr(dol_string_nospecial(dol_string_unaccent($langs->transnoentitiesnoconv('RUM'))), 0, 3); // Must always be on 3 char ('RUM' or 'UMR'. This is a protection against bad translation)
2068 2068
 
2069 2069
 		// 3 char + '-' + 12 + '-' + id + '-' + code 		Must be lower than 32.
2070
-		return $pre . '-' . dol_print_date($row_datec, 'dayhourlogsmall') . '-' . dol_trunc($row_drum . ($row_code_client ? '-' . $row_code_client : ''), 13, 'right', 'UTF-8', 1);
2070
+		return $pre.'-'.dol_print_date($row_datec, 'dayhourlogsmall').'-'.dol_trunc($row_drum.($row_code_client ? '-'.$row_code_client : ''), 13, 'right', 'UTF-8', 1);
2071 2071
 	}
2072 2072
 
2073 2073
 
@@ -2106,11 +2106,11 @@  discard block
 block discarded – undo
2106 2106
 
2107 2107
 		// Raison Sociale Destinataire C2
2108 2108
 
2109
-		fwrite($this->file, substr(strtoupper($client_nom) . "                         ", 0, 24));
2109
+		fwrite($this->file, substr(strtoupper($client_nom)."                         ", 0, 24));
2110 2110
 
2111 2111
 		// Address optional D1
2112 2112
 		$address = strtr($rib_dom, array(" " => "-", chr(13) => " ", chr(10) => ""));
2113
-		fwrite($this->file, substr($address . "                         ", 0, 24));
2113
+		fwrite($this->file, substr($address."                         ", 0, 24));
2114 2114
 
2115 2115
 		// Zone Reservee D2
2116 2116
 
@@ -2122,17 +2122,17 @@  discard block
 block discarded – undo
2122 2122
 
2123 2123
 		// Numero de compte D4
2124 2124
 
2125
-		fwrite($this->file, substr("000000000000000" . $rib_number, -11));
2125
+		fwrite($this->file, substr("000000000000000".$rib_number, -11));
2126 2126
 
2127 2127
 		// Zone E Montant
2128 2128
 
2129 2129
 		$montant = (round($amount, 2) * 100);
2130 2130
 
2131
-		fwrite($this->file, substr("000000000000000" . $montant, -16));
2131
+		fwrite($this->file, substr("000000000000000".$montant, -16));
2132 2132
 
2133 2133
 		// Label F
2134 2134
 
2135
-		fwrite($this->file, substr("*_" . $ref . "_RDVnet" . $rowid . "                               ", 0, 31));
2135
+		fwrite($this->file, substr("*_".$ref."_RDVnet".$rowid."                               ", 0, 31));
2136 2136
 
2137 2137
 		// Code etablissement G1
2138 2138
 
@@ -2183,7 +2183,7 @@  discard block
 block discarded – undo
2183 2183
 			$row_somme = round((float) $row_somme, 2);
2184 2184
 		}
2185 2185
 
2186
-		include_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php';
2186
+		include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
2187 2187
 
2188 2188
 		$CrLf = "\n";
2189 2189
 		$Rowing = sprintf("%010d", $row_idfac);
@@ -2198,59 +2198,59 @@  discard block
 block discarded – undo
2198 2198
 		if ($type != 'bank-transfer') {
2199 2199
 			// SEPA Paiement Information of buyer for Direct Debit
2200 2200
 			$XML_DEBITOR = '';
2201
-			$XML_DEBITOR .= '			<DrctDbtTxInf>' . $CrLf;
2202
-			$XML_DEBITOR .= '				<PmtId>' . $CrLf;
2201
+			$XML_DEBITOR .= '			<DrctDbtTxInf>'.$CrLf;
2202
+			$XML_DEBITOR .= '				<PmtId>'.$CrLf;
2203 2203
 			// Add EndToEndId. Must be a unique ID for each payment (for example by including bank, buyer or seller, date, checksum)
2204
-			$XML_DEBITOR .= '					<EndToEndId>' . ((getDolGlobalString('PRELEVEMENT_END_TO_END') != "") ? $conf->global->PRELEVEMENT_END_TO_END : ('DD-' . dol_trunc($row_idfac . '-' . $row_ref, 20, 'right', 'UTF-8', 1)) . '-' . $Rowing) . '</EndToEndId>' . $CrLf; // ISO20022 states that EndToEndId has a MaxLength of 35 characters
2205
-			$XML_DEBITOR .= '				</PmtId>' . $CrLf;
2206
-			$XML_DEBITOR .= '				<InstdAmt Ccy="EUR">' . $row_somme . '</InstdAmt>' . $CrLf;
2207
-			$XML_DEBITOR .= '				<DrctDbtTx>' . $CrLf;
2208
-			$XML_DEBITOR .= '					<MndtRltdInf>' . $CrLf;
2209
-			$XML_DEBITOR .= '						<MndtId>' . $Rum . '</MndtId>' . $CrLf;
2210
-			$XML_DEBITOR .= '						<DtOfSgntr>' . $DtOfSgntr . '</DtOfSgntr>' . $CrLf;
2211
-			$XML_DEBITOR .= '						<AmdmntInd>false</AmdmntInd>' . $CrLf;
2212
-			$XML_DEBITOR .= '					</MndtRltdInf>' . $CrLf;
2213
-			$XML_DEBITOR .= '				</DrctDbtTx>' . $CrLf;
2214
-			$XML_DEBITOR .= '				<DbtrAgt>' . $CrLf;
2215
-			$XML_DEBITOR .= '					<FinInstnId>' . $CrLf;
2216
-			$XML_DEBITOR .= '						<BIC>' . $row_bic . '</BIC>' . $CrLf;
2217
-			$XML_DEBITOR .= '					</FinInstnId>' . $CrLf;
2218
-			$XML_DEBITOR .= '				</DbtrAgt>' . $CrLf;
2219
-			$XML_DEBITOR .= '				<Dbtr>' . $CrLf;
2220
-			$XML_DEBITOR .= '					<Nm>' . dolEscapeXML(strtoupper(dol_string_nospecial(dol_string_unaccent($row_nom), ' '))) . '</Nm>' . $CrLf;
2221
-			$XML_DEBITOR .= '					<PstlAdr>' . $CrLf;
2222
-			$XML_DEBITOR .= '						<Ctry>' . $row_country_code . '</Ctry>' . $CrLf;
2204
+			$XML_DEBITOR .= '					<EndToEndId>'.((getDolGlobalString('PRELEVEMENT_END_TO_END') != "") ? $conf->global->PRELEVEMENT_END_TO_END : ('DD-'.dol_trunc($row_idfac.'-'.$row_ref, 20, 'right', 'UTF-8', 1)).'-'.$Rowing).'</EndToEndId>'.$CrLf; // ISO20022 states that EndToEndId has a MaxLength of 35 characters
2205
+			$XML_DEBITOR .= '				</PmtId>'.$CrLf;
2206
+			$XML_DEBITOR .= '				<InstdAmt Ccy="EUR">'.$row_somme.'</InstdAmt>'.$CrLf;
2207
+			$XML_DEBITOR .= '				<DrctDbtTx>'.$CrLf;
2208
+			$XML_DEBITOR .= '					<MndtRltdInf>'.$CrLf;
2209
+			$XML_DEBITOR .= '						<MndtId>'.$Rum.'</MndtId>'.$CrLf;
2210
+			$XML_DEBITOR .= '						<DtOfSgntr>'.$DtOfSgntr.'</DtOfSgntr>'.$CrLf;
2211
+			$XML_DEBITOR .= '						<AmdmntInd>false</AmdmntInd>'.$CrLf;
2212
+			$XML_DEBITOR .= '					</MndtRltdInf>'.$CrLf;
2213
+			$XML_DEBITOR .= '				</DrctDbtTx>'.$CrLf;
2214
+			$XML_DEBITOR .= '				<DbtrAgt>'.$CrLf;
2215
+			$XML_DEBITOR .= '					<FinInstnId>'.$CrLf;
2216
+			$XML_DEBITOR .= '						<BIC>'.$row_bic.'</BIC>'.$CrLf;
2217
+			$XML_DEBITOR .= '					</FinInstnId>'.$CrLf;
2218
+			$XML_DEBITOR .= '				</DbtrAgt>'.$CrLf;
2219
+			$XML_DEBITOR .= '				<Dbtr>'.$CrLf;
2220
+			$XML_DEBITOR .= '					<Nm>'.dolEscapeXML(strtoupper(dol_string_nospecial(dol_string_unaccent($row_nom), ' '))).'</Nm>'.$CrLf;
2221
+			$XML_DEBITOR .= '					<PstlAdr>'.$CrLf;
2222
+			$XML_DEBITOR .= '						<Ctry>'.$row_country_code.'</Ctry>'.$CrLf;
2223 2223
 			$addressline1 = strtr($row_address, array(chr(13) => ", ", chr(10) => ""));
2224
-			$addressline2 = strtr($row_zip . (($row_zip && $row_town) ? ' ' : (string) $row_town), array(chr(13) => ", ", chr(10) => ""));
2224
+			$addressline2 = strtr($row_zip.(($row_zip && $row_town) ? ' ' : (string) $row_town), array(chr(13) => ", ", chr(10) => ""));
2225 2225
 			if (trim($addressline1)) {
2226
-				$XML_DEBITOR .= '						<AdrLine>' . dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline1), ' '), 70, 'right', 'UTF-8', 1)) . '</AdrLine>' . $CrLf;
2226
+				$XML_DEBITOR .= '						<AdrLine>'.dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline1), ' '), 70, 'right', 'UTF-8', 1)).'</AdrLine>'.$CrLf;
2227 2227
 			}
2228 2228
 			if (trim($addressline2)) {
2229
-				$XML_DEBITOR .= '						<AdrLine>' . dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline2), ' '), 70, 'right', 'UTF-8', 1)) . '</AdrLine>' . $CrLf;
2229
+				$XML_DEBITOR .= '						<AdrLine>'.dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline2), ' '), 70, 'right', 'UTF-8', 1)).'</AdrLine>'.$CrLf;
2230 2230
 			}
2231
-			$XML_DEBITOR .= '					</PstlAdr>' . $CrLf;
2232
-			$XML_DEBITOR .= '				</Dbtr>' . $CrLf;
2233
-			$XML_DEBITOR .= '				<DbtrAcct>' . $CrLf;
2234
-			$XML_DEBITOR .= '					<Id>' . $CrLf;
2235
-			$XML_DEBITOR .= '						<IBAN>' . preg_replace('/\s/', '', $row_iban) . '</IBAN>' . $CrLf;
2236
-			$XML_DEBITOR .= '					</Id>' . $CrLf;
2237
-			$XML_DEBITOR .= '				</DbtrAcct>' . $CrLf;
2238
-			$XML_DEBITOR .= '				<RmtInf>' . $CrLf;
2231
+			$XML_DEBITOR .= '					</PstlAdr>'.$CrLf;
2232
+			$XML_DEBITOR .= '				</Dbtr>'.$CrLf;
2233
+			$XML_DEBITOR .= '				<DbtrAcct>'.$CrLf;
2234
+			$XML_DEBITOR .= '					<Id>'.$CrLf;
2235
+			$XML_DEBITOR .= '						<IBAN>'.preg_replace('/\s/', '', $row_iban).'</IBAN>'.$CrLf;
2236
+			$XML_DEBITOR .= '					</Id>'.$CrLf;
2237
+			$XML_DEBITOR .= '				</DbtrAcct>'.$CrLf;
2238
+			$XML_DEBITOR .= '				<RmtInf>'.$CrLf;
2239 2239
 			// A string with some information on payment - 140 max
2240
-			$XML_DEBITOR .= '					<Ustrd>' . getDolGlobalString('PRELEVEMENT_USTRD', dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($row_ref . ($row_comment ? ' - ' . $row_comment : '')), '', '', '', 1), 135, 'right', 'UTF-8', 1))) . '</Ustrd>' . $CrLf; // Free unstuctured data - 140 max
2241
-			$XML_DEBITOR .= '				</RmtInf>' . $CrLf;
2242
-			$XML_DEBITOR .= '			</DrctDbtTxInf>' . $CrLf;
2240
+			$XML_DEBITOR .= '					<Ustrd>'.getDolGlobalString('PRELEVEMENT_USTRD', dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($row_ref.($row_comment ? ' - '.$row_comment : '')), '', '', '', 1), 135, 'right', 'UTF-8', 1))).'</Ustrd>'.$CrLf; // Free unstuctured data - 140 max
2241
+			$XML_DEBITOR .= '				</RmtInf>'.$CrLf;
2242
+			$XML_DEBITOR .= '			</DrctDbtTxInf>'.$CrLf;
2243 2243
 			return $XML_DEBITOR;
2244 2244
 		} else {
2245 2245
 			// SEPA Payment Information of seller for Credit Transfer
2246 2246
 			$XML_CREDITOR = '';
2247
-			$XML_CREDITOR .= '			<CdtTrfTxInf>' . $CrLf;
2248
-			$XML_CREDITOR .= '				<PmtId>' . $CrLf;
2247
+			$XML_CREDITOR .= '			<CdtTrfTxInf>'.$CrLf;
2248
+			$XML_CREDITOR .= '				<PmtId>'.$CrLf;
2249 2249
 			// Add EndToEndId. Must be a unique ID for each payment (for example by including bank, buyer or seller, date, checksum)
2250
-			$XML_CREDITOR .= '					<EndToEndId>' . ((getDolGlobalString('PRELEVEMENT_END_TO_END') != "") ? $conf->global->PRELEVEMENT_END_TO_END : ('CT-' . dol_trunc($row_idfac . '-' . $row_ref, 20, 'right', 'UTF-8', 1)) . '-' . $Rowing) . '</EndToEndId>' . $CrLf; // ISO20022 states that EndToEndId has a MaxLength of 35 characters
2251
-			$XML_CREDITOR .= '				</PmtId>' . $CrLf;
2250
+			$XML_CREDITOR .= '					<EndToEndId>'.((getDolGlobalString('PRELEVEMENT_END_TO_END') != "") ? $conf->global->PRELEVEMENT_END_TO_END : ('CT-'.dol_trunc($row_idfac.'-'.$row_ref, 20, 'right', 'UTF-8', 1)).'-'.$Rowing).'</EndToEndId>'.$CrLf; // ISO20022 states that EndToEndId has a MaxLength of 35 characters
2251
+			$XML_CREDITOR .= '				</PmtId>'.$CrLf;
2252 2252
 			if (!empty($this->sepa_xml_pti_in_ctti)) {
2253
-				$XML_CREDITOR .= '				<PmtTpInf>' . $CrLf;
2253
+				$XML_CREDITOR .= '				<PmtTpInf>'.$CrLf;
2254 2254
 
2255 2255
 				// Can be 'NORM' for normal or 'HIGH' for high priority level
2256 2256
 				if (getDolGlobalString('PAYMENTBYBANKTRANSFER_FORCE_HIGH_PRIORITY')) {
@@ -2258,18 +2258,18 @@  discard block
 block discarded – undo
2258 2258
 				} else {
2259 2259
 					$instrprty = 'NORM';
2260 2260
 				}
2261
-				$XML_CREDITOR .= '					<InstrPrty>' . $instrprty . '</InstrPrty>' . $CrLf;
2262
-				$XML_CREDITOR .= '					<SvcLvl>' . $CrLf;
2263
-				$XML_CREDITOR .= '						<Cd>SEPA</Cd>' . $CrLf;
2264
-				$XML_CREDITOR .= '					</SvcLvl>' . $CrLf;
2265
-				$XML_CREDITOR .= '					<CtgyPurp>' . $CrLf;
2266
-				$XML_CREDITOR .= '						<Cd>CORE</Cd>' . $CrLf;
2267
-				$XML_CREDITOR .= '					</CtgyPurp>' . $CrLf;
2268
-				$XML_CREDITOR .= '				</PmtTpInf>' . $CrLf;
2261
+				$XML_CREDITOR .= '					<InstrPrty>'.$instrprty.'</InstrPrty>'.$CrLf;
2262
+				$XML_CREDITOR .= '					<SvcLvl>'.$CrLf;
2263
+				$XML_CREDITOR .= '						<Cd>SEPA</Cd>'.$CrLf;
2264
+				$XML_CREDITOR .= '					</SvcLvl>'.$CrLf;
2265
+				$XML_CREDITOR .= '					<CtgyPurp>'.$CrLf;
2266
+				$XML_CREDITOR .= '						<Cd>CORE</Cd>'.$CrLf;
2267
+				$XML_CREDITOR .= '					</CtgyPurp>'.$CrLf;
2268
+				$XML_CREDITOR .= '				</PmtTpInf>'.$CrLf;
2269 2269
 			}
2270
-			$XML_CREDITOR .= '				<Amt>' . $CrLf;
2270
+			$XML_CREDITOR .= '				<Amt>'.$CrLf;
2271 2271
 			$XML_CREDITOR .= '				<InstdAmt Ccy="EUR">'.round((float) $row_somme, 2).'</InstdAmt>'.$CrLf;
2272
-			$XML_CREDITOR .= '				</Amt>' . $CrLf;
2272
+			$XML_CREDITOR .= '				</Amt>'.$CrLf;
2273 2273
 			/*
2274 2274
 			 $XML_CREDITOR .= '				<DrctDbtTx>'.$CrLf;
2275 2275
 			 $XML_CREDITOR .= '					<MndtRltdInf>'.$CrLf;
@@ -2280,35 +2280,35 @@  discard block
 block discarded – undo
2280 2280
 			 $XML_CREDITOR .= '				</DrctDbtTx>'.$CrLf;
2281 2281
 			 */
2282 2282
 			//$XML_CREDITOR .= '				<ChrgBr>SLEV</ChrgBr>'.$CrLf;
2283
-			$XML_CREDITOR .= '				<CdtrAgt>' . $CrLf;
2284
-			$XML_CREDITOR .= '					<FinInstnId>' . $CrLf;
2285
-			$XML_CREDITOR .= '						<BIC>' . $row_bic . '</BIC>' . $CrLf;
2286
-			$XML_CREDITOR .= '					</FinInstnId>' . $CrLf;
2287
-			$XML_CREDITOR .= '				</CdtrAgt>' . $CrLf;
2288
-			$XML_CREDITOR .= '				<Cdtr>' . $CrLf;
2289
-			$XML_CREDITOR .= '					<Nm>' . dolEscapeXML(strtoupper(dol_string_nospecial(dol_string_unaccent($row_nom), ' '))) . '</Nm>' . $CrLf;
2290
-			$XML_CREDITOR .= '					<PstlAdr>' . $CrLf;
2291
-			$XML_CREDITOR .= '						<Ctry>' . $row_country_code . '</Ctry>' . $CrLf;
2283
+			$XML_CREDITOR .= '				<CdtrAgt>'.$CrLf;
2284
+			$XML_CREDITOR .= '					<FinInstnId>'.$CrLf;
2285
+			$XML_CREDITOR .= '						<BIC>'.$row_bic.'</BIC>'.$CrLf;
2286
+			$XML_CREDITOR .= '					</FinInstnId>'.$CrLf;
2287
+			$XML_CREDITOR .= '				</CdtrAgt>'.$CrLf;
2288
+			$XML_CREDITOR .= '				<Cdtr>'.$CrLf;
2289
+			$XML_CREDITOR .= '					<Nm>'.dolEscapeXML(strtoupper(dol_string_nospecial(dol_string_unaccent($row_nom), ' '))).'</Nm>'.$CrLf;
2290
+			$XML_CREDITOR .= '					<PstlAdr>'.$CrLf;
2291
+			$XML_CREDITOR .= '						<Ctry>'.$row_country_code.'</Ctry>'.$CrLf;
2292 2292
 			$addressline1 = strtr($row_address, array(chr(13) => ", ", chr(10) => ""));
2293
-			$addressline2 = strtr($row_zip . (($row_zip && $row_town) ? ' ' : (string) $row_town), array(chr(13) => ", ", chr(10) => ""));
2293
+			$addressline2 = strtr($row_zip.(($row_zip && $row_town) ? ' ' : (string) $row_town), array(chr(13) => ", ", chr(10) => ""));
2294 2294
 			if (trim($addressline1)) {
2295
-				$XML_CREDITOR .= '						<AdrLine>' . dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline1), ' '), 70, 'right', 'UTF-8', 1)) . '</AdrLine>' . $CrLf;
2295
+				$XML_CREDITOR .= '						<AdrLine>'.dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline1), ' '), 70, 'right', 'UTF-8', 1)).'</AdrLine>'.$CrLf;
2296 2296
 			}
2297 2297
 			if (trim($addressline2)) {
2298
-				$XML_CREDITOR .= '						<AdrLine>' . dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline2), ' '), 70, 'right', 'UTF-8', 1)) . '</AdrLine>' . $CrLf;
2298
+				$XML_CREDITOR .= '						<AdrLine>'.dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline2), ' '), 70, 'right', 'UTF-8', 1)).'</AdrLine>'.$CrLf;
2299 2299
 			}
2300
-			$XML_CREDITOR .= '					</PstlAdr>' . $CrLf;
2301
-			$XML_CREDITOR .= '				</Cdtr>' . $CrLf;
2302
-			$XML_CREDITOR .= '				<CdtrAcct>' . $CrLf;
2303
-			$XML_CREDITOR .= '					<Id>' . $CrLf;
2304
-			$XML_CREDITOR .= '						<IBAN>' . preg_replace('/\s/', '', $row_iban) . '</IBAN>' . $CrLf;
2305
-			$XML_CREDITOR .= '					</Id>' . $CrLf;
2306
-			$XML_CREDITOR .= '				</CdtrAcct>' . $CrLf;
2307
-			$XML_CREDITOR .= '				<RmtInf>' . $CrLf;
2300
+			$XML_CREDITOR .= '					</PstlAdr>'.$CrLf;
2301
+			$XML_CREDITOR .= '				</Cdtr>'.$CrLf;
2302
+			$XML_CREDITOR .= '				<CdtrAcct>'.$CrLf;
2303
+			$XML_CREDITOR .= '					<Id>'.$CrLf;
2304
+			$XML_CREDITOR .= '						<IBAN>'.preg_replace('/\s/', '', $row_iban).'</IBAN>'.$CrLf;
2305
+			$XML_CREDITOR .= '					</Id>'.$CrLf;
2306
+			$XML_CREDITOR .= '				</CdtrAcct>'.$CrLf;
2307
+			$XML_CREDITOR .= '				<RmtInf>'.$CrLf;
2308 2308
 			// A string with some information on payment - 140 max
2309
-			$XML_CREDITOR .= '					<Ustrd>' . getDolGlobalString('CREDITTRANSFER_USTRD', dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($row_ref . ($row_comment ? ' - ' . $row_comment : '')), '', '', '', 1), 135, 'right', 'UTF-8', 1))) . '</Ustrd>' . $CrLf; // Free unstructured data - 140 max
2310
-			$XML_CREDITOR .= '				</RmtInf>' . $CrLf;
2311
-			$XML_CREDITOR .= '			</CdtTrfTxInf>' . $CrLf;
2309
+			$XML_CREDITOR .= '					<Ustrd>'.getDolGlobalString('CREDITTRANSFER_USTRD', dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($row_ref.($row_comment ? ' - '.$row_comment : '')), '', '', '', 1), 135, 'right', 'UTF-8', 1))).'</Ustrd>'.$CrLf; // Free unstructured data - 140 max
2310
+			$XML_CREDITOR .= '				</RmtInf>'.$CrLf;
2311
+			$XML_CREDITOR .= '			</CdtTrfTxInf>'.$CrLf;
2312 2312
 			return $XML_CREDITOR;
2313 2313
 		}
2314 2314
 	}
@@ -2340,11 +2340,11 @@  discard block
 block discarded – undo
2340 2340
 
2341 2341
 		// Raison Sociale C2
2342 2342
 
2343
-		fwrite($this->file, substr($this->raison_sociale . "                           ", 0, 24));
2343
+		fwrite($this->file, substr($this->raison_sociale."                           ", 0, 24));
2344 2344
 
2345 2345
 		// Reference de la remise creancier D1 sur 7 caracteres
2346 2346
 
2347
-		fwrite($this->file, substr($this->reference_remise . "                           ", 0, 7));
2347
+		fwrite($this->file, substr($this->reference_remise."                           ", 0, 7));
2348 2348
 
2349 2349
 		// Zone Reservee D1-2
2350 2350
 
@@ -2362,7 +2362,7 @@  discard block
 block discarded – undo
2362 2362
 
2363 2363
 		// Numero de compte D4
2364 2364
 
2365
-		fwrite($this->file, substr("000000000000000" . $this->emetteur_numero_compte, -11));
2365
+		fwrite($this->file, substr("000000000000000".$this->emetteur_numero_compte, -11));
2366 2366
 
2367 2367
 		// Zone Reservee E
2368 2368
 
@@ -2425,15 +2425,15 @@  discard block
 block discarded – undo
2425 2425
 			$this->emetteur_iban = $account->iban;
2426 2426
 			$this->emetteur_bic = $account->bic;
2427 2427
 
2428
-			$this->emetteur_ics = (($type == 'bank-transfer' && getDolGlobalString("SEPA_USE_IDS")) ? $account->ics_transfer : $account->ics);  // Ex: PRELEVEMENT_ICS = "FR78ZZZ123456";
2428
+			$this->emetteur_ics = (($type == 'bank-transfer' && getDolGlobalString("SEPA_USE_IDS")) ? $account->ics_transfer : $account->ics); // Ex: PRELEVEMENT_ICS = "FR78ZZZ123456";
2429 2429
 
2430 2430
 			$this->raison_sociale = $account->proprio;
2431 2431
 		}
2432 2432
 
2433 2433
 		// Get pending payments
2434 2434
 		$sql = "SELECT rowid, ref";
2435
-		$sql .= " FROM " . MAIN_DB_PREFIX . "prelevement_bons as pb";
2436
-		$sql .= " WHERE pb.rowid = " . ((int) $this->id);
2435
+		$sql .= " FROM ".MAIN_DB_PREFIX."prelevement_bons as pb";
2436
+		$sql .= " WHERE pb.rowid = ".((int) $this->id);
2437 2437
 
2438 2438
 		$resql = $this->db->query($sql);
2439 2439
 		if ($resql) {
@@ -2450,45 +2450,45 @@  discard block
 block discarded – undo
2450 2450
 			if ($type != 'bank-transfer') {
2451 2451
 				// SEPA Paiement Information of my company for Direct Debit
2452 2452
 				$XML_SEPA_INFO = '';
2453
-				$XML_SEPA_INFO .= '		<PmtInf>' . $CrLf;
2454
-				$XML_SEPA_INFO .= '			<PmtInfId>' . ('DD/' . $dateTime_YMD . '/ID' . $IdBon . '-' . $RefBon) . '</PmtInfId>' . $CrLf;
2455
-				$XML_SEPA_INFO .= '			<PmtMtd>DD</PmtMtd>' . $CrLf;
2456
-				$XML_SEPA_INFO .= '			<NbOfTxs>' . $nombre . '</NbOfTxs>' . $CrLf;
2457
-				$XML_SEPA_INFO .= '			<CtrlSum>' . $total . '</CtrlSum>' . $CrLf;
2458
-				$XML_SEPA_INFO .= '			<PmtTpInf>' . $CrLf;
2459
-				$XML_SEPA_INFO .= '				<SvcLvl>' . $CrLf;
2460
-				$XML_SEPA_INFO .= '					<Cd>SEPA</Cd>' . $CrLf;
2461
-				$XML_SEPA_INFO .= '				</SvcLvl>' . $CrLf;
2462
-				$XML_SEPA_INFO .= '				<LclInstrm>' . $CrLf;
2463
-				$XML_SEPA_INFO .= '					<Cd>CORE</Cd>' . $CrLf;
2464
-				$XML_SEPA_INFO .= '				</LclInstrm>' . $CrLf;
2465
-				$XML_SEPA_INFO .= '				<SeqTp>' . $format . '</SeqTp>' . $CrLf;
2466
-				$XML_SEPA_INFO .= '			</PmtTpInf>' . $CrLf;
2467
-				$XML_SEPA_INFO .= '			<ReqdColltnDt>' . $dateTime_ETAD . '</ReqdColltnDt>' . $CrLf;
2468
-				$XML_SEPA_INFO .= '			<Cdtr>' . $CrLf;
2469
-				$XML_SEPA_INFO .= '				<Nm>' . dolEscapeXML(strtoupper(dol_string_nospecial(dol_string_unaccent($this->raison_sociale), ' '))) . '</Nm>' . $CrLf;
2470
-				$XML_SEPA_INFO .= '				<PstlAdr>' . $CrLf;
2471
-				$XML_SEPA_INFO .= '					<Ctry>' . $country[1] . '</Ctry>' . $CrLf;
2453
+				$XML_SEPA_INFO .= '		<PmtInf>'.$CrLf;
2454
+				$XML_SEPA_INFO .= '			<PmtInfId>'.('DD/'.$dateTime_YMD.'/ID'.$IdBon.'-'.$RefBon).'</PmtInfId>'.$CrLf;
2455
+				$XML_SEPA_INFO .= '			<PmtMtd>DD</PmtMtd>'.$CrLf;
2456
+				$XML_SEPA_INFO .= '			<NbOfTxs>'.$nombre.'</NbOfTxs>'.$CrLf;
2457
+				$XML_SEPA_INFO .= '			<CtrlSum>'.$total.'</CtrlSum>'.$CrLf;
2458
+				$XML_SEPA_INFO .= '			<PmtTpInf>'.$CrLf;
2459
+				$XML_SEPA_INFO .= '				<SvcLvl>'.$CrLf;
2460
+				$XML_SEPA_INFO .= '					<Cd>SEPA</Cd>'.$CrLf;
2461
+				$XML_SEPA_INFO .= '				</SvcLvl>'.$CrLf;
2462
+				$XML_SEPA_INFO .= '				<LclInstrm>'.$CrLf;
2463
+				$XML_SEPA_INFO .= '					<Cd>CORE</Cd>'.$CrLf;
2464
+				$XML_SEPA_INFO .= '				</LclInstrm>'.$CrLf;
2465
+				$XML_SEPA_INFO .= '				<SeqTp>'.$format.'</SeqTp>'.$CrLf;
2466
+				$XML_SEPA_INFO .= '			</PmtTpInf>'.$CrLf;
2467
+				$XML_SEPA_INFO .= '			<ReqdColltnDt>'.$dateTime_ETAD.'</ReqdColltnDt>'.$CrLf;
2468
+				$XML_SEPA_INFO .= '			<Cdtr>'.$CrLf;
2469
+				$XML_SEPA_INFO .= '				<Nm>'.dolEscapeXML(strtoupper(dol_string_nospecial(dol_string_unaccent($this->raison_sociale), ' '))).'</Nm>'.$CrLf;
2470
+				$XML_SEPA_INFO .= '				<PstlAdr>'.$CrLf;
2471
+				$XML_SEPA_INFO .= '					<Ctry>'.$country[1].'</Ctry>'.$CrLf;
2472 2472
 				$addressline1 = strtr($configuration->global->MAIN_INFO_SOCIETE_ADDRESS, array(chr(13) => ", ", chr(10) => ""));
2473
-				$addressline2 = strtr($configuration->global->MAIN_INFO_SOCIETE_ZIP . (($configuration->global->MAIN_INFO_SOCIETE_ZIP || ' ' . $configuration->global->MAIN_INFO_SOCIETE_TOWN) ? ' ' : '') . $configuration->global->MAIN_INFO_SOCIETE_TOWN, array(chr(13) => ", ", chr(10) => ""));
2473
+				$addressline2 = strtr($configuration->global->MAIN_INFO_SOCIETE_ZIP.(($configuration->global->MAIN_INFO_SOCIETE_ZIP || ' '.$configuration->global->MAIN_INFO_SOCIETE_TOWN) ? ' ' : '').$configuration->global->MAIN_INFO_SOCIETE_TOWN, array(chr(13) => ", ", chr(10) => ""));
2474 2474
 				if ($addressline1) {
2475
-					$XML_SEPA_INFO .= '					<AdrLine>' . dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline1), ' '), 70, 'right', 'UTF-8', 1)) . '</AdrLine>' . $CrLf;
2475
+					$XML_SEPA_INFO .= '					<AdrLine>'.dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline1), ' '), 70, 'right', 'UTF-8', 1)).'</AdrLine>'.$CrLf;
2476 2476
 				}
2477 2477
 				if ($addressline2) {
2478
-					$XML_SEPA_INFO .= '					<AdrLine>' . dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline2), ' '), 70, 'right', 'UTF-8', 1)) . '</AdrLine>' . $CrLf;
2478
+					$XML_SEPA_INFO .= '					<AdrLine>'.dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline2), ' '), 70, 'right', 'UTF-8', 1)).'</AdrLine>'.$CrLf;
2479 2479
 				}
2480
-				$XML_SEPA_INFO .= '				</PstlAdr>' . $CrLf;
2481
-				$XML_SEPA_INFO .= '			</Cdtr>' . $CrLf;
2482
-				$XML_SEPA_INFO .= '			<CdtrAcct>' . $CrLf;
2483
-				$XML_SEPA_INFO .= '				<Id>' . $CrLf;
2484
-				$XML_SEPA_INFO .= '					<IBAN>' . preg_replace('/\s/', '', $this->emetteur_iban) . '</IBAN>' . $CrLf;
2485
-				$XML_SEPA_INFO .= '				</Id>' . $CrLf;
2486
-				$XML_SEPA_INFO .= '			</CdtrAcct>' . $CrLf;
2487
-				$XML_SEPA_INFO .= '			<CdtrAgt>' . $CrLf;
2488
-				$XML_SEPA_INFO .= '				<FinInstnId>' . $CrLf;
2489
-				$XML_SEPA_INFO .= '					<BIC>' . $this->emetteur_bic . '</BIC>' . $CrLf;
2490
-				$XML_SEPA_INFO .= '				</FinInstnId>' . $CrLf;
2491
-				$XML_SEPA_INFO .= '			</CdtrAgt>' . $CrLf;
2480
+				$XML_SEPA_INFO .= '				</PstlAdr>'.$CrLf;
2481
+				$XML_SEPA_INFO .= '			</Cdtr>'.$CrLf;
2482
+				$XML_SEPA_INFO .= '			<CdtrAcct>'.$CrLf;
2483
+				$XML_SEPA_INFO .= '				<Id>'.$CrLf;
2484
+				$XML_SEPA_INFO .= '					<IBAN>'.preg_replace('/\s/', '', $this->emetteur_iban).'</IBAN>'.$CrLf;
2485
+				$XML_SEPA_INFO .= '				</Id>'.$CrLf;
2486
+				$XML_SEPA_INFO .= '			</CdtrAcct>'.$CrLf;
2487
+				$XML_SEPA_INFO .= '			<CdtrAgt>'.$CrLf;
2488
+				$XML_SEPA_INFO .= '				<FinInstnId>'.$CrLf;
2489
+				$XML_SEPA_INFO .= '					<BIC>'.$this->emetteur_bic.'</BIC>'.$CrLf;
2490
+				$XML_SEPA_INFO .= '				</FinInstnId>'.$CrLf;
2491
+				$XML_SEPA_INFO .= '			</CdtrAgt>'.$CrLf;
2492 2492
 				/* $XML_SEPA_INFO .= '			<UltmtCdtr>'.$CrLf;
2493 2493
 				 $XML_SEPA_INFO .= '				<Nm>'.dolEscapeXML(strtoupper(dol_string_nospecial(dol_string_unaccent($this->raison_sociale), ' '))).'</Nm>'.$CrLf;
2494 2494
 				 $XML_SEPA_INFO .= '				<PstlAdr>'.$CrLf;
@@ -2497,64 +2497,64 @@  discard block
 block discarded – undo
2497 2497
 				 $XML_SEPA_INFO .= '					<AdrLine>'.dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($conf->global->MAIN_INFO_SOCIETE_ZIP.' '.$conf->global->MAIN_INFO_SOCIETE_TOWN), ' '), 70, 'right', 'UTF-8', 1)).'</AdrLine>'.$CrLf;
2498 2498
 				 $XML_SEPA_INFO .= '				</PstlAdr>'.$CrLf;
2499 2499
 				 $XML_SEPA_INFO .= '			</UltmtCdtr>'.$CrLf;*/
2500
-				$XML_SEPA_INFO .= '			<ChrgBr>SLEV</ChrgBr>' . $CrLf; // Field "Responsible of fees". Must be SLEV
2501
-				$XML_SEPA_INFO .= '			<CdtrSchmeId>' . $CrLf;
2502
-				$XML_SEPA_INFO .= '				<Id>' . $CrLf;
2503
-				$XML_SEPA_INFO .= '					<PrvtId>' . $CrLf;
2504
-				$XML_SEPA_INFO .= '						<Othr>' . $CrLf;
2505
-				$XML_SEPA_INFO .= '							<Id>' . $this->emetteur_ics . '</Id>' . $CrLf;
2506
-				$XML_SEPA_INFO .= '							<SchmeNm>' . $CrLf;
2507
-				$XML_SEPA_INFO .= '								<Prtry>SEPA</Prtry>' . $CrLf;
2508
-				$XML_SEPA_INFO .= '							</SchmeNm>' . $CrLf;
2509
-				$XML_SEPA_INFO .= '						</Othr>' . $CrLf;
2510
-				$XML_SEPA_INFO .= '					</PrvtId>' . $CrLf;
2511
-				$XML_SEPA_INFO .= '				</Id>' . $CrLf;
2512
-				$XML_SEPA_INFO .= '			</CdtrSchmeId>' . $CrLf;
2500
+				$XML_SEPA_INFO .= '			<ChrgBr>SLEV</ChrgBr>'.$CrLf; // Field "Responsible of fees". Must be SLEV
2501
+				$XML_SEPA_INFO .= '			<CdtrSchmeId>'.$CrLf;
2502
+				$XML_SEPA_INFO .= '				<Id>'.$CrLf;
2503
+				$XML_SEPA_INFO .= '					<PrvtId>'.$CrLf;
2504
+				$XML_SEPA_INFO .= '						<Othr>'.$CrLf;
2505
+				$XML_SEPA_INFO .= '							<Id>'.$this->emetteur_ics.'</Id>'.$CrLf;
2506
+				$XML_SEPA_INFO .= '							<SchmeNm>'.$CrLf;
2507
+				$XML_SEPA_INFO .= '								<Prtry>SEPA</Prtry>'.$CrLf;
2508
+				$XML_SEPA_INFO .= '							</SchmeNm>'.$CrLf;
2509
+				$XML_SEPA_INFO .= '						</Othr>'.$CrLf;
2510
+				$XML_SEPA_INFO .= '					</PrvtId>'.$CrLf;
2511
+				$XML_SEPA_INFO .= '				</Id>'.$CrLf;
2512
+				$XML_SEPA_INFO .= '			</CdtrSchmeId>'.$CrLf;
2513 2513
 			} else {
2514 2514
 				// SEPA Paiement Information of my company for Credit Transfer
2515 2515
 				$XML_SEPA_INFO = '';
2516
-				$XML_SEPA_INFO .= '		<PmtInf>' . $CrLf;
2517
-				$XML_SEPA_INFO .= '			<PmtInfId>' . ('TRF/' . $dateTime_YMD . '/ID' . $IdBon . '-' . $RefBon) . '</PmtInfId>' . $CrLf;
2518
-				$XML_SEPA_INFO .= '			<PmtMtd>TRF</PmtMtd>' . $CrLf;
2516
+				$XML_SEPA_INFO .= '		<PmtInf>'.$CrLf;
2517
+				$XML_SEPA_INFO .= '			<PmtInfId>'.('TRF/'.$dateTime_YMD.'/ID'.$IdBon.'-'.$RefBon).'</PmtInfId>'.$CrLf;
2518
+				$XML_SEPA_INFO .= '			<PmtMtd>TRF</PmtMtd>'.$CrLf;
2519 2519
 				//$XML_SEPA_INFO .= '			<BtchBookg>False</BtchBookg>'.$CrLf;
2520
-				$XML_SEPA_INFO .= '			<NbOfTxs>' . $nombre . '</NbOfTxs>' . $CrLf;
2521
-				$XML_SEPA_INFO .= '			<CtrlSum>' . $total . '</CtrlSum>' . $CrLf;
2520
+				$XML_SEPA_INFO .= '			<NbOfTxs>'.$nombre.'</NbOfTxs>'.$CrLf;
2521
+				$XML_SEPA_INFO .= '			<CtrlSum>'.$total.'</CtrlSum>'.$CrLf;
2522 2522
 				if (!empty($this->sepa_xml_pti_in_ctti) && !empty($format)) {	// @TODO Using $format (FRST ou RCUR) in a section for a Credit Transfer looks strange.
2523
-					$XML_SEPA_INFO .= '			<PmtTpInf>' . $CrLf;
2524
-					$XML_SEPA_INFO .= '				<SvcLvl>' . $CrLf;
2525
-					$XML_SEPA_INFO .= '					<Cd>SEPA</Cd>' . $CrLf;
2526
-					$XML_SEPA_INFO .= '				</SvcLvl>' . $CrLf;
2527
-					$XML_SEPA_INFO .= '				<LclInstrm>' . $CrLf;
2528
-					$XML_SEPA_INFO .= '					<Cd>CORE</Cd>' . $CrLf;
2529
-					$XML_SEPA_INFO .= '				</LclInstrm>' . $CrLf;
2530
-					$XML_SEPA_INFO .= '				<SeqTp>' . $format . '</SeqTp>' . $CrLf;
2531
-					$XML_SEPA_INFO .= '			</PmtTpInf>' . $CrLf;
2523
+					$XML_SEPA_INFO .= '			<PmtTpInf>'.$CrLf;
2524
+					$XML_SEPA_INFO .= '				<SvcLvl>'.$CrLf;
2525
+					$XML_SEPA_INFO .= '					<Cd>SEPA</Cd>'.$CrLf;
2526
+					$XML_SEPA_INFO .= '				</SvcLvl>'.$CrLf;
2527
+					$XML_SEPA_INFO .= '				<LclInstrm>'.$CrLf;
2528
+					$XML_SEPA_INFO .= '					<Cd>CORE</Cd>'.$CrLf;
2529
+					$XML_SEPA_INFO .= '				</LclInstrm>'.$CrLf;
2530
+					$XML_SEPA_INFO .= '				<SeqTp>'.$format.'</SeqTp>'.$CrLf;
2531
+					$XML_SEPA_INFO .= '			</PmtTpInf>'.$CrLf;
2532 2532
 				}
2533
-				$XML_SEPA_INFO .= '			<ReqdExctnDt>' . dol_print_date($dateTime_ETAD, 'dayrfc') . '</ReqdExctnDt>' . $CrLf;
2534
-				$XML_SEPA_INFO .= '			<Dbtr>' . $CrLf;
2535
-				$XML_SEPA_INFO .= '				<Nm>' . dolEscapeXML(strtoupper(dol_string_nospecial(dol_string_unaccent($this->raison_sociale), ' '))) . '</Nm>' . $CrLf;
2536
-				$XML_SEPA_INFO .= '				<PstlAdr>' . $CrLf;
2537
-				$XML_SEPA_INFO .= '					<Ctry>' . $country[1] . '</Ctry>' . $CrLf;
2533
+				$XML_SEPA_INFO .= '			<ReqdExctnDt>'.dol_print_date($dateTime_ETAD, 'dayrfc').'</ReqdExctnDt>'.$CrLf;
2534
+				$XML_SEPA_INFO .= '			<Dbtr>'.$CrLf;
2535
+				$XML_SEPA_INFO .= '				<Nm>'.dolEscapeXML(strtoupper(dol_string_nospecial(dol_string_unaccent($this->raison_sociale), ' '))).'</Nm>'.$CrLf;
2536
+				$XML_SEPA_INFO .= '				<PstlAdr>'.$CrLf;
2537
+				$XML_SEPA_INFO .= '					<Ctry>'.$country[1].'</Ctry>'.$CrLf;
2538 2538
 				$addressline1 = strtr($configuration->global->MAIN_INFO_SOCIETE_ADDRESS, array(chr(13) => ", ", chr(10) => ""));
2539
-				$addressline2 = strtr($configuration->global->MAIN_INFO_SOCIETE_ZIP . (($configuration->global->MAIN_INFO_SOCIETE_ZIP || ' ' . $configuration->global->MAIN_INFO_SOCIETE_TOWN) ? ' ' : '') . $configuration->global->MAIN_INFO_SOCIETE_TOWN, array(chr(13) => ", ", chr(10) => ""));
2539
+				$addressline2 = strtr($configuration->global->MAIN_INFO_SOCIETE_ZIP.(($configuration->global->MAIN_INFO_SOCIETE_ZIP || ' '.$configuration->global->MAIN_INFO_SOCIETE_TOWN) ? ' ' : '').$configuration->global->MAIN_INFO_SOCIETE_TOWN, array(chr(13) => ", ", chr(10) => ""));
2540 2540
 				if ($addressline1) {
2541
-					$XML_SEPA_INFO .= '					<AdrLine>' . dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline1), ' '), 70, 'right', 'UTF-8', 1)) . '</AdrLine>' . $CrLf;
2541
+					$XML_SEPA_INFO .= '					<AdrLine>'.dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline1), ' '), 70, 'right', 'UTF-8', 1)).'</AdrLine>'.$CrLf;
2542 2542
 				}
2543 2543
 				if ($addressline2) {
2544
-					$XML_SEPA_INFO .= '					<AdrLine>' . dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline2), ' '), 70, 'right', 'UTF-8', 1)) . '</AdrLine>' . $CrLf;
2544
+					$XML_SEPA_INFO .= '					<AdrLine>'.dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline2), ' '), 70, 'right', 'UTF-8', 1)).'</AdrLine>'.$CrLf;
2545 2545
 				}
2546
-				$XML_SEPA_INFO .= '				</PstlAdr>' . $CrLf;
2547
-				$XML_SEPA_INFO .= '			</Dbtr>' . $CrLf;
2548
-				$XML_SEPA_INFO .= '			<DbtrAcct>' . $CrLf;
2549
-				$XML_SEPA_INFO .= '				<Id>' . $CrLf;
2550
-				$XML_SEPA_INFO .= '					<IBAN>' . preg_replace('/\s/', '', $this->emetteur_iban) . '</IBAN>' . $CrLf;
2551
-				$XML_SEPA_INFO .= '				</Id>' . $CrLf;
2552
-				$XML_SEPA_INFO .= '			</DbtrAcct>' . $CrLf;
2553
-				$XML_SEPA_INFO .= '			<DbtrAgt>' . $CrLf;
2554
-				$XML_SEPA_INFO .= '				<FinInstnId>' . $CrLf;
2555
-				$XML_SEPA_INFO .= '					<BIC>' . $this->emetteur_bic . '</BIC>' . $CrLf;
2556
-				$XML_SEPA_INFO .= '				</FinInstnId>' . $CrLf;
2557
-				$XML_SEPA_INFO .= '			</DbtrAgt>' . $CrLf;
2546
+				$XML_SEPA_INFO .= '				</PstlAdr>'.$CrLf;
2547
+				$XML_SEPA_INFO .= '			</Dbtr>'.$CrLf;
2548
+				$XML_SEPA_INFO .= '			<DbtrAcct>'.$CrLf;
2549
+				$XML_SEPA_INFO .= '				<Id>'.$CrLf;
2550
+				$XML_SEPA_INFO .= '					<IBAN>'.preg_replace('/\s/', '', $this->emetteur_iban).'</IBAN>'.$CrLf;
2551
+				$XML_SEPA_INFO .= '				</Id>'.$CrLf;
2552
+				$XML_SEPA_INFO .= '			</DbtrAcct>'.$CrLf;
2553
+				$XML_SEPA_INFO .= '			<DbtrAgt>'.$CrLf;
2554
+				$XML_SEPA_INFO .= '				<FinInstnId>'.$CrLf;
2555
+				$XML_SEPA_INFO .= '					<BIC>'.$this->emetteur_bic.'</BIC>'.$CrLf;
2556
+				$XML_SEPA_INFO .= '				</FinInstnId>'.$CrLf;
2557
+				$XML_SEPA_INFO .= '			</DbtrAgt>'.$CrLf;
2558 2558
 				/* $XML_SEPA_INFO .= '			<UltmtCdtr>'.$CrLf;
2559 2559
 				 $XML_SEPA_INFO .= '				<Nm>'.dolEscapeXML(strtoupper(dol_string_nospecial(dol_string_unaccent($this->raison_sociale), ' '))).'</Nm>'.$CrLf;
2560 2560
 				 $XML_SEPA_INFO .= '				<PstlAdr>'.$CrLf;
@@ -2563,7 +2563,7 @@  discard block
 block discarded – undo
2563 2563
 				 $XML_SEPA_INFO .= '					<AdrLine>'.dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($conf->global->MAIN_INFO_SOCIETE_ZIP.' '.$conf->global->MAIN_INFO_SOCIETE_TOWN), ' '), 70, 'right', 'UTF-8', 1)).'</AdrLine>'.$CrLf;
2564 2564
 				 $XML_SEPA_INFO .= '				</PstlAdr>'.$CrLf;
2565 2565
 				 $XML_SEPA_INFO .= '			</UltmtCdtr>'.$CrLf;*/
2566
-				$XML_SEPA_INFO .= '			<ChrgBr>SLEV</ChrgBr>' . $CrLf; // Field "Responsible of fees". Must be SLEV
2566
+				$XML_SEPA_INFO .= '			<ChrgBr>SLEV</ChrgBr>'.$CrLf; // Field "Responsible of fees". Must be SLEV
2567 2567
 				/*$XML_SEPA_INFO .= '			<CdtrSchmeId>'.$CrLf;
2568 2568
 				 $XML_SEPA_INFO .= '				<Id>'.$CrLf;
2569 2569
 				 $XML_SEPA_INFO .= '					<PrvtId>'.$CrLf;
@@ -2578,7 +2578,7 @@  discard block
 block discarded – undo
2578 2578
 				 $XML_SEPA_INFO .= '			</CdtrSchmeId>'.$CrLf;*/
2579 2579
 			}
2580 2580
 		} else {
2581
-			fwrite($this->file, 'INCORRECT EMETTEUR ' . $this->raison_sociale . $CrLf);
2581
+			fwrite($this->file, 'INCORRECT EMETTEUR '.$this->raison_sociale.$CrLf);
2582 2582
 			$XML_SEPA_INFO = '';
2583 2583
 		}
2584 2584
 		return $XML_SEPA_INFO;
@@ -2630,7 +2630,7 @@  discard block
 block discarded – undo
2630 2630
 
2631 2631
 		$montant = ($total * 100);
2632 2632
 
2633
-		fwrite($this->file, substr("000000000000000" . $montant, -16));
2633
+		fwrite($this->file, substr("000000000000000".$montant, -16));
2634 2634
 
2635 2635
 		// Zone Reservee F
2636 2636
 
@@ -2787,18 +2787,18 @@  discard block
 block discarded – undo
2787 2787
 		$return .= img_picto('', $this->picto);
2788 2788
 		$return .= '</span>';
2789 2789
 		$return .= '<div class="info-box-content">';
2790
-		$return .= '<span class="info-box-ref inline-block tdoverflowmax150 valignmiddle">' . (method_exists($this, 'getNomUrl') ? $this->getNomUrl(1) : $this->ref) . '</span>';
2790
+		$return .= '<span class="info-box-ref inline-block tdoverflowmax150 valignmiddle">'.(method_exists($this, 'getNomUrl') ? $this->getNomUrl(1) : $this->ref).'</span>';
2791 2791
 		if ($selected >= 0) {
2792
-			$return .= '<input id="cb' . $this->id . '" class="flat checkforselect fright" type="checkbox" name="toselect[]" value="' . $this->id . '"' . ($selected ? ' checked="checked"' : '') . '>';
2792
+			$return .= '<input id="cb'.$this->id.'" class="flat checkforselect fright" type="checkbox" name="toselect[]" value="'.$this->id.'"'.($selected ? ' checked="checked"' : '').'>';
2793 2793
 		}
2794 2794
 		if (property_exists($this, 'date_echeance')) {
2795
-			$return .= '<br><span class="opacitymedium">' . $langs->trans("Date") . '</span> : <span class="info-box-label">' . dol_print_date($this->db->jdate($this->date_echeance), 'day') . '</span>';
2795
+			$return .= '<br><span class="opacitymedium">'.$langs->trans("Date").'</span> : <span class="info-box-label">'.dol_print_date($this->db->jdate($this->date_echeance), 'day').'</span>';
2796 2796
 		}
2797 2797
 		if (property_exists($this, 'total')) {
2798
-			$return .= '<br><span class="opacitymedium">' . $langs->trans("Amount") . '</span> : <span class="amount">' . price($this->total) . '</span>';
2798
+			$return .= '<br><span class="opacitymedium">'.$langs->trans("Amount").'</span> : <span class="amount">'.price($this->total).'</span>';
2799 2799
 		}
2800 2800
 		if (method_exists($this, 'LibStatut')) {
2801
-			$return .= '<br><div class="info-box-status">' . $this->getLibStatut(3) . '</div>';
2801
+			$return .= '<br><div class="info-box-status">'.$this->getLibStatut(3).'</div>';
2802 2802
 		}
2803 2803
 		$return .= '</div>';
2804 2804
 		$return .= '</div>';
@@ -2819,9 +2819,9 @@  discard block
 block discarded – undo
2819 2819
 			return 0;
2820 2820
 		}
2821 2821
 		if ($id) {
2822
-			$sql = "SELECT COUNT(*) AS nb FROM " . MAIN_DB_PREFIX . "prelevement_lignes";
2823
-			$sql .= " WHERE fk_prelevement_bons = " . ((int) $id);
2824
-			$sql .= " AND fk_soc = 0";	// fk_soc can't be NULL
2822
+			$sql = "SELECT COUNT(*) AS nb FROM ".MAIN_DB_PREFIX."prelevement_lignes";
2823
+			$sql .= " WHERE fk_prelevement_bons = ".((int) $id);
2824
+			$sql .= " AND fk_soc = 0"; // fk_soc can't be NULL
2825 2825
 			$sql .= " AND fk_user IS NOT NULL";
2826 2826
 
2827 2827
 			$num = 0;
Please login to merge, or discard this patch.
htdocs/user/perms.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -222,9 +222,9 @@  discard block
 block discarded – undo
222 222
 // Read the permissions of a user inherited by its groups
223 223
 $permsgroupbyentity = array();
224 224
 
225
-$sql = "SELECT DISTINCT gr.fk_id, gu.entity";	// fk_id are permission id and entity is entity of the group
225
+$sql = "SELECT DISTINCT gr.fk_id, gu.entity"; // fk_id are permission id and entity is entity of the group
226 226
 $sql .= " FROM ".MAIN_DB_PREFIX."usergroup_rights as gr,";
227
-$sql .= " ".MAIN_DB_PREFIX."usergroup_user as gu";	// all groups of a user
227
+$sql .= " ".MAIN_DB_PREFIX."usergroup_user as gu"; // all groups of a user
228 228
 $sql .= " WHERE gr.entity = ".((int) $entity);
229 229
 // The entity on the table gu=usergroup_user should be useless and should never be used because it is already into gr and r.
230 230
 // but when using MULTICOMPANY_TRANSVERSE_MODE, we may have inserted record that make rubbish result here due to the duplicate record of
@@ -505,7 +505,7 @@  discard block
 block discarded – undo
505 505
 		} else {
506 506
 			$ishidden = 0;
507 507
 		}
508
-		$isexpanded = ! $ishidden;
508
+		$isexpanded = !$ishidden;
509 509
 		//var_dump("isexpanded=".$isexpanded);
510 510
 
511 511
 		$permsgroupbyentitypluszero = array();
@@ -529,7 +529,7 @@  discard block
 block discarded – undo
529 529
 			} else {
530 530
 				$ishidden = 0;
531 531
 			}
532
-			$isexpanded = ! $ishidden;
532
+			$isexpanded = !$ishidden;
533 533
 			//var_dump('$obj->module='.$obj->module.' isexpanded='.$isexpanded);
534 534
 
535 535
 			// Break detected, we get objMod
Please login to merge, or discard this patch.
htdocs/user/class/user.class.php 1 patch
Spacing   +42 added lines, -42 removed lines patch added patch discarded remove patch
@@ -593,11 +593,11 @@  discard block
 block discarded – undo
593 593
 				$this->socialnetworks = ($obj->socialnetworks ? (array) json_decode($obj->socialnetworks, true) : array());
594 594
 				$this->job = $obj->job;
595 595
 				$this->signature = $obj->signature;
596
-				$this->admin		= $obj->admin;
596
+				$this->admin = $obj->admin;
597 597
 				$this->note_public = $obj->note_public;
598 598
 				$this->note_private = $obj->note_private;
599 599
 
600
-				$this->statut		= $obj->status;			// deprecated
600
+				$this->statut		= $obj->status; // deprecated
601 601
 				$this->status		= $obj->status;
602 602
 
603 603
 				$this->photo		= $obj->photo;
@@ -726,7 +726,7 @@  discard block
 block discarded – undo
726 726
 			require_once DOL_DOCUMENT_ROOT.'/core/class/defaultvalues.class.php';
727 727
 
728 728
 			$defaultValues = new DefaultValues($this->db);
729
-			$result = $defaultValues->fetchAll('', '', 0, 0, '(t.user_id:in:0,'.$this->id.') AND (entity:in:'.(isset($this->entity) ? $this->entity : $conf->entity).','.$conf->entity.')');	// User 0 (all) + me (if defined)
729
+			$result = $defaultValues->fetchAll('', '', 0, 0, '(t.user_id:in:0,'.$this->id.') AND (entity:in:'.(isset($this->entity) ? $this->entity : $conf->entity).','.$conf->entity.')'); // User 0 (all) + me (if defined)
730 730
 			//$result = $defaultValues->fetchAll('', '', 0, 0, array('t.user_id'=>array(0, $this->id), 'entity'=>array((isset($this->entity) ? $this->entity : $conf->entity), $conf->entity)));	// User 0 (all) + me (if defined)
731 731
 
732 732
 			if (!is_array($result) && $result < 0) {
@@ -840,16 +840,16 @@  discard block
 block discarded – undo
840 840
 		// Special case for external user
841 841
 		if (!empty($this->socid)) {
842 842
 			if ($module == 'societe' && ($permlevel1 == 'creer' || $permlevel1 == 'write')) {
843
-				return 0;	// An external user never has the permission ->societe->write to see all thirdparties (always restricted to himself)
843
+				return 0; // An external user never has the permission ->societe->write to see all thirdparties (always restricted to himself)
844 844
 			}
845 845
 			if ($module == 'societe' && $permlevel1 == 'client' && $permlevel2 == 'voir') {
846
-				return 0;	// An external user never has the permission ->societe->client->voir to see all thirdparties (always restricted to himself)
846
+				return 0; // An external user never has the permission ->societe->client->voir to see all thirdparties (always restricted to himself)
847 847
 			}
848 848
 			if ($module == 'societe' && $permlevel1 == 'export') {
849
-				return 0;	// An external user never has the permission ->societe->export to see all thirdparties (always restricted to himself)
849
+				return 0; // An external user never has the permission ->societe->export to see all thirdparties (always restricted to himself)
850 850
 			}
851 851
 			if ($module == 'societe' && ($permlevel1 == 'supprimer' || $permlevel1 == 'delete')) {
852
-				return 0;	// An external user never has the permission ->societe->delete to see all thirdparties (always restricted to himself)
852
+				return 0; // An external user never has the permission ->societe->delete to see all thirdparties (always restricted to himself)
853 853
 			}
854 854
 		}
855 855
 
@@ -997,7 +997,7 @@  discard block
 block discarded – undo
997 997
 			$sql .= " FROM ".$this->db->prefix()."rights_def";
998 998
 			$sql .= " WHERE entity = ".((int) $entity);
999 999
 			if (!empty($whereforadd) && $whereforadd != 'allmodules') {
1000
-				$sql .= " AND (".$whereforadd.")";	// Note: parenthesis are important because whereforadd can contains OR. Also note that $whereforadd is already sanitized
1000
+				$sql .= " AND (".$whereforadd.")"; // Note: parenthesis are important because whereforadd can contains OR. Also note that $whereforadd is already sanitized
1001 1001
 			}
1002 1002
 
1003 1003
 			$sqldelete = "DELETE FROM ".$this->db->prefix()."user_rights";
@@ -1133,7 +1133,7 @@  discard block
 block discarded – undo
1133 1133
 			$sql .= " FROM ".$this->db->prefix()."rights_def";
1134 1134
 			$sql .= " WHERE entity IN (".$this->db->sanitize($entity, 0, 0, 0, 0).")";
1135 1135
 			if (!empty($wherefordel) && $wherefordel != 'allmodules') {
1136
-				$sql .= " AND (".$wherefordel.")";	// Note: parenthesis are important because wherefordel can contains OR. Also note that $wherefordel is already sanitized
1136
+				$sql .= " AND (".$wherefordel.")"; // Note: parenthesis are important because wherefordel can contains OR. Also note that $wherefordel is already sanitized
1137 1137
 			}
1138 1138
 
1139 1139
 			// avoid admin to remove his own important rights
@@ -1307,12 +1307,12 @@  discard block
 block discarded – undo
1307 1307
 					$sql .= " AND r.entity = ".((int) $conf->entity);
1308 1308
 				}
1309 1309
 			} else {
1310
-				$sql .= " AND gr.entity = ".((int) $conf->entity);	// Only groups created in current entity
1310
+				$sql .= " AND gr.entity = ".((int) $conf->entity); // Only groups created in current entity
1311 1311
 				// The entity on the table gu=usergroup_user should be useless and should never be used because it is already into gr and r.
1312 1312
 				// but when using MULTICOMPANY_TRANSVERSE_MODE, we may have inserted record that make rubbish result here due to the duplicate record of
1313 1313
 				// other entities, so we are forced to add a filter on gu here
1314 1314
 				$sql .= " AND gu.entity IN (0,".$conf->entity.")";
1315
-				$sql .= " AND r.entity = ".((int) $conf->entity);	// Only permission of modules enabled in current entity
1315
+				$sql .= " AND r.entity = ".((int) $conf->entity); // Only permission of modules enabled in current entity
1316 1316
 			}
1317 1317
 			// End of strange business rule
1318 1318
 			$sql .= " AND gr.fk_usergroup = gu.fk_usergroup";
@@ -1862,7 +1862,7 @@  discard block
 block discarded – undo
1862 1862
 		$this->civility_code = $member->civility_code;
1863 1863
 		$this->lastname     = $member->lastname;
1864 1864
 		$this->firstname    = $member->firstname;
1865
-		$this->gender		= $member->gender;
1865
+		$this->gender = $member->gender;
1866 1866
 		$this->email        = $member->email;
1867 1867
 		$this->fk_member    = $member->id;
1868 1868
 		$this->address      = $member->address;
@@ -2000,44 +2000,44 @@  discard block
 block discarded – undo
2000 2000
 		$this->lastname						= trim((string) $this->lastname);
2001 2001
 		$this->firstname					= trim((string) $this->firstname);
2002 2002
 		$this->ref_employee					= trim((string) $this->ref_employee);
2003
-		$this->national_registration_number	= trim((string) $this->national_registration_number);
2003
+		$this->national_registration_number = trim((string) $this->national_registration_number);
2004 2004
 		$this->employee						= ($this->employee > 0 ? $this->employee : 0);
2005 2005
 		$this->login						= trim((string) $this->login);
2006
-		$this->gender						= trim((string) $this->gender);
2006
+		$this->gender = trim((string) $this->gender);
2007 2007
 
2008 2008
 		$this->pass							= trim((string) $this->pass);
2009
-		$this->api_key						= trim((string) $this->api_key);
2010
-		$this->datestartvalidity			= empty($this->datestartvalidity) ? '' : $this->datestartvalidity;
2011
-		$this->dateendvalidity				= empty($this->dateendvalidity) ? '' : $this->dateendvalidity;
2009
+		$this->api_key = trim((string) $this->api_key);
2010
+		$this->datestartvalidity = empty($this->datestartvalidity) ? '' : $this->datestartvalidity;
2011
+		$this->dateendvalidity = empty($this->dateendvalidity) ? '' : $this->dateendvalidity;
2012 2012
 
2013
-		$this->address						= trim((string) $this->address);
2014
-		$this->zip							= trim((string) $this->zip);
2015
-		$this->town							= trim((string) $this->town);
2013
+		$this->address = trim((string) $this->address);
2014
+		$this->zip = trim((string) $this->zip);
2015
+		$this->town = trim((string) $this->town);
2016 2016
 
2017
-		$this->state_id						= ($this->state_id > 0 ? $this->state_id : 0);
2017
+		$this->state_id = ($this->state_id > 0 ? $this->state_id : 0);
2018 2018
 		$this->country_id					= ($this->country_id > 0 ? $this->country_id : 0);
2019
-		$this->office_phone					= trim((string) $this->office_phone);
2019
+		$this->office_phone = trim((string) $this->office_phone);
2020 2020
 		$this->office_fax					= trim((string) $this->office_fax);
2021
-		$this->user_mobile					= trim((string) $this->user_mobile);
2022
-		$this->personal_mobile				= trim((string) $this->personal_mobile);
2023
-		$this->email						= trim((string) $this->email);
2024
-		$this->personal_email				= trim((string) $this->personal_email);
2025
-
2026
-		$this->job							= trim((string) $this->job);
2027
-		$this->signature					= trim((string) $this->signature);
2028
-		$this->note_public					= trim((string) $this->note_public);
2029
-		$this->note_private					= trim((string) $this->note_private);
2030
-		$this->openid						= trim((string) $this->openid);
2021
+		$this->user_mobile = trim((string) $this->user_mobile);
2022
+		$this->personal_mobile = trim((string) $this->personal_mobile);
2023
+		$this->email = trim((string) $this->email);
2024
+		$this->personal_email = trim((string) $this->personal_email);
2025
+
2026
+		$this->job = trim((string) $this->job);
2027
+		$this->signature = trim((string) $this->signature);
2028
+		$this->note_public = trim((string) $this->note_public);
2029
+		$this->note_private = trim((string) $this->note_private);
2030
+		$this->openid = trim((string) $this->openid);
2031 2031
 		$this->admin						= ($this->admin > 0 ? $this->admin : 0);
2032 2032
 
2033 2033
 		$this->accountancy_code				= trim((string) $this->accountancy_code);
2034 2034
 		$this->color						= trim((string) $this->color);
2035
-		$this->dateemployment				= empty($this->dateemployment) ? '' : $this->dateemployment;
2035
+		$this->dateemployment = empty($this->dateemployment) ? '' : $this->dateemployment;
2036 2036
 		$this->dateemploymentend			= empty($this->dateemploymentend) ? '' : $this->dateemploymentend;
2037 2037
 
2038
-		$this->birth						= empty($this->birth) ? '' : $this->birth;
2039
-		$this->fk_warehouse					= (int) $this->fk_warehouse;
2040
-		$this->fk_establishment				= (int) $this->fk_establishment;
2038
+		$this->birth = empty($this->birth) ? '' : $this->birth;
2039
+		$this->fk_warehouse = (int) $this->fk_warehouse;
2040
+		$this->fk_establishment = (int) $this->fk_establishment;
2041 2041
 
2042 2042
 		$this->setUpperOrLowerCase();
2043 2043
 
@@ -2792,7 +2792,7 @@  discard block
 block discarded – undo
2792 2792
 		$sql .= " WHERE fk_user  = ".((int) $this->id);
2793 2793
 		$sql .= " AND fk_usergroup = ".((int) $group);
2794 2794
 		if (empty($entity)) {
2795
-			$sql .= " AND entity IN (0, 1)";	// group may be in entity 0 (so $entity=0) and link with user into entity 1.
2795
+			$sql .= " AND entity IN (0, 1)"; // group may be in entity 0 (so $entity=0) and link with user into entity 1.
2796 2796
 		} else {
2797 2797
 			$sql .= " AND entity = ".((int) $entity);
2798 2798
 		}
@@ -3054,7 +3054,7 @@  discard block
 block discarded – undo
3054 3054
 				$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
3055 3055
 			}
3056 3056
 			$linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"');
3057
-			$linkclose .= $dataparams . ' class="'.$classfortooltip.($morecss ? ' '.$morecss : '').'"';
3057
+			$linkclose .= $dataparams.' class="'.$classfortooltip.($morecss ? ' '.$morecss : '').'"';
3058 3058
 		} else {
3059 3059
 			$linkclose = ($morecss ? ' class="'.$morecss.'"' : '');
3060 3060
 		}
@@ -3134,7 +3134,7 @@  discard block
 block discarded – undo
3134 3134
 
3135 3135
 		if ($option == 'xxx') {
3136 3136
 			$linkstart = '<a href="'.DOL_URL_ROOT.'/user/card.php?id='.$this->id.'">';
3137
-			$linkend = '</a>';  // @phan-suppress-current-line PhanPluginRedundantAssignment
3137
+			$linkend = '</a>'; // @phan-suppress-current-line PhanPluginRedundantAssignment
3138 3138
 		}
3139 3139
 
3140 3140
 		if ($option == 'nolink') {
@@ -3293,11 +3293,11 @@  discard block
 block discarded – undo
3293 3293
 		global $conf;
3294 3294
 		$dn = '';
3295 3295
 		if ($mode == 0) {
3296
-			$dn = getDolGlobalString('LDAP_KEY_USERS') . "=".$info[getDolGlobalString('LDAP_KEY_USERS')]."," . getDolGlobalString('LDAP_USER_DN');
3296
+			$dn = getDolGlobalString('LDAP_KEY_USERS')."=".$info[getDolGlobalString('LDAP_KEY_USERS')].",".getDolGlobalString('LDAP_USER_DN');
3297 3297
 		} elseif ($mode == 1) {
3298 3298
 			$dn = getDolGlobalString('LDAP_USER_DN');
3299 3299
 		} elseif ($mode == 2) {
3300
-			$dn = getDolGlobalString('LDAP_KEY_USERS') . "=".$info[getDolGlobalString('LDAP_KEY_USERS')];
3300
+			$dn = getDolGlobalString('LDAP_KEY_USERS')."=".$info[getDolGlobalString('LDAP_KEY_USERS')];
3301 3301
 		}
3302 3302
 		return $dn;
3303 3303
 	}
@@ -3512,7 +3512,7 @@  discard block
 block discarded – undo
3512 3512
 		$this->iplastlogin = '127.0.0.1';
3513 3513
 		$this->datepreviouslogin = $now;
3514 3514
 		$this->ippreviouslogin = '127.0.0.1';
3515
-		$this->statut = 1;		// deprecated
3515
+		$this->statut = 1; // deprecated
3516 3516
 		$this->status = 1;
3517 3517
 
3518 3518
 		$this->entity = 1;
Please login to merge, or discard this patch.