Completed
Branch develop (f44757)
by
unknown
23:48
created
htdocs/core/modules/DolibarrModules.class.php 1 patch
Spacing   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
 
144 144
 	const KEY_ID = 0;
145 145
 	const KEY_LABEL = 1;
146
-	const KEY_TYPE = 2;	// deprecated
146
+	const KEY_TYPE = 2; // deprecated
147 147
 	const KEY_DEFAULT = 3;
148 148
 	const KEY_FIRST_LEVEL = 4;
149 149
 	const KEY_SECOND_LEVEL = 5;
@@ -729,7 +729,7 @@  discard block
 block discarded – undo
729 729
 				$moduleNameInConf = 'supplier_proposal';
730 730
 			}
731 731
 
732
-			unset($conf->modules[$moduleNameInConf]);	// Add this module in list of enabled modules so isModEnabled() will work (conf->module->enabled must no more be used)
732
+			unset($conf->modules[$moduleNameInConf]); // Add this module in list of enabled modules so isModEnabled() will work (conf->module->enabled must no more be used)
733 733
 
734 734
 			return 1;
735 735
 		} else {
@@ -825,7 +825,7 @@  discard block
 block discarded – undo
825 825
 		$pathoffile = $this->getDescLongReadmeFound();
826 826
 
827 827
 		if ($pathoffile) {     // Mostly for external modules
828
-			$content = file_get_contents($pathoffile, false, null, 0, 1024 * 1024);	// Max size loaded 1Mb
828
+			$content = file_get_contents($pathoffile, false, null, 0, 1024 * 1024); // Max size loaded 1Mb
829 829
 
830 830
 			if ((float) DOL_VERSION >= 6.0) {  // @phpstan-ignore-line
831 831
 				@include_once DOL_DOCUMENT_ROOT.'/core/lib/parsemd.lib.php';
@@ -1589,7 +1589,7 @@  discard block
 block discarded – undo
1589 1589
 
1590 1590
 				$sql = "DELETE FROM ".MAIN_DB_PREFIX."boxes_def";
1591 1591
 				$sql .= " WHERE file = '".$this->db->escape($file)."'";
1592
-				$sql .= " AND entity = ".$conf->entity;		// Do not use getEntity here, we want to delete only in current company
1592
+				$sql .= " AND entity = ".$conf->entity; // Do not use getEntity here, we want to delete only in current company
1593 1593
 
1594 1594
 				dol_syslog(get_class($this)."::delete_boxes", LOG_DEBUG);
1595 1595
 				$resql = $this->db->query($sql);
@@ -1612,9 +1612,9 @@  discard block
 block discarded – undo
1612 1612
 	public function insert_cronjobs()
1613 1613
 	{
1614 1614
 		// phpcs:enable
1615
-		include_once DOL_DOCUMENT_ROOT . '/core/class/infobox.class.php';
1616
-		include_once DOL_DOCUMENT_ROOT . '/cron/class/cronjob.class.php';
1617
-		include_once DOL_DOCUMENT_ROOT . '/user/class/user.class.php';
1615
+		include_once DOL_DOCUMENT_ROOT.'/core/class/infobox.class.php';
1616
+		include_once DOL_DOCUMENT_ROOT.'/cron/class/cronjob.class.php';
1617
+		include_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
1618 1618
 
1619 1619
 		global $conf, $user;
1620 1620
 
@@ -1625,7 +1625,7 @@  discard block
 block discarded – undo
1625 1625
 		$err = 0;
1626 1626
 
1627 1627
 		if (is_array($this->cronjobs)) {
1628
-			dol_syslog(get_class($this) . "::insert_cronjobs", LOG_DEBUG);
1628
+			dol_syslog(get_class($this)."::insert_cronjobs", LOG_DEBUG);
1629 1629
 
1630 1630
 			foreach ($this->cronjobs as $key => $value) {
1631 1631
 				$now = dol_now();
@@ -1652,7 +1652,7 @@  discard block
 block discarded – undo
1652 1652
 				$test = isset($value['test']) ? $value['test'] : ''; // Line must be enabled or not (so visible or not)
1653 1653
 
1654 1654
 				// Search if cron entry already present
1655
-				$sql = "SELECT count(*) as nb FROM " . MAIN_DB_PREFIX . "cronjob";
1655
+				$sql = "SELECT count(*) as nb FROM ".MAIN_DB_PREFIX."cronjob";
1656 1656
 				//$sql .= " WHERE module_name = '" . $this->db->escape(empty($this->rights_class) ? strtolower($this->name) : $this->rights_class) . "'";
1657 1657
 				$sql .= " WHERE label = '".$this->db->escape($label)."'";
1658 1658
 				/* unique key is on label,entity so no need for this test
@@ -1672,7 +1672,7 @@  discard block
 block discarded – undo
1672 1672
 					$sql .= " AND params = '" . $this->db->escape($params) . "'";
1673 1673
 				}
1674 1674
 				*/
1675
-				$sql .= " AND entity = " . ((int) $entity); // Must be exact entity
1675
+				$sql .= " AND entity = ".((int) $entity); // Must be exact entity
1676 1676
 
1677 1677
 				$result = $this->db->query($sql);
1678 1678
 				if (!$result) {
@@ -1992,9 +1992,9 @@  discard block
 block discarded – undo
1992 1992
 
1993 1993
 				// If the module is active
1994 1994
 				foreach ($this->rights as $key => $value) {
1995
-					$r_id = $this->rights[$key][self::KEY_ID];	// permission id in llx_rights_def (not unique because primary key is couple id-entity)
1995
+					$r_id = $this->rights[$key][self::KEY_ID]; // permission id in llx_rights_def (not unique because primary key is couple id-entity)
1996 1996
 					$r_label = $this->rights[$key][self::KEY_LABEL];
1997
-					$r_type	= $this->rights[$key][self::KEY_TYPE] ?? 'w';	// TODO deprecated
1997
+					$r_type = $this->rights[$key][self::KEY_TYPE] ?? 'w'; // TODO deprecated
1998 1998
 					$r_default = $this->rights[$key][self::KEY_DEFAULT] ?? 0;
1999 1999
 					$r_perms = $this->rights[$key][self::KEY_FIRST_LEVEL] ?? '';
2000 2000
 					$r_subperms = $this->rights[$key][self::KEY_SECOND_LEVEL] ?? '';
@@ -2022,7 +2022,7 @@  discard block
 block discarded – undo
2022 2022
 					}
2023 2023
 
2024 2024
 					// condition to show or hide a user right (default: 1) (eg isModEnabled('anothermodule') or ($conf->global->MAIN_FEATURES_LEVEL > 0) or etc..)
2025
-					$r_enabled	= $this->rights[$key][self::KEY_ENABLED] ?? '1';
2025
+					$r_enabled = $this->rights[$key][self::KEY_ENABLED] ?? '1';
2026 2026
 
2027 2027
 					// Search if perm already present
2028 2028
 					$sql = "SELECT count(*) as nb FROM ".MAIN_DB_PREFIX."rights_def";
@@ -2039,10 +2039,10 @@  discard block
 block discarded – undo
2039 2039
 							$sql .= ", libelle";
2040 2040
 							$sql .= ", module";
2041 2041
 							$sql .= ", module_origin";
2042
-							$sql .= ", module_position";		// Not that module_position can be fixed eynamically when accessing page user/perms.php
2042
+							$sql .= ", module_position"; // Not that module_position can be fixed eynamically when accessing page user/perms.php
2043 2043
 							$sql .= ", family";
2044 2044
 							$sql .= ", family_position";
2045
-							$sql .= ", type";	// Not used yet
2045
+							$sql .= ", type"; // Not used yet
2046 2046
 							$sql .= ", bydefault";
2047 2047
 							$sql .= ", perms";
2048 2048
 							$sql .= ", subperms";
@@ -2056,7 +2056,7 @@  discard block
 block discarded – undo
2056 2056
 							$sql .= ", '".$this->db->escape((string) $r_module_position)."'";
2057 2057
 							$sql .= ", '".$this->db->escape($r_family)."'";
2058 2058
 							$sql .= ", '".$this->db->escape((string) $r_family_position)."'";
2059
-							$sql .= ", '".$this->db->escape($r_type)."'";	// Not used yet
2059
+							$sql .= ", '".$this->db->escape($r_type)."'"; // Not used yet
2060 2060
 							$sql .= ", ".((int) $r_default);
2061 2061
 							$sql .= ", '".$this->db->escape($r_perms)."'";
2062 2062
 							$sql .= ", '".$this->db->escape($r_subperms)."'";
@@ -2278,7 +2278,7 @@  discard block
 block discarded – undo
2278 2278
 
2279 2279
 		$sql = "DELETE FROM ".MAIN_DB_PREFIX."menu";
2280 2280
 		$sql .= " WHERE module = '".$this->db->escape($module)."'";
2281
-		$sql .= " AND menu_handler = 'all'";	// We delete only lines that were added manually or by the module activation. We keep entry added by menuhandler like 'auguria'
2281
+		$sql .= " AND menu_handler = 'all'"; // We delete only lines that were added manually or by the module activation. We keep entry added by menuhandler like 'auguria'
2282 2282
 		$sql .= " AND entity IN (0, ".$conf->entity.")";
2283 2283
 
2284 2284
 		dol_syslog(get_class($this)."::delete_menus", LOG_DEBUG);
@@ -2462,7 +2462,7 @@  discard block
 block discarded – undo
2462 2462
 						dol_delete_file($dest.'.zip');
2463 2463
 
2464 2464
 						// Compress it
2465
-						global $errormsg;	// Used by dol_compress_dir
2465
+						global $errormsg; // Used by dol_compress_dir
2466 2466
 						$errormsg = '';
2467 2467
 						$result = dol_compress_dir($src, $dest.'.zip', 'zip');
2468 2468
 						if ($result < 0) {
@@ -2662,36 +2662,36 @@  discard block
 block discarded – undo
2662 2662
 		}
2663 2663
 
2664 2664
 		if ($this->isCoreOrExternalModule() == 'external' || preg_match('/development|experimental|deprecated/i', $version)) {
2665
-			$versionTitle =  $langs->trans("Version").' '.$this->getVersion(1);
2665
+			$versionTitle = $langs->trans("Version").' '.$this->getVersion(1);
2666 2666
 			if ($this->needUpdate) {
2667 2667
 				$versionTitle .= '<br>'.$langs->trans('ModuleUpdateAvailable').' : '.$this->lastVersion;
2668 2668
 			}
2669 2669
 
2670
-			$return .=  '<span class="info-box-icon-version'.($versiontrans ? ' '.$versiontrans : '').' classfortooltip" title="'.dol_escape_js($versionTitle).'" >';
2671
-			$return .=  $this->getVersion(1);
2672
-			$return .=  '</span>';
2670
+			$return .= '<span class="info-box-icon-version'.($versiontrans ? ' '.$versiontrans : '').' classfortooltip" title="'.dol_escape_js($versionTitle).'" >';
2671
+			$return .= $this->getVersion(1);
2672
+			$return .= '</span>';
2673 2673
 		}
2674 2674
 
2675
-		$return .=  '</div>
2675
+		$return .= '</div>
2676 2676
 	    <div class="info-box-content info-box-text-module'.(!getDolGlobalString($const_name) ? '' : ' info-box-module-enabled'.($versiontrans ? ' info-box-content-warning' : '')).'">
2677 2677
 	    <span class="info-box-title">'.$this->getName().'</span>
2678 2678
 	    <span class="info-box-desc twolinesmax opacitymedium" title="'.dol_escape_htmltag($this->getDesc()).'">'.nl2br($this->getDesc()).'</span>';
2679 2679
 
2680
-		$return .=  '<div class="valignmiddle inline-block info-box-more">';
2680
+		$return .= '<div class="valignmiddle inline-block info-box-more">';
2681 2681
 		//if ($versiontrans) print img_warning($langs->trans("Version").' '.$this->getVersion(1)).' ';
2682
-		$return .=  '<a class="valignmiddle inline-block" href="javascript:document_preview(\''.DOL_URL_ROOT.'/admin/modulehelp.php?id='.((int) $this->numero).'\',\'text/html\',\''.dol_escape_js($langs->trans("Module")).'\')">'.img_picto(($this->isCoreOrExternalModule() == 'external' ? $langs->trans("ExternalModule").' - ' : '').$langs->trans("ClickToShowDescription"), $imginfo).'</a>';
2683
-		$return .=  '</div><br>';
2684
-
2685
-		$return .=  '<div class="valignmiddle inline-block info-box-actions">';
2686
-		$return .=  '<div class="valignmiddle inline-block info-box-setup">';
2687
-		$return .=  $codetoconfig;
2688
-		$return .=  '</div>';
2689
-		$return .=  '<div class="valignmiddle inline-block marginleftonly marginrightonly">';
2690
-		$return .=  $codeenabledisable;
2691
-		$return .=  '</div>';
2692
-		$return .=  '</div>';
2693
-
2694
-		$return .=  '
2682
+		$return .= '<a class="valignmiddle inline-block" href="javascript:document_preview(\''.DOL_URL_ROOT.'/admin/modulehelp.php?id='.((int) $this->numero).'\',\'text/html\',\''.dol_escape_js($langs->trans("Module")).'\')">'.img_picto(($this->isCoreOrExternalModule() == 'external' ? $langs->trans("ExternalModule").' - ' : '').$langs->trans("ClickToShowDescription"), $imginfo).'</a>';
2683
+		$return .= '</div><br>';
2684
+
2685
+		$return .= '<div class="valignmiddle inline-block info-box-actions">';
2686
+		$return .= '<div class="valignmiddle inline-block info-box-setup">';
2687
+		$return .= $codetoconfig;
2688
+		$return .= '</div>';
2689
+		$return .= '<div class="valignmiddle inline-block marginleftonly marginrightonly">';
2690
+		$return .= $codeenabledisable;
2691
+		$return .= '</div>';
2692
+		$return .= '</div>';
2693
+
2694
+		$return .= '
2695 2695
 	    </div><!-- /.info-box-content -->
2696 2696
 	    </div><!-- /.info-box -->
2697 2697
 	    </div>';
@@ -2711,7 +2711,7 @@  discard block
 block discarded – undo
2711 2711
 	{
2712 2712
 		require_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php';
2713 2713
 		if (!empty($this->url_last_version)) {
2714
-			$lastVersion = getURLContent($this->url_last_version, 'GET', '', 1, array(), array('http', 'https'), 0);	// Accept http or https links on external remote server only
2714
+			$lastVersion = getURLContent($this->url_last_version, 'GET', '', 1, array(), array('http', 'https'), 0); // Accept http or https links on external remote server only
2715 2715
 			if (isset($lastVersion['content']) && strlen($lastVersion['content']) < 30) {
2716 2716
 				// Security warning :  be careful with remote data content, the module editor could be hacked (or evil) so limit to a-z A-Z 0-9 _ . -
2717 2717
 				$this->lastVersion = preg_replace("/[^a-zA-Z0-9_\.\-]+/", "", $lastVersion['content']);
@@ -2748,7 +2748,7 @@  discard block
 block discarded – undo
2748 2748
 		if (empty($conf->cache['noncompliantmodules'])) {
2749 2749
 			require_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php';
2750 2750
 
2751
-			$result = getURLContent(self::URL_FOR_BLACKLISTED_MODULES, 'GET', '', 1, array(), array('http', 'https'), 0);	// Accept http or https links on external remote server only
2751
+			$result = getURLContent(self::URL_FOR_BLACKLISTED_MODULES, 'GET', '', 1, array(), array('http', 'https'), 0); // Accept http or https links on external remote server only
2752 2752
 			if (isset($result['content']) && $result['http_code'] == 200) {
2753 2753
 				$langs->load("errors");
2754 2754
 
Please login to merge, or discard this patch.
htdocs/societe/card.php 1 patch
Spacing   +68 added lines, -68 removed lines patch added patch discarded remove patch
@@ -161,10 +161,10 @@  discard block
 block discarded – undo
161 161
 }
162 162
 
163 163
 // Permissions
164
-$permissiontoread 	= $user->hasRight('societe', 'lire');
165
-$permissiontoadd 	= $user->hasRight('societe', 'creer'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
164
+$permissiontoread = $user->hasRight('societe', 'lire');
165
+$permissiontoadd = $user->hasRight('societe', 'creer'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
166 166
 $permissiontodelete = $user->hasRight('societe', 'supprimer') || ($permissiontoadd && isset($object->status) && $object->status == 0);
167
-$permissionnote 	= $user->hasRight('societe', 'creer'); // Used by the include of actions_setnotes.inc.php
167
+$permissionnote = $user->hasRight('societe', 'creer'); // Used by the include of actions_setnotes.inc.php
168 168
 $permissiondellink 	= $user->hasRight('societe', 'creer'); // Used by the include of actions_dellink.inc.php
169 169
 $permissiontoeditextra = $permissiontoadd;
170 170
 if (GETPOST('attribute', 'aZ09') && isset($extrafields->attributes[$object->table_element]['perms'][GETPOST('attribute', 'aZ09')])) {
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
 	$permissiontoeditextra = dol_eval((string) $extrafields->attributes[$object->table_element]['perms'][GETPOST('attribute', 'aZ09')]);
173 173
 }
174 174
 
175
-$upload_dir 		= $conf->societe->multidir_output[isset($object->entity) ? $object->entity : 1];
175
+$upload_dir = $conf->societe->multidir_output[isset($object->entity) ? $object->entity : 1];
176 176
 
177 177
 // Security check
178 178
 $result = restrictedArea($user, 'societe', $object->id, '&societe', '', 'fk_soc', 'rowid', 0);
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
 			if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) {
202 202
 				$backtopage = $backurlforlist;
203 203
 			} else {
204
-				$backtopage = DOL_URL_ROOT.'/societe/card.php?id='.((!empty($id) && $id > 0) ? $id : '__ID__') . (!empty($canvas) ? "&canvas=" . $canvas : "");
204
+				$backtopage = DOL_URL_ROOT.'/societe/card.php?id='.((!empty($id) && $id > 0) ? $id : '__ID__').(!empty($canvas) ? "&canvas=".$canvas : "");
205 205
 			}
206 206
 		}
207 207
 	}
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
 
220 220
 	if ($action == 'confirm_merge' && $confirm == 'yes' && $permissiontoadd) {
221 221
 		$soc_origin_id = GETPOSTINT('soc_origin');
222
-		$soc_origin = new Societe($db);		// The thirdparty that we will delete
222
+		$soc_origin = new Societe($db); // The thirdparty that we will delete
223 223
 
224 224
 		if ($soc_origin_id <= 0) {
225 225
 			$langs->load('errors');
@@ -267,7 +267,7 @@  discard block
 block discarded – undo
267 267
 	if ($action == 'update_extras' && $permissiontoeditextra) {
268 268
 		$object->fetch($socid);
269 269
 
270
-		$object->oldcopy = dol_clone($object, 2);  // @phan-suppress-current-line PhanTypeMismatchProperty
270
+		$object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty
271 271
 
272 272
 		$attribute_name = GETPOST('attribute', 'aZ09');
273 273
 
@@ -323,7 +323,7 @@  discard block
 block discarded – undo
323 323
 		if (!$error) {
324 324
 			if ($action == 'update') {	// Test on permission not required here
325 325
 				$ret = $object->fetch($socid);
326
-				$object->oldcopy = clone $object;  // @phan-suppress-current-line PhanTypeMismatchProperty
326
+				$object->oldcopy = clone $object; // @phan-suppress-current-line PhanTypeMismatchProperty
327 327
 			} else {
328 328
 				$object->canvas = $canvas;
329 329
 			}
@@ -333,21 +333,21 @@  discard block
 block discarded – undo
333 333
 
334 334
 				$object->name = dolGetFirstLastname(GETPOST('firstname', 'alphanohtml'), GETPOST('name', 'alphanohtml'));
335 335
 				$object->civility_id		= GETPOST('civility_id', 'alphanohtml'); // Note: civility id is a code, not an int
336
-				$object->civility_code		= GETPOST('civility_id', 'alphanohtml'); // Note: civility id is a code, not an int
336
+				$object->civility_code = GETPOST('civility_id', 'alphanohtml'); // Note: civility id is a code, not an int
337 337
 				// Add non official properties
338
-				$object->name_bis			= GETPOST('name', 'alphanohtml');
339
-				$object->firstname			= GETPOST('firstname', 'alphanohtml');
338
+				$object->name_bis = GETPOST('name', 'alphanohtml');
339
+				$object->firstname = GETPOST('firstname', 'alphanohtml');
340 340
 			} else {
341
-				$object->name				= GETPOST('name', 'alphanohtml');
341
+				$object->name = GETPOST('name', 'alphanohtml');
342 342
 			}
343 343
 			$object->entity					= ((GETPOSTISSET('entity') && GETPOST('entity') != '') ? GETPOSTINT('entity') : $conf->entity);
344
-			$object->name_alias				= GETPOST('name_alias', 'alphanohtml');
344
+			$object->name_alias = GETPOST('name_alias', 'alphanohtml');
345 345
 			$object->parent					= GETPOSTISSET('parent_company_id') ? GETPOSTINT('parent_company_id') : $object->parent;
346 346
 			$object->address				= GETPOST('address', 'alphanohtml');
347
-			$object->zip					= GETPOST('zipcode', 'alphanohtml');
348
-			$object->town					= GETPOST('town', 'alphanohtml');
349
-			$object->country_id				= GETPOSTINT('country_id');
350
-			$object->state_id				= GETPOSTINT('state_id');
347
+			$object->zip = GETPOST('zipcode', 'alphanohtml');
348
+			$object->town = GETPOST('town', 'alphanohtml');
349
+			$object->country_id = GETPOSTINT('country_id');
350
+			$object->state_id = GETPOSTINT('state_id');
351 351
 
352 352
 			$object->socialnetworks = array();
353 353
 			if (isModEnabled('socialnetworks')) {
@@ -359,10 +359,10 @@  discard block
 block discarded – undo
359 359
 			}
360 360
 
361 361
 			$object->phone					= GETPOST('phone', 'alpha');
362
-			$object->phone_mobile 			= (string) GETPOST("phone_mobile", 'alpha');
362
+			$object->phone_mobile = (string) GETPOST("phone_mobile", 'alpha');
363 363
 			$object->fax					= GETPOST('fax', 'alpha');
364 364
 			$object->email					= trim(GETPOST('email', 'email'));
365
-			$object->no_email 				= GETPOSTINT("no_email");
365
+			$object->no_email = GETPOSTINT("no_email");
366 366
 			$object->url					= trim(GETPOST('url', 'url'));
367 367
 			$object->idprof1				= trim(GETPOST('idprof1', 'alphanohtml'));
368 368
 			$object->idprof2				= trim(GETPOST('idprof2', 'alphanohtml'));
@@ -372,13 +372,13 @@  discard block
 block discarded – undo
372 372
 			$object->idprof6				= trim(GETPOST('idprof6', 'alphanohtml'));
373 373
 			$object->prefix_comm			= GETPOST('prefix_comm', 'alphanohtml');
374 374
 			$object->code_client			= GETPOSTISSET('customer_code') ? GETPOST('customer_code', 'alpha') : GETPOST('code_client', 'alpha');
375
-			$object->code_fournisseur		= GETPOSTISSET('supplier_code') ? GETPOST('supplier_code', 'alpha') : GETPOST('code_fournisseur', 'alpha');
376
-			$object->capital				= GETPOST('capital');	// Can be null or 0 or a float value
375
+			$object->code_fournisseur = GETPOSTISSET('supplier_code') ? GETPOST('supplier_code', 'alpha') : GETPOST('code_fournisseur', 'alpha');
376
+			$object->capital				= GETPOST('capital'); // Can be null or 0 or a float value
377 377
 			$object->barcode				= GETPOST('barcode', 'alphanohtml');
378 378
 
379 379
 			$object->tva_intra				= GETPOST('tva_intra', 'alphanohtml');
380 380
 			$object->tva_assuj				= GETPOSTINT('assujtva_value');
381
-			$object->vat_reverse_charge		= GETPOST('vat_reverse_charge') == 'on' ? 1 : 0;
381
+			$object->vat_reverse_charge = GETPOST('vat_reverse_charge') == 'on' ? 1 : 0;
382 382
 			$object->status = GETPOSTINT('status');
383 383
 
384 384
 			// Local Taxes
@@ -388,11 +388,11 @@  discard block
 block discarded – undo
388 388
 			$object->localtax1_value		= GETPOST('lt1', 'alpha');
389 389
 			$object->localtax2_value		= GETPOST('lt2', 'alpha');
390 390
 
391
-			$object->forme_juridique_code	= GETPOSTINT('forme_juridique_code');
392
-			$object->birth				= dol_mktime(0, 0, 0, GETPOSTINT('birthmonth'), GETPOSTINT('birthday'), GETPOSTINT('birthyear'));
391
+			$object->forme_juridique_code = GETPOSTINT('forme_juridique_code');
392
+			$object->birth = dol_mktime(0, 0, 0, GETPOSTINT('birthmonth'), GETPOSTINT('birthday'), GETPOSTINT('birthyear'));
393 393
 
394 394
 			$object->effectif_id			= GETPOSTINT('effectif_id');
395
-			$object->typent_id				= GETPOSTINT('typent_id');
395
+			$object->typent_id = GETPOSTINT('typent_id');
396 396
 
397 397
 			$object->typent_code			= dol_getIdFromCode($db, $object->typent_id, 'c_typent', 'id', 'code'); // Force typent_code too so check in verify() will be done on new type
398 398
 
@@ -401,8 +401,8 @@  discard block
 block discarded – undo
401 401
 			$prospect = (GETPOSTINT('prospect') > 0 ? 2 : 0);
402 402
 			$prospectcustomer = $customer + $prospect;
403 403
 
404
-			$object->client					= $prospectcustomer;
405
-			$object->fournisseur			= (GETPOSTINT('supplier') > 0 ? 1 : 0);
404
+			$object->client = $prospectcustomer;
405
+			$object->fournisseur = (GETPOSTINT('supplier') > 0 ? 1 : 0);
406 406
 
407 407
 			if ($action == 'add') {		// Test on permission already done
408 408
 				// for prospect, customer or supplier
@@ -422,7 +422,7 @@  discard block
 block discarded – undo
422 422
 					}
423 423
 
424 424
 					if ($object->fournisseur > 0) {
425
-						$object->cond_reglement_supplier_id	= $paymentTermId;
425
+						$object->cond_reglement_supplier_id = $paymentTermId;
426 426
 
427 427
 						$filterPaymentTypeIdArr = array(1, 2, 3); // allow payment type for supplier (filter is "DBIT" in "Form::select_types_paiements()" method)
428 428
 						if (!empty($form->cache_types_paiements[$paymentTypeId]) && isset($form->cache_types_paiements[$paymentTypeId]['type']) && in_array($form->cache_types_paiements[$paymentTypeId]['type'], $filterPaymentTypeIdArr)) {
@@ -432,15 +432,15 @@  discard block
 block discarded – undo
432 432
 				}
433 433
 			}
434 434
 
435
-			$object->commercial_id			= GETPOSTINT('commercial_id');
436
-			$object->default_lang			= GETPOST('default_lang');
435
+			$object->commercial_id = GETPOSTINT('commercial_id');
436
+			$object->default_lang = GETPOST('default_lang');
437 437
 
438 438
 			// Webservices url/key
439 439
 			$object->webservices_url		= GETPOST('webservices_url', 'url');
440 440
 			$object->webservices_key		= GETPOST('webservices_key', 'password');
441 441
 
442 442
 			if (GETPOSTISSET('accountancy_code_sell')) {
443
-				$accountancy_code_sell		= GETPOST('accountancy_code_sell', 'alpha');
443
+				$accountancy_code_sell = GETPOST('accountancy_code_sell', 'alpha');
444 444
 
445 445
 				if (empty($accountancy_code_sell) || $accountancy_code_sell == '-1') {
446 446
 					$object->accountancy_code_sell = '';
@@ -449,7 +449,7 @@  discard block
 block discarded – undo
449 449
 				}
450 450
 			}
451 451
 			if (GETPOSTISSET('accountancy_code_buy')) {
452
-				$accountancy_code_buy		= GETPOST('accountancy_code_buy', 'alpha');
452
+				$accountancy_code_buy = GETPOST('accountancy_code_buy', 'alpha');
453 453
 
454 454
 				if (empty($accountancy_code_buy) || $accountancy_code_buy == '-1') {
455 455
 					$object->accountancy_code_buy = '';
@@ -835,7 +835,7 @@  discard block
 block discarded – undo
835 835
 	// Delete third party
836 836
 	if ($action == 'confirm_delete' && $confirm == 'yes' && $user->hasRight('societe', 'supprimer')) {
837 837
 		$object->fetch($socid);
838
-		$object->oldcopy = clone $object;  // @phan-suppress-current-line PhanTypeMismatchProperty
838
+		$object->oldcopy = clone $object; // @phan-suppress-current-line PhanTypeMismatchProperty
839 839
 		$result = $object->delete($socid, $user);
840 840
 
841 841
 		if ($result > 0) {
@@ -913,7 +913,7 @@  discard block
 block discarded – undo
913 913
 				} else {
914 914
 					$db->commit();
915 915
 					$db->close();
916
-					header("Location: " . $_SERVER["PHP_SELF"] . "?id=" . $id);
916
+					header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id);
917 917
 					exit;
918 918
 				}
919 919
 			} else {
@@ -1102,12 +1102,12 @@  discard block
 block discarded – undo
1102 1102
 		$object->fax = GETPOST('fax', 'alpha');
1103 1103
 		$object->email = GETPOST('email', 'email');
1104 1104
 		$object->url = GETPOST('url', 'url');
1105
-		$object->capital = GETPOST('capital');	// can be null or 0 or a float value
1105
+		$object->capital = GETPOST('capital'); // can be null or 0 or a float value
1106 1106
 		$paymentTermId = GETPOSTINT('cond_reglement_id'); // can be set by default values on create page and not already in get or post variables
1107 1107
 		if (empty($paymentTermId) && !GETPOSTISSET('cond_reglement_id')) {
1108 1108
 			$paymentTermId = getDolGlobalString('MAIN_DEFAULT_PAYMENT_TERM_ID');
1109 1109
 		}
1110
-		$object->cond_reglement_id	= $paymentTermId;
1110
+		$object->cond_reglement_id = $paymentTermId;
1111 1111
 		$paymentTypeId = GETPOSTINT('mode_reglement_id'); // can be set by default values on create page and not already in get or post variables
1112 1112
 		if (empty($paymentTypeId) && !GETPOSTISSET('mode_reglement_id')) {
1113 1113
 			$paymentTypeId = getDolGlobalString('MAIN_DEFAULT_PAYMENT_TYPE_ID');
@@ -1125,7 +1125,7 @@  discard block
 block discarded – undo
1125 1125
 		$object->civility_id = GETPOST('civility_id', 'alpha');
1126 1126
 
1127 1127
 		$object->tva_assuj = GETPOSTINT('assujtva_value');
1128
-		$object->vat_reverse_charge	= GETPOST('vat_reverse_charge') == 'on' ? 1 : 0;
1128
+		$object->vat_reverse_charge = GETPOST('vat_reverse_charge') == 'on' ? 1 : 0;
1129 1129
 		$object->status = GETPOSTINT('status');
1130 1130
 
1131 1131
 		//Local Taxes
@@ -1141,7 +1141,7 @@  discard block
 block discarded – undo
1141 1141
 		$object->default_lang = GETPOST('default_lang');
1142 1142
 
1143 1143
 		if (GETPOSTISSET('accountancy_code_sell')) {
1144
-			$accountancy_code_sell  = GETPOST('accountancy_code_sell', 'alpha');
1144
+			$accountancy_code_sell = GETPOST('accountancy_code_sell', 'alpha');
1145 1145
 
1146 1146
 			if (empty($accountancy_code_sell) || $accountancy_code_sell == '-1') {
1147 1147
 				$object->accountancy_code_sell = '';
@@ -1276,7 +1276,7 @@  discard block
 block discarded – undo
1276 1276
 
1277 1277
 			print '<script type="text/javascript">';
1278 1278
 			print '$(document).ready(function () {
1279
-					var canHaveCustomerCategoryIfNotCustomerProspectSupplier = ' . (!getDolGlobalString('THIRDPARTY_CAN_HAVE_CUSTOMER_CATEGORY_EVEN_IF_NOT_CUSTOMER_PROSPECT') ? '0' : '1') . ';
1279
+					var canHaveCustomerCategoryIfNotCustomerProspectSupplier = ' . (!getDolGlobalString('THIRDPARTY_CAN_HAVE_CUSTOMER_CATEGORY_EVEN_IF_NOT_CUSTOMER_PROSPECT') ? '0' : '1').';
1280 1280
 
1281 1281
 					init_customer_categ();
1282 1282
 			  		$("#prospectinput, #customerinput").change(function() {
@@ -1350,7 +1350,7 @@  discard block
 block discarded – undo
1350 1350
 			print '</td><td colspan="3">';
1351 1351
 
1352 1352
 			print '<input type="text" class="minwidth300" maxlength="128" name="name" id="name" value="'.dol_escape_htmltag($object->name).'" autofocus="autofocus" spellcheck="false">';
1353
-			print $form->widgetForTranslation("name", $object, $permissiontoadd, 'string', 'alphanohtml', 'minwidth300');	// For some countries that need the company name in 2 languages
1353
+			print $form->widgetForTranslation("name", $object, $permissiontoadd, 'string', 'alphanohtml', 'minwidth300'); // For some countries that need the company name in 2 languages
1354 1354
 			// This implementation of the feature to search already existing company has been disabled. It must be implemented by keeping the "input text" and we must call the search ajax societe/ajax/ajaxcompanies.php
1355 1355
 			// on a keydown of the input. We should show data about a duplicate found if we found less than 5 answers into a div under the input.
1356 1356
 			/*
@@ -1469,8 +1469,8 @@  discard block
 block discarded – undo
1469 1469
 
1470 1470
 			// Prospect/Customer/Supplier
1471 1471
 			$selected = $object->client;
1472
-			$selectedcustomer = ((getDolGlobalInt('THIRDPARTY_CUSTOMERTYPE_BY_DEFAULT')==1 && GETPOST("type", 'aZ') != 'p' && GETPOST("type", 'aZ') != 'f') || (getDolGlobalInt('THIRDPARTY_CUSTOMERTYPE_BY_DEFAULT')==3 && GETPOST("type", 'aZ') != 'p' && GETPOST("type", 'aZ') != 'f') ? 1 : 0);
1473
-			$selectedprospect = ((getDolGlobalInt('THIRDPARTY_CUSTOMERTYPE_BY_DEFAULT')==2 && GETPOST("type", 'aZ') != 'c' && GETPOST("type", 'aZ') != 'f') || (getDolGlobalInt('THIRDPARTY_CUSTOMERTYPE_BY_DEFAULT')==3 && GETPOST("type", 'aZ') != 'c' && GETPOST("type", 'aZ') != 'f') ? 1 : 0);
1472
+			$selectedcustomer = ((getDolGlobalInt('THIRDPARTY_CUSTOMERTYPE_BY_DEFAULT') == 1 && GETPOST("type", 'aZ') != 'p' && GETPOST("type", 'aZ') != 'f') || (getDolGlobalInt('THIRDPARTY_CUSTOMERTYPE_BY_DEFAULT') == 3 && GETPOST("type", 'aZ') != 'p' && GETPOST("type", 'aZ') != 'f') ? 1 : 0);
1473
+			$selectedprospect = ((getDolGlobalInt('THIRDPARTY_CUSTOMERTYPE_BY_DEFAULT') == 2 && GETPOST("type", 'aZ') != 'c' && GETPOST("type", 'aZ') != 'f') || (getDolGlobalInt('THIRDPARTY_CUSTOMERTYPE_BY_DEFAULT') == 3 && GETPOST("type", 'aZ') != 'c' && GETPOST("type", 'aZ') != 'f') ? 1 : 0);
1474 1474
 			switch ($selected) {
1475 1475
 				case 1:
1476 1476
 					$selectedcustomer = 1;
@@ -1723,7 +1723,7 @@  discard block
 block discarded – undo
1723 1723
 					print '<td></td>';
1724 1724
 					print '<td></td>';
1725 1725
 				}
1726
-				print '<td class="individualline noemail">'.$form->editfieldkey($langs->trans('No_Email') .' ('.$langs->trans('Contact').')', 'contact_no_email', '', $object, 0).'</td>';
1726
+				print '<td class="individualline noemail">'.$form->editfieldkey($langs->trans('No_Email').' ('.$langs->trans('Contact').')', 'contact_no_email', '', $object, 0).'</td>';
1727 1727
 				print '<td class="individualline" '.(($conf->browser->layout == 'phone') || !isModEnabled('mailing') ? ' colspan="3"' : '').'>'.$form->selectyesno('contact_no_email', (GETPOSTISSET("contact_no_email") ? GETPOST("contact_no_email", 'alpha') : (empty($object->no_email) ? 0 : 1)), 1, false, 1).'</td>';
1728 1728
 				print '</tr>';
1729 1729
 			}
@@ -1771,7 +1771,7 @@  discard block
 block discarded – undo
1771 1771
 			// Vat is used
1772 1772
 			print '<tr><td><label for="assujtva_value">'.$form->editfieldkey('VATIsUsed', 'assujtva_value', '', $object, 0).'</label></td>';
1773 1773
 			print '<td>';
1774
-			print '<input id="assujtva_value" name="assujtva_value" type="checkbox" ' . (GETPOSTISSET('assujtva_value') ? (GETPOST('assujtva_value', 'alpha') != '' ? ' checked="checked"' : '') : 'checked="checked"') . ' value="1">'; // Assujeti par default en creation
1774
+			print '<input id="assujtva_value" name="assujtva_value" type="checkbox" '.(GETPOSTISSET('assujtva_value') ? (GETPOST('assujtva_value', 'alpha') != '' ? ' checked="checked"' : '') : 'checked="checked"').' value="1">'; // Assujeti par default en creation
1775 1775
 			print '</td>';
1776 1776
 			if ($conf->browser->layout == 'phone') {
1777 1777
 				print '</tr><tr>';
@@ -1812,7 +1812,7 @@  discard block
 block discarded – undo
1812 1812
 
1813 1813
 			// VAT reverse charge by default
1814 1814
 			if (getDolGlobalString('ACCOUNTING_FORCE_ENABLE_VAT_REVERSE_CHARGE')) {
1815
-				print '<tr><td><label for="vat_reverse_charge">' . $form->editfieldkey('VATReverseChargeByDefault', 'vat_reverse_charge', '', $object, 0) . '</label></td><td colspan="3">';
1815
+				print '<tr><td><label for="vat_reverse_charge">'.$form->editfieldkey('VATReverseChargeByDefault', 'vat_reverse_charge', '', $object, 0).'</label></td><td colspan="3">';
1816 1816
 				print '<input type="checkbox" name="vat_reverse_charge" id="vat_reverse_charge" '.($object->vat_reverse_charge == '1' ? ' checked' : '').'>';
1817 1817
 				print '</td></tr>';
1818 1818
 			}
@@ -1821,21 +1821,21 @@  discard block
 block discarded – undo
1821 1821
 			// TODO: Place into a function to control showing by country or study better option
1822 1822
 			if ($mysoc->localtax1_assuj == "1" && $mysoc->localtax2_assuj == "1") {
1823 1823
 				print '<tr><td>'.$langs->transcountry("LocalTax1IsUsed", $mysoc->country_code).'</td><td>';
1824
-				print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" ' . (isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX1) ? 'checked="checked"' : '') . ' value="1">';
1824
+				print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" '.(isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX1) ? 'checked="checked"' : '').' value="1">';
1825 1825
 				print '</td>';
1826 1826
 				if ($conf->browser->layout == 'phone') {
1827 1827
 					print '</tr><tr>';
1828 1828
 				}
1829 1829
 				print '<td>'.$langs->transcountry("LocalTax2IsUsed", $mysoc->country_code).'</td><td>';
1830
-				print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" ' . (isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX2) ? 'checked="checked"' : '') . ' value="1">';
1830
+				print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" '.(isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX2) ? 'checked="checked"' : '').' value="1">';
1831 1831
 				print '</td></tr>';
1832 1832
 			} elseif ($mysoc->localtax1_assuj == "1") {
1833 1833
 				print '<tr><td>'.$langs->transcountry("LocalTax1IsUsed", $mysoc->country_code).'</td><td colspan="3">';
1834
-				print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" ' . (isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX1) ? 'checked="checked"' : '') . ' value="1">';
1834
+				print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" '.(isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX1) ? 'checked="checked"' : '').' value="1">';
1835 1835
 				print '</td></tr>';
1836 1836
 			} elseif ($mysoc->localtax2_assuj == "1") {
1837 1837
 				print '<tr><td>'.$langs->transcountry("LocalTax2IsUsed", $mysoc->country_code).'</td><td colspan="3">';
1838
-				print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" ' . (isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX2) ? 'checked="checked"' : '') . ' value="1">';
1838
+				print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" '.(isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX2) ? 'checked="checked"' : '').' value="1">';
1839 1839
 				print '</td></tr>';
1840 1840
 			}
1841 1841
 
@@ -2114,7 +2114,7 @@  discard block
 block discarded – undo
2114 2114
 				$prefixSupplierIsUsed = false;
2115 2115
 			}
2116 2116
 
2117
-			$object->oldcopy = clone $object;  // @phan-suppress-current-line PhanTypeMismatchProperty
2117
+			$object->oldcopy = clone $object; // @phan-suppress-current-line PhanTypeMismatchProperty
2118 2118
 
2119 2119
 			if (GETPOSTISSET('name')) {
2120 2120
 				// We overwrite with values if posted
@@ -2142,12 +2142,12 @@  discard block
 block discarded – undo
2142 2142
 				}
2143 2143
 
2144 2144
 				$object->phone					= GETPOST('phone', 'alpha');
2145
-				$object->phone_mobile			= (string) GETPOST('phone_mobile', 'alpha');
2145
+				$object->phone_mobile = (string) GETPOST('phone_mobile', 'alpha');
2146 2146
 				$object->fax					= GETPOST('fax', 'alpha');
2147 2147
 				$object->email					= GETPOST('email', 'email');
2148
-				$object->no_email				= GETPOSTINT("no_email");
2148
+				$object->no_email = GETPOSTINT("no_email");
2149 2149
 				$object->url					= GETPOST('url', 'url');
2150
-				$object->capital				= GETPOST('capital');	// Can be null or 0 or a float value
2150
+				$object->capital				= GETPOST('capital'); // Can be null or 0 or a float value
2151 2151
 				$object->idprof1				= GETPOST('idprof1', 'alphanohtml');
2152 2152
 				$object->idprof2				= GETPOST('idprof2', 'alphanohtml');
2153 2153
 				$object->idprof3				= GETPOST('idprof3', 'alphanohtml');
@@ -2161,16 +2161,16 @@  discard block
 block discarded – undo
2161 2161
 				$object->default_lang = GETPOST('default_lang', 'alpha');
2162 2162
 
2163 2163
 				$object->tva_assuj				= GETPOSTINT('assujtva_value');
2164
-				$object->vat_reverse_charge		= GETPOST('vat_reverse_charge') == 'on' ? 1 : 0;
2164
+				$object->vat_reverse_charge = GETPOST('vat_reverse_charge') == 'on' ? 1 : 0;
2165 2165
 				$object->tva_intra				= GETPOST('tva_intra', 'alphanohtml');
2166
-				$object->status =				GETPOSTINT('status');
2166
+				$object->status = GETPOSTINT('status');
2167 2167
 
2168 2168
 				// Webservices url/key
2169 2169
 				$object->webservices_url        = GETPOST('webservices_url', 'url');
2170 2170
 				$object->webservices_key        = GETPOST('webservices_key', 'password');
2171 2171
 
2172 2172
 				if (GETPOSTISSET('accountancy_code_sell')) {
2173
-					$accountancy_code_sell  = GETPOST('accountancy_code_sell', 'alpha');
2173
+					$accountancy_code_sell = GETPOST('accountancy_code_sell', 'alpha');
2174 2174
 
2175 2175
 					if (empty($accountancy_code_sell) || $accountancy_code_sell == '-1') {
2176 2176
 						$object->accountancy_code_sell = '';
@@ -2179,7 +2179,7 @@  discard block
 block discarded – undo
2179 2179
 					}
2180 2180
 				}
2181 2181
 				if (GETPOSTISSET('accountancy_code_buy')) {
2182
-					$accountancy_code_buy   = GETPOST('accountancy_code_buy', 'alpha');
2182
+					$accountancy_code_buy = GETPOST('accountancy_code_buy', 'alpha');
2183 2183
 
2184 2184
 					if (empty($accountancy_code_buy) || $accountancy_code_buy == '-1') {
2185 2185
 						$object->accountancy_code_buy = '';
@@ -2261,7 +2261,7 @@  discard block
 block discarded – undo
2261 2261
     				}
2262 2262
     			});
2263 2263
 
2264
-				var canHaveCustomerCategoryIfNotCustomerProspect = ' . (getDolGlobalInt('THIRDPARTY_CAN_HAVE_CUSTOMER_CATEGORY_EVEN_IF_NOT_CUSTOMER_PROSPECT') ? '1' : '0') . ';
2264
+				var canHaveCustomerCategoryIfNotCustomerProspect = ' . (getDolGlobalInt('THIRDPARTY_CAN_HAVE_CUSTOMER_CATEGORY_EVEN_IF_NOT_CUSTOMER_PROSPECT') ? '1' : '0').';
2265 2265
 
2266 2266
 				init_customer_categ();
2267 2267
 	  			$("#prospectinput, #customerinput").change(function() {
@@ -2433,7 +2433,7 @@  discard block
 block discarded – undo
2433 2433
 					$colspan = 3;
2434 2434
 				}
2435 2435
 
2436
-				print '<tr><td>'.$form->editfieldkey('CustomerCode', 'customer_code', '', $object, 0).'</td><td'.($colspan ? ' colspan="'.$colspan.'"': '').'>';
2436
+				print '<tr><td>'.$form->editfieldkey('CustomerCode', 'customer_code', '', $object, 0).'</td><td'.($colspan ? ' colspan="'.$colspan.'"' : '').'>';
2437 2437
 				print '<table class="nobordernopadding"><tr><td>';
2438 2438
 				$tmpcode = $object->code_client ?? '';
2439 2439
 				if (empty($tmpcode) && !empty($modCodeClient->code_auto)) {
@@ -2450,7 +2450,7 @@  discard block
 block discarded – undo
2450 2450
 					print '</tr><tr>';
2451 2451
 				}
2452 2452
 
2453
-				print '<td>'.$form->editfieldkey('SupplierCode', 'supplier_code', '', $object, 0).'</td><td'.($colspan ? ' colspan="'.$colspan.'"': '').'>';
2453
+				print '<td>'.$form->editfieldkey('SupplierCode', 'supplier_code', '', $object, 0).'</td><td'.($colspan ? ' colspan="'.$colspan.'"' : '').'>';
2454 2454
 
2455 2455
 				if ((isModEnabled("fournisseur") && $user->hasRight('fournisseur', 'lire') && !getDolGlobalString('MAIN_USE_NEW_SUPPLIERMOD')) || (isModEnabled("supplier_order") && $user->hasRight('supplier_order', 'lire')) || (isModEnabled("supplier_invoice") && $user->hasRight('supplier_invoice', 'lire'))) {
2456 2456
 					print '<table class="nobordernopadding"><tr><td>';
@@ -2631,14 +2631,14 @@  discard block
 block discarded – undo
2631 2631
 
2632 2632
 				// VAT is used
2633 2633
 				print '<tr><td>'.$form->editfieldkey('VATIsUsed', 'assujtva_value', '', $object, 0).'</td><td colspan="3">';
2634
-				print '<input id="assujtva_value" name="assujtva_value" type="checkbox" ' . ($object->tva_assuj ? 'checked="checked"' : '') . ' value="1">';
2634
+				print '<input id="assujtva_value" name="assujtva_value" type="checkbox" '.($object->tva_assuj ? 'checked="checked"' : '').' value="1">';
2635 2635
 				print '</td></tr>';
2636 2636
 
2637 2637
 				// Local Taxes
2638 2638
 				//TODO: Place into a function to control showing by country or study better option
2639 2639
 				if ($mysoc->localtax1_assuj == "1" && $mysoc->localtax2_assuj == "1") {
2640 2640
 					print '<tr><td>'.$form->editfieldkey($langs->transcountry("LocalTax1IsUsed", $mysoc->country_code), 'localtax1assuj_value', '', $object, 0).'</td><td>';
2641
-					print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" ' . ($object->localtax1_assuj ? 'checked="checked"' : '') . ' value="1">';
2641
+					print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" '.($object->localtax1_assuj ? 'checked="checked"' : '').' value="1">';
2642 2642
 					if (!isOnlyOneLocalTax(1)) {
2643 2643
 						print '<span class="cblt1">     '.$langs->transcountry("Type", $mysoc->country_code).': ';
2644 2644
 						$formcompany->select_localtax(1, (float) $object->localtax1_value, "lt1");
@@ -2647,7 +2647,7 @@  discard block
 block discarded – undo
2647 2647
 					print '</td>';
2648 2648
 					print '</tr><tr>';
2649 2649
 					print '<td>'.$form->editfieldkey($langs->transcountry("LocalTax2IsUsed", $mysoc->country_code), 'localtax2assuj_value', '', $object, 0).'</td><td>';
2650
-					print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" ' . ($object->localtax2_assuj ? 'checked="checked"' : '') . ' value="1"></td></tr>';
2650
+					print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" '.($object->localtax2_assuj ? 'checked="checked"' : '').' value="1"></td></tr>';
2651 2651
 					if (!isOnlyOneLocalTax(2)) {
2652 2652
 						print '<span class="cblt2">     '.$langs->transcountry("Type", $mysoc->country_code).': ';
2653 2653
 						$formcompany->select_localtax(2, (float) $object->localtax2_value, "lt2");
@@ -2656,7 +2656,7 @@  discard block
 block discarded – undo
2656 2656
 					print '</td></tr>';
2657 2657
 				} elseif ($mysoc->localtax1_assuj == "1" && $mysoc->localtax2_assuj != "1") {
2658 2658
 					print '<tr><td>'.$form->editfieldkey($langs->transcountry("LocalTax1IsUsed", $mysoc->country_code), 'localtax1assuj_value', '', $object, 0).'</td><td colspan="3">';
2659
-					print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" ' . ($object->localtax1_assuj ? 'checked="checked"' : '') . ' value="1">';
2659
+					print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" '.($object->localtax1_assuj ? 'checked="checked"' : '').' value="1">';
2660 2660
 					if (!isOnlyOneLocalTax(1)) {
2661 2661
 						print '<span class="cblt1">     '.$langs->transcountry("Type", $mysoc->country_code).': ';
2662 2662
 						$formcompany->select_localtax(1, (float) $object->localtax1_value, "lt1");
@@ -2665,7 +2665,7 @@  discard block
 block discarded – undo
2665 2665
 					print '</td></tr>';
2666 2666
 				} elseif ($mysoc->localtax2_assuj == "1" && $mysoc->localtax1_assuj != "1") {
2667 2667
 					print '<tr><td>'.$form->editfieldkey($langs->transcountry("LocalTax2IsUsed", $mysoc->country_code), 'localtax2assuj_value', '', $object, 0).'</td><td colspan="3">';
2668
-					print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" ' . ($object->localtax2_assuj ? 'checked="checked"' : '') . ' value="1">';
2668
+					print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" '.($object->localtax2_assuj ? 'checked="checked"' : '').' value="1">';
2669 2669
 					if (!isOnlyOneLocalTax(2)) {
2670 2670
 						print '<span class="cblt2">     '.$langs->transcountry("Type", $mysoc->country_code).': ';
2671 2671
 						$formcompany->select_localtax(2, (float) $object->localtax2_value, "lt2");
@@ -2676,7 +2676,7 @@  discard block
 block discarded – undo
2676 2676
 
2677 2677
 				// VAT reverse charge by default
2678 2678
 				if (getDolGlobalString('ACCOUNTING_FORCE_ENABLE_VAT_REVERSE_CHARGE')) {
2679
-					print '<tr><td>' . $form->editfieldkey('VATReverseChargeByDefault', 'vat_reverse_charge', '', $object, 0) . '</td><td colspan="3">';
2679
+					print '<tr><td>'.$form->editfieldkey('VATReverseChargeByDefault', 'vat_reverse_charge', '', $object, 0).'</td><td colspan="3">';
2680 2680
 					print '<input type="checkbox" name="vat_reverse_charge" '.($object->vat_reverse_charge == '1' ? ' checked' : '').'>';
2681 2681
 					print '</td></tr>';
2682 2682
 				}
@@ -2848,7 +2848,7 @@  discard block
 block discarded – undo
2848 2848
 					$maxfilesizearray = getMaxFileSizeArray();
2849 2849
 					$maxmin = $maxfilesizearray['maxmin'];
2850 2850
 					if ($maxmin > 0) {
2851
-						print '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">';	// MAX_FILE_SIZE must precede the field type=file
2851
+						print '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file
2852 2852
 					}
2853 2853
 					print '<input type="file" class="flat" name="photo" id="photoinput">';
2854 2854
 					print '</td></tr>';
@@ -3105,7 +3105,7 @@  discard block
 block discarded – undo
3105 3105
 					print '<tr><td>';
3106 3106
 					print $form->textwithpicto($langs->trans('VATReverseChargeByDefault'), $langs->trans('VATReverseChargeByDefaultDesc'));
3107 3107
 					print '</td><td>';
3108
-					print '<input type="checkbox" name="vat_reverse_charge" ' . ($object->vat_reverse_charge == '1' ? ' checked' : '') . ' disabled>';
3108
+					print '<input type="checkbox" name="vat_reverse_charge" '.($object->vat_reverse_charge == '1' ? ' checked' : '').' disabled>';
3109 3109
 					print '</td>';
3110 3110
 					print '</tr>';
3111 3111
 				}
Please login to merge, or discard this patch.
htdocs/install/upgrade2.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -308,7 +308,7 @@  discard block
 block discarded – undo
308 308
 			$conf->global->SYSLOG_FILE = constant('SYSLOG_FILE');
309 309
 		}
310 310
 
311
-		$conf->global->MAIN_ENABLE_LOG_TO_HTML = 1;		// Add also log into conf->logbuffer.
311
+		$conf->global->MAIN_ENABLE_LOG_TO_HTML = 1; // Add also log into conf->logbuffer.
312 312
 
313 313
 		$versiontoarray = array();
314 314
 		$versionranarray = array();
@@ -775,7 +775,7 @@  discard block
 block discarded – undo
775 775
 
776 776
 	if (!$error) {
777 777
 		// Set constant to ask to remake a new ping to inform about upgrade (if ping was already done and OK)
778
-		$sql = 'UPDATE '.MAIN_DB_PREFIX."const SET VALUE = 'torefresh' WHERE name = 'MAIN_FIRST_PING_OK_ID'";	// This should be useless now because constant is uniqueid+' v'+version
778
+		$sql = 'UPDATE '.MAIN_DB_PREFIX."const SET VALUE = 'torefresh' WHERE name = 'MAIN_FIRST_PING_OK_ID'"; // This should be useless now because constant is uniqueid+' v'+version
779 779
 		$db->query($sql, 1);
780 780
 	}
781 781
 
@@ -4373,7 +4373,7 @@  discard block
 block discarded – undo
4373 4373
 
4374 4374
 	if (!is_object($user)) {
4375 4375
 		include_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
4376
-		$user = new User($db);	// To avoid error during migration
4376
+		$user = new User($db); // To avoid error during migration
4377 4377
 	}
4378 4378
 
4379 4379
 	dolibarr_install_syslog("upgrade2::migrate_reload_modules force=".$force.", listofmodule=".implode(',', array_keys($listofmodule)), LOG_NOTICE);
@@ -4544,7 +4544,7 @@  discard block
 block discarded – undo
4544 4544
 
4545 4545
 	if (!is_object($user)) {
4546 4546
 		include_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
4547
-		$user = new User($db);	// To avoid error during migration
4547
+		$user = new User($db); // To avoid error during migration
4548 4548
 	}
4549 4549
 
4550 4550
 	print '<tr><td colspan="4">';
@@ -4555,7 +4555,7 @@  discard block
 block discarded – undo
4555 4555
 	$resql = $db->query($sql);
4556 4556
 
4557 4557
 	if ($resql) {
4558
-		$modulepart="product_batch";
4558
+		$modulepart = "product_batch";
4559 4559
 
4560 4560
 		$lot = new Productlot($db);
4561 4561
 
@@ -4569,7 +4569,7 @@  discard block
 block discarded – undo
4569 4569
 
4570 4570
 			if ($dir) {
4571 4571
 				$lot->id = (int) $obj->rowid;
4572
-				$lot->ref = (string) $obj->rowid;		// No ref for the moment
4572
+				$lot->ref = (string) $obj->rowid; // No ref for the moment
4573 4573
 				$lot->batch = $obj->batch;
4574 4574
 				$lot->entity = $obj->entity;
4575 4575
 				$lot->fk_product = $obj->fk_product;
@@ -4577,10 +4577,10 @@  discard block
 block discarded – undo
4577 4577
 				$savref = $lot->ref;
4578 4578
 
4579 4579
 				$lot->ref = $obj->batch;
4580
-				$origin = $dir . '/' . get_exdir(0, 0, 0, 1, $lot, $modulepart);
4580
+				$origin = $dir.'/'.get_exdir(0, 0, 0, 1, $lot, $modulepart);
4581 4581
 
4582
-				$lot->ref = $savref;		// So restore the id
4583
-				$destin = $dir . '/' . get_exdir(0, 0, 0, 1, $lot, $modulepart);
4582
+				$lot->ref = $savref; // So restore the id
4583
+				$destin = $dir.'/'.get_exdir(0, 0, 0, 1, $lot, $modulepart);
4584 4584
 
4585 4585
 				//var_dump($origin.' -> '.$destin.' '.$lot->batch.' dir origin is '.dol_is_dir($origin));exit;
4586 4586
 
@@ -5357,7 +5357,7 @@  discard block
 block discarded – undo
5357 5357
 				$error++;
5358 5358
 			}
5359 5359
 
5360
-			$current_contract =  $obj->cid;
5360
+			$current_contract = $obj->cid;
5361 5361
 		}
5362 5362
 	} else {
5363 5363
 		$error++;
@@ -5392,7 +5392,7 @@  discard block
 block discarded – undo
5392 5392
 	print '<tr class="trforrunsql"><td colspan="4">';
5393 5393
 	print '<b>'.$langs->trans('InvoiceExportModelsMigration')."</b>: \n";
5394 5394
 
5395
-	if (! $migrationNeeded) {
5395
+	if (!$migrationNeeded) {
5396 5396
 		print $langs->trans("AlreadyDone");
5397 5397
 		print '</td></tr>';
5398 5398
 		dolibarr_set_const($db, 'MIGRATION_FLAG_INVOICE_MODELS_V20', 1, 'chaine', 0, 'To flag the upgrade of invoice template has been set', 0);
@@ -5406,7 +5406,7 @@  discard block
 block discarded – undo
5406 5406
 
5407 5407
 	$resql1 = $db->query($sql1);
5408 5408
 
5409
-	if (! $resql1) {
5409
+	if (!$resql1) {
5410 5410
 		dol_print_error($db);
5411 5411
 		$db->rollback();
5412 5412
 		print '</td></tr>';
@@ -5423,7 +5423,7 @@  discard block
 block discarded – undo
5423 5423
 
5424 5424
 	$resql2 = $db->query($sql2);
5425 5425
 
5426
-	if (! $resql2) {
5426
+	if (!$resql2) {
5427 5427
 		dol_print_error($db);
5428 5428
 		$db->rollback();
5429 5429
 		print '</td></tr>';
@@ -5480,7 +5480,7 @@  discard block
 block discarded – undo
5480 5480
 
5481 5481
 		$resql = $db->query($sql);
5482 5482
 
5483
-		require_once DOL_DOCUMENT_ROOT . '/accountancy/class/bookkeeping.class.php';
5483
+		require_once DOL_DOCUMENT_ROOT.'/accountancy/class/bookkeeping.class.php';
5484 5484
 		$bookkeeping = new BookKeeping($db);
5485 5485
 		if ($resql) {
5486 5486
 			while ($obj = $db->fetch_object($resql)) {
@@ -5622,9 +5622,9 @@  discard block
 block discarded – undo
5622 5622
 	$hmac_encoded_secret_key = getDolGlobalString('BLOCKEDLOG_HMAC_KEY');
5623 5623
 	if (empty($hmac_encoded_secret_key)) {
5624 5624
 		// Add key
5625
-		$hmac_secret_key = 'BLOCKEDLOGHMAC'.getRandomPassword(true);		// This is using random_int for 32 chars
5625
+		$hmac_secret_key = 'BLOCKEDLOGHMAC'.getRandomPassword(true); // This is using random_int for 32 chars
5626 5626
 
5627
-		$result = dolibarr_set_const($db, 'BLOCKEDLOG_HMAC_KEY', $hmac_secret_key, 'chaine', 0, 'The secret key for HMAC used for blockedlog record', 0);	// Will encrypt the value using dolCrypt and store it.
5627
+		$result = dolibarr_set_const($db, 'BLOCKEDLOG_HMAC_KEY', $hmac_secret_key, 'chaine', 0, 'The secret key for HMAC used for blockedlog record', 0); // Will encrypt the value using dolCrypt and store it.
5628 5628
 
5629 5629
 		if ($result < 0) {
5630 5630
 			dol_print_error($db);
@@ -5639,7 +5639,7 @@  discard block
 block discarded – undo
5639 5639
 		// Decode the HMAC key
5640 5640
 		$hmac_secret_key = dolDecrypt($hmac_encoded_secret_key);
5641 5641
 
5642
-		if (! preg_match('/^BLOCKEDLOGHMAC/', $hmac_secret_key)) {
5642
+		if (!preg_match('/^BLOCKEDLOGHMAC/', $hmac_secret_key)) {
5643 5643
 			print 'Error: Failed to decode the crypted value of the parameter BLOCKEDLOG_HMAC_KEY using the $dolibarr_main_crypt_key. A value was found in config parameters in database but decoding failed. May be the database data were restored onto another environment and the coding/decoding key $dolibarr_main_dolcrypt_key was not restored with the same value in conf.php file.';
5644 5644
 			print 'Restore the value of $dolibarr_main_crypt_key that was used for encryption in database and restart the migration.';
5645 5645
 			print 'If you don\'t use the Unalterable Log module, you can also remove the BLOCKEDLOG_HMAC_KEY entry from llx_const table. If you use the Unalterable Log, this is not possible because this will invalidate all past record.';
Please login to merge, or discard this patch.
htdocs/fichinter/card.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -49,8 +49,8 @@  discard block
 block discarded – undo
49 49
 	require_once DOL_DOCUMENT_ROOT."/core/class/html.formcontract.class.php";
50 50
 	require_once DOL_DOCUMENT_ROOT."/contrat/class/contrat.class.php";
51 51
 }
52
-if (getDolGlobalString('FICHEINTER_ADDON') && is_readable(DOL_DOCUMENT_ROOT."/core/modules/fichinter/mod_" . getDolGlobalString('FICHEINTER_ADDON').".php")) {
53
-	require_once DOL_DOCUMENT_ROOT."/core/modules/fichinter/mod_" . getDolGlobalString('FICHEINTER_ADDON').'.php';
52
+if (getDolGlobalString('FICHEINTER_ADDON') && is_readable(DOL_DOCUMENT_ROOT."/core/modules/fichinter/mod_".getDolGlobalString('FICHEINTER_ADDON').".php")) {
53
+	require_once DOL_DOCUMENT_ROOT."/core/modules/fichinter/mod_".getDolGlobalString('FICHEINTER_ADDON').'.php';
54 54
 }
55 55
 require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
56 56
 require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 
69 69
 $id = GETPOSTINT('id');
70 70
 $ref = GETPOST('ref', 'alpha');
71
-$ref_client	= GETPOST('ref_client', 'alpha');
71
+$ref_client = GETPOST('ref_client', 'alpha');
72 72
 $socid = GETPOSTINT('socid');
73 73
 $contratid = GETPOSTINT('contratid');
74 74
 $action = GETPOST('action', 'alpha');
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
 				$result = fichinter_create($db, $object, (!GETPOST('model', 'alpha')) ? $object->model_pdf : GETPOST('model', 'alpha'), $outputlangs);
242 242
 			}
243 243
 
244
-			header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object->id);
244
+			header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id);
245 245
 			exit;
246 246
 		} else {
247 247
 			$mesg = $object->error;
@@ -266,7 +266,7 @@  discard block
 block discarded – undo
266 266
 				$result = fichinter_create($db, $object, (!GETPOST('model', 'alpha')) ? $object->model_pdf : GETPOST('model', 'alpha'), $outputlangs);
267 267
 			}
268 268
 
269
-			header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object->id);
269
+			header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id);
270 270
 			exit;
271 271
 		} else {
272 272
 			$mesg = $object->error;
@@ -291,7 +291,7 @@  discard block
 block discarded – undo
291 291
 				$result = fichinter_create($db, $object, (!GETPOST('model', 'alpha')) ? $object->model_pdf : GETPOST('model', 'alpha'), $outputlangs);
292 292
 			}
293 293
 
294
-			header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object->id);
294
+			header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id);
295 295
 			exit;
296 296
 		} else {
297 297
 			$mesg = $object->error;
@@ -387,7 +387,7 @@  discard block
 block discarded – undo
387 387
 
388 388
 					$classname = ucfirst($subelement);
389 389
 					$srcobject = new $classname($db);
390
-					'@phan-var-force Commande|Propal|Contrat $srcobject';  // Can be other class, but CommonObject is too generic
390
+					'@phan-var-force Commande|Propal|Contrat $srcobject'; // Can be other class, but CommonObject is too generic
391 391
 					/** @var Commande|Propal|Contrat $srcobject */
392 392
 
393 393
 					dol_syslog("Try to find source object origin=".$object->origin." originid=".$object->origin_id." to add lines");
@@ -868,7 +868,7 @@  discard block
 block discarded – undo
868 868
 	include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
869 869
 
870 870
 	if ($action == 'update_extras' && $permissiontoeditextra) {
871
-		$object->oldcopy = dol_clone($object, 2);  // @phan-suppress-current-line PhanTypeMismatchProperty
871
+		$object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty
872 872
 
873 873
 		$attribute_name = GETPOST('attribute', 'aZ09');
874 874
 
@@ -1195,7 +1195,7 @@  discard block
 block discarded – undo
1195 1195
 	} else {
1196 1196
 		print '<form name="fichinter" action="'.$_SERVER['PHP_SELF'].'" method="POST">';
1197 1197
 		print '<input type="hidden" name="token" value="'.newToken().'">';
1198
-		print '<input type="hidden" name="action" value="create">';		// We go back to create action
1198
+		print '<input type="hidden" name="action" value="create">'; // We go back to create action
1199 1199
 		print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
1200 1200
 
1201 1201
 		print dol_get_fiche_head([]);
@@ -1593,13 +1593,13 @@  discard block
 block discarded – undo
1593 1593
 						$line_options = is_array($line_options) ? $line_options['subtotal'] : array();
1594 1594
 						print '<td colspan="3" ><strong>'.dol_htmlentitiesbr($objp->description).'</strong>';
1595 1595
 						if (array_key_exists('titleshowuponpdf', $line_options)) {
1596
-							echo '&nbsp;' . img_picto($langs->trans("ShowUPOnPDF"), 'invoicing');
1596
+							echo '&nbsp;'.img_picto($langs->trans("ShowUPOnPDF"), 'invoicing');
1597 1597
 						}
1598 1598
 						if (array_key_exists('titleshowtotalexludingvatonpdf', $line_options)) {
1599
-							echo '&nbsp; <span title="' . $langs->trans("ShowTotalExludingVATOnPDF") . '">%</span>';
1599
+							echo '&nbsp; <span title="'.$langs->trans("ShowTotalExludingVATOnPDF").'">%</span>';
1600 1600
 						}
1601 1601
 						if (array_key_exists('titleforcepagebreak', $line_options)) {
1602
-							echo '&nbsp;' . img_picto($langs->trans("ForcePageBreak"), 'file');
1602
+							echo '&nbsp;'.img_picto($langs->trans("ForcePageBreak"), 'file');
1603 1603
 						}
1604 1604
 						print "</td>";
1605 1605
 					} else {
@@ -1955,9 +1955,9 @@  discard block
 block discarded – undo
1955 1955
 				// Sign
1956 1956
 				if ($object->status > Fichinter::STATUS_DRAFT) {
1957 1957
 					if ($object->signed_status != Fichinter::$SIGNED_STATUSES['STATUS_SIGNED_ALL']) {
1958
-						print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=sign&token=' . newToken() . '">' . $langs->trans("InterventionSign") . '</a></div>';
1958
+						print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=sign&token='.newToken().'">'.$langs->trans("InterventionSign").'</a></div>';
1959 1959
 					} else {
1960
-						print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=unsign&token=' . newToken() . '">' . $langs->trans("InterventionUnsign") . '</a></div>';
1960
+						print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=unsign&token='.newToken().'">'.$langs->trans("InterventionUnsign").'</a></div>';
1961 1961
 					}
1962 1962
 				}
1963 1963
 
Please login to merge, or discard this patch.
htdocs/ticket/card.php 1 patch
Spacing   +48 added lines, -48 removed lines patch added patch discarded remove patch
@@ -180,31 +180,31 @@  discard block
 block discarded – undo
180 180
 		$search_agenda_label = '';
181 181
 	}
182 182
 
183
-	$backurlforlist = DOL_URL_ROOT . '/ticket/list.php';
183
+	$backurlforlist = DOL_URL_ROOT.'/ticket/list.php';
184 184
 
185 185
 	if (empty($backtopage) || ($cancel && empty($id))) {
186 186
 		if (empty($backtopage) || ($cancel && strpos($backtopage, '__ID__'))) {
187 187
 			if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) {
188 188
 				$backtopage = $backurlforlist;
189 189
 			} else {
190
-				$backtopage = DOL_URL_ROOT . '/ticket/card.php?id=' . ((!empty($id) && $id > 0) ? $id : '__ID__');
190
+				$backtopage = DOL_URL_ROOT.'/ticket/card.php?id='.((!empty($id) && $id > 0) ? $id : '__ID__');
191 191
 			}
192 192
 		}
193 193
 	}
194 194
 
195 195
 	if ($cancel) {
196 196
 		if (!empty($backtopageforcancel)) {
197
-			header("Location: " . $backtopageforcancel);
197
+			header("Location: ".$backtopageforcancel);
198 198
 			exit;
199 199
 		} elseif (!empty($backtopage)) {
200
-			header("Location: " . $backtopage);
200
+			header("Location: ".$backtopage);
201 201
 			exit;
202 202
 		}
203 203
 		$action = 'view';
204 204
 	}
205 205
 
206 206
 	if ((($action == 'add' && GETPOST('save', 'alpha')) || ($action == 'update' && $object->status < Ticket::STATUS_CLOSED)) && $permissiontoadd) {
207
-		$ifErrorAction = ($action == 'add' ? 'create' : 'edit');	// Test on permission not required here
207
+		$ifErrorAction = ($action == 'add' ? 'create' : 'edit'); // Test on permission not required here
208 208
 		if ($action == 'add') {		// Test on permission already done
209 209
 			$object->track_id = null;
210 210
 		}
@@ -337,7 +337,7 @@  discard block
 block discarded – undo
337 337
 
338 338
 				if (!$error) {
339 339
 					// File transfer
340
-					$object->copyFilesForTicket('');        // trackid is forced to '' because files were uploaded when no id for ticket exists yet and trackid was ''
340
+					$object->copyFilesForTicket(''); // trackid is forced to '' because files were uploaded when no id for ticket exists yet and trackid was ''
341 341
 				}
342 342
 			}
343 343
 			if (!$error) {
@@ -347,13 +347,13 @@  discard block
 block discarded – undo
347 347
 					if (empty($id)) {
348 348
 						$url = $backtopage;
349 349
 					} else {
350
-						$url = 'card.php?track_id=' . urlencode($object->track_id);
350
+						$url = 'card.php?track_id='.urlencode($object->track_id);
351 351
 					}
352 352
 				} else {
353
-					$url = 'card.php?track_id=' . urlencode($object->track_id);
353
+					$url = 'card.php?track_id='.urlencode($object->track_id);
354 354
 				}
355 355
 
356
-				header("Location: " . $url);
356
+				header("Location: ".$url);
357 357
 				exit;
358 358
 			} else {
359 359
 				$db->rollback();
@@ -371,7 +371,7 @@  discard block
 block discarded – undo
371 371
 		if ($object->markAsRead($user) > 0) {
372 372
 			setEventMessages($langs->trans('TicketMarkedAsRead'), null, 'mesgs');
373 373
 
374
-			header("Location: card.php?track_id=" . $object->track_id);
374
+			header("Location: card.php?track_id=".$object->track_id);
375 375
 			exit;
376 376
 		} else {
377 377
 			setEventMessages($object->error, $object->errors, 'errors');
@@ -427,7 +427,7 @@  discard block
 block discarded – undo
427 427
 			$object->fetch_user($usertoassign);
428 428
 
429 429
 			setEventMessages($langs->trans('TicketAssigned'), null, 'mesgs');
430
-			header("Location: card.php?track_id=" . $object->track_id);
430
+			header("Location: card.php?track_id=".$object->track_id);
431 431
 			exit;
432 432
 		} else {
433 433
 			array_push($object->errors, $object->error);
@@ -444,10 +444,10 @@  discard block
 block discarded – undo
444 444
 			if (!empty($backtopage)) {
445 445
 				$url = $backtopage;
446 446
 			} else {
447
-				$url = 'card.php?track_id=' . urlencode($object->track_id);
447
+				$url = 'card.php?track_id='.urlencode($object->track_id);
448 448
 			}
449 449
 
450
-			header("Location: " . $url);
450
+			header("Location: ".$url);
451 451
 			exit;
452 452
 		} else {
453 453
 			setEventMessages($object->error, $object->errors, 'errors');
@@ -464,8 +464,8 @@  discard block
 block discarded – undo
464 464
 		if ($object->close($user, ($action == "confirm_abandon" ? 1 : 0))) {	// Test on pemrission already done
465 465
 			setEventMessages($langs->trans('TicketMarkedAsClosed'), null, 'mesgs');
466 466
 
467
-			$url = 'card.php?track_id=' . GETPOST('track_id', 'alpha');
468
-			header("Location: " . $url);
467
+			$url = 'card.php?track_id='.GETPOST('track_id', 'alpha');
468
+			header("Location: ".$url);
469 469
 			exit;
470 470
 		} else {
471 471
 			$action = '';
@@ -480,10 +480,10 @@  discard block
 block discarded – undo
480 480
 
481 481
 			$object->close($user);
482 482
 
483
-			setEventMessages('<div class="confirm">' . $langs->trans('TicketMarkedAsClosed') . '</div>', null, 'mesgs');
483
+			setEventMessages('<div class="confirm">'.$langs->trans('TicketMarkedAsClosed').'</div>', null, 'mesgs');
484 484
 
485
-			$url = 'card.php?track_id=' . GETPOST('track_id', 'alpha');
486
-			header("Location: " . $url);
485
+			$url = 'card.php?track_id='.GETPOST('track_id', 'alpha');
486
+			header("Location: ".$url);
487 487
 			exit;
488 488
 		} else {
489 489
 			setEventMessages($object->error, $object->errors, 'errors');
@@ -495,7 +495,7 @@  discard block
 block discarded – undo
495 495
 		if ($object->fetch(GETPOSTINT('id'), '', GETPOST('track_id', 'alpha')) >= 0) {
496 496
 			$newid = $object->createFromClone($user, $object->id);
497 497
 			if ($newid > 0) {
498
-				header("Location: " . DOL_URL_ROOT . "/ticket/card.php?id=".$newid);
498
+				header("Location: ".DOL_URL_ROOT."/ticket/card.php?id=".$newid);
499 499
 				exit;
500 500
 			} else {
501 501
 				setEventMessages($object->error, $object->errors, 'errors');
@@ -507,12 +507,12 @@  discard block
 block discarded – undo
507 507
 	if ($action == 'confirm_delete_ticket' && GETPOST('confirm', 'alpha') == "yes" && $permissiontodelete) {
508 508
 		if ($object->fetch(GETPOSTINT('id'), '', GETPOST('track_id', 'alpha')) >= 0) {
509 509
 			if ($object->delete($user) > 0) {
510
-				setEventMessages('<div class="confirm">' . $langs->trans('TicketDeletedSuccess') . '</div>', null, 'mesgs');
511
-				header("Location: " . DOL_URL_ROOT . "/ticket/list.php");
510
+				setEventMessages('<div class="confirm">'.$langs->trans('TicketDeletedSuccess').'</div>', null, 'mesgs');
511
+				header("Location: ".DOL_URL_ROOT."/ticket/list.php");
512 512
 				exit;
513 513
 			} else {
514 514
 				$langs->load("errors");
515
-				$mesg = '<div class="error">' . $langs->trans($object->error) . '</div>';
515
+				$mesg = '<div class="error">'.$langs->trans($object->error).'</div>';
516 516
 				$action = '';
517 517
 			}
518 518
 		}
@@ -522,8 +522,8 @@  discard block
 block discarded – undo
522 522
 	if ($action == 'set_thirdparty' && $user->hasRight('ticket', 'write')) {
523 523
 		if ($object->fetch(GETPOSTINT('id'), '', GETPOST('track_id', 'alpha')) >= 0) {
524 524
 			$result = $object->setCustomer(GETPOSTINT('editcustomer'));
525
-			$url = $_SERVER["PHP_SELF"] . '?track_id=' . GETPOST('track_id', 'alpha');
526
-			header("Location: " . $url);
525
+			$url = $_SERVER["PHP_SELF"].'?track_id='.GETPOST('track_id', 'alpha');
526
+			header("Location: ".$url);
527 527
 			exit();
528 528
 		}
529 529
 	}
@@ -533,8 +533,8 @@  discard block
 block discarded – undo
533 533
 		if ($object->fetch(GETPOSTINT('id'), '', GETPOST('track_id', 'alpha')) >= 0) {
534 534
 			$result = $object->setProgression(GETPOSTINT('progress'));
535 535
 
536
-			$url = 'card.php?track_id=' . $object->track_id;
537
-			header("Location: " . $url);
536
+			$url = 'card.php?track_id='.$object->track_id;
537
+			header("Location: ".$url);
538 538
 			exit();
539 539
 		}
540 540
 	}
@@ -544,8 +544,8 @@  discard block
 block discarded – undo
544 544
 		if ($object->fetch(GETPOSTINT('id'), '', GETPOST('track_id', 'alpha')) >= 0) {
545 545
 			$result = $object->setCategories(GETPOST('categories', 'array'));
546 546
 
547
-			$url = 'card.php?track_id=' . $object->track_id;
548
-			header("Location: " . $url);
547
+			$url = 'card.php?track_id='.$object->track_id;
548
+			header("Location: ".$url);
549 549
 			exit();
550 550
 		}
551 551
 	}
@@ -569,7 +569,7 @@  discard block
 block discarded – undo
569 569
 				}
570 570
 			}
571 571
 
572
-			header("Location: " . $_SERVER['PHP_SELF'] . "?track_id=" . $object->track_id);
572
+			header("Location: ".$_SERVER['PHP_SELF']."?track_id=".$object->track_id);
573 573
 			exit;
574 574
 		}
575 575
 	}
@@ -584,8 +584,8 @@  discard block
 block discarded – undo
584 584
 					$res = $object->setStatut(Ticket::STATUS_NOT_READ, null, '', $triggermodname);
585 585
 				}
586 586
 				if ($res) {
587
-					$url = 'card.php?track_id=' . $object->track_id;
588
-					header("Location: " . $url);
587
+					$url = 'card.php?track_id='.$object->track_id;
588
+					header("Location: ".$url);
589 589
 					exit();
590 590
 				} else {
591 591
 					$error++;
@@ -597,16 +597,16 @@  discard block
 block discarded – undo
597 597
 		// Categorisation dans projet
598 598
 		if ($object->fetch(GETPOSTINT('id'), '', GETPOST('track_id', 'alpha')) >= 0) {
599 599
 			$object->setProject($projectid);
600
-			$url = 'card.php?track_id=' . $object->track_id;
601
-			header("Location: " . $url);
600
+			$url = 'card.php?track_id='.$object->track_id;
601
+			header("Location: ".$url);
602 602
 			exit();
603 603
 		}
604 604
 	} elseif ($action == 'setcontract' && $permissiontoadd) {
605 605
 		// Categorisation dans contrat
606 606
 		if ($object->fetch(GETPOSTINT('id'), '', GETPOST('track_id', 'alpha')) >= 0) {
607 607
 			$object->setContract(GETPOSTINT('contractid'));
608
-			$url = 'card.php?track_id=' . $object->track_id;
609
-			header("Location: " . $url);
608
+			$url = 'card.php?track_id='.$object->track_id;
609
+			header("Location: ".$url);
610 610
 			exit();
611 611
 		}
612 612
 	} elseif ($action == "set_message" && $user->hasRight('ticket', 'manage')) {
@@ -637,8 +637,8 @@  discard block
 block discarded – undo
637 637
 			//$old_status = $object->status;
638 638
 			$res = $object->setStatut($new_status);
639 639
 			if ($res) {
640
-				$url = 'card.php?track_id=' . $object->track_id;
641
-				header("Location: " . $url);
640
+				$url = 'card.php?track_id='.$object->track_id;
641
+				header("Location: ".$url);
642 642
 				exit();
643 643
 			} else {
644 644
 				$error++;
@@ -692,17 +692,17 @@  discard block
 block discarded – undo
692 692
 	include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
693 693
 
694 694
 	$permissiondellink = $user->hasRight('ticket', 'write');
695
-	include DOL_DOCUMENT_ROOT . '/core/actions_dellink.inc.php'; // Must be 'include', not 'include_once'
695
+	include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be 'include', not 'include_once'
696 696
 
697 697
 	// Actions to build doc
698
-	include DOL_DOCUMENT_ROOT . '/core/actions_builddoc.inc.php';
698
+	include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
699 699
 
700 700
 	// Actions to send emails
701 701
 	$triggersendname = 'TICKET_SENTBYMAIL';
702 702
 	$paramname = 'id';
703 703
 	$autocopy = 'MAIN_MAIL_AUTOCOPY_TICKET_TO'; // used to know the automatic BCC to add
704
-	$trackid = 'tic' . $object->id;
705
-	include DOL_DOCUMENT_ROOT . '/core/actions_sendmails.inc.php';
704
+	$trackid = 'tic'.$object->id;
705
+	include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
706 706
 
707 707
 	// Set $action to correct value for the case we used presend action to add a message
708 708
 	if (GETPOSTISSET('actionbis') && $action == 'presend') {	// Test on permission not required here
@@ -738,7 +738,7 @@  discard block
 block discarded – undo
738 738
 
739 739
 	print load_fiche_titre($langs->trans('NewTicket'), '', 'ticket');
740 740
 
741
-	$formticket->trackid = '';		// TODO Use a unique key 'tic' to avoid conflict in upload file feature
741
+	$formticket->trackid = ''; // TODO Use a unique key 'tic' to avoid conflict in upload file feature
742 742
 	$formticket->withfromsocid = $socid ? $socid : $user->socid;
743 743
 	$formticket->withfromcontactid = $contactid ? $contactid : '';
744 744
 	$formticket->withtitletopic = 1;
@@ -771,7 +771,7 @@  discard block
 block discarded – undo
771 771
 
772 772
 	print dol_get_fiche_head($head, 'tabTicket', $langs->trans('Ticket'), -1, 'ticket');
773 773
 
774
-	$formticket->trackid = $object->track_id;        // TODO Use a unique key 'tic' to avoid conflict in upload file feature
774
+	$formticket->trackid = $object->track_id; // TODO Use a unique key 'tic' to avoid conflict in upload file feature
775 775
 	$formticket->withfromsocid = $object->socid;
776 776
 	$formticket->withtitletopic = 1;
777 777
 	//  $formticket->withnotifytiersatcreate = ($notifyTiers ? 1 : (getDolGlobalString('TICKET_CHECK_NOTIFY_THIRDPARTY_AT_CREATION') ? 1 : 0));
@@ -806,7 +806,7 @@  discard block
 block discarded – undo
806 806
 				'-3' => $langs->trans('TicketNotNotifyTiersAtClose')
807 807
 			);
808 808
 			foreach ($thirdparty_contacts as $thirdparty_contact) {
809
-				$contacts_select[$thirdparty_contact['id']] = $thirdparty_contact['civility'] . ' ' . $thirdparty_contact['lastname'] . ' ' . $thirdparty_contact['firstname'];
809
+				$contacts_select[$thirdparty_contact['id']] = $thirdparty_contact['civility'].' '.$thirdparty_contact['lastname'].' '.$thirdparty_contact['firstname'];
810 810
 			}
811 811
 
812 812
 			// Default select all or no contact
@@ -1061,8 +1061,8 @@  discard block
 block discarded – undo
1061 1061
 						$morehtmlref .= $formcontract->formSelectContract($_SERVER["PHP_SELF"].'?id='.$object->id, $object->socid, $object->fk_contract, 'contratid', 0, 1, 1, 1);
1062 1062
 					} else {
1063 1063
 						$morehtmlref .= '<a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=edit_contrat&token='.newToken().'&id='.$object->id.'">';
1064
-						$morehtmlref .=  img_edit($langs->trans('SetContract'));
1065
-						$morehtmlref .=  '</a>';
1064
+						$morehtmlref .= img_edit($langs->trans('SetContract'));
1065
+						$morehtmlref .= '</a>';
1066 1066
 					}
1067 1067
 				} else {
1068 1068
 					if (!empty($object->fk_contract)) {
@@ -1504,10 +1504,10 @@  discard block
 block discarded – undo
1504 1504
 				// Link to create an intervention
1505 1505
 				// socid is needed otherwise fichinter ask it and forgot origin after form submit :\
1506 1506
 				if (!$object->fk_soc && $user->hasRight("ficheinter", "creer")) {
1507
-					print dolGetButtonAction($langs->trans('UnableToCreateInterIfNoSocid'), $langs->trans('TicketAddIntervention'), 'default', $_SERVER['PHP_SELF']. '#', '', false);
1507
+					print dolGetButtonAction($langs->trans('UnableToCreateInterIfNoSocid'), $langs->trans('TicketAddIntervention'), 'default', $_SERVER['PHP_SELF'].'#', '', false);
1508 1508
 				}
1509 1509
 				if ($object->fk_soc > 0 && isset($object->status) && $object->status < Ticket::STATUS_CLOSED && $user->hasRight('ficheinter', 'creer')) {
1510
-					print dolGetButtonAction('', $langs->trans('TicketAddIntervention'), 'default', DOL_URL_ROOT.'/fichinter/card.php?action=create&token='.newToken().'&socid='. $object->fk_soc.'&origin=ticket_ticket&originid='. $object->id, '');
1510
+					print dolGetButtonAction('', $langs->trans('TicketAddIntervention'), 'default', DOL_URL_ROOT.'/fichinter/card.php?action=create&token='.newToken().'&socid='.$object->fk_soc.'&origin=ticket_ticket&originid='.$object->id, '');
1511 1511
 				}
1512 1512
 
1513 1513
 				// Close ticket if status is read
Please login to merge, or discard this patch.
htdocs/core/triggers/interface_95_modWebhook_WebhookTriggers.class.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -81,10 +81,10 @@  discard block
 block discarded – undo
81 81
 		$errors = 0;
82 82
 		$errorforhistory = 0;
83 83
 		$static_object = new Target($this->db);
84
-		$target_url = $static_object->fetchAll();	// TODO Replace this with a search with filter on $action trigger to avoid to filter later.
84
+		$target_url = $static_object->fetchAll(); // TODO Replace this with a search with filter on $action trigger to avoid to filter later.
85 85
 
86 86
 		if (is_numeric($target_url) && $target_url < 0) {
87
-			dol_syslog("Error Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id);
87
+			dol_syslog("Error Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
88 88
 			$this->errors = array_merge($this->errors, $static_object->errors);
89 89
 			return -1;
90 90
 		}
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
 					$nbPosts++;
136 136
 				} else {
137 137
 					$errormsg = "The WebHook for ".$action." failed to get URL ".$tmpobject->url." with httpcode=".(!empty($response['http_code']) ? $response['http_code'] : "")." curl_error_no=".(!empty($response['curl_error_no']) ? $response['curl_error_no'] : "");
138
-					$errorforhistory ++;
138
+					$errorforhistory++;
139 139
 
140 140
 					if ($tmpobject->type == Target::TYPE_BLOCKING) {
141 141
 						$errors++;
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
 		}
171 171
 
172 172
 		$dbhistory->close();
173
-		dol_syslog("Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id." -> nbPost=".$nbPosts);
173
+		dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id." -> nbPost=".$nbPosts);
174 174
 
175 175
 		if (!empty($errors)) {
176 176
 			return $errors * -1;
Please login to merge, or discard this patch.
htdocs/core/class/html.formcompany.class.php 1 patch
Spacing   +112 added lines, -112 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
  *	Only common components are here.
34 34
  */
35 35
 
36
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.form.class.php';
36
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php';
37 37
 
38 38
 
39 39
 /**
@@ -57,13 +57,13 @@  discard block
 block discarded – undo
57 57
 		$effs = array();
58 58
 
59 59
 		$sql = "SELECT id, code, libelle as label";
60
-		$sql .= " FROM " . $this->db->prefix() . "c_typent";
61
-		$sql .= " WHERE active = 1 AND (fk_country IS NULL OR fk_country = " . (empty($mysoc->country_id) ? '0' : $mysoc->country_id) . ")";
60
+		$sql .= " FROM ".$this->db->prefix()."c_typent";
61
+		$sql .= " WHERE active = 1 AND (fk_country IS NULL OR fk_country = ".(empty($mysoc->country_id) ? '0' : $mysoc->country_id).")";
62 62
 		if ($filter) {
63
-			$sql .= " " . $filter;
63
+			$sql .= " ".$filter;
64 64
 		}
65 65
 		$sql .= " ORDER by position, id";
66
-		dol_syslog(get_class($this) . '::typent_array', LOG_DEBUG);
66
+		dol_syslog(get_class($this).'::typent_array', LOG_DEBUG);
67 67
 		$resql = $this->db->query($sql);
68 68
 		if ($resql) {
69 69
 			$num = $this->db->num_rows($resql);
@@ -106,13 +106,13 @@  discard block
 block discarded – undo
106 106
 		$effs = array();
107 107
 
108 108
 		$sql = "SELECT id, code, libelle as label";
109
-		$sql .= " FROM " . $this->db->prefix() . "c_effectif";
109
+		$sql .= " FROM ".$this->db->prefix()."c_effectif";
110 110
 		$sql .= " WHERE active = 1";
111 111
 		if ($filter) {
112
-			$sql .= " " . $filter;
112
+			$sql .= " ".$filter;
113 113
 		}
114 114
 		$sql .= " ORDER BY id ASC";
115
-		dol_syslog(get_class($this) . '::effectif_array', LOG_DEBUG);
115
+		dol_syslog(get_class($this).'::effectif_array', LOG_DEBUG);
116 116
 		$resql = $this->db->query($sql);
117 117
 		if ($resql) {
118 118
 			$num = $this->db->num_rows($resql);
@@ -153,13 +153,13 @@  discard block
 block discarded – undo
153 153
 		// phpcs:enable
154 154
 		global $user, $langs;
155 155
 
156
-		print '<form method="post" action="' . $page . '">';
156
+		print '<form method="post" action="'.$page.'">';
157 157
 		print '<input type="hidden" name="action" value="setprospectlevel">';
158
-		print '<input type="hidden" name="token" value="' . newToken() . '">';
158
+		print '<input type="hidden" name="token" value="'.newToken().'">';
159 159
 
160
-		dol_syslog(get_class($this) . '::form_prospect_level', LOG_DEBUG);
160
+		dol_syslog(get_class($this).'::form_prospect_level', LOG_DEBUG);
161 161
 		$sql = "SELECT code, label";
162
-		$sql .= " FROM " . $this->db->prefix() . "c_prospectlevel";
162
+		$sql .= " FROM ".$this->db->prefix()."c_prospectlevel";
163 163
 		$sql .= " WHERE active > 0";
164 164
 		$sql .= " ORDER BY sortorder";
165 165
 		$resql = $this->db->query($sql);
@@ -185,9 +185,9 @@  discard block
 block discarded – undo
185 185
 			dol_print_error($this->db);
186 186
 		}
187 187
 		if (!empty($htmlname) && $user->admin) {
188
-			print ' ' . info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
188
+			print ' '.info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
189 189
 		}
190
-		print '<input type="submit" class="button button-save valignmiddle small" value="' . $langs->trans("Modify") . '">';
190
+		print '<input type="submit" class="button button-save valignmiddle small" value="'.$langs->trans("Modify").'">';
191 191
 		print '</form>';
192 192
 	}
193 193
 
@@ -204,13 +204,13 @@  discard block
 block discarded – undo
204 204
 	{
205 205
 		global $user, $langs;
206 206
 
207
-		print '<form method="post" action="' . $page . '">';
207
+		print '<form method="post" action="'.$page.'">';
208 208
 		print '<input type="hidden" name="action" value="setprospectcontactlevel">';
209
-		print '<input type="hidden" name="token" value="' . newToken() . '">';
209
+		print '<input type="hidden" name="token" value="'.newToken().'">';
210 210
 
211 211
 		dol_syslog(__METHOD__, LOG_DEBUG);
212 212
 		$sql = "SELECT code, label";
213
-		$sql .= " FROM " . $this->db->prefix() . "c_prospectcontactlevel";
213
+		$sql .= " FROM ".$this->db->prefix()."c_prospectcontactlevel";
214 214
 		$sql .= " WHERE active > 0";
215 215
 		$sql .= " ORDER BY sortorder";
216 216
 		$resql = $this->db->query($sql);
@@ -236,9 +236,9 @@  discard block
 block discarded – undo
236 236
 			dol_print_error($this->db);
237 237
 		}
238 238
 		if (!empty($htmlname) && $user->admin) {
239
-			print ' ' . info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
239
+			print ' '.info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
240 240
 		}
241
-		print '<input type="submit" class="button button-save valignmiddle small" value="' . $langs->trans("Modify") . '">';
241
+		print '<input type="submit" class="button button-save valignmiddle small" value="'.$langs->trans("Modify").'">';
242 242
 		print '</form>';
243 243
 	}
244 244
 
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
 		// phpcs:enable
280 280
 		global $conf, $langs, $user;
281 281
 
282
-		dol_syslog(get_class($this) . "::select_departement selected=" . $selected . ", country_codeid=" . $country_codeid, LOG_DEBUG);
282
+		dol_syslog(get_class($this)."::select_departement selected=".$selected.", country_codeid=".$country_codeid, LOG_DEBUG);
283 283
 
284 284
 		$langs->load("dict");
285 285
 
@@ -287,28 +287,28 @@  discard block
 block discarded – undo
287 287
 
288 288
 		// Search departements/cantons/province active d'une region et pays actif
289 289
 		$sql = "SELECT d.rowid, d.code_departement as code, d.nom as name, d.active, c.label as country, c.code as country_code, r.nom as region_name FROM";
290
-		$sql .= " " . $this->db->prefix() . "c_departements as d, " . $this->db->prefix() . "c_regions as r," . $this->db->prefix() . "c_country as c";
290
+		$sql .= " ".$this->db->prefix()."c_departements as d, ".$this->db->prefix()."c_regions as r,".$this->db->prefix()."c_country as c";
291 291
 		$sql .= " WHERE d.fk_region=r.code_region and r.fk_pays=c.rowid";
292 292
 		$sql .= " AND d.active = 1 AND r.active = 1 AND c.active = 1";
293 293
 		if ($country_codeid && is_numeric($country_codeid)) {
294
-			$sql .= " AND c.rowid = '" . $this->db->escape($country_codeid) . "'";
294
+			$sql .= " AND c.rowid = '".$this->db->escape($country_codeid)."'";
295 295
 		}
296 296
 		if ($country_codeid && !is_numeric($country_codeid)) {
297
-			$sql .= " AND c.code = '" . $this->db->escape($country_codeid) . "'";
297
+			$sql .= " AND c.code = '".$this->db->escape($country_codeid)."'";
298 298
 		}
299 299
 		$sql .= " ORDER BY c.code, d.code_departement";
300 300
 
301 301
 		$result = $this->db->query($sql);
302 302
 		if ($result) {
303 303
 			if (!empty($htmlname)) {
304
-				$out .= '<select id="' . $htmlname . '" class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">';
304
+				$out .= '<select id="'.$htmlname.'" class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">';
305 305
 			}
306 306
 			if ($country_codeid) {
307 307
 				$out .= '<option value="0">&nbsp;</option>';
308 308
 			}
309 309
 			$num = $this->db->num_rows($result);
310 310
 			$i = 0;
311
-			dol_syslog(get_class($this) . "::select_departement num=" . $num, LOG_DEBUG);
311
+			dol_syslog(get_class($this)."::select_departement num=".$num, LOG_DEBUG);
312 312
 			if ($num) {
313 313
 				$country = '';
314 314
 				while ($i < $num) {
@@ -319,15 +319,15 @@  discard block
 block discarded – undo
319 319
 						if (!$country || $country != $obj->country) {
320 320
 							// Show break if we are in list with multiple countries
321 321
 							if (!$country_codeid && $obj->country_code) {
322
-								$out .= '<option value="-1" disabled data-html="----- ' . $obj->country . ' -----">----- ' . $obj->country . " -----</option>\n";
322
+								$out .= '<option value="-1" disabled data-html="----- '.$obj->country.' -----">----- '.$obj->country." -----</option>\n";
323 323
 								$country = $obj->country;
324 324
 							}
325 325
 						}
326 326
 
327 327
 						if (!empty($selected) && $selected == $obj->rowid) {
328
-							$out .= '<option value="' . $obj->rowid . '" selected>';
328
+							$out .= '<option value="'.$obj->rowid.'" selected>';
329 329
 						} else {
330
-							$out .= '<option value="' . $obj->rowid . '">';
330
+							$out .= '<option value="'.$obj->rowid.'">';
331 331
 						}
332 332
 
333 333
 						// Si traduction existe, on l'utilise, sinon on prend le libelle par default
@@ -336,13 +336,13 @@  discard block
 block discarded – undo
336 336
 							(getDolGlobalInt('MAIN_SHOW_STATE_CODE') == 1 || getDolGlobalInt('MAIN_SHOW_STATE_CODE') == 2 || getDolGlobalString('MAIN_SHOW_STATE_CODE') === 'all')
337 337
 						) {
338 338
 							if (getDolGlobalInt('MAIN_SHOW_REGION_IN_STATE_SELECT') == 1) {
339
-								$out .= $obj->region_name . ' - ' . $obj->code . ' - ' . ($langs->trans($obj->code) != $obj->code ? $langs->trans($obj->code) : ($obj->name != '-' ? $obj->name : ''));
339
+								$out .= $obj->region_name.' - '.$obj->code.' - '.($langs->trans($obj->code) != $obj->code ? $langs->trans($obj->code) : ($obj->name != '-' ? $obj->name : ''));
340 340
 							} else {
341
-								$out .= $obj->code . ' - ' . ($langs->trans($obj->code) != $obj->code ? $langs->trans($obj->code) : ($obj->name != '-' ? $obj->name : ''));
341
+								$out .= $obj->code.' - '.($langs->trans($obj->code) != $obj->code ? $langs->trans($obj->code) : ($obj->name != '-' ? $obj->name : ''));
342 342
 							}
343 343
 						} else {
344 344
 							if (getDolGlobalInt('MAIN_SHOW_REGION_IN_STATE_SELECT') == 1) {
345
-								$out .= $obj->region_name . ' - ' . ($langs->trans($obj->code) != $obj->code ? $langs->trans($obj->code) : ($obj->name != '-' ? $obj->name : ''));
345
+								$out .= $obj->region_name.' - '.($langs->trans($obj->code) != $obj->code ? $langs->trans($obj->code) : ($obj->name != '-' ? $obj->name : ''));
346 346
 							} else {
347 347
 								$out .= ($langs->trans($obj->code) != $obj->code ? $langs->trans($obj->code) : ($obj->name != '-' ? $obj->name : ''));
348 348
 							}
@@ -357,7 +357,7 @@  discard block
 block discarded – undo
357 357
 				$out .= '</select>';
358 358
 			}
359 359
 			if (!empty($htmlname) && $user->admin) {
360
-				$out .= ' ' . info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
360
+				$out .= ' '.info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
361 361
 			}
362 362
 		} else {
363 363
 			dol_print_error($this->db);
@@ -365,7 +365,7 @@  discard block
 block discarded – undo
365 365
 
366 366
 		// Make select dynamic
367 367
 		if (!empty($htmlname)) {
368
-			include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
368
+			include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
369 369
 			$out .= ajax_combobox($htmlname);
370 370
 		}
371 371
 
@@ -418,14 +418,14 @@  discard block
 block discarded – undo
418 418
 		$langs->load("dict");
419 419
 
420 420
 		$sql = "SELECT r.rowid, r.code_region as code, r.nom as label, r.active, c.code as country_code, c.label as country";
421
-		$sql .= " FROM " . $this->db->prefix() . "c_regions as r, " . $this->db->prefix() . "c_country as c";
421
+		$sql .= " FROM ".$this->db->prefix()."c_regions as r, ".$this->db->prefix()."c_country as c";
422 422
 		$sql .= " WHERE r.fk_pays=c.rowid AND r.active = 1 and c.active = 1";
423 423
 		$sql .= " ORDER BY c.code, c.label ASC";
424 424
 
425
-		dol_syslog(get_class($this) . "::select_region", LOG_DEBUG);
425
+		dol_syslog(get_class($this)."::select_region", LOG_DEBUG);
426 426
 		$resql = $this->db->query($sql);
427 427
 		if ($resql) {
428
-			print '<select class="flat" id="' . $htmlname . '" name="' . $htmlname . '">';
428
+			print '<select class="flat" id="'.$htmlname.'" name="'.$htmlname.'">';
429 429
 			$num = $this->db->num_rows($resql);
430 430
 			$i = 0;
431 431
 			if ($num) {
@@ -437,16 +437,16 @@  discard block
 block discarded – undo
437 437
 					} else {
438 438
 						if ($country == '' || $country != $obj->country) {
439 439
 							// Show break
440
-							$key = $langs->trans("Country" . strtoupper($obj->country_code));
441
-							$valuetoshow = ($key != "Country" . strtoupper($obj->country_code)) ? $obj->country_code . " - " . $key : $obj->country;
442
-							print '<option value="-2" disabled>----- ' . $valuetoshow . " -----</option>\n";
440
+							$key = $langs->trans("Country".strtoupper($obj->country_code));
441
+							$valuetoshow = ($key != "Country".strtoupper($obj->country_code)) ? $obj->country_code." - ".$key : $obj->country;
442
+							print '<option value="-2" disabled>----- '.$valuetoshow." -----</option>\n";
443 443
 							$country = $obj->country;
444 444
 						}
445 445
 
446 446
 						if ($selected > 0 && $selected == $obj->code) {
447
-							print '<option value="' . $obj->code . '" selected>' . $obj->label . '</option>';
447
+							print '<option value="'.$obj->code.'" selected>'.$obj->label.'</option>';
448 448
 						} else {
449
-							print '<option value="' . $obj->code . '">' . $obj->label . '</option>';
449
+							print '<option value="'.$obj->code.'">'.$obj->label.'</option>';
450 450
 						}
451 451
 					}
452 452
 					$i++;
@@ -477,13 +477,13 @@  discard block
 block discarded – undo
477 477
 
478 478
 		$out = '';
479 479
 
480
-		$sql = "SELECT rowid, code, label, active FROM " . $this->db->prefix() . "c_civility";
480
+		$sql = "SELECT rowid, code, label, active FROM ".$this->db->prefix()."c_civility";
481 481
 		$sql .= " WHERE active = 1";
482 482
 
483 483
 		dol_syslog("Form::select_civility", LOG_DEBUG);
484 484
 		$resql = $this->db->query($sql);
485 485
 		if ($resql) {
486
-			$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">';
486
+			$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
487 487
 			$out .= '<option value="">&nbsp;</option>';
488 488
 			$num = $this->db->num_rows($resql);
489 489
 			$i = 0;
@@ -491,12 +491,12 @@  discard block
 block discarded – undo
491 491
 				while ($i < $num) {
492 492
 					$obj = $this->db->fetch_object($resql);
493 493
 					if ($selected == $obj->code) {
494
-						$out .= '<option value="' . $obj->code . '" selected>';
494
+						$out .= '<option value="'.$obj->code.'" selected>';
495 495
 					} else {
496
-						$out .= '<option value="' . $obj->code . '">';
496
+						$out .= '<option value="'.$obj->code.'">';
497 497
 					}
498 498
 					// If translation exists, we use it, otherwise, we use the hard coded label
499
-					$out .= ($langs->trans("Civility" . $obj->code) != "Civility" . $obj->code ? $langs->trans("Civility" . $obj->code) : ($obj->label != '-' ? $obj->label : ''));
499
+					$out .= ($langs->trans("Civility".$obj->code) != "Civility".$obj->code ? $langs->trans("Civility".$obj->code) : ($obj->label != '-' ? $obj->label : ''));
500 500
 					$out .= '</option>';
501 501
 					$i++;
502 502
 				}
@@ -508,7 +508,7 @@  discard block
 block discarded – undo
508 508
 
509 509
 			if ($addjscombo) {
510 510
 				// Enhance with select2
511
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
511
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
512 512
 				$out .= ajax_combobox($htmlname);
513 513
 			}
514 514
 		} else {
@@ -558,22 +558,22 @@  discard block
 block discarded – undo
558 558
 
559 559
 		// Lookup the active juridical types for the active countries
560 560
 		$sql  = "SELECT f.rowid, f.code as code , f.libelle as label, f.active, c.label as country, c.code as country_code";
561
-		$sql .= " FROM " . $this->db->prefix() . "c_forme_juridique as f, " . $this->db->prefix() . "c_country as c";
561
+		$sql .= " FROM ".$this->db->prefix()."c_forme_juridique as f, ".$this->db->prefix()."c_country as c";
562 562
 		$sql .= " WHERE f.fk_pays=c.rowid";
563 563
 		$sql .= " AND f.active = 1 AND c.active = 1";
564 564
 		if ($country_codeid) {
565
-			$sql .= " AND c.code = '" . $this->db->escape((string) $country_codeid) . "'";
565
+			$sql .= " AND c.code = '".$this->db->escape((string) $country_codeid)."'";
566 566
 		}
567 567
 		if ($filter) {
568
-			$sql .= " " . $filter;
568
+			$sql .= " ".$filter;
569 569
 		}
570 570
 		$sql .= " ORDER BY c.code";
571 571
 
572
-		dol_syslog(get_class($this) . "::select_juridicalstatus", LOG_DEBUG);
572
+		dol_syslog(get_class($this)."::select_juridicalstatus", LOG_DEBUG);
573 573
 		$resql = $this->db->query($sql);
574 574
 		if ($resql) {
575 575
 			$out .= '<div id="particulier2" class="visible">';
576
-			$out .= '<select class="flat minwidth200' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">';
576
+			$out .= '<select class="flat minwidth200'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
577 577
 			if ($country_codeid) {
578 578
 				$out .= '<option value="0">&nbsp;</option>'; // When country_codeid is set, we force to add an empty line because it does not appears from select. When not set, we already get the empty line from select.
579 579
 			}
@@ -588,9 +588,9 @@  discard block
 block discarded – undo
588 588
 					$obj = $this->db->fetch_object($resql);
589 589
 
590 590
 					if ($obj->code) {		// We exclude empty line, we will add it later
591
-						$labelcountry = (($langs->trans("Country" . $obj->country_code) != "Country" . $obj->country_code) ? $langs->trans("Country" . $obj->country_code) : $obj->country);
592
-						$labeljs = (($langs->trans("JuridicalStatus" . $obj->code) != "JuridicalStatus" . $obj->code) ? $langs->trans("JuridicalStatus" . $obj->code) : ($obj->label != '-' ? $obj->label : '')); // $obj->label is already in output charset (converted by database driver)
593
-						$arraydata[(int) $obj->code] = array('code' => (int) $obj->code, 'label' => $labeljs, 'label_sort' => $labelcountry . '_' . $labeljs, 'country_code' => (string) $obj->country_code, 'country' => $labelcountry);
591
+						$labelcountry = (($langs->trans("Country".$obj->country_code) != "Country".$obj->country_code) ? $langs->trans("Country".$obj->country_code) : $obj->country);
592
+						$labeljs = (($langs->trans("JuridicalStatus".$obj->code) != "JuridicalStatus".$obj->code) ? $langs->trans("JuridicalStatus".$obj->code) : ($obj->label != '-' ? $obj->label : '')); // $obj->label is already in output charset (converted by database driver)
593
+						$arraydata[(int) $obj->code] = array('code' => (int) $obj->code, 'label' => $labeljs, 'label_sort' => $labelcountry.'_'.$labeljs, 'country_code' => (string) $obj->country_code, 'country' => $labelcountry);
594 594
 					}
595 595
 					$i++;
596 596
 				}
@@ -604,15 +604,15 @@  discard block
 block discarded – undo
604 604
 					if (!$country || $country != $val['country']) {
605 605
 						// Show break when we are in multi country mode
606 606
 						if (empty($country_codeid) && $val['country_code']) {
607
-							$out .= '<option value="0" disabled class="selectoptiondisabledwhite">----- ' . $val['country'] . " -----</option>\n";
607
+							$out .= '<option value="0" disabled class="selectoptiondisabledwhite">----- '.$val['country']." -----</option>\n";
608 608
 							$country = $val['country'];
609 609
 						}
610 610
 					}
611 611
 
612 612
 					if ($selected > 0 && $selected == $val['code']) {
613
-						$out .= '<option value="' . $val['code'] . '" selected>';
613
+						$out .= '<option value="'.$val['code'].'" selected>';
614 614
 					} else {
615
-						$out .= '<option value="' . $val['code'] . '">';
615
+						$out .= '<option value="'.$val['code'].'">';
616 616
 					}
617 617
 					// If translation exists, we use it, otherwise we use default label in database
618 618
 					$out .= $val['label'];
@@ -621,11 +621,11 @@  discard block
 block discarded – undo
621 621
 			}
622 622
 			$out .= '</select>';
623 623
 			if ($user->admin) {
624
-				$out .= ' ' . info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
624
+				$out .= ' '.info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
625 625
 			}
626 626
 
627 627
 			// Make select dynamic
628
-			include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
628
+			include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
629 629
 			$out .= ajax_combobox($htmlname);
630 630
 
631 631
 			$out .= '</div>';
@@ -679,13 +679,13 @@  discard block
 block discarded – undo
679 679
 			$events[] = array('method' => 'getContacts', 'url' => dol_buildpath('/core/ajax/contacts.php', 1), 'htmlname' => 'contactid', 'params' => array('add-customer-contact' => 'disabled'));
680 680
 
681 681
 			if (count($events)) {	// If there is some ajax events to run once selection is done, we add code here to run events
682
-				print '<script nonce="' . getNonce() . '" type="text/javascript">
682
+				print '<script nonce="'.getNonce().'" type="text/javascript">
683 683
 				jQuery(document).ready(function() {
684
-					$("#search_' . $htmlname . '").change(function() {
685
-						var obj = ' . json_encode($events) . ';
684
+					$("#search_' . $htmlname.'").change(function() {
685
+						var obj = ' . json_encode($events).';
686 686
 						$.each(obj, function(key,values) {
687 687
 							if (values.method.length) {
688
-								runJsCodeForEvent' . $htmlname . '(values);
688
+								runJsCodeForEvent' . $htmlname.'(values);
689 689
 							}
690 690
 						});
691 691
 
@@ -693,13 +693,13 @@  discard block
 block discarded – undo
693 693
 					});
694 694
 
695 695
 					// Function used to execute events when search_htmlname change
696
-					function runJsCodeForEvent' . $htmlname . '(obj) {
697
-						var id = $("#' . $htmlname . '").val();
696
+					function runJsCodeForEvent' . $htmlname.'(obj) {
697
+						var id = $("#' . $htmlname.'").val();
698 698
 						var method = obj.method;
699 699
 						var url = obj.url;
700 700
 						var htmlname = obj.htmlname;
701 701
 						var showempty = obj.showempty;
702
-						console.log("Run runJsCodeForEvent-' . $htmlname . ' from selectCompaniesForNewContact id="+id+" method="+method+" showempty="+showempty+" url="+url+" htmlname="+htmlname);
702
+						console.log("Run runJsCodeForEvent-' . $htmlname.' from selectCompaniesForNewContact id="+id+" method="+method+" showempty="+showempty+" url="+url+" htmlname="+htmlname);
703 703
 						$.getJSON(url,
704 704
 							{
705 705
 								action: method,
@@ -729,9 +729,9 @@  discard block
 block discarded – undo
729 729
 				</script>';
730 730
 			}
731 731
 
732
-			print "\n" . '<!-- Input text for third party with Ajax.Autocompleter (selectCompaniesForNewContact) -->' . "\n";
733
-			print '<input type="text" size="30" id="search_' . $htmlname . '" name="search_' . $htmlname . '" value="' . $name . '" />';
734
-			print ajax_autocompleter((string) ($socid ? $socid : -1), $htmlname, DOL_URL_ROOT . '/societe/ajax/ajaxcompanies.php', '', $minLength, 0);
732
+			print "\n".'<!-- Input text for third party with Ajax.Autocompleter (selectCompaniesForNewContact) -->'."\n";
733
+			print '<input type="text" size="30" id="search_'.$htmlname.'" name="search_'.$htmlname.'" value="'.$name.'" />';
734
+			print ajax_autocompleter((string) ($socid ? $socid : -1), $htmlname, DOL_URL_ROOT.'/societe/ajax/ajaxcompanies.php', '', $minLength, 0);
735 735
 			return $socid;
736 736
 		} else {
737 737
 			// Search to list thirdparties
@@ -743,18 +743,18 @@  discard block
 block discarded – undo
743 743
 				$sql .= ", s.address, s.zip, s.town";
744 744
 				$sql .= ", dictp.code as country_code";
745 745
 			}
746
-			$sql .= " FROM " . $this->db->prefix() . "societe as s";
746
+			$sql .= " FROM ".$this->db->prefix()."societe as s";
747 747
 			if (getDolGlobalString('COMPANY_SHOW_ADDRESS_SELECTLIST')) {
748
-				$sql .= " LEFT JOIN " . $this->db->prefix() . "c_country as dictp ON dictp.rowid = s.fk_pays";
748
+				$sql .= " LEFT JOIN ".$this->db->prefix()."c_country as dictp ON dictp.rowid = s.fk_pays";
749 749
 			}
750
-			$sql .= " WHERE s.entity IN (" . getEntity('societe') . ")";
750
+			$sql .= " WHERE s.entity IN (".getEntity('societe').")";
751 751
 			// For ajax search we limit here. For combo list, we limit later
752 752
 			if (is_array($limitto) && count($limitto)) {
753
-				$sql .= " AND s.rowid IN (" . $this->db->sanitize(implode(',', $limitto)) . ")";
753
+				$sql .= " AND s.rowid IN (".$this->db->sanitize(implode(',', $limitto)).")";
754 754
 			}
755 755
 			// filter user access
756 756
 			if (!$user->hasRight('societe', 'client', 'voir') && !$user->socid) {
757
-				$sql .= " AND EXISTS (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX."societe_commerciaux as sc WHERE sc.fk_soc = s.rowid AND sc.fk_user = ".(int) $user->id .")";
757
+				$sql .= " AND EXISTS (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX."societe_commerciaux as sc WHERE sc.fk_soc = s.rowid AND sc.fk_user = ".(int) $user->id.")";
758 758
 			}
759 759
 			if ($user->socid > 0) {
760 760
 				$sql .= " AND s.rowid = ".((int) $user->socid);
@@ -767,17 +767,17 @@  discard block
 block discarded – undo
767 767
 
768 768
 			$resql = $this->db->query($sql);
769 769
 			if ($resql) {
770
-				print '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlname . '" name="' . $htmlname . '"';
770
+				print '<select class="flat'.($morecss ? ' '.$morecss : '').'" id="'.$htmlname.'" name="'.$htmlname.'"';
771 771
 				if ($conf->use_javascript_ajax) {
772
-					$javaScript = "window.location='" . dol_escape_js($_SERVER['PHP_SELF']) . "?" . $var_id . "=" . ($forceid > 0 ? $forceid : $object->id) . $moreparam . "&" . $htmlname . "=' + form." . $htmlname . ".options[form." . $htmlname . ".selectedIndex].value;";
773
-					print ' onChange="' . $javaScript . '"';
772
+					$javaScript = "window.location='".dol_escape_js($_SERVER['PHP_SELF'])."?".$var_id."=".($forceid > 0 ? $forceid : $object->id).$moreparam."&".$htmlname."=' + form.".$htmlname.".options[form.".$htmlname.".selectedIndex].value;";
773
+					print ' onChange="'.$javaScript.'"';
774 774
 				}
775 775
 				print '>';
776 776
 				print '<option value="-1">&nbsp;</option>';
777 777
 
778 778
 				$num = $this->db->num_rows($resql);
779 779
 				$i = 0;
780
-				$firstCompany = 0;  // For static analysis
780
+				$firstCompany = 0; // For static analysis
781 781
 				if ($num) {
782 782
 					while ($i < $num) {
783 783
 						$obj = $this->db->fetch_object($resql);
@@ -789,18 +789,18 @@  discard block
 block discarded – undo
789 789
 							$disabled = 1;
790 790
 						}
791 791
 						if ($selected > 0 && $selected == $obj->rowid) {
792
-							print '<option value="' . $obj->rowid . '"';
792
+							print '<option value="'.$obj->rowid.'"';
793 793
 							if ($disabled) {
794 794
 								print ' disabled';
795 795
 							}
796
-							print ' selected>' . dol_escape_htmltag($obj->name, 0, 0, '', 0, 1) . '</option>';
796
+							print ' selected>'.dol_escape_htmltag($obj->name, 0, 0, '', 0, 1).'</option>';
797 797
 							$firstCompany = $obj->rowid;
798 798
 						} else {
799
-							print '<option value="' . $obj->rowid . '"';
799
+							print '<option value="'.$obj->rowid.'"';
800 800
 							if ($disabled) {
801 801
 								print ' disabled';
802 802
 							}
803
-							print '>' . dol_escape_htmltag($obj->name, 0, 0, '', 0, 1) . '</option>';
803
+							print '>'.dol_escape_htmltag($obj->name, 0, 0, '', 0, 1).'</option>';
804 804
 						}
805 805
 						$i++;
806 806
 					}
@@ -835,10 +835,10 @@  discard block
 block discarded – undo
835 835
 
836 836
 		$out = '';
837 837
 		if (is_object($object) && method_exists($object, 'liste_type_contact')) {
838
-			'@phan-var-force CommonObject $object';  // CommonObject has the method.
839
-			$lesTypes = $object->liste_type_contact($source, $sortorder, 2, 1);	// List of types into c_type_contact for element=$object->element
838
+			'@phan-var-force CommonObject $object'; // CommonObject has the method.
839
+			$lesTypes = $object->liste_type_contact($source, $sortorder, 2, 1); // List of types into c_type_contact for element=$object->element
840 840
 
841
-			$out .= '<select class="flat valignmiddle' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">';
841
+			$out .= '<select class="flat valignmiddle'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
842 842
 			if ($showempty) {
843 843
 				$out .= '<option value="0">&nbsp;</option>';
844 844
 			}
@@ -881,9 +881,9 @@  discard block
 block discarded – undo
881 881
 		if ($rendermode === 'view') {
882 882
 			$toprint = array();
883 883
 			foreach ($contact->roles as $key => $val) {
884
-				$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb;">' . $val['label'] . '</li>';
884
+				$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb;">'.$val['label'].'</li>';
885 885
 			}
886
-			return '<div class="select2-container-multi-dolibarr" style="width: 90%;" id="' . $htmlname . '"><ul class="select2-choices-dolibarr">' . implode(' ', $toprint) . '</ul></div>';
886
+			return '<div class="select2-container-multi-dolibarr" style="width: 90%;" id="'.$htmlname.'"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>';
887 887
 		}
888 888
 
889 889
 		if ($rendermode === 'edit') {	// A multiselect combo list
@@ -929,14 +929,14 @@  discard block
 block discarded – undo
929 929
 
930 930
 		$size = '';
931 931
 		if (!empty($fieldsize)) {
932
-			$size = 'size="' . $fieldsize . '"';
932
+			$size = 'size="'.$fieldsize.'"';
933 933
 		}
934 934
 
935 935
 		if ($conf->use_javascript_ajax && empty($disableautocomplete)) {
936
-			$out .= ajax_multiautocompleter($htmlname, $fields, DOL_URL_ROOT . '/core/ajax/ziptown.php') . "\n";
936
+			$out .= ajax_multiautocompleter($htmlname, $fields, DOL_URL_ROOT.'/core/ajax/ziptown.php')."\n";
937 937
 			$moreattrib .= ' autocomplete="off"';
938 938
 		}
939
-		$out .= '<input id="' . $htmlname . '" class="maxwidthonsmartphone' . ($morecss ? ' ' . $morecss : '') . '" type="text"' . ($moreattrib ? ' ' . $moreattrib : '') . ' name="' . $htmlname . '" ' . $size . ' value="' . $selected . '">' . "\n";
939
+		$out .= '<input id="'.$htmlname.'" class="maxwidthonsmartphone'.($morecss ? ' '.$morecss : '').'" type="text"'.($moreattrib ? ' '.$moreattrib : '').' name="'.$htmlname.'" '.$size.' value="'.$selected.'">'."\n";
940 940
 
941 941
 		return $out;
942 942
 	}
@@ -1013,7 +1013,7 @@  discard block
 block discarded – undo
1013 1013
 		$parameters = array('formlength' => $formlength, 'selected' => $preselected, 'idprof' => $idprof, 'htmlname' => $htmlname, 'country_code' => $country_code);
1014 1014
 		$reshook = $hookmanager->executeHooks('getInputIdProf', $parameters);
1015 1015
 		if (empty($reshook)) {
1016
-			$out .= '<input type="text" ' . ($morecss ? 'class="' . $morecss . '" ' : '') . 'name="' . $htmlname . '" id="' . $htmlname . '" maxlength="' . $maxlength . '" value="' . $selected . '">';
1016
+			$out .= '<input type="text" '.($morecss ? 'class="'.$morecss.'" ' : '').'name="'.$htmlname.'" id="'.$htmlname.'" maxlength="'.$maxlength.'" value="'.$selected.'">';
1017 1017
 		}
1018 1018
 		$out .= $hookmanager->resPrint;
1019 1019
 
@@ -1044,9 +1044,9 @@  discard block
 block discarded – undo
1044 1044
 				$i = 0;
1045 1045
 				while ($i < $nbvalues) {
1046 1046
 					if ($selected == $valors[$i]) {
1047
-						print '<option value="' . $valors[$i] . '" selected>';
1047
+						print '<option value="'.$valors[$i].'" selected>';
1048 1048
 					} else {
1049
-						print '<option value="' . $valors[$i] . '">';
1049
+						print '<option value="'.$valors[$i].'">';
1050 1050
 					}
1051 1051
 					print $valors[$i];
1052 1052
 					print '</option>';
@@ -1075,7 +1075,7 @@  discard block
 block discarded – undo
1075 1075
 			return '';
1076 1076
 		}
1077 1077
 
1078
-		$out = '<select class="flat ' . $morecss . '" name="' . $htmlname . '" id="' . $htmlidname . '">';
1078
+		$out = '<select class="flat '.$morecss.'" name="'.$htmlname.'" id="'.$htmlidname.'">';
1079 1079
 		if ($typeinput == 'form') {
1080 1080
 			if ($allowempty || ($selected == '' || $selected == '-1')) {
1081 1081
 				$out .= '<option value="-1">';
@@ -1087,33 +1087,33 @@  discard block
 block discarded – undo
1087 1087
 				$out .= '</option>';
1088 1088
 			}
1089 1089
 			if (!getDolGlobalString('SOCIETE_DISABLE_PROSPECTS')) {
1090
-				$out .= '<option value="2"' . ($selected == 2 ? ' selected' : '') . '>' . $langs->trans('Prospect') . '</option>';
1090
+				$out .= '<option value="2"'.($selected == 2 ? ' selected' : '').'>'.$langs->trans('Prospect').'</option>';
1091 1091
 			}
1092 1092
 			if (!getDolGlobalString('SOCIETE_DISABLE_PROSPECTS') && !getDolGlobalString('SOCIETE_DISABLE_CUSTOMERS') && !getDolGlobalString('SOCIETE_DISABLE_PROSPECTSCUSTOMERS')) {
1093
-				$out .= '<option value="3"' . ($selected == 3 ? ' selected' : '') . '>' . $langs->trans('ProspectCustomer') . '</option>';
1093
+				$out .= '<option value="3"'.($selected == 3 ? ' selected' : '').'>'.$langs->trans('ProspectCustomer').'</option>';
1094 1094
 			}
1095 1095
 			if (!getDolGlobalString('SOCIETE_DISABLE_CUSTOMERS')) {
1096
-				$out .= '<option value="1"' . ($selected == 1 ? ' selected' : '') . '>' . $langs->trans('Customer') . '</option>';
1096
+				$out .= '<option value="1"'.($selected == 1 ? ' selected' : '').'>'.$langs->trans('Customer').'</option>';
1097 1097
 			}
1098
-			$out .= '<option value="0"' . ((string) $selected == '0' ? ' selected' : '') . '>' . $langs->trans('NorProspectNorCustomer') . '</option>';
1098
+			$out .= '<option value="0"'.((string) $selected == '0' ? ' selected' : '').'>'.$langs->trans('NorProspectNorCustomer').'</option>';
1099 1099
 		} elseif ($typeinput == 'list') {
1100
-			$out .= '<option value="-1"' . (($selected == '' || $selected == '-1') ? ' selected' : '') . '>&nbsp;</option>';
1100
+			$out .= '<option value="-1"'.(($selected == '' || $selected == '-1') ? ' selected' : '').'>&nbsp;</option>';
1101 1101
 			if (!getDolGlobalString('SOCIETE_DISABLE_PROSPECTS')) {
1102
-				$out .= '<option value="2,3"' . ($selected == '2,3' ? ' selected' : '') . '>' . $langs->trans('Prospect') . '</option>';
1102
+				$out .= '<option value="2,3"'.($selected == '2,3' ? ' selected' : '').'>'.$langs->trans('Prospect').'</option>';
1103 1103
 			}
1104 1104
 			if (!getDolGlobalString('SOCIETE_DISABLE_CUSTOMERS')) {
1105
-				$out .= '<option value="1,3"' . ($selected == '1,3' ? ' selected' : '') . '>' . $langs->trans('Customer') . '</option>';
1105
+				$out .= '<option value="1,3"'.($selected == '1,3' ? ' selected' : '').'>'.$langs->trans('Customer').'</option>';
1106 1106
 			}
1107 1107
 			if (isModEnabled("fournisseur")) {
1108
-				$out .= '<option value="4"' . ($selected == '4' ? ' selected' : '') . '>' . $langs->trans('Supplier') . '</option>';
1108
+				$out .= '<option value="4"'.($selected == '4' ? ' selected' : '').'>'.$langs->trans('Supplier').'</option>';
1109 1109
 			}
1110
-			$out .= '<option value="0"' . ($selected == '0' ? ' selected' : '') . '>' . $langs->trans('Other') . '</option>';
1110
+			$out .= '<option value="0"'.($selected == '0' ? ' selected' : '').'>'.$langs->trans('Other').'</option>';
1111 1111
 		} elseif ($typeinput == 'admin') {
1112 1112
 			if (!getDolGlobalString('SOCIETE_DISABLE_PROSPECTS') && !getDolGlobalString('SOCIETE_DISABLE_CUSTOMERS') && !getDolGlobalString('SOCIETE_DISABLE_PROSPECTSCUSTOMERS')) {
1113
-				$out .= '<option value="3"' . ($selected == 3 ? ' selected' : '') . '>' . $langs->trans('ProspectCustomer') . '</option>';
1113
+				$out .= '<option value="3"'.($selected == 3 ? ' selected' : '').'>'.$langs->trans('ProspectCustomer').'</option>';
1114 1114
 			}
1115 1115
 			if (!getDolGlobalString('SOCIETE_DISABLE_CUSTOMERS')) {
1116
-				$out .= '<option value="1"' . ($selected == 1 ? ' selected' : '') . '>' . $langs->trans('Customer') . '</option>';
1116
+				$out .= '<option value="1"'.($selected == 1 ? ' selected' : '').'>'.$langs->trans('Customer').'</option>';
1117 1117
 			}
1118 1118
 		}
1119 1119
 		$out .= '</select>';
@@ -1140,12 +1140,12 @@  discard block
 block discarded – undo
1140 1140
 
1141 1141
 		$out = '';
1142 1142
 		if ($htmlname != "none") {
1143
-			$out .= '<form method="post" action="' . $page . '">';
1143
+			$out .= '<form method="post" action="'.$page.'">';
1144 1144
 			$out .= '<input type="hidden" name="action" value="set_thirdpartytype">';
1145
-			$out .= '<input type="hidden" name="token" value="' . newToken() . '">';
1145
+			$out .= '<input type="hidden" name="token" value="'.newToken().'">';
1146 1146
 			$sortparam = getDolGlobalString('SOCIETE_SORT_ON_TYPEENT', 'ASC'); // NONE means we keep sort of original array, so we sort on position. ASC, means next function will sort on label.
1147 1147
 			$out .= $this->selectarray($htmlname, $this->typent_array(0, $filter), $selected, 1, 0, 0, '', 0, 0, 0, $sortparam, '', 1);
1148
-			$out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">';
1148
+			$out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
1149 1149
 			$out .= '</form>';
1150 1150
 		} else {
1151 1151
 			if ($selected > 0) {
@@ -1184,7 +1184,7 @@  discard block
 block discarded – undo
1184 1184
 
1185 1185
 			//print $prospectstatic->LibProspCommStatut($statusprospect, 2, $prospectstatic->cacheprospectstatus[$statusprospect]['label'], $prospectstatic->cacheprospectstatus[$statusprospect]['picto']);
1186 1186
 			print img_action('', $actioncode, $actionpicto, 'class="inline-block valignmiddle paddingright pictoprospectstatus"');
1187
-			print '<select class="flat selectprospectstatus maxwidth150" id="'. $htmlname.$idprospect .'" data-socid="'.$idprospect.'" name="' . $htmlname .'"';
1187
+			print '<select class="flat selectprospectstatus maxwidth150" id="'.$htmlname.$idprospect.'" data-socid="'.$idprospect.'" name="'.$htmlname.'"';
1188 1188
 			if (!$user->hasRight('societe', 'creer')) {
1189 1189
 				print ' disabled';
1190 1190
 			}
@@ -1214,8 +1214,8 @@  discard block
 block discarded – undo
1214 1214
 						var image = $(this).prev(".pictoprospectstatus");
1215 1215
 						$.ajax({
1216 1216
 							type: "POST",
1217
-							url: \'' . DOL_URL_ROOT . '/core/ajax/ajaxstatusprospect.php\',
1218
-							data: { id: statusid, prospectid: prospectid, token: \''. newToken() .'\', action: \'updatestatusprospect\' },
1217
+							url: \'' . DOL_URL_ROOT.'/core/ajax/ajaxstatusprospect.php\',
1218
+							data: { id: statusid, prospectid: prospectid, token: \''. newToken().'\', action: \'updatestatusprospect\' },
1219 1219
 							success: function(response) {
1220 1220
 								console.log(response.img);
1221 1221
 								image.replaceWith(response.img);
Please login to merge, or discard this patch.
htdocs/accountancy/bookkeeping/card.php 1 patch
Spacing   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
 
64 64
 $id = GETPOSTINT('id'); // id of record
65 65
 $mode = GETPOST('mode', 'aZ09'); // '' or '_tmp'
66
-$piece_num = GETPOSTINT("piece_num") ? GETPOSTINT("piece_num") : GETPOST('ref'); 	// id of transaction (several lines share the same transaction id)
66
+$piece_num = GETPOSTINT("piece_num") ? GETPOSTINT("piece_num") : GETPOST('ref'); // id of transaction (several lines share the same transaction id)
67 67
 $clonedate = (int) GETPOSTINT('clonedate');
68 68
 
69 69
 $accountingaccount = new AccountingAccount($db);
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
 	$error = 0;
130 130
 
131 131
 	if ($cancel) {
132
-		header("Location: ". $backtopage . (!empty($type) ? '?type=sub' : ''));
132
+		header("Location: ".$backtopage.(!empty($type) ? '?type=sub' : ''));
133 133
 		exit;
134 134
 	}
135 135
 
@@ -201,14 +201,14 @@  discard block
 block discarded – undo
201 201
 		$subledger_account_str = is_array($subledger_account) ? reset($subledger_account) : (string) $subledger_account;
202 202
 		if (!checkGeneralAccountAllowsAuxiliary($db, $accountingaccount_number, $subledger_account_str)) {
203 203
 			$error++;
204
-			setEventMessages($langs->trans("ErrorAccountNotCentralized"). ". " . $langs->trans("RemoveSubsidiaryAccountOrAdjustTheGeneralAccount"), null, 'errors');
204
+			setEventMessages($langs->trans("ErrorAccountNotCentralized").". ".$langs->trans("RemoveSubsidiaryAccountOrAdjustTheGeneralAccount"), null, 'errors');
205 205
 		}
206 206
 
207 207
 		if (!$error) {
208 208
 			if (GETPOSTINT('doc_datemonth') && GETPOSTINT('doc_dateday') && GETPOSTINT('doc_dateyear')) {
209 209
 				$datedoc = dol_mktime(0, 0, 0, GETPOSTINT('doc_datemonth'), GETPOSTINT('doc_dateday'), GETPOSTINT('doc_dateyear'));
210 210
 			} else {
211
-				$datedoc = (int) GETPOSTINT('doc_date');	// TODO Use instead the mode day-month-year
211
+				$datedoc = (int) GETPOSTINT('doc_date'); // TODO Use instead the mode day-month-year
212 212
 			}
213 213
 
214 214
 			$object = new BookKeeping($db);
@@ -382,7 +382,7 @@  discard block
 block discarded – undo
382 382
 		if ($result < 0) {
383 383
 			setEventMessages($object->error, $object->errors, 'errors');
384 384
 		} else {
385
-			header("Location: " . $backtopage . "?sortfield=t.piece_num&sortorder=asc" . ($type ? '&type='.$type : ''));
385
+			header("Location: ".$backtopage."?sortfield=t.piece_num&sortorder=asc".($type ? '&type='.$type : ''));
386 386
 			exit;
387 387
 		}
388 388
 	}
@@ -467,7 +467,7 @@  discard block
 block discarded – undo
467 467
 
468 468
 		if (!$error) {
469 469
 			$db->commit();
470
-			header("Location: " . $_SERVER['PHP_SELF'] . "?piece_num=" . ($object->getNextNumMvt() - 1));
470
+			header("Location: ".$_SERVER['PHP_SELF']."?piece_num=".($object->getNextNumMvt() - 1));
471 471
 			exit();
472 472
 		} else {
473 473
 			$db->rollback();
@@ -497,7 +497,7 @@  discard block
 block discarded – undo
497 497
 
498 498
 // Update fields properties in realtime
499 499
 if (!empty($conf->use_javascript_ajax)) {
500
-	print "\n" . '<script type="text/javascript">';
500
+	print "\n".'<script type="text/javascript">';
501 501
 	print '$(document).ready(function () {
502 502
 			function toggleSubledger() {
503 503
 				var isCentral = $("#accountingaccount_number option:selected").data("centralized");
@@ -514,8 +514,8 @@  discard block
 block discarded – undo
514 514
 			$("#accountingaccount_number").on("change", toggleSubledger);
515 515
 			$("#accountingaccount_number").on("select2:select", toggleSubledger);
516 516
 		';
517
-	print '	});' . "\n";
518
-	print '	</script>' . "\n";
517
+	print '	});'."\n";
518
+	print '	</script>'."\n";
519 519
 }
520 520
 
521 521
 if ($action == 'create') {
@@ -611,7 +611,7 @@  discard block
 block discarded – undo
611 611
 		//$object->label = $object->doc_ref;
612 612
 		if ($mode == '_tmp') {
613 613
 			$object->context['mode'] = $mode;
614
-			$object->next_prev_filter = '1=0';	// Add a test always false to disable navigation into the dol_banner_tab. In tmp mode, we just want to create/edit lines of bank transaction.
614
+			$object->next_prev_filter = '1=0'; // Add a test always false to disable navigation into the dol_banner_tab. In tmp mode, we just want to create/edit lines of bank transaction.
615 615
 		}
616 616
 		$object->label = $object->ref;
617 617
 
@@ -635,7 +635,7 @@  discard block
 block discarded – undo
635 635
 				array(
636 636
 					'type' => 'other',
637 637
 					'name' => 'clonedate',
638
-					'label' => '<span class="fieldrequired">' . $langs->trans("Docdate") . '</span>',
638
+					'label' => '<span class="fieldrequired">'.$langs->trans("Docdate").'</span>',
639 639
 					'value' => $input1
640 640
 				)
641 641
 			);
@@ -646,7 +646,7 @@  discard block
 block discarded – undo
646 646
 				$formquestion[] = array(
647 647
 					'type' => 'text',
648 648
 					'name' => 'code_journal',
649
-					'label' => '<span class="fieldrequired">' . $langs->trans("Codejournal") . '</span>',
649
+					'label' => '<span class="fieldrequired">'.$langs->trans("Codejournal").'</span>',
650 650
 					'value' => $input2
651 651
 				);
652 652
 			}
@@ -838,7 +838,7 @@  discard block
 block discarded – undo
838 838
 		// Due date (if invoice)
839 839
 		//if (in_array($object->doc_type, array('customer_invoice', 'supplier_invoice'))) {
840 840
 		print '<tr>';
841
-		print '<td class="titlefield">' . $form->textwithpicto($langs->trans('DateDue'), $langs->trans("IfTransactionHasDueDate")) . '</td>';
841
+		print '<td class="titlefield">'.$form->textwithpicto($langs->trans('DateDue'), $langs->trans("IfTransactionHasDueDate")).'</td>';
842 842
 		print '<td>';
843 843
 		print $object->date_lim_reglement ? dol_print_date($object->date_lim_reglement, 'day') : '&nbsp;';
844 844
 		print '</td>';
@@ -849,7 +849,7 @@  discard block
 block discarded – undo
849 849
 		if ($mode != "_tmp") {
850 850
 			// Date document export
851 851
 			print '<tr>';
852
-			print '<td class="titlefield">' . $langs->trans("DateExport") . '</td>';
852
+			print '<td class="titlefield">'.$langs->trans("DateExport").'</td>';
853 853
 			print '<td>';
854 854
 			print $object->date_export ? img_picto($langs->trans("TransactionExportDesc"), 'fa-file-export', 'class="pictofixedwidth opacitymedium"').dol_print_date($object->date_export, 'dayhour') : '&nbsp;';
855 855
 			print '</td>';
@@ -857,7 +857,7 @@  discard block
 block discarded – undo
857 857
 
858 858
 			// Date document validation
859 859
 			print '<tr>';
860
-			print '<td class="titlefield">' . $langs->trans("DateValidation") . '</td>';
860
+			print '<td class="titlefield">'.$langs->trans("DateValidation").'</td>';
861 861
 			print '<td>';
862 862
 			print $object->date_validation ? img_picto($langs->trans("TransactionBlockedLockedDesc"), 'fa-lock', 'class="pictofixedwidth opacitymedium"').dol_print_date($object->date_validation, 'dayhour') : '&nbsp;';
863 863
 			print '</td>';
@@ -866,7 +866,7 @@  discard block
 block discarded – undo
866 866
 			// Id_import
867 867
 			if (!empty($object->import_key)) {
868 868
 				print '<tr>';
869
-				print '<td class="titlefield">' . $langs->trans("ImportId") . '</td>';
869
+				print '<td class="titlefield">'.$langs->trans("ImportId").'</td>';
870 870
 				print '<td>';
871 871
 				print $object->import_key;
872 872
 				print '</td>';
@@ -925,7 +925,7 @@  discard block
 block discarded – undo
925 925
 		print dol_get_fiche_end();
926 926
 
927 927
 
928
-		$result = $object->fetchAllPerMvt($piece_num, $mode);	// This load $object->linesmvt
928
+		$result = $object->fetchAllPerMvt($piece_num, $mode); // This load $object->linesmvt
929 929
 
930 930
 		if ($result < 0) {
931 931
 			setEventMessages($object->error, $object->errors, 'errors');
@@ -956,7 +956,7 @@  discard block
 block discarded – undo
956 956
 						}
957 957
 					}
958 958
 					if ($permissiontoadd) {
959
-						print dolGetButtonAction('', $langs->trans('Clone'), 'clone', DOL_URL_ROOT.'/accountancy/bookkeeping/card.php?action=clonebookkeepingwriting&token=' . newToken() . '&piece_num=' . ((int) $object->piece_num) . '&toselect=' . implode(',', $tmptoselect), 'action-clone', $permissiontoadd);
959
+						print dolGetButtonAction('', $langs->trans('Clone'), 'clone', DOL_URL_ROOT.'/accountancy/bookkeeping/card.php?action=clonebookkeepingwriting&token='.newToken().'&piece_num='.((int) $object->piece_num).'&toselect='.implode(',', $tmptoselect), 'action-clone', $permissiontoadd);
960 960
 					}
961 961
 				}
962 962
 
@@ -967,21 +967,21 @@  discard block
 block discarded – undo
967 967
 			print load_fiche_titre($langs->trans("ListeMvts"), '', '');
968 968
 
969 969
 			if (empty($object->date_validation)) {
970
-				print '<form action="' . $_SERVER["PHP_SELF"] . '?piece_num=' . ((int) $object->piece_num) . '" method="POST">';
970
+				print '<form action="'.$_SERVER["PHP_SELF"].'?piece_num='.((int) $object->piece_num).'" method="POST">';
971 971
 				if ($optioncss != '') {
972
-					print '<input type="hidden" name="optioncss" value="' . $optioncss . '">';
972
+					print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
973 973
 				}
974
-				print '<input type="hidden" name="token" value="' . newToken() . '">';
975
-				print '<input type="hidden" name="doc_date" value="' . $object->doc_date . '">' . "\n";
976
-				print '<input type="hidden" name="doc_type" value="' . $object->doc_type . '">' . "\n";
977
-				print '<input type="hidden" name="doc_ref" value="' . $object->doc_ref . '">' . "\n";
978
-				print '<input type="hidden" name="ref" value="' . $object->ref . '">' . "\n";
979
-				print '<input type="hidden" name="code_journal" value="' . $object->code_journal . '">' . "\n";
980
-				print '<input type="hidden" name="fk_doc" value="' . $object->fk_doc . '">' . "\n";
981
-				print '<input type="hidden" name="fk_docdet" value="' . $object->fk_docdet . '">' . "\n";
982
-				print '<input type="hidden" name="mode" value="' . $mode . '">' . "\n";
983
-				print '<input type="hidden" name="backtopage" value="' . $backtopage . '">';
984
-				print '<input type="hidden" name="type" value="' . $type . '">';
974
+				print '<input type="hidden" name="token" value="'.newToken().'">';
975
+				print '<input type="hidden" name="doc_date" value="'.$object->doc_date.'">'."\n";
976
+				print '<input type="hidden" name="doc_type" value="'.$object->doc_type.'">'."\n";
977
+				print '<input type="hidden" name="doc_ref" value="'.$object->doc_ref.'">'."\n";
978
+				print '<input type="hidden" name="ref" value="'.$object->ref.'">'."\n";
979
+				print '<input type="hidden" name="code_journal" value="'.$object->code_journal.'">'."\n";
980
+				print '<input type="hidden" name="fk_doc" value="'.$object->fk_doc.'">'."\n";
981
+				print '<input type="hidden" name="fk_docdet" value="'.$object->fk_docdet.'">'."\n";
982
+				print '<input type="hidden" name="mode" value="'.$mode.'">'."\n";
983
+				print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
984
+				print '<input type="hidden" name="type" value="'.$type.'">';
985 985
 			}
986 986
 
987 987
 			if (count($object->linesmvt) > 0) {
@@ -1061,14 +1061,14 @@  discard block
 block discarded – undo
1061 1061
 							if (getDolGlobalString('ACCOUNTANCY_COMBO_FOR_AUX')) {
1062 1062
 								print $formaccounting->select_auxaccount('', 'subledger_account', 1, 'maxwidth250', '', 'subledger_label');
1063 1063
 							} else {
1064
-								print '<input type="text" class="maxwidth150" name="subledger_account" value="" placeholder="' . dol_escape_htmltag($langs->trans("SubledgerAccount")) . '">';
1064
+								print '<input type="text" class="maxwidth150" name="subledger_account" value="" placeholder="'.dol_escape_htmltag($langs->trans("SubledgerAccount")).'">';
1065 1065
 							}
1066
-							print '<br><input type="text" class="maxwidth150" name="subledger_label" id="subledger_label" value="" placeholder="' . dol_escape_htmltag($langs->trans("SubledgerAccountLabel")) . '">';
1066
+							print '<br><input type="text" class="maxwidth150" name="subledger_label" id="subledger_label" value="" placeholder="'.dol_escape_htmltag($langs->trans("SubledgerAccountLabel")).'">';
1067 1067
 							print '</td>';
1068
-							print '<td><input type="text" class="minwidth200" name="label_operation" value="' . dol_escape_htmltag($label_operation) . '"/></td>';
1068
+							print '<td><input type="text" class="minwidth200" name="label_operation" value="'.dol_escape_htmltag($label_operation).'"/></td>';
1069 1069
 							print '<td class="right"><input type="text" class="right width50" name="debit" value=""/></td>';
1070 1070
 							print '<td class="right"><input type="text" class="right width50" name="credit" value=""/></td>';
1071
-							print '<td class="center"><input type="submit" class="button small" name="save" value="' . $langs->trans("Add") . '"></td>';
1071
+							print '<td class="center"><input type="submit" class="button small" name="save" value="'.$langs->trans("Add").'"></td>';
1072 1072
 							print "</tr>\n";
1073 1073
 						}
1074 1074
 					} else {
@@ -1094,7 +1094,7 @@  discard block
 block discarded – undo
1094 1094
 						print '<td class="center nowraponall">';
1095 1095
 						if ($permissiontoadd) {
1096 1096
 							if (empty($line->date_export) && empty($line->date_validation)) {
1097
-								print '<a class="editfielda reposition" href="' . $_SERVER["PHP_SELF"] . '?action=update&id=' . $line->id . '&piece_num=' . ((int) $line->piece_num) . '&mode=' . urlencode((string) $mode) . '&token=' . urlencode(newToken()) . '">';
1097
+								print '<a class="editfielda reposition" href="'.$_SERVER["PHP_SELF"].'?action=update&id='.$line->id.'&piece_num='.((int) $line->piece_num).'&mode='.urlencode((string) $mode).'&token='.urlencode(newToken()).'">';
1098 1098
 								print img_edit('', 0, 'class="marginrightonly"');
1099 1099
 								print '</a> &nbsp;';
1100 1100
 							} else {
@@ -1109,7 +1109,7 @@  discard block
 block discarded – undo
1109 1109
 									$actiontodelete = 'confirm_delete';
1110 1110
 								}
1111 1111
 
1112
-								print '<a href="' . $_SERVER["PHP_SELF"] . '?action=' . $actiontodelete . '&id=' . $line->id . '&piece_num=' . ((int) $line->piece_num) . '&mode=' . urlencode((string) $mode) . '&token=' . urlencode(newToken()) . '">';
1112
+								print '<a href="'.$_SERVER["PHP_SELF"].'?action='.$actiontodelete.'&id='.$line->id.'&piece_num='.((int) $line->piece_num).'&mode='.urlencode((string) $mode).'&token='.urlencode(newToken()).'">';
1113 1113
 								print img_delete();
1114 1114
 								print '</a>';
1115 1115
 							} else {
Please login to merge, or discard this patch.