Passed
Branch develop (7fd3bb)
by Laurent
38:31
created
htdocs/core/lib/functions.lib.php 1 patch
Spacing   +65 added lines, -65 removed lines patch added patch discarded remove patch
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
 {
110 110
 	global $conf, $mc, $hookmanager, $object, $action, $db;
111 111
 
112
-	if (! is_object($hookmanager)) {
112
+	if (!is_object($hookmanager)) {
113 113
 		$hookmanager = new HookManager($db);
114 114
 	}
115 115
 
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
 	$os = 'unknown';
209 209
 	$phone = '';
210 210
 
211
-	$user_agent = substr($user_agent, 0, 512);	// Avoid to process too large user agent
211
+	$user_agent = substr($user_agent, 0, 512); // Avoid to process too large user agent
212 212
 
213 213
 	$detectmobile = new Mobile_Detect(null, $user_agent);
214 214
 	$tablet = $detectmobile->isTablet();
@@ -670,13 +670,13 @@  discard block
 block discarded – undo
670 670
 	// Sanitizing for special parameters.
671 671
 	// Note: There is no reason to allow the backtopage, backtolist or backtourl parameter to contains an external URL. Only relative URLs are allowed.
672 672
 	if ($paramname == 'backtopage' || $paramname == 'backtolist' || $paramname == 'backtourl') {
673
-		$out = str_replace('\\', '/', $out);								// Can be before the loop because only 1 char is replaced. No risk to get it after other replacements.
674
-		$out = str_replace(array(':', ';', '@', "\t", ' '), '', $out);		// Can be before the loop because only 1 char is replaced. No risk to retreive it after other replacements.
673
+		$out = str_replace('\\', '/', $out); // Can be before the loop because only 1 char is replaced. No risk to get it after other replacements.
674
+		$out = str_replace(array(':', ';', '@', "\t", ' '), '', $out); // Can be before the loop because only 1 char is replaced. No risk to retreive it after other replacements.
675 675
 		do {
676 676
 			$oldstringtoclean = $out;
677 677
 			$out = str_ireplace(array('javascript', 'vbscript', '&colon', '&#'), '', $out);
678
-			$out = preg_replace(array('/^[^\?]*%/'), '', $out);				// We remove any % chars before the ?. Example in url: '/product/stock/card.php?action=create&backtopage=%2Fdolibarr_dev%2Fhtdocs%2Fpro%25duct%2Fcard.php%3Fid%3Dabc'
679
-			$out = preg_replace(array('/^[a-z]*\/\s*\/+/i'), '', $out);		// We remove schema*// to remove external URL
678
+			$out = preg_replace(array('/^[^\?]*%/'), '', $out); // We remove any % chars before the ?. Example in url: '/product/stock/card.php?action=create&backtopage=%2Fdolibarr_dev%2Fhtdocs%2Fpro%25duct%2Fcard.php%3Fid%3Dabc'
679
+			$out = preg_replace(array('/^[a-z]*\/\s*\/+/i'), '', $out); // We remove schema*// to remove external URL
680 680
 		} while ($oldstringtoclean != $out);
681 681
 	}
682 682
 
@@ -817,7 +817,7 @@  discard block
 block discarded – undo
817 817
 						// like 'abc' that ends up with '<p>abc</p>'
818 818
 						$out = '<div class="tricktoremove">'.$out.'</div>';
819 819
 
820
-						$dom->loadHTML($out, LIBXML_ERR_NONE|LIBXML_HTML_NOIMPLIED|LIBXML_HTML_NODEFDTD|LIBXML_NONET|LIBXML_NOWARNING|LIBXML_NOXMLDECL);
820
+						$dom->loadHTML($out, LIBXML_ERR_NONE | LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD | LIBXML_NONET | LIBXML_NOWARNING | LIBXML_NOXMLDECL);
821 821
 						$out = trim($dom->saveHTML());
822 822
 
823 823
 						// Remove the trick added to solve pb with text without parent tag
@@ -837,12 +837,12 @@  discard block
 block discarded – undo
837 837
 				// No need to use a loop here, this step is not to sanitize (this is done at next step, this is to try to save chars, even if they are
838 838
 				// using a non coventionnel way to be encoded, to not have them sanitized just after)
839 839
 				//$out = preg_replace_callback('/&#(x?[0-9][0-9a-f]+;?)/i', 'realCharForNumericEntities', $out);
840
-				$out = preg_replace_callback('/&#(x?[0-9][0-9a-f]+;?)/i', function ($m) {
840
+				$out = preg_replace_callback('/&#(x?[0-9][0-9a-f]+;?)/i', function($m) {
841 841
 					return realCharForNumericEntities($m); }, $out);
842 842
 
843 843
 
844 844
 				// Now we remove all remaining HTML entities starting with a number. We don't want such entities.
845
-				$out = preg_replace('/&#x?[0-9]+/i', '', $out);	// For example if we have j&#x61vascript with an entities without the ; to hide the 'a' of 'javascript'.
845
+				$out = preg_replace('/&#x?[0-9]+/i', '', $out); // For example if we have j&#x61vascript with an entities without the ; to hide the 'a' of 'javascript'.
846 846
 
847 847
 				$out = dol_string_onlythesehtmltags($out, 0, 1, 1);
848 848
 
@@ -902,7 +902,7 @@  discard block
 block discarded – undo
902 902
 		}
903 903
 
904 904
 		// If prefix is for session (no need to have $conf loaded)
905
-		global $dolibarr_main_instance_unique_id, $dolibarr_main_cookie_cryptkey;	// This is loaded by filefunc.inc.php
905
+		global $dolibarr_main_instance_unique_id, $dolibarr_main_cookie_cryptkey; // This is loaded by filefunc.inc.php
906 906
 		$tmp_instance_unique_id = empty($dolibarr_main_instance_unique_id) ? (empty($dolibarr_main_cookie_cryptkey) ? '' : $dolibarr_main_cookie_cryptkey) : $dolibarr_main_instance_unique_id; // Unique id of instance
907 907
 
908 908
 		// The recommended value (may be not defined for old versions)
@@ -1056,7 +1056,7 @@  discard block
 block discarded – undo
1056 1056
 function dol_clone($object, $native = 0)
1057 1057
 {
1058 1058
 	if (empty($native)) {
1059
-		$myclone = unserialize(serialize($object));	// serialize then unserialize is hack to be sure to have a new object for all fields
1059
+		$myclone = unserialize(serialize($object)); // serialize then unserialize is hack to be sure to have a new object for all fields
1060 1060
 	} else {
1061 1061
 		$myclone = clone $object; // PHP clone is a shallow copy only, not a real clone, so properties of references will keep the reference (refering to the same target/variable)
1062 1062
 	}
@@ -1633,10 +1633,10 @@  discard block
 block discarded – undo
1633 1633
 								returnedlabel = jQuery("#varforreturndialoglabel'.$name.'").text();
1634 1634
 								console.log("popup has been closed. returnedid (js var defined into parent page)="+returnedid+" returnedlabel="+returnedlabel);
1635 1635
 								if (returnedid != "" && returnedid != "div for returned id") {
1636
-									jQuery("#'.(empty($backtopagejsfieldsid)?"none":$backtopagejsfieldsid).'").val(returnedid);
1636
+									jQuery("#'.(empty($backtopagejsfieldsid) ? "none" : $backtopagejsfieldsid).'").val(returnedid);
1637 1637
 								}
1638 1638
 								if (returnedlabel != "" && returnedlabel != "div for returned label") {
1639
-									jQuery("#'.(empty($backtopagejsfieldslabel)?"none":$backtopagejsfieldslabel).'").val(returnedlabel);
1639
+									jQuery("#'.(empty($backtopagejsfieldslabel) ? "none" : $backtopagejsfieldslabel).'").val(returnedlabel);
1640 1640
 								}
1641 1641
 							}
1642 1642
 						});
@@ -1772,7 +1772,7 @@  discard block
 block discarded – undo
1772 1772
 				}
