Completed
Branch develop (ab5575)
by
unknown
18:12
created
htdocs/accountancy/class/bookkeeping.class.php 2 patches
Spacing   +89 added lines, -89 removed lines patch added patch discarded remove patch
@@ -368,7 +368,7 @@  discard block
 block discarded – undo
368 368
 				if (empty($this->piece_num)) {
369 369
 					$sqlnum = "SELECT MAX(piece_num)+1 as maxpiecenum";
370 370
 					$sqlnum .= " FROM ".MAIN_DB_PREFIX.$this->table_element;
371
-					$sqlnum .= " WHERE entity = " . ((int) $conf->entity); // Do not use getEntity for accounting features
371
+					$sqlnum .= " WHERE entity = ".((int) $conf->entity); // Do not use getEntity for accounting features
372 372
 
373 373
 					$resqlnum = $this->db->query($sqlnum);
374 374
 					if ($resqlnum) {
@@ -464,8 +464,8 @@  discard block
 block discarded – undo
464 464
 		}
465 465
 
466 466
 		// Call triggers
467
-		if (! $error && ! $notrigger) {
468
-			$result=$this->call_trigger('BOOKKEEPING_CREATE', $user);
467
+		if (!$error && !$notrigger) {
468
+			$result = $this->call_trigger('BOOKKEEPING_CREATE', $user);
469 469
 			if ($result < 0) $error++;
470 470
 		}
471 471
 
@@ -546,7 +546,7 @@  discard block
 block discarded – undo
546 546
 		//if ($withpicto != 2) $result.=(($addlabel && $this->label) ? $sep . dol_trunc($this->label, ($addlabel > 1 ? $addlabel : 0)) : '');
547 547
 
548 548
 		global $action;
549
-		$hookmanager->initHooks(array($this->element . 'dao'));
549
+		$hookmanager->initHooks(array($this->element.'dao'));
550 550
 		$parameters = array('id' => $this->id, 'getnomurl' => &$result);
551 551
 		$reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
552 552
 		if ($reshook > 0) {
@@ -713,8 +713,8 @@  discard block
 block discarded – undo
713 713
 		if (!$error) {
714 714
 			$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX.$this->table_element.$mode);
715 715
 			// Call triggers
716
-			if (! $notrigger) {
717
-				$result=$this->call_trigger('BOOKKEEPING_CREATE', $user);
716
+			if (!$notrigger) {
717
+				$result = $this->call_trigger('BOOKKEEPING_CREATE', $user);
718 718
 				if ($result < 0) $error++;
719 719
 			}
720 720
 		}
@@ -776,7 +776,7 @@  discard block
 block discarded – undo
776 776
 		$sql .= " t.date_validated as date_validation";
777 777
 		$sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.$mode.' as t';
778 778
 		$sql .= ' WHERE 1 = 1';
779
-		$sql .= " AND entity = " . ((int) $conf->entity); // Do not use getEntity for accounting features
779
+		$sql .= " AND entity = ".((int) $conf->entity); // Do not use getEntity for accounting features
780 780
 		if (null !== $ref) {
781 781
 			$sql .= " AND t.rowid = ".((int) $ref);
782 782
 		} else {
@@ -948,7 +948,7 @@  discard block
 block discarded – undo
948 948
 			}
949 949
 		}
950 950
 		$sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.' as t';
951
-		$sql .= ' WHERE entity = ' . ((int) $conf->entity); // Do not use getEntity for accounting features
951
+		$sql .= ' WHERE entity = '.((int) $conf->entity); // Do not use getEntity for accounting features
952 952
 		if (count($sqlwhere) > 0) {
953 953
 			$sql .= " AND ".implode(" ".$this->db->sanitize($filtermode)." ", $sqlwhere);
954 954
 		}
@@ -1083,7 +1083,7 @@  discard block
 block discarded – undo
1083 1083
 		$sql .= " t.date_validated as date_validation";
1084 1084
 		$sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.' as t';
1085 1085
 
1086
-		$sql .= ' WHERE t.entity = ' . ((int) $conf->entity); // Do not use getEntity for accounting features
1086
+		$sql .= ' WHERE t.entity = '.((int) $conf->entity); // Do not use getEntity for accounting features
1087 1087
 		if ($showAlreadyExportMovements == 0) {
1088 1088
 			$sql .= " AND t.date_export IS NULL";
1089 1089
 		}
@@ -1251,7 +1251,7 @@  discard block
 block discarded – undo
1251 1251
 		$sql .= " SUM(t.debit) as debit,";
1252 1252
 		$sql .= " SUM(t.credit) as credit";
1253 1253
 		$sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.' as t';
1254
-		$sql .= ' WHERE entity = ' . ((int) $conf->entity); // Do not use getEntity for accounting features
1254
+		$sql .= ' WHERE entity = '.((int) $conf->entity); // Do not use getEntity for accounting features
1255 1255
 
1256 1256
 		// Manage filter
1257 1257
 		if (is_array($filter)) {
@@ -1479,8 +1479,8 @@  discard block
 block discarded – undo
1479 1479
 		}
1480 1480
 
1481 1481
 		// Call triggers
1482
-		if (! $error && ! $notrigger) {
1483
-			$result=$this->call_trigger('BOOKKEEPING_MODIFY', $user);
1482
+		if (!$error && !$notrigger) {
1483
+			$result = $this->call_trigger('BOOKKEEPING_MODIFY', $user);
1484 1484
 			if ($result < 0) $error++;
1485 1485
 		}
1486 1486
 
@@ -1570,8 +1570,8 @@  discard block
 block discarded – undo
1570 1570
 		$this->db->begin();
1571 1571
 
1572 1572
 		// Call triggers
1573
-		if (! $error && ! $notrigger) {
1574
-			$result=$this->call_trigger('BOOKKEEPING_DELETE', $user);
1573
+		if (!$error && !$notrigger) {
1574
+			$result = $this->call_trigger('BOOKKEEPING_DELETE', $user);
1575 1575
 			if ($result < 0) $error++;
1576 1576
 		}
1577 1577
 
@@ -1671,7 +1671,7 @@  discard block
 block discarded – undo
1671 1671
 		if (!empty($journal)) {
1672 1672
 			$sql .= " AND code_journal = '".$this->db->escape($journal)."'";
1673 1673
 		}
1674
-		$sql .= " AND entity = " . ((int) $conf->entity); // Do not use getEntity for accounting features
1674
+		$sql .= " AND entity = ".((int) $conf->entity); // Do not use getEntity for accounting features
1675 1675
 		// Exclusion of validated entries at the time of deletion
1676 1676
 		$sql .= " AND date_validated IS NULL";
1677 1677
 		$sql .= $sql_filter;
@@ -1718,8 +1718,8 @@  discard block
 block discarded – undo
1718 1718
 		$sql = "DELETE";
1719 1719
 		$sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element.$mode;
1720 1720
 		$sql .= " WHERE piece_num = ".(int) $piecenum;
1721
-		$sql .= " AND date_validated IS NULL";		// For security, exclusion of validated entries at the time of deletion
1722
-		$sql .= " AND entity = " . ((int) $conf->entity); // Do not use getEntity for accounting features
1721
+		$sql .= " AND date_validated IS NULL"; // For security, exclusion of validated entries at the time of deletion
1722
+		$sql .= " AND entity = ".((int) $conf->entity); // Do not use getEntity for accounting features
1723 1723
 		$sql .= $sql_filter;
1724 1724
 
1725 1725
 		$resql = $this->db->query($sql);
@@ -1847,7 +1847,7 @@  discard block
 block discarded – undo
1847 1847
 		}
1848 1848
 		$sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element.$mode;
1849 1849
 		$sql .= " WHERE piece_num = ".((int) $piecenum);
1850
-		$sql .= " AND entity = " . ((int) $conf->entity); // Do not use getEntity for accounting features
1850
+		$sql .= " AND entity = ".((int) $conf->entity); // Do not use getEntity for accounting features
1851 1851
 
1852 1852
 		dol_syslog(__METHOD__, LOG_DEBUG);
1853 1853
 		$result = $this->db->query($sql);
@@ -1888,7 +1888,7 @@  discard block
 block discarded – undo
1888 1888
 		global $conf;
1889 1889
 
1890 1890
 		$sql = "SELECT MAX(piece_num)+1 as max FROM ".MAIN_DB_PREFIX.$this->table_element.$mode;
1891
-		$sql .= " WHERE entity = " . ((int) $conf->entity); // Do not use getEntity for accounting features
1891
+		$sql .= " WHERE entity = ".((int) $conf->entity); // Do not use getEntity for accounting features
1892 1892
 
1893 1893
 		dol_syslog(get_class($this)."::getNextNumMvt", LOG_DEBUG);
1894 1894
 
@@ -1932,7 +1932,7 @@  discard block
 block discarded – undo
1932 1932
 		}
1933 1933
 		$sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element.$mode;
1934 1934
 		$sql .= " WHERE piece_num = ".((int) $piecenum);
1935
-		$sql .= " AND entity = " . ((int) $conf->entity); // Do not use getEntity for accounting features
1935
+		$sql .= " AND entity = ".((int) $conf->entity); // Do not use getEntity for accounting features
1936 1936
 
1937 1937
 		dol_syslog(__METHOD__, LOG_DEBUG);
1938 1938
 		$result = $this->db->query($sql);
@@ -1997,7 +1997,7 @@  discard block
 block discarded – undo
1997 1997
 		$sql .= " montant as amount, sens, fk_user_author, import_key, code_journal, piece_num,";
1998 1998
 		$sql .= " date_validated as date_validation";
1999 1999
 		$sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element;
2000
-		$sql .= " WHERE entity = " . ((int) $conf->entity); // Do not use getEntity for accounting features
2000
+		$sql .= " WHERE entity = ".((int) $conf->entity); // Do not use getEntity for accounting features
2001 2001
 
2002 2002
 		dol_syslog(get_class($this)."::export_bookkeeping", LOG_DEBUG);
2003 2003
 
@@ -2075,7 +2075,7 @@  discard block
 block discarded – undo
2075 2075
 
2076 2076
 			if (!$error) {
2077 2077
 				// Delete if there is an empty line
2078
-				$sql = 'DELETE FROM '.MAIN_DB_PREFIX.$this->table_element.'_tmp WHERE piece_num = '.((int) $piece_num).' AND entity = ' .((int) $conf->entity)." AND numero_compte IS NULL AND debit = 0 AND credit = 0";
2078
+				$sql = 'DELETE FROM '.MAIN_DB_PREFIX.$this->table_element.'_tmp WHERE piece_num = '.((int) $piece_num).' AND entity = '.((int) $conf->entity)." AND numero_compte IS NULL AND debit = 0 AND credit = 0";
2079 2079
 				$resql = $this->db->query($sql);
2080 2080
 				if (!$resql) {
2081 2081
 					$error++;
@@ -2093,7 +2093,7 @@  discard block
 block discarded – undo
2093 2093
 				$sql .= ' doc_ref, fk_doc, fk_docdet, entity, thirdparty_code, subledger_account, subledger_label,';
2094 2094
 				$sql .= ' numero_compte, label_compte, label_operation, debit, credit,';
2095 2095
 				$sql .= ' montant, sens, fk_user_author, import_key, code_journal, journal_label, '.((int) $next_piecenum).", '".$this->db->idate($now)."'";
2096
-				$sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.'_tmp WHERE piece_num = '.((int) $piece_num).' AND numero_compte IS NOT NULL AND entity = ' .((int) $conf->entity);
2096
+				$sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.'_tmp WHERE piece_num = '.((int) $piece_num).' AND numero_compte IS NOT NULL AND entity = '.((int) $conf->entity);
2097 2097
 				$sql .= $sql_filter;
2098 2098
 				$resql = $this->db->query($sql);
2099 2099
 				if (!$resql) {
@@ -2104,7 +2104,7 @@  discard block
 block discarded – undo
2104 2104
 			}
2105 2105
 
2106 2106
 			if (!$error) {
2107
-				$sql = 'DELETE FROM '.MAIN_DB_PREFIX.$this->table_element.'_tmp WHERE piece_num = '.((int) $piece_num).' AND entity = ' .((int) $conf->entity);
2107
+				$sql = 'DELETE FROM '.MAIN_DB_PREFIX.$this->table_element.'_tmp WHERE piece_num = '.((int) $piece_num).' AND entity = '.((int) $conf->entity);
2108 2108
 				$resql = $this->db->query($sql);
2109 2109
 				if (!$resql) {
2110 2110
 					$error++;
@@ -2114,7 +2114,7 @@  discard block
 block discarded – undo
2114 2114
 			}
2115 2115
 		} elseif ($direction == 1) {
2116 2116
 			if (!$error) {
2117
-				$sql = 'DELETE FROM '.MAIN_DB_PREFIX.$this->table_element.'_tmp WHERE piece_num = '.((int) $piece_num).' AND entity = ' .((int) $conf->entity);
2117
+				$sql = 'DELETE FROM '.MAIN_DB_PREFIX.$this->table_element.'_tmp WHERE piece_num = '.((int) $piece_num).' AND entity = '.((int) $conf->entity);
2118 2118
 				$resql = $this->db->query($sql);
2119 2119
 				if (!$resql) {
2120 2120
 					$error++;
@@ -2132,7 +2132,7 @@  discard block
 block discarded – undo
2132 2132
 				$sql .= ' doc_ref, fk_doc, fk_docdet, thirdparty_code, subledger_account, subledger_label,';
2133 2133
 				$sql .= ' numero_compte, label_compte, label_operation, debit, credit,';
2134 2134
 				$sql .= ' montant, sens, fk_user_author, import_key, code_journal, journal_label, piece_num';
2135
-				$sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.' WHERE piece_num = '.((int) $piece_num).' AND entity = ' .((int) $conf->entity);
2135
+				$sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.' WHERE piece_num = '.((int) $piece_num).' AND entity = '.((int) $conf->entity);
2136 2136
 				$sql .= $sql_filter;
2137 2137
 				$resql = $this->db->query($sql);
2138 2138
 				if (!$resql) {
@@ -2143,7 +2143,7 @@  discard block
 block discarded – undo
2143 2143
 			}
2144 2144
 
2145 2145
 			if (!$error) {
2146
-				$sql = 'DELETE FROM '.MAIN_DB_PREFIX.$this->table_element.'_tmp WHERE piece_num = '.((int) $piece_num).' AND entity = ' .((int) $conf->entity);
2146
+				$sql = 'DELETE FROM '.MAIN_DB_PREFIX.$this->table_element.'_tmp WHERE piece_num = '.((int) $piece_num).' AND entity = '.((int) $conf->entity);
2147 2147
 				$sql .= $sql_filter;
2148 2148
 				$resql = $this->db->query($sql);
2149 2149
 				if (!$resql) {
@@ -2200,7 +2200,7 @@  discard block
 block discarded – undo
2200 2200
 		$sql .= " AND aa.active = 1";
2201 2201
 		$sql .= " INNER JOIN ".MAIN_DB_PREFIX."accounting_system as asy ON aa.fk_pcg_version = asy.pcg_version";
2202 2202
 		$sql .= " AND asy.rowid = ".((int) $pcgver);
2203
-		$sql .= " AND ab.entity = " . ((int) $conf->entity); // Do not use getEntity for accounting features
2203
+		$sql .= " AND ab.entity = ".((int) $conf->entity); // Do not use getEntity for accounting features
2204 2204
 		$sql .= " ORDER BY account_number ASC";
2205 2205
 
2206 2206
 		dol_syslog(get_class($this)."::select_account", LOG_DEBUG);
@@ -2264,7 +2264,7 @@  discard block
 block discarded – undo
2264 2264
 		$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as parent ON aa.account_parent = parent.rowid AND parent.active = 1";
2265 2265
 		$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as root ON parent.account_parent = root.rowid AND root.active = 1";
2266 2266
 		$sql .= " WHERE aa.account_number = '".$this->db->escape($account)."'";
2267
-		$sql .= " AND aa.entity = " . ((int) $conf->entity); // Do not use getEntity for accounting features
2267
+		$sql .= " AND aa.entity = ".((int) $conf->entity); // Do not use getEntity for accounting features
2268 2268
 
2269 2269
 		dol_syslog(get_class($this)."::select_account", LOG_DEBUG);
2270 2270
 		$resql = $this->db->query($sql);
@@ -2304,7 +2304,7 @@  discard block
 block discarded – undo
2304 2304
 		$sql .= " AND asy.rowid = ".((int) $pcgver);
2305 2305
 		$sql .= " AND aa.active = 1";
2306 2306
 		$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_accounting_category as cat ON aa.fk_accounting_category = cat.rowid";
2307
-		$sql .= " WHERE aa.entity = " . ((int) $conf->entity); // Do not use getEntity for accounting features
2307
+		$sql .= " WHERE aa.entity = ".((int) $conf->entity); // Do not use getEntity for accounting features
2308 2308
 
2309 2309
 		dol_syslog(get_class($this)."::select_account", LOG_DEBUG);
2310 2310
 		$resql = $this->db->query($sql);
@@ -2337,7 +2337,7 @@  discard block
 block discarded – undo
2337 2337
 		global $conf;
2338 2338
 
2339 2339
 		$alias = trim($alias);
2340
-		$alias = !empty($alias) && strpos($alias, '.') < 0 ? $alias . "." : $alias;
2340
+		$alias = !empty($alias) && strpos($alias, '.') < 0 ? $alias."." : $alias;
2341 2341
 
2342 2342
 		if (!isset(self::$can_modify_bookkeeping_sql_cached[$alias]) || $force) {
2343 2343
 			$result = $this->loadFiscalPeriods($force, 'active');
@@ -2350,10 +2350,10 @@  discard block
 block discarded – undo
2350 2350
 				$i = 0;
2351 2351
 				foreach ($conf->cache['active_fiscal_period_cached'] as $fiscal_period) {
2352 2352
 					$sql_list[$i] = "(";
2353
-					$sql_list[$i] .= "'".$this->db->idate($fiscal_period['date_start']) . "' <= ".$this->db->sanitize($alias)."doc_date";
2353
+					$sql_list[$i] .= "'".$this->db->idate($fiscal_period['date_start'])."' <= ".$this->db->sanitize($alias)."doc_date";
2354 2354
 					if (!empty($fiscal_period['date_end'])) {
2355 2355
 						$sql_list[$i] .= " AND ";
2356
-						$sql_list[$i] .= $this->db->sanitize($alias)."doc_date <= '" . $this->db->idate($fiscal_period['date_end'])."'";
2356
+						$sql_list[$i] .= $this->db->sanitize($alias)."doc_date <= '".$this->db->idate($fiscal_period['date_end'])."'";
2357 2357
 					}
2358 2358
 					$sql_list[$i] .= ")";
2359 2359
 					$i++;
@@ -2481,8 +2481,8 @@  discard block
 block discarded – undo
2481 2481
 		if ($mode == 'active') {
2482 2482
 			if (!isset($conf->cache['active_fiscal_period_cached']) || $force) {
2483 2483
 				$sql = "SELECT date_start, date_end";
2484
-				$sql .= " FROM " . $this->db->prefix() . "accounting_fiscalyear";
2485
-				$sql .= " WHERE entity = " . ((int) $conf->entity);
2484
+				$sql .= " FROM ".$this->db->prefix()."accounting_fiscalyear";
2485
+				$sql .= " WHERE entity = ".((int) $conf->entity);
2486 2486
 				$sql .= " AND statut = 0";
2487 2487
 
2488 2488
 				$resql = $this->db->query($sql);
@@ -2504,8 +2504,8 @@  discard block
 block discarded – undo
2504 2504
 		if ($mode == 'closed') {
2505 2505
 			if (!isset($conf->cache['closed_fiscal_period_cached']) || $force) {
2506 2506
 				$sql = "SELECT date_start, date_end";
2507
-				$sql .= " FROM " . $this->db->prefix() . "accounting_fiscalyear";
2508
-				$sql .= " WHERE entity = " . ((int) $conf->entity);
2507
+				$sql .= " FROM ".$this->db->prefix()."accounting_fiscalyear";
2508
+				$sql .= " WHERE entity = ".((int) $conf->entity);
2509 2509
 				$sql .= " AND statut = 1";
2510 2510
 
2511 2511
 				$resql = $this->db->query($sql);
@@ -2540,10 +2540,10 @@  discard block
 block discarded – undo
2540 2540
 		$list = array();
2541 2541
 
2542 2542
 		$sql = "SELECT rowid, label, date_start, date_end, statut";
2543
-		$sql .= " FROM " . $this->db->prefix() . "accounting_fiscalyear";
2544
-		$sql .= " WHERE entity = " . ((int) $conf->entity);
2543
+		$sql .= " FROM ".$this->db->prefix()."accounting_fiscalyear";
2544
+		$sql .= " WHERE entity = ".((int) $conf->entity);
2545 2545
 		if (!empty($filter)) {
2546
-			$sql .= " AND (" . $this->db->sanitize($filter, 1, 1, 1) . ')';
2546
+			$sql .= " AND (".$this->db->sanitize($filter, 1, 1, 1).')';
2547 2547
 		}
2548 2548
 		$sql .= $this->db->order('date_start', 'ASC');
2549 2549
 
@@ -2580,13 +2580,13 @@  discard block
 block discarded – undo
2580 2580
 
2581 2581
 		$sql = "SELECT YEAR(b.doc_date) as year";
2582 2582
 		for ($i = 1; $i <= 12; $i++) {
2583
-			$sql .= ", SUM(".$this->db->ifsql("MONTH(b.doc_date) = ".((int) $i), "1", "0") . ") AS month".((int) $i);
2583
+			$sql .= ", SUM(".$this->db->ifsql("MONTH(b.doc_date) = ".((int) $i), "1", "0").") AS month".((int) $i);
2584 2584
 		}
2585 2585
 		$sql .= ", COUNT(b.rowid) as total";
2586
-		$sql .= " FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping as b";
2587
-		$sql .= " WHERE b.doc_date >= '" . $this->db->idate($date_start) . "'";
2588
-		$sql .= " AND b.doc_date <= '" . $this->db->idate($date_end) . "'";
2589
-		$sql .= " AND b.entity IN (" . getEntity('bookkeeping', 0) . ")"; // We don't share object for accountancy
2586
+		$sql .= " FROM ".MAIN_DB_PREFIX."accounting_bookkeeping as b";
2587
+		$sql .= " WHERE b.doc_date >= '".$this->db->idate($date_start)."'";
2588
+		$sql .= " AND b.doc_date <= '".$this->db->idate($date_end)."'";
2589
+		$sql .= " AND b.entity IN (".getEntity('bookkeeping', 0).")"; // We don't share object for accountancy
2590 2590
 
2591 2591
 		// Get count for each month into the fiscal period
2592 2592
 		if (getDolGlobalString("ACCOUNTANCY_DISABLE_CLOSURE_LINE_BY_LINE")) {
@@ -2616,7 +2616,7 @@  discard block
 block discarded – undo
2616 2616
 				'total' => (int) $obj->total,
2617 2617
 			);
2618 2618
 			for ($i = 1; $i <= 12; $i++) {
2619
-				$year_list['count'][$i] = (int) $obj->{'month' . $i};
2619
+				$year_list['count'][$i] = (int) $obj->{'month'.$i};
2620 2620
 			}
2621 2621
 
2622 2622
 			$list[] = $year_list;
@@ -2644,11 +2644,11 @@  discard block
 block discarded – undo
2644 2644
 		$now = dol_now();
2645 2645
 
2646 2646
 		// Specify as export : update field date_validated on selected month/year
2647
-		$sql = " UPDATE " . MAIN_DB_PREFIX . "accounting_bookkeeping";
2648
-		$sql .= " SET date_validated = '" . $this->db->idate($now) . "'";
2649
-		$sql .= " WHERE entity = " . ((int) $conf->entity);
2650
-		$sql .= " AND DATE(doc_date) >= '" . $this->db->idate($date_start) . "'";
2651
-		$sql .= " AND DATE(doc_date) <= '" . $this->db->idate($date_end) . "'";
2647
+		$sql = " UPDATE ".MAIN_DB_PREFIX."accounting_bookkeeping";
2648
+		$sql .= " SET date_validated = '".$this->db->idate($now)."'";
2649
+		$sql .= " WHERE entity = ".((int) $conf->entity);
2650
+		$sql .= " AND DATE(doc_date) >= '".$this->db->idate($date_start)."'";
2651
+		$sql .= " AND DATE(doc_date) <= '".$this->db->idate($date_end)."'";
2652 2652
 		$sql .= " AND date_validated IS NULL";
2653 2653
 
2654 2654
 		dol_syslog(__METHOD__, LOG_DEBUG);
@@ -2681,27 +2681,27 @@  discard block
 block discarded – undo
2681 2681
 
2682 2682
 			$pcg_type_filter = array();
2683 2683
 			foreach ($accounting_groups_used_for_income_statement as $item) {
2684
-				$pcg_type_filter[] = "'" . $this->db->escape($item) . "'";
2684
+				$pcg_type_filter[] = "'".$this->db->escape($item)."'";
2685 2685
 			}
2686 2686
 
2687 2687
 			$sql = 'SELECT';
2688 2688
 			$sql .= " t.numero_compte,";
2689 2689
 			$sql .= " aa.pcg_type,";
2690 2690
 			$sql .= " (SUM(t.credit) - SUM(t.debit)) as accounting_result";
2691
-			$sql .= ' FROM ' . MAIN_DB_PREFIX . $this->table_element . ' as t';
2692
-			$sql .= ' LEFT JOIN  ' . MAIN_DB_PREFIX . 'accounting_account as aa ON aa.account_number = t.numero_compte';
2693
-			$sql .= ' WHERE t.entity = ' . ((int) $conf->entity); // Do not use getEntity for accounting features
2694
-			$sql .= " AND aa.entity = " . ((int) $conf->entity);
2695
-			$sql .= ' AND aa.fk_pcg_version IN (SELECT pcg_version FROM ' . MAIN_DB_PREFIX . 'accounting_system WHERE rowid = ' . ((int) getDolGlobalInt('CHARTOFACCOUNTS')) . ')';
2696
-			$sql .= ' AND aa.pcg_type IN (' . $this->db->sanitize(implode(',', $pcg_type_filter), 1) . ')';
2697
-			$sql .= " AND DATE(t.doc_date) >= '" . $this->db->idate($date_start) . "'";
2698
-			$sql .= " AND DATE(t.doc_date) <= '" . $this->db->idate($date_end) . "'";
2691
+			$sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.' as t';
2692
+			$sql .= ' LEFT JOIN  '.MAIN_DB_PREFIX.'accounting_account as aa ON aa.account_number = t.numero_compte';
2693
+			$sql .= ' WHERE t.entity = '.((int) $conf->entity); // Do not use getEntity for accounting features
2694
+			$sql .= " AND aa.entity = ".((int) $conf->entity);
2695
+			$sql .= ' AND aa.fk_pcg_version IN (SELECT pcg_version FROM '.MAIN_DB_PREFIX.'accounting_system WHERE rowid = '.((int) getDolGlobalInt('CHARTOFACCOUNTS')).')';
2696
+			$sql .= ' AND aa.pcg_type IN ('.$this->db->sanitize(implode(',', $pcg_type_filter), 1).')';
2697
+			$sql .= " AND DATE(t.doc_date) >= '".$this->db->idate($date_start)."'";
2698
+			$sql .= " AND DATE(t.doc_date) <= '".$this->db->idate($date_end)."'";
2699 2699
 			$sql .= ' GROUP BY t.numero_compte, aa.pcg_type';
2700 2700
 
2701 2701
 			$resql = $this->db->query($sql);
2702 2702
 			if (!$resql) {
2703
-				$this->errors[] = 'Error ' . $this->db->lasterror();
2704
-				dol_syslog(__METHOD__ . ' ' . implode(',', $this->errors), LOG_ERR);
2703
+				$this->errors[] = 'Error '.$this->db->lasterror();
2704
+				dol_syslog(__METHOD__.' '.implode(',', $this->errors), LOG_ERR);
2705 2705
 			} else {
2706 2706
 				while ($obj = $this->db->fetch_object($resql)) {
2707 2707
 					$income_statement_amount += $obj->accounting_result;
@@ -2740,7 +2740,7 @@  discard block
 block discarded – undo
2740 2740
 			return -1;
2741 2741
 		} elseif (empty($fiscal_period->id)) {
2742 2742
 			$langs->loadLangs(array('errors', 'compta'));
2743
-			$this->errors[] = $langs->trans('ErrorRecordNotFound') . ' - ' . $langs->trans('FiscalPeriod') . ' (' . $fiscal_period_id . ')';
2743
+			$this->errors[] = $langs->trans('ErrorRecordNotFound').' - '.$langs->trans('FiscalPeriod').' ('.$fiscal_period_id.')';
2744 2744
 			return -1;
2745 2745
 		}
2746 2746
 
@@ -2759,7 +2759,7 @@  discard block
 block discarded – undo
2759 2759
 			return -1;
2760 2760
 		} elseif (empty($new_fiscal_period->id)) {
2761 2761
 			$langs->loadLangs(array('errors', 'compta'));
2762
-			$this->errors[] = $langs->trans('ErrorRecordNotFound') . ' - ' . $langs->trans('FiscalPeriod') . ' (' . $new_fiscal_period_id . ')';
2762
+			$this->errors[] = $langs->trans('ErrorRecordNotFound').' - '.$langs->trans('FiscalPeriod').' ('.$new_fiscal_period_id.')';
2763 2763
 			return -1;
2764 2764
 		}
2765 2765
 
@@ -2779,7 +2779,7 @@  discard block
 block discarded – undo
2779 2779
 			$journal_id = max(0, getDolGlobalString('ACCOUNTING_CLOSURE_DEFAULT_JOURNAL'));
2780 2780
 			if (empty($journal_id)) {
2781 2781
 				$langs->loadLangs(array('errors', 'accountancy'));
2782
-				$this->errors[] = $langs->trans('ErrorBadParameters') . ' - ' . $langs->trans('Codejournal') . ' (' . $langs->trans('AccountingJournalType9') . ')';
2782
+				$this->errors[] = $langs->trans('ErrorBadParameters').' - '.$langs->trans('Codejournal').' ('.$langs->trans('AccountingJournalType9').')';
2783 2783
 				$error++;
2784 2784
 			}
2785 2785
 
@@ -2793,7 +2793,7 @@  discard block
 block discarded – undo
2793 2793
 					$error++;
2794 2794
 				} elseif ($result == 0) {
2795 2795
 					$langs->loadLangs(array('errors', 'accountancy'));
2796
-					$this->errors[] = $langs->trans('ErrorRecordNotFound') . ' - ' . $langs->trans('Codejournal') . ' (' . $langs->trans('AccountingJournalType9') . ')';
2796
+					$this->errors[] = $langs->trans('ErrorRecordNotFound').' - '.$langs->trans('Codejournal').' ('.$langs->trans('AccountingJournalType9').')';
2797 2797
 					$error++;
2798 2798
 				}
2799 2799
 			} else {
@@ -2807,7 +2807,7 @@  discard block
 block discarded – undo
2807 2807
 				$pcg_type_filter = array();
2808 2808
 				$tmp = array_merge($accounting_groups_used_for_balance_sheet_account, $accounting_groups_used_for_income_statement);
2809 2809
 				foreach ($tmp as $item) {
2810
-					$pcg_type_filter[] = "'" . $this->db->escape($item) . "'";
2810
+					$pcg_type_filter[] = "'".$this->db->escape($item)."'";
2811 2811
 				}
2812 2812
 
2813 2813
 				$sql = 'SELECT';
@@ -2819,14 +2819,14 @@  discard block
 block discarded – undo
2819 2819
 				}
2820 2820
 				$sql .= " aa.pcg_type,";
2821 2821
 				$sql .= " (SUM(t.credit) - SUM(t.debit)) as opening_balance";
2822
-				$sql .= ' FROM ' . MAIN_DB_PREFIX . $this->table_element . ' as t';
2823
-				$sql .= ' LEFT JOIN  ' . MAIN_DB_PREFIX . 'accounting_account as aa ON aa.account_number = t.numero_compte';
2824
-				$sql .= ' WHERE t.entity = ' . ((int) $conf->entity); // Do not use getEntity for accounting features
2825
-				$sql .= " AND aa.entity = ". ((int) $conf->entity);
2822
+				$sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.' as t';
2823
+				$sql .= ' LEFT JOIN  '.MAIN_DB_PREFIX.'accounting_account as aa ON aa.account_number = t.numero_compte';
2824
+				$sql .= ' WHERE t.entity = '.((int) $conf->entity); // Do not use getEntity for accounting features
2825
+				$sql .= " AND aa.entity = ".((int) $conf->entity);
2826 2826
 				$sql .= ' AND aa.fk_pcg_version IN (SELECT pcg_version FROM '.MAIN_DB_PREFIX.'accounting_system WHERE rowid = '.((int) getDolGlobalInt('CHARTOFACCOUNTS')).')';
2827
-				$sql .= ' AND aa.pcg_type IN (' . $this->db->sanitize(implode(',', $pcg_type_filter), 1) . ')';
2828
-				$sql .= " AND DATE(t.doc_date) >= '" . $this->db->idate($fiscal_period->date_start) . "'";
2829
-				$sql .= " AND DATE(t.doc_date) <= '" . $this->db->idate($fiscal_period->date_end) . "'";
2827
+				$sql .= ' AND aa.pcg_type IN ('.$this->db->sanitize(implode(',', $pcg_type_filter), 1).')';
2828
+				$sql .= " AND DATE(t.doc_date) >= '".$this->db->idate($fiscal_period->date_start)."'";
2829
+				$sql .= " AND DATE(t.doc_date) <= '".$this->db->idate($fiscal_period->date_end)."'";
2830 2830
 				$sql .= ' GROUP BY t.numero_compte, t.label_compte, aa.pcg_type';
2831 2831
 				if ($separate_auxiliary_account) {
2832 2832
 					$sql .= ' ,t.subledger_account, t.subledger_label';
@@ -2835,8 +2835,8 @@  discard block
 block discarded – undo
2835 2835
 
2836 2836
 				$resql = $this->db->query($sql);
2837 2837
 				if (!$resql) {
2838
-					$this->errors[] = 'Error ' . $this->db->lasterror();
2839
-					dol_syslog(__METHOD__ . ' ' . implode(',', $this->errors), LOG_ERR);
2838
+					$this->errors[] = 'Error '.$this->db->lasterror();
2839
+					dol_syslog(__METHOD__.' '.implode(',', $this->errors), LOG_ERR);
2840 2840
 
2841 2841
 					$error++;
2842 2842
 				} else {
@@ -2978,7 +2978,7 @@  discard block
 block discarded – undo
2978 2978
 			return -1;
2979 2979
 		} elseif (empty($fiscal_period->id)) {
2980 2980
 			$langs->loadLangs(array('errors', 'compta'));
2981
-			$this->errors[] = $langs->trans('ErrorRecordNotFound') . ' - ' . $langs->trans('FiscalPeriod') . ' (' . $fiscal_period_id . ')';
2981
+			$this->errors[] = $langs->trans('ErrorRecordNotFound').' - '.$langs->trans('FiscalPeriod').' ('.$fiscal_period_id.')';
2982 2982
 			return -1;
2983 2983
 		}
2984 2984
 
@@ -2997,7 +2997,7 @@  discard block
 block discarded – undo
2997 2997
 			return -1;
2998 2998
 		} elseif (empty($new_fiscal_period->id)) {
2999 2999
 			$langs->loadLangs(array('errors', 'compta'));
3000
-			$this->errors[] = $langs->trans('ErrorRecordNotFound') . ' - ' . $langs->trans('FiscalPeriod') . ' (' . $new_fiscal_period_id . ')';
3000
+			$this->errors[] = $langs->trans('ErrorRecordNotFound').' - '.$langs->trans('FiscalPeriod').' ('.$new_fiscal_period_id.')';
3001 3001
 			return -1;
3002 3002
 		}
3003 3003
 
@@ -3017,7 +3017,7 @@  discard block
 block discarded – undo
3017 3017
 			return -1;
3018 3018
 		} elseif ($result == 0) {
3019 3019
 			$langs->loadLangs(array('errors', 'accountancy'));
3020
-			$this->errors[] = $langs->trans('ErrorRecordNotFound') . ' - ' . $langs->trans('InventoryJournal');
3020
+			$this->errors[] = $langs->trans('ErrorRecordNotFound').' - '.$langs->trans('InventoryJournal');
3021 3021
 			return -1;
3022 3022
 		}
3023 3023
 
@@ -3025,18 +3025,18 @@  discard block
 block discarded – undo
3025 3025
 		$this->db->begin();
3026 3026
 
3027 3027
 		$sql = 'SELECT t.rowid';
3028
-		$sql .= ' FROM ' . MAIN_DB_PREFIX . $this->table_element . ' as t';
3029
-		$sql .= ' WHERE t.entity = ' . ((int) $conf->entity); // Do not use getEntity for accounting features
3030
-		$sql .= " AND code_journal = '" . $this->db->escape($inventory_journal->code) . "'";
3031
-		$sql .= " AND DATE(t.doc_date) >= '" . $this->db->idate($date_start) . "'";
3032
-		$sql .= " AND DATE(t.doc_date) <= '" . $this->db->idate($date_end) . "'";
3033
-		$sql .= " AND DATE(t.doc_date) >= '" . $this->db->idate($fiscal_period->date_start) . "'";
3034
-		$sql .= " AND DATE(t.doc_date) <= '" . $this->db->idate($fiscal_period->date_end) . "'";
3028
+		$sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.' as t';
3029
+		$sql .= ' WHERE t.entity = '.((int) $conf->entity); // Do not use getEntity for accounting features
3030
+		$sql .= " AND code_journal = '".$this->db->escape($inventory_journal->code)."'";
3031
+		$sql .= " AND DATE(t.doc_date) >= '".$this->db->idate($date_start)."'";
3032
+		$sql .= " AND DATE(t.doc_date) <= '".$this->db->idate($date_end)."'";
3033
+		$sql .= " AND DATE(t.doc_date) >= '".$this->db->idate($fiscal_period->date_start)."'";
3034
+		$sql .= " AND DATE(t.doc_date) <= '".$this->db->idate($fiscal_period->date_end)."'";
3035 3035
 
3036 3036
 		$resql = $this->db->query($sql);
3037 3037
 		if (!$resql) {
3038
-			$this->errors[] = 'Error ' . $this->db->lasterror();
3039
-			dol_syslog(__METHOD__ . ' ' . implode(',', $this->errors), LOG_ERR);
3038
+			$this->errors[] = 'Error '.$this->db->lasterror();
3039
+			dol_syslog(__METHOD__.' '.implode(',', $this->errors), LOG_ERR);
3040 3040
 
3041 3041
 			$error++;
3042 3042
 		} else {
@@ -3051,7 +3051,7 @@  discard block
 block discarded – undo
3051 3051
 					break;
3052 3052
 				} elseif ($result == 0) {
3053 3053
 					$langs->loadLangs(array('errors', 'accountancy'));
3054
-					$this->errors[] = $langs->trans('ErrorRecordNotFound') . ' - ' . $langs->trans('LineId') . ': ' . $obj->rowid;
3054
+					$this->errors[] = $langs->trans('ErrorRecordNotFound').' - '.$langs->trans('LineId').': '.$obj->rowid;
3055 3055
 					$error++;
3056 3056
 					break;
3057 3057
 				}
Please login to merge, or discard this patch.
Braces   +12 added lines, -4 removed lines patch added patch discarded remove patch
@@ -466,7 +466,9 @@  discard block
 block discarded – undo
466 466
 		// Call triggers
467 467
 		if (! $error && ! $notrigger) {
468 468
 			$result=$this->call_trigger('BOOKKEEPING_CREATE', $user);
469
-			if ($result < 0) $error++;
469
+			if ($result < 0) {
470
+				$error++;
471
+			}
470 472
 		}
471 473
 
472 474
 		// Commit or rollback
@@ -715,7 +717,9 @@  discard block
 block discarded – undo
715 717
 			// Call triggers
716 718
 			if (! $notrigger) {
717 719
 				$result=$this->call_trigger('BOOKKEEPING_CREATE', $user);
718
-				if ($result < 0) $error++;
720
+				if ($result < 0) {
721
+					$error++;
722
+				}
719 723
 			}
720 724
 		}
721 725
 
@@ -1481,7 +1485,9 @@  discard block
 block discarded – undo
1481 1485
 		// Call triggers
1482 1486
 		if (! $error && ! $notrigger) {
1483 1487
 			$result=$this->call_trigger('BOOKKEEPING_MODIFY', $user);
1484
-			if ($result < 0) $error++;
1488
+			if ($result < 0) {
1489
+				$error++;
1490
+			}
1485 1491
 		}
1486 1492
 
1487 1493
 		// Commit or rollback
@@ -1572,7 +1578,9 @@  discard block
 block discarded – undo
1572 1578
 		// Call triggers
1573 1579
 		if (! $error && ! $notrigger) {
1574 1580
 			$result=$this->call_trigger('BOOKKEEPING_DELETE', $user);
1575
-			if ($result < 0) $error++;
1581
+			if ($result < 0) {
1582
+				$error++;
1583
+			}
1576 1584
 		}
1577 1585
 
1578 1586
 		if (!$error) {
Please login to merge, or discard this patch.
htdocs/expedition/card.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -1457,7 +1457,7 @@  discard block
 block discarded – undo
1457 1457
 										$tooltipClass = ' classfortooltip';
1458 1458
 										$tooltipTitle = $langs->trans('StockQuantitiesAlreadyAllocatedOnPreviousLines').' : '.$alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch][intval($warehouse_id)];
1459 1459
 									} else {
1460
-										$alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch][intval($warehouse_id)] = 0 ;
1460
+										$alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch][intval($warehouse_id)] = 0;
1461 1461
 									}
1462 1462
 									$alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch][intval($warehouse_id)] = $deliverableQty + $alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch][intval($warehouse_id)];
1463 1463
 
@@ -1696,7 +1696,7 @@  discard block
 block discarded – undo
1696 1696
 											$tooltipClass = ' classfortooltip';
1697 1697
 											$tooltipTitle = $langs->trans('StockQuantitiesAlreadyAllocatedOnPreviousLines').' : '.$alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch][intval($warehouse_id)];
1698 1698
 										} else {
1699
-											$alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch][intval($warehouse_id)] = 0 ;
1699
+											$alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch][intval($warehouse_id)] = 0;
1700 1700
 										}
1701 1701
 										$alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch][intval($warehouse_id)] = $deliverableQty + $alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch][intval($warehouse_id)];
