Completed
Branch develop (689ca5)
by
unknown
22:53
created
htdocs/admin/remotestore/class/externalModules.class.php 1 patch
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -139,9 +139,9 @@  discard block
 block discarded – undo
139 139
 		$this->url       = DOL_URL_ROOT.'/admin/modules.php?mode=marketplace';
140 140
 
141 141
 		// For dolistore modules
142
-		$this->dolistore_api_url = getDolGlobalString('MAIN_MODULE_DOLISTORE_API_SRV', 'https://www.dolistore.com/api/');	// 'https://www.dolistore.com/api/', 'https://admin2.dolibarr.org/api/index.php/marketplace/'
142
+		$this->dolistore_api_url = getDolGlobalString('MAIN_MODULE_DOLISTORE_API_SRV', 'https://www.dolistore.com/api/'); // 'https://www.dolistore.com/api/', 'https://admin2.dolibarr.org/api/index.php/marketplace/'
143 143
 		$this->dolistore_api_key = getDolGlobalString('MAIN_MODULE_DOLISTORE_API_KEY', 'dolistorepublicapi');
144
-		$this->shop_url  = getDolGlobalString('MAIN_MODULE_DOLISTORE_SHOP_URL', 'https://www.dolistore.com');
144
+		$this->shop_url = getDolGlobalString('MAIN_MODULE_DOLISTORE_SHOP_URL', 'https://www.dolistore.com');
145 145
 
146 146
 		// For community modules
147 147
 		$this->file_source_url = "https://raw.githubusercontent.com/Dolibarr/dolibarr-community-modules/refs/heads/main/index.yaml";
@@ -204,12 +204,12 @@  discard block
 block discarded – undo
204 204
 			$httpheader[] = 'Authorization: Basic '.base64_encode($basicAuthLogin.':'.$basicAuthPassword);
205 205
 		}
206 206
 
207
-		$url = $this->dolistore_api_url . (preg_match('/\/$/', $this->dolistore_api_url) ? '' : '/') . $resource;
207
+		$url = $this->dolistore_api_url.(preg_match('/\/$/', $this->dolistore_api_url) ? '' : '/').$resource;
208 208
 
209 209
 		$options['apikey'] = $this->dolistore_api_key;
210 210
 
211 211
 		if ($options) {
212
-			$url .= '?' . http_build_query($options);
212
+			$url .= '?'.http_build_query($options);
213 213
 		}
214 214
 
215 215
 		$response = getURLContent($url, 'GET', '', 1, $httpheader, array('https'), 0, -1, 5, 5);
@@ -251,13 +251,13 @@  discard block
 block discarded – undo
251 251
 		$modules = array();
252 252
 
253 253
 		if (!empty($this->cache_file) && file_exists($this->cache_file)) {
254
-			dol_syslog(__METHOD__ . " - Loading cache file: " . $this->cache_file, LOG_DEBUG);
254
+			dol_syslog(__METHOD__." - Loading cache file: ".$this->cache_file, LOG_DEBUG);
255 255
 
256 256
 			$content = file_get_contents($this->cache_file);
257 257
 			if ($content !== false) {
258 258
 				$modules = $this->readYaml($content);
259 259
 			} else {
260
-				dol_syslog(__METHOD__ . " - Error reading cache file", LOG_ERR);
260
+				dol_syslog(__METHOD__." - Error reading cache file", LOG_ERR);
261 261
 			}
262 262
 		}
263 263
 
@@ -285,20 +285,20 @@  discard block
 block discarded – undo
285 285
 		if (isset($resCategories['response']) && is_array($resCategories['response'])) {
286 286
 			$organized_tree = $resCategories['response'];
287 287
 		} else {
288
-			return $html ;
288
+			return $html;
289 289
 		}
290 290
 
291 291
 		$html = '';