1773 1773
 			} elseif (!empty($links[$i][1])) {
1774 1774
 				//print "x $i $active ".$links[$i][2]." z";
1775
-				$out .= '<div class="tab tab'.($isactive?'active':'unactive').'" style="margin: 0 !important">';
1775
+				$out .= '<div class="tab tab'.($isactive ? 'active' : 'unactive').'" style="margin: 0 !important">';
1776 1776
 				if (!empty($links[$i][0])) {
1777 1777
 					$titletoshow = preg_replace('/<.*$/', '', $links[$i][1]);
1778 1778
 					$out .= '<a'.(!empty($links[$i][2]) ? ' id="'.$links[$i][2].'"' : '').' class="tab inline-block valignmiddle'.($morecss ? ' '.$morecss : '').'" href="'.$links[$i][0].'" title="'.dol_escape_htmltag($titletoshow).'">';
@@ -2182,7 +2182,7 @@  discard block
 block discarded – undo
2182 2182
 		$morehtmlref .= '</div>';
2183 2183
 	}
2184 2184
 
2185
-	$parameters=array('morehtmlref'=>$morehtmlref);
2185
+	$parameters = array('morehtmlref'=>$morehtmlref);
2186 2186
 	$reshook = $hookmanager->executeHooks('formDolBanner', $parameters, $object, $action);
2187 2187
 	if ($reshook < 0) {
2188 2188
 		setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
@@ -2272,7 +2272,7 @@  discard block
 block discarded – undo
2272 2272
 		$town = ($extralangcode ? $object->array_languages['town'][$extralangcode] : (empty($object->town) ? '' : $object->town));
2273 2273
 		$ret .= (($ret && $town) ? $sep : '').$town;
2274 2274
 
2275
-		if (!empty($object->state))	{
2275
+		if (!empty($object->state)) {
2276 2276
 			$ret .= ($ret ? ($town ? ", " : $sep) : '').$object->state;
2277 2277
 		}
2278 2278
 		if (!empty($object->zip)) {
@@ -2389,8 +2389,8 @@  discard block
 block discarded – undo
2389 2389
 			if ($tzoutput == 'tzserver') {
2390 2390
 				$to_gmt = false;
2391 2391
 				$offsettzstring = @date_default_timezone_get(); // Example 'Europe/Berlin' or 'Indian/Reunion'
2392
-				$offsettz = 0;	// Timezone offset with server timezone, so 0
2393
-				$offsetdst = 0;	// Dst offset with server timezone, so 0
2392
+				$offsettz = 0; // Timezone offset with server timezone, so 0
2393
+				$offsetdst = 0; // Dst offset with server timezone, so 0
2394 2394
 			} elseif ($tzoutput == 'tzuser' || $tzoutput == 'tzuserrel') {
2395 2395
 				$to_gmt = true;
2396 2396
 				$offsettzstring = (empty($_SESSION['dol_tz_string']) ? 'UTC' : $_SESSION['dol_tz_string']); // Example 'Europe/Berlin' or 'Indian/Reunion'
@@ -2417,8 +2417,8 @@  discard block
 block discarded – undo
2417 2417
 
2418 2418
 	// Do we have to reduce the length of date (year on 2 chars) to save space.
2419 2419
 	// Note: dayinputnoreduce is same than day but no reduction of year length will be done
2420
-	$reduceformat = (!empty($conf->dol_optimize_smallscreen) && in_array($format, array('day', 'dayhour'))) ? 1 : 0;	// Test on original $format param.
2421
-	$format = preg_replace('/inputnoreduce/', '', $format);	// so format 'dayinputnoreduce' is processed like day
2420
+	$reduceformat = (!empty($conf->dol_optimize_smallscreen) && in_array($format, array('day', 'dayhour'))) ? 1 : 0; // Test on original $format param.
2421
+	$format = preg_replace('/inputnoreduce/', '', $format); // so format 'dayinputnoreduce' is processed like day
2422 2422
 	$formatwithoutreduce = preg_replace('/reduceformat/', '', $format);
2423 2423
 	if ($formatwithoutreduce != $format) {
2424 2424
 		$format = $formatwithoutreduce;
@@ -2504,7 +2504,7 @@  discard block
 block discarded – undo
2504 2504
 		if ($time < 100000000000) {	// Protection against bad date values
2505 2505
 			$timetouse = $time + $offsettz + $offsetdst; // TODO Replace this with function Date PHP. We also should not use anymore offsettz and offsetdst but only offsettzstring.
2506 2506
 
2507
-			$ret = adodb_strftime($format, $timetouse, $to_gmt);	// If to_gmt = false then adodb_strftime use TZ of server
2507
+			$ret = adodb_strftime($format, $timetouse, $to_gmt); // If to_gmt = false then adodb_strftime use TZ of server
2508 2508
 		} else {
2509 2509
 			$ret = 'Bad value '.$time.' for date';
2510 2510
 		}
@@ -2514,7 +2514,7 @@  discard block
 block discarded – undo
2514 2514
 		$timetouse = $time + $offsettz + $offsetdst; // TODO Replace this with function Date PHP. We also should not use anymore offsettz and offsetdst but only offsettzstring.
2515 2515
 
2516 2516
 		// Here ret is string in PHP setup language (strftime was used). Now we convert to $outputlangs.
2517
-		$month = adodb_strftime('%m', $timetouse, $to_gmt);		// If to_gmt = false then adodb_strftime use TZ of server
2517
+		$month = adodb_strftime('%m', $timetouse, $to_gmt); // If to_gmt = false then adodb_strftime use TZ of server
2518 2518
 		$month = sprintf("%02d", $month); // $month may be return with format '06' on some installation and '6' on other, so we force it to '06'.
2519 2519
 		if ($encodetooutput) {
2520 2520
 			$monthtext = $outputlangs->transnoentities('Month'.$month);
@@ -2533,7 +2533,7 @@  discard block
 block discarded – undo
2533 2533
 		//print "time=$time offsettz=$offsettz offsetdst=$offsetdst offsettzstring=$offsettzstring";
2534 2534
 		$timetouse = $time + $offsettz + $offsetdst; // TODO Replace this with function Date PHP. We also should not use anymore offsettz and offsetdst but only offsettzstring.
2535 2535
 
2536
-		$w = adodb_strftime('%w', $timetouse, $to_gmt);		// If to_gmt = false then adodb_strftime use TZ of server
2536
+		$w = adodb_strftime('%w', $timetouse, $to_gmt); // If to_gmt = false then adodb_strftime use TZ of server
2537 2537
 		$dayweek = $outputlangs->transnoentitiesnoconv('Day'.$w);
2538 2538
 		$ret = str_replace('__A__', $dayweek, $ret);
2539 2539
 		$ret = str_replace('__a__', dol_substr($dayweek, 0, 3), $ret);
@@ -2882,7 +2882,7 @@  discard block
 block discarded – undo
2882 2882
 	$socialnetworks = array();
2883 2883
 	// Enable caching of array
2884 2884
 	require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php';
2885
-	$cachekey = 'socialnetworks_' . $conf->entity;
2885
+	$cachekey = 'socialnetworks_'.$conf->entity;
2886 2886
 	$dataretrieved = dol_getcache($cachekey);
2887 2887
 	if (!is_null($dataretrieved)) {
2888 2888
 		$socialnetworks = $dataretrieved;
@@ -3233,7 +3233,7 @@  discard block
 block discarded – undo
3233 3233
 			$newphonesav = $newphone;
3234 3234
 			if (empty($conf->global->CLICKTODIAL_DO_NOT_USE_AJAX_CALL)) {
3235 3235
 				// Default and recommended: New method using ajax without submiting a page making a javascript history.go(-1) back
3236
-				$newphone = '<a href="'.$url.'" class="cssforclicktodial"';	// Call of ajax is handled by the lib_foot.js.php on class 'cssforclicktodial'
3236
+				$newphone = '<a href="'.$url.'" class="cssforclicktodial"'; // Call of ajax is handled by the lib_foot.js.php on class 'cssforclicktodial'
3237 3237
 				$newphone .= '>'.$newphonesav.'</a>';
3238 3238
 			} else {
3239 3239
 				// Old method
@@ -3346,9 +3346,9 @@  discard block
 block discarded – undo
3346 3346
 	if (empty($_SERVER['HTTP_X_FORWARDED_FOR']) || preg_match('/[^0-9\.\:,\[\]]/', $_SERVER['HTTP_X_FORWARDED_FOR'])) {
3347 3347
 		if (empty($_SERVER['HTTP_CLIENT_IP']) || preg_match('/[^0-9\.\:,\[\]]/', $_SERVER['HTTP_CLIENT_IP'])) {
3348 3348
 			if (empty($_SERVER["HTTP_CF_CONNECTING_IP"])) {
3349
-				$ip = (empty($_SERVER['REMOTE_ADDR']) ? '' : $_SERVER['REMOTE_ADDR']);	// value may have been the IP of the proxy and not the client
3349
+				$ip = (empty($_SERVER['REMOTE_ADDR']) ? '' : $_SERVER['REMOTE_ADDR']); // value may have been the IP of the proxy and not the client
3350 3350
 			} else {
3351
-				$ip = $_SERVER["HTTP_CF_CONNECTING_IP"];	// value here may have been forged by client
3351
+				$ip = $_SERVER["HTTP_CF_CONNECTING_IP"]; // value here may have been forged by client
3352 3352
 			}
3353 3353
 		} else {
3354 3354
 			$ip = $_SERVER['HTTP_CLIENT_IP']; // value is clean here but may have been forged by proxy
@@ -3830,7 +3830,7 @@  discard block
 block discarded – undo
3830 3830
 				'intervention'=>'ambulance', 'invoice'=>'file-invoice-dollar', 'currency'=>'dollar-sign', 'multicurrency'=>'dollar-sign', 'order'=>'file-invoice',
3831 3831
 				'error'=>'exclamation-triangle', 'warning'=>'exclamation-triangle',
3832 3832
 				'other'=>'square',
3833
-				'playdisabled'=>'play', 'pdf'=>'file-pdf',  'poll'=>'check-double', 'pos'=>'cash-register', 'preview'=>'binoculars', 'project'=>'project-diagram', 'projectpub'=>'project-diagram', 'projecttask'=>'tasks', 'propal'=>'file-signature',
3833
+				'playdisabled'=>'play', 'pdf'=>'file-pdf', 'poll'=>'check-double', 'pos'=>'cash-register', 'preview'=>'binoculars', 'project'=>'project-diagram', 'projectpub'=>'project-diagram', 'projecttask'=>'tasks', 'propal'=>'file-signature',
3834 3834
 				'partnership'=>'handshake', 'payment'=>'money-check-alt', 'payment_vat'=>'money-check-alt', 'phoning'=>'phone', 'phoning_mobile'=>'mobile-alt', 'phoning_fax'=>'fax', 'previous'=>'arrow-alt-circle-left', 'printer'=>'print', 'product'=>'cube', 'puce'=>'angle-right',
3835 3835
 				'recent' => 'question', 'reception'=>'dolly', 'recruitmentjobposition'=>'id-card-alt', 'recruitmentcandidature'=>'id-badge',
3836 3836
 				'resize'=>'crop', 'supplier_order'=>'dol-order_supplier', 'supplier_proposal'=>'file-signature',
@@ -3900,7 +3900,7 @@  discard block
 block discarded – undo
3900 3900
 				'bill'=>'infobox-commande', 'billa'=>'infobox-commande', 'billr'=>'infobox-commande', 'billd'=>'infobox-commande',
3901 3901
 				'margin'=>'infobox-bank_account', 'conferenceorbooth'=>'infobox-project',
3902 3902
 				'cash-register'=>'infobox-bank_account', 'contract'=>'infobox-contrat', 'check'=>'font-status4', 'collab'=>'infobox-action', 'conversation'=>'infobox-contrat',
3903
-				'donation'=>'infobox-commande', 'dolly'=>'infobox-commande',  'dollyrevert'=>'flip infobox-order_supplier',
3903
+				'donation'=>'infobox-commande', 'dolly'=>'infobox-commande', 'dollyrevert'=>'flip infobox-order_supplier',
3904 3904
 				'ecm'=>'infobox-action', 'eventorganization'=>'infobox-project',
3905 3905
 				'hrm'=>'infobox-adherent', 'group'=>'infobox-adherent', 'intervention'=>'infobox-contrat',
3906 3906
 				'incoterm'=>'infobox-supplier_proposal',
@@ -5527,7 +5527,7 @@  discard block
 block discarded – undo
5527 5527
 		$amount = str_replace($thousand, '', $amount); // Replace of thousand before replace of dec to avoid pb if thousand is .
5528 5528
 		$amount = str_replace($dec, '.', $amount);
5529 5529
 
5530
-		$amount = preg_replace('/[^0-9\-\.]/', '', $amount);	// Clean non numeric chars (so it clean some UTF8 spaces for example.
5530
+		$amount = preg_replace('/[^0-9\-\.]/', '', $amount); // Clean non numeric chars (so it clean some UTF8 spaces for example.
5531 5531
 	}
5532 5532
 	//print ' XX'.$amount.' '.$rounding;
5533 5533
 
@@ -5541,9 +5541,9 @@  discard block
 block discarded – undo
5541 5541
 		} elseif ($rounding == 'MS') {
5542 5542
 			$nbofdectoround = isset($conf->global->MAIN_MAX_DECIMALS_STOCK) ? $conf->global->MAIN_MAX_DECIMALS_STOCK : 5;
5543 5543
 		} elseif ($rounding == 'CU') {
5544
-			$nbofdectoround = max($conf->global->MAIN_MAX_DECIMALS_UNIT, 8);	// TODO Use param of currency
5544
+			$nbofdectoround = max($conf->global->MAIN_MAX_DECIMALS_UNIT, 8); // TODO Use param of currency
5545 5545
 		} elseif ($rounding == 'CT') {
5546
-			$nbofdectoround = max($conf->global->MAIN_MAX_DECIMALS_TOT, 8);		// TODO Use param of currency
5546
+			$nbofdectoround = max($conf->global->MAIN_MAX_DECIMALS_TOT, 8); // TODO Use param of currency
5547 5547
 		} elseif (is_numeric($rounding)) {
5548 5548
 			$nbofdectoround = (int) $rounding;
5549 5549
 		}
@@ -5577,7 +5577,7 @@  discard block
 block discarded – undo
5577 5577
 		$amount = str_replace($thousand, '', $amount); // Replace of thousand before replace of dec to avoid pb if thousand is .
5578 5578
 		$amount = str_replace($dec, '.', $amount);
5579 5579
 
5580
-		$amount = preg_replace('/[^0-9\-\.]/', '', $amount);	// Clean non numeric chars (so it clean some UTF8 spaces for example.
5580
+		$amount = preg_replace('/[^0-9\-\.]/', '', $amount); // Clean non numeric chars (so it clean some UTF8 spaces for example.
5581 5581
 	}
5582 5582
 
5583 5583
 	return $amount;
@@ -6515,7 +6515,7 @@  discard block
 block discarded – undo
6515 6515
 	if ($strip_tags) {
6516 6516
 		$temp = strip_tags($temp);
6517 6517
 	} else {
6518
-		$temp = str_replace('<>', '', $temp);	// No reason to have this into a text, except if value is to try bypass the next html cleaning
6518
+		$temp = str_replace('<>', '', $temp); // No reason to have this into a text, except if value is to try bypass the next html cleaning
6519 6519
 		$pattern = "/<[^<>]+>/";
6520 6520
 		// Example of $temp: <a href="/myurl" title="<u>A title</u>">0000-021</a>
6521 6521
 		$temp = preg_replace($pattern, "", $temp); // pass 1 - $temp after pass 1: <a href="/myurl" title="A title">0000-021
@@ -6570,7 +6570,7 @@  discard block
 block discarded – undo
6570 6570
 	$allowed_tags_string = join("><", $allowed_tags);
6571 6571
 	$allowed_tags_string = '<'.$allowed_tags_string.'>';
6572 6572
 
6573
-	$stringtoclean = str_replace('<!DOCTYPE html>', '__!DOCTYPE_HTML__', $stringtoclean);	// Replace DOCTYPE to avoid to have it removed by the strip_tags
6573
+	$stringtoclean = str_replace('<!DOCTYPE html>', '__!DOCTYPE_HTML__', $stringtoclean); // Replace DOCTYPE to avoid to have it removed by the strip_tags
6574 6574
 
6575 6575
 	$stringtoclean = dol_string_nounprintableascii($stringtoclean, 0);
6576 6576
 
@@ -6581,7 +6581,7 @@  discard block
 block discarded – undo
6581 6581
 	$stringtoclean = preg_replace('/&#58;|&#0+58|&#x3A/i', '', $stringtoclean); // refused string ':' encoded (no reason to have a : encoded like this) to disable 'javascript:...'
6582 6582
 	$stringtoclean = preg_replace('/javascript\s*:/i', '', $stringtoclean);
6583 6583
 
6584
-	$temp = strip_tags($stringtoclean, $allowed_tags_string);	// Warning: This remove also undesired </> changing string obfuscated with </> that pass injection detection into harmfull string
6584
+	$temp = strip_tags($stringtoclean, $allowed_tags_string); // Warning: This remove also undesired </> changing string obfuscated with </> that pass injection detection into harmfull string
6585 6585
 
6586 6586
 	if ($cleanalsosomestyles) {	// Clean for remaining html tags
6587 6587
 		$temp = preg_replace('/position\s*:\s*(absolute|fixed)\s*!\s*important/i', '', $temp); // Note: If hacker try to introduce css comment into string to bypass this regex, the string must also be encoded by the dol_htmlentitiesbr during output so it become harmless
@@ -6596,9 +6596,9 @@  discard block
 block discarded – undo
6596 6596
 		$temp = preg_replace('/javascript\s*:/i', '', $temp);
6597 6597
 	}
6598 6598
 
6599
-	$temp = str_replace('__!DOCTYPE_HTML__', '<!DOCTYPE html>', $temp);	// Restore the DOCTYPE
6599
+	$temp = str_replace('__!DOCTYPE_HTML__', '<!DOCTYPE html>', $temp); // Restore the DOCTYPE
6600 6600
 
6601
-	$temp = preg_replace('/<comment>([^>]*)<\/comment>/', '<!--\1-->', $temp);	// Restore html comments
6601
+	$temp = preg_replace('/<comment>([^>]*)<\/comment>/', '<!--\1-->', $temp); // Restore html comments
6602 6602
 
6603 6603
 
6604 6604
 	return $temp;
@@ -6622,15 +6622,15 @@  discard block
 block discarded – undo
6622 6622
 		$stringtoclean = '<?xml encoding="UTF-8"><html><body>'.$stringtoclean.'</body></html>';
6623 6623
 
6624 6624
 		$dom = new DOMDocument(null, 'UTF-8');
6625
-		$dom->loadHTML($stringtoclean, LIBXML_ERR_NONE|LIBXML_HTML_NOIMPLIED|LIBXML_HTML_NODEFDTD|LIBXML_NONET|LIBXML_NOWARNING|LIBXML_NOXMLDECL);
6625
+		$dom->loadHTML($stringtoclean, LIBXML_ERR_NONE | LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD | LIBXML_NONET | LIBXML_NOWARNING | LIBXML_NOXMLDECL);
6626 6626
 
6627 6627
 		if (is_object($dom)) {
6628 6628
 			for ($els = $dom->getElementsByTagname('*'), $i = $els->length - 1; $i >= 0; $i--) {
6629 6629
 				for ($attrs = $els->item($i)->attributes, $ii = $attrs->length - 1; $ii >= 0; $ii--) {
6630 6630
 					//var_dump($attrs->item($ii));
6631
-					if (! empty($attrs->item($ii)->name)) {
6631
+					if (!empty($attrs->item($ii)->name)) {
6632 6632
 						// Delete attribute if not into allowed_attributes
6633
-						if (! in_array($attrs->item($ii)->name, $allowed_attributes)) {
6633
+						if (!in_array($attrs->item($ii)->name, $allowed_attributes)) {
6634 6634
 							$els->item($i)->removeAttribute($attrs->item($ii)->name);
6635 6635
 						} elseif (in_array($attrs->item($ii)->name, array('style'))) {
6636 6636
 							$valuetoclean = $attrs->item($ii)->value;
@@ -6638,7 +6638,7 @@  discard block
 block discarded – undo
6638 6638
 							if (isset($valuetoclean)) {
6639 6639
 								do {
6640 6640
 									$oldvaluetoclean = $valuetoclean;
6641
-									$valuetoclean = preg_replace('/\/\*.*\*\//m', '', $valuetoclean);	// clean css comments
6641
+									$valuetoclean = preg_replace('/\/\*.*\*\//m', '', $valuetoclean); // clean css comments
6642 6642
 									$valuetoclean = preg_replace('/position\s*:\s*[a-z]+/mi', '', $valuetoclean);
6643 6643
 									if ($els->item($i)->tagName == 'a') {	// more paranoiac cleaning for clickable tags.
6644 6644
 										$valuetoclean = preg_replace('/display\s*://m', '', $valuetoclean);
@@ -6834,7 +6834,7 @@  discard block
 block discarded – undo
6834 6834
  */
6835 6835
 function dol_htmlcleanlastbr($stringtodecode)
6836 6836
 {
6837
-	$ret = preg_replace('/&nbsp;$/i', "", $stringtodecode);		// Because wysiwyg editor may add a &nbsp; at end of last line
6837
+	$ret = preg_replace('/&nbsp;$/i', "", $stringtodecode); // Because wysiwyg editor may add a &nbsp; at end of last line
6838 6838
 	$ret = preg_replace('/(<br>|<br(\s[\sa-zA-Z_="]*)?\/?>|'."\n".'|'."\r".')+$/i', "", $ret);
6839 6839
 	return $ret;
6840 6840
 }
@@ -6871,7 +6871,7 @@  discard block
 block discarded – undo
6871 6871
  * @param   bool    $double_encode  When double_encode is turned off, PHP will not encode existing html entities
6872 6872
  * @return  string  $ret            Encoded string
6873 6873
  */
6874
-function dol_htmlentities($string, $flags = ENT_QUOTES|ENT_SUBSTITUTE, $encoding = 'UTF-8', $double_encode = false)
6874
+function dol_htmlentities($string, $flags = ENT_QUOTES | ENT_SUBSTITUTE, $encoding = 'UTF-8', $double_encode = false)
6875 6875
 {
6876 6876
 	return htmlentities($string, $flags, $encoding, $double_encode);
6877 6877
 }
@@ -7113,7 +7113,7 @@  discard block
 block discarded – undo
7113 7113
 			'__MYCOMPANY_PROFID5__' => $mysoc->idprof5,
7114 7114
 			'__MYCOMPANY_PROFID6__' => $mysoc->idprof6,
7115 7115
 			'__MYCOMPANY_CAPITAL__' => $mysoc->capital,
7116
-			'__MYCOMPANY_FULLADDRESS__' => (method_exists($mysoc, 'getFullAddress') ? $mysoc->getFullAddress(1, ', ') : ''),	// $mysoc may be stdClass
7116
+			'__MYCOMPANY_FULLADDRESS__' => (method_exists($mysoc, 'getFullAddress') ? $mysoc->getFullAddress(1, ', ') : ''), // $mysoc may be stdClass
7117 7117
 			'__MYCOMPANY_ADDRESS__' => $mysoc->address,
7118 7118
 			'__MYCOMPANY_ZIP__'     => $mysoc->zip,
7119 7119
 			'__MYCOMPANY_TOWN__'    => $mysoc->town,
@@ -7527,9 +7527,9 @@  discard block
 block discarded – undo
7527 7527
 
7528 7528
 		$substitutionarray['__AMOUNT_REMAIN__'] = is_object($object) ? $object->total_ttc - $already_payed_all : '';
7529 7529
 
7530
-		$substitutionarray['__AMOUNT_VAT__']      = is_object($object) ? (isset($object->total_vat) ? $object->total_vat : $object->total_tva) : '';
7531
-		$substitutionarray['__AMOUNT_VAT_TEXT__']      = is_object($object) ? (isset($object->total_vat) ? dol_convertToWord($object->total_vat, $outputlangs, '', true) : dol_convertToWord($object->total_tva, $outputlangs, '', true)) : '';
7532
-		$substitutionarray['__AMOUNT_VAT_TEXTCURRENCY__']      = is_object($object) ? (isset($object->total_vat) ? dol_convertToWord($object->total_vat, $outputlangs, $conf->currency, true) : dol_convertToWord($object->total_tva, $outputlangs, $conf->currency, true)) : '';
7530
+		$substitutionarray['__AMOUNT_VAT__'] = is_object($object) ? (isset($object->total_vat) ? $object->total_vat : $object->total_tva) : '';
7531
+		$substitutionarray['__AMOUNT_VAT_TEXT__'] = is_object($object) ? (isset($object->total_vat) ? dol_convertToWord($object->total_vat, $outputlangs, '', true) : dol_convertToWord($object->total_tva, $outputlangs, '', true)) : '';
7532
+		$substitutionarray['__AMOUNT_VAT_TEXTCURRENCY__'] = is_object($object) ? (isset($object->total_vat) ? dol_convertToWord($object->total_vat, $outputlangs, $conf->currency, true) : dol_convertToWord($object->total_tva, $outputlangs, $conf->currency, true)) : '';
7533 7533
 
7534 7534
 		if ($onlykey != 2 || $mysoc->useLocalTax(1)) {
7535 7535
 			$substitutionarray['__AMOUNT_TAX2__']     = is_object($object) ? $object->total_localtax1 : '';
@@ -7657,7 +7657,7 @@  discard block
 block discarded – undo
7657 7657
 				// convert $newval into HTML is necessary
7658 7658
 				$text = preg_replace('/__\('.preg_quote($reg[1], '/').'\)__/', $msgishtml ? dol_htmlentitiesbr($value) : $value, $text);
7659 7659
 			} else {
7660
-				if (! $msgishtml) {
7660
+				if (!$msgishtml) {
7661 7661
 					$valueishtml = dol_textishtml($value, 1);
7662 7662
 
7663 7663
 					if ($valueishtml) {
@@ -7688,7 +7688,7 @@  discard block
 block discarded – undo
7688 7688
 			// convert $newval into HTML is necessary
7689 7689
 			$text = preg_replace('/__\['.preg_quote($keyfound, '/').'\]__/', $msgishtml ? dol_htmlentitiesbr($value) : $value, $text);
7690 7690
 		} else {
7691
-			if (! $msgishtml) {
7691
+			if (!$msgishtml) {
7692 7692
 				$valueishtml = dol_textishtml($value, 1);
7693 7693
 
7694 7694
 				if ($valueishtml) {
@@ -7716,7 +7716,7 @@  discard block
 block discarded – undo
7716 7716
 		if (empty($converttextinhtmlifnecessary)) {
7717 7717
 			$text = str_replace("$key", "$value", $text); // We must keep the " to work when value is 123.5 for example
7718 7718
 		} else {
7719
-			if (! $msgishtml) {
7719
+			if (!$msgishtml) {
7720 7720
 				$valueishtml = dol_textishtml($value, 1);
7721 7721
 
7722 7722
 				if ($valueishtml) {
@@ -8197,7 +8197,7 @@  discard block
 block discarded – undo
8197 8197
 				if ($case_sensitive) {
8198 8198
 					natsort($temp);
8199 8199
 				} else {
8200
-					natcasesort($temp);	// natecasesort is not sensible to case
8200
+					natcasesort($temp); // natecasesort is not sensible to case
8201 8201
 				}
8202 8202
 				if ($order != 'asc') {
8203 8203
 					$temp = array_reverse($temp, true);
@@ -8225,7 +8225,7 @@  discard block
 block discarded – undo
8225 8225
  */
8226 8226
 function utf8_check($str)
8227 8227
 {
8228
-	$str = (string) $str;	// Sometimes string is an int.
8228
+	$str = (string) $str; // Sometimes string is an int.
8229 8229
 
8230 8230
 	// We must use here a binary strlen function (so not dol_strlen)
8231 8231
 	$strLength = dol_strlen($str);
@@ -8633,8 +8633,8 @@  discard block
 block discarded – undo
8633 8633
 		'en-GB',
8634 8634
 		'en-IE',
8635 8635
 		'en-IN',
8636
-		'as-IN',	// as-IN must be after en-IN (en in priority if country is IN)
8637
-		'bn-IN',	// bn-IN must be after en-IN (en in priority if country is IN)
8636
+		'as-IN', // as-IN must be after en-IN (en in priority if country is IN)
8637
+		'bn-IN', // bn-IN must be after en-IN (en in priority if country is IN)
8638 8638
 		'en-JM',
8639 8639
 		'en-MY',
8640 8640
 		'en-NZ',
@@ -9031,7 +9031,7 @@  discard block
 block discarded – undo
9031 9031
 								print 'jQuery("select[name=\''.$paramkey.'\'] option[value=\'0\']").prop(\'value\', \'\');'."\n";
9032 9032
 
9033 9033
 								// Add 'field required' class on closest td for all input elements : input, textarea and select
9034
-								print 'jQuery(":input[name=\'' . $paramkey . '\']").closest("tr").find("td:first").addClass("fieldrequired");' . "\n";
9034
+								print 'jQuery(":input[name=\''.$paramkey.'\']").closest("tr").find("td:first").addClass("fieldrequired");'."\n";
9035 9035
 							}
9036 9036
 						}
9037 9037
 					}
@@ -9911,7 +9911,7 @@  discard block
 block discarded – undo
9911 9911
 {
9912 9912
 	global $conf, $db;
9913 9913
 
9914
-	$tablename = preg_replace('/^'.preg_quote(MAIN_DB_PREFIX, '/').'/', '', $tablename);	// Clean name of table for backward compatibility.
9914
+	$tablename = preg_replace('/^'.preg_quote(MAIN_DB_PREFIX, '/').'/', '', $tablename); // Clean name of table for backward compatibility.
9915 9915
 
9916 9916
 	$dictvalues = (isset($conf->cache['dictvalues_'.$tablename]) ? $conf->cache['dictvalues_'.$tablename] : null);
9917 9917
 
@@ -10266,14 +10266,14 @@  discard block
 block discarded – undo
10266 10266
 
10267 10267
 	// automatic add tooltip when title is detected
10268 10268
 	if (!empty($attr['title']) && !empty($attr['class']) && strpos($attr['class'], 'classfortooltip') === false) {
10269
-		$attr['class'].= ' classfortooltip';
10269
+		$attr['class'] .= ' classfortooltip';
10270 10270
 	}
10271 10271
 
10272 10272
 	// Js Confirm button
10273 10273
 	if ($userRight && !empty($params['confirm'])) {
10274 10274
 		if (!is_array($params['confirm'])) {
10275 10275
 			$params['confirm'] = array(
10276
-				'url' => $url . (strpos($url, '?') > 0 ? '&' : '?') . 'confirm=yes'
10276
+				'url' => $url.(strpos($url, '?') > 0 ? '&' : '?').'confirm=yes'
10277 10277
 			);
10278 10278
 		}
10279 10279
 
@@ -10286,7 +10286,7 @@  discard block
 block discarded – undo
10286 10286
 		$attr['data-confirm-cancel-btn-label'] = !empty($params['confirm']['cancel-btn-label']) ? $params['confirm']['cancel-btn-label'] : $langs->trans('CloseDialog');
10287 10287
 		$attr['data-confirm-modal'] = !empty($params['confirm']['modal']) ? $params['confirm']['modal'] : true;
10288 10288
 
10289
-		$attr['class'].= ' butActionConfirm';
10289
+		$attr['class'] .= ' butActionConfirm';
10290 10290
 	}
10291 10291
 
10292 10292
 	if (isset($attr['href']) && empty($attr['href'])) {
@@ -10324,7 +10324,7 @@  discard block
 block discarded – undo
10324 10324
 	if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
10325 10325
 
10326 10326
 	if (empty($reshook)) {
10327
-		return '<' . $tag . ' ' . $compiledAttributes . '>' . $html . '</' . $tag . '>';
10327
+		return '<'.$tag.' '.$compiledAttributes.'>'.$html.'</'.$tag.'>';
10328 10328
 	} else {
10329 10329
 		return $hookmanager->resPrint;
10330 10330
 	}
@@ -10351,9 +10351,9 @@  discard block
 block discarded – undo
10351 10351
 {
10352 10352
 	$out = '';
10353 10353
 	if (!empty($fieldValidationErrorMsg)) {
10354
-		$out.= '<span class="field-error-icon classfortooltip" title="'.dol_escape_htmltag($fieldValidationErrorMsg, 1).'"  role="alert" >'; // role alert is used for accessibility
10355
-		$out.= '<span class="fa fa-exclamation-circle" aria-hidden="true" ></span>'; // For accessibility icon is separated and aria-hidden
10356
-		$out.= '</span>';
10354
+		$out .= '<span class="field-error-icon classfortooltip" title="'.dol_escape_htmltag($fieldValidationErrorMsg, 1).'"  role="alert" >'; // role alert is used for accessibility
10355
+		$out .= '<span class="fa fa-exclamation-circle" aria-hidden="true" ></span>'; // For accessibility icon is separated and aria-hidden
10356
+		$out .= '</span>';
10357 10357
 	}
10358 10358
 
10359 10359
 	return $out;
@@ -10862,7 +10862,7 @@  discard block
 block discarded – undo
10862 10862
 		$showonlyonhover = 0;
10863 10863
 	}*/
10864 10864
 
10865
-	$tag = 'span'; 	// Using div does not work when using the js copy code.
10865
+	$tag = 'span'; // Using div does not work when using the js copy code.
10866 10866
 	if ($texttoshow) {
10867 10867
 		$result = '<span class="clipboardCP'.($showonlyonhover ? ' clipboardCPShowOnHover' : '').'"><'.$tag.' class="clipboardCPValue hidewithsize">'.dol_escape_htmltag($valuetocopy, 1, 1).'</'.$tag.'><span class="clipboardCPValueToPrint">'.dol_escape_htmltag($texttoshow, 1, 1).'</span><span class="clipboardCPButton far fa-clipboard opacitymedium paddingleft paddingright"></span><span class="clipboardCPText"></span></span>';
10868 10868
 	} else {
Please login to merge, or discard this patch.
htdocs/emailcollector/class/emailcollector.class.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -1675,7 +1675,7 @@  discard block
 block discarded – undo
1675 1675
 
1676 1676
 					// Make Operation
1677 1677
 					dol_syslog("Execute action ".$operation['type']." actionparam=".$operation['actionparam'].' thirdpartystatic->id='.$thirdpartystatic->id.' contactstatic->id='.$contactstatic->id.' projectstatic->id='.$projectstatic->id);
1678
-					dol_syslog("Execute action fk_element_id=".$fk_element_id." fk_element_type=".$fk_element_type);	// If a Dolibarr tracker id is found, we should now the id of object
1678
+					dol_syslog("Execute action fk_element_id=".$fk_element_id." fk_element_type=".$fk_element_type); // If a Dolibarr tracker id is found, we should now the id of object
1679 1679
 
1680 1680
 					$actioncode = 'EMAIL_IN';
1681 1681
 					// If we scan the Sent box, we use the code for out email
@@ -1918,7 +1918,7 @@  discard block
 block discarded – undo
1918 1918
 							$data[$val['filename']] = getFileData($imapemail, $val['pos'], $val['type'], $connection);
1919 1919
 						}
1920 1920
 						if (count($pj) > 0) {
1921
-							$sql = "SELECT rowid as id FROM " . MAIN_DB_PREFIX . "user WHERE email LIKE '%" . $from . "%'";
1921
+							$sql = "SELECT rowid as id FROM ".MAIN_DB_PREFIX."user WHERE email LIKE '%".$from."%'";
1922 1922
 							$resql = $this->db->query($sql);
1923 1923
 							if ($this->db->num_rows($resql) == 0) {
1924 1924
 								$this->errors = 'User Not allowed to add documents';
@@ -2020,17 +2020,17 @@  discard block
 block discarded – undo
2020 2020
 
2021 2021
 							$hookmanager->initHooks(array('emailcolector'));
2022 2022
 							$parameters = array('arrayobject' => $arrayobject);
2023
-							$reshook = $hookmanager->executeHooks('addmoduletoeamailcollectorjoinpiece', $parameters);    // Note that $action and $object may have been modified by some hooks
2023
+							$reshook = $hookmanager->executeHooks('addmoduletoeamailcollectorjoinpiece', $parameters); // Note that $action and $object may have been modified by some hooks
2024 2024
 							if ($reshook > 0) $arrayobject = $hookmanager->resArray;
2025 2025
 
2026 2026
 							$resultobj = array();
2027 2027
 
2028 2028
 							foreach ($arrayobject as $key => $objectdesc) {
2029 2029
 								$sql = 'SELECT DISTINCT t.rowid ';
2030
-								$sql .= ' FROM ' . MAIN_DB_PREFIX . $objectdesc['table'] . ' AS t';
2030
+								$sql .= ' FROM '.MAIN_DB_PREFIX.$objectdesc['table'].' AS t';
2031 2031
 								$sql .= ' WHERE ';
2032 2032
 								foreach ($objectdesc['fields'] as $field) {
2033
-									$sql .= "'" .$this->db->escape($subject) . "'  LIKE CONCAT('%',  t." . $field . ", '%') OR ";
2033
+									$sql .= "'".$this->db->escape($subject)."'  LIKE CONCAT('%',  t.".$field.", '%') OR ";
2034 2034
 								}
2035 2035
 								$sql = substr($sql, 0, -4);
2036 2036
 
@@ -2050,8 +2050,8 @@  discard block
 block discarded – undo
2050 2050
 								foreach ($ids as $val) {
2051 2051
 									$res = $objectmanaged->fetch($val);
2052 2052
 									if ($res) {
2053
-										$path = ($objectmanaged->entity > 1 ? "/" . $objectmanaged->entity : '');
2054
-										$dirs[] = DOL_DATA_ROOT . $path . "/" . $elementpath . '/' . dol_sanitizeFileName($objectmanaged->ref) . '/';
2053
+										$path = ($objectmanaged->entity > 1 ? "/".$objectmanaged->entity : '');
2054
+										$dirs[] = DOL_DATA_ROOT.$path."/".$elementpath.'/'.dol_sanitizeFileName($objectmanaged->ref).'/';
2055 2055
 									} else {
2056 2056
 										$this->errors = 'object not found';
2057 2057
 									}
@@ -2061,7 +2061,7 @@  discard block
 block discarded – undo
2061 2061
 								foreach ($data as $filename => $content) {
2062 2062
 									$prefix = $this->actions[$this->id]['actionparam'];
2063 2063
 
2064
-									$resr = saveAttachment($target, $prefix . '_' . $filename, $content);
2064
+									$resr = saveAttachment($target, $prefix.'_'.$filename, $content);
2065 2065
 									if ($resr == -1) {
2066 2066
 										$this->errors = 'Doc not saved';
2067 2067
 									}
@@ -2602,7 +2602,7 @@  discard block
 block discarded – undo
2602 2602
 			$attachments[$filename] = $data; // this is a problem if two files have same name
2603 2603
 
2604 2604
 			// Get file name (with extension)
2605
-			$file_name_complete =  $params['filename'];
2605
+			$file_name_complete = $params['filename'];
2606 2606
 
2607 2607
 
2608 2608
 			$destination = $destdir.'/'.$file_name_complete;
@@ -2623,9 +2623,9 @@  discard block
 block discarded – undo
2623 2623
 			 * Check if the same file name already exists in the upload folder,
2624 2624
 			 * append increment number to the original filename
2625 2625
 			 */
2626
-			while (file_exists($destdir."/" . $file_name . "." . $extension)) {
2627
-				$file_name = (string) $file_name_original . ' (' . $num . ')';
2628
-				$file_name_complete = $file_name . "." . $extension;
2626
+			while (file_exists($destdir."/".$file_name.".".$extension)) {
2627
+				$file_name = (string) $file_name_original.' ('.$num.')';
2628
+				$file_name_complete = $file_name.".".$extension;
2629 2629
 				$destination = $destdir.'/'.$file_name_complete;
2630 2630
 				$num++;
2631 2631
 			}
Please login to merge, or discard this patch.
htdocs/hrm/skill_card.php 1 patch
Spacing   +101 added lines, -101 removed lines patch added patch discarded remove patch
@@ -28,11 +28,11 @@  discard block
 block discarded – undo
28 28
 
29 29
 // Load Dolibarr environment
30 30
 require '../main.inc.php';
31
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formcompany.class.php';
32
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formfile.class.php';
33
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php';
34
-require_once DOL_DOCUMENT_ROOT . '/hrm/class/skill.class.php';
35
-require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_skill.lib.php';
31
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
32
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
33
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
34
+require_once DOL_DOCUMENT_ROOT.'/hrm/class/skill.class.php';
35
+require_once DOL_DOCUMENT_ROOT.'/hrm/lib/hrm_skill.lib.php';
36 36
 
37 37
 
38 38
 // Load translation files required by the page
@@ -65,8 +65,8 @@  discard block
 block discarded – undo
65 65
 $search_all = GETPOST("search_all", 'alpha');
66 66
 $search = array();
67 67
 foreach ($object->fields as $key => $val) {
68
-	if (GETPOST('search_' . $key, 'alpha')) {
69
-		$search[$key] = GETPOST('search_' . $key, 'alpha');
68
+	if (GETPOST('search_'.$key, 'alpha')) {
69
+		$search[$key] = GETPOST('search_'.$key, 'alpha');
70 70
 	}
71 71
 }
72 72
 
@@ -75,13 +75,13 @@  discard block
 block discarded – undo
75 75
 }
76 76
 
77 77
 // Load object
78
-include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be include, not include_once.
78
+include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once.
79 79
 
80 80
 
81 81
 $permissiontoread = $user->rights->hrm->all->read;
82 82
 $permissiontoadd = $user->rights->hrm->all->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
83 83
 $permissiontodelete = $user->rights->hrm->all->delete;
84
-$upload_dir = $conf->hrm->multidir_output[isset($object->entity) ? $object->entity : 1] . '/skill';
84
+$upload_dir = $conf->hrm->multidir_output[isset($object->entity) ? $object->entity : 1].'/skill';
85 85
 
86 86
 // Security check (enable the most restrictive one)
87 87
 //if ($user->socid > 0) accessforbidden();
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
 			if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) {
115 115
 				$backtopage = $backurlforlist;
116 116
 			} else {
117
-				$backtopage = DOL_URL_ROOT.'/hrm/skill_card.php?id=' . ($id > 0 ? $id : '__ID__');
117
+				$backtopage = DOL_URL_ROOT.'/hrm/skill_card.php?id='.($id > 0 ? $id : '__ID__');
118 118
 			}
119 119
 		}
120 120
 	}
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
 
124 124
 
125 125
 	// Actions cancel, add, update, update_extras, confirm_validate, confirm_delete, confirm_deleteline, confirm_clone, confirm_close, confirm_setdraft, confirm_reopen
126
-	include DOL_DOCUMENT_ROOT . '/core/actions_addupdatedelete.inc.php';
126
+	include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php';
127 127
 
128 128
 	// action update on Skilldet
129 129
 
@@ -147,16 +147,16 @@  discard block
 block discarded – undo
147 147
 
148 148
 
149 149
 	// Actions when linking object each other
150
-	include DOL_DOCUMENT_ROOT . '/core/actions_dellink.inc.php';
150
+	include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php';
151 151
 
152 152
 	// Actions when printing a doc from card
153
-	include DOL_DOCUMENT_ROOT . '/core/actions_printing.inc.php';
153
+	include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
154 154
 
155 155
 	// Action to move up and down lines of object
156 156
 	//include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php';
157 157
 
158 158
 	// Action to build doc
159
-	include DOL_DOCUMENT_ROOT . '/core/actions_builddoc.inc.php';
159
+	include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
160 160
 
161 161
 	if ($action == 'set_thirdparty' && $permissiontoadd) {
162 162
 		$object->setValueFrom('fk_soc', GETPOST('fk_soc', 'int'), '', '', 'date', '', $user, $triggermodname);
@@ -168,8 +168,8 @@  discard block
 block discarded – undo
168 168
 	// Actions to send emails
169 169
 	$triggersendname = 'hrm_SKILL_SENTBYMAIL';
170 170
 	$autocopy = 'MAIN_MAIL_AUTOCOPY_SKILL_TO';
171
-	$trackid = 'skill' . $object->id;
172
-	include DOL_DOCUMENT_ROOT . '/core/actions_sendmails.inc.php';
171
+	$trackid = 'skill'.$object->id;
172
+	include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
173 173
 }
174 174
 
175 175
 
@@ -188,25 +188,25 @@  discard block
 block discarded – undo
188 188
 
189 189
 // Part to create
190 190
 if ($action == 'create') {
191
-	print load_fiche_titre($langs->trans("NewSkill"), '', 'object_' . $object->picto);
191
+	print load_fiche_titre($langs->trans("NewSkill"), '', 'object_'.$object->picto);
192 192
 
193
-	print '<form method="POST" action="' . $_SERVER["PHP_SELF"] . '">';
194
-	print '<input type="hidden" name="token" value="' . newToken() . '">';
193
+	print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
194
+	print '<input type="hidden" name="token" value="'.newToken().'">';
195 195
 	print '<input type="hidden" name="action" value="add">';
196
-	$backtopage .= (strpos($backtopage, '?') > 0 ? '&' : '?' ) ."objecttype=job";
196
+	$backtopage .= (strpos($backtopage, '?') > 0 ? '&' : '?')."objecttype=job";
197 197
 	if ($backtopage) {
198
-		print '<input type="hidden" name="backtopage" value="' . $backtopage . '">';
198
+		print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
199 199
 	}
200 200
 	if ($backtopageforcancel) {
201
-		print '<input type="hidden" name="backtopageforcancel" value="' . $backtopageforcancel . '">';
201
+		print '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">';
202 202
 	}
203 203
 
204 204
 	print dol_get_fiche_head(array(), '');
205 205
 
206
-	print '<table class="border centpercent tableforfieldcreate">' . "\n";
206
+	print '<table class="border centpercent tableforfieldcreate">'."\n";
207 207
 
208 208
 	// Common attributes
209
-	include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_add.tpl.php';
209
+	include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_add.tpl.php';
210 210
 
211 211
 	// Other attributes
212 212
 	include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php';
@@ -216,15 +216,15 @@  discard block
 block discarded – undo
216 216
 	//@todo je stop ici ... à continuer  (affichage des 5 skilled input pour create action
217 217
 	//print $object->showInputField($val, $key, $value, '', '['']', '', 0);
218 218
 
219
-	print '</table>' . "\n";
219
+	print '</table>'."\n";
220 220
 
221 221
 	print dol_get_fiche_end();
222 222
 
223 223
 	print '<div class="center">';
224
-	print '<input type="submit" class="button" name="add" value="' . dol_escape_htmltag($langs->trans("Create")) . '">';
224
+	print '<input type="submit" class="button" name="add" value="'.dol_escape_htmltag($langs->trans("Create")).'">';
225 225
 	print '&nbsp; ';
226 226
 
227
-	print '<input type="' . ($backtopage ? "submit" : "button") . '" class="button button-cancel" name="cancel" value="' . dol_escape_htmltag($langs->trans("Cancel")) . '"' . ($backtopage ? '' : ' onclick="javascript:history.go(-1)"') . '>'; // Cancel for create does not post form if we don't know the backtopage
227
+	print '<input type="'.($backtopage ? "submit" : "button").'" class="button button-cancel" name="cancel" value="'.dol_escape_htmltag($langs->trans("Cancel")).'"'.($backtopage ? '' : ' onclick="javascript:history.go(-1)"').'>'; // Cancel for create does not post form if we don't know the backtopage
228 228
 	print '</div>';
229 229
 
230 230
 	print '</form>';
@@ -235,25 +235,25 @@  discard block
 block discarded – undo
235 235
 // Part to edit record
236 236
 // and skilldet edition
237 237
 if (($id || $ref) && $action == 'edit') {
238
-	print load_fiche_titre($langs->trans("Skill"), '', 'object_' . $object->picto);
238
+	print load_fiche_titre($langs->trans("Skill"), '', 'object_'.$object->picto);
239 239
 
240
-	print '<form method="POST" action="' . $_SERVER["PHP_SELF"] . '">';
241
-	print '<input type="hidden" name="token" value="' . newToken() . '">';
240
+	print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
241
+	print '<input type="hidden" name="token" value="'.newToken().'">';
242 242
 	print '<input type="hidden" name="action" value="update">';
243
-	print '<input type="hidden" name="id" value="' . $object->id . '">';
243
+	print '<input type="hidden" name="id" value="'.$object->id.'">';
244 244
 	if ($backtopage) {
245
-		print '<input type="hidden" name="backtopage" value="' . $backtopage . '">';
245
+		print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
246 246
 	}
247 247
 	if ($backtopageforcancel) {
248
-		print '<input type="hidden" name="backtopageforcancel" value="' . $backtopageforcancel . '">';
248
+		print '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">';
249 249
 	}
250 250
 
251 251
 	print dol_get_fiche_head();
252 252
 
253
-	print '<table class="border centpercent tableforfieldedit">' . "\n";
253
+	print '<table class="border centpercent tableforfieldedit">'."\n";
254 254
 
255 255
 	// Common attributes
256
-	include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_edit.tpl.php';
256
+	include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_edit.tpl.php';
257 257
 
258 258
 	print '</table>';
259 259
 
@@ -277,7 +277,7 @@  discard block
 block discarded – undo
277 277
 				continue;
278 278
 			}
279 279
 
280
-			print '<table class="border centpercent =">' . "\n";
280
+			print '<table class="border centpercent =">'."\n";
281 281
 			$sk->fields = dol_sort_array($sk->fields, 'position');
282 282
 			foreach ($sk->fields as $key => $val) {
283 283
 				if (abs($val['visible']) != 1 && abs($val['visible']) != 3 && abs($val['visible']) != 4) {
@@ -288,7 +288,7 @@  discard block
 block discarded – undo
288 288
 					continue; // We don't want this field
289 289
 				}
290 290
 
291
-				print '<tr class="field_' . $key . '"><td';
291
+				print '<tr class="field_'.$key.'"><td';
292 292
 				print ' class="titlefieldcreate';
293 293
 				if (isset($val['notnull']) && $val['notnull'] > 0) {
294 294
 					print ' fieldrequired';
@@ -323,7 +323,7 @@  discard block
 block discarded – undo
323 323
 				if (empty($skilldetArray)) {
324 324
 					$value = GETPOSTISSET($key) ? GETPOST($key, $check) : $sk->$key;
325 325
 				} else {
326
-					$value=$skilldetArray[$sk->id];
326
+					$value = $skilldetArray[$sk->id];
327 327
 				}
328 328
 				//
329 329
 				//              } elseif ($val['type'] == 'price') {
@@ -336,7 +336,7 @@  discard block
 block discarded – undo
336 336
 					print $sk->showOutputField($val, $key, $value, '', '', '', 0);
337 337
 				} else {
338 338
 					/** @var Skilldet $sk */
339
-					print $sk->showInputField($val, $key, $value, "", "line[" . $sk->id . "]", "", "");
339
+					print $sk->showInputField($val, $key, $value, "", "line[".$sk->id."]", "", "");
340 340
 				}
341 341
 				print '</td>';
342 342
 				print '</tr>';
@@ -348,8 +348,8 @@  discard block
 block discarded – undo
348 348
 
349 349
 	print dol_get_fiche_end();
350 350
 
351
-	print '<div class="center"><input type="submit" class="button button-save" name="save" value="' . $langs->trans("Save") . '">';
352
-	print ' &nbsp; <input type="submit" class="button button-cancel" name="cancel" value="' . $langs->trans("Cancel") . '">';
351
+	print '<div class="center"><input type="submit" class="button button-save" name="save" value="'.$langs->trans("Save").'">';
352
+	print ' &nbsp; <input type="submit" class="button button-cancel" name="cancel" value="'.$langs->trans("Cancel").'">';
353 353
 	print '</div>';
354 354
 
355 355
 	print '</form>';
@@ -367,17 +367,17 @@  discard block
 block discarded – undo
367 367
 
368 368
 	// Confirmation to delete
369 369
 	if ($action == 'delete') {
370
-		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('DeleteSkill'), $langs->trans('ConfirmDeleteObject'), 'confirm_delete', '', 0, 1);
370
+		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteSkill'), $langs->trans('ConfirmDeleteObject'), 'confirm_delete', '', 0, 1);
371 371
 	}
372 372
 	// Confirmation to delete line
373 373
 	if ($action == 'deleteline') {
374
-		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id . '&lineid=' . $lineid, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_deleteline', '', 0, 1);
374
+		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_deleteline', '', 0, 1);
375 375
 	}
376 376
 	// Clone confirmation
377 377
 	if ($action == 'clone') {
378 378
 		// Create an array for form
379 379
 		$formquestion = array();
380
-		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneAsk', $object->ref), 'confirm_clone', $formquestion, 'yes', 1);
380
+		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneAsk', $object->ref), 'confirm_clone', $formquestion, 'yes', 1);
381 381
 	}
382 382
 
383 383
 	// Confirmation of action xxxx
@@ -393,7 +393,7 @@  discard block
 block discarded – undo
393 393
 			// array('type' => 'other',    'name' => 'idwarehouse',   'label' => $langs->trans("SelectWarehouseForStockDecrease"), 'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse')?GETPOST('idwarehouse'):'ifone', 'idwarehouse', '', 1, 0, 0, '', 0, $forcecombo))
394 394
 		);
395 395
 		*/
396
-		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('XXX'), $text, 'confirm_xxx', $formquestion, 0, 1, 220);
396
+		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('XXX'), $text, 'confirm_xxx', $formquestion, 0, 1, 220);
397 397
 	}
398 398
 
399 399
 	// Call Hook formConfirm
@@ -411,11 +411,11 @@  discard block
 block discarded – undo
411 411
 
412 412
 	// Object card
413 413
 	// ------------------------------------------------------------
414
-	$linkback = '<a href="' . DOL_URL_ROOT.'/hrm/skill_list.php?restore_lastsearch_values=1' . (!empty($socid) ? '&socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';
414
+	$linkback = '<a href="'.DOL_URL_ROOT.'/hrm/skill_list.php?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>';
415 415
 
416 416
 
417 417
 	$morehtmlref = '<div class="refid">';
418
-	$morehtmlref.= $object->label;
418
+	$morehtmlref .= $object->label;
419 419
 	$morehtmlref .= '</div>';
420 420
 	dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'rowid', $morehtmlref);
421 421
 
@@ -423,10 +423,10 @@  discard block
 block discarded – undo
423 423
 	print '<div class="fichecenter">';
424 424
 	print '<div class="fichehalfleft">';
425 425
 	print '<div class="underbanner clearboth"></div>';
426
-	print '<table class="border centpercent tableforfield">' . "\n";
426
+	print '<table class="border centpercent tableforfield">'."\n";
427 427
 
428
-	$object->fields['label']['visible']=0; // Already in banner
429
-	include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_view.tpl.php';
428
+	$object->fields['label']['visible'] = 0; // Already in banner
429
+	include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php';
430 430
 
431 431
 	// Other attributes. Fields from hook formObjectOptions and Extrafields.
432 432
 	include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
@@ -446,7 +446,7 @@  discard block
 block discarded – undo
446 446
 	// Buttons for actions
447 447
 
448 448
 	if ($action != 'presend' && $action != 'editline') {
449
-		print '<div class="tabsAction">' . "\n";
449
+		print '<div class="tabsAction">'."\n";
450 450
 		$parameters = array();
451 451
 		$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
452 452
 		if ($reshook < 0) {
@@ -456,15 +456,15 @@  discard block
 block discarded – undo
456 456
 		if (empty($reshook)) {
457 457
 			// Back to draft
458 458
 			if ($object->status == $object::STATUS_VALIDATED) {
459
-				print dolGetButtonAction($langs->trans('SetToDraft'), '', 'default', $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=confirm_setdraft&confirm=yes&token=' . newToken(), '', $permissiontoadd);
459
+				print dolGetButtonAction($langs->trans('SetToDraft'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=confirm_setdraft&confirm=yes&token='.newToken(), '', $permissiontoadd);
460 460
 			}
461 461
 
462
-			print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=edit&token=' . newToken(), '', $permissiontoadd);
462
+			print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit&token='.newToken(), '', $permissiontoadd);
463 463
 
464 464
 			// Delete (need delete permission, or if draft, just need create/modify permission)
465
-			print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=delete&token=' . newToken(), '', $permissiontodelete);
465
+			print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=delete&token='.newToken(), '', $permissiontodelete);
466 466
 		}
467
-		print '</div>' . "\n";
467
+		print '</div>'."\n";
468 468
 	}
469 469
 }
470 470
 
@@ -475,12 +475,12 @@  discard block
 block discarded – undo
475 475
 //*---------------------------------------------------------------------------
476 476
 
477 477
 if ($action != "create" && $action != "edit") {
478
-	require_once DOL_DOCUMENT_ROOT . '/core/class/html.formcompany.class.php';
479
-	require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
480
-	require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php';
478
+	require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
479
+	require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
480
+	require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
481 481
 
482 482
 	// load hrm libraries
483
-	require_once __DIR__ . '/class/skilldet.class.php';
483
+	require_once __DIR__.'/class/skilldet.class.php';
484 484
 
485 485
 	// for other modules
486 486
 	//dol_include_once('/othermodule/class/otherobject.class.php');
@@ -517,8 +517,8 @@  discard block
 block discarded – undo
517 517
 
518 518
 	// Default sort order (if not yet defined by previous GETPOST)
519 519
 	if (!$sortfield) {
520
-		reset($objectline->fields);                    // Reset is required to avoid key() to return null.
521
-		$sortfield = "t." . key($objectline->fields); // Set here default search field. By default 1st field in definition.
520
+		reset($objectline->fields); // Reset is required to avoid key() to return null.
521
+		$sortfield = "t.".key($objectline->fields); // Set here default search field. By default 1st field in definition.
522 522
 	}
523 523
 	if (!$sortorder) {
524 524
 		$sortorder = "ASC";
@@ -528,12 +528,12 @@  discard block
 block discarded – undo
528 528
 	$search_all = GETPOST('search_all', 'alphanohtml') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml');
529 529
 	$search = array();
530 530
 	foreach ($objectline->fields as $key => $val) {
531
-		if (GETPOST('search_' . $key, 'alpha') !== '') {
532
-			$search[$key] = GETPOST('search_' . $key, 'alpha');
531
+		if (GETPOST('search_'.$key, 'alpha') !== '') {
532
+			$search[$key] = GETPOST('search_'.$key, 'alpha');
533 533
 		}
534 534
 		if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) {
535
-			$search[$key . '_dtstart'] = dol_mktime(0, 0, 0, GETPOST('search_' . $key . '_dtstartmonth', 'int'), GETPOST('search_' . $key . '_dtstartday', 'int'), GETPOST('search_' . $key . '_dtstartyear', 'int'));
536
-			$search[$key . '_dtend'] = dol_mktime(23, 59, 59, GETPOST('search_' . $key . '_dtendmonth', 'int'), GETPOST('search_' . $key . '_dtendday', 'int'), GETPOST('search_' . $key . '_dtendyear', 'int'));
535
+			$search[$key.'_dtstart'] = dol_mktime(0, 0, 0, GETPOST('search_'.$key.'_dtstartmonth', 'int'), GETPOST('search_'.$key.'_dtstartday', 'int'), GETPOST('search_'.$key.'_dtstartyear', 'int'));
536
+			$search[$key.'_dtend'] = dol_mktime(23, 59, 59, GETPOST('search_'.$key.'_dtendmonth', 'int'), GETPOST('search_'.$key.'_dtendday', 'int'), GETPOST('search_'.$key.'_dtendyear', 'int'));
537 537
 		}
538 538
 	}
539 539
 
@@ -541,7 +541,7 @@  discard block
 block discarded – undo
541 541
 	$fieldstosearchall = array();
542 542
 	foreach ($objectline->fields as $key => $val) {
543 543
 		if (!empty($val['searchall'])) {
544
-			$fieldstosearchall['t.' . $key] = $val['label'];
544
+			$fieldstosearchall['t.'.$key] = $val['label'];
545 545
 		}
546 546
 	}
547 547
 
@@ -551,7 +551,7 @@  discard block
 block discarded – undo
551 551
 		// If $val['visible']==0, then we never show the field
552 552
 		if (!empty($val['visible'])) {
553 553
 			$visible = (int) dol_eval($val['visible'], 1, 1, '1');
554
-			$arrayfields['t.' . $key] = array(
554
+			$arrayfields['t.'.$key] = array(
555 555
 				'label' => $val['label'],
556 556
 				'checked' => (($visible < 0) ? 0 : 1),
557 557
 				'enabled' => ($visible != 3 && dol_eval($val['enabled'], 1, 1, '1')),
@@ -583,15 +583,15 @@  discard block
 block discarded – undo
583 583
 	// --------------------------------------------------------------------
584 584
 	$sql = 'SELECT ';
585 585
 	$sql .= $objectline->getFieldList('t');
586
-	$sql .= " FROM " . MAIN_DB_PREFIX . $objectline->table_element . " as t";
586
+	$sql .= " FROM ".MAIN_DB_PREFIX.$objectline->table_element." as t";
587 587
 	if ($objectline->ismultientitymanaged == 1) {
588
-		$sql .= " WHERE t.entity IN (" . getEntity($objectline->element) . ")";
588
+		$sql .= " WHERE t.entity IN (".getEntity($objectline->element).")";
589 589
 	} else {
590 590
 		$sql .= " WHERE 1 = 1 ";
591 591
 	}
592 592
 
593 593
 	if (!empty($id)) {
594
-		$sql .= " AND fk_skill = " . ((int) $id) . " ";
594
+		$sql .= " AND fk_skill = ".((int) $id)." ";
595 595
 	}
596 596
 
597 597
 	// if total of record found is smaller than limit, no need to do paging and to restart another select with limits set.
@@ -611,39 +611,39 @@  discard block
 block discarded – undo
611 611
 		$num = $db->num_rows($resql);
612 612
 	}
613 613
 
614
-	print '<form method="POST" id="searchFormList" action="' . $_SERVER["PHP_SELF"] . '">' . "\n";
614
+	print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">'."\n";
615 615
 	if ($optioncss != '') {
616
-		print '<input type="hidden" name="optioncss" value="' . $optioncss . '">';
616
+		print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
617 617
 	}
618
-	print '<input type="hidden" name="token" value="' . newToken() . '">';
618
+	print '<input type="hidden" name="token" value="'.newToken().'">';
619 619
 	print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
620 620
 	print '<input type="hidden" name="action" value="list">';
621
-	print '<input type="hidden" name="sortfield" value="' . $sortfield . '">';
622
-	print '<input type="hidden" name="sortorder" value="' . $sortorder . '">';
623
-	print '<input type="hidden" name="page" value="' . $page . '">';
624
-	print '<input type="hidden" name="contextpage" value="' . $contextpage . '">';
621
+	print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
622
+	print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
623
+	print '<input type="hidden" name="page" value="'.$page.'">';
624
+	print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
625 625
 	if (!empty($id)) {
626
-		print '<input type="hidden" name="id" value="' . $id . '">';
626
+		print '<input type="hidden" name="id" value="'.$id.'">';
627 627
 	}
628 628
 
629
-	$param_fk = "&fk_skill=" . $id . "&fk_user_creat=" . $user->rowid;
630
-	$backtopage = dol_buildpath('/hrm/skill_card.php', 1) . '?id=' . $id;
629
+	$param_fk = "&fk_skill=".$id."&fk_user_creat=".$user->rowid;
630
+	$backtopage = dol_buildpath('/hrm/skill_card.php', 1).'?id='.$id;
631 631
 	//$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);
632 632
 
633
-	print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'object_' . $object->picto, 0, "", '', '', 0, 0, 1);
633
+	print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'object_'.$object->picto, 0, "", '', '', 0, 0, 1);
634 634
 
635 635
 	// Add code for pre mass action (confirmation or email presend form)
636 636
 	$topicmail = "SendSkilldetRef";
637 637
 	$modelmail = "skilldet";
638 638
 	$objecttmp = new Skilldet($db);
639
-	$trackid = 'xxxx' . $object->id;
639
+	$trackid = 'xxxx'.$object->id;
640 640
 	//include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php';
641 641
 
642 642
 	if ($search_all) {
643 643
 		foreach ($fieldstosearchall as $key => $val) {
644 644
 			$fieldstosearchall[$key] = $langs->trans($val);
645 645
 		}
646
-		print '<div class="divsearchfieldfilter">' . $langs->trans("FilterOnInto", $search_all) . join(', ', $fieldstosearchall) . '</div>';
646
+		print '<div class="divsearchfieldfilter">'.$langs->trans("FilterOnInto", $search_all).join(', ', $fieldstosearchall).'</div>';
647 647
 	}
648 648
 
649 649
 	$moreforfilter = '';
@@ -670,7 +670,7 @@  discard block
 block discarded – undo
670 670
 	//  $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
671 671
 
672 672
 	print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you dont need reserved height for your table
673
-	print '<table class="tagtable nobottomiftotal liste' . ($moreforfilter ? " listwithfilterbefore" : "") . '">' . "\n";
673
+	print '<table class="tagtable nobottomiftotal liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
674 674
 
675 675
 
676 676
 	// Fields title label
@@ -687,13 +687,13 @@  discard block
 block discarded – undo
687 687
 		//      } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) {
688 688
 		//          $cssforfield .= ($cssforfield ? ' ' : '') . 'right';
689 689
 		//      }
690
-		if (!empty($arrayfields['t.' . $key]['checked'])) {
691
-			print getTitleFieldOfList($arrayfields['t.' . $key]['label'], 0, $_SERVER['PHP_SELF'], 't.' . $key, '', $param, ($cssforfield ? 'class="' . $cssforfield . '"' : ''), $sortfield, $sortorder, ($cssforfield ? $cssforfield . ' ' : '')) . "\n";
690
+		if (!empty($arrayfields['t.'.$key]['checked'])) {
691
+			print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, ($cssforfield ? 'class="'.$cssforfield.'"' : ''), $sortfield, $sortorder, ($cssforfield ? $cssforfield.' ' : ''))."\n";
692 692
 		}
693 693
 	}
694 694
 	print '<td></td>';
695 695
 	print '<td></td>';
696
-	print '</tr>' . "\n";
696
+	print '</tr>'."\n";
697 697
 
698 698
 
699 699
 	// Display all ranks of skill
@@ -736,14 +736,14 @@  discard block
 block discarded – undo
736 736
 			//          }
737 737
 			//if (in_array($key, array('fk_soc', 'fk_user', 'fk_warehouse'))) $cssforfield = 'tdoverflowmax100';
738 738
 
739
-			if (!empty($arrayfields['t.' . $key]['checked'])) {
740
-				print '<td' . ($cssforfield ? ' class="' . $cssforfield . '"' : '') . '>';
739
+			if (!empty($arrayfields['t.'.$key]['checked'])) {
740
+				print '<td'.($cssforfield ? ' class="'.$cssforfield.'"' : '').'>';
741 741
 				if ($key == 'status') {
742 742
 					print $objectline->getLibStatut(5);
743 743
 				} elseif ($key == 'rowid') {
744 744
 					print $objectline->showOutputField($val, $key, $objectline->id, '');
745 745
 					// ajout pencil
746
-					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>';
746
+					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>';
747 747
 				} else {
748 748
 					print $objectline->showOutputField($val, $key, $objectline->$key, '');
749 749
 				}
@@ -755,15 +755,15 @@  discard block
 block discarded – undo
755 755
 				}
756 756
 				if (!empty($val['isameasure']) && $val['isameasure'] == 1) {
757 757
 					if (!$i) {
758
-						$totalarray['pos'][$totalarray['nbfield']] = 't.' . $key;
758
+						$totalarray['pos'][$totalarray['nbfield']] = 't.'.$key;
759 759
 					}
760 760
 					if (!isset($totalarray['val'])) {
761 761
 						$totalarray['val'] = array();
762 762
 					}
763
-					if (!isset($totalarray['val']['t.' . $key])) {
764
-						$totalarray['val']['t.' . $key] = 0;
763
+					if (!isset($totalarray['val']['t.'.$key])) {
764
+						$totalarray['val']['t.'.$key] = 0;
765 765
 					}
766
-					$totalarray['val']['t.' . $key] += $objectline->$key;
766
+					$totalarray['val']['t.'.$key] += $objectline->$key;
767 767
 				}
768 768
 			}
769 769
 		}
@@ -796,7 +796,7 @@  discard block
 block discarded – undo
796 796
 			$totalarray['nbfield']++;
797 797
 		}
798 798
 
799
-		print '</tr>' . "\n";
799
+		print '</tr>'."\n";
800 800
 
801 801
 		$i++;
802 802
 	}
@@ -811,7 +811,7 @@  discard block
 block discarded – undo
811 811
 				$colspan++;
812 812
 			}
813 813
 		}
814
-		print '<tr><td colspan="' . $colspan . '" class="opacitymedium">' . $langs->trans("NoRecordFound") . '</td></tr>';
814
+		print '<tr><td colspan="'.$colspan.'" class="opacitymedium">'.$langs->trans("NoRecordFound").'</td></tr>';
815 815
 	}
816 816
 
817 817
 
@@ -821,10 +821,10 @@  discard block
 block discarded – undo
821 821
 	$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $objectline); // Note that $action and $objectline may have been modified by hook
822 822
 	print $hookmanager->resPrint;
823 823
 
824
-	print '</table>' . "\n";
825
-	print '</div>' . "\n";
824
+	print '</table>'."\n";
825
+	print '</div>'."\n";
826 826
 
827
-	print '</form>' . "\n";
827
+	print '</form>'."\n";
828 828
 
829 829
 	//  if (in_array('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) {
830 830
 	//      $hidegeneratedfilelistifempty = 1;
@@ -859,9 +859,9 @@  discard block
 block discarded – undo
859 859
 	$morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', DOL_URL_ROOT.'/hrm/skill_agenda.php?id='.$object->id);
860 860
 
861 861
 	// List of actions on element
862
-	include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
862
+	include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
863 863
 	$formactions = new FormActions($db);
864
-	$somethingshown = $formactions->showactions($object, $object->element . '@' . $object->module, (is_object($object->thirdparty) ? $object->thirdparty->id : 0), 1, '', $MAXEVENT, '', $morehtmlcenter);
864
+	$somethingshown = $formactions->showactions($object, $object->element.'@'.$object->module, (is_object($object->thirdparty) ? $object->thirdparty->id : 0), 1, '', $MAXEVENT, '', $morehtmlcenter);
865 865
 
866 866
 	print '</div></div>';
867 867
 }
Please login to merge, or discard this patch.
htdocs/hrm/position_card.php 1 patch
Spacing   +47 added lines, -47 removed lines patch added patch discarded remove patch
@@ -29,18 +29,18 @@  discard block
 block discarded – undo
29 29
 // Load Dolibarr environment
30 30
 require '../main.inc.php';
31 31
 
32
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formcompany.class.php';
33
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formfile.class.php';
34
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php';
35
-require_once DOL_DOCUMENT_ROOT . '/hrm/class/position.class.php';
36
-require_once DOL_DOCUMENT_ROOT . '/hrm/class/job.class.php';
37
-require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_position.lib.php';
32
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
33
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
34
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
35
+require_once DOL_DOCUMENT_ROOT.'/hrm/class/position.class.php';
36
+require_once DOL_DOCUMENT_ROOT.'/hrm/class/job.class.php';
37
+require_once DOL_DOCUMENT_ROOT.'/hrm/lib/hrm_position.lib.php';
38 38
 //dol_include_once('/hrm/position.php');
39 39
 
40
-$action 	= GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ...
40
+$action = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ...
41 41
 $backtopage = GETPOST('backtopage', 'alpha');
42 42
 $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha');
43
-$id 	= GETPOST('id', 'int');
43
+$id = GETPOST('id', 'int');
44 44
 
45 45
 // Initialize technical objects
46 46
 $form = new Form($db);
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 $permissiontoadd = $user->rights->hrm->all->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
55 55
 $permissiontodelete = $user->rights->hrm->all->delete;
56 56
 $permissiondellink = $user->rights->hrm->all->write; // Used by the include of actions_dellink.inc.php
57
-$upload_dir = $conf->hrm->multidir_output[isset($object->entity) ? $object->entity : 1] . '/position';
57
+$upload_dir = $conf->hrm->multidir_output[isset($object->entity) ? $object->entity : 1].'/position';
58 58
 
59 59
 // Security check (enable the most restrictive one)
60 60
 //if ($user->socid > 0) accessforbidden();
@@ -69,10 +69,10 @@  discard block
 block discarded – undo
69 69
 
70 70
 
71 71
 // Get parameters
72
-$id 	= GETPOST('id', 'int');
72
+$id = GETPOST('id', 'int');
73 73
 $fk_job = GETPOST('fk_job', 'int');
74 74
 
75
-$ref 	= GETPOST('ref', 'alpha');
75
+$ref = GETPOST('ref', 'alpha');
76 76
 $action = GETPOST('action', 'aZ09');
77 77
 $confirm = GETPOST('confirm', 'alpha');
78 78
 $cancel = GETPOST('cancel', 'aZ09');
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
 
91 91
 $extrafields = new ExtraFields($db);
92 92
 
93
-$diroutputmassaction = $conf->hrm->dir_output . '/temp/massgeneration/' . $user->id;
93
+$diroutputmassaction = $conf->hrm->dir_output.'/temp/massgeneration/'.$user->id;
94 94
 $hookmanager->initHooks(array('positioncard', 'globalcard')); // Note that conf->hooks_modules contains array
95 95
 
96 96
 // Fetch optionals attributes and labels
@@ -102,8 +102,8 @@  discard block
 block discarded – undo
102 102
 $search_all = GETPOST("search_all", 'alpha');
103 103
 $search = array();
104 104
 foreach ($object->fields as $key => $val) {
105
-	if (GETPOST('search_' . $key, 'alpha')) {
106
-		$search[$key] = GETPOST('search_' . $key, 'alpha');
105
+	if (GETPOST('search_'.$key, 'alpha')) {
106
+		$search[$key] = GETPOST('search_'.$key, 'alpha');
107 107
 	}
108 108
 }
109 109
 
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
 }
113 113
 
114 114
 // Load object
115
-include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be include, not include_once.
115
+include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once.
116 116
 
117 117
 
118 118
 /*
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
 			if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) {
136 136
 				$backtopage = $backurlforlist;
137 137
 			} else {
138
-				$backtopage = dol_buildpath('/hrm/position_card.php', 1) . '?id=' . ($id > 0 ? $id : '__ID__');
138
+				$backtopage = dol_buildpath('/hrm/position_card.php', 1).'?id='.($id > 0 ? $id : '__ID__');
139 139
 			}
140 140
 		}
141 141
 	}
@@ -143,19 +143,19 @@  discard block
 block discarded – undo
143 143
 	$triggermodname = 'hrm_POSITION_MODIFY'; // Name of trigger action code to execute when we modify record
144 144
 
145 145
 	// Actions cancel, add, update, update_extras, confirm_validate, confirm_delete, confirm_deleteline, confirm_clone, confirm_close, confirm_setdraft, confirm_reopen
146
-	include DOL_DOCUMENT_ROOT . '/core/actions_addupdatedelete.inc.php';
146
+	include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php';
147 147
 
148 148
 	// Actions when linking object each other
149
-	include DOL_DOCUMENT_ROOT . '/core/actions_dellink.inc.php';
149
+	include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php';
150 150
 
151 151
 	// Actions when printing a doc from card
152
-	include DOL_DOCUMENT_ROOT . '/core/actions_printing.inc.php';
152
+	include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
153 153
 
154 154
 	// Action to move up and down lines of object
155 155
 	//include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php';
156 156
 
157 157
 	// Action to build doc
158
-	include DOL_DOCUMENT_ROOT . '/core/actions_builddoc.inc.php';
158
+	include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
159 159
 
160 160
 	if ($action == 'set_thirdparty' && $permissiontoadd) {
161 161
 		$object->setValueFrom('fk_soc', GETPOST('fk_soc', 'int'), '', '', 'date', '', $user, $triggermodname);
@@ -167,8 +167,8 @@  discard block
 block discarded – undo
167 167
 	// Actions to send emails
168 168
 	$triggersendname = 'hrm_POSITION_SENTBYMAIL';
169 169
 	$autocopy = 'MAIN_MAIL_AUTOCOPY_POSITION_TO';
170
-	$trackid = 'position' . $object->id;
171
-	include DOL_DOCUMENT_ROOT . '/core/actions_sendmails.inc.php';
170
+	$trackid = 'position'.$object->id;
171
+	include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
172 172
 }
173 173
 
174 174
 DisplayPositionCard($object);
@@ -204,36 +204,36 @@  discard block
 block discarded – undo
204 204
 
205 205
 	// Part to edit record
206 206
 	if (($id || $ref) && $action == 'edit') {
207
-		print load_fiche_titre($langs->trans("Position"), '', 'object_' . $object->picto);
207
+		print load_fiche_titre($langs->trans("Position"), '', 'object_'.$object->picto);
208 208
 
209
-		print '<form method="POST" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '">';
210
-		print '<input type="hidden" name="token" value="' . newToken() . '">';
209
+		print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'">';
210
+		print '<input type="hidden" name="token" value="'.newToken().'">';
211 211
 		print '<input type="hidden" name="action" value="update">';
212
-		print '<input type="hidden" name="id" value="' . $object->id . '">';
212
+		print '<input type="hidden" name="id" value="'.$object->id.'">';
213 213
 
214 214
 		if ($backtopage) {
215
-			print '<input type="hidden" name="backtopage" value="' . $backtopage . '">';
215
+			print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
216 216
 		}
217 217
 		if ($backtopageforcancel) {
218
-			print '<input type="hidden" name="backtopageforcancel" value="' . $backtopageforcancel . '">';
218
+			print '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">';
219 219
 		}
220 220
 
221 221
 		print dol_get_fiche_head();
222 222
 
223
-		print '<table class="border centpercent tableforfieldedit">' . "\n";
223
+		print '<table class="border centpercent tableforfieldedit">'."\n";
224 224
 
225 225
 		// Common attributes
226
-		include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_edit.tpl.php';
226
+		include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_edit.tpl.php';
227 227
 
228 228
 		// Other attributes
229
-		include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_edit.tpl.php';
229
+		include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_edit.tpl.php';
230 230
 
231 231
 		print '</table>';
232 232
 
233 233
 		print dol_get_fiche_end();
234 234
 
235
-		print '<div class="center"><input type="submit" class="button button-save" name="save" value="' . $langs->trans("Save") . '">';
236
-		print ' &nbsp; <input type="submit" class="button button-cancel" name="cancel" value="' . $langs->trans("Cancel") . '">';
235
+		print '<div class="center"><input type="submit" class="button button-save" name="save" value="'.$langs->trans("Save").'">';
236
+		print ' &nbsp; <input type="submit" class="button button-cancel" name="cancel" value="'.$langs->trans("Cancel").'">';
237 237
 		print '</div>';
238 238
 
239 239
 		print '</form>';
@@ -252,7 +252,7 @@  discard block
 block discarded – undo
252 252
 
253 253
 		// Confirmation to delete
254 254
 		if ($action == 'delete') {
255
-			$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('DeletePosition'), $langs->trans('ConfirmDeleteObject'), 'confirm_delete', '', 0, 1);
255
+			$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeletePosition'), $langs->trans('ConfirmDeleteObject'), 'confirm_delete', '', 0, 1);
256 256
 		}
257 257
 
258 258
 		// Call Hook formConfirm
@@ -271,7 +271,7 @@  discard block
 block discarded – undo
271 271
 		// Object card
272 272
 		// ------------------------------------------------------------
273 273
 		//      $linkback = '<a href="' . dol_buildpath('/hrm/position.php', 1) . '?restore_lastsearch_values=1' . (!empty($object->fk_job) ? '&fk_job=' . $object->fk_job : '') . '">' . $langs->trans("BackToList") . '</a>';
274
-		$linkback = '<a href="' . dol_buildpath('/hrm/position_list.php', 1) . '">' . $langs->trans("BackToList") . '</a>';
274
+		$linkback = '<a href="'.dol_buildpath('/hrm/position_list.php', 1).'">'.$langs->trans("BackToList").'</a>';
275 275
 
276 276
 		$morehtmlref = '<div class="refidno">';
277 277
 		$u_position = new User(($db));
@@ -288,18 +288,18 @@  discard block
 block discarded – undo
288 288
 		print '<div class="fichecenter">';
289 289
 		print '<div class="fichehalfleft">';
290 290
 		print '<div class="underbanner clearboth"></div>';
291
-		print '<table class="border centpercent tableforfield">' . "\n";
291
+		print '<table class="border centpercent tableforfield">'."\n";
292 292
 
293 293
 		// Common attributes
294 294
 		//$keyforbreak='fieldkeytoswitchonsecondcolumn';	// We change column just before this field
295 295
 		//unset($object->fields['fk_project']);				// Hide field already shown in banner
296 296
 		//unset($object->fields['fk_soc']);					// Hide field already shown in banner
297
-		$object->fields['fk_user']['visible']=0; // Already in banner
298
-		$object->fields['fk_job']['visible']=0; // Already in banner
299
-		include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_view.tpl.php';
297
+		$object->fields['fk_user']['visible'] = 0; // Already in banner
298
+		$object->fields['fk_job']['visible'] = 0; // Already in banner
299
+		include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php';
300 300
 
301 301
 		// Other attributes. Fields from hook formObjectOptions and Extrafields.
302
-		include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
302
+		include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
303 303
 
304 304
 		print '</table>';
305 305
 		print '</div>';
@@ -318,10 +318,10 @@  discard block
 block discarded – undo
318 318
 		$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
319 319
 
320 320
 
321
-		print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=edit&token=' . newToken(), '', $permissiontoadd);
321
+		print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit&token='.newToken(), '', $permissiontoadd);
322 322
 
323 323
 		// Delete (need delete permission, or if draft, just need create/modify permission)
324
-		print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=delete&token=' . newToken(), '', $permissiontodelete);
324
+		print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=delete&token='.newToken(), '', $permissiontodelete);
325 325
 	}
326 326
 }
327 327
 
@@ -359,10 +359,10 @@  discard block
 block discarded – undo
359 359
 //}
360 360
 
361 361
 
362
-print '</table>' . "\n";
363
-print '</div>' . "\n";
362
+print '</table>'."\n";
363
+print '</div>'."\n";
364 364
 
365
-print '</form>' . "\n";
365
+print '</form>'."\n";
366 366
 
367 367
 
368 368
 if ($action !== 'edit' && $action !== 'create') {
@@ -380,9 +380,9 @@  discard block
 block discarded – undo
380 380
 	$morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', DOL_URL_ROOT.'/hrm/position_agenda.php?id='.$object->id);
381 381
 
382 382
 	// List of actions on element
383
-	include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
383
+	include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
384 384
 	$formactions = new FormActions($db);
385
-	$somethingshown = $formactions->showactions($object, $object->element . '@' . $object->module, (is_object($object->thirdparty) ? $object->thirdparty->id : 0), 1, '', $MAXEVENT, '', $morehtmlcenter);
385
+	$somethingshown = $formactions->showactions($object, $object->element.'@'.$object->module, (is_object($object->thirdparty) ? $object->thirdparty->id : 0), 1, '', $MAXEVENT, '', $morehtmlcenter);
386 386
 
387 387
 	print '</div></div>';
388 388
 }
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
@@ -29,11 +29,11 @@  discard block
 block discarded – undo
29 29
 // Load Dolibarr environment
30 30
 require '../main.inc.php';
31 31
 
32
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formcompany.class.php';
33
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formfile.class.php';
34
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php';
35
-require_once DOL_DOCUMENT_ROOT . '/hrm/class/job.class.php';
36
-require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_job.lib.php';
32
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
33
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
34
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
35
+require_once DOL_DOCUMENT_ROOT.'/hrm/class/job.class.php';
36
+require_once DOL_DOCUMENT_ROOT.'/hrm/lib/hrm_job.lib.php';
37 37
 
38 38
 // Load translation files required by the page
39 39
 $langs->loadLangs(array("hrm", "other", 'products'));
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 // Initialize technical objects
53 53
 $object = new Job($db);
54 54
 $extrafields = new ExtraFields($db);
55
-$diroutputmassaction = $conf->hrm->dir_output . '/temp/massgeneration/' . $user->id;
55
+$diroutputmassaction = $conf->hrm->dir_output.'/temp/massgeneration/'.$user->id;
56 56
 $hookmanager->initHooks(array('jobcard', 'globalcard')); // Note that conf->hooks_modules contains array
57 57
 
58 58
 // Fetch optionals attributes and labels
@@ -64,8 +64,8 @@  discard block
 block discarded – undo
64 64
 $search_all = GETPOST("search_all", 'alpha');
65 65
 $search = array();
66 66
 foreach ($object->fields as $key => $val) {
67
-	if (GETPOST('search_' . $key, 'alpha')) {
68
-		$search[$key] = GETPOST('search_' . $key, 'alpha');
67
+	if (GETPOST('search_'.$key, 'alpha')) {
68
+		$search[$key] = GETPOST('search_'.$key, 'alpha');
69 69
 	}
70 70
 }
71 71
 
@@ -74,13 +74,13 @@  discard block
 block discarded – undo
74 74
 }
75 75
 
76 76
 // Load object
77
-include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be include, not include_once.
77
+include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once.
78 78
 
79 79
 
80 80
 $permissiontoread = $user->rights->hrm->all->read;
81 81
 $permissiontoadd = $user->rights->hrm->all->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
82 82
 $permissiontodelete = $user->rights->hrm->all->delete;
83
-$upload_dir = $conf->hrm->multidir_output[isset($object->entity) ? $object->entity : 1] . '/job';
83
+$upload_dir = $conf->hrm->multidir_output[isset($object->entity) ? $object->entity : 1].'/job';
84 84
 
85 85
 // Security check (enable the most restrictive one)
86 86
 //if ($user->socid > 0) accessforbidden();
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
 			if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) {
112 112
 				$backtopage = $backurlforlist;
113 113
 			} else {
114
-				$backtopage = dol_buildpath('/hrm/job_card.php', 1) . '?id=' . ($id > 0 ? $id : '__ID__');
114
+				$backtopage = dol_buildpath('/hrm/job_card.php', 1).'?id='.($id > 0 ? $id : '__ID__');
115 115
 			}
116 116
 		}
117 117
 	}
@@ -120,19 +120,19 @@  discard block
 block discarded – undo
120 120
 
121 121
 
122 122
 	// Actions cancel, add, update, update_extras, confirm_validate, confirm_delete, confirm_deleteline, confirm_clone, confirm_close, confirm_setdraft, confirm_reopen
123
-	include DOL_DOCUMENT_ROOT . '/core/actions_addupdatedelete.inc.php';
123
+	include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php';
124 124
 
125 125
 	// Actions when linking object each other
126
-	include DOL_DOCUMENT_ROOT . '/core/actions_dellink.inc.php';
126
+	include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php';
127 127
 
128 128
 	// Actions when printing a doc from card
129
-	include DOL_DOCUMENT_ROOT . '/core/actions_printing.inc.php';
129
+	include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
130 130
 
131 131
 	// Action to move up and down lines of object
132 132
 	//include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php';
133 133
 
134 134
 	// Action to build doc
135
-	include DOL_DOCUMENT_ROOT . '/core/actions_builddoc.inc.php';
135
+	include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
136 136
 
137 137
 	if ($action == 'set_thirdparty' && $permissiontoadd) {
138 138
 		$object->setValueFrom('fk_soc', GETPOST('fk_soc', 'int'), '', '', 'date', '', $user, $triggermodname);
@@ -144,8 +144,8 @@  discard block
 block discarded – undo
144 144
 	// Actions to send emails
145 145
 	$triggersendname = 'hrm_JOB_SENTBYMAIL';
146 146
 	$autocopy = 'MAIN_MAIL_AUTOCOPY_JOB_TO';
147
-	$trackid = 'job' . $object->id;
148
-	include DOL_DOCUMENT_ROOT . '/core/actions_sendmails.inc.php';
147
+	$trackid = 'job'.$object->id;
148
+	include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
149 149
 }
150 150
 
151 151
 
@@ -181,36 +181,36 @@  discard block
 block discarded – undo
181 181
 
182 182
 // Part to create
183 183
 if ($action == 'create') {
184
-	print load_fiche_titre($langs->trans("NewObject", $langs->transnoentities('Job')), '', 'object_' . $object->picto);
184
+	print load_fiche_titre($langs->trans("NewObject", $langs->transnoentities('Job')), '', 'object_'.$object->picto);
185 185
 
186
-	print '<form method="POST" action="' . $_SERVER["PHP_SELF"] . '">';
187
-	print '<input type="hidden" name="token" value="' . newToken() . '">';
186
+	print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
187
+	print '<input type="hidden" name="token" value="'.newToken().'">';
188 188
 	print '<input type="hidden" name="action" value="add">';
189 189
 	if ($backtopage) {
190
-		print '<input type="hidden" name="backtopage" value="' . $backtopage . '">';
190
+		print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
191 191
 	}
192 192
 	if ($backtopageforcancel) {
193
-		print '<input type="hidden" name="backtopageforcancel" value="' . $backtopageforcancel . '">';
193
+		print '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">';
194 194
 	}
195 195
 
196 196
 	print dol_get_fiche_head(array(), '');
197 197
 
198
-	print '<table class="border centpercent tableforfieldcreate">' . "\n";
198
+	print '<table class="border centpercent tableforfieldcreate">'."\n";
199 199
 
200 200
 	// Common attributes
201
-	include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_add.tpl.php';
201
+	include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_add.tpl.php';
202 202
 
203 203
 	// Other attributes
204
-	include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_add.tpl.php';
204
+	include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php';
205 205
 
206
-	print '</table>' . "\n";
206
+	print '</table>'."\n";
207 207
 
208 208
 	print dol_get_fiche_end();
209 209
 
210 210
 	print '<div class="center">';
211
-	print '<input type="submit" class="button" name="add" value="' . dol_escape_htmltag($langs->trans("Create")) . '">';
211
+	print '<input type="submit" class="button" name="add" value="'.dol_escape_htmltag($langs->trans("Create")).'">';
212 212
 	print '&nbsp; ';
213
-	print '<input type="' . ($backtopage ? "submit" : "button") . '" class="button button-cancel" name="cancel" value="' . dol_escape_htmltag($langs->trans("Cancel")) . '"' . ($backtopage ? '' : ' onclick="javascript:history.go(-1)"') . '>'; // Cancel for create does not post form if we don't know the backtopage
213
+	print '<input type="'.($backtopage ? "submit" : "button").'" class="button button-cancel" name="cancel" value="'.dol_escape_htmltag($langs->trans("Cancel")).'"'.($backtopage ? '' : ' onclick="javascript:history.go(-1)"').'>'; // Cancel for create does not post form if we don't know the backtopage
214 214
 	print '</div>';
215 215
 
216 216
 	print '</form>';
@@ -220,35 +220,35 @@  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("Job"), '', 'object_' . $object->picto);
223
+	print load_fiche_titre($langs->trans("Job"), '', 'object_'.$object->picto);
224 224
 
225
-	print '<form method="POST" action="' . $_SERVER["PHP_SELF"] . '">';
226
-	print '<input type="hidden" name="token" value="' . newToken() . '">';
225
+	print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
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
 	if ($backtopage) {
230
-		print '<input type="hidden" name="backtopage" value="' . $backtopage . '">';
230
+		print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
231 231
 	}
232 232
 	if ($backtopageforcancel) {
233
-		print '<input type="hidden" name="backtopageforcancel" value="' . $backtopageforcancel . '">';
233
+		print '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">';
234 234
 	}
235 235
 
236 236
 	print dol_get_fiche_head();
237 237
 
238
-	print '<table class="border centpercent tableforfieldedit">' . "\n";
238
+	print '<table class="border centpercent tableforfieldedit">'."\n";
239 239
 
240 240
 	// Common attributes
241
-	include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_edit.tpl.php';
241
+	include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_edit.tpl.php';
242 242
 
243 243
 	// Other attributes
244
-	include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_edit.tpl.php';
244
+	include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_edit.tpl.php';
245 245
 
246 246
 	print '</table>';
247 247
 
248 248
 	print dol_get_fiche_end();
249 249
 
250
-	print '<div class="center"><input type="submit" class="button button-save" name="save" value="' . $langs->trans("Save") . '">';
251
-	print ' &nbsp; <input type="submit" class="button button-cancel" name="cancel" value="' . $langs->trans("Cancel") . '">';
250
+	print '<div class="center"><input type="submit" class="button button-save" name="save" value="'.$langs->trans("Save").'">';
251
+	print ' &nbsp; <input type="submit" class="button button-cancel" name="cancel" value="'.$langs->trans("Cancel").'">';
252 252
 	print '</div>';
253 253
 
254 254
 	print '</form>';
@@ -266,17 +266,17 @@  discard block
 block discarded – undo
266 266
 
267 267
 	// Confirmation to delete
268 268
 	if ($action == 'delete') {
269
-		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('DeleteJob'), $langs->trans('ConfirmDeleteObject'), 'confirm_delete', '', 0, 1);
269
+		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteJob'), $langs->trans('ConfirmDeleteObject'), 'confirm_delete', '', 0, 1);
270 270
 	}
271 271
 	// Confirmation to delete line
272 272
 	if ($action == 'deleteline') {
273
-		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id . '&lineid=' . $lineid, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_deleteline', '', 0, 1);
273
+		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_deleteline', '', 0, 1);
274 274
 	}
275 275
 	// Clone confirmation
276 276
 	if ($action == 'clone') {
277 277
 		// Create an array for form
278 278
 		$formquestion = array();
279
-		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneAsk', $object->ref), 'confirm_clone', $formquestion, 'yes', 1);
279
+		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneAsk', $object->ref), 'confirm_clone', $formquestion, 'yes', 1);
280 280
 	}
281 281
 
282 282
 	// Confirmation of action xxxx
@@ -292,7 +292,7 @@  discard block
 block discarded – undo
292 292
 			// array('type' => 'other',    'name' => 'idwarehouse',   'label' => $langs->trans("SelectWarehouseForStockDecrease"), 'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse')?GETPOST('idwarehouse'):'ifone', 'idwarehouse', '', 1, 0, 0, '', 0, $forcecombo))
293 293
 		);
294 294
 		*/
295
-		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('XXX'), $text, 'confirm_xxx', $formquestion, 0, 1, 220);
295
+		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('XXX'), $text, 'confirm_xxx', $formquestion, 0, 1, 220);
296 296
 	}
297 297
 
298 298
 	// Call Hook formConfirm
@@ -310,10 +310,10 @@  discard block
 block discarded – undo
310 310
 
311 311
 	// Object card
312 312
 	// ------------------------------------------------------------
313
-	$linkback = '<a href="' . dol_buildpath('/hrm/job_list.php', 1) . '?restore_lastsearch_values=1' . (!empty($socid) ? '&socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';
313
+	$linkback = '<a href="'.dol_buildpath('/hrm/job_list.php', 1).'?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>';
314 314
 
315 315
 	$morehtmlref = '<div class="refid">';
316
-	$morehtmlref.= $object->label;
316
+	$morehtmlref .= $object->label;
317 317
 	$morehtmlref .= '</div>';
318 318
 
319 319
 
@@ -323,17 +323,17 @@  discard block
 block discarded – undo
323 323
 	print '<div class="fichecenter">';
324 324
 	print '<div class="fichehalfleft">';
325 325
 	print '<div class="underbanner clearboth"></div>';
326
-	print '<table class="border centpercent tableforfield">' . "\n";
326
+	print '<table class="border centpercent tableforfield">'."\n";
327 327
 
328 328
 	// Common attributes
329 329
 	//$keyforbreak='fieldkeytoswitchonsecondcolumn';	// We change column just before this field
330 330
 	//unset($object->fields['fk_project']);				// Hide field already shown in banner
331 331
 	//unset($object->fields['fk_soc']);					// Hide field already shown in banner
332
-	$object->fields['label']['visible']=0; // Already in banner
333
-	include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_view.tpl.php';
332
+	$object->fields['label']['visible'] = 0; // Already in banner
333
+	include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php';
334 334
 
335 335
 	// Other attributes. Fields from hook formObjectOptions and Extrafields.
336
-	include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
336
+	include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
337 337
 
338 338
 	print '</table>';
339 339
 	print '</div>';
@@ -352,16 +352,16 @@  discard block
 block discarded – undo
352 352
 		// Show object lines
353 353
 		$result = $object->getLinesArray();
354 354
 
355
-		print '	<form name="addproduct" id="addproduct" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . (($action != 'editline') ? '' : '#line_' . GETPOST('lineid', 'int')) . '" method="POST">
356
-		<input type="hidden" name="token" value="' . newToken() . '">
357
-		<input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline') . '">
355
+		print '	<form name="addproduct" id="addproduct" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.(($action != 'editline') ? '' : '#line_'.GETPOST('lineid', 'int')).'" method="POST">
356
+		<input type="hidden" name="token" value="' . newToken().'">
357
+		<input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline').'">
358 358
 		<input type="hidden" name="mode" value="">
359 359
 		<input type="hidden" name="page_y" value="">
360
-		<input type="hidden" name="id" value="' . $object->id . '">
360
+		<input type="hidden" name="id" value="' . $object->id.'">
361 361
 		';
362 362
 
363 363
 		if (!empty($conf->use_javascript_ajax) && $object->status == 0) {
364
-			include DOL_DOCUMENT_ROOT . '/core/tpl/ajaxrow.tpl.php';
364
+			include DOL_DOCUMENT_ROOT.'/core/tpl/ajaxrow.tpl.php';
365 365
 		}
366 366
 
367 367
 		print '<div class="div-table-responsive-no-min">';
@@ -398,7 +398,7 @@  discard block
 block discarded – undo
398 398
 	// Buttons for actions
399 399
 
400 400
 	if ($action != 'presend' && $action != 'editline') {
401
-		print '<div class="tabsAction">' . "\n";
401
+		print '<div class="tabsAction">'."\n";
402 402
 		$parameters = array();
403 403
 		$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
404 404
 		if ($reshook < 0) {
@@ -408,15 +408,15 @@  discard block
 block discarded – undo
408 408
 		if (empty($reshook)) {
409 409
 			// Back to draft
410 410
 			if ($object->status == $object::STATUS_VALIDATED) {
411
-				print dolGetButtonAction($langs->trans('SetToDraft'), '', 'default', $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=confirm_setdraft&confirm=yes&token=' . newToken(), '', $permissiontoadd);
411
+				print dolGetButtonAction($langs->trans('SetToDraft'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=confirm_setdraft&confirm=yes&token='.newToken(), '', $permissiontoadd);
412 412
 			}
413 413
 
414
-			print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=edit&token=' . newToken(), '', $permissiontoadd);
414
+			print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit&token='.newToken(), '', $permissiontoadd);
415 415
 
416 416
 			// Delete (need delete permission, or if draft, just need create/modify permission)
417
-			print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=delete&token=' . newToken(), '', $permissiontodelete);
417
+			print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=delete&token='.newToken(), '', $permissiontodelete);
418 418
 		}
419
-		print '</div>' . "\n";
419
+		print '</div>'."\n";
420 420
 	}
421 421
 
422 422
 
@@ -434,12 +434,12 @@  discard block
 block discarded – undo
434 434
 		// Documents
435 435
 		if ($includedocgeneration) {
436 436
 			$objref = dol_sanitizeFileName($object->ref);
437
-			$relativepath = $objref . '/' . $objref . '.pdf';
438
-			$filedir = $conf->hrm->dir_output . '/' . $object->element . '/' . $objref;
439
-			$urlsource = $_SERVER["PHP_SELF"] . "?id=" . $object->id;
437
+			$relativepath = $objref.'/'.$objref.'.pdf';
438
+			$filedir = $conf->hrm->dir_output.'/'.$object->element.'/'.$objref;
439
+			$urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id;
440 440
 			$genallowed = $user->rights->hrm->job->read; // If you can read, you can build the PDF to read content
441 441
 			$delallowed = $user->rights->hrm->job->write; // If you can create/edit, you can remove a file on card
442
-			print $formfile->showdocuments('hrm:Job', $object->element . '/' . $objref, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 28, 0, '', '', '', $langs->defaultlang);
442
+			print $formfile->showdocuments('hrm:Job', $object->element.'/'.$objref, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 28, 0, '', '', '', $langs->defaultlang);
443 443
 		}
444 444
 
445 445
 		// Show links to link elements
@@ -454,9 +454,9 @@  discard block
 block discarded – undo
454 454
 		$morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', DOL_URL_ROOT.'/hrm/job_agenda.php?id='.$object->id);
455 455
 
456 456
 		// List of actions on element
457
-		include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
457
+		include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
458 458
 		$formactions = new FormActions($db);
459
-		$somethingshown = $formactions->showactions($object, $object->element . '@' . $object->module, (is_object($object->thirdparty) ? $object->thirdparty->id : 0), 1, '', $MAXEVENT, '', $morehtmlcenter);
459
+		$somethingshown = $formactions->showactions($object, $object->element.'@'.$object->module, (is_object($object->thirdparty) ? $object->thirdparty->id : 0), 1, '', $MAXEVENT, '', $morehtmlcenter);
460 460
 
461 461
 		print '</div></div>';
462 462
 	}
@@ -465,9 +465,9 @@  discard block
 block discarded – undo
465 465
 	$modelmail = 'job';
466 466
 	$defaulttopic = 'InformationMessage';
467 467
 	$diroutput = $conf->hrm->dir_output;
468
-	$trackid = 'job' . $object->id;
468
+	$trackid = 'job'.$object->id;
469 469
 
470
-	include DOL_DOCUMENT_ROOT . '/core/tpl/card_presend.tpl.php';
470
+	include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php';
471 471
 }
472 472
 
473 473
 // End of page
Please login to merge, or discard this patch.
htdocs/hrm/skill_tab.php 2 patches
Spacing   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -30,13 +30,13 @@  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 . '/user/class/user.class.php';
37
-require_once DOL_DOCUMENT_ROOT . '/hrm/class/skill.class.php';
38
-require_once DOL_DOCUMENT_ROOT . '/hrm/class/skillrank.class.php';
39
-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.'/user/class/user.class.php';
37
+require_once DOL_DOCUMENT_ROOT.'/hrm/class/skill.class.php';
38
+require_once DOL_DOCUMENT_ROOT.'/hrm/class/skillrank.class.php';
39
+require_once DOL_DOCUMENT_ROOT.'/hrm/lib/hrm_skill.lib.php';
40 40
 
41 41
 // Load translation files required by the page
42 42
 $langs->loadLangs(array("hrm", "other"));
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 // Initialize technical objects
60 60
 if (in_array($objecttype, $TAuthorizedObjects)) {
61 61
 	if ($objecttype == 'job') {
62
-		require_once DOL_DOCUMENT_ROOT . '/hrm/class/job.class.php';
62
+		require_once DOL_DOCUMENT_ROOT.'/hrm/class/job.class.php';
63 63
 		$object = new Job($db);
64 64
 	} elseif ($objecttype == "user") {
65 65
 		$object = new User($db);
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 $hookmanager->initHooks(array('skilltab', 'globalcard')); // Note that conf->hooks_modules contains array
70 70
 
71 71
 // Load object
72
-include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be include, not include_once.
72
+include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once.
73 73
 
74 74
 $permissiontoread = $user->rights->hrm->all->read;
75 75
 $permissiontoadd = $user->rights->hrm->all->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
 			if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) {
101 101
 				$backtopage = $backurlforlist;
102 102
 			} else {
103
-				$backtopage = DOL_URL_ROOT.'/hrm/skill_list.php?id=' . ($id > 0 ? $id : '__ID__');
103
+				$backtopage = DOL_URL_ROOT.'/hrm/skill_list.php?id='.($id > 0 ? $id : '__ID__');
104 104
 			}
105 105
 		}
106 106
 	}
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
 	} elseif ($action == 'saveSkill') {
129 129
 		if (!empty($TNote)) {
130 130
 			foreach ($TNote as $skillId => $rank) {
131
-				$TSkills = $skill->fetchAll('ASC', 't.rowid', 0, 0, array('customsql' => 'fk_object=' . ((int) $id) . " AND objecttype='" . $db->escape($objecttype) . "' AND fk_skill = " . ((int) $skillId)));
131
+				$TSkills = $skill->fetchAll('ASC', 't.rowid', 0, 0, array('customsql' => 'fk_object='.((int) $id)." AND objecttype='".$db->escape($objecttype)."' AND fk_skill = ".((int) $skillId)));
132 132
 				if (is_array($TSkills) && !empty($TSkills)) {
133 133
 					foreach ($TSkills as $tmpObj) {
134 134
 						$tmpObj->rankorder = $rank;
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
 				}
138 138
 			}
139 139
 			setEventMessages($langs->trans("SaveLevelSkill"), null);
140
-			header("Location: " . DOL_URL_ROOT.'/hrm/skill_tab.php?id=' . $id. '&objecttype=job');
140
+			header("Location: ".DOL_URL_ROOT.'/hrm/skill_tab.php?id='.$id.'&objecttype=job');
141 141
 			exit;
142 142
 		}
143 143
 	} elseif ($action == 'confirm_deleteskill' && $confirm == 'yes') {
@@ -170,11 +170,11 @@  discard block
 block discarded – undo
170 170
 
171 171
 	// view configuration
172 172
 	if ($objecttype == 'job') {
173
-		require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_job.lib.php';
173
+		require_once DOL_DOCUMENT_ROOT.'/hrm/lib/hrm_job.lib.php';
174 174
 		$head = jobPrepareHead($object);
175 175
 		$listLink = dol_buildpath('/hrm/job_list.php', 1);
176 176
 	} elseif ($objecttype == "user") {
177
-		require_once DOL_DOCUMENT_ROOT . "/core/lib/usergroups.lib.php";
177
+		require_once DOL_DOCUMENT_ROOT."/core/lib/usergroups.lib.php";
178 178
 		$object->getRights();
179 179
 		$head = user_prepare_head($object);
180 180
 		$listLink = dol_buildpath('/user/list.php', 1);
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
 	}*/
191 191
 	// Confirmation to delete line
192 192
 	if ($action == 'ask_deleteskill') {
193
-		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id . '&objecttype=' . $objecttype . '&lineid=' . $lineid, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_deleteskill', '', 0, 1);
193
+		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&objecttype='.$objecttype.'&lineid='.$lineid, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_deleteskill', '', 0, 1);
194 194
 	}
195 195
 	// Clone confirmation
196 196
 	/*if ($action == 'clone') {
@@ -214,10 +214,10 @@  discard block
 block discarded – undo
214 214
 
215 215
 	// Object card
216 216
 	// ------------------------------------------------------------
217
-	$linkback = '<a href="' . $listLink . '?restore_lastsearch_values=1' . (!empty($socid) ? '&socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';
217
+	$linkback = '<a href="'.$listLink.'?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>';
218 218
 
219 219
 	$morehtmlref = '<div class="refid">';
220
-	$morehtmlref.= $object->label;
220
+	$morehtmlref .= $object->label;
221 221
 	$morehtmlref .= '</div>';
222 222
 
223 223
 	dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'rowid', $morehtmlref, '&objecttype='.$objecttype);
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
 	$TAllSkills = $static_skill->fetchAll();
229 229
 
230 230
 	// Array format for multiselectarray function
231
-	$TAllSkillsFormatted=array();
231
+	$TAllSkillsFormatted = array();
232 232
 	if (!empty($TAllSkills)) {
233 233
 		foreach ($TAllSkills as $k=>$v) {
234 234
 			$TAllSkillsFormatted[$k] = $v->label;
@@ -236,7 +236,7 @@  discard block
 block discarded – undo
236 236
 	}
237 237
 
238 238
 	// table of skillRank linked to current object
239
-	$TSkillsJob = $skill->fetchAll('ASC', 't.rowid', 0, 0, array('customsql' => 'fk_object=' . ((int) $id) . " AND objecttype='" . $db->escape($objecttype) . "'"));
239
+	$TSkillsJob = $skill->fetchAll('ASC', 't.rowid', 0, 0, array('customsql' => 'fk_object='.((int) $id)." AND objecttype='".$db->escape($objecttype)."'"));
240 240
 
241 241
 	$TAlreadyUsedSkill = array();
242 242
 	if (is_array($TSkillsJob) && !empty($TSkillsJob)) {
@@ -272,9 +272,9 @@  discard block
 block discarded – undo
272 272
 	}
273 273
 	print '</tr>'."\n";
274 274
 
275
-	$object->fields['label']['visible']=0; // Already in banner
276
-	$object->fields['firstname']['visible']=0; // Already in banner
277
-	$object->fields['lastname']['visible']=0; // Already in banner
275
+	$object->fields['label']['visible'] = 0; // Already in banner
276
+	$object->fields['firstname']['visible'] = 0; // Already in banner
277
+	$object->fields['lastname']['visible'] = 0; // Already in banner
278 278
 	//include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_view.tpl.php';
279 279
 
280 280
 	// Ref employee
@@ -313,16 +313,16 @@  discard block
 block discarded – undo
313 313
 
314 314
 	if ($objecttype != 'user' && $permissiontoadd) {
315 315
 		// form pour ajouter des compétences
316
-		print '<form name="addSkill" method="post" action="' . $_SERVER['PHP_SELF'] . '">';
317
-		print '<input type="hidden" name="objecttype" value="' . $objecttype . '">';
318
-		print '<input type="hidden" name="id" value="' . $id . '">';
316
+		print '<form name="addSkill" method="post" action="'.$_SERVER['PHP_SELF'].'">';
317
+		print '<input type="hidden" name="objecttype" value="'.$objecttype.'">';
318
+		print '<input type="hidden" name="id" value="'.$id.'">';
319 319
 		print '<input type="hidden" name="action" value="addSkill">';
320 320
 		print '<div class="div-table-responsive-no-min">';
321 321
 		print '<table id="tablelines" class="noborder noshadow" width="100%">';
322
-		print '<tr><td style="width:90%">' . $langs->trans('AddSkill') . '</td><td style="width:10%"></td></tr>';
322
+		print '<tr><td style="width:90%">'.$langs->trans('AddSkill').'</td><td style="width:10%"></td></tr>';
323 323
 		print '<tr>';
324
-		print '<td>' . $form->multiselectarray('fk_skill', array_diff_key($TAllSkillsFormatted, $TAlreadyUsedSkill), array(), 0, 0, '', 0, '100%') . '</td>';
325
-		print '<td><input class="button reposition" type="submit" value="' . $langs->trans('Add') . '"></td>';
324
+		print '<td>'.$form->multiselectarray('fk_skill', array_diff_key($TAllSkillsFormatted, $TAlreadyUsedSkill), array(), 0, 0, '', 0, '100%').'</td>';
325
+		print '<td><input class="button reposition" type="submit" value="'.$langs->trans('Add').'"></td>';
326 326
 		print '</tr>';
327 327
 		print '</table>';
328 328
 		print '</div>';
@@ -333,9 +333,9 @@  discard block
 block discarded – undo
333 333
 	print '<div class="clearboth"></div>';
334 334
 
335 335
 	if ($objecttype != 'user' && $permissiontoadd) {
336
-		print '<form name="saveSkill" method="post" action="' . $_SERVER['PHP_SELF'] . '">';
337
-		print '<input type="hidden" name="objecttype" value="' . $objecttype . '">';
338
-		print '<input type="hidden" name="id" value="' . $id . '">';
336
+		print '<form name="saveSkill" method="post" action="'.$_SERVER['PHP_SELF'].'">';
337
+		print '<input type="hidden" name="objecttype" value="'.$objecttype.'">';
338
+		print '<input type="hidden" name="id" value="'.$id.'">';
339 339
 		print '<input type="hidden" name="action" value="saveSkill">';
340 340
 	}
341 341
 	print '<div class="div-table-responsive-no-min">';
@@ -351,7 +351,7 @@  discard block
 block discarded – undo
351 351
 	}
352 352
 	print '</tr>';
353 353
 	if (!is_array($TSkillsJob) || empty($TSkillsJob)) {
354
-		print '<tr><td><span class="opacitymedium">' . $langs->trans("NoRecordFound") . '</span></td></tr>';
354
+		print '<tr><td><span class="opacitymedium">'.$langs->trans("NoRecordFound").'</span></td></tr>';
355 355
 	} else {
356 356
 		$sk = new Skill($db);
357 357
 		foreach ($TSkillsJob as $skillElement) {
@@ -370,7 +370,7 @@  discard block
 block discarded – undo
370 370
 			if ($objecttype != 'user' && $permissiontoadd) {
371 371
 				print '<td class="linecoledit"></td>';
372 372
 				print '<td class="linecoldelete">';
373
-				print '<a class="reposition" href="' . $_SERVER["PHP_SELF"] . '?id=' . $skillElement->fk_object . '&amp;objecttype=' . $objecttype . '&amp;action=ask_deleteskill&amp;lineid=' . $skillElement->id . '">';
373
+				print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$skillElement->fk_object.'&amp;objecttype='.$objecttype.'&amp;action=ask_deleteskill&amp;lineid='.$skillElement->id.'">';
374 374
 				print img_delete();
375 375
 				print '</a>';
376 376
 			}
@@ -380,7 +380,7 @@  discard block
 block discarded – undo
380 380
 	}
381 381
 
382 382
 	print '</table>';
383
-	if ($objecttype != 'user' && $permissiontoadd) print '<td><input class="button pull-right" type="submit" value="' . $langs->trans('SaveRank') . '"></td>';
383
+	if ($objecttype != 'user' && $permissiontoadd) print '<td><input class="button pull-right" type="submit" value="'.$langs->trans('SaveRank').'"></td>';
384 384
 	print '</div>';
385 385
 	if ($objecttype != 'user' && $permissiontoadd) print '</form>';
386 386
 
Please login to merge, or discard this patch.
Braces   +24 added lines, -8 removed lines patch added patch discarded remove patch
@@ -64,7 +64,9 @@  discard block
 block discarded – undo
64 64
 	} elseif ($objecttype == "user") {
65 65
 		$object = new User($db);
66 66
 	}
67
-} else accessforbidden($langs->trans('ErrorBadObjectType'));
67
+} else {
68
+	accessforbidden($langs->trans('ErrorBadObjectType'));
69
+}
68 70
 
69 71
 $hookmanager->initHooks(array('skilltab', 'globalcard')); // Note that conf->hooks_modules contains array
70 72
 
@@ -75,9 +77,15 @@  discard block
 block discarded – undo
75 77
 $permissiontoadd = $user->rights->hrm->all->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
76 78
 
77 79
 // Security check (enable the most restrictive one)
78
-if ($user->socid > 0) accessforbidden();
79
-if (empty($conf->hrm->enabled)) accessforbidden();
80
-if (!$permissiontoread) accessforbidden();
80
+if ($user->socid > 0) {
81
+	accessforbidden();
82
+}
83
+if (empty($conf->hrm->enabled)) {
84
+	accessforbidden();
85
+}
86
+if (!$permissiontoread) {
87
+	accessforbidden();
88
+}
81 89
 
82 90
 
83 91
 /*
@@ -120,10 +128,14 @@  discard block
 block discarded – undo
120 128
 				$skillAdded->fk_object = $id;
121 129
 				$skillAdded->objecttype = $objecttype;
122 130
 				$ret = $skillAdded->create($user);
123
-				if ($ret < 0) setEventMessages($skillAdded->error, null, 'errors');
131
+				if ($ret < 0) {
132
+					setEventMessages($skillAdded->error, null, 'errors');
133
+				}
124 134
 				//else unset($TSkillsToAdd);
125 135
 			}
126
-			if ($ret > 0) setEventMessages($langs->trans("SaveAddSkill"), null);
136
+			if ($ret > 0) {
137
+				setEventMessages($langs->trans("SaveAddSkill"), null);
138
+			}
127 139
 		}
128 140
 	} elseif ($action == 'saveSkill') {
129 141
 		if (!empty($TNote)) {
@@ -380,9 +392,13 @@  discard block
 block discarded – undo
380 392
 	}
381 393
 
382 394
 	print '</table>';
383
-	if ($objecttype != 'user' && $permissiontoadd) print '<td><input class="button pull-right" type="submit" value="' . $langs->trans('SaveRank') . '"></td>';
395
+	if ($objecttype != 'user' && $permissiontoadd) {
396
+		print '<td><input class="button pull-right" type="submit" value="' . $langs->trans('SaveRank') . '"></td>';
397
+	}
384 398
 	print '</div>';
385
-	if ($objecttype != 'user' && $permissiontoadd) print '</form>';
399
+	if ($objecttype != 'user' && $permissiontoadd) {
400
+		print '</form>';
401
+	}
386 402
 
387 403
 
388 404
 	// liste des compétences liées
Please login to merge, or discard this patch.
htdocs/modulebuilder/index.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -46,8 +46,8 @@  discard block
 block discarded – undo
46 46
 $confirm = GETPOST('confirm', 'alpha');
47 47
 $cancel = GETPOST('cancel', 'alpha');
48 48
 
49
-$sortfield=GETPOST('sortfield', 'alpha');
50
-$sortorder=GETPOST('sortorder', 'alpha');
49
+$sortfield = GETPOST('sortfield', 'alpha');
50
+$sortorder = GETPOST('sortorder', 'alpha');
51 51
 
52 52
 $module = GETPOST('module', 'alpha');
53 53
 $tab = GETPOST('tab', 'aZ09');
@@ -347,7 +347,7 @@  discard block
 block discarded – undo
347 347
 
348 348
 		clearstatcache(true);
349 349
 		if (function_exists('opcache_invalidate')) {
350
-			opcache_reset();	// remove the include cache hell !
350
+			opcache_reset(); // remove the include cache hell !
351 351
 		}
352 352
 
353 353
 		header("Location: ".$_SERVER["PHP_SELF"].'?module='.$modulename);
@@ -1457,7 +1457,7 @@  discard block
 block discarded – undo
1457 1457
 				'isameasure'=>GETPOST('propisameasure', 'int'),
1458 1458
 				'comment'=>GETPOST('propcomment', 'alpha'),
1459 1459
 				'help'=>GETPOST('prophelp', 'alpha'),
1460
-				'css'=>GETPOST('propcss', 'alpha'),				// Can be 'maxwidth500 widthcentpercentminusxx' for example
1460
+				'css'=>GETPOST('propcss', 'alpha'), // Can be 'maxwidth500 widthcentpercentminusxx' for example
1461 1461
 				'cssview'=>GETPOST('propcssview', 'alpha'),
1462 1462
 				'csslist'=>GETPOST('propcsslist', 'alpha'),
1463 1463
 				'default'=>GETPOST('propdefault', 'restricthtml'),
@@ -1568,7 +1568,7 @@  discard block
 block discarded – undo
1568 1568
 
1569 1569
 			clearstatcache(true);
1570 1570
 			if (function_exists('opcache_invalidate')) {
1571
-				opcache_reset();	// remove the include cache hell !
1571
+				opcache_reset(); // remove the include cache hell !
1572 1572
 			}
1573 1573
 
1574 1574
 			header("Location: ".$_SERVER["PHP_SELF"].'?module=deletemodule');
@@ -2567,7 +2567,7 @@  discard block
 block discarded – undo
2567 2567
 						print ' <a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&tabobj='.$tabobj.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=editfile&token='.newToken().'&format=php&file='.urlencode($pathtoclass).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>';
2568 2568
 						// API file
2569 2569
 						print '<br>';
2570
-						print '<span class="fa fa-file-o"></span> '.$langs->trans("ApiClassFile").' : <strong class="wordbreak">'.(dol_is_file($realpathtoapi) ? '' : '<strike><span class="opacitymedium">').preg_replace('/^'.strtolower($module).'\//', '', $pathtoapi).(dol_is_file($realpathtoapi)?'':'</span></strike>').'</strong>';
2570
+						print '<span class="fa fa-file-o"></span> '.$langs->trans("ApiClassFile").' : <strong class="wordbreak">'.(dol_is_file($realpathtoapi) ? '' : '<strike><span class="opacitymedium">').preg_replace('/^'.strtolower($module).'\//', '', $pathtoapi).(dol_is_file($realpathtoapi) ? '' : '</span></strike>').'</strong>';
2571 2571
 						if (dol_is_file($realpathtoapi)) {
2572 2572
 							print ' <a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&tabobj='.$tabobj.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=editfile&token='.newToken().'&format=php&file='.urlencode($pathtoapi).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>';
2573 2573
 							print ' ';
@@ -2583,7 +2583,7 @@  discard block
 block discarded – undo
2583 2583
 						}
2584 2584
 						// PHPUnit
2585 2585
 						print '<br>';
2586
-						print '<span class="fa fa-file-o"></span> '.$langs->trans("TestClassFile").' : <strong class="wordbreak">'.(dol_is_file($realpathtophpunit) ? '' : '<strike><span class="opacitymedium">').preg_replace('/^'.strtolower($module).'\//', '', $pathtophpunit).(dol_is_file($realpathtophpunit)?'':'</span></strike>').'</strong>';
2586
+						print '<span class="fa fa-file-o"></span> '.$langs->trans("TestClassFile").' : <strong class="wordbreak">'.(dol_is_file($realpathtophpunit) ? '' : '<strike><span class="opacitymedium">').preg_replace('/^'.strtolower($module).'\//', '', $pathtophpunit).(dol_is_file($realpathtophpunit) ? '' : '</span></strike>').'</strong>';
2587 2587
 						if (dol_is_file($realpathtophpunit)) {
2588 2588
 							print ' <a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&tabobj='.$tabobj.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=editfile&token='.newToken().'&format=php&file='.urlencode($pathtophpunit).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>';
2589 2589
 							print ' ';
@@ -2814,25 +2814,25 @@  discard block
 block discarded – undo
2814 2814
 									$propname = $propkey;
2815 2815
 									$proplabel = $propval['label'];
2816 2816
 									$proptype = $propval['type'];
2817
-									$proparrayofkeyval = !empty($propval['arrayofkeyval'])?$propval['arrayofkeyval']:'';
2817
+									$proparrayofkeyval = !empty($propval['arrayofkeyval']) ? $propval['arrayofkeyval'] : '';
2818 2818
 									$propnotnull = $propval['notnull'];
2819
-									$propdefault = !empty($propval['default'])?$propval['default']:'';
2820
-									$propindex = !empty($propval['index'])?$propval['index']:'';
2821
-									$propforeignkey = !empty($propval['foreignkey'])?$propval['foreignkey']:'';
2819
+									$propdefault = !empty($propval['default']) ? $propval['default'] : '';
2820
+									$propindex = !empty($propval['index']) ? $propval['index'] : '';
2821
+									$propforeignkey = !empty($propval['foreignkey']) ? $propval['foreignkey'] : '';
2822 2822
 									$propposition = $propval['position'];
2823 2823
 									$propenabled = $propval['enabled'];
2824 2824
 									$propvisible = $propval['visible'];
2825
-									$propnoteditable = !empty($propval['noteditable'])?$propval['noteditable']:0;
2826
-									$propsearchall = !empty($propval['searchall'])?$propval['searchall']:0;
2827
-									$propisameasure = !empty($propval['isameasure'])?$propval['isameasure']:0;
2828
-									$propcss = !empty($propval['css'])?$propval['css']:'';
2829
-									$propcssview = !empty($propval['cssview'])?$propval['cssview']:'';
2830
-									$propcsslist = !empty($propval['csslist'])?$propval['csslist']:'';
2831
-									$prophelp = !empty($propval['help'])?$propval['help']:'';
2832
-									$propshowoncombobox = !empty($propval['showoncombobox'])?$propval['showoncombobox']:0;
2825
+									$propnoteditable = !empty($propval['noteditable']) ? $propval['noteditable'] : 0;
2826
+									$propsearchall = !empty($propval['searchall']) ? $propval['searchall'] : 0;
2827
+									$propisameasure = !empty($propval['isameasure']) ? $propval['isameasure'] : 0;
2828
+									$propcss = !empty($propval['css']) ? $propval['css'] : '';
2829
+									$propcssview = !empty($propval['cssview']) ? $propval['cssview'] : '';
2830
+									$propcsslist = !empty($propval['csslist']) ? $propval['csslist'] : '';
2831
+									$prophelp = !empty($propval['help']) ? $propval['help'] : '';
2832
+									$propshowoncombobox = !empty($propval['showoncombobox']) ? $propval['showoncombobox'] : 0;
2833 2833
 									//$propdisabled=$propval['disabled'];
2834
-									$propvalidate = !empty($propval['validate'])?$propval['validate']:0;
2835
-									$propcomment = !empty($propval['comment'])?$propval['comment']:'';
2834
+									$propvalidate = !empty($propval['validate']) ? $propval['validate'] : 0;
2835
+									$propcomment = !empty($propval['comment']) ? $propval['comment'] : '';
2836 2836
 
2837 2837
 									print '<tr class="oddeven">';
2838 2838
 
@@ -4292,9 +4292,9 @@  discard block
 block discarded – undo
4292 4292
 
4293 4293
 						print '<td>';
4294 4294
 						if ($tabName[0] === "+") {
4295
-							print '<span class="badge badge-status4 badge-status">' . dol_escape_htmltag($tabName) . '</span>';
4295
+							print '<span class="badge badge-status4 badge-status">'.dol_escape_htmltag($tabName).'</span>';
4296 4296
 						} else {
4297
-							print '<span class="badge badge-status8 badge-status">' . dol_escape_htmltag($tabName) . '</span>';
4297
+							print '<span class="badge badge-status8 badge-status">'.dol_escape_htmltag($tabName).'</span>';
4298 4298
 						}
4299 4299
 						print '</td>';
4300 4300
 
Please login to merge, or discard this patch.
htdocs/bom/bom_net_needs.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
 
125 125
 
126 126
 $title = $langs->trans('BOM');
127
-$help_url ='EN:Module_BOM';
127
+$help_url = 'EN:Module_BOM';
128 128
 llxHeader('', $title, $help_url);
129 129
 
130 130
 
@@ -184,8 +184,8 @@  discard block
 block discarded – undo
184 184
 
185 185
 	print dol_get_fiche_end();
186 186
 
187
-	$viewlink = dolGetButtonTitle($langs->trans('GroupByProduct'), '', 'fa fa-bars imgforviewmode', $_SERVER['PHP_SELF'].'?id='.$object->id.'&token='.newToken(), '', 1, array('morecss' => 'reposition '.($action !== 'treeview' ? 'btnTitleSelected':'')));
188
-	$viewlink .= dolGetButtonTitle($langs->trans('TreeStructure'), '', 'fa fa-stream imgforviewmode', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=treeview&token='.newToken(), '', 1, array('morecss' => 'reposition marginleftonly '.($action == 'treeview' ? 'btnTitleSelected':'')));
187
+	$viewlink = dolGetButtonTitle($langs->trans('GroupByProduct'), '', 'fa fa-bars imgforviewmode', $_SERVER['PHP_SELF'].'?id='.$object->id.'&token='.newToken(), '', 1, array('morecss' => 'reposition '.($action !== 'treeview' ? 'btnTitleSelected' : '')));
188
+	$viewlink .= dolGetButtonTitle($langs->trans('TreeStructure'), '', 'fa fa-stream imgforviewmode', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=treeview&token='.newToken(), '', 1, array('morecss' => 'reposition marginleftonly '.($action == 'treeview' ? 'btnTitleSelected' : '')));
189 189
 
190 190
 	print load_fiche_titre($langs->trans("BillOfMaterials"), $viewlink, 'cubes');
191 191
 
@@ -194,19 +194,19 @@  discard block
 block discarded – undo
194 194
 	 */
195 195
 	$text_stock_options = $langs->trans("RealStockDesc").'<br>';
196 196
 	$text_stock_options .= $langs->trans("RealStockWillAutomaticallyWhen").'<br>';
197
-	$text_stock_options .= (! empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT) || ! empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE) ? '- '.$langs->trans("DeStockOnShipment").'<br>' : '');
198
-	$text_stock_options .= (! empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) ? '- '.$langs->trans("DeStockOnValidateOrder").'<br>' : '');
199
-	$text_stock_options .= (! empty($conf->global->STOCK_CALCULATE_ON_BILL) ? '- '.$langs->trans("DeStockOnBill").'<br>' : '');
200
-	$text_stock_options .= (! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL) ? '- '.$langs->trans("ReStockOnBill").'<br>' : '');
201
-	$text_stock_options .= (! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER) ? '- '.$langs->trans("ReStockOnValidateOrder").'<br>' : '');
202
-	$text_stock_options .= (! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER) ? '- '.$langs->trans("ReStockOnDispatchOrder").'<br>' : '');
197
+	$text_stock_options .= (!empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT) || !empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE) ? '- '.$langs->trans("DeStockOnShipment").'<br>' : '');
198
+	$text_stock_options .= (!empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) ? '- '.$langs->trans("DeStockOnValidateOrder").'<br>' : '');
199
+	$text_stock_options .= (!empty($conf->global->STOCK_CALCULATE_ON_BILL) ? '- '.$langs->trans("DeStockOnBill").'<br>' : '');
200
+	$text_stock_options .= (!empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL) ? '- '.$langs->trans("ReStockOnBill").'<br>' : '');
201
+	$text_stock_options .= (!empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER) ? '- '.$langs->trans("ReStockOnValidateOrder").'<br>' : '');
202
+	$text_stock_options .= (!empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER) ? '- '.$langs->trans("ReStockOnDispatchOrder").'<br>' : '');
203 203
 	$text_stock_options .= (!empty($conf->global->STOCK_CALCULATE_ON_RECEPTION) || !empty($conf->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE) ? '- '.$langs->trans("StockOnReception").'<br>' : '');
204 204
 
205 205
 	print '<table id="tablelines" class="noborder noshadow" width="100%">';
206 206
 	print "<thead>\n";
207 207
 	print '<tr class="liste_titre nodrag nodrop">';
208 208
 	print '<td class="linecoldescription">'.$langs->trans('Product');
209
-	if (! empty($conf->global->BOM_SUB_BOM)  && $action == 'treeview') {
209
+	if (!empty($conf->global->BOM_SUB_BOM) && $action == 'treeview') {
210 210
 		print ' &nbsp; <a id="show_all" href="#">'.img_picto('', 'folder-open', 'class="paddingright"').$langs->trans("ExpandAll").'</a>&nbsp;&nbsp;';
211 211
 		print '<a id="hide_all" href="#">'.img_picto('', 'folder', 'class="paddingright"').$langs->trans("UndoExpandAll").'</a>&nbsp;';
212 212
 	}
@@ -215,11 +215,11 @@  discard block
 block discarded – undo
215 215
 	print '<td class="linecolstock right">'.$form->textwithpicto($langs->trans("PhysicalStock"), $text_stock_options, 1).'</td>';
216 216
 	print '<td class="linecoltheoricalstock right">'.$form->textwithpicto($langs->trans("VirtualStock"), $langs->trans("VirtualStockDesc")).'</td>';
217 217
 	print  '</tr>';
218
-	if (! empty($TChildBom)) {
218
+	if (!empty($TChildBom)) {
219 219
 		if ($action == 'treeview') {
220 220
 			foreach ($TChildBom as $fk_bom => $TProduct) {
221 221
 				$repeatChar = '&emsp;';
222
-				if (! empty($TProduct['bom'])) {
222
+				if (!empty($TProduct['bom'])) {
223 223
 					if ($TProduct['parentid'] != $object->id) print '<tr class="sub_bom_lines oddeven" parentid="'.$TProduct['parentid'].'">';
224 224
 					else print '<tr class="oddeven">';
225 225
 					print '<td class="linecoldescription">'.str_repeat($repeatChar, $TProduct['level']).$TProduct['bom']->getNomUrl(1);
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
 					print '<td class="linecoltheoricalstock right"></td>';
233 233
 					print '</tr>';
234 234
 				}
235
-				if (! empty($TProduct['product'])) {
235
+				if (!empty($TProduct['product'])) {
236 236
 					foreach ($TProduct['product'] as $fk_product => $TInfos) {
237 237
 						$prod = new Product($db);
238 238
 						$prod->fetch($fk_product);
Please login to merge, or discard this patch.