1702 1702
 
@@ -1757,7 +1757,7 @@  discard block
 block discarded – undo
1757 1757
 								}
1758 1758
 								print '<input class="qtyl right" name="qtyl'.$indiceAsked.'_'.$subj.'" id="qtyl'.$indiceAsked.'_'.$subj.'" type="text" size="4" value="0"'.($disabled ? ' '.$disabled : '').'> ';
1759 1759
 								if (empty($disabled) && getDolGlobalString('STOCK_ALLOW_NEGATIVE_TRANSFER')) {
1760
-									print '<input name="ent1' . $indiceAsked . '_' . $subj . '" type="hidden" value="' . $warehouse_selected_id . '">';
1760
+									print '<input name="ent1'.$indiceAsked.'_'.$subj.'" type="hidden" value="'.$warehouse_selected_id.'">';
1761 1761
 								}
1762 1762
 							} elseif ($line->product_type == Product::TYPE_SERVICE && getDolGlobalString('SHIPMENT_SUPPORTS_SERVICES')) {
1763 1763
 								$disabled = '';
@@ -1769,7 +1769,7 @@  discard block
 block discarded – undo
1769 1769
 								}
1770 1770
 								print '<input class="qtyl right" name="qtyl'.$indiceAsked.'_'.$subj.'" id="qtyl'.$indiceAsked.'_'.$subj.'" type="text" size="4" value="'.$quantityToBeDelivered.'"'.($disabled ? ' '.$disabled : '').'> ';