292 292
 		foreach ($organized_tree as $key => $value) {
293 293
 			if ($value['label'] != "Versions" && $value['label'] != "Specials") {
294
-				$html .= '<li' . ($current == $value['rowid'] ? ' class="active"' : '') . '>';
295
-				$html .= '<a href="?mode=marketplace&categorie=' . $value['rowid'] . '">' . $value['label'] . '</a>';
294
+				$html .= '<li'.($current == $value['rowid'] ? ' class="active"' : '').'>';
295
+				$html .= '<a href="?mode=marketplace&categorie='.$value['rowid'].'">'.$value['label'].'</a>';
296 296
 				if (isset($value['children'])) {
297 297
 					$html .= '<ul>';
298 298
 					usort($value['children'], $this->buildSorter('position'));
299 299
 					foreach ($value['children'] as $key_children => $value_children) {
300
-						$html .= '<li' . ($current == $value_children['rowid'] ? ' class="active"' : '') . '>';
301
-						$html .= '<a href="?mode=marketplace&categorie=' . $value_children['rowid'] . '" title="' . dol_escape_htmltag(strip_tags($value_children['description'])) . '">' . $value_children['label'] . '</a>';
300
+						$html .= '<li'.($current == $value_children['rowid'] ? ' class="active"' : '').'>';
301
+						$html .= '<a href="?mode=marketplace&categorie='.$value_children['rowid'].'" title="'.dol_escape_htmltag(strip_tags($value_children['description'])).'">'.$value_children['label'].'</a>';
302 302
 						$html .= '</li>';
303 303
 					}
304 304
 					$html .= '</ul>';
@@ -321,7 +321,7 @@  discard block
 block discarded – undo
321 321
 
322 322
 		$html       = "";
323 323
 		$last_month = dol_now() - (30 * 24 * 60 * 60);
324
-		$dolibarrversiontouse = DOL_VERSION;	// full string with version
324
+		$dolibarrversiontouse = DOL_VERSION; // full string with version
325 325
 
326 326
 		$this->products = array();
327 327
 
@@ -330,7 +330,7 @@  discard block
 block discarded – undo
330 330
 		$this->no_page  = $options['no_page'] ?? 1;
331 331
 		$this->search    = $options['search'] ?? '';
332 332
 
333
-		$this->per_page = 11;	// We fix number of products per page to 11
333
+		$this->per_page = 11; // We fix number of products per page to 11
334 334
 
335 335
 		// Length of $search must be at least 2 characters
336 336
 		if (!empty($this->search) && strlen(str_replace(' ', '', (string) $this->search)) < 2) {
@@ -371,7 +371,7 @@  discard block
 block discarded – undo
371 371
 		$fileProducts = array();
372 372
 		$fileProductsTotal = 0;
373 373
 		if (!empty($this->githubFileStatus) && getDolGlobalInt('MAIN_ENABLE_EXTERNALMODULES_COMMUNITY')) {
374
-			$fileProducts = $this->fetchModulesFromFile($data);			// Return an array with all modules from the cache filecontent in $data
374
+			$fileProducts = $this->fetchModulesFromFile($data); // Return an array with all modules from the cache filecontent in $data
375 375
 
376 376
 			$fileProducts = $this->adaptData($fileProducts, 'githubcommunity');
377 377
 
@@ -429,7 +429,7 @@  discard block
 block discarded – undo
429 429
 					$download_link .= img_picto('', 'file-code', 'class="size2x paddingright"');
430 430
 					$download_link .= '</a>';
431 431
 
432
-					$urlview = $product["dolistore-download"];		// In a future, we will have the download to the zip file
432
+					$urlview = $product["dolistore-download"]; // In a future, we will have the download to the zip file
433 433
 					if ($urlview) {
434 434
 						$download_link .= '<a class="paddingleft paddingright" target="_blank" title="'.$langs->trans("View").'" href="'.$urlview.'" rel="noopener noreferrer">';
435 435
 						$download_link .= img_picto('', 'url', 'class="size2x"');
@@ -447,7 +447,7 @@  discard block
 block discarded – undo
447 447
 						}
448 448
 					}
449 449
 				} elseif ($product['source'] === 'dolistore') {
450
-					$urldownload = 'https://www.dolistore.com/_service_download.php?t=free&p=' . $product['id'];
450
+					$urldownload = 'https://www.dolistore.com/_service_download.php?t=free&p='.$product['id'];
451 451
 					$download_link = '<a class="paddingleft paddingright" target="_blank" title="'.$langs->trans("View").'" href="'.$this->shop_url.'/product.php?id='.((int) $product["id"]).'">';
452 452
 					$download_link .= img_picto('', 'url', 'class="size2x"');
453 453
 					$download_link .= '</a>';
@@ -505,12 +505,12 @@  discard block
 block discarded – undo
505 505
 			// Output the line
506 506
 			$html .= '<tr class="app oddeven nohover '.dol_escape_htmltag($compatible).'">';
507 507
 			$html .= '<td class="center width150"><div class="newAppParent">';
508
-			$html .= $newapp.$images;	// No dol_escape_htmltag, it is already escape html
508
+			$html .= $newapp.$images; // No dol_escape_htmltag, it is already escape html
509 509
 			$html .= '</div></td>';
510 510
 			$html .= '<td class="margeCote"><h2 class="appTitle">';
511 511
 			$html .= dolPrintHTML(dol_string_nohtmltag($product["label"]));
512 512
 			$html .= '<br><small>';
513
-			$html .= $version;			// No dol_escape_htmltag, it is already escape html
513
+			$html .= $version; // No dol_escape_htmltag, it is already escape html
514 514
 			$html .= '</small></h2>';
515 515
 			$html .= '<small> ';
516 516
 			if (empty($product['tms'])) {
@@ -543,7 +543,7 @@  discard block
 block discarded – undo
543 543
 
544 544
 		$this->numberOfProducts = count($this->products);
545 545
 
546
-		return $html ;
546
+		return $html;
547 547
 	}
548 548
 
549 549
 	/**
@@ -560,7 +560,7 @@  discard block
 block discarded – undo
560 560
 		 * @param array<string, mixed> $b
561 561
 		 * @return int
562 562
 		 */
563
-		function (array $a, array $b) use ($key) {
563
+		function(array $a, array $b) use ($key) {
564 564
 			$valA = isset($a[$key]) && is_scalar($a[$key]) ? (string) $a[$key] : '';
565 565
 			$valB = isset($b[$key]) && is_scalar($b[$key]) ? (string) $b[$key] : '';
566 566
 
@@ -721,7 +721,7 @@  discard block
 block discarded – undo
721 721
 				$pagelist .= '<li class="pagination">';
722 722
 				$pagelist .= '<label for="page_input">Page </label>';
723 723
 				if ($this->categorie != 0) {
724
-					$pagelist .= '<input type="hidden" name="categorie" value="' . $this->categorie . '">';
724
+					$pagelist .= '<input type="hidden" name="categorie" value="'.$this->categorie.'">';
725 725
 				}
726 726
 				$pagelist .= '<input type="text" id="page_input" name="no_page" value="'.($page).'" min="1" max="'.$nbpages.'" class="width40 page_input" oninput="if(this.value > '.$nbpages.') this.value='.$nbpages.'">';
727 727
 				$pagelist .= ' / '.$nbpages;
@@ -771,17 +771,17 @@  discard block
 block discarded – undo
771 771
 		}
772 772
 
773 773
 		// Get the predefined error message or use a default one
774
-		$error_message = $error_messages[$request['status_code']] ?? 'Unexpected HTTP status: ' . $request['status_code'];
774
+		$error_message = $error_messages[$request['status_code']] ?? 'Unexpected HTTP status: '.$request['status_code'];
775 775
 
776 776
 		// Append error details if available
777 777
 		if (!empty($request['response']) && isset($request['response']['errors']) && is_array($request['response']['errors'])) {
778 778
 			foreach ($request['response']['errors'] as $error) {
779
-				$error_message .= ' - (Code ' . $error['code'] . '): ' . $error['message'];
779
+				$error_message .= ' - (Code '.$error['code'].'): '.$error['message'];
780 780
 			}
781 781
 		}
782 782
 
783 783
 		if (!empty($request['curl_error_msg'])) {
784
-			$error_message .= ' - ' . $request['curl_error_msg'];
784
+			$error_message .= ' - '.$request['curl_error_msg'];
785 785
 		}
786 786
 
787 787
 		// Return the formatted error message
@@ -809,7 +809,7 @@  discard block
 block discarded – undo
809 809
 		if (!file_exists($cache_file) || filemtime($cache_file) < (dol_now() - $cache_time)) {
810 810
 			// We get remote url
811 811
 			$addheaders = array();
812
-			$result = getURLContent($file_source_url, 'GET', '', 1, $addheaders);	// TODO Force timeout to 5 s on both connect and response.
812
+			$result = getURLContent($file_source_url, 'GET', '', 1, $addheaders); // TODO Force timeout to 5 s on both connect and response.
813 813
 			if (!empty($result) && $result['http_code'] == 200) {
814 814
 				$yaml = $result['content'];
815 815
 				file_put_contents($cache_file, $yaml);
@@ -914,7 +914,7 @@  discard block
 block discarded – undo
914 914
 					continue;
915 915
 				}
916 916
 				$adaptedPackage = [
917
-					'ref' => str_replace(' ', '', $package['modulename'] . '-' . $package['current_version'] . '@' .
917
+					'ref' => str_replace(' ', '', $package['modulename'].'-'.$package['current_version'].'@'.
918 918
 						(array_key_exists('author', $package) ? $package['author'] : 'unkownauthor')),
919 919
 					'label' => !empty($package['label'][substr($this->lang, 0, 2)])
920 920
 						? $package['label'][substr($this->lang, 0, 2)]
@@ -1019,7 +1019,7 @@  discard block
 block discarded – undo
1019 1019
 			 *
1020 1020
 			 * @return int
1021 1021
 			 */
1022
-			static function ($a, $b) {
1022
+			static function($a, $b) {
1023 1023
 				return strtotime($b['datec'] ?? '0') - strtotime($a['datec'] ?? '0');
1024 1024
 			}
1025 1025
 		);
@@ -1034,7 +1034,7 @@  discard block
 block discarded – undo
1034 1034
 				 *
1035 1035
 				 * @return bool
1036 1036
 				 */
1037
-				static function ($package) use ($options) {
1037
+				static function($package) use ($options) {
1038 1038
 					return stripos($package['label'], $options['search']) !== false || stripos($package['description'], $options['search']) !== false;
1039 1039
 				}
1040 1040
 			);
@@ -1050,7 +1050,7 @@  discard block
 block discarded – undo
1050 1050
 				 *
1051 1051
 				 * @return bool
1052 1052
 				 */
1053
-				static function ($package) use ($options) {
1053
+				static function($package) use ($options) {
1054 1054
 					return in_array($options['categorieid'], $package['category']);
1055 1055
 				}
1056 1056
 			);
Please login to merge, or discard this patch.
htdocs/core/tpl/objectline_edit.tpl.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -340,7 +340,7 @@  discard block
 block discarded – undo
340 340
 
341 341
 			print '<td class="nowrap right linecolcycleref"><input class="right" type="text" size="1" value="'.$fieldv.'" name="progress">%</td>';
342 342
 		} else {
343
-			print '<td class="nowrap right linecolcycleref"><input class="right" type="text" size="1" value="' . (GETPOSTISSET('progress') ? GETPOST('progress') : $line->situation_percent) . '" name="progress">%</td>';
343
+			print '<td class="nowrap right linecolcycleref"><input class="right" type="text" size="1" value="'.(GETPOSTISSET('progress') ? GETPOST('progress') : $line->situation_percent).'" name="progress">%</td>';
344 344
 		}
345 345
 		$coldisplay++;
346 346
 		print '<td></td>';
@@ -441,37 +441,37 @@  discard block
 block discarded – undo
441 441
 	}
442 442
 	if (!$line->date_start) {
443 443
 		if (getDolGlobalString('MAIN_DEFAULT_DATE_START_HOUR') != '') {
444
-			print 'jQuery("#date_starthour").val("' . getDolGlobalString('MAIN_DEFAULT_DATE_START_HOUR').'");';
444
+			print 'jQuery("#date_starthour").val("'.getDolGlobalString('MAIN_DEFAULT_DATE_START_HOUR').'");';
445 445
 		}
446 446
 		if (getDolGlobalString('MAIN_DEFAULT_DATE_START_MIN') != '') {
447
-			print 'jQuery("#date_startmin").val("' . getDolGlobalString('MAIN_DEFAULT_DATE_START_MIN').'");';
447
+			print 'jQuery("#date_startmin").val("'.getDolGlobalString('MAIN_DEFAULT_DATE_START_MIN').'");';
448 448
 		}
449 449
 
450 450
 		$res = 1;
451 451
 		if (!is_object($line->product)) {
452
-			$res = $line->fetch_product();		// fetch product to know its type and allow isMandatoryperiod()
452
+			$res = $line->fetch_product(); // fetch product to know its type and allow isMandatoryperiod()
453 453
 		}
454 454
 		if ($res > 0) {
455 455
 			if ($line->product->isMandatoryPeriod() && $line->product->isService()) {
456
-				print  'jQuery("#date_start").addClass("inputmandatory");';	// Do not add tag "required", this block the cancel action when value not set
456
+				print  'jQuery("#date_start").addClass("inputmandatory");'; // Do not add tag "required", this block the cancel action when value not set
457 457
 			}
458 458
 		}
459 459
 	}
460 460
 	if (!$line->date_end) {
461 461
 		if (getDolGlobalString('MAIN_DEFAULT_DATE_END_HOUR') != '') {
462
-			print 'jQuery("#date_endhour").val("' . getDolGlobalString('MAIN_DEFAULT_DATE_END_HOUR').'");';
462
+			print 'jQuery("#date_endhour").val("'.getDolGlobalString('MAIN_DEFAULT_DATE_END_HOUR').'");';
463 463
 		}
464 464
 		if (getDolGlobalString('MAIN_DEFAULT_DATE_END_MIN') != '') {
465
-			print 'jQuery("#date_endmin").val("' . getDolGlobalString('MAIN_DEFAULT_DATE_END_MIN').'");';
465
+			print 'jQuery("#date_endmin").val("'.getDolGlobalString('MAIN_DEFAULT_DATE_END_MIN').'");';
466 466
 		}
467 467
 
468 468
 		$res = 1;
469 469
 		if (!is_object($line->product)) {
470
-			$res = $line->fetch_product();		// fetch product to know its type and allow isMandatoryperiod()
470
+			$res = $line->fetch_product(); // fetch product to know its type and allow isMandatoryperiod()
471 471
 		}
472
-		if ($res  > 0) {
472
+		if ($res > 0) {
473 473
 			if ($line->product->isMandatoryperiod() && $line->product->isService()) {
474
-				print  'jQuery("#date_end").addClass("inputmandatory");';	// Do not add tag "required", this block the cancel action when value not set
474
+				print  'jQuery("#date_end").addClass("inputmandatory");'; // Do not add tag "required", this block the cancel action when value not set
475 475
 			}
476 476
 		}
477 477
 	}
Please login to merge, or discard this patch.
htdocs/core/tpl/objectline_create.tpl.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -632,18 +632,18 @@
 block discarded – undo
632 632
 
633 633
 	if (!$date_start) {
634 634
 		if (getDolGlobalString('MAIN_DEFAULT_DATE_START_HOUR') != '') {
635
-			print 'jQuery("#date_starthour").val("' . getDolGlobalString('MAIN_DEFAULT_DATE_START_HOUR').'");';
635
+			print 'jQuery("#date_starthour").val("'.getDolGlobalString('MAIN_DEFAULT_DATE_START_HOUR').'");';
636 636
 		}
637 637
 		if (getDolGlobalString('MAIN_DEFAULT_DATE_START_MIN') != '') {
638
-			print 'jQuery("#date_startmin").val("' . getDolGlobalString('MAIN_DEFAULT_DATE_START_MIN').'");';
638
+			print 'jQuery("#date_startmin").val("'.getDolGlobalString('MAIN_DEFAULT_DATE_START_MIN').'");';
639 639
 		}
640 640
 	}
641 641
 	if (!$date_end) {
642 642
 		if (getDolGlobalString('MAIN_DEFAULT_DATE_END_HOUR')) {
643
-			print 'jQuery("#date_endhour").val("' . getDolGlobalString('MAIN_DEFAULT_DATE_END_HOUR').'");';
643
+			print 'jQuery("#date_endhour").val("'.getDolGlobalString('MAIN_DEFAULT_DATE_END_HOUR').'");';
644 644
 		}
645 645
 		if (getDolGlobalString('MAIN_DEFAULT_DATE_END_MIN')) {
646
-			print 'jQuery("#date_endmin").val("' . getDolGlobalString('MAIN_DEFAULT_DATE_END_MIN').'");';
646
+			print 'jQuery("#date_endmin").val("'.getDolGlobalString('MAIN_DEFAULT_DATE_END_MIN').'");';
647 647
 		}
648 648
 	}
649 649
 	print '</script>';
Please login to merge, or discard this patch.
htdocs/accountancy/bookkeeping/balance.php 1 patch
Spacing   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -95,18 +95,18 @@  discard block
 block discarded – undo
95 95
 
96 96
 // Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
97 97
 $object = new BookKeeping($db);
98
-$hookmanager->initHooks(array($contextpage));  // Note that conf->hooks_modules contains array
98
+$hookmanager->initHooks(array($contextpage)); // Note that conf->hooks_modules contains array
99 99
 
100 100
 $formaccounting = new FormAccounting($db);
101 101
 $form = new Form($db);
102 102
 
103 103
 if (empty($search_date_start) && empty($search_date_end) && !GETPOSTISSET('formfilteraction')) {
104 104
 	$sql = "SELECT date_start, date_end";
105
-	$sql .=" FROM ".MAIN_DB_PREFIX."accounting_fiscalyear ";
105
+	$sql .= " FROM ".MAIN_DB_PREFIX."accounting_fiscalyear ";
106 106
 	if (getDolGlobalInt('ACCOUNTANCY_FISCALYEAR_DEFAULT')) {
107
-		$sql .= " WHERE rowid = " . getDolGlobalInt('ACCOUNTANCY_FISCALYEAR_DEFAULT');
107
+		$sql .= " WHERE rowid = ".getDolGlobalInt('ACCOUNTANCY_FISCALYEAR_DEFAULT');
108 108
 	} else {
109
-		$sql .= " WHERE date_start < '" . $db->idate(dol_now()) . "' and date_end > '" . $db->idate(dol_now()) . "'";
109
+		$sql .= " WHERE date_start < '".$db->idate(dol_now())."' and date_end > '".$db->idate(dol_now())."'";
110 110
 	}
111 111
 	$sql .= $db->plimit(1);
112 112
 	$res = $db->query($sql);
@@ -178,11 +178,11 @@  discard block
 block discarded – undo
178 178
 
179 179
 	if (!empty($search_date_start)) {
180 180
 		$filter['t.doc_date>='] = $search_date_start;
181
-		$param .= '&date_startmonth=' . GETPOSTINT('date_startmonth') . '&date_startday=' . GETPOSTINT('date_startday') . '&date_startyear=' . GETPOSTINT('date_startyear');
181
+		$param .= '&date_startmonth='.GETPOSTINT('date_startmonth').'&date_startday='.GETPOSTINT('date_startday').'&date_startyear='.GETPOSTINT('date_startyear');
182 182
 	}
183 183
 	if (!empty($search_date_end)) {
184 184
 		$filter['t.doc_date<='] = $search_date_end;
185
-		$param .= '&date_endmonth=' . GETPOSTINT('date_endmonth') . '&date_endday=' . GETPOSTINT('date_endday') . '&date_endyear=' . GETPOSTINT('date_endyear');
185
+		$param .= '&date_endmonth='.GETPOSTINT('date_endmonth').'&date_endday='.GETPOSTINT('date_endday').'&date_endyear='.GETPOSTINT('date_endyear');
186 186
 	}
187 187
 	if (!empty($search_accountancy_code_start)) {
188 188
 		if ($type == 'sub') {
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
 		} else {
191 191
 			$filter['t.numero_compte>='] = $search_accountancy_code_start;
192 192
 		}
193
-		$param .= '&search_accountancy_code_start=' . urlencode($search_accountancy_code_start);
193
+		$param .= '&search_accountancy_code_start='.urlencode($search_accountancy_code_start);
194 194
 	}
195 195
 	if (!empty($search_accountancy_code_end)) {
196 196
 		if ($type == 'sub') {
@@ -198,12 +198,12 @@  discard block
 block discarded – undo
198 198
 		} else {
199 199
 			$filter['t.numero_compte<='] = $search_accountancy_code_end;
200 200
 		}
201
-		$param .= '&search_accountancy_code_end=' . urlencode($search_accountancy_code_end);
201
+		$param .= '&search_accountancy_code_end='.urlencode($search_accountancy_code_end);
202 202
 	}
203 203
 	if (!empty($search_ledger_code)) {
204 204
 		$filter['t.code_journal'] = $search_ledger_code;
205 205
 		foreach ($search_ledger_code as $code) {
206
-			$param .= '&search_ledger_code[]=' . urlencode($code);
206
+			$param .= '&search_ledger_code[]='.urlencode($code);
207 207
 		}
208 208
 	}
209 209
 	if (!empty($search_not_reconciled)) {
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
 	// param with type of list
218 218
 	$url_param = substr($param, 1); // remove first "&"
219 219
 	if (!empty($type)) {
220
-		$param = '&type=' . $type . $param;
220
+		$param = '&type='.$type.$param;
221 221
 	}
222 222
 }
223 223
 
@@ -241,11 +241,11 @@  discard block
 block discarded – undo
241 241
 
242 242
 		foreach ($object->lines as $line) {
243 243
 			if ($type == 'sub') {
244
-				print '"' . length_accounta($line->subledger_account) . '"' . $sep;
245
-				print '"' . $line->subledger_label . '"' . $sep;
244
+				print '"'.length_accounta($line->subledger_account).'"'.$sep;
245
+				print '"'.$line->subledger_label.'"'.$sep;
246 246
 			} else {
247
-				print '"' . length_accountg($line->numero_compte) . '"' . $sep;
248
-				print '"' . $object->get_compte_desc($line->numero_compte) . '"' . $sep;
247
+				print '"'.length_accountg($line->numero_compte).'"'.$sep;
248
+				print '"'.$object->get_compte_desc($line->numero_compte).'"'.$sep;
249 249
 			}
250 250
 			print '"'.price($line->debit).'"'.$sep;
251 251
 			print '"'.price($line->credit).'"'.$sep;
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
 		}
255 255
 		exit;
256 256
 	} else {
257
-		require_once DOL_DOCUMENT_ROOT . '/core/modules/accountancy/doc/pdf_balance.modules.php';
257
+		require_once DOL_DOCUMENT_ROOT.'/core/modules/accountancy/doc/pdf_balance.modules.php';
258 258
 		$pdf = new pdf_balance($db);
259 259
 		$pdf->fromDate = dol_mktime(12, 0, 0, GETPOSTINT('search_date_startmonth'), GETPOSTINT('search_date_startday'), GETPOSTINT('search_date_startyear'));
260 260
 		if (empty($pdf->fromDate)) {
@@ -345,11 +345,11 @@  discard block
 block discarded – undo
345 345
 
346 346
 	if (empty($reshook)) {
347 347
 		if ($type == 'sub') {
348
-			$newcardbutton .= dolGetButtonTitle($langs->trans('AccountBalance')." - ".$langs->trans('GroupByAccountAccounting'), '', 'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT . '/accountancy/bookkeeping/balance.php?' . $url_param, '', 1, array('morecss' => 'marginleftonly'));
349
-			$newcardbutton .= dolGetButtonTitle($langs->trans('AccountBalance')." - ".$langs->trans('GroupBySubAccountAccounting'), '', 'fa fa-align-left vmirror paddingleft imgforviewmode', DOL_URL_ROOT . '/accountancy/bookkeeping/balance.php?type=sub' . $url_param, '', 1, array('morecss' => 'marginleftonly btnTitleSelected'));
348
+			$newcardbutton .= dolGetButtonTitle($langs->trans('AccountBalance')." - ".$langs->trans('GroupByAccountAccounting'), '', 'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/balance.php?'.$url_param, '', 1, array('morecss' => 'marginleftonly'));
349
+			$newcardbutton .= dolGetButtonTitle($langs->trans('AccountBalance')." - ".$langs->trans('GroupBySubAccountAccounting'), '', 'fa fa-align-left vmirror paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/balance.php?type=sub'.$url_param, '', 1, array('morecss' => 'marginleftonly btnTitleSelected'));
350 350
 		} else {
351
-			$newcardbutton .= dolGetButtonTitle($langs->trans('AccountBalance')." - ".$langs->trans('GroupByAccountAccounting'), '', 'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT . '/accountancy/bookkeeping/balance.php?' . $url_param, '', 1, array('morecss' => 'marginleftonly btnTitleSelected'));
352
-			$newcardbutton .= dolGetButtonTitle($langs->trans('AccountBalance')." - ".$langs->trans('GroupBySubAccountAccounting'), '', 'fa fa-align-left vmirror paddingleft imgforviewmode', DOL_URL_ROOT . '/accountancy/bookkeeping/balance.php?type=sub' . $url_param, '', 1, array('morecss' => 'marginleftonly'));
351
+			$newcardbutton .= dolGetButtonTitle($langs->trans('AccountBalance')." - ".$langs->trans('GroupByAccountAccounting'), '', 'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/balance.php?'.$url_param, '', 1, array('morecss' => 'marginleftonly btnTitleSelected'));
352
+			$newcardbutton .= dolGetButtonTitle($langs->trans('AccountBalance')." - ".$langs->trans('GroupBySubAccountAccounting'), '', 'fa fa-align-left vmirror paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/balance.php?type=sub'.$url_param, '', 1, array('morecss' => 'marginleftonly'));
353 353
 		}
354 354
 
355 355
 		$newcardbutton .= dolGetButtonTitle($langs->trans('ExportToCsv'), '', 'fa fa-file-csv paddingleft', $_SERVER['PHP_SELF'], 'exportcsvbutton', 1, array('morecss' => 'marginleftonly'));
@@ -371,7 +371,7 @@  discard block
 block discarded – undo
371 371
 		$newcardbutton .= dolGetButtonTitle($langs->trans('ExportToPdf'), '', 'fa fa-file-pdf paddingleft', $_SERVER['PHP_SELF'], 'exportpdfbutton', 1, array('morecss' => 'marginleftonly'));
372 372
 
373 373
 		$newcardbutton .= dolGetButtonTitleSeparator();
374
-		$newcardbutton .= dolGetButtonTitle($langs->trans('NewAccountingMvt'), '', 'fa fa-plus-circle paddingleft', DOL_URL_ROOT.'/accountancy/bookkeeping/card.php?action=create'.(!empty($type)?'&type=sub':'').'&backtopage='.urlencode($_SERVER['PHP_SELF']), '', $permissiontoadd);
374
+		$newcardbutton .= dolGetButtonTitle($langs->trans('NewAccountingMvt'), '', 'fa fa-plus-circle paddingleft', DOL_URL_ROOT.'/accountancy/bookkeeping/card.php?action=create'.(!empty($type) ? '&type=sub' : '').'&backtopage='.urlencode($_SERVER['PHP_SELF']), '', $permissiontoadd);
375 375
 	}
376 376
 	if ($contextpage != $_SERVER["PHP_SELF"]) {
377 377
 		$param .= '&contextpage='.urlencode($contextpage);
@@ -518,9 +518,9 @@  discard block
 block discarded – undo
518 518
 	// without time and class limits (Class 6 and 7 accounts ???) and does not take into account the "a-nouveau" journal.
519 519
 	if (getDolGlobalString('ACCOUNTANCY_SHOW_OPENING_BALANCE')) {
520 520
 		$sql = "SELECT t.numero_compte, (SUM(t.debit) - SUM(t.credit)) as opening_balance";
521
-		$sql .= " FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping as t";
522
-		$sql .= " WHERE t.entity = " . $conf->entity;        // Never do sharing into accounting features
523
-		$sql .= " AND t.doc_date < '" . $db->idate($search_date_start) . "'";
521
+		$sql .= " FROM ".MAIN_DB_PREFIX."accounting_bookkeeping as t";
522
+		$sql .= " WHERE t.entity = ".$conf->entity; // Never do sharing into accounting features
523
+		$sql .= " AND t.doc_date < '".$db->idate($search_date_start)."'";
524 524
 		$sql .= " GROUP BY t.numero_compte";
525 525
 
526 526
 		$resql = $db->query($sql);
@@ -530,7 +530,7 @@  discard block
 block discarded – undo
530 530
 			for ($i = 0; $i < $nrows; $i++) {
531 531
 				$arr = $db->fetch_array($resql);
532 532
 				if (is_array($arr)) {
533
-					$opening_balances["'" . $arr['numero_compte'] . "'"] = $arr['opening_balance'];
533
+					$opening_balances["'".$arr['numero_compte']."'"] = $arr['opening_balance'];
534 534
 				}
535 535
 			}
536 536
 		} else {
@@ -567,9 +567,9 @@  discard block
 block discarded – undo
567 567
 		//var_dump($accounting_account);
568 568
 		//var_dump($accountingaccountstatic);
569 569
 		if (empty($accountingaccountstatic->label) && $accountingaccountstatic->id > 0) {
570
-			$link = '<a class="editfielda reposition" href="' . DOL_URL_ROOT . '/accountancy/admin/card.php?action=update&token=' . newToken() . '&id=' . $accountingaccountstatic->id . '">' . img_edit() . '</a>';
570
+			$link = '<a class="editfielda reposition" href="'.DOL_URL_ROOT.'/accountancy/admin/card.php?action=update&token='.newToken().'&id='.$accountingaccountstatic->id.'">'.img_edit().'</a>';
571 571
 		} elseif ($accounting_account == 'NotDefined') {
572
-			$link = '<a href="' . DOL_URL_ROOT . '/accountancy/admin/card.php?action=create&token=' . newToken() . '&accountingaccount=' . length_accountg($line->numero_compte) . '">' . img_edit_add() . '</a>';
572
+			$link = '<a href="'.DOL_URL_ROOT.'/accountancy/admin/card.php?action=create&token='.newToken().'&accountingaccount='.length_accountg($line->numero_compte).'">'.img_edit_add().'</a>';
573 573
 		} /* elseif (empty($tmparrayforrootaccount['label'])) {
574 574
 			// $tmparrayforrootaccount['label'] not defined = the account has not parent with a parent.
575 575
 			// This is useless, we should not create a new account when an account has no parent, we must edit it to fix its parent.
@@ -645,22 +645,22 @@  discard block
 block discarded – undo
645 645
 		$urlzoom = '';
646 646
 		if ($type == 'sub') {
647 647
 			if ($line->subledger_account) {
648
-				$urlzoom = DOL_URL_ROOT . '/accountancy/bookkeeping/listbyaccount.php?type=sub&search_accountancy_code_start=' . urlencode($line->subledger_account) . '&search_accountancy_code_end=' . urlencode($line->subledger_account);
648
+				$urlzoom = DOL_URL_ROOT.'/accountancy/bookkeeping/listbyaccount.php?type=sub&search_accountancy_code_start='.urlencode($line->subledger_account).'&search_accountancy_code_end='.urlencode($line->subledger_account);
649 649
 				if (GETPOSTISSET('date_startmonth')) {
650
-					$urlzoom .= '&search_date_startmonth=' . GETPOSTINT('date_startmonth') . '&search_date_startday=' . GETPOSTINT('date_startday') . '&search_date_startyear=' . GETPOSTINT('date_startyear');
650
+					$urlzoom .= '&search_date_startmonth='.GETPOSTINT('date_startmonth').'&search_date_startday='.GETPOSTINT('date_startday').'&search_date_startyear='.GETPOSTINT('date_startyear');
651 651
 				}
652 652
 				if (GETPOSTISSET('date_endmonth')) {
653
-					$urlzoom .= '&search_date_endmonth=' . GETPOSTINT('date_endmonth') . '&search_date_endday=' . GETPOSTINT('date_endday') . '&search_date_endyear=' . GETPOSTINT('date_endyear');
653
+					$urlzoom .= '&search_date_endmonth='.GETPOSTINT('date_endmonth').'&search_date_endday='.GETPOSTINT('date_endday').'&search_date_endyear='.GETPOSTINT('date_endyear');
654 654
 				}
655 655
 			}
656 656
 		} else {
657 657
 			if ($line->numero_compte) {
658
-				$urlzoom = DOL_URL_ROOT . '/accountancy/bookkeeping/listbyaccount.php?search_accountancy_code_start=' . urlencode($line->numero_compte) . '&search_accountancy_code_end=' . urlencode($line->numero_compte);
658
+				$urlzoom = DOL_URL_ROOT.'/accountancy/bookkeeping/listbyaccount.php?search_accountancy_code_start='.urlencode($line->numero_compte).'&search_accountancy_code_end='.urlencode($line->numero_compte);
659 659
 				if (GETPOSTISSET('date_startmonth')) {
660
-					$urlzoom .= '&search_date_startmonth=' . GETPOSTINT('date_startmonth') . '&search_date_startday=' . GETPOSTINT('date_startday') . '&search_date_startyear=' . GETPOSTINT('date_startyear');
660
+					$urlzoom .= '&search_date_startmonth='.GETPOSTINT('date_startmonth').'&search_date_startday='.GETPOSTINT('date_startday').'&search_date_startyear='.GETPOSTINT('date_startyear');
661 661
 				}
662 662
 				if (GETPOSTISSET('date_endmonth')) {
663
-					$urlzoom .= '&search_date_endmonth=' . GETPOSTINT('date_endmonth') . '&search_date_endday=' . GETPOSTINT('date_endday') . '&search_date_endyear=' . GETPOSTINT('date_endyear');
663
+					$urlzoom .= '&search_date_endmonth='.GETPOSTINT('date_endmonth').'&search_date_endday='.GETPOSTINT('date_endday').'&search_date_endyear='.GETPOSTINT('date_endyear');
664 664
 				}
665 665
 			}
666 666
 		}
@@ -703,9 +703,9 @@  discard block
 block discarded – undo
703 703
 		print '<td class="right nowraponall amount">'.price(price2num($sous_total_debit, 'MT')).'</td>';
704 704
 		print '<td class="right nowraponall amount">'.price(price2num($sous_total_credit, 'MT')).'</td>';
705 705
 		if (getDolGlobalString('ACCOUNTANCY_SHOW_OPENING_BALANCE')) {
706
-			print '<td class="right nowraponall amount">' . price(price2num($sous_total_opening_balance + $sous_total_debit - $sous_total_credit, 'MT')) . '</td>';
706
+			print '<td class="right nowraponall amount">'.price(price2num($sous_total_opening_balance + $sous_total_debit - $sous_total_credit, 'MT')).'</td>';
707 707
 		} else {
708
-			print '<td class="right nowraponall amount">' . price(price2num($sous_total_debit - $sous_total_credit, 'MT')) . '</td>';
708
+			print '<td class="right nowraponall amount">'.price(price2num($sous_total_debit - $sous_total_credit, 'MT')).'</td>';
709 709
 		}
710 710
 		// Action column
711 711
 		if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
@@ -726,9 +726,9 @@  discard block
 block discarded – undo
726 726
 	print '<td class="right nowraponall amount">'.price(price2num($total_debit, 'MT')).'</td>';
727 727
 	print '<td class="right nowraponall amount">'.price(price2num($total_credit, 'MT')).'</td>';
728 728
 	if (getDolGlobalString('ACCOUNTANCY_SHOW_OPENING_BALANCE')) {
729
-		print '<td class="right nowraponall amount">' . price(price2num($total_opening_balance + $total_debit - $total_credit, 'MT')) . '</td>';
729
+		print '<td class="right nowraponall amount">'.price(price2num($total_opening_balance + $total_debit - $total_credit, 'MT')).'</td>';
730 730
 	} else {
731
-		print '<td class="right nowraponall amount">' . price(price2num($total_debit - $total_credit, 'MT')) . '</td>';
731
+		print '<td class="right nowraponall amount">'.price(price2num($total_debit - $total_credit, 'MT')).'</td>';
732 732
 	}
733 733
 	// Action column
734 734
 	if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
@@ -742,7 +742,7 @@  discard block
 block discarded – undo
742 742
 		if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
743 743
 			print "<td></td>\n";
744 744
 		}
745
-		print '<td class="right">' . $langs->trans("AccountingResult") . ':</td>';
745
+		print '<td class="right">'.$langs->trans("AccountingResult").':</td>';
746 746
 		if (getDolGlobalString('ACCOUNTANCY_SHOW_OPENING_BALANCE')) {
747 747
 			print '<td></td>';
748 748
 		}
@@ -757,8 +757,8 @@  discard block
 block discarded – undo
757 757
 			$accountingResultCredit = price(price2num($accountingResult, 'MT'));
758 758
 			$accountingResultClassCSS = ' green';
759 759
 		}
760
-		print '<td class="right nowraponall amount' . $accountingResultClassCSS . '">' . $accountingResultDebit . '</td>';
761
-		print '<td class="right nowraponall amount' . $accountingResultClassCSS . '">' . $accountingResultCredit . '</td>';
760
+		print '<td class="right nowraponall amount'.$accountingResultClassCSS.'">'.$accountingResultDebit.'</td>';
761
+		print '<td class="right nowraponall amount'.$accountingResultClassCSS.'">'.$accountingResultCredit.'</td>';
762 762
 
763 763
 		print '<td></td>';
764 764
 		if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
Please login to merge, or discard this patch.