Completed
Branch develop (8b51aa)
by
unknown
16:02
created
htdocs/hrm/job_agenda.php 1 patch
Spacing   +6 added lines, -6 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 . '/contact/class/contact.class.php';
33
-require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php';
34
-require_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.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.'/contact/class/contact.class.php';
33
+require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
34
+require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.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'));
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
 	$linkback = '<a href="'.dol_buildpath('/hrm/job_list.php', 1).'?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>';
152 152
 
153 153
 	$morehtmlref = '<div class="refid">';
154
-	$morehtmlref.= $object->label;
154
+	$morehtmlref .= $object->label;
155 155
 	$morehtmlref .= '</div>';
156 156
 
157 157
 
Please login to merge, or discard this patch.
htdocs/hrm/position_agenda.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
35 35
 require_once DOL_DOCUMENT_ROOT.'/hrm/class/position.class.php';
36 36
 require_once DOL_DOCUMENT_ROOT.'/hrm/lib/hrm_position.lib.php';
37
-require_once DOL_DOCUMENT_ROOT . '/hrm/class/job.class.php';
37
+require_once DOL_DOCUMENT_ROOT.'/hrm/class/job.class.php';
38 38
 
39 39
 
40 40
 // Load translation files required by the page
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
 		$filters['search_agenda_label'] = $search_agenda_label;
228 228
 		$filters['search_rowid'] = $search_rowid;
229 229
 
230
-		$object->fields['label']=array(); // Usefull to get only agenda events linked to position (this object doesn't need label of ref field, but show_actions_done() needs it to work correctly)
230
+		$object->fields['label'] = array(); // Usefull to get only agenda events linked to position (this object doesn't need label of ref field, but show_actions_done() needs it to work correctly)
231 231
 
232 232
 		// TODO Replace this with same code than into list.php
233 233
 		show_actions_done($conf, $langs, $db, $object, null, 0, $actioncode, '', $filters, $sortfield, $sortorder, $object->module);
Please login to merge, or discard this patch.
htdocs/bookmarks/bookmarks.lib.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@
 block discarded – undo
36 36
 
37 37
 	$langs->load("bookmarks");
38 38
 
39
-	$authorized_var=array('limit','optioncss','contextpage');
39
+	$authorized_var = array('limit', 'optioncss', 'contextpage');
40 40
 	$url = $_SERVER["PHP_SELF"];
41 41
 	$url_param = array();