1771 1771
 								if (empty($disabled) && getDolGlobalString('STOCK_ALLOW_NEGATIVE_TRANSFER')) {
1772
-									print '<input name="ent1' . $indiceAsked . '_' . $subj . '" type="hidden" value="' . $warehouse_selected_id . '">';
1772
+									print '<input name="ent1'.$indiceAsked.'_'.$subj.'" type="hidden" value="'.$warehouse_selected_id.'">';
1773 1773
 								}
1774 1774
 							} else {
1775 1775
 								print $langs->trans("NA");
@@ -1834,7 +1834,7 @@  discard block
 block discarded – undo
1834 1834
 		}
1835 1835
 	}
1836 1836
 } elseif ($object->id > 0) {
1837
-	'@phan-var-force Expedition $object';  // Need to force it (type overridden earlier)
1837
+	'@phan-var-force Expedition $object'; // Need to force it (type overridden earlier)
1838 1838
 	/* *************************************************************************** */
1839 1839
 	/*                                                                             */
1840 1840
 	/* Edit and view mode                                                          */
@@ -1948,7 +1948,7 @@  discard block
 block discarded – undo
1948 1948
 	$morehtmlref = '<div class="refidno">';
1949 1949
 	// Ref customer shipment
1950 1950
 	$morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_customer', $object->ref_customer, $object, $user->hasRight('expedition', 'creer'), 'string', '', 0, 1);
1951
-	$morehtmlref .= $form->editfieldval("RefCustomer", 'ref_customer', $object->ref_customer, $object, $user->hasRight('expedition', 'creer'), 'string'.(isset($conf->global->THIRDPARTY_REF_INPUT_SIZE) ? ':' . getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') : ''), '', null, null, '', 1);
1951
+	$morehtmlref .= $form->editfieldval("RefCustomer", 'ref_customer', $object->ref_customer, $object, $user->hasRight('expedition', 'creer'), 'string'.(isset($conf->global->THIRDPARTY_REF_INPUT_SIZE) ? ':'.getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') : ''), '', null, null, '', 1);
1952 1952
 	// Thirdparty
1953 1953
 	$morehtmlref .= '<br>'.$object->thirdparty->getNomUrl(1);
1954 1954
 	// Project
@@ -2714,7 +2714,7 @@  discard block
 block discarded – undo
2714 2714
 				 || (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('expedition', 'shipping_advance', 'validate'))) {
2715 2715
 					print dolGetButtonAction('', $langs->trans('Validate'), 'default', $_SERVER["PHP_SELF"].'?action=valid&token='.newToken().'&id='.$object->id, '');
2716 2716
 				} else {
2717
-					print dolGetButtonAction($langs->trans('NotAllowed'), $langs->trans('Validate'), 'default', $_SERVER['PHP_SELF']. '#', '', false);
2717
+					print dolGetButtonAction($langs->trans('NotAllowed'), $langs->trans('Validate'), 'default', $_SERVER['PHP_SELF'].'#', '', false);
2718 2718
 				}
2719 2719
 			}
2720 2720
 
@@ -2736,7 +2736,7 @@  discard block
 block discarded – undo
2736 2736
 					if (!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') || $user->hasRight('expedition', 'shipping_advance', 'send')) {
2737 2737
 						print dolGetButtonAction('', $langs->trans('SendMail'), 'default', $_SERVER["PHP_SELF"].'?action=presend&token='.newToken().'&id='.$object->id.'&mode=init#formmailbeforetitle', '');
2738 2738
 					} else {
2739
-						print dolGetButtonAction('', $langs->trans('SendMail'), 'default', $_SERVER['PHP_SELF']. '#', '', false);
2739
+						print dolGetButtonAction('', $langs->trans('SendMail'), 'default', $_SERVER['PHP_SELF'].'#', '', false);
2740 2740
 					}
2741 2741
 				}
2742 2742
 			}
Please login to merge, or discard this patch.
htdocs/hrm/position_card.php 1 patch
Spacing   +44 added lines, -44 removed lines patch added patch discarded remove patch
@@ -30,19 +30,19 @@  discard block
 block discarded – undo
30 30
 // Load Dolibarr environment
31 31
 require '../main.inc.php';
32 32
 
33
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formcompany.class.php';
34
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formfile.class.php';
35
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php';
36
-require_once DOL_DOCUMENT_ROOT . '/hrm/class/position.class.php';
37
-require_once DOL_DOCUMENT_ROOT . '/hrm/class/job.class.php';
38
-require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_position.lib.php';
33
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
34
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
35
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
36
+require_once DOL_DOCUMENT_ROOT.'/hrm/class/position.class.php';
37
+require_once DOL_DOCUMENT_ROOT.'/hrm/class/job.class.php';
38
+require_once DOL_DOCUMENT_ROOT.'/hrm/lib/hrm_position.lib.php';
39 39
 //dol_include_once('/hrm/position.php');
40 40
 
41 41
 // Get Parameters
42
-$action 	= GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ...
42
+$action = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ...
43 43
 $backtopage = GETPOST('backtopage', 'alpha');
44 44
 $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha');
45
-$id 	= GETPOSTINT('id');
45
+$id = GETPOSTINT('id');
46 46
 
47 47
 // Initialize a technical objects
48 48
 $form = new Form($db);
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 $permissiontoadd = $user->hasRight('hrm', 'all', 'write'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
58 58
 $permissiontodelete = $user->hasRight('hrm', 'all', 'delete');
59 59
 $permissiondellink = $user->hasRight('hrm', 'all', 'write'); // Used by the include of actions_dellink.inc.php
60
-$upload_dir = $conf->hrm->multidir_output[isset($object->entity) ? $object->entity : 1] . '/position';
60
+$upload_dir = $conf->hrm->multidir_output[isset($object->entity) ? $object->entity : 1].'/position';
61 61
 
62 62
 // Security check (enable the most restrictive one)
63 63
 //if ($user->socid > 0) accessforbidden();
@@ -76,10 +76,10 @@  discard block
 block discarded – undo
76 76
 
77 77
 
78 78
 // Get parameters
79
-$id 	= GETPOSTINT('id');
79
+$id = GETPOSTINT('id');
80 80
 $fk_job = GETPOSTINT('fk_job');
81 81
 
82
-$ref 	= GETPOST('ref', 'alpha');
82
+$ref = GETPOST('ref', 'alpha');
83 83
 $action = GETPOST('action', 'aZ09');
84 84
 $confirm = GETPOST('confirm', 'alpha');
85 85
 $cancel = GETPOST('cancel', 'aZ09');
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
 
98 98
 $extrafields = new ExtraFields($db);
99 99
 
100
-$diroutputmassaction = $conf->hrm->dir_output . '/temp/massgeneration/' . $user->id;
100
+$diroutputmassaction = $conf->hrm->dir_output.'/temp/massgeneration/'.$user->id;
101 101
 $hookmanager->initHooks(array('positioncard', 'globalcard')); // Note that conf->hooks_modules contains array
102 102
 
103 103
 // Fetch optionals attributes and labels
@@ -109,8 +109,8 @@  discard block
 block discarded – undo
109 109
 $search_all = GETPOST("search_all", 'alpha');
110 110
 $search = array();
111 111
 foreach ($object->fields as $key => $val) {
112
-	if (GETPOST('search_' . $key, 'alpha')) {
113
-		$search[$key] = GETPOST('search_' . $key, 'alpha');
112
+	if (GETPOST('search_'.$key, 'alpha')) {
113
+		$search[$key] = GETPOST('search_'.$key, 'alpha');
114 114
 	}
115 115
 }
116 116
 
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
 }
120 120
 
121 121
 // Load object
122
-include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'.
122
+include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'.
123 123
 
124 124
 
125 125
 /*
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
 			if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) {
143 143
 				$backtopage = $backurlforlist;
144 144
 			} else {
145
-				$backtopage = dol_buildpath('/hrm/position_card.php', 1) . '?id=' . ($id > 0 ? $id : '__ID__');
145
+				$backtopage = dol_buildpath('/hrm/position_card.php', 1).'?id='.($id > 0 ? $id : '__ID__');
146 146
 			}
147 147
 		}
148 148
 	}
@@ -150,19 +150,19 @@  discard block
 block discarded – undo
150 150
 	$triggermodname = 'HRM_POSITION_MODIFY'; // Name of trigger action code to execute when we modify record
151 151
 
152 152
 	// Actions cancel, add, update, update_extras, confirm_validate, confirm_delete, confirm_deleteline, confirm_clone, confirm_close, confirm_setdraft, confirm_reopen
153
-	include DOL_DOCUMENT_ROOT . '/core/actions_addupdatedelete.inc.php';
153
+	include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php';
154 154
 
155 155
 	// Actions when linking object each other
156
-	include DOL_DOCUMENT_ROOT . '/core/actions_dellink.inc.php';
156
+	include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php';
157 157
 
158 158
 	// Actions when printing a doc from card
159
-	include DOL_DOCUMENT_ROOT . '/core/actions_printing.inc.php';
159
+	include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
160 160
 
161 161
 	// Action to move up and down lines of object
162 162
 	//include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php';
163 163
 
164 164
 	// Action to build doc
165
-	include DOL_DOCUMENT_ROOT . '/core/actions_builddoc.inc.php';
165
+	include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
166 166
 
167 167
 	if ($action == 'set_thirdparty' && $permissiontoadd) {
168 168
 		$object->setValueFrom('fk_soc', GETPOSTINT('fk_soc'), '', null, 'date', '', $user, $triggermodname);
@@ -174,8 +174,8 @@  discard block
 block discarded – undo
174 174
 	// Actions to send emails
175 175
 	$triggersendname = 'HRM_POSITION_SENTBYMAIL';
176 176
 	$autocopy = 'MAIN_MAIL_AUTOCOPY_POSITION_TO';
177
-	$trackid = 'position' . $object->id;
178
-	include DOL_DOCUMENT_ROOT . '/core/actions_sendmails.inc.php';
177
+	$trackid = 'position'.$object->id;
178
+	include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
179 179
 }
180 180
 
181 181
 
@@ -220,36 +220,36 @@  discard block
 block discarded – undo
220 220
 
221 221
 	// Part to edit record
222 222
 	if (($id || $ref) && $action == 'edit') {
223
-		print load_fiche_titre($langs->trans("Position"), '', 'object_' . $object->picto);
223
+		print load_fiche_titre($langs->trans("Position"), '', 'object_'.$object->picto);
224 224
 
225
-		print '<form method="POST" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '">';
226
-		print '<input type="hidden" name="token" value="' . newToken() . '">';
225
+		print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'">';
226
+		print '<input type="hidden" name="token" value="'.newToken().'">';
227 227
 		print '<input type="hidden" name="action" value="update">';
228
-		print '<input type="hidden" name="id" value="' . $object->id . '">';
228
+		print '<input type="hidden" name="id" value="'.$object->id.'">';
229 229
 
230 230
 		if ($backtopage) {
231
-			print '<input type="hidden" name="backtopage" value="' . $backtopage . '">';
231
+			print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
232 232
 		}
233 233
 		if ($backtopageforcancel) {
234
-			print '<input type="hidden" name="backtopageforcancel" value="' . $backtopageforcancel . '">';
234
+			print '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">';
235 235
 		}
236 236
 
237 237
 		print dol_get_fiche_head();
238 238
 
239
-		print '<table class="border centpercent tableforfieldedit">' . "\n";
239
+		print '<table class="border centpercent tableforfieldedit">'."\n";
240 240
 
241 241
 		// Common attributes
242
-		include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_edit.tpl.php';
242
+		include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_edit.tpl.php';
243 243
 
244 244
 		// Other attributes
245
-		include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_edit.tpl.php';
245
+		include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_edit.tpl.php';
246 246
 
247 247
 		print '</table>';
248 248
 
249 249
 		print dol_get_fiche_end();
250 250
 
251
-		print '<div class="center"><input type="submit" class="button button-save" name="save" value="' . $langs->trans("Save") . '">';
252
-		print ' &nbsp; <input type="submit" class="button button-cancel" name="cancel" value="' . $langs->trans("Cancel") . '">';
251
+		print '<div class="center"><input type="submit" class="button button-save" name="save" value="'.$langs->trans("Save").'">';
252
+		print ' &nbsp; <input type="submit" class="button button-cancel" name="cancel" value="'.$langs->trans("Cancel").'">';
253 253
 		print '</div>';
254 254
 
255 255
 		print '</form>';
@@ -268,7 +268,7 @@  discard block
 block discarded – undo
268 268
 
269 269
 		// Confirmation to delete
270 270
 		if ($action == 'delete') {
271
-			$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('DeletePosition'), $langs->trans('ConfirmDeleteObject'), 'confirm_delete', '', 0, 1);
271
+			$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeletePosition'), $langs->trans('ConfirmDeleteObject'), 'confirm_delete', '', 0, 1);
272 272
 		}
273 273
 
274 274
 		// Call Hook formConfirm
@@ -303,7 +303,7 @@  discard block
 block discarded – undo
303 303
 		print '<div class="fichecenter">';
304 304
 		print '<div class="fichehalfleft">';
305 305
 		print '<div class="underbanner clearboth"></div>';
306
-		print '<table class="border centpercent tableforfield">' . "\n";
306
+		print '<table class="border centpercent tableforfield">'."\n";
307 307
 
308 308
 		// Common attributes
309 309
 		//$keyforbreak='fieldkeytoswitchonsecondcolumn';	// We change column just before this field
@@ -311,10 +311,10 @@  discard block
 block discarded – undo
311 311
 		//unset($object->fields['fk_soc']);					// Hide field already shown in banner
312 312
 		$object->fields['fk_user']['visible'] = 0; // Already in banner
313 313
 		$object->fields['fk_job']['visible'] = 0; // Already in banner
314
-		include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_view.tpl.php';
314
+		include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php';
315 315
 
316 316
 		// Other attributes. Fields from hook formObjectOptions and Extrafields.
317
-		include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
317
+		include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
318 318
 
319 319
 		print '</table>';
320 320
 		print '</div>';
@@ -333,10 +333,10 @@  discard block
 block discarded – undo
333 333
 		$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
334 334
 
335 335
 
336
-		print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=edit&token=' . newToken(), '', $permissiontoadd);
336
+		print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit&token='.newToken(), '', $permissiontoadd);
337 337
 
338 338
 		// Delete (need delete permission, or if draft, just need create/modify permission)
339
-		print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=delete&token=' . newToken(), '', $permissiontodelete);
339
+		print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=delete&token='.newToken(), '', $permissiontodelete);
340 340
 	}
341 341
 }
342 342
 
@@ -374,10 +374,10 @@  discard block
 block discarded – undo
374 374
 //}
375 375
 
376 376
 
377
-print '</table>' . "\n";
378
-print '</div>' . "\n";
377
+print '</table>'."\n";
378
+print '</div>'."\n";
379 379
 
380
-print '</form>' . "\n";
380
+print '</form>'."\n";
381 381
 
382 382
 
383 383
 if ($action !== 'edit' && $action !== 'create') {
@@ -395,9 +395,9 @@  discard block
 block discarded – undo
395 395
 	$morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', DOL_URL_ROOT.'/hrm/position_agenda.php?id='.$object->id);
396 396
 
397 397
 	// List of actions on element
398
-	include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
398
+	include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
399 399
 	$formactions = new FormActions($db);
400
-	$somethingshown = $formactions->showactions($object, $object->element . '@' . $object->module, (is_object($object->thirdparty) ? $object->thirdparty->id : 0), 1, '', $MAXEVENT, '', $morehtmlcenter);
400
+	$somethingshown = $formactions->showactions($object, $object->element.'@'.$object->module, (is_object($object->thirdparty) ? $object->thirdparty->id : 0), 1, '', $MAXEVENT, '', $morehtmlcenter);
401 401
 
402 402
 	print '</div></div>';
403 403
 }
Please login to merge, or discard this patch.
htdocs/hrm/job_card.php 1 patch
Spacing   +67 added lines, -67 removed lines patch added patch discarded remove patch
@@ -30,15 +30,15 @@  discard block
 block discarded – undo
30 30
 // Load Dolibarr environment
31 31
 require '../main.inc.php';
32 32
 
33
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formcompany.class.php';
34
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formfile.class.php';
35
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php';
36
-require_once DOL_DOCUMENT_ROOT . '/hrm/class/job.class.php';
37
-require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_job.lib.php';
38
-require_once DOL_DOCUMENT_ROOT . '/hrm/class/skillrank.class.php';
33
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
34
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
35
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
36
+require_once DOL_DOCUMENT_ROOT.'/hrm/class/job.class.php';
37
+require_once DOL_DOCUMENT_ROOT.'/hrm/lib/hrm_job.lib.php';
38
+require_once DOL_DOCUMENT_ROOT.'/hrm/class/skillrank.class.php';
39 39
 
40 40
 // Load translation files required by the page
41
-$langs->loadLangs(array('hrm', 'other', 'products'));   // why products?
41
+$langs->loadLangs(array('hrm', 'other', 'products')); // why products?
42 42
 
43 43
 // Get parameters
44 44
 $id = GETPOSTINT('id');
@@ -49,12 +49,12 @@  discard block
 block discarded – undo
49 49
 $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'jobcard'; // To manage different context of search
50 50
 $backtopage = GETPOST('backtopage', 'alpha');
51 51
 $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha');
52
-$lineid   = GETPOSTINT('lineid');
52
+$lineid = GETPOSTINT('lineid');
53 53
 
54 54
 // Initialize a technical objects
55 55
 $object = new Job($db);
56 56
 $extrafields = new ExtraFields($db);
57
-$diroutputmassaction = $conf->hrm->dir_output . '/temp/massgeneration/' . $user->id;
57
+$diroutputmassaction = $conf->hrm->dir_output.'/temp/massgeneration/'.$user->id;
58 58
 $hookmanager->initHooks(array('jobcard', 'globalcard')); // Note that conf->hooks_modules contains array
59 59
 
60 60
 // Fetch optionals attributes and labels
@@ -66,8 +66,8 @@  discard block
 block discarded – undo
66 66
 $search_all = GETPOST("search_all", 'alpha');
67 67
 $search = array();
68 68
 foreach ($object->fields as $key => $val) {
69
-	if (GETPOST('search_' . $key, 'alpha')) {
70
-		$search[$key] = GETPOST('search_' . $key, 'alpha');
69
+	if (GETPOST('search_'.$key, 'alpha')) {
70
+		$search[$key] = GETPOST('search_'.$key, 'alpha');
71 71
 	}
72 72
 }
73 73
 
@@ -76,13 +76,13 @@  discard block
 block discarded – undo
76 76
 }
77 77
 
78 78
 // Load object
79
-include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'.
79
+include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'.
80 80
 
81 81
 // Permissions
82 82
 $permissiontoread = $user->hasRight('hrm', 'all', 'read');
83 83
 $permissiontoadd  = $user->hasRight('hrm', 'all', 'write'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
84 84
 $permissiontodelete = $user->hasRight('hrm', 'all', 'delete');
85
-$upload_dir = $conf->hrm->multidir_output[isset($object->entity) ? $object->entity : 1] . '/job';
85
+$upload_dir = $conf->hrm->multidir_output[isset($object->entity) ? $object->entity : 1].'/job';
86 86
 
87 87
 // Security check (enable the most restrictive one)
88 88
 //if ($user->socid > 0) accessforbidden();
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
 			if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) {
118 118
 				$backtopage = $backurlforlist;
119 119
 			} else {
120
-				$backtopage = dol_buildpath('/hrm/job_card.php', 1) . '?id=' . ($id > 0 ? $id : '__ID__');
120
+				$backtopage = dol_buildpath('/hrm/job_card.php', 1).'?id='.($id > 0 ? $id : '__ID__');
121 121
 			}
122 122
 		}
123 123
 	}
@@ -127,20 +127,20 @@  discard block
 block discarded – undo
127 127
 
128 128
 	// Actions cancel, add, update, update_extras, confirm_validate, confirm_delete, confirm_deleteline, confirm_clone, confirm_close, confirm_setdraft, confirm_reopen
129 129
 	if ($action != 'confirm_clone') {
130
-		include DOL_DOCUMENT_ROOT . '/core/actions_addupdatedelete.inc.php';
130
+		include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php';
131 131
 	}
132 132
 
133 133
 	// Actions when linking object each other
134
-	include DOL_DOCUMENT_ROOT . '/core/actions_dellink.inc.php';
134
+	include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php';
135 135
 
136 136
 	// Actions when printing a doc from card
137
-	include DOL_DOCUMENT_ROOT . '/core/actions_printing.inc.php';
137
+	include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
138 138
 
139 139
 	// Action to move up and down lines of object
140 140
 	//include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php';
141 141
 
142 142
 	// Action to build doc
143
-	include DOL_DOCUMENT_ROOT . '/core/actions_builddoc.inc.php';
143
+	include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
144 144
 
145 145
 	if ($action == 'set_thirdparty' && $permissiontoadd) {
146 146
 		$object->setValueFrom('fk_soc', GETPOSTINT('fk_soc'), '', null, 'date', '', $user, $triggermodname);
@@ -152,8 +152,8 @@  discard block
 block discarded – undo
152 152
 	// Actions to send emails
153 153
 	$triggersendname = 'HRM_JOB_SENTBYMAIL';
154 154
 	$autocopy = 'MAIN_MAIL_AUTOCOPY_JOB_TO';
155
-	$trackid = 'job' . $object->id;
156
-	include DOL_DOCUMENT_ROOT . '/core/actions_sendmails.inc.php';
155
+	$trackid = 'job'.$object->id;
156
+	include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
157 157
 
158 158
 	if ($action == 'confirm_clone' && $confirm != 'yes') {
159 159
 		$action = '';
@@ -240,36 +240,36 @@  discard block
 block discarded – undo
240 240
 
241 241
 // Part to create
242 242
 if ($action == 'create') {
243
-	print load_fiche_titre($langs->trans("NewJobProfile", $langs->transnoentities('Job')), '', 'object_' . $object->picto);
243
+	print load_fiche_titre($langs->trans("NewJobProfile", $langs->transnoentities('Job')), '', 'object_'.$object->picto);
244 244
 
245
-	print '<form method="POST" action="' . $_SERVER["PHP_SELF"] . '">';
246
-	print '<input type="hidden" name="token" value="' . newToken() . '">';
245
+	print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
246
+	print '<input type="hidden" name="token" value="'.newToken().'">';
247 247
 	print '<input type="hidden" name="action" value="add">';
248 248
 	if ($backtopage) {
249
-		print '<input type="hidden" name="backtopage" value="' . $backtopage . '">';
249
+		print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
250 250
 	}
251 251
 	if ($backtopageforcancel) {
252
-		print '<input type="hidden" name="backtopageforcancel" value="' . $backtopageforcancel . '">';
252
+		print '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">';
253 253
 	}
254 254
 
255 255
 	print dol_get_fiche_head(array(), '');
256 256
 
257
-	print '<table class="border centpercent tableforfieldcreate">' . "\n";
257
+	print '<table class="border centpercent tableforfieldcreate">'."\n";
258 258
 
259 259
 	// Common attributes
260
-	include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_add.tpl.php';
260
+	include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_add.tpl.php';
261 261
 
262 262
 	// Other attributes
263
-	include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_add.tpl.php';
263
+	include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php';
264 264
 
265
-	print '</table>' . "\n";
265
+	print '</table>'."\n";
266 266
 
267 267
 	print dol_get_fiche_end();
268 268
 
269 269
 	print '<div class="center">';
270
-	print '<input type="submit" class="button" name="add" value="' . dol_escape_htmltag($langs->trans("Create")) . '">';
270
+	print '<input type="submit" class="button" name="add" value="'.dol_escape_htmltag($langs->trans("Create")).'">';
271 271
 	print '&nbsp; ';
272
-	print '<input type="' . ($backtopage ? "submit" : "button") . '" class="button button-cancel" name="cancel" value="' . dol_escape_htmltag($langs->trans("Cancel")) . '"' . ($backtopage ? '' : ' onclick="history.go(-1)"') . '>'; // Cancel for create does not post form if we don't know the backtopage
272
+	print '<input type="'.($backtopage ? "submit" : "button").'" class="button button-cancel" name="cancel" value="'.dol_escape_htmltag($langs->trans("Cancel")).'"'.($backtopage ? '' : ' onclick="history.go(-1)"').'>'; // Cancel for create does not post form if we don't know the backtopage
273 273
 	print '</div>';
274 274
 
275 275
 	print '</form>';
@@ -279,35 +279,35 @@  discard block
 block discarded – undo
279 279
 
280 280
 // Part to edit record
281 281
 if (($id || $ref) && $action == 'edit') {
282
-	print load_fiche_titre($langs->trans("JobProfile"), '', 'object_' . $object->picto);
282
+	print load_fiche_titre($langs->trans("JobProfile"), '', 'object_'.$object->picto);
283 283
 
284
-	print '<form method="POST" action="' . $_SERVER["PHP_SELF"] . '">';
285
-	print '<input type="hidden" name="token" value="' . newToken() . '">';
284
+	print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
285
+	print '<input type="hidden" name="token" value="'.newToken().'">';
286 286
 	print '<input type="hidden" name="action" value="update">';
287
-	print '<input type="hidden" name="id" value="' . $object->id . '">';
287
+	print '<input type="hidden" name="id" value="'.$object->id.'">';
288 288
 	if ($backtopage) {
289
-		print '<input type="hidden" name="backtopage" value="' . $backtopage . '">';
289
+		print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
290 290
 	}
291 291
 	if ($backtopageforcancel) {
292
-		print '<input type="hidden" name="backtopageforcancel" value="' . $backtopageforcancel . '">';
292
+		print '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">';
293 293
 	}
294 294
 
295 295
 	print dol_get_fiche_head();
296 296
 
297
-	print '<table class="border centpercent tableforfieldedit">' . "\n";
297
+	print '<table class="border centpercent tableforfieldedit">'."\n";
298 298
 
299 299
 	// Common attributes
300
-	include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_edit.tpl.php';
300
+	include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_edit.tpl.php';
301 301
 
302 302
 	// Other attributes
303
-	include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_edit.tpl.php';
303
+	include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_edit.tpl.php';
304 304
 
305 305
 	print '</table>';
306 306
 
307 307
 	print dol_get_fiche_end();
308 308
 
309
-	print '<div class="center"><input type="submit" class="button button-save" name="save" value="' . $langs->trans("Save") . '">';
310
-	print ' &nbsp; <input type="submit" class="button button-cancel" name="cancel" value="' . $langs->trans("Cancel") . '">';
309
+	print '<div class="center"><input type="submit" class="button button-save" name="save" value="'.$langs->trans("Save").'">';
310
+	print ' &nbsp; <input type="submit" class="button button-cancel" name="cancel" value="'.$langs->trans("Cancel").'">';
311 311
 	print '</div>';
312 312
 
313 313
 	print '</form>';
@@ -325,11 +325,11 @@  discard block
 block discarded – undo
325 325
 
326 326
 	// Confirmation to delete
327 327
 	if ($action == 'delete') {
328
-		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('DeleteJob'), $langs->trans('ConfirmDeleteObject'), 'confirm_delete', '', 0, 1);
328
+		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteJob'), $langs->trans('ConfirmDeleteObject'), 'confirm_delete', '', 0, 1);
329 329
 	}
330 330
 	// Confirmation to delete line
331 331
 	if ($action == 'deleteline') {
332
-		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id . '&lineid=' . $lineid, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_deleteline', '', 0, 1);
332
+		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_deleteline', '', 0, 1);
333 333
 	}
334 334
 	// Clone confirmation
335 335
 	if ($action == 'clone') {
@@ -355,7 +355,7 @@  discard block
 block discarded – undo
355 355
 			// array('type' => 'other',    'name' => 'idwarehouse',   'label' => $langs->trans("SelectWarehouseForStockDecrease"), 'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse')?GETPOST('idwarehouse'):'ifone', 'idwarehouse', '', 1, 0, 0, '', 0, $forcecombo))
356 356
 		);
357 357
 		*/
358
-		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('XXX'), $text, 'confirm_xxx', $formquestion, 0, 1, 220);
358
+		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('XXX'), $text, 'confirm_xxx', $formquestion, 0, 1, 220);
359 359
 	}
360 360
 
361 361
 	// Call Hook formConfirm
@@ -373,7 +373,7 @@  discard block
 block discarded – undo
373 373
 
374 374
 	// Object card
375 375
 	// ------------------------------------------------------------
376
-	$linkback = '<a href="' . dol_buildpath('/hrm/job_list.php', 1) . '?restore_lastsearch_values=1' . (!empty($socid) ? '&socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';
376
+	$linkback = '<a href="'.dol_buildpath('/hrm/job_list.php', 1).'?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>';
377 377
 
378 378
 	$morehtmlref = '<div class="refid">';
379 379
 	$morehtmlref .= $object->label;
@@ -393,10 +393,10 @@  discard block
 block discarded – undo
393 393
 	//unset($object->fields['fk_project']);				// Hide field already shown in banner
394 394
 	//unset($object->fields['fk_soc']);					// Hide field already shown in banner
395 395
 	$object->fields['label']['visible'] = 0; // Already in banner
396
-	include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_view.tpl.php';
396
+	include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php';
397 397
 
398 398
 	// Other attributes. Fields from hook formObjectOptions and Extrafields.
399
-	include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
399
+	include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
400 400
 
401 401
 	print '</table>';
402 402
 	print '</div>';
@@ -415,16 +415,16 @@  discard block
 block discarded – undo
415 415
 		// Show object lines
416 416
 		$result = $object->getLinesArray();
417 417
 
418
-		print '	<form name="addproduct" id="addproduct" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . (($action != 'editline') ? '' : '#line_' . GETPOSTINT('lineid')) . '" method="POST">
419
-		<input type="hidden" name="token" value="' . newToken() . '">
420
-		<input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline') . '">
418
+		print '	<form name="addproduct" id="addproduct" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.(($action != 'editline') ? '' : '#line_'.GETPOSTINT('lineid')).'" method="POST">
419
+		<input type="hidden" name="token" value="' . newToken().'">
420
+		<input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline').'">
421 421
 		<input type="hidden" name="mode" value="">
422 422
 		<input type="hidden" name="page_y" value="">
423
-		<input type="hidden" name="id" value="' . $object->id . '">
423
+		<input type="hidden" name="id" value="' . $object->id.'">
424 424
 		';
425 425
 
426 426
 		if (!empty($conf->use_javascript_ajax) && $object->status == 0) {
427
-			include DOL_DOCUMENT_ROOT . '/core/tpl/ajaxrow.tpl.php';
427
+			include DOL_DOCUMENT_ROOT.'/core/tpl/ajaxrow.tpl.php';
428 428
 		}
429 429
 
430 430
 		print '<div class="div-table-responsive-no-min">';
@@ -464,7 +464,7 @@  discard block
 block discarded – undo
464 464
 	// Buttons for actions
465 465
 
466 466
 	if ($action != 'presend' && $action != 'editline') {
467
-		print '<div class="tabsAction">' . "\n";
467
+		print '<div class="tabsAction">'."\n";
468 468
 		$parameters = array();
469 469
 		$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
470 470
 		if ($reshook < 0) {
@@ -474,17 +474,17 @@  discard block
 block discarded – undo
474 474
 		if (empty($reshook)) {
475 475
 			// Back to draft
476 476
 			if ($object->status == $object::STATUS_VALIDATED) {
477
-				print dolGetButtonAction($langs->trans('SetToDraft'), '', 'default', $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=confirm_setdraft&confirm=yes&token=' . newToken(), '', $permissiontoadd);
477
+				print dolGetButtonAction($langs->trans('SetToDraft'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=confirm_setdraft&confirm=yes&token='.newToken(), '', $permissiontoadd);
478 478
 			}
479 479
 
480
-			print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=edit&token=' . newToken(), '', $permissiontoadd);
480
+			print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit&token='.newToken(), '', $permissiontoadd);
481 481
 
482
-			print dolGetButtonAction($langs->trans('ToClone'), '', 'default', $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=clone&token=' . newToken(), '', $permissiontoadd);
482
+			print dolGetButtonAction($langs->trans('ToClone'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=clone&token='.newToken(), '', $permissiontoadd);
483 483
 
484 484
 			// Delete (need delete permission, or if draft, just need create/modify permission)
485
-			print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=delete&token=' . newToken(), '', $permissiontodelete);
485
+			print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=delete&token='.newToken(), '', $permissiontodelete);
486 486
 		}
487
-		print '</div>' . "\n";
487
+		print '</div>'."\n";
488 488
 	}
489 489
 
490 490
 
@@ -502,12 +502,12 @@  discard block
 block discarded – undo
502 502
 		// Documents
503 503
 		if ($includedocgeneration) {
504 504
 			$objref = dol_sanitizeFileName($object->ref);
505
-			$relativepath = $objref . '/' . $objref . '.pdf';
506
-			$filedir = $conf->hrm->dir_output . '/' . $object->element . '/' . $objref;
507
-			$urlsource = $_SERVER["PHP_SELF"] . "?id=" . $object->id;
505
+			$relativepath = $objref.'/'.$objref.'.pdf';
506
+			$filedir = $conf->hrm->dir_output.'/'.$object->element.'/'.$objref;
507
+			$urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id;
508 508
 			$genallowed = $user->hasRight('hrm', 'job', 'read'); // If you can read, you can build the PDF to read content
509 509
 			$delallowed = $user->hasRight('hrm', 'job', 'write'); // If you can create/edit, you can remove a file on card
510
-			print $formfile->showdocuments('hrm:Job', $object->element . '/' . $objref, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 28, 0, '', '', '', $langs->defaultlang);
510
+			print $formfile->showdocuments('hrm:Job', $object->element.'/'.$objref, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 28, 0, '', '', '', $langs->defaultlang);
511 511
 		}
512 512
 
513 513
 		// Show links to link elements
@@ -522,9 +522,9 @@  discard block
 block discarded – undo
522 522
 		$morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', DOL_URL_ROOT.'/hrm/job_agenda.php?id='.$object->id);
523 523
 
524 524
 		// List of actions on element
525
-		include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
525
+		include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
526 526
 		$formactions = new FormActions($db);
527
-		$somethingshown = $formactions->showactions($object, $object->element . '@' . $object->module, (is_object($object->thirdparty) ? $object->thirdparty->id : 0), 1, '', $MAXEVENT, '', $morehtmlcenter);
527
+		$somethingshown = $formactions->showactions($object, $object->element.'@'.$object->module, (is_object($object->thirdparty) ? $object->thirdparty->id : 0), 1, '', $MAXEVENT, '', $morehtmlcenter);
528 528
 
529 529
 		print '</div></div>';
530 530
 	}
@@ -533,9 +533,9 @@  discard block
 block discarded – undo
533 533
 	$modelmail = 'job';
534 534
 	$defaulttopic = 'InformationMessage';
535 535
 	$diroutput = $conf->hrm->dir_output;
536
-	$trackid = 'job' . $object->id;
536
+	$trackid = 'job'.$object->id;
537 537
 
538
-	include DOL_DOCUMENT_ROOT . '/core/tpl/card_presend.tpl.php';
538
+	include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php';
539 539
 }
540 540
 
541 541
 // End of page
Please login to merge, or discard this patch.
htdocs/hrm/class/skill.class.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
 	/**
140 140
 	 * @var int|string
141 141
 	 */
142
-	public $date_validite;  // Note: misspelled!
142
+	public $date_validite; // Note: misspelled!
143 143
 	/**
144 144
 	 * @var float
145 145
 	 */
@@ -245,7 +245,7 @@  discard block
 block discarded – undo
245 245
 	 */
246 246
 	public function create(User $user, $notrigger = 0)
247 247
 	{
248
-		global $langs,$conf;
248
+		global $langs, $conf;
249 249
 
250 250
 		$resultcreate = $this->createCommon($user, $notrigger);
251 251
 
@@ -273,18 +273,18 @@  discard block
 block discarded – undo
273 273
 
274 274
 		$error = 0;
275 275
 
276
-		require_once __DIR__ . '/skilldet.class.php';
276
+		require_once __DIR__.'/skilldet.class.php';
277 277
 
278 278
 		$this->db->begin();
279 279
 
280 280
 		// Create level of skills
281 281
 		while ($i <= $MaxNumberSkill) {
282 282
 			$skilldet = new Skilldet($this->db);
283
-			$skilldet->description = $defaultSkillDesc . " " . $i;
283
+			$skilldet->description = $defaultSkillDesc." ".$i;
284 284
 			$skilldet->rankorder = $i;
285 285
 			$skilldet->fk_skill = $this->id;
286 286
 
287
-			$result =  $skilldet->create($user);
287
+			$result = $skilldet->create($user);
288 288
 			if ($result <= 0) {
289 289
 				$error++;
290 290
 			}
@@ -425,7 +425,7 @@  discard block
 block discarded – undo
425 425
 	public function fetchLines()
426 426
 	{
427 427
 		$this->lines = array();
428
-		require_once __DIR__ . '/skilldet.class.php';
428
+		require_once __DIR__.'/skilldet.class.php';
429 429
 		$skilldet = new Skilldet($this->db);
430 430
 		$this->lines = $skilldet->fetchAll('ASC', '', 0, 0, '(fk_skill:=:'.$this->id.')');
431 431
 
@@ -1011,7 +1011,7 @@  discard block
 block discarded – undo
1011 1011
 		if (getDolGlobalString('hrm_SKILL_ADDON')) {
1012 1012
 			$mybool = false;
1013 1013
 
1014
-			$file = getDolGlobalString('hrm_SKILL_ADDON') . ".php";
1014
+			$file = getDolGlobalString('hrm_SKILL_ADDON').".php";
1015 1015
 			$classname = getDolGlobalString('hrm_SKILL_ADDON');
1016 1016
 
1017 1017
 			// Include file with class
Please login to merge, or discard this patch.
htdocs/hrm/skill_card.php 1 patch
Spacing   +99 added lines, -99 removed lines patch added patch discarded remove patch
@@ -30,15 +30,15 @@  discard block
 block discarded – undo
30 30
 
31 31
 // Load Dolibarr environment
32 32
 require '../main.inc.php';
33
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formcompany.class.php';
34
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formfile.class.php';
35
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php';
36
-require_once DOL_DOCUMENT_ROOT . '/hrm/class/skill.class.php';
37
-require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_skill.lib.php';
33
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
34
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
35
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
36
+require_once DOL_DOCUMENT_ROOT.'/hrm/class/skill.class.php';
37
+require_once DOL_DOCUMENT_ROOT.'/hrm/lib/hrm_skill.lib.php';
38 38
 
39 39
 
40 40
 // Load translation files required by the page
41
-$langs->loadLangs(array('hrm', 'other', 'products'));  // why products?
41
+$langs->loadLangs(array('hrm', 'other', 'products')); // why products?
42 42
 
43 43
 // Get parameters
44 44
 $id = GETPOSTINT('id');
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'skillcard'; // To manage different context of search
50 50
 $backtopage = GETPOST('backtopage', 'alpha');
51 51
 $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha');
52
-$lineid   = GETPOSTINT('lineid');
52
+$lineid = GETPOSTINT('lineid');
53 53
 
54 54
 // Initialize a technical objects
55 55
 $object = new Skill($db);
@@ -67,8 +67,8 @@  discard block
 block discarded – undo
67 67
 $search_all = GETPOST("search_all", 'alpha');
68 68
 $search = array();
69 69
 foreach ($object->fields as $key => $val) {
70
-	if (GETPOST('search_' . $key, 'alpha')) {
71
-		$search[$key] = GETPOST('search_' . $key, 'alpha');
70
+	if (GETPOST('search_'.$key, 'alpha')) {
71
+		$search[$key] = GETPOST('search_'.$key, 'alpha');
72 72
 	}
73 73
 }
74 74
 
@@ -77,14 +77,14 @@  discard block
 block discarded – undo
77 77
 }
78 78
 
79 79
 // Load object
80
-include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'.
80
+include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'.
81 81
 
82 82
 // Permissions
83 83
 $permissiontoread   = $user->hasRight('hrm', 'all', 'read');
84 84
 $permissiontoadd    = $user->hasRight('hrm', 'all', 'write'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
85 85
 $permissiontodelete = $user->hasRight('hrm', 'all', 'delete');
86 86
 
87
-$upload_dir = $conf->hrm->multidir_output[isset($object->entity) ? $object->entity : 1] . '/skill';
87
+$upload_dir = $conf->hrm->multidir_output[isset($object->entity) ? $object->entity : 1].'/skill';
88 88
 
89 89
 // Security check (enable the most restrictive one)
90 90
 //if ($user->socid > 0) accessforbidden();
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
 			if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) {
122 122
 				$backtopage = $backurlforlist;
123 123
 			} else {
124
-				$backtopage = DOL_URL_ROOT.'/hrm/skill_card.php?id=' . ($id > 0 ? $id : '__ID__');
124
+				$backtopage = DOL_URL_ROOT.'/hrm/skill_card.php?id='.($id > 0 ? $id : '__ID__');
125 125
 			}
126 126
 		}
127 127
 	}
@@ -174,16 +174,16 @@  discard block
 block discarded – undo
174 174
 
175 175
 
176 176
 	// Actions when linking object each other
177
-	include DOL_DOCUMENT_ROOT . '/core/actions_dellink.inc.php';
177
+	include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php';
178 178
 
179 179
 	// Actions when printing a doc from card
180
-	include DOL_DOCUMENT_ROOT . '/core/actions_printing.inc.php';
180
+	include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
181 181
 
182 182
 	// Action to move up and down lines of object
183 183
 	//include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php';
184 184
 
185 185
 	// Action to build doc
186
-	include DOL_DOCUMENT_ROOT . '/core/actions_builddoc.inc.php';
186
+	include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
187 187
 
188 188
 	if ($action == 'set_thirdparty' && $permissiontoadd) {
189 189
 		$object->setValueFrom('fk_soc', GETPOSTINT('fk_soc'), '', null, 'date', '', $user, $triggermodname);
@@ -195,8 +195,8 @@  discard block
 block discarded – undo
195 195
 	// Actions to send emails
196 196
 	$triggersendname = 'HRM_SKILL_SENTBYMAIL';
197 197
 	$autocopy = 'MAIN_MAIL_AUTOCOPY_SKILL_TO';
198
-	$trackid = 'skill' . $object->id;
199
-	include DOL_DOCUMENT_ROOT . '/core/actions_sendmails.inc.php';
198
+	$trackid = 'skill'.$object->id;
199
+	include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
200 200
 
201 201
 	if ($action == 'confirm_clone' && $confirm != 'yes') {
202 202
 		$action = '';
@@ -225,25 +225,25 @@  discard block
 block discarded – undo
225 225
 
226 226
 // Part to create
227 227
 if ($action == 'create') {
228
-	print load_fiche_titre($langs->trans("NewSkill"), '', 'object_' . $object->picto);
228
+	print load_fiche_titre($langs->trans("NewSkill"), '', 'object_'.$object->picto);
229 229
 
230
-	print '<form method="POST" action="' . $_SERVER["PHP_SELF"] . '">';
231
-	print '<input type="hidden" name="token" value="' . newToken() . '">';
230
+	print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
231
+	print '<input type="hidden" name="token" value="'.newToken().'">';
232 232
 	print '<input type="hidden" name="action" value="add">';
233
-	$backtopage .= (strpos($backtopage, '?') > 0 ? '&' : '?') ."objecttype=job";
233
+	$backtopage .= (strpos($backtopage, '?') > 0 ? '&' : '?')."objecttype=job";
234 234
 	if ($backtopage) {
235
-		print '<input type="hidden" name="backtopage" value="' . $backtopage . '">';
235
+		print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
236 236
 	}
237 237
 	if ($backtopageforcancel) {
238
-		print '<input type="hidden" name="backtopageforcancel" value="' . $backtopageforcancel . '">';
238
+		print '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">';
239 239
 	}
240 240
 
241 241
 	print dol_get_fiche_head(array(), '');
242 242
 
243
-	print '<table class="border centpercent tableforfieldcreate">' . "\n";
243
+	print '<table class="border centpercent tableforfieldcreate">'."\n";
244 244
 
245 245
 	// Common attributes
246
-	include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_add.tpl.php';
246
+	include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_add.tpl.php';
247 247
 
248 248
 	// Other attributes
249 249
 	include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php';
@@ -253,12 +253,12 @@  discard block
 block discarded – undo
253 253
 	//@todo je stop ici ... à continuer  (affichage des 5 skilled input pour create action
254 254
 	//print $object->showInputField($val, $key, $value, '', '['']', '', 0);
255 255
 
256
-	print '</table>' . "\n";
256
+	print '</table>'."\n";
257 257
 	print '<hr>';
258 258
 
259
-	print '<table class="border centpercent =">' . "\n";
259
+	print '<table class="border centpercent =">'."\n";
260 260
 	for ($i = 1; $i <= $MaxNumberSkill; $i++) {
261
-		print '<tr><td class="titlefieldcreate tdtop">'. $langs->trans('Description') . ' ' . $langs->trans('rank') . ' ' . $i . '</td>';
261
+		print '<tr><td class="titlefieldcreate tdtop">'.$langs->trans('Description').' '.$langs->trans('rank').' '.$i.'</td>';
262 262
 		print '<td class="valuefieldcreate"><textarea name="descriptionline[]" rows="5"  class="flat minwidth100" style="margin-top: 5px; width: 90%"></textarea></td>';
263 263
 	}
264 264
 	print '</table>';
@@ -266,9 +266,9 @@  discard block
 block discarded – undo
266 266
 	print dol_get_fiche_end();
267 267
 
268 268
 	print '<div class="center">';
269
-	print '<input type="submit" class="button" name="add" value="' . dol_escape_htmltag($langs->trans("Create")) . '">';
269
+	print '<input type="submit" class="button" name="add" value="'.dol_escape_htmltag($langs->trans("Create")).'">';
270 270
 	print '&nbsp; ';
271
-	print '<input type="' . ($backtopage ? "submit" : "button") . '" class="button button-cancel" name="cancel" value="' . dol_escape_htmltag($langs->trans("Cancel")) . '"' . ($backtopage ? '' : ' onclick="history.go(-1)"') . '>';
271
+	print '<input type="'.($backtopage ? "submit" : "button").'" class="button button-cancel" name="cancel" value="'.dol_escape_htmltag($langs->trans("Cancel")).'"'.($backtopage ? '' : ' onclick="history.go(-1)"').'>';
272 272
 	print '</div>';
273 273
 
274 274
 	print '</form>';
@@ -279,25 +279,25 @@  discard block
 block discarded – undo
279 279
 // Part to edit record
280 280
 // and skilldet edition
281 281
 if (($id || $ref) && $action == 'edit') {
282
-	print load_fiche_titre($langs->trans("Skill"), '', 'object_' . $object->picto);
282
+	print load_fiche_titre($langs->trans("Skill"), '', 'object_'.$object->picto);
283 283
 
284
-	print '<form method="POST" action="' . $_SERVER["PHP_SELF"] . '">';
285
-	print '<input type="hidden" name="token" value="' . newToken() . '">';
284
+	print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
285
+	print '<input type="hidden" name="token" value="'.newToken().'">';
286 286
 	print '<input type="hidden" name="action" value="update">';
287
-	print '<input type="hidden" name="id" value="' . $object->id . '">';
287
+	print '<input type="hidden" name="id" value="'.$object->id.'">';
288 288
 	if ($backtopage) {
289
-		print '<input type="hidden" name="backtopage" value="' . $backtopage . '">';
289
+		print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
290 290
 	}
291 291
 	if ($backtopageforcancel) {
292
-		print '<input type="hidden" name="backtopageforcancel" value="' . $backtopageforcancel . '">';
292
+		print '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">';
293 293
 	}
294 294
 
295 295
 	print dol_get_fiche_head();
296 296
 
297
-	print '<table class="border centpercent tableforfieldedit">' . "\n";
297
+	print '<table class="border centpercent tableforfieldedit">'."\n";
298 298
 
299 299
 	// Common attributes
300
-	include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_edit.tpl.php';
300
+	include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_edit.tpl.php';
301 301
 
302 302
 	// Other attributes
303 303
 	include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_edit.tpl.php';
@@ -321,7 +321,7 @@  discard block
 block discarded – undo
321 321
 				continue;
322 322
 			}
323 323
 
324
-			print '<table class="border centpercent =">' . "\n";
324
+			print '<table class="border centpercent =">'."\n";
325 325
 			$sk->fields = dol_sort_array($sk->fields, 'position');
326 326
 			foreach ($sk->fields as $key => $val) {
327 327
 				if (abs($val['visible']) != 1 && abs($val['visible']) != 3 && abs($val['visible']) != 4) {
@@ -332,7 +332,7 @@  discard block
 block discarded – undo
332 332
 					continue; // We don't want this field
333 333
 				}
334 334
 
335
-				print '<tr class="field_' . $key . '"><td';
335
+				print '<tr class="field_'.$key.'"><td';
336 336
 				print ' class="titlefieldcreate';
337 337
 				if (isset($val['notnull']) && $val['notnull'] > 0) {
338 338
 					print ' fieldrequired';
@@ -380,7 +380,7 @@  discard block
 block discarded – undo
380 380
 					print $sk->showOutputField($val, $key, $value, '', '', '', 0);
381 381
 				} else {
382 382
 					/** @var Skilldet $sk */
383
-					print $sk->showInputField($val, $key, $value, "", "line[" . $sk->id . "]", "", "");
383
+					print $sk->showInputField($val, $key, $value, "", "line[".$sk->id."]", "", "");
384 384
 				}
385 385
 				print '</td>';
386 386
 				print '</tr>';
@@ -392,8 +392,8 @@  discard block
 block discarded – undo
392 392
 
393 393
 	print dol_get_fiche_end();
394 394
 
395
-	print '<div class="center"><input type="submit" class="button button-save" name="save" value="' . $langs->trans("Save") . '">';
396
-	print ' &nbsp; <input type="submit" class="button button-cancel" name="cancel" value="' . $langs->trans("Cancel") . '">';
395
+	print '<div class="center"><input type="submit" class="button button-save" name="save" value="'.$langs->trans("Save").'">';
396
+	print ' &nbsp; <input type="submit" class="button button-cancel" name="cancel" value="'.$langs->trans("Cancel").'">';
397 397
 	print '</div>';
398 398
 
399 399
 	print '</form>';
@@ -411,11 +411,11 @@  discard block
 block discarded – undo
411 411
 
412 412
 	// Confirmation to delete
413 413
 	if ($action == 'delete') {
414
-		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('DeleteSkill'), $langs->trans('ConfirmDeleteObject'), 'confirm_delete', '', 0, 1);
414
+		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteSkill'), $langs->trans('ConfirmDeleteObject'), 'confirm_delete', '', 0, 1);
415 415
 	}
416 416
 	// Confirmation to delete line
417 417
 	if ($action == 'deleteline') {
418
-		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id . '&lineid=' . $lineid, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_deleteline', '', 0, 1);
418
+		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_deleteline', '', 0, 1);
419 419
 	}
420 420
 	// Confirmation clone
421 421
 	if ($action === 'clone') {
@@ -438,7 +438,7 @@  discard block
 block discarded – undo
438 438
 			// array('type' => 'other',    'name' => 'idwarehouse',   'label' => $langs->trans("SelectWarehouseForStockDecrease"), 'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse')?GETPOST('idwarehouse'):'ifone', 'idwarehouse', '', 1, 0, 0, '', 0, $forcecombo))
439 439
 		);
440 440
 		*/
441
-		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('XXX'), $text, 'confirm_xxx', $formquestion, 0, 1, 220);
441
+		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('XXX'), $text, 'confirm_xxx', $formquestion, 0, 1, 220);
442 442
 	}
443 443
 
444 444
 	// Call Hook formConfirm
@@ -456,7 +456,7 @@  discard block
 block discarded – undo
456 456
 
457 457
 	// Object card
458 458
 	// ------------------------------------------------------------
459
-	$linkback = '<a href="' . DOL_URL_ROOT.'/hrm/skill_list.php?restore_lastsearch_values=1' . (!empty($socid) ? '&socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';
459
+	$linkback = '<a href="'.DOL_URL_ROOT.'/hrm/skill_list.php?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>';
460 460
 
461 461
 
462 462
 	$morehtmlref = '<div class="refid">';
@@ -468,10 +468,10 @@  discard block
 block discarded – undo
468 468
 	print '<div class="fichecenter">';
469 469
 	print '<div class="fichehalfleft">';
470 470
 	print '<div class="underbanner clearboth"></div>';
471
-	print '<table class="border centpercent tableforfield">' . "\n";
471
+	print '<table class="border centpercent tableforfield">'."\n";
472 472
 
473 473
 	$object->fields['label']['visible'] = 0; // Already in banner
474
-	include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_view.tpl.php';
474
+	include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php';
475 475
 
476 476
 	// Other attributes. Fields from hook formObjectOptions and Extrafields.
477 477
 	include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
@@ -491,7 +491,7 @@  discard block
 block discarded – undo
491 491
 	// Buttons for actions
492 492
 
493 493
 	if ($action != 'presend' && $action != 'editline') {
494
-		print '<div class="tabsAction">' . "\n";
494
+		print '<div class="tabsAction">'."\n";
495 495
 		$parameters = array();
496 496
 		$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
497 497
 		if ($reshook < 0) {
@@ -501,19 +501,19 @@  discard block
 block discarded – undo
501 501
 		if (empty($reshook)) {
502 502
 			// Back to draft
503 503
 			if ($object->status == $object::STATUS_VALIDATED) {
504
-				print dolGetButtonAction($langs->trans('SetToDraft'), '', 'default', $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=confirm_setdraft&confirm=yes&token=' . newToken(), '', $permissiontoadd);
504
+				print dolGetButtonAction($langs->trans('SetToDraft'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=confirm_setdraft&confirm=yes&token='.newToken(), '', $permissiontoadd);
505 505
 			}
506 506
 
507
-			print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=edit&token=' . newToken(), '', $permissiontoadd);
507
+			print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit&token='.newToken(), '', $permissiontoadd);
508 508
 
509 509
 			// Clone
510 510
 			if ($permissiontoadd) {
511 511
 				print dolGetButtonAction('', $langs->trans('ToClone'), 'default', $_SERVER["PHP_SELF"].'?action=clone&token='.newToken().'&id='.$object->id, '');
512 512
 			}
513 513
 			// Delete (need delete permission, or if draft, just need create/modify permission)
514
-			print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=delete&token=' . newToken(), '', $permissiontodelete);
514
+			print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=delete&token='.newToken(), '', $permissiontodelete);
515 515
 		}
516
-		print '</div>' . "\n";
516
+		print '</div>'."\n";
517 517
 	}
518 518
 }
519 519
 
@@ -521,12 +521,12 @@  discard block
 block discarded – undo
521 521
 //*---------------------------------------------------------------------------
522 522
 
523 523
 if ($action != "create" && $action != "edit") {
524
-	require_once DOL_DOCUMENT_ROOT . '/core/class/html.formcompany.class.php';
525
-	require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
526
-	require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php';
524
+	require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
525
+	require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
526
+	require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
527 527
 
528 528
 	// load hrm libraries
529
-	require_once __DIR__ . '/class/skilldet.class.php';
529
+	require_once __DIR__.'/class/skilldet.class.php';
530 530
 
531 531
 	// for other modules
532 532
 	//dol_include_once('/othermodule/class/otherobject.class.php');
@@ -563,8 +563,8 @@  discard block
 block discarded – undo
563 563
 
564 564
 	// Default sort order (if not yet defined by previous GETPOST)
565 565
 	if (!$sortfield) {
566
-		reset($objectline->fields);                    // Reset is required to avoid key() to return null.
567
-		$sortfield = "t." . key($objectline->fields); // Set here default search field. By default 1st field in definition.
566
+		reset($objectline->fields); // Reset is required to avoid key() to return null.
567
+		$sortfield = "t.".key($objectline->fields); // Set here default search field. By default 1st field in definition.
568 568
 	}
569 569
 	if (!$sortorder) {
570 570
 		$sortorder = "ASC";
@@ -574,12 +574,12 @@  discard block
 block discarded – undo
574 574
 	$search_all = GETPOST('search_all', 'alphanohtml') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml');
575 575
 	$search = array();
576 576
 	foreach ($objectline->fields as $key => $val) {
577
-		if (GETPOST('search_' . $key, 'alpha') !== '') {
578
-			$search[$key] = GETPOST('search_' . $key, 'alpha');
577
+		if (GETPOST('search_'.$key, 'alpha') !== '') {
578
+			$search[$key] = GETPOST('search_'.$key, 'alpha');
579 579
 		}
580 580
 		if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) {
581
-			$search[$key . '_dtstart'] = dol_mktime(0, 0, 0, GETPOSTINT('search_' . $key . '_dtstartmonth'), GETPOSTINT('search_' . $key . '_dtstartday'), GETPOSTINT('search_' . $key . '_dtstartyear'));
582
-			$search[$key . '_dtend'] = dol_mktime(23, 59, 59, GETPOSTINT('search_' . $key . '_dtendmonth'), GETPOSTINT('search_' . $key . '_dtendday'), GETPOSTINT('search_' . $key . '_dtendyear'));
581
+			$search[$key.'_dtstart'] = dol_mktime(0, 0, 0, GETPOSTINT('search_'.$key.'_dtstartmonth'), GETPOSTINT('search_'.$key.'_dtstartday'), GETPOSTINT('search_'.$key.'_dtstartyear'));
582
+			$search[$key.'_dtend'] = dol_mktime(23, 59, 59, GETPOSTINT('search_'.$key.'_dtendmonth'), GETPOSTINT('search_'.$key.'_dtendday'), GETPOSTINT('search_'.$key.'_dtendyear'));
583 583
 		}
584 584
 	}
585 585
 
@@ -587,7 +587,7 @@  discard block
 block discarded – undo
587 587
 	$fieldstosearchall = array();
588 588
 	foreach ($objectline->fields as $key => $val) {
589 589
 		if (!empty($val['searchall'])) {
590
-			$fieldstosearchall['t.' . $key] = $val['label'];
590
+			$fieldstosearchall['t.'.$key] = $val['label'];
591 591
 		}
592 592
 	}
593 593
 
@@ -597,7 +597,7 @@  discard block
 block discarded – undo
597 597
 		// If $val['visible']==0, then we never show the field
598 598
 		if (!empty($val['visible'])) {
599 599
 			$visible = (int) dol_eval((string) $val['visible'], 1, 1, '1');
600
-			$arrayfields['t.' . $key] = array(
600
+			$arrayfields['t.'.$key] = array(
601 601
 				'label' => $val['label'],
602 602
 				'checked' => (($visible < 0) ? 0 : 1),
603 603
 				'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)),
@@ -627,9 +627,9 @@  discard block
 block discarded – undo
627 627
 	// --------------------------------------------------------------------
628 628
 	$sql = 'SELECT ';
629 629
 	$sql .= $objectline->getFieldList('t');
630
-	$sql .= " FROM " . MAIN_DB_PREFIX . $objectline->table_element . " as t";
630
+	$sql .= " FROM ".MAIN_DB_PREFIX.$objectline->table_element." as t";
631 631
 	if ($objectline->ismultientitymanaged == 1) {
632
-		$sql .= " WHERE t.entity IN (" . getEntity($objectline->element) . ")";
632
+		$sql .= " WHERE t.entity IN (".getEntity($objectline->element).")";
633 633
 	} else {
634 634
 		$sql .= " WHERE 1 = 1 ";
635 635
 	}
@@ -639,41 +639,41 @@  discard block
 block discarded – undo
639 639
 	$nbtotalofrecords = $db->num_rows($resql);
640 640
 	$num = $db->num_rows($resql);
641 641
 
642
-	print '<form method="POST" id="searchFormList" action="' . $_SERVER["PHP_SELF"] . '">' . "\n";
642
+	print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">'."\n";
643 643
 	if ($optioncss != '') {
644
-		print '<input type="hidden" name="optioncss" value="' . $optioncss . '">';
644
+		print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
645 645
 	}
646
-	print '<input type="hidden" name="token" value="' . newToken() . '">';
646
+	print '<input type="hidden" name="token" value="'.newToken().'">';
647 647
 	print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
648 648
 	print '<input type="hidden" name="action" value="list">';
649
-	print '<input type="hidden" name="sortfield" value="' . $sortfield . '">';
650
-	print '<input type="hidden" name="sortorder" value="' . $sortorder . '">';
651
-	print '<input type="hidden" name="page" value="' . $page . '">';
652
-	print '<input type="hidden" name="contextpage" value="' . $contextpage . '">';
649
+	print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
650
+	print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
651
+	print '<input type="hidden" name="page" value="'.$page.'">';
652
+	print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
653 653
 	if (!empty($id)) {
654
-		print '<input type="hidden" name="id" value="' . $id . '">';
654
+		print '<input type="hidden" name="id" value="'.$id.'">';
655 655
 	}
656 656
 
657
-	$param_fk = "&fk_skill=" . $id . "&fk_user_creat=" . (!empty($user->rowid) ? $user->rowid : 0);
658
-	$backtopage = dol_buildpath('/hrm/skill_card.php', 1) . '?id=' . $id;
657
+	$param_fk = "&fk_skill=".$id."&fk_user_creat=".(!empty($user->rowid) ? $user->rowid : 0);
658
+	$backtopage = dol_buildpath('/hrm/skill_card.php', 1).'?id='.$id;
659 659
 	$param = "";
660 660
 	$massactionbutton = "";
661 661
 	//$newcardbutton = dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', dol_buildpath('/hrm/skilldet_card.php', 1) . '?action=create&backtopage=' . urlencode($_SERVER['PHP_SELF']) . $param_fk . '&backtopage=' . $backtopage, '', $permissiontoadd);
662 662
 
663
-	print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'object_' . $object->picto, 0, '', '', 0, 0, 0, 1);
663
+	print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'object_'.$object->picto, 0, '', '', 0, 0, 0, 1);
664 664
 
665 665
 	// Add code for pre mass action (confirmation or email presend form)
666 666
 	$topicmail = "SendSkilldetRef";
667 667
 	$modelmail = "skilldet";
668 668
 	$objecttmp = new Skilldet($db);
669
-	$trackid = 'xxxx' . $object->id;
669
+	$trackid = 'xxxx'.$object->id;
670 670
 	//include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php';
671 671
 
672 672
 	if ($search_all) {
673 673
 		foreach ($fieldstosearchall as $key => $val) {
674 674
 			$fieldstosearchall[$key] = $langs->trans($val);
675 675
 		}
676
-		print '<div class="divsearchfieldfilter">' . $langs->trans("FilterOnInto", $search_all) . implode(', ', $fieldstosearchall) . '</div>';
676
+		print '<div class="divsearchfieldfilter">'.$langs->trans("FilterOnInto", $search_all).implode(', ', $fieldstosearchall).'</div>';
677 677
 	}
678 678
 
679 679
 	$moreforfilter = '';
@@ -700,7 +700,7 @@  discard block
 block discarded – undo
700 700
 	//  $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
701 701
 
702 702
 	print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you don't need reserved height for your table
703
-	print '<table class="tagtable nobottomiftotal liste' . ($moreforfilter ? " listwithfilterbefore" : "") . '">' . "\n";
703
+	print '<table class="tagtable nobottomiftotal liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
704 704
 
705 705
 
706 706
 	// Fields title label
@@ -717,13 +717,13 @@  discard block
 block discarded – undo
717 717
 		//      } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) {
718 718
 		//          $cssforfield .= ($cssforfield ? ' ' : '') . 'right';
719 719
 		//      }
720
-		if (!empty($arrayfields['t.' . $key]['checked'])) {
721
-			print getTitleFieldOfList($arrayfields['t.' . $key]['label'], 0, $_SERVER['PHP_SELF'], 't.' . $key, '', $param, (!empty($cssforfield) ? 'class="' . $cssforfield . '"' : ''), $sortfield, $sortorder, (!empty($cssforfield) ? $cssforfield . ' ' : '')) . "\n";
720
+		if (!empty($arrayfields['t.'.$key]['checked'])) {
721
+			print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, (!empty($cssforfield) ? 'class="'.$cssforfield.'"' : ''), $sortfield, $sortorder, (!empty($cssforfield) ? $cssforfield.' ' : ''))."\n";
722 722
 		}
723 723
 	}
724 724
 	//print '<td></td>';
725 725
 	print '<td></td>';
726
-	print '</tr>' . "\n";
726
+	print '</tr>'."\n";
727 727
 
728 728
 
729 729
 	// Display all ranks of skill
@@ -766,14 +766,14 @@  discard block
 block discarded – undo
766 766
 			//          }
767 767
 			//if (in_array($key, array('fk_soc', 'fk_user', 'fk_warehouse'))) $cssforfield = 'tdoverflowmax100';
768 768
 
769
-			if (!empty($arrayfields['t.' . $key]['checked'])) {
770
-				print '<td' . (empty($cssforfield) ? '' : ' class="' . $cssforfield . '"') . '>';
769
+			if (!empty($arrayfields['t.'.$key]['checked'])) {
770
+				print '<td'.(empty($cssforfield) ? '' : ' class="'.$cssforfield.'"').'>';
771 771
 				if ($key == 'status') {
772 772
 					print $objectline->getLibStatut(5);
773 773
 				} elseif ($key == 'rowid') {
774 774
 					print $objectline->showOutputField($val, $key, $objectline->id, '');
775 775
 					// ajout pencil
776
-					print '<a class="timeline-btn" href="' . DOL_MAIN_URL_ROOT . '/comm/action/skilldet_card.php?action=edit&id=' . $objectline->id . '"><i class="fa fa-pencil" title="' . $langs->trans("Modify") . '" ></i></a>';
776
+					print '<a class="timeline-btn" href="'.DOL_MAIN_URL_ROOT.'/comm/action/skilldet_card.php?action=edit&id='.$objectline->id.'"><i class="fa fa-pencil" title="'.$langs->trans("Modify").'" ></i></a>';
777 777
 				} else {
778 778
 					print $objectline->showOutputField($val, $key, $objectline->$key, '');
779 779
 				}
@@ -785,15 +785,15 @@  discard block
 block discarded – undo
785 785
 				}
786 786
 				if (!empty($val['isameasure']) && $val['isameasure'] == 1) {
787 787
 					if (!$i) {
788
-						$totalarray['pos'][$totalarray['nbfield']] = 't.' . $key;
788
+						$totalarray['pos'][$totalarray['nbfield']] = 't.'.$key;
789 789
 					}
790 790
 					if (!isset($totalarray['val'])) {
791 791
 						$totalarray['val'] = array();
792 792
 					}
793
-					if (!isset($totalarray['val']['t.' . $key])) {
794
-						$totalarray['val']['t.' . $key] = 0;
793
+					if (!isset($totalarray['val']['t.'.$key])) {
794
+						$totalarray['val']['t.'.$key] = 0;
795 795
 					}
796
-					$totalarray['val']['t.' . $key] += $objectline->$key;
796
+					$totalarray['val']['t.'.$key] += $objectline->$key;
797 797
 				}
798 798
 			}
799 799
 		}
@@ -826,7 +826,7 @@  discard block
 block discarded – undo
826 826
 			$totalarray['nbfield']++;
827 827
 		}
828 828
 
829
-		print '</tr>' . "\n";
829
+		print '</tr>'."\n";
830 830
 
831 831
 		$i++;
832 832
 	}
@@ -841,7 +841,7 @@  discard block
 block discarded – undo
841 841
 				$colspan++;
842 842
 			}
843 843
 		}
844
-		print '<tr><td colspan="' . $colspan . '"><span class="opacitymedium">' . $langs->trans("NoRecordFound") . '</span></td></tr>';
844
+		print '<tr><td colspan="'.$colspan.'"><span class="opacitymedium">'.$langs->trans("NoRecordFound").'</span></td></tr>';
845 845
 	}
846 846
 
847 847
 	if (!empty($resql)) {
@@ -852,10 +852,10 @@  discard block
 block discarded – undo
852 852
 	$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $objectline); // Note that $action and $objectline may have been modified by hook
853 853
 	print $hookmanager->resPrint;
854 854
 
855
-	print '</table>' . "\n";
856
-	print '</div>' . "\n";
855
+	print '</table>'."\n";
856
+	print '</div>'."\n";
857 857
 
858
-	print '</form>' . "\n";
858
+	print '</form>'."\n";
859 859
 
860 860
 	//  if (in_array('builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords === '' || $nbtotalofrecords)) {
861 861
 	//      $hidegeneratedfilelistifempty = 1;
@@ -890,9 +890,9 @@  discard block
 block discarded – undo
890 890
 	$morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', DOL_URL_ROOT.'/hrm/skill_agenda.php?id='.$object->id);
891 891
 
892 892
 	// List of actions on element
893
-	include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
893
+	include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
894 894
 	$formactions = new FormActions($db);
895
-	$somethingshown = $formactions->showactions($object, $object->element . '@' . $object->module, (is_object($object->thirdparty) ? $object->thirdparty->id : 0), 1, '', $MAXEVENT, '', $morehtmlcenter);
895
+	$somethingshown = $formactions->showactions($object, $object->element.'@'.$object->module, (is_object($object->thirdparty) ? $object->thirdparty->id : 0), 1, '', $MAXEVENT, '', $morehtmlcenter);
896 896
 
897 897
 	print '</div></div>';
898 898
 }
Please login to merge, or discard this patch.
htdocs/hrm/skill_tab.php 1 patch
Spacing   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -32,15 +32,15 @@  discard block
 block discarded – undo
32 32
 // Load Dolibarr environment
33 33
 require '../main.inc.php';
34 34
 
35
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formcompany.class.php';
36
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formfile.class.php';
37
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php';
38
-require_once DOL_DOCUMENT_ROOT . '/user/class/user.class.php';
39
-require_once DOL_DOCUMENT_ROOT . '/hrm/class/job.class.php';
40
-require_once DOL_DOCUMENT_ROOT . '/hrm/class/skill.class.php';
41
-require_once DOL_DOCUMENT_ROOT . '/hrm/class/skillrank.class.php';
42
-require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_skill.lib.php';
43
-require_once DOL_DOCUMENT_ROOT .'/hrm/class/evaluation.class.php';
35
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
36
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
37
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
38
+require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
39
+require_once DOL_DOCUMENT_ROOT.'/hrm/class/job.class.php';
40
+require_once DOL_DOCUMENT_ROOT.'/hrm/class/skill.class.php';
41
+require_once DOL_DOCUMENT_ROOT.'/hrm/class/skillrank.class.php';
42
+require_once DOL_DOCUMENT_ROOT.'/hrm/lib/hrm_skill.lib.php';
43
+require_once DOL_DOCUMENT_ROOT.'/hrm/class/evaluation.class.php';
44 44
 require_once DOL_DOCUMENT_ROOT.'/hrm/lib/hrm_evaluation.lib.php';
45 45
 
46 46
 // Load translation files required by the page
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
 $hookmanager->initHooks(array('skilltab', 'globalcard')); // Note that conf->hooks_modules contains array
82 82
 
83 83
 // Load object
84
-include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'.
84
+include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'.
85 85
 if (method_exists($object, 'loadPersonalConf')) {
86 86
 	$object->loadPersonalConf();
87 87
 }
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
 			if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) {
123 123
 				$backtopage = $backurlforlist;
124 124
 			} else {
125
-				$backtopage = DOL_URL_ROOT.'/hrm/skill_list.php?id=' . ($id > 0 ? $id : '__ID__');
125
+				$backtopage = DOL_URL_ROOT.'/hrm/skill_list.php?id='.($id > 0 ? $id : '__ID__');
126 126
 			}
127 127
 		}
128 128
 	}
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
 				}
175 175
 			}
176 176
 			setEventMessages($langs->trans("SaveLevelSkill"), null);
177
-			header("Location: " . DOL_URL_ROOT.'/hrm/skill_tab.php?id=' . $id. '&objecttype=job');
177
+			header("Location: ".DOL_URL_ROOT.'/hrm/skill_tab.php?id='.$id.'&objecttype=job');
178 178
 			exit;
179 179
 		}
180 180
 	} elseif ($action == 'confirm_deleteskill' && $confirm == 'yes' && $permissiontoadd) {
@@ -207,11 +207,11 @@  discard block
 block discarded – undo
207 207
 
208 208
 	// view configuration
209 209
 	if ($objecttype == 'job') {
210
-		require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_job.lib.php';
210
+		require_once DOL_DOCUMENT_ROOT.'/hrm/lib/hrm_job.lib.php';
211 211
 		$head = jobPrepareHead($object);
212 212
 		$listLink = dol_buildpath('/hrm/job_list.php', 1);
213 213
 	} elseif ($objecttype == "user") {
214
-		require_once DOL_DOCUMENT_ROOT . "/core/lib/usergroups.lib.php";
214
+		require_once DOL_DOCUMENT_ROOT."/core/lib/usergroups.lib.php";
215 215
 		$object->getRights();
216 216
 		$head = user_prepare_head($object);
217 217
 		$listLink = dol_buildpath('/user/list.php', 1);
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
 	// Confirmation to delete
225 225
 	// Confirmation to delete line
226 226
 	if ($action == 'ask_deleteskill') {
227
-		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id . '&objecttype=' . $objecttype . '&lineid=' . $lineid, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_deleteskill', '', 0, 1);
227
+		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&objecttype='.$objecttype.'&lineid='.$lineid, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_deleteskill', '', 0, 1);
228 228
 	}
229 229
 	// Clone confirmation
230 230
 	/*if ($action == 'clone' && $permissiontoadd) {
@@ -249,7 +249,7 @@  discard block
 block discarded – undo
249 249
 	// Object card
250 250
 	// ------------------------------------------------------------
251 251
 	if ($objecttype == 'job') {
252
-		$linkback = '<a href="' . dol_buildpath('/hrm/job_list.php', 1) . '?restore_lastsearch_values=1' . (!empty($socid) ? '&socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';
252
+		$linkback = '<a href="'.dol_buildpath('/hrm/job_list.php', 1).'?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>';
253 253
 
254 254
 		$morehtmlref = '<div class="refid">';
255 255
 		$morehtmlref .= $object->label;
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
 
258 258
 		dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'rowid', $morehtmlref);
259 259
 	} elseif ($listLink !== null) {
260
-		$linkback = '<a href="' . $listLink . '?restore_lastsearch_values=1' . (!empty($socid) ? '&socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';
260
+		$linkback = '<a href="'.$listLink.'?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>';
261 261
 
262 262
 		$morehtmlref = '<a href="'.DOL_URL_ROOT.'/user/vcard.php?id='.$object->id.'&output=file&file='.urlencode(dol_sanitizeFileName($object->getFullName($langs).'.vcf')).'" class="refid" rel="noopener">';
263 263
 		$morehtmlref .= img_picto($langs->trans("Download").' '.$langs->trans("VCard"), 'vcard.png', 'class="valignmiddle marginleftonly paddingrightonly"');
@@ -314,10 +314,10 @@  discard block
 block discarded – undo
314 314
 		//unset($object->fields['fk_project']);				// Hide field already shown in banner
315 315
 		//unset($object->fields['fk_soc']);					// Hide field already shown in banner
316 316
 		$object->fields['label']['visible'] = 0; // Already in banner
317
-		include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_view.tpl.php';
317
+		include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php';
318 318
 
319 319
 		// Other attributes. Fields from hook formObjectOptions and Extrafields.
320
-		include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
320
+		include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
321 321
 	} else {
322 322
 		// Login
323 323
 		print '<tr><td class="titlefield">'.$langs->trans("Login").'</td>';
@@ -383,19 +383,19 @@  discard block
 block discarded – undo
383 383
 	if ($objecttype != 'user' && $permissiontoadd) {
384 384
 		// form to add new skills
385 385
 		print '<br>';
386
-		print '<form name="addSkill" method="post" action="' . $_SERVER['PHP_SELF'] . '">';
387
-		print '<input type="hidden" name="objecttype" value="' . $objecttype . '">';
388
-		print '<input type="hidden" name="id" value="' . $id . '">';
386
+		print '<form name="addSkill" method="post" action="'.$_SERVER['PHP_SELF'].'">';
387
+		print '<input type="hidden" name="objecttype" value="'.$objecttype.'">';
388
+		print '<input type="hidden" name="id" value="'.$id.'">';
389 389
 		print '<input type="hidden" name="action" value="addSkill">';
390 390
 		print '<input type="hidden" name="token" value="'.newToken().'">';
391 391
 		print '<div class="div-table-responsive-no-min">';
392 392
 		print '<table id="tablelines" class="noborder noshadow" width="100%">';
393
-		print '<tr><td style="width:90%">' . $langs->trans('AddSkill') . '</td><td style="width:10%"></td></tr>';
393
+		print '<tr><td style="width:90%">'.$langs->trans('AddSkill').'</td><td style="width:10%"></td></tr>';
394 394
 		print '<tr>';
395 395
 		print '<td>';
396 396
 		print img_picto('', 'shapes', 'class="pictofixedwidth"');
397
-		print $form->multiselectarray('fk_skill', array_diff_key($TAllSkillsFormatted, $TAlreadyUsedSkill), array(), 0, 0, 'widthcentpercentminusx') . '</td>';
398
-		print '<td><input class="button reposition" type="submit" value="' . $langs->trans('Add') . '"></td>';
397
+		print $form->multiselectarray('fk_skill', array_diff_key($TAllSkillsFormatted, $TAlreadyUsedSkill), array(), 0, 0, 'widthcentpercentminusx').'</td>';
398
+		print '<td><input class="button reposition" type="submit" value="'.$langs->trans('Add').'"></td>';
399 399
 		print '</tr>';
400 400
 		print '</table>';
401 401
 		print '</div>';
@@ -406,9 +406,9 @@  discard block
 block discarded – undo
406 406
 	print '<div class="clearboth"></div>';
407 407
 
408 408
 	if ($objecttype != 'user' && $permissiontoadd) {
409
-		print '<form name="saveSkill" method="post" action="' . $_SERVER['PHP_SELF'] . '">';
410
-		print '<input type="hidden" name="objecttype" value="' . $objecttype . '">';
411
-		print '<input type="hidden" name="id" value="' . $id . '">';
409
+		print '<form name="saveSkill" method="post" action="'.$_SERVER['PHP_SELF'].'">';
410
+		print '<input type="hidden" name="objecttype" value="'.$objecttype.'">';
411
+		print '<input type="hidden" name="id" value="'.$id.'">';
412 412
 		print '<input type="hidden" name="token" value="'.newToken().'">';
413 413
 		print '<input type="hidden" name="action" value="saveSkill">';
414 414
 	}
@@ -426,7 +426,7 @@  discard block
 block discarded – undo
426 426
 		}
427 427
 		print '</tr>';
428 428
 		if (!is_array($TSkillsJob) || empty($TSkillsJob)) {
429
-			print '<tr><td><span class="opacitymedium">' . $langs->trans("NoRecordFound") . '</span></td></tr>';
429
+			print '<tr><td><span class="opacitymedium">'.$langs->trans("NoRecordFound").'</span></td></tr>';
430 430
 		} else {
431 431
 			$sk = new Skill($db);
432 432
 			foreach ($TSkillsJob as $skillElement) {
@@ -445,7 +445,7 @@  discard block
 block discarded – undo
445 445
 				if ($objecttype != 'user' && $permissiontoadd) {
446 446
 					print '<td class="linecoledit"></td>';
447 447
 					print '<td class="linecoldelete">';
448
-					print '<a class="reposition" href="' . $_SERVER["PHP_SELF"] . '?id=' . $skillElement->fk_object . '&amp;objecttype=' . $objecttype . '&amp;action=ask_deleteskill&amp;lineid=' . $skillElement->rowid . '">';
448
+					print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$skillElement->fk_object.'&amp;objecttype='.$objecttype.'&amp;action=ask_deleteskill&amp;lineid='.$skillElement->rowid.'">';
449 449
 					print img_delete();
450 450
 					print '</a>';
451 451
 				}
@@ -456,7 +456,7 @@  discard block
 block discarded – undo
456 456
 
457 457
 		print '</table>';
458 458
 		if ($objecttype != 'user' && $permissiontoadd) {
459
-			print '<td><input class="button pull-right" type="submit" value="' . $langs->trans('SaveRank') . '"></td>';
459
+			print '<td><input class="button pull-right" type="submit" value="'.$langs->trans('SaveRank').'"></td>';
460 460
 		}
461 461
 		print '</div>';
462 462
 		if ($objecttype != 'user' && $permissiontoadd) {
@@ -496,10 +496,10 @@  discard block
 block discarded – undo
496 496
 		print '<th>'.$langs->trans('Description').'</th>';
497 497
 		print '<th>'.$langs->trans('DateEval').'</th>';
498 498
 		print '<th>'.$langs->trans('Status').'</th>';
499
-		print '<th>'.$langs->trans("Result").' ' .$form->textwithpicto('', GetLegendSkills(), 1) .'</th>';
499
+		print '<th>'.$langs->trans("Result").' '.$form->textwithpicto('', GetLegendSkills(), 1).'</th>';
500 500
 		print '</tr>';
501 501
 		if (!$resql) {
502
-			print '<tr><td><span class="opacitymedium">' . $langs->trans("NoRecordFound") . '</span></td></tr>';
502
+			print '<tr><td><span class="opacitymedium">'.$langs->trans("NoRecordFound").'</span></td></tr>';
503 503
 		} else {
504 504
 			$i = 0;
505 505
 			$sameRef = array();
Please login to merge, or discard this patch.
htdocs/don/admin/donation.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -118,10 +118,10 @@  discard block
 block discarded – undo
118 118
 
119 119
 	if (!$error) {
120 120
 		setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
121
-		$action = '';	// To avoid to execute next actions
121
+		$action = ''; // To avoid to execute next actions
122 122
 	} else {
123 123
 		setEventMessages($langs->trans("Error"), null, 'errors');
124
-		$action = '';	// To avoid to execute next actions
124
+		$action = ''; // To avoid to execute next actions
125 125
 	}
126 126
 }
127 127
 
@@ -136,10 +136,10 @@  discard block
 block discarded – undo
136 136
 
137 137
 	if (!$error) {
138 138
 		setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
139
-		$action = '';	// To avoid to execute next actions
139
+		$action = ''; // To avoid to execute next actions
140 140
 	} else {
141 141
 		setEventMessages($langs->trans("Error"), null, 'errors');
142
-		$action = '';	// To avoid to execute next actions
142
+		$action = ''; // To avoid to execute next actions
143 143
 	}
144 144
 }
145 145
 
@@ -345,7 +345,7 @@  discard block
 block discarded – undo
345 345
 if (isModEnabled('accounting')) {
346 346
 	print $formaccounting->select_account($conf->global->DONATION_ACCOUNTINGACCOUNT, 'DONATION_ACCOUNTINGACCOUNT', 1, array(), 1, 1);
347 347
 } else {
348
-	print '<input type="text" size="10" id="DONATION_ACCOUNTINGACCOUNT" name="DONATION_ACCOUNTINGACCOUNT" value="' . getDolGlobalString('DONATION_ACCOUNTINGACCOUNT').'">';
348
+	print '<input type="text" size="10" id="DONATION_ACCOUNTINGACCOUNT" name="DONATION_ACCOUNTINGACCOUNT" value="'.getDolGlobalString('DONATION_ACCOUNTINGACCOUNT').'">';
349 349
 }
350 350
 print '</td><td class="center">';
351 351
 print '<input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'" />';
@@ -358,7 +358,7 @@  discard block
 block discarded – undo
358 358
 
359 359
 print '<tr class="oddeven"><td colspan="2">';
360 360
 print $langs->trans("FreeTextOnDonations").' '.img_info($langs->trans("AddCRIfTooLong")).'<br>';
361
-print '<textarea name="DONATION_MESSAGE" class="flat" cols="80">' . getDolGlobalString('DONATION_MESSAGE').'</textarea>';
361
+print '<textarea name="DONATION_MESSAGE" class="flat" cols="80">'.getDolGlobalString('DONATION_MESSAGE').'</textarea>';
362 362
 print '</td><td class="center">';
363 363
 print '<input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'" />';
364 364
 print "</td></tr>\n";
Please login to merge, or discard this patch.
htdocs/compta/tva/payments.php 1 patch
Spacing   +44 added lines, -44 removed lines patch added patch discarded remove patch
@@ -30,12 +30,12 @@  discard block
 block discarded – undo
30 30
 
31 31
 // Load Dolibarr environment
32 32
 require '../../main.inc.php';
33
-require_once DOL_DOCUMENT_ROOT . '/compta/tva/class/tva.class.php';
34
-require_once DOL_DOCUMENT_ROOT . '/compta/tva/class/tva.class.php';
35
-require_once DOL_DOCUMENT_ROOT . '/compta/tva/class/paymentvat.class.php';
36
-require_once DOL_DOCUMENT_ROOT . '/compta/bank/class/account.class.php';
37
-require_once DOL_DOCUMENT_ROOT . '/salaries/class/paymentsalary.class.php';
38
-require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
33
+require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php';
34
+require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php';
35
+require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/paymentvat.class.php';
36
+require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
37
+require_once DOL_DOCUMENT_ROOT.'/salaries/class/paymentsalary.class.php';
38
+require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
39 39
 
40 40
 // Load translation files required by the page
41 41
 $langs->loadLangs(array('compta', 'bills'));
@@ -91,22 +91,22 @@  discard block
 block discarded – undo
91 91
 
92 92
 $param = '';
93 93
 if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
94
-	$param .= '&contextpage=' . $contextpage;
94
+	$param .= '&contextpage='.$contextpage;
95 95
 }
96 96
 if ($limit > 0 && $limit != $conf->liste_limit) {
97
-	$param .= '&limit=' . $limit;
97
+	$param .= '&limit='.$limit;
98 98
 }
99 99
 if ($sortfield) {
100
-	$param .= '&sortfield=' . $sortfield;
100
+	$param .= '&sortfield='.$sortfield;
101 101
 }
102 102
 if ($sortorder) {
103
-	$param .= '&sortorder=' . $sortorder;
103
+	$param .= '&sortorder='.$sortorder;
104 104
 }
105 105
 
106 106
 $center = '';
107 107
 
108 108
 if ($year) {
109
-	$param .= '&year=' . $year;
109
+	$param .= '&year='.$year;
110 110
 }
111 111
 
112 112
 $sql = "SELECT tva.rowid, tva.label as label, b.fk_account, ptva.fk_bank";
@@ -114,19 +114,19 @@  discard block
 block discarded – undo
114 114
 $sql .= ", tva.amount as total,";
115 115
 $sql .= " ptva.rowid as pid, ptva.datep, ptva.amount as totalpaid, ptva.num_paiement as num_payment,";
116 116
 $sql .= " pct.code as payment_code";
117
-$sql .= " FROM " . MAIN_DB_PREFIX . "tva as tva,";
118
-$sql .= " " . MAIN_DB_PREFIX . "payment_vat as ptva";
119
-$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "bank as b ON (b.rowid = ptva.fk_bank)";
120
-$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "bank_account as bank ON (bank.rowid = b.fk_account)";
121
-$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_paiement as pct ON ptva.fk_typepaiement = pct.id";
117
+$sql .= " FROM ".MAIN_DB_PREFIX."tva as tva,";
118
+$sql .= " ".MAIN_DB_PREFIX."payment_vat as ptva";
119
+$sql .= " INNER JOIN ".MAIN_DB_PREFIX."bank as b ON (b.rowid = ptva.fk_bank)";
120
+$sql .= " INNER JOIN ".MAIN_DB_PREFIX."bank_account as bank ON (bank.rowid = b.fk_account)";
121
+$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as pct ON ptva.fk_typepaiement = pct.id";
122 122
 $sql .= " WHERE ptva.fk_tva = tva.rowid";
123
-$sql .= " AND tva.entity = " . $conf->entity;
123
+$sql .= " AND tva.entity = ".$conf->entity;
124 124
 if ($year > 0) {
125 125
 	$sql .= " AND (";
126 126
 	// Si period renseignee on l'utilise comme critere de date, sinon on prend date echeance,
127 127
 	// ceci afin d'etre compatible avec les cas ou la periode n'etait pas obligatoire
128
-	$sql .= "   (tva.datev IS NOT NULL AND tva.datev between '" . $db->idate(dol_get_first_day($year)) . "' AND '" . $db->idate(dol_get_last_day($year)) . "')";
129
-	$sql .= " OR (tva.datev IS NULL AND tva.datev between '" . $db->idate(dol_get_first_day($year)) . "' AND '" . $db->idate(dol_get_last_day($year)) . "')";
128
+	$sql .= "   (tva.datev IS NOT NULL AND tva.datev between '".$db->idate(dol_get_first_day($year))."' AND '".$db->idate(dol_get_last_day($year))."')";
129
+	$sql .= " OR (tva.datev IS NULL AND tva.datev between '".$db->idate(dol_get_first_day($year))."' AND '".$db->idate(dol_get_last_day($year))."')";
130 130
 	$sql .= ")";
131 131
 }
132 132
 if (preg_match('/^cs\./', $sortfield)
@@ -151,16 +151,16 @@  discard block
 block discarded – undo
151 151
 print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $center, $num, $num, 'title_accountancy', 0, '', '', $limit);
152 152
 
153 153
 if (isModEnabled('tax') && $user->hasRight('tax', 'charges', 'lire')) {
154
-	print '<form method="POST" action="' . $_SERVER["PHP_SELF"] . '">';
154
+	print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
155 155
 	if ($optioncss != '') {
156
-		print '<input type="hidden" name="optioncss" value="' . $optioncss . '">';
156
+		print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
157 157
 	}
158
-	print '<input type="hidden" name="token" value="' . newToken() . '">';
158
+	print '<input type="hidden" name="token" value="'.newToken().'">';
159 159
 	print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
160
-	print '<input type="hidden" name="sortfield" value="' . $sortfield . '">';
161
-	print '<input type="hidden" name="sortorder" value="' . $sortorder . '">';
162
-	print '<input type="hidden" name="page" value="' . $page . '">';
163
-	print '<input type="hidden" name="mode" value="' . $mode . '">';
160
+	print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
161
+	print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
162
+	print '<input type="hidden" name="page" value="'.$page.'">';
163
+	print '<input type="hidden" name="mode" value="'.$mode.'">';
164 164
 
165 165
 	print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you don't need reserved height for your table
166 166
 	print '<table class="noborder centpercent">';
@@ -186,19 +186,19 @@  discard block
 block discarded – undo
186 186
 	$sql .= ", tva.amount as total,";
187 187
 	$sql .= " ptva.rowid as pid, ptva.datep, ptva.amount as totalpaid, ptva.num_paiement as num_payment,";
188 188
 	$sql .= " pct.code as payment_code";
189
-	$sql .= " FROM " . MAIN_DB_PREFIX . "tva as tva,";
190
-	$sql .= " " . MAIN_DB_PREFIX . "payment_vat as ptva";
191
-	$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "bank as b ON (b.rowid = ptva.fk_bank)";
192
-	$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "bank_account as bank ON (bank.rowid = b.fk_account)";
193
-	$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_paiement as pct ON ptva.fk_typepaiement = pct.id";
189
+	$sql .= " FROM ".MAIN_DB_PREFIX."tva as tva,";
190
+	$sql .= " ".MAIN_DB_PREFIX."payment_vat as ptva";
191
+	$sql .= " INNER JOIN ".MAIN_DB_PREFIX."bank as b ON (b.rowid = ptva.fk_bank)";
192
+	$sql .= " INNER JOIN ".MAIN_DB_PREFIX."bank_account as bank ON (bank.rowid = b.fk_account)";
193
+	$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as pct ON ptva.fk_typepaiement = pct.id";
194 194
 	$sql .= " WHERE ptva.fk_tva = tva.rowid";
195
-	$sql .= " AND tva.entity = " . $conf->entity;
195
+	$sql .= " AND tva.entity = ".$conf->entity;
196 196
 	if ($year > 0) {
197 197
 		$sql .= " AND (";
198 198
 		// Si period renseignee on l'utilise comme critere de date, sinon on prend date echeance,
199 199
 		// ceci afin d'etre compatible avec les cas ou la periode n'etait pas obligatoire
200
-		$sql .= "   (tva.datev IS NOT NULL AND tva.datev between '" . $db->idate(dol_get_first_day($year)) . "' AND '" . $db->idate(dol_get_last_day($year)) . "')";
201
-		$sql .= " OR (tva.datev IS NULL AND tva.datev between '" . $db->idate(dol_get_first_day($year)) . "' AND '" . $db->idate(dol_get_last_day($year)) . "')";
200
+		$sql .= "   (tva.datev IS NOT NULL AND tva.datev between '".$db->idate(dol_get_first_day($year))."' AND '".$db->idate(dol_get_last_day($year))."')";
201
+		$sql .= " OR (tva.datev IS NULL AND tva.datev between '".$db->idate(dol_get_first_day($year))."' AND '".$db->idate(dol_get_last_day($year))."')";
202 202
 		$sql .= ")";
203 203
 	}
204 204
 	if ($sortfield !== null
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
 			print '<tr class="oddeven">';
228 228
 
229 229
 			// Ref payment
230
-			print '<td>' . $payment_vat_static->getNomUrl(1) . "</td>\n";
230
+			print '<td>'.$payment_vat_static->getNomUrl(1)."</td>\n";
231 231
 
232 232
 			// VAT
233 233
 			print '<td>';
@@ -235,28 +235,28 @@  discard block
 block discarded – undo
235 235
 			print '</td>';
236 236
 
237 237
 			// Label
238
-			print '<td class="tdoverflowmax150" title="' . dol_escape_htmltag($obj->label) . '">' . dol_escape_htmltag($obj->label) . '</td>';
238
+			print '<td class="tdoverflowmax150" title="'.dol_escape_htmltag($obj->label).'">'.dol_escape_htmltag($obj->label).'</td>';
239 239
 
240 240
 			// Date
241 241
 			$date = $db->jdate($obj->datev);
242
-			print '<td class="center nowraponall">' . dol_print_date($date, 'day') . '</td>';
242
+			print '<td class="center nowraponall">'.dol_print_date($date, 'day').'</td>';
243 243
 
244 244
 			// Date payment
245 245
 			$datep = $db->jdate($obj->datep);
246
-			print '<td class="center nowraponall">' . dol_print_date($datep, 'day') . '</td>';
246
+			print '<td class="center nowraponall">'.dol_print_date($datep, 'day').'</td>';
247 247
 
248 248
 			// Type payment
249 249
 			$labelpaymenttype = '';
250 250
 			if ($obj->payment_code) {
251
-				$labelpaymenttype = $langs->trans("PaymentTypeShort" . $obj->payment_code) . ' ';
251
+				$labelpaymenttype = $langs->trans("PaymentTypeShort".$obj->payment_code).' ';
252 252
 			}
253 253
 
254
-			print '<td class="tdoverflowmax100" title="' . dol_escape_htmltag($labelpaymenttype) . '">';
254
+			print '<td class="tdoverflowmax100" title="'.dol_escape_htmltag($labelpaymenttype).'">';
255 255
 			print dol_escape_htmltag($labelpaymenttype);
256 256
 			print '</td>';
257 257
 
258 258
 			// Chq number
259
-			print '<td>' . dol_escape_htmltag($obj->num_payment) . '</td>';
259
+			print '<td>'.dol_escape_htmltag($obj->num_payment).'</td>';
260 260
 
261 261
 			if (isModEnabled("bank")) {
262 262
 				// Bank transaction
@@ -274,7 +274,7 @@  discard block
 block discarded – undo
274 274
 			}
275 275
 
276 276
 			// Expected to pay
277
-			print '<td class="right"><span class="amount">' . price($obj->total) . '</span></td>';
277
+			print '<td class="right"><span class="amount">'.price($obj->total).'</span></td>';
278 278
 
279 279
 			// Paid
280 280
 			print '<td class="right"><span class="amount">';
@@ -290,7 +290,7 @@  discard block
 block discarded – undo
290 290
 		}
291 291
 
292 292
 		// Total
293
-		print '<tr class="liste_total"><td colspan="3" class="liste_total">' . $langs->trans("Total") . '</td>';
293
+		print '<tr class="liste_total"><td colspan="3" class="liste_total">'.$langs->trans("Total").'</td>';
294 294
 		print '<td class="liste_total right"></td>'; // A total here has no sense
295 295
 		print '<td class="center liste_total">&nbsp;</td>';
296 296
 		print '<td class="center liste_total">&nbsp;</td>';
@@ -300,7 +300,7 @@  discard block
 block discarded – undo
300 300
 		}
301 301
 		print '<td class="center liste_total">&nbsp;</td>';
302 302
 		print '<td class="center liste_total">&nbsp;</td>';
303
-		print '<td class="liste_total right">' . price($totalpaid) . "</td>";
303
+		print '<td class="liste_total right">'.price($totalpaid)."</td>";
304 304
 		print "</tr>";
305 305
 	}
306 306
 	print '</table>';
Please login to merge, or discard this patch.