42 42
 	if (!empty($_SERVER["QUERY_STRING"])) {
Please login to merge, or discard this patch.
htdocs/comm/card.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -916,7 +916,7 @@
 block discarded – undo
916 916
 	 * Latest orders
917 917
 	 */
918 918
 	if (isModEnabled('commande') && $user->hasRight('commande', 'lire')) {
919
-		$param ="";
919
+		$param = "";
920 920
 
921 921
 		$sql = "SELECT s.nom, s.rowid";
922 922
 		$sql .= ", c.rowid as cid, c.entity, c.total_ht";
Please login to merge, or discard this patch.
dev/tools/dolibarr-postgres2mysql.php 2 patches
Upper-Lower-Casing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
  - If you're having problems creating your postgres dump, make sure you use "--format p --inserts"
62 62
  - Default output engine if not specified is InnoDB
63 63
 
64
-XHTML;
64
+xhtml;
65 65
 }
66 66
 
67 67
 /**
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
 function formatsize($s)
101 101
 {
102 102
 	if ($s < pow(2, 14)) {
103
-		return "{$s}B";
103
+		return "{$s}b";
104 104
 	} elseif ($s < pow(2, 20)) {
105 105
 		return sprintf("%.1f", round($s / 1024, 1)) . "K";
106 106
 	} elseif ($s < pow(2, 30)) {
Please login to merge, or discard this patch.
Spacing   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -28,12 +28,12 @@  discard block
 block discarded – undo
28 28
 
29 29
 $sapi_type = php_sapi_name();
30 30
 $script_file = basename(__FILE__);
31
-$path = dirname(__FILE__) . '/';
31
+$path = dirname(__FILE__).'/';
32 32
 
33 33
 // Test si mode batch
34 34
 $sapi_type = php_sapi_name();
35 35
 if (substr($sapi_type, 0, 3) == 'cgi') {
36
-	echo "Error: You are using PHP for CGI. To execute " . $script_file . " from command line, you must use PHP for CLI mode.\n";
36
+	echo "Error: You are using PHP for CGI. To execute ".$script_file." from command line, you must use PHP for CLI mode.\n";
37 37
 	exit();
38 38
 }
39 39
 
@@ -102,11 +102,11 @@  discard block
 block discarded – undo
102 102
 	if ($s < pow(2, 14)) {
103 103
 		return "{$s}B";
104 104
 	} elseif ($s < pow(2, 20)) {
105
-		return sprintf("%.1f", round($s / 1024, 1)) . "K";
105
+		return sprintf("%.1f", round($s / 1024, 1))."K";
106 106
 	} elseif ($s < pow(2, 30)) {
107
-		return sprintf("%.1f", round($s / 1024 / 1024, 1)) . "M";
107
+		return sprintf("%.1f", round($s / 1024 / 1024, 1))."M";
108 108
 	} else {
109
-		return sprintf("%.1f", round($s / 1024 / 1024 / 1024, 1)) . "G";
109
+		return sprintf("%.1f", round($s / 1024 / 1024 / 1024, 1))."G";
110 110
 	}
111 111
 }
112 112
 
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
 	}
139 139
 
140 140
 	$fs = filesize($infilename);
141
-	echo "Filesize: " . formatsize($fs) . "\n";
141
+	echo "Filesize: ".formatsize($fs)."\n";
142 142
 
143 143
 	while ($instr = fgets($infp)) {
144 144
 		$linenum++;
@@ -215,13 +215,13 @@  discard block
 block discarded – undo
215 215
 
216 216
 	fputs($outfp, "\n");
217 217
 
218
-	fputs($outfp, '/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;' . "\n");
219
-	fputs($outfp, '/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;' . "\n");
220
-	fputs($outfp, '/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;' . "\n");
221
-	fputs($outfp, '/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;' . "\n");
222
-	fputs($outfp, '/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;' . "\n");
223
-	fputs($outfp, '/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;' . "\n");
224
-	fputs($outfp, '/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;' . "\n");
218
+	fputs($outfp, '/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;'."\n");
219
+	fputs($outfp, '/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;'."\n");
220
+	fputs($outfp, '/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;'."\n");
221
+	fputs($outfp, '/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;'."\n");
222
+	fputs($outfp, '/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;'."\n");
223
+	fputs($outfp, '/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;'."\n");
224
+	fputs($outfp, '/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;'."\n");
225 225
 
226 226
 	printf("Completed! %9d lines   %9d sql chunks\n\n", $linenum, $chunkcount);
227 227
 
@@ -250,8 +250,8 @@  discard block
 block discarded – undo
250 250
 	}
251 251
 
252 252
 	if ($header) {
253
-		$output = "-- Converted with " . PRODUCT . "-" . VERSION . "\n";
254
-		$output .= "-- Converted on " . date("r") . "\n";
253
+		$output = "-- Converted with ".PRODUCT."-".VERSION."\n";
254
+		$output .= "-- Converted on ".date("r")."\n";
255 255
 		$output .= "\n";
256 256
 
257 257
 		$output .= "/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;\n";
@@ -282,8 +282,8 @@  discard block
 block discarded – undo
282 282
 
283 283
 		$reg = array();
284 284
 		if (preg_match('/CREATE SEQUENCE (?:public\.)(.*)_(id|rowid|id_comment)_seq/', $line, $reg)) {
285
-			$outputatend .= '-- Make field ' . $reg[2] . ' auto_increment for table ' . $reg[1] . "\n";
286
-			$outputatend .= 'ALTER TABLE ' . $reg[1] . ' CHANGE COLUMN ' . $reg[2] . ' ' . $reg[2] . ' INTEGER NOT NULL AUTO_INCREMENT;' . "\n\n";
285
+			$outputatend .= '-- Make field '.$reg[2].' auto_increment for table '.$reg[1]."\n";
286
+			$outputatend .= 'ALTER TABLE '.$reg[1].' CHANGE COLUMN '.$reg[2].' '.$reg[2].' INTEGER NOT NULL AUTO_INCREMENT;'."\n\n";
287 287
 			// var_dump($outputatend);
288 288
 		}
289 289
 
@@ -299,7 +299,7 @@  discard block
 block discarded – undo
299 299
 
300 300
 			$reg2 = array();
301 301
 			if (preg_match('/CREATE TABLE ([^\s]+)/', $line, $reg2)) {
302
-				$output .= 'DROP TABLE IF EXISTS `' . $reg2[1] . '`;' . "\n";
302
+				$output .= 'DROP TABLE IF EXISTS `'.$reg2[1].'`;'."\n";
303 303
 			}
304 304
 			$output .= $line;
305 305
 			$linenumber++;
@@ -379,7 +379,7 @@  discard block
 block discarded – undo
379 379
 				$arrayofprimaryalreadyintabledef[$in_create_table] = $in_create_table;
380 380
 			}
381 381
 
382
-			$specialfields = array("repeat","status","type","call");
382
+			$specialfields = array("repeat", "status", "type", "call");
383 383
 
384 384
 			$field = getfieldname($line);
385 385
 			if (in_array($field, $specialfields)) {
@@ -398,7 +398,7 @@  discard block
 block discarded – undo
398 398
 				$lastchr = substr($output, -2, 1);
399 399
 				// echo "lastchr=$lastchr";
400 400
 				if ($lastchr == ",") {
401
-					$output = substr($output, 0, -2) . "\n";
401
+					$output = substr($output, 0, -2)."\n";
402 402
 				}
403 403
 			}
404 404
 
@@ -423,7 +423,7 @@  discard block
 block discarded – undo
423 423
 				$after = str_replace(" (E'", " ('", $after);
424 424
 				$after = str_replace(", E'", ", '", $after);
425 425
 
426
-				$output .= $before . " VALUES " . $after;
426
+				$output .= $before." VALUES ".$after;
427 427
 				$linenumber++;
428 428
 				continue;
429 429
 			} else {
@@ -451,7 +451,7 @@  discard block
 block discarded – undo
451 451
 					$inquotes = false;
452 452
 				}
453 453
 
454
-				$output .= $before . " VALUES " . $after;
454
+				$output .= $before." VALUES ".$after;
455 455
 				do {
456 456
 					$linenumber++;
457 457
 
@@ -501,14 +501,14 @@  discard block
 block discarded – undo
501 501
 						$output .= str_replace("\n", "", $pkey);
502 502
 						// the postgres and mysql syntax for this is (at least, in the example im looking at)
503 503
 						// identical, so we can just add it as is.
504
-						$output .= $line . "\n";
504
+						$output .= $line."\n";
505 505
 					} else {
506
-						$output .= '-- ' . str_replace("\n", "", $pkey);
507
-						$output .= '-- ' . $line . "\n";
506
+						$output .= '-- '.str_replace("\n", "", $pkey);
507
+						$output .= '-- '.$line."\n";
508 508
 					}
509 509
 				} else {
510
-					$output .= '-- ' . str_replace("\n", "", $pkey);
511
-					$output .= '-- ' . $line . "\n";
510
+					$output .= '-- '.str_replace("\n", "", $pkey);
511
+					$output .= '-- '.$line."\n";
512 512
 				}
513 513
 			}
514 514
 		}
@@ -522,7 +522,7 @@  discard block
 block discarded – undo
522 522
 				$tablename = str_replace('public.', '', $matches[2]);
523 523
 				$columns = $matches[3];
524 524
 				if ($tablename && $columns) {
525
-					$output .= "ALTER TABLE `" . $tablename . "` ADD INDEX " . $indexname . "( {$columns} ) ;\n";
525
+					$output .= "ALTER TABLE `".$tablename."` ADD INDEX ".$indexname."( {$columns} ) ;\n";
526 526
 				}
527 527
 			}
528 528
 		}
@@ -534,7 +534,7 @@  discard block
 block discarded – undo
534 534
 				$tablename = str_replace('public.', '', $matches[2]);
535 535
 				$columns = str_replace('"', '', $matches[3]);
536 536
 				if ($tablename && $columns) {
537
-					$output .= "ALTER TABLE `" . $tablename . "` ADD UNIQUE INDEX " . $indexname . " ( {$columns} ) ;\n";
537
+					$output .= "ALTER TABLE `".$tablename."` ADD UNIQUE INDEX ".$indexname." ( {$columns} ) ;\n";
538 538
 				}
539 539
 			}
540 540
 		}
@@ -565,16 +565,16 @@  discard block
 block discarded – undo
565 565
 			if ($line == "\\.\n") {
566 566
 				$in_insert = false;
567 567
 				if ($values) {
568
-					$output .= "INSERT INTO $heads VALUES\n" . implode(",\n", $values) . ";\n\n";
568
+					$output .= "INSERT INTO $heads VALUES\n".implode(",\n", $values).";\n\n";
569 569
 				}
570 570
 			} else {
571 571
 				$vals = explode('	', $line);
572 572
 				foreach ($vals as $i => $val) {
573
-					$vals[$i] = ($val == '\\N') ? 'NULL' : "'" . str_replace("'", "\\'", trim($val)) . "'";
573
+					$vals[$i] = ($val == '\\N') ? 'NULL' : "'".str_replace("'", "\\'", trim($val))."'";
574 574
 				}
575
-				$values[] = '(' . implode(',', $vals) . ')';
575
+				$values[] = '('.implode(',', $vals).')';
576 576
 				if (count($values) >= 1000) {
577
-					$output .= "INSERT INTO $heads VALUES\n" . implode(",\n", $values) . ";\n";
577
+					$output .= "INSERT INTO $heads VALUES\n".implode(",\n", $values).";\n";
578 578
 					$values = array();
579 579
 				}
580 580
 			}
@@ -583,5 +583,5 @@  discard block
 block discarded – undo
583 583
 		$linenumber++;
584 584
 	}
585 585
 
586
-	return array('output' => $output,'outputatend' => $outputatend);
586
+	return array('output' => $output, 'outputatend' => $outputatend);
587 587
 }
Please login to merge, or discard this patch.
dev/tools/test/namespacemig/bbb.class.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
  */
19 19
 class Bbb
20 20
 {
21
-	const BBB='bbb';
21
+	const BBB = 'bbb';
22 22
 
23 23
 	/**
24 24
 	 * do
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 	{
30 30
 		global $globalaaa, $globalbbb;
31 31
 		echo 'dobbb'."\n";
32
-		$globalaaa.='+bbb';
33
-		$globalbbb.='+bbb';
32
+		$globalaaa .= '+bbb';
33
+		$globalbbb .= '+bbb';
34 34
 	}
35 35
 }
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,9 +25,11 @@
 block discarded – undo
25 25
 	 *
26 26
 	 * @return void
27 27
 	 */
28
-	public function do()
28
+	public function do {
29
+		()
29 30
 	{
30 31
 		global $globalaaa, $globalbbb;
32
+	}
31 33
 		echo 'dobbb'."\n";
32 34
 		$globalaaa.='+bbb';
33 35
 		$globalbbb.='+bbb';
Please login to merge, or discard this patch.
dev/tools/test/namespacemig/aaa.class.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@
 block discarded – undo
20 20
  */
21 21
 class Aaa
22 22
 {
23
-	const AAA='aaa';
23
+	const AAA = 'aaa';
24 24
 
25 25
 	/**
26 26
 	 * do
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,8 +27,10 @@
 block discarded – undo
27 27
 	 *
28 28
 	 * @return void
29 29
 	 */
30
-	public function do()
30
+	public function do {
31
+		()
31 32
 	{
32 33
 		echo 'doaaa'."\n";
33 34
 	}
35
+	}
34 36
 }
Please login to merge, or discard this patch.
dev/tools/test/testtcpdf.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -65,11 +65,11 @@
 block discarded – undo
65 65
  - To convert pfx certificate to pem: openssl pkcs12 -in tcpdf.pfx -out tcpdf.crt -nodes
66 66
 
67 67
 */
68
-$permissions=array('copy');
69
-$user_pass='aaa';
70
-$owner_pass=null;
71
-$mode=0;
72
-$pubkeys=null;
68
+$permissions = array('copy');
69
+$user_pass = 'aaa';
70
+$owner_pass = null;
71
+$mode = 0;
72
+$pubkeys = null;
73 73
 $pdf->SetProtection($permissions, $user_pass, $owner_pass, $mode, $pubkeys);
74 74
 
75 75
 // Example with public-key
Please login to merge, or discard this patch.
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -123,7 +123,7 @@
 block discarded – undo
123 123
 Encryption Example
124 124
 
125 125
 Consult the source code documentation for the SetProtection() method.
126
-EOD;
126
+eod;
127 127
 
128 128
 // print a block of text using Write()
129 129
 $pdf->Write(0, $txt, '', 0, 'L', true, 0, false, false, 0);
Please login to merge, or discard this patch.
dev/translation/strip_language_file.php 2 patches
Upper-Lower-Casing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -149,13 +149,13 @@  discard block
 block discarded – undo
149 149
 
150 150
 			// key is redundant
151 151
 			if (array_key_exists($key, $aSecondary)) {
152
-				print "Key $key is redundant in file $lSecondaryFile (line: $cnt).\n";
152
+				print "key $key is redundant in file $lSecondaryFile (line: $cnt).\n";
153 153
 				continue;
154 154
 			}
155 155
 
156 156
 			// String has no value
157 157
 			if ($value == '') {
158
-				print "Key $key has no value in file $lSecondaryFile (line: $cnt).\n";
158
+				print "key $key has no value in file $lSecondaryFile (line: $cnt).\n";
159 159
 				continue;
160 160
 			}
161 161
 
@@ -203,13 +203,13 @@  discard block
 block discarded – undo
203 203
 
204 204
 			// key is redundant
205 205
 			if (array_key_exists($key, $aEnglish)) {
206
-				print "Key $key is redundant in file $lEnglishFile (line: $cnt).\n";
206
+				print "key $key is redundant in file $lEnglishFile (line: $cnt).\n";
207 207
 				continue;
208 208
 			}
209 209
 
210 210
 			// String has no value
211 211
 			if ($value == '') {
212
-				print "Key $key has no value in file $lEnglishFile (line: $cnt).\n";
212
+				print "key $key has no value in file $lEnglishFile (line: $cnt).\n";
213 213
 				continue;
214 214
 			}
215 215
 
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
 
273 273
 			// key is redundant
274 274
 			if (array_key_exists($key, $aPrimary)) {
275
-				print "Key $key is redundant in file $lPrimaryFile (line: $cnt) - Already found into ".$fileFirstFound[$key]." (line: ".$lineFirstFound[$key].").\n";
275
+				print "key $key is redundant in file $lPrimaryFile (line: $cnt) - Already found into ".$fileFirstFound[$key]." (line: ".$lineFirstFound[$key].").\n";
276 276
 				continue;
277 277
 			} else {
278 278
 				$fileFirstFound[$key] = $fileToProcess;
@@ -281,7 +281,7 @@  discard block
 block discarded – undo
281 281
 
282 282
 			// String has no value
283 283
 			if ($value == '') {
284
-				print "Key $key has no value in file $lPrimaryFile (line: $cnt).\n";
284
+				print "key $key has no value in file $lPrimaryFile (line: $cnt).\n";
285 285
 				continue;
286 286
 			}
287 287
 
Please login to merge, or discard this patch.
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
 
47 47
 $sapi_type = php_sapi_name();
48 48
 $script_file = basename(__FILE__);
49
-$path=dirname(__FILE__).'/';
49
+$path = dirname(__FILE__).'/';
50 50
 
51 51
 // Test if batch mode
52 52
 if (substr($sapi_type, 0, 3) == 'cgi') {
@@ -66,8 +66,8 @@  discard block
 block discarded – undo
66 66
 if (empty($lPrimary) || empty($lSecondary) || empty($filesToProcess)) {
67 67
 	$rc = 1;
68 68
 	$msg = '***** Script to clean language files *****'."\n";
69
-	$msg.= 'Usage: ./dev/translation/strip_language_file.php xx_XX xx_YY [file.lang|all]'."\n";
70
-	print $msg . "(rc=$rc).\n";
69
+	$msg .= 'Usage: ./dev/translation/strip_language_file.php xx_XX xx_YY [file.lang|all]'."\n";
70
+	print $msg."(rc=$rc).\n";
71 71
 	exit($rc);
72 72
 }
73 73
 
@@ -79,14 +79,14 @@  discard block
 block discarded – undo
79 79
 if ($filesToProcess == 'all') {
80 80
 	$dir = new DirectoryIterator('htdocs/langs/'.$lPrimary);
81 81
 	while ($dir->valid()) {
82
-		if (!$dir->isDot() && $dir->isFile() && ! preg_match('/^\./', $dir->getFilename())) {
83
-			$files[] =  $dir->getFilename();
82
+		if (!$dir->isDot() && $dir->isFile() && !preg_match('/^\./', $dir->getFilename())) {
83
+			$files[] = $dir->getFilename();
84 84
 		}
85 85
 		$dir->next();
86 86
 	}
87
-	$filesToProcess=$files;
87
+	$filesToProcess = $files;
88 88
 } else {
89
-	$filesToProcess=explode(',', $filesToProcess);
89
+	$filesToProcess = explode(',', $filesToProcess);
90 90
 }
91 91
 
92 92
 // Arguments should be OK here.
@@ -97,28 +97,28 @@  discard block
 block discarded – undo
97 97
 	$lPrimaryFile = 'htdocs/langs/'.$lPrimary.'/'.$fileToProcess;
98 98
 	$lSecondaryFile = 'htdocs/langs/'.$lSecondary.'/'.$fileToProcess;
99 99
 	$lEnglishFile = 'htdocs/langs/'.$lEnglish.'/'.$fileToProcess;
100
-	$output = $lSecondaryFile . '.delta';
100
+	$output = $lSecondaryFile.'.delta';
101 101
 
102 102
 	print "---- Process language file ".$lSecondaryFile."\n";
103 103
 
104
-	if (! is_readable($lPrimaryFile)) {
104
+	if (!is_readable($lPrimaryFile)) {
105 105
 		$rc = 2;
106 106
 		$msg = "Cannot read primary language file $lPrimaryFile.";
107
-		print $msg . " (rc=$rc).\n";
107
+		print $msg." (rc=$rc).\n";
108 108
 		exit($rc);
109 109
 	}
110 110
 
111
-	if (! is_readable($lSecondaryFile)) {
111
+	if (!is_readable($lSecondaryFile)) {
112 112
 		$rc = 3;
113 113
 		$msg = "Cannot read secondary language file $lSecondaryFile. We discard this file.";
114
-		print $msg . "\n";
114
+		print $msg."\n";
115 115
 		continue;
116 116
 	}
117 117
 
118
-	if (! is_readable($lEnglishFile)) {
118
+	if (!is_readable($lEnglishFile)) {
119 119
 		$rc = 3;
120 120
 		$msg = "Cannot read english language file $lEnglishFile. We discard this file.";
121
-		print $msg . "\n";
121
+		print $msg."\n";
122 122
 		continue;
123 123
 	}
124 124
 
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
 
142 142
 			$a = mb_split('=', trim($line), 2);
143 143
 			if (count($a) != 2) {
144
-				print "ERROR in file $lSecondaryFile, line $cnt: " . trim($line) . "\n";
144
+				print "ERROR in file $lSecondaryFile, line $cnt: ".trim($line)."\n";
145 145
 				continue;
146 146
 			}
147 147
 
@@ -161,17 +161,17 @@  discard block
 block discarded – undo
161 161
 
162 162
 			$aSecondary[$key] = trim($value);
163 163
 		}
164
-		if (! feof($handle)) {
164
+		if (!feof($handle)) {
165 165
 			$rc = 5;
166 166
 			$msg = "Unexpected fgets() fail";
167
-			print $msg . " (rc=$rc).\n";
167
+			print $msg." (rc=$rc).\n";
168 168
 			exit($rc);
169 169
 		}
170 170
 		fclose($handle);
171 171
 	} else {
172 172
 		$rc = 6;
173 173
 		$msg = "Cannot open file $lSecondaryFile";
174
-		print $msg . " (rc=$rc).\n";
174
+		print $msg." (rc=$rc).\n";
175 175
 		exit($rc);
176 176
 	}
177 177
 
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
 
196 196
 			$a = mb_split('=', trim($line), 2);
197 197
 			if (count($a) != 2) {
198
-				print "ERROR in file $lEnglishFile, line $cnt: " . trim($line) . "\n";
198
+				print "ERROR in file $lEnglishFile, line $cnt: ".trim($line)."\n";
199 199
 				continue;
200 200
 			}
201 201
 
@@ -215,17 +215,17 @@  discard block
 block discarded – undo
215 215
 
216 216
 			$aEnglish[$key] = trim($value);
217 217
 		}
218
-		if (! feof($handle)) {
218
+		if (!feof($handle)) {
219 219
 			$rc = 5;
220 220
 			$msg = "Unexpected fgets() fail";
221
-			print $msg . " (rc=$rc).\n";
221
+			print $msg." (rc=$rc).\n";
222 222
 			exit($rc);
223 223
 		}
224 224
 		fclose($handle);
225 225
 	} else {
226 226
 		$rc = 6;
227 227
 		$msg = "Cannot open file $lEnglishFile";
228
-		print $msg . " (rc=$rc).\n";
228
+		print $msg." (rc=$rc).\n";
229 229
 		exit($rc);
230 230
 	}
231 231
 
@@ -233,11 +233,11 @@  discard block
 block discarded – undo
233 233
 
234 234
 	// Start reading and parsing Primary. See rules in header!
235 235
 
236
-	$arrayofkeytoalwayskeep=array('DIRECTION','FONTFORPDF','FONTSIZEFORPDF','SeparatorDecimal','SeparatorThousand');
236
+	$arrayofkeytoalwayskeep = array('DIRECTION', 'FONTFORPDF', 'FONTSIZEFORPDF', 'SeparatorDecimal', 'SeparatorThousand');
237 237
 
238 238
 
239 239
 	if ($handle = fopen($lPrimaryFile, 'r')) {
240
-		if (! $oh = fopen($output, 'w')) {
240
+		if (!$oh = fopen($output, 'w')) {
241 241
 			print "ERROR in writing to file ".$output."\n";
242 242
 			exit;
243 243
 		}
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
 
265 265
 			$a = mb_split('=', trim($line), 2);
266 266
 			if (count($a) != 2) {
267
-				print "ERROR in file $lPrimaryFile, line $cnt: " . trim($line) . "\n";
267
+				print "ERROR in file $lPrimaryFile, line $cnt: ".trim($line)."\n";
268 268
 				continue;
269 269
 			}
270 270
 
@@ -296,7 +296,7 @@  discard block
 block discarded – undo
296 296
 			// Key not in other file
297 297
 			if (in_array($key, $arrayofkeytoalwayskeep) || preg_match('/^FormatDate/', $key) || preg_match('/^FormatHour/', $key)) {
298 298
 				//print "Key $key is a key we always want to see into secondary file (line: $cnt).\n";
299
-			} elseif (! array_key_exists($key, $aSecondary)) {
299
+			} elseif (!array_key_exists($key, $aSecondary)) {
300 300
 				//print "Key $key does NOT exist in secondary language (line: $cnt).\n";
301 301
 				continue;
302 302
 			}
@@ -311,10 +311,10 @@  discard block
 block discarded – undo
311 311
 				fwrite($oh, $key."=".(empty($aSecondary[$key]) ? $aPrimary[$key] : $aSecondary[$key])."\n");
312 312
 			}
313 313
 		}
314
-		if (! feof($handle)) {
314
+		if (!feof($handle)) {
315 315
 			$rc = 7;
316 316
 			$msg = "Unexpected fgets() fail";
317
-			print $msg . " (rc=$rc).\n";
317
+			print $msg." (rc=$rc).\n";
318 318
 			exit($rc);
319 319
 		}
320 320
 		fclose($oh);
@@ -322,7 +322,7 @@  discard block
 block discarded – undo
322 322
 	} else {
323 323
 		$rc = 8;
324 324
 		$msg = "Cannot open file $lPrimaryFile";
325
-		print $msg . " (rc=$rc).\n";
325
+		print $msg." (rc=$rc).\n";
326 326
 		exit($rc);
327 327
 	}
328 328
 
Please login to merge, or discard this patch.