Completed
Branch develop (7cec96)
by
unknown
15:04
created
htdocs/accountancy/class/accountingaccount.class.php 1 patch
Spacing   +58 added lines, -58 removed lines patch added patch discarded remove patch
@@ -281,7 +281,7 @@  discard block
 block discarded – undo
281 281
 		// Put here code to add control on parameters values
282 282
 
283 283
 		// Insert request
284
-		$sql = "INSERT INTO " . MAIN_DB_PREFIX . "accounting_account(";
284
+		$sql = "INSERT INTO ".MAIN_DB_PREFIX."accounting_account(";
285 285
 		$sql .= "datec";
286 286
 		$sql .= ", entity";
287 287
 		$sql .= ", fk_pcg_version";
@@ -315,11 +315,11 @@  discard block
 block discarded – undo
315 315
 		$resql = $this->db->query($sql);
316 316
 		if (!$resql) {
317 317
 			$error++;
318
-			$this->errors[] = "Error " . $this->db->lasterror();
318
+			$this->errors[] = "Error ".$this->db->lasterror();
319 319
 		}
320 320
 
321 321
 		if (!$error) {
322
-			$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX . "accounting_account");
322
+			$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."accounting_account");
323 323
 
324 324
 			// Uncomment this and change MYOBJECT to your own tag if you
325 325
 			// want this action to call a trigger.
@@ -335,8 +335,8 @@  discard block
 block discarded – undo
335 335
 		// Commit or rollback
336 336
 		if ($error) {
337 337
 			foreach ($this->errors as $errmsg) {
338
-				dol_syslog(get_class($this) . "::create " . $errmsg, LOG_ERR);
339
-				$this->error .= ($this->error ? ', ' . $errmsg : $errmsg);
338
+				dol_syslog(get_class($this)."::create ".$errmsg, LOG_ERR);
339
+				$this->error .= ($this->error ? ', '.$errmsg : $errmsg);
340 340
 			}
341 341
 			$this->db->rollback();
342 342
 			return -1 * $error;
@@ -361,18 +361,18 @@  discard block
 block discarded – undo
361 361
 
362 362
 		$this->db->begin();
363 363
 
364
-		$sql = "UPDATE " . MAIN_DB_PREFIX . "accounting_account ";
365
-		$sql .= " SET fk_pcg_version = " . ($this->fk_pcg_version ? "'" . $this->db->escape($this->fk_pcg_version) . "'" : "null");
366
-		$sql .= " , pcg_type = " . ($this->pcg_type ? "'" . $this->db->escape($this->pcg_type) . "'" : "null");
367
-		$sql .= " , account_number = '" . $this->db->escape($this->account_number) . "'";
368
-		$sql .= " , account_parent = " . (int) $this->account_parent;
369
-		$sql .= " , label = " . ($this->label ? "'" . $this->db->escape($this->label) . "'" : "''");
370
-		$sql .= " , labelshort = " . ($this->labelshort ? "'" . $this->db->escape($this->labelshort) . "'" : "''");
371
-		$sql .= " , fk_accounting_category = " . (empty($this->account_category) ? 0 : (int) $this->account_category);
372
-		$sql .= " , fk_user_modif = " . ((int) $user->id);
373
-		$sql .= " , active = " . (int) $this->active;
374
-		$sql .= " , reconcilable = " . (int) $this->reconcilable;
375
-		$sql .= " WHERE rowid = " . ((int) $this->id);
364
+		$sql = "UPDATE ".MAIN_DB_PREFIX."accounting_account ";
365
+		$sql .= " SET fk_pcg_version = ".($this->fk_pcg_version ? "'".$this->db->escape($this->fk_pcg_version)."'" : "null");
366
+		$sql .= " , pcg_type = ".($this->pcg_type ? "'".$this->db->escape($this->pcg_type)."'" : "null");
367
+		$sql .= " , account_number = '".$this->db->escape($this->account_number)."'";
368
+		$sql .= " , account_parent = ".(int) $this->account_parent;
369
+		$sql .= " , label = ".($this->label ? "'".$this->db->escape($this->label)."'" : "''");
370
+		$sql .= " , labelshort = ".($this->labelshort ? "'".$this->db->escape($this->labelshort)."'" : "''");
371
+		$sql .= " , fk_accounting_category = ".(empty($this->account_category) ? 0 : (int) $this->account_category);
372
+		$sql .= " , fk_user_modif = ".((int) $user->id);
373
+		$sql .= " , active = ".(int) $this->active;
374
+		$sql .= " , reconcilable = ".(int) $this->reconcilable;
375
+		$sql .= " WHERE rowid = ".((int) $this->id);
376 376
 
377 377
 		dol_syslog(get_class($this)."::update", LOG_DEBUG);
378 378
 		$result = $this->db->query($sql);
@@ -441,22 +441,22 @@  discard block
 block discarded – undo
441 441
 			$this->db->begin();
442 442
 
443 443
 			if (!$error) {
444
-				$sql = "DELETE FROM " . MAIN_DB_PREFIX . "accounting_account";
445
-				$sql .= " WHERE rowid=" . ((int) $this->id);
444
+				$sql = "DELETE FROM ".MAIN_DB_PREFIX."accounting_account";
445
+				$sql .= " WHERE rowid=".((int) $this->id);
446 446
 
447
-				dol_syslog(get_class($this) . "::delete sql=" . $sql);
447
+				dol_syslog(get_class($this)."::delete sql=".$sql);
448 448
 				$resql = $this->db->query($sql);
449 449
 				if (!$resql) {
450 450
 					$error++;
451
-					$this->errors[] = "Error " . $this->db->lasterror();
451
+					$this->errors[] = "Error ".$this->db->lasterror();
452 452
 				}
453 453
 			}
454 454
 
455 455
 			// Commit or rollback
456 456
 			if ($error) {
457 457
 				foreach ($this->errors as $errmsg) {
458
-					dol_syslog(get_class($this) . "::delete " . $errmsg, LOG_ERR);
459
-					$this->error .= ($this->error ? ', ' . $errmsg : $errmsg);
458
+					dol_syslog(get_class($this)."::delete ".$errmsg, LOG_ERR);
459
+					$this->error .= ($this->error ? ', '.$errmsg : $errmsg);
460 460
 				}
461 461
 				$this->db->rollback();
462 462
 				return -1 * $error;
@@ -485,7 +485,7 @@  discard block
 block discarded – undo
485 485
 	public function getNomUrl($withpicto = 0, $withlabel = 0, $nourl = 0, $moretitle = '', $notooltip = 0, $save_lastsearch_value = -1, $withcompletelabel = 0, $option = '')
486 486
 	{
487 487
 		global $langs, $conf, $hookmanager;
488
-		require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
488
+		require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
489 489
 
490 490
 		if (!empty($conf->dol_no_mouse_hover)) {
491 491
 			$notooltip = 1; // Force disable tooltips
@@ -496,13 +496,13 @@  discard block
 block discarded – undo
496 496
 		$url = '';
497 497
 		$labelurl = '';
498 498
 		if (empty($option) || $option == 'ledger') {
499
-			$url = DOL_URL_ROOT . '/accountancy/bookkeeping/listbyaccount.php?search_accountancy_code_start=' . urlencode($this->account_number) . '&search_accountancy_code_end=' . urlencode($this->account_number);
499
+			$url = DOL_URL_ROOT.'/accountancy/bookkeeping/listbyaccount.php?search_accountancy_code_start='.urlencode($this->account_number).'&search_accountancy_code_end='.urlencode($this->account_number);
500 500
 			$labelurl = $langs->trans("ShowAccountingAccountInLedger");
501 501
 		} elseif ($option == 'journals') {
502
-			$url = DOL_URL_ROOT . '/accountancy/bookkeeping/list.php?search_accountancy_code_start=' . urlencode($this->account_number) . '&search_accountancy_code_end=' . urlencode($this->account_number);
502
+			$url = DOL_URL_ROOT.'/accountancy/bookkeeping/list.php?search_accountancy_code_start='.urlencode($this->account_number).'&search_accountancy_code_end='.urlencode($this->account_number);
503 503
 			$labelurl = $langs->trans("ShowAccountingAccountInJournals");
504 504
 		} elseif ($option == 'accountcard') {
505
-			$url = DOL_URL_ROOT . '/accountancy/admin/card.php?id=' . urlencode($this->id);
505
+			$url = DOL_URL_ROOT.'/accountancy/admin/card.php?id='.urlencode($this->id);
506 506
 			$labelurl = $langs->trans("ShowAccountingAccount");
507 507
 		}
508 508
 
@@ -524,29 +524,29 @@  discard block
 block discarded – undo
524 524
 			$labeltoshow = $this->labelshort;
525 525
 		}
526 526
 
527
-		$label = '<u>' . $labelurl . '</u>';
527
+		$label = '<u>'.$labelurl.'</u>';
528 528
 		if (!empty($this->account_number)) {
529
-			$label .= '<br><b>' . $langs->trans('AccountAccounting') . ':</b> ' . length_accountg($this->account_number);
529
+			$label .= '<br><b>'.$langs->trans('AccountAccounting').':</b> '.length_accountg($this->account_number);
530 530
 		}
531 531
 		if (!empty($labeltoshow)) {
532
-			$label .= '<br><b>' . $langs->trans('Label') . ':</b> ' . $labeltoshow;
532
+			$label .= '<br><b>'.$langs->trans('Label').':</b> '.$labeltoshow;
533 533
 		}
534 534
 		if ($moretitle) {
535
-			$label .= ' - ' . $moretitle;
535
+			$label .= ' - '.$moretitle;
536 536
 		}
537 537
 
538 538
 		$linkclose = '';
539 539
 		if (empty($notooltip)) {
540 540
 			if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
541 541
 				$label = $labelurl;
542
-				$linkclose .= ' alt="' . dol_escape_htmltag($label, 1) . '"';
542
+				$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
543 543
 			}
544
-			$linkclose .= ' title="' . dol_escape_htmltag($label, 1) . '"';
544
+			$linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"';
545 545
 			$linkclose .= ' class="classfortooltip"';
546 546
 		}
547 547
 
548
-		$linkstart = '<a href="' . $url . '"';
549
-		$linkstart .= $linkclose . '>';
548
+		$linkstart = '<a href="'.$url.'"';
549
+		$linkstart .= $linkclose.'>';
550 550
 		$linkend = '</a>';
551 551
 
552 552
 		if ($nourl) {
@@ -557,20 +557,20 @@  discard block
 block discarded – undo
557 557
 
558 558
 		$label_link = length_accountg($this->account_number);
559 559
 		if ($withlabel) {
560
-			$label_link .= ' - ' . ($nourl ? '<span class="opacitymedium">' : '') . $labeltoshow . ($nourl ? '</span>' : '');
560
+			$label_link .= ' - '.($nourl ? '<span class="opacitymedium">' : '').$labeltoshow.($nourl ? '</span>' : '');
561 561
 		}
562 562
 
563 563
 		if ($withpicto) {
564
-			$result .= ($linkstart . img_object(($notooltip ? '' : $label), $picto, ($notooltip ? '' : 'class="classfortooltip"'), 0, 0, $notooltip ? 0 : 1) . $linkend);
564
+			$result .= ($linkstart.img_object(($notooltip ? '' : $label), $picto, ($notooltip ? '' : 'class="classfortooltip"'), 0, 0, $notooltip ? 0 : 1).$linkend);
565 565
 		}
566 566
 		if ($withpicto && $withpicto != 2) {
567 567
 			$result .= ' ';
568 568
 		}
569 569
 		if ($withpicto != 2) {
570
-			$result .= $linkstart . $label_link . $linkend;
570
+			$result .= $linkstart.$label_link.$linkend;
571 571
 		}
572 572
 		global $action;
573
-		$hookmanager->initHooks(array($this->element . 'dao'));
573
+		$hookmanager->initHooks(array($this->element.'dao'));
574 574
 		$parameters = array('id'=>$this->id, 'getnomurl' => &$result);
575 575
 		$reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
576 576
 		if ($reshook > 0) {
@@ -590,10 +590,10 @@  discard block
 block discarded – undo
590 590
 	public function info($id)
591 591
 	{
592 592
 		$sql = 'SELECT a.rowid, a.datec, a.fk_user_author, a.fk_user_modif, a.tms as date_modification';
593
-		$sql .= ' FROM ' . MAIN_DB_PREFIX . 'accounting_account as a';
594
-		$sql .= ' WHERE a.rowid = ' . ((int) $id);
593
+		$sql .= ' FROM '.MAIN_DB_PREFIX.'accounting_account as a';
594
+		$sql .= ' WHERE a.rowid = '.((int) $id);
595 595
 
596
-		dol_syslog(get_class($this) . '::info sql=' . $sql);
596
+		dol_syslog(get_class($this).'::info sql='.$sql);
597 597
 		$resql = $this->db->query($sql);
598 598
 
599 599
 		if ($resql) {
@@ -748,7 +748,7 @@  discard block
 block discarded – undo
748 748
 		$hookmanager->initHooks(array('accountancyBindingCalculation'));
749 749
 
750 750
 		// Execute hook accountancyBindingCalculation
751
-		$parameters = array('buyer' => $buyer, 'seller' => $seller, 'product' => $product, 'facture' => $facture, 'factureDet' => $factureDet ,'accountingAccount'=>$accountingAccount, $type);
751
+		$parameters = array('buyer' => $buyer, 'seller' => $seller, 'product' => $product, 'facture' => $facture, 'factureDet' => $factureDet, 'accountingAccount'=>$accountingAccount, $type);
752 752
 		$reshook = $hookmanager->executeHooks('accountancyBindingCalculation', $parameters); // Note that $action and $object may have been modified by some hooks
753 753
 
754 754
 		if (empty($reshook)) {
@@ -759,51 +759,51 @@  discard block
 block discarded – undo
759 759
 				$const_name = "BUY";
760 760
 			}
761 761
 
762
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php';
762
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
763 763
 			$isBuyerInEEC = isInEEC($buyer);
764 764
 			$isSellerInEEC = isInEEC($seller);
765
-			$code_l = '';	// Default value for generic product/service
766
-			$code_p = '';	// Value for the product/service in parameter ($product)
767
-			$code_t = '';	// Default value of product account for the thirdparty
765
+			$code_l = ''; // Default value for generic product/service
766
+			$code_p = ''; // Value for the product/service in parameter ($product)
767
+			$code_t = ''; // Default value of product account for the thirdparty
768 768
 			$suggestedid = '';
769 769
 
770 770
 			// Level 1 (define $code_l): Search suggested default account for product/service
771 771
 			$suggestedaccountingaccountbydefaultfor = '';
772 772
 			if ($factureDet->product_type == 1) {
773 773
 				if ($buyer->country_code == $seller->country_code || empty($buyer->country_code)) {  // If buyer in same country than seller (if not defined, we assume it is same country)
774
-					$code_l = getDolGlobalString('ACCOUNTING_SERVICE_' . $const_name . '_ACCOUNT');
774
+					$code_l = getDolGlobalString('ACCOUNTING_SERVICE_'.$const_name.'_ACCOUNT');
775 775
 					$suggestedaccountingaccountbydefaultfor = '';
776 776
 				} else {
777 777
 					if ($isSellerInEEC && $isBuyerInEEC && $factureDet->tva_tx != 0) {    // European intravat sale, but with a VAT
778
-						$code_l = getDolGlobalString('ACCOUNTING_SERVICE_' . $const_name . '_ACCOUNT');
778
+						$code_l = getDolGlobalString('ACCOUNTING_SERVICE_'.$const_name.'_ACCOUNT');
779 779
 						$suggestedaccountingaccountbydefaultfor = 'eecwithvat';
780 780
 					} elseif ($isSellerInEEC && $isBuyerInEEC && empty($buyer->tva_intra)) {    // European intravat sale, without VAT intra community number
781
-						$code_l = getDolGlobalString('ACCOUNTING_SERVICE_' . $const_name . '_ACCOUNT');
781
+						$code_l = getDolGlobalString('ACCOUNTING_SERVICE_'.$const_name.'_ACCOUNT');
782 782
 						$suggestedaccountingaccountbydefaultfor = 'eecwithoutvatnumber';
783 783
 					} elseif ($isSellerInEEC && $isBuyerInEEC) {    // European intravat sale
784
-						$code_l = getDolGlobalString('ACCOUNTING_SERVICE_' . $const_name . '_INTRA_ACCOUNT');
784
+						$code_l = getDolGlobalString('ACCOUNTING_SERVICE_'.$const_name.'_INTRA_ACCOUNT');
785 785
 						$suggestedaccountingaccountbydefaultfor = 'eec';
786 786
 					} else {                                        // Foreign sale
787
-						$code_l = getDolGlobalString('ACCOUNTING_SERVICE_' . $const_name . '_EXPORT_ACCOUNT');
787
+						$code_l = getDolGlobalString('ACCOUNTING_SERVICE_'.$const_name.'_EXPORT_ACCOUNT');
788 788
 						$suggestedaccountingaccountbydefaultfor = 'export';
789 789
 					}
790 790
 				}
791 791
 			} elseif ($factureDet->product_type == 0) {
792 792
 				if ($buyer->country_code == $seller->country_code || empty($buyer->country_code)) {  // If buyer in same country than seller (if not defined, we assume it is same country)
793
-					$code_l = getDolGlobalString('ACCOUNTING_PRODUCT_' . $const_name . '_ACCOUNT');
793
+					$code_l = getDolGlobalString('ACCOUNTING_PRODUCT_'.$const_name.'_ACCOUNT');
794 794
 					$suggestedaccountingaccountbydefaultfor = '';
795 795
 				} else {
796 796
 					if ($isSellerInEEC && $isBuyerInEEC && $factureDet->tva_tx != 0) {    // European intravat sale, but with a VAT
797
-						$code_l = getDolGlobalString('ACCOUNTING_PRODUCT_' . $const_name . '_ACCOUNT');
797
+						$code_l = getDolGlobalString('ACCOUNTING_PRODUCT_'.$const_name.'_ACCOUNT');
798 798
 						$suggestedaccountingaccountbydefaultfor = 'eecwithvat';
799 799
 					} elseif ($isSellerInEEC && $isBuyerInEEC && empty($buyer->tva_intra)) {    // European intravat sale, without VAT intra community number
800
-						$code_l = getDolGlobalString('ACCOUNTING_PRODUCT_' . $const_name . '_ACCOUNT');
800
+						$code_l = getDolGlobalString('ACCOUNTING_PRODUCT_'.$const_name.'_ACCOUNT');
801 801
 						$suggestedaccountingaccountbydefaultfor = 'eecwithoutvatnumber';
802 802
 					} elseif ($isSellerInEEC && $isBuyerInEEC) {    // European intravat sale
803
-						$code_l = getDolGlobalString('ACCOUNTING_PRODUCT_' . $const_name . '_INTRA_ACCOUNT');
803
+						$code_l = getDolGlobalString('ACCOUNTING_PRODUCT_'.$const_name.'_INTRA_ACCOUNT');
804 804
 						$suggestedaccountingaccountbydefaultfor = 'eec';
805 805
 					} else {
806
-						$code_l = getDolGlobalString('ACCOUNTING_PRODUCT_' . $const_name . '_EXPORT_ACCOUNT');
806
+						$code_l = getDolGlobalString('ACCOUNTING_PRODUCT_'.$const_name.'_EXPORT_ACCOUNT');
807 807
 						$suggestedaccountingaccountbydefaultfor = 'export';
808 808
 					}
809 809
 				}
@@ -873,7 +873,7 @@  discard block
 block discarded – undo
873 873
 			}
874 874
 
875 875
 			// Manage Deposit
876
-			if (getDolGlobalString('ACCOUNTING_ACCOUNT_' . strtoupper($type) . '_DEPOSIT')) {
876
+			if (getDolGlobalString('ACCOUNTING_ACCOUNT_'.strtoupper($type).'_DEPOSIT')) {
877 877
 				if ($factureDet->desc == "(DEPOSIT)" || $facture->type == $facture::TYPE_DEPOSIT) {
878 878
 					$accountdeposittoventilated = new self($this->db);
879 879
 					if ($type == 'customer') {
Please login to merge, or discard this patch.
htdocs/accountancy/class/accountingjournal.class.php 1 patch
Spacing   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
 					$this->rowid		= $obj->rowid;
142 142
 
143 143
 					$this->code			= $obj->code;
144
-					$this->ref			= $obj->code;
144
+					$this->ref = $obj->code;
145 145
 					$this->label		= $obj->label;
146 146
 					$this->nature		= $obj->nature;
147 147
 					$this->active		= $obj->active;
@@ -433,10 +433,10 @@  discard block
 block discarded – undo
433 433
 			return array();
434 434
 		}
435 435
 
436
-		require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
437
-		require_once DOL_DOCUMENT_ROOT . '/asset/class/asset.class.php';
438
-		require_once DOL_DOCUMENT_ROOT . '/asset/class/assetaccountancycodes.class.php';
439
-		require_once DOL_DOCUMENT_ROOT . '/asset/class/assetdepreciationoptions.class.php';
436
+		require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
437
+		require_once DOL_DOCUMENT_ROOT.'/asset/class/asset.class.php';
438
+		require_once DOL_DOCUMENT_ROOT.'/asset/class/assetaccountancycodes.class.php';
439
+		require_once DOL_DOCUMENT_ROOT.'/asset/class/assetdepreciationoptions.class.php';
440 440
 
441 441
 		$langs->loadLangs(array("assets"));
442 442
 
@@ -452,21 +452,21 @@  discard block
 block discarded – undo
452 452
 		$sql .= "SELECT ad.fk_asset AS rowid, a.ref AS asset_ref, a.label AS asset_label, a.acquisition_value_ht AS asset_acquisition_value_ht";
453 453
 		$sql .= ", a.disposal_date AS asset_disposal_date, a.disposal_amount_ht AS asset_disposal_amount_ht, a.disposal_subject_to_vat AS asset_disposal_subject_to_vat";
454 454
 		$sql .= ", ad.rowid AS depreciation_id, ad.depreciation_mode, ad.ref AS depreciation_ref, ad.depreciation_date, ad.depreciation_ht, ad.accountancy_code_debit, ad.accountancy_code_credit";
455
-		$sql .= " FROM " . MAIN_DB_PREFIX . "asset_depreciation as ad";
456
-		$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "asset as a ON a.rowid = ad.fk_asset";
457
-		$sql .= " WHERE a.entity IN (" . getEntity('asset', 0) . ')'; // We don't share object for accountancy, we use source object sharing
455
+		$sql .= " FROM ".MAIN_DB_PREFIX."asset_depreciation as ad";
456
+		$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."asset as a ON a.rowid = ad.fk_asset";
457
+		$sql .= " WHERE a.entity IN (".getEntity('asset', 0).')'; // We don't share object for accountancy, we use source object sharing
458 458
 		if ($in_bookkeeping == 'already') {
459
-			$sql .= " AND EXISTS (SELECT iab.fk_docdet FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping AS iab WHERE iab.fk_docdet = ad.rowid AND doc_type = 'asset')";
459
+			$sql .= " AND EXISTS (SELECT iab.fk_docdet FROM ".MAIN_DB_PREFIX."accounting_bookkeeping AS iab WHERE iab.fk_docdet = ad.rowid AND doc_type = 'asset')";
460 460
 		} elseif ($in_bookkeeping == 'notyet') {
461
-			$sql .= " AND NOT EXISTS (SELECT iab.fk_docdet FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping AS iab WHERE iab.fk_docdet = ad.rowid AND doc_type = 'asset')";
461
+			$sql .= " AND NOT EXISTS (SELECT iab.fk_docdet FROM ".MAIN_DB_PREFIX."accounting_bookkeeping AS iab WHERE iab.fk_docdet = ad.rowid AND doc_type = 'asset')";
462 462
 		}
463 463
 		$sql .= " AND ad.ref != ''"; // not reversal lines
464 464
 		if ($date_start && $date_end) {
465
-			$sql .= " AND ad.depreciation_date >= '" . $this->db->idate($date_start) . "' AND ad.depreciation_date <= '" . $this->db->idate($date_end) . "'";
465
+			$sql .= " AND ad.depreciation_date >= '".$this->db->idate($date_start)."' AND ad.depreciation_date <= '".$this->db->idate($date_end)."'";
466 466
 		}
467 467
 		// Define begin binding date
468 468
 		if (getDolGlobalString('ACCOUNTING_DATE_START_BINDING')) {
469
-			$sql .= " AND ad.depreciation_date >= '" . $this->db->idate($conf->global->ACCOUNTING_DATE_START_BINDING) . "'";
469
+			$sql .= " AND ad.depreciation_date >= '".$this->db->idate($conf->global->ACCOUNTING_DATE_START_BINDING)."'";
470 470
 		}
471 471
 		$sql .= " ORDER BY ad.depreciation_date";
472 472
 
@@ -554,7 +554,7 @@  discard block
 block discarded – undo
554 554
 					if ($type == 'view') {
555 555
 						$account_to_show = length_accounta($account);
556 556
 						if (($account_to_show == "") || $account_to_show == 'NotDefined') {
557
-							$account_to_show = '<span class="error">' . $langs->trans("AssetInAccountNotDefined") . '</span>';
557
+							$account_to_show = '<span class="error">'.$langs->trans("AssetInAccountNotDefined").'</span>';
558 558
 						}
559 559
 
560 560
 						$blocks[] = array(
@@ -562,7 +562,7 @@  discard block
 block discarded – undo
562 562
 							'piece' => $element_link,
563 563
 							'account_accounting' => $account_to_show,
564 564
 							'subledger_account' => '',
565
-							'label_operation' => $label_operation . ' - ' . $depreciation_ref,
565
+							'label_operation' => $label_operation.' - '.$depreciation_ref,
566 566
 							'debit' => $mt < 0 ? price(-$mt) : '',
567 567
 							'credit' => $mt >= 0 ? price($mt) : '',
568 568
 						);
@@ -581,7 +581,7 @@  discard block
 block discarded – undo
581 581
 								'subledger_label' => '',
582 582
 								'numero_compte' => $account,
583 583
 								'label_compte' => $account_infos['label'],
584
-								'label_operation' => $element_name_formatted_0 . ' - ' . $depreciation_ref,
584
+								'label_operation' => $element_name_formatted_0.' - '.$depreciation_ref,
585 585
 								'montant' => $mt,
586 586
 								'sens' => $mt < 0 ? 'D' : 'C',
587 587
 								'debit' => $mt < 0 ? -$mt : 0,
@@ -596,12 +596,12 @@  discard block
 block discarded – undo
596 596
 						}
597 597
 					} else { // $type == 'csv'
598 598
 						$blocks[] = array(
599
-							$depreciation_date,                                   	// Date
600
-							$element_static->ref,                                	// Piece
601
-							$account_infos['code_formatted_1'],                		// AccountAccounting
602
-							$element_name_formatted_0 . ' - ' . $depreciation_ref,  // LabelOperation
603
-							$mt < 0 ? price(-$mt) : '',                        		// Debit
604
-							$mt >= 0 ? price($mt) : '',                        		// Credit
599
+							$depreciation_date, // Date
600
+							$element_static->ref, // Piece
601
+							$account_infos['code_formatted_1'], // AccountAccounting
602
+							$element_name_formatted_0.' - '.$depreciation_ref, // LabelOperation
603
+							$mt < 0 ? price(-$mt) : '', // Debit
604
+							$mt >= 0 ? price($mt) : '', // Credit
605 605
 						);
606 606
 					}
607 607
 				}
@@ -623,7 +623,7 @@  discard block
 block discarded – undo
623 623
 
624 624
 					// Get accountancy codes
625 625
 					//---------------------------
626
-					require_once DOL_DOCUMENT_ROOT . '/asset/class/assetaccountancycodes.class.php';
626
+					require_once DOL_DOCUMENT_ROOT.'/asset/class/assetaccountancycodes.class.php';
627 627
 					$accountancy_codes = new AssetAccountancyCodes($this->db);
628 628
 					$result = $accountancy_codes->fetchAccountancyCodes($element_static->id);
629 629
 					if ($result < 0) {
@@ -672,7 +672,7 @@  discard block
 block discarded – undo
672 672
 									if ($type == 'view') {
673 673
 										$account_to_show = length_accounta($account);
674 674
 										if (($account_to_show == "") || $account_to_show == 'NotDefined') {
675
-											$account_to_show = '<span class="error">' . $langs->trans("AssetInAccountNotDefined") . '</span>';
675
+											$account_to_show = '<span class="error">'.$langs->trans("AssetInAccountNotDefined").'</span>';
676 676
 										}
677 677
 
678 678
 										$blocks[] = array(
@@ -680,7 +680,7 @@  discard block
 block discarded – undo
680 680
 											'piece' => $element_link,
681 681
 											'account_accounting' => $account_to_show,
682 682
 											'subledger_account' => '',
683
-											'label_operation' => $label_operation . ' - ' . $disposal_ref,
683
+											'label_operation' => $label_operation.' - '.$disposal_ref,
684 684
 											'debit' => $mt < 0 ? price(-$mt) : '',
685 685
 											'credit' => $mt >= 0 ? price($mt) : '',
686 686
 										);
@@ -699,7 +699,7 @@  discard block
 block discarded – undo
699 699
 												'subledger_label' => '',
700 700
 												'numero_compte' => $account,
701 701
 												'label_compte' => $account_infos['label'],
702
-												'label_operation' => $element_name_formatted_0 . ' - ' . $disposal_ref,
702
+												'label_operation' => $element_name_formatted_0.' - '.$disposal_ref,
703 703
 												'montant' => $mt,
704 704
 												'sens' => $mt < 0 ? 'D' : 'C',
705 705
 												'debit' => $mt < 0 ? -$mt : 0,
@@ -714,12 +714,12 @@  discard block
 block discarded – undo
714 714
 										}
715 715
 									} else { // $type == 'csv'
716 716
 										$blocks[] = array(
717
-											$disposal_date,                                    // Date
718
-											$element_static->ref,                              // Piece
719
-											$account_infos['code_formatted_1'],                // AccountAccounting
720
-											$element_name_formatted_0 . ' - ' . $disposal_ref, // LabelOperation
721
-											$mt < 0 ? price(-$mt) : '',                        // Debit
722
-											$mt >= 0 ? price($mt) : '',                        // Credit
717
+											$disposal_date, // Date
718
+											$element_static->ref, // Piece
719
+											$account_infos['code_formatted_1'], // AccountAccounting
720
+											$element_name_formatted_0.' - '.$disposal_ref, // LabelOperation
721
+											$mt < 0 ? price(-$mt) : '', // Debit
722
+											$mt >= 0 ? price($mt) : '', // Credit
723 723
 										);
724 724
 									}
725 725
 								}
@@ -783,7 +783,7 @@  discard block
 block discarded – undo
783 783
 	public function writeIntoBookkeeping(User $user, &$journal_data = array(), $max_nb_errors = 10)
784 784
 	{
785 785
 		global $conf, $langs, $hookmanager;
786
-		require_once DOL_DOCUMENT_ROOT . '/accountancy/class/bookkeeping.class.php';
786
+		require_once DOL_DOCUMENT_ROOT.'/accountancy/class/bookkeeping.class.php';
787 787
 
788 788
 		$error = 0;
789 789
 
@@ -881,7 +881,7 @@  discard block
 block discarded – undo
881 881
 					$error++;
882 882
 					$error_for_line++;
883 883
 					$journal_data[$element_id]['error'] = 'amountsnotbalanced';
884
-					$this->errors[] = 'Try to insert a non balanced transaction in book for ' . $element['blocks'] . '. Canceled. Surely a bug.';
884
+					$this->errors[] = 'Try to insert a non balanced transaction in book for '.$element['blocks'].'. Canceled. Surely a bug.';
885 885
 				}
886 886
 
887 887
 				if (!$error_for_line) {
@@ -976,11 +976,11 @@  discard block
 block discarded – undo
976 976
 				);
977 977
 			}
978 978
 
979
-			if (!empty($header)) $out .= '"' . implode('"' . $sep . '"', $header) . '"' . "\n";
979
+			if (!empty($header)) $out .= '"'.implode('"'.$sep.'"', $header).'"'."\n";
980 980
 			foreach ($journal_data as $element_id => $element) {
981 981
 				foreach ($element['blocks'] as $lines) {
982 982
 					foreach ($lines as $line) {
983
-						$out .= '"' . implode('"' . $sep . '"', $line) . '"' . "\n";
983
+						$out .= '"'.implode('"'.$sep.'"', $line).'"'."\n";
984 984
 					}
985 985
 				}
986 986
 			}
@@ -998,8 +998,8 @@  discard block
 block discarded – undo
998 998
 	public function getAccountingAccountInfos($account)
999 999
 	{
1000 1000
 		if (!isset(self::$accounting_account_cached[$account])) {
1001
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
1002
-			require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingaccount.class.php';
1001
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
1002
+			require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php';
1003 1003
 			$accountingaccount = new AccountingAccount($this->db);
1004 1004
 			$result = $accountingaccount->fetch(null, $account, true);
1005 1005
 			if ($result > 0) {
Please login to merge, or discard this patch.
htdocs/accountancy/customer/list.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 $search_date_endday = GETPOST('search_date_endday', 'int');
70 70
 $search_date_endmonth = GETPOST('search_date_endmonth', 'int');
71 71
 $search_date_endyear = GETPOST('search_date_endyear', 'int');
72
-$search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear);	// Use tzserver
72
+$search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver
73 73
 $search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear);
74 74
 $search_country = GETPOST('search_country', 'alpha');
75 75
 $search_tvaintra = GETPOST('search_tvaintra', 'alpha');
@@ -264,20 +264,20 @@  discard block
 block discarded – undo
264 264
 $sql .= " FROM ".MAIN_DB_PREFIX."facture as f";
265 265
 $sql .= " INNER JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = f.fk_soc";
266 266
 if (getDolGlobalString('MAIN_COMPANY_PERENTITY_SHARED')) {
267
-	$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "societe_perentity as spe ON spe.fk_soc = s.rowid AND spe.entity = " . ((int) $conf->entity);
267
+	$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_perentity as spe ON spe.fk_soc = s.rowid AND spe.entity = ".((int) $conf->entity);
268 268
 }
269 269
 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as co ON co.rowid = s.fk_pays ";
270 270
 $sql .= " INNER JOIN ".MAIN_DB_PREFIX."facturedet as l ON f.rowid = l.fk_facture";
271 271
 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON p.rowid = l.fk_product";
272 272
 if (getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED')) {
273
-	$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product_perentity as ppe ON ppe.fk_product = p.rowid AND ppe.entity = " . ((int) $conf->entity);
273
+	$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_perentity as ppe ON ppe.fk_product = p.rowid AND ppe.entity = ".((int) $conf->entity);
274 274
 }
275 275
 $alias_societe_perentity = !getDolGlobalString('MAIN_COMPANY_PERENTITY_SHARED') ? "s" : "spe";
276 276
 $alias_product_perentity = !getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED') ? "p" : "ppe";
277
-$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa  ON " . $alias_product_perentity . ".accountancy_code_sell = aa.account_number         AND aa.active = 1  AND aa.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa.entity = ".$conf->entity;
278
-$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa2 ON " . $alias_product_perentity . ".accountancy_code_sell_intra = aa2.account_number  AND aa2.active = 1 AND aa2.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa2.entity = ".$conf->entity;
279
-$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa3 ON " . $alias_product_perentity . ".accountancy_code_sell_export = aa3.account_number AND aa3.active = 1 AND aa3.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa3.entity = ".$conf->entity;
280
-$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa4 ON " . $alias_societe_perentity . ".accountancy_code_sell = aa4.account_number        AND aa4.active = 1 AND aa4.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa4.entity = ".$conf->entity;
277
+$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa  ON ".$alias_product_perentity.".accountancy_code_sell = aa.account_number         AND aa.active = 1  AND aa.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa.entity = ".$conf->entity;
278
+$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa2 ON ".$alias_product_perentity.".accountancy_code_sell_intra = aa2.account_number  AND aa2.active = 1 AND aa2.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa2.entity = ".$conf->entity;
279
+$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa3 ON ".$alias_product_perentity.".accountancy_code_sell_export = aa3.account_number AND aa3.active = 1 AND aa3.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa3.entity = ".$conf->entity;
280
+$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa4 ON ".$alias_societe_perentity.".accountancy_code_sell = aa4.account_number        AND aa4.active = 1 AND aa4.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa4.entity = ".$conf->entity;
281 281
 
282 282
 $sql .= " WHERE f.fk_statut > 0 AND l.fk_code_ventilation <= 0";
283 283
 $sql .= " AND l.product_type <= 2";
@@ -466,7 +466,7 @@  discard block
 block discarded – undo
466 466
 	print_barre_liste($langs->trans("InvoiceLines"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num_lines, $nbtotalofrecords, 'title_accountancy', 0, '', '', $limit);
467 467
 
468 468
 	if ($massaction == 'set_default_account') {
469
-		$formquestion[]=array('type' => 'other',
469
+		$formquestion[] = array('type' => 'other',
470 470
 			'name' => 'set_default_account',
471 471
 			'label' => $langs->trans("AccountancyCode"),
472 472
 			'value' => $formaccounting->select_account('', 'default_account', 1, array(), 0, 0, 'maxwidth200 maxwidthonsmartphone', 'cachewithshowemptyone'));
@@ -558,14 +558,14 @@  discard block
 block discarded – undo
558 558
 		$thirdpartystatic->client = $objp->client;
559 559
 		$thirdpartystatic->fournisseur = $objp->fournisseur;
560 560
 		$thirdpartystatic->code_client = $objp->code_client;
561
-		$thirdpartystatic->code_compta = $objp->code_compta_client;		// For backward compatibility
561
+		$thirdpartystatic->code_compta = $objp->code_compta_client; // For backward compatibility
562 562
 		$thirdpartystatic->code_compta_client = $objp->code_compta_client;
563 563
 		$thirdpartystatic->code_fournisseur = $objp->code_fournisseur;
564 564
 		$thirdpartystatic->code_compta_fournisseur = $objp->code_compta_fournisseur;
565 565
 		$thirdpartystatic->email = $objp->email;
566 566
 		$thirdpartystatic->country_code = $objp->country_code;
567 567
 		$thirdpartystatic->tva_intra = $objp->tva_intra;
568
-		$thirdpartystatic->code_compta_product = $objp->company_code_sell;		// The accounting account for product stored on thirdparty object (for level3 suggestion)
568
+		$thirdpartystatic->code_compta_product = $objp->company_code_sell; // The accounting account for product stored on thirdparty object (for level3 suggestion)
569 569
 
570 570
 		$product_static->ref = $objp->product_ref;
571 571
 		$product_static->id = $objp->product_id;
@@ -605,16 +605,16 @@  discard block
 block discarded – undo
605 605
 
606 606
 		$suggestedid = 0;
607 607
 
608
-		$return=$accountingAccount->getAccountingCodeToBind($thirdpartystatic, $mysoc, $product_static, $facture_static, $facture_static_det, $accountingAccountArray, 'customer');
609
-		if (!is_array($return) && $return<0) {
608
+		$return = $accountingAccount->getAccountingCodeToBind($thirdpartystatic, $mysoc, $product_static, $facture_static, $facture_static_det, $accountingAccountArray, 'customer');
609
+		if (!is_array($return) && $return < 0) {
610 610
 			setEventMessage($accountingAccount->error, 'errors');
611 611
 		} else {
612
-			$suggestedid=$return['suggestedid'];
613
-			$suggestedaccountingaccountfor=$return['suggestedaccountingaccountfor'];
614
-			$suggestedaccountingaccountbydefaultfor=$return['suggestedaccountingaccountbydefaultfor'];
615
-			$code_sell_l=$return['code_l'];
616
-			$code_sell_p=$return['code_p'];
617
-			$code_sell_t=$return['code_t'];
612
+			$suggestedid = $return['suggestedid'];
613
+			$suggestedaccountingaccountfor = $return['suggestedaccountingaccountfor'];
614
+			$suggestedaccountingaccountbydefaultfor = $return['suggestedaccountingaccountbydefaultfor'];
615
+			$code_sell_l = $return['code_l'];
616
+			$code_sell_p = $return['code_p'];
617
+			$code_sell_t = $return['code_t'];
618 618
 		}
619 619
 		//var_dump($return);
620 620
 
@@ -693,7 +693,7 @@  discard block
 block discarded – undo
693 693
 		if ($product_static->tva_tx !== $facture_static_det->tva_tx && price2num($product_static->tva_tx) && price2num($facture_static_det->tva_tx)) {	// Note: having a vat rate of 0 is often the normal case when sells is intra b2b or to export
694 694
 			$code_vat_differ = 'warning bold';
695 695
 		}
696
-		print '<td class="right'.($code_vat_differ?' '.$code_vat_differ:'').'">';
696
+		print '<td class="right'.($code_vat_differ ? ' '.$code_vat_differ : '').'">';
697 697
 		print vatrate($facture_static_det->tva_tx.($facture_static_det->vat_src_code ? ' ('.$facture_static_det->vat_src_code.')' : ''));
698 698
 		print '</td>';
699 699
 
@@ -774,7 +774,7 @@  discard block
 block discarded – undo
774 774
 		if (!empty($toselect)) {
775 775
 			$ischecked = 0;
776 776
 			if (in_array($objp->rowid."_".$i, $toselect)) {
777
-				$ischecked=1;
777
+				$ischecked = 1;
778 778
 			}
779 779
 		}
780 780
 
Please login to merge, or discard this patch.
htdocs/accountancy/customer/card.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -110,7 +110,7 @@
 block discarded – undo
110 110
 	$sql .= " FROM ".MAIN_DB_PREFIX."facturedet as l";
111 111
 	$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON p.rowid = l.fk_product";
112 112
 	if (getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED')) {
113
-		$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product_perentity as ppe ON ppe.fk_product = p.rowid AND ppe.entity = " . ((int) $conf->entity);
113
+		$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_perentity as ppe ON ppe.fk_product = p.rowid AND ppe.entity = ".((int) $conf->entity);
114 114
 	}
115 115
 	$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa ON l.fk_code_ventilation = aa.rowid";
116 116
 	$sql .= " INNER JOIN ".MAIN_DB_PREFIX."facture as f ON f.rowid = l.fk_facture";
Please login to merge, or discard this patch.
htdocs/accountancy/customer/lines.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 $search_date_endday = GETPOST('search_date_endday', 'int');
60 60
 $search_date_endmonth = GETPOST('search_date_endmonth', 'int');
61 61
 $search_date_endyear = GETPOST('search_date_endyear', 'int');
62
-$search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear);	// Use tzserver
62
+$search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver
63 63
 $search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear);
64 64
 $search_country = GETPOST('search_country', 'alpha');
65 65
 $search_tvaintra = GETPOST('search_tvaintra', 'alpha');
@@ -223,13 +223,13 @@  discard block
 block discarded – undo
223 223
 $sql .= " FROM ".MAIN_DB_PREFIX."facturedet as fd";
224 224
 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON p.rowid = fd.fk_product";
225 225
 if (getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED')) {
226
-	$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product_perentity as ppe ON ppe.fk_product = p.rowid AND ppe.entity = " . ((int) $conf->entity);
226
+	$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_perentity as ppe ON ppe.fk_product = p.rowid AND ppe.entity = ".((int) $conf->entity);
227 227
 }
228 228
 $sql .= " INNER JOIN ".MAIN_DB_PREFIX."accounting_account as aa ON aa.rowid = fd.fk_code_ventilation";
229 229
 $sql .= " INNER JOIN ".MAIN_DB_PREFIX."facture as f ON f.rowid = fd.fk_facture";
230 230
 $sql .= " INNER JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = f.fk_soc";
231 231
 if (getDolGlobalString('MAIN_COMPANY_PERENTITY_SHARED')) {
232
-	$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "societe_perentity as spe ON spe.fk_soc = s.rowid AND spe.entity = " . ((int) $conf->entity);
232
+	$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_perentity as spe ON spe.fk_soc = s.rowid AND spe.entity = ".((int) $conf->entity);
233 233
 }
234 234
 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as co ON co.rowid = s.fk_pays ";
235 235
 $sql .= " WHERE fd.fk_code_ventilation > 0";
Please login to merge, or discard this patch.
htdocs/accountancy/customer/index.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -140,27 +140,27 @@  discard block
 block discarded – undo
140 140
 	$sql .= " co.code as country_code, co.label as country_label,";
141 141
 	$sql .= " s.tva_intra,";
142 142
 	if (getDolGlobalString('MAIN_COMPANY_PERENTITY_SHARED')) {
143
-		$sql .= " spe.accountancy_code_sell as company_code_sell";	// accounting code for product but stored on thirdparty
143
+		$sql .= " spe.accountancy_code_sell as company_code_sell"; // accounting code for product but stored on thirdparty
144 144
 	} else {
145
-		$sql .= " s.accountancy_code_sell as company_code_sell";	// accounting code for product but stored on thirdparty
145
+		$sql .= " s.accountancy_code_sell as company_code_sell"; // accounting code for product but stored on thirdparty
146 146
 	}
147 147
 	$sql .= " FROM ".$db->prefix()."facture as f";
148 148
 	$sql .= " INNER JOIN ".$db->prefix()."societe as s ON s.rowid = f.fk_soc";
149 149
 	if (getDolGlobalString('MAIN_COMPANY_PERENTITY_SHARED')) {
150
-		$sql .= " LEFT JOIN " . $db->prefix() . "societe_perentity as spe ON spe.fk_soc = s.rowid AND spe.entity = " . ((int) $conf->entity);
150
+		$sql .= " LEFT JOIN ".$db->prefix()."societe_perentity as spe ON spe.fk_soc = s.rowid AND spe.entity = ".((int) $conf->entity);
151 151
 	}
152 152
 	$sql .= " LEFT JOIN ".$db->prefix()."c_country as co ON co.rowid = s.fk_pays ";
153
-	$sql .= " INNER JOIN ".$db->prefix()."facturedet as l ON f.rowid = l.fk_facture";	// the main table
153
+	$sql .= " INNER JOIN ".$db->prefix()."facturedet as l ON f.rowid = l.fk_facture"; // the main table
154 154
 	$sql .= " LEFT JOIN ".$db->prefix()."product as p ON p.rowid = l.fk_product";
155 155
 	if (getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED')) {
156
-		$sql .= " LEFT JOIN " . $db->prefix() . "product_perentity as ppe ON ppe.fk_product = p.rowid AND ppe.entity = " . ((int) $conf->entity);
156
+		$sql .= " LEFT JOIN ".$db->prefix()."product_perentity as ppe ON ppe.fk_product = p.rowid AND ppe.entity = ".((int) $conf->entity);
157 157
 	}
158 158
 	$alias_societe_perentity = !getDolGlobalString('MAIN_COMPANY_PERENTITY_SHARED') ? "s" : "spe";
159 159
 	$alias_product_perentity = !getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED') ? "p" : "ppe";
160
-	$sql .= " LEFT JOIN ".$db->prefix()."accounting_account as aa  ON " . $alias_product_perentity . ".accountancy_code_sell = aa.account_number         AND aa.active = 1  AND aa.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa.entity = ".$conf->entity;
161
-	$sql .= " LEFT JOIN ".$db->prefix()."accounting_account as aa2 ON " . $alias_product_perentity . ".accountancy_code_sell_intra = aa2.account_number  AND aa2.active = 1 AND aa2.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa2.entity = ".$conf->entity;
162
-	$sql .= " LEFT JOIN ".$db->prefix()."accounting_account as aa3 ON " . $alias_product_perentity . ".accountancy_code_sell_export = aa3.account_number AND aa3.active = 1 AND aa3.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa3.entity = ".$conf->entity;
163
-	$sql .= " LEFT JOIN ".$db->prefix()."accounting_account as aa4 ON " . $alias_societe_perentity . ".accountancy_code_sell = aa4.account_number        AND aa4.active = 1 AND aa4.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa4.entity = ".$conf->entity;
160
+	$sql .= " LEFT JOIN ".$db->prefix()."accounting_account as aa  ON ".$alias_product_perentity.".accountancy_code_sell = aa.account_number         AND aa.active = 1  AND aa.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa.entity = ".$conf->entity;
161
+	$sql .= " LEFT JOIN ".$db->prefix()."accounting_account as aa2 ON ".$alias_product_perentity.".accountancy_code_sell_intra = aa2.account_number  AND aa2.active = 1 AND aa2.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa2.entity = ".$conf->entity;
162
+	$sql .= " LEFT JOIN ".$db->prefix()."accounting_account as aa3 ON ".$alias_product_perentity.".accountancy_code_sell_export = aa3.account_number AND aa3.active = 1 AND aa3.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa3.entity = ".$conf->entity;
163
+	$sql .= " LEFT JOIN ".$db->prefix()."accounting_account as aa4 ON ".$alias_societe_perentity.".accountancy_code_sell = aa4.account_number        AND aa4.active = 1 AND aa4.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa4.entity = ".$conf->entity;
164 164
 	$sql .= " WHERE f.fk_statut > 0 AND l.fk_code_ventilation <= 0";
165 165
 	$sql .= " AND l.product_type <= 2";
166 166
 	$sql .= " AND f.entity IN (".getEntity('invoice', 0).")"; // We don't share object for accountancy
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
 			$thirdpartystatic->email = !empty($objp->email) ? $objp->email : "";
205 205
 			$thirdpartystatic->country_code = !empty($objp->country_code) ? $objp->country_code : "";
206 206
 			$thirdpartystatic->tva_intra = !empty($objp->tva_intra) ? $objp->tva_intra : "";
207
-			$thirdpartystatic->code_compta_product = !empty($objp->company_code_sell) ? $objp->company_code_sell : "";		// The accounting account for product stored on thirdparty object (for level3 suggestion)
207
+			$thirdpartystatic->code_compta_product = !empty($objp->company_code_sell) ? $objp->company_code_sell : ""; // The accounting account for product stored on thirdparty object (for level3 suggestion)
208 208
 
209 209
 			$product_static->ref = $objp->product_ref;
210 210
 			$product_static->id = $objp->product_id;
@@ -244,7 +244,7 @@  discard block
 block discarded – undo
244 244
 
245 245
 			$suggestedid = 0;
246 246
 
247
-			$return=$accountingAccount->getAccountingCodeToBind($thirdpartystatic, $mysoc, $product_static, $facture_static, $facture_static_det, $accountingAccountArray, 'customer');
247
+			$return = $accountingAccount->getAccountingCodeToBind($thirdpartystatic, $mysoc, $product_static, $facture_static, $facture_static_det, $accountingAccountArray, 'customer');
248 248
 			if (!is_array($return) && $return < 0) {
249 249
 				setEventMessage($accountingAccount->error, 'errors');
250 250
 			} else {
@@ -288,7 +288,7 @@  discard block
 block discarded – undo
288 288
 		$db->rollback();
289 289
 	} else {
290 290
 		$db->commit();
291
-		setEventMessages($langs->trans('AutomaticBindingDone', 	$nbbinddone, $notpossible), null, ($notpossible ? 'warnings' : 'mesgs'));
291
+		setEventMessages($langs->trans('AutomaticBindingDone', $nbbinddone, $notpossible), null, ($notpossible ? 'warnings' : 'mesgs'));
292 292
 		if ($nbbindfailed) {
293 293
 			setEventMessages($langs->trans('DoManualBindingForFailedRecord', $nbbindfailed), null, 'warnings');
294 294
 		}
@@ -668,12 +668,12 @@  discard block
 block discarded – undo
668 668
 				}
669 669
 				$sql .= " SUM(".$db->ifsql("MONTH(f.datef)=".$j,
670 670
 							" (".$db->ifsql("fd.total_ht < 0",
671
-								" (-1 * (abs(fd.total_ht) - (fd.buy_price_ht * fd.qty * (fd.situation_percent / 100))))",	// TODO This is bugged, we must use the percent for the invoice and fd.situation_percent is cumulated percent !
671
+								" (-1 * (abs(fd.total_ht) - (fd.buy_price_ht * fd.qty * (fd.situation_percent / 100))))", // TODO This is bugged, we must use the percent for the invoice and fd.situation_percent is cumulated percent !
672 672
 								"  (fd.total_ht - (fd.buy_price_ht * fd.qty * (fd.situation_percent / 100)))").")",
673 673
 							 0).") AS month".str_pad($j, 2, '0', STR_PAD_LEFT).",";
674 674
 			}
675 675
 			$sql .= "  SUM(".$db->ifsql("fd.total_ht < 0",
676
-				" (-1 * (abs(fd.total_ht) - (fd.buy_price_ht * fd.qty * (fd.situation_percent / 100))))",	// TODO This is bugged, we must use the percent for the invoice and fd.situation_percent is cumulated percent !
676
+				" (-1 * (abs(fd.total_ht) - (fd.buy_price_ht * fd.qty * (fd.situation_percent / 100))))", // TODO This is bugged, we must use the percent for the invoice and fd.situation_percent is cumulated percent !
677 677
 								"  (fd.total_ht - (fd.buy_price_ht * fd.qty * (fd.situation_percent / 100)))").") as total";
678 678
 		} else {
679 679
 			$sql = "SELECT '".$db->escape($langs->trans("Vide"))."' AS marge,";
Please login to merge, or discard this patch.
htdocs/admin/mails.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -383,7 +383,7 @@  discard block
 block discarded – undo
383 383
 	print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_SENDMODE").'</td><td>';
384 384
 
385 385
 	// SuperAdministrator access only
386
-	if (!isModEnabled('multicompany')  || ($user->admin && !$user->entity)) {
386
+	if (!isModEnabled('multicompany') || ($user->admin && !$user->entity)) {
387 387
 		print $form->selectarray('MAIN_MAIL_SENDMODE', $listofmethods, getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail'));
388 388
 	} else {
389 389
 		$text = $listofmethods[getDolGlobalString('MAIN_MAIL_SENDMODE')];
@@ -502,11 +502,11 @@  discard block
 block discarded – undo
502 502
 		print '</td><td>';
503 503
 		// SuperAdministrator access only
504 504
 		if (!isModEnabled('multicompany') || ($user->admin && !$user->entity)) {
505
-			print '<input class="flat" type="password" name="MAIN_MAIL_SMTPS_PW" size="32" value="' . htmlspecialchars($mainsmtppw, ENT_COMPAT, 'UTF-8') . '" autocomplete="off">';
505
+			print '<input class="flat" type="password" name="MAIN_MAIL_SMTPS_PW" size="32" value="'.htmlspecialchars($mainsmtppw, ENT_COMPAT, 'UTF-8').'" autocomplete="off">';
506 506
 		} else {
507 507
 			$htmltext = $langs->trans("ContactSuperAdminForChange");
508 508
 			print $form->textwithpicto($conf->global->MAIN_MAIL_SMTPS_PW, $htmltext, 1, 'superadmin');
509
-			print '<input type="hidden" name="MAIN_MAIL_SMTPS_PW" value="' . htmlspecialchars($mainsmtppw, ENT_COMPAT, 'UTF-8') . '">';
509
+			print '<input type="hidden" name="MAIN_MAIL_SMTPS_PW" value="'.htmlspecialchars($mainsmtppw, ENT_COMPAT, 'UTF-8').'">';
510 510
 		}
511 511
 		print '</td></tr>';
512 512
 	}
@@ -516,7 +516,7 @@  discard block
 block discarded – undo
516 516
 		print '<tr class="oddeven smtp_oauth_service"><td>'.$langs->trans("MAIN_MAIL_SMTPS_OAUTH_SERVICE").'</td><td>';
517 517
 
518 518
 		// SuperAdministrator access only
519
-		if (!isModEnabled('multicompany')  || ($user->admin && !$user->entity)) {
519
+		if (!isModEnabled('multicompany') || ($user->admin && !$user->entity)) {
520 520
 			print $form->selectarray('MAIN_MAIL_SMTPS_OAUTH_SERVICE', $oauthservices, $conf->global->MAIN_MAIL_SMTPS_OAUTH_SERVICE);
521 521
 		} else {
522 522
 			$text = $oauthservices[getDolGlobalString('MAIN_MAIL_SMTPS_OAUTH_SERVICE')];
@@ -525,7 +525,7 @@  discard block
 block discarded – undo
525 525
 			}
526 526
 			$htmltext = $langs->trans("ContactSuperAdminForChange");
527 527
 			print $form->textwithpicto($text, $htmltext, 1, 'superadmin');
528
-			print '<input type="hidden" name="MAIN_MAIL_SMTPS_OAUTH_SERVICE" value="' . getDolGlobalString('MAIN_MAIL_SMTPS_OAUTH_SERVICE').'">';
528
+			print '<input type="hidden" name="MAIN_MAIL_SMTPS_OAUTH_SERVICE" value="'.getDolGlobalString('MAIN_MAIL_SMTPS_OAUTH_SERVICE').'">';
529 529
 		}
530 530
 		print '</td></tr>';
531 531
 	}
@@ -717,13 +717,13 @@  discard block
 block discarded – undo
717 717
 		// AUTH method
718 718
 		if (in_array(getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail'), array('smtps', 'swiftmailer'))) {
719 719
 			$authtype = getDolGlobalString('MAIN_MAIL_SMTPS_AUTH_TYPE', 'LOGIN');
720
-			$text = ($authtype === "LOGIN") ? $langs->trans("UsePassword") : ($authtype === "XOAUTH2" ?  $langs->trans("UseOauth") : '') ;
720
+			$text = ($authtype === "LOGIN") ? $langs->trans("UsePassword") : ($authtype === "XOAUTH2" ? $langs->trans("UseOauth") : '');
721 721
 			print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_SMTPS_AUTH_TYPE").'</td><td>'.$text.'</td></tr>';
722 722
 		}
723 723
 
724 724
 		// SMTPS ID
725 725
 		if (in_array(getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail'), array('smtps', 'swiftmailer'))) {
726
-			print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_SMTPS_ID").'</td><td>' . getDolGlobalString('MAIN_MAIL_SMTPS_ID').'</td></tr>';
726
+			print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_SMTPS_ID").'</td><td>'.getDolGlobalString('MAIN_MAIL_SMTPS_ID').'</td></tr>';
727 727
 		}
728 728
 
729 729
 		// SMTPS PW
@@ -832,7 +832,7 @@  discard block
 block discarded – undo
832 832
 		// From
833 833
 		$help = img_help(1, $langs->trans("EMailHelpMsgSPFDKIM"));
834 834
 		print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_EMAIL_FROM", ini_get('sendmail_from') ?ini_get('sendmail_from') : $langs->transnoentities("Undefined")).' '.$help.'</td>';
835
-		print '<td>' . getDolGlobalString('MAIN_MAIL_EMAIL_FROM');
835
+		print '<td>'.getDolGlobalString('MAIN_MAIL_EMAIL_FROM');
836 836
 		if (!getDolGlobalString('MAIN_MAIL_EMAIL_FROM')) {
837 837
 			print img_warning($langs->trans("Mandatory"));
838 838
 		} elseif (!isValidEmail($conf->global->MAIN_MAIL_EMAIL_FROM)) {
Please login to merge, or discard this patch.
htdocs/admin/limits.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
 
48 48
 $valmainmaxdecimalsunit = GETPOST($mainmaxdecimalsunit, 'int');
49 49
 $valmainmaxdecimalstot = GETPOST($mainmaxdecimalstot, 'int');
50
-$valmainmaxdecimalsshown = GETPOST($mainmaxdecimalsshown, 'alpha');	// Can be 'x.y' but also 'x...'
50
+$valmainmaxdecimalsshown = GETPOST($mainmaxdecimalsshown, 'alpha'); // Can be 'x.y' but also 'x...'
51 51
 $valmainroundingruletot = price2num(GETPOST($mainroundingruletot, 'alphanohtml'), '', 2);
52 52
 
53 53
 if (!$user->admin) {
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
 		setEventMessages($langs->trans("ErrorValueCantBeNull", dol_trunc(dol_string_nohtmltag($langs->transnoentitiesnoconv("MAIN_MAX_DECIMALS_SHOWN")), 40)), null, 'errors');
95 95
 		$action = 'edit';
96 96
 	}
97
-	if (! $error && ((float) $valmainmaxdecimalsshown < $valmainmaxdecimalsunit || (float) $valmainmaxdecimalsshown < $valmainmaxdecimalstot)) {
97
+	if (!$error && ((float) $valmainmaxdecimalsshown < $valmainmaxdecimalsunit || (float) $valmainmaxdecimalsshown < $valmainmaxdecimalstot)) {
98 98
 		$langs->load("errors");
99 99
 		$error++;
100 100
 		setEventMessages($langs->trans("ErrorValueForTooLow", dol_trunc(dol_string_nohtmltag($langs->transnoentitiesnoconv("MAIN_MAX_DECIMALS_SHOWN")), 40)), null, 'errors');
@@ -130,11 +130,11 @@  discard block
 block discarded – undo
130 130
 $aCurrencies = array($conf->currency); // Default currency always first position
131 131
 
132 132
 if (isModEnabled('multicompany') && getDolGlobalString('MULTICURRENCY_USE_LIMIT_BY_CURRENCY')) {
133
-	require_once DOL_DOCUMENT_ROOT . '/core/lib/multicurrency.lib.php';
133
+	require_once DOL_DOCUMENT_ROOT.'/core/lib/multicurrency.lib.php';
134 134
 
135
-	$sql = "SELECT rowid, code FROM " . MAIN_DB_PREFIX . "multicurrency";
136
-	$sql .= " WHERE entity = " . ((int) $conf->entity);
137
-	$sql .= " AND code <> '" . $db->escape($conf->currency) . "'"; // Default currency always first position
135
+	$sql = "SELECT rowid, code FROM ".MAIN_DB_PREFIX."multicurrency";
136
+	$sql .= " WHERE entity = ".((int) $conf->entity);
137
+	$sql .= " AND code <> '".$db->escape($conf->currency)."'"; // Default currency always first position
138 138
 	$resql = $db->query($sql);
139 139
 	if ($resql) {
140 140
 		while ($obj = $db->fetch_object($resql)) {
@@ -153,11 +153,11 @@  discard block
 block discarded – undo
153 153
 print "<br>\n";
154 154
 
155 155
 if ($action == 'edit') {
156
-	print '<form method="POST" action="' . $_SERVER["PHP_SELF"] . '">';
157
-	print '<input type="hidden" name="token" value="' . newToken() . '">';
156
+	print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
157
+	print '<input type="hidden" name="token" value="'.newToken().'">';
158 158
 	print '<input type="hidden" name="action" value="update">';
159 159
 	if (isModEnabled('multicompany') && getDolGlobalString('MULTICURRENCY_USE_LIMIT_BY_CURRENCY')) {
160
-		print '<input type="hidden" name="currencycode" value="' . $currencycode . '">';
160
+		print '<input type="hidden" name="currencycode" value="'.$currencycode.'">';
161 161
 	}
162 162
 
163 163
 	clearstatcache();
Please login to merge, or discard this patch.
htdocs/admin/ihm.php 1 patch
Spacing   +59 added lines, -59 removed lines patch added patch discarded remove patch
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
 	dolibarr_set_const($db, "MAIN_IHM_PARAMS_REV", getDolGlobalInt('MAIN_IHM_PARAMS_REV') + 1, 'chaine', 0, '', $conf->entity);
82 82
 	require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
83 83
 
84
-	$logofile = $conf->mycompany->dir_output.'/logos/' . getDolGlobalString('MAIN_LOGIN_BACKGROUND');
84
+	$logofile = $conf->mycompany->dir_output.'/logos/'.getDolGlobalString('MAIN_LOGIN_BACKGROUND');
85 85
 	dol_delete_file($logofile);
86 86
 	dolibarr_del_const($db, "MAIN_LOGIN_BACKGROUND", $conf->entity);
87 87
 	$mysoc->logo = '';
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
 		}
122 122
 
123 123
 		if (GETPOSTISSET('THEME_TOPMENU_DISABLE_IMAGE')) {
124
-			$val=GETPOST('THEME_TOPMENU_DISABLE_IMAGE');
124
+			$val = GETPOST('THEME_TOPMENU_DISABLE_IMAGE');
125 125
 			if (!$val) {
126 126
 				dolibarr_del_const($db, 'THEME_TOPMENU_DISABLE_IMAGE', $conf->entity);
127 127
 			} else {
@@ -225,14 +225,14 @@  discard block
 block discarded – undo
225 225
 			dolibarr_set_const($db, "THEME_ELDY_USE_CHECKED", $val, 'chaine', 0, '', $conf->entity);
226 226
 		}
227 227
 
228
-		$val=(implode(',', (colorStringToArray(GETPOST('THEME_ELDY_BTNACTION'), array()))));
228
+		$val = (implode(',', (colorStringToArray(GETPOST('THEME_ELDY_BTNACTION'), array()))));
229 229
 		if ($val == '') {
230 230
 			dolibarr_del_const($db, 'THEME_ELDY_BTNACTION', $conf->entity);
231 231
 		} else {
232 232
 			dolibarr_set_const($db, 'THEME_ELDY_BTNACTION', $val, 'chaine', 0, '', $conf->entity);
233 233
 		}
234 234
 
235
-		$val=(implode(',', (colorStringToArray(GETPOST('THEME_ELDY_TEXTBTNACTION'), array()))));
235
+		$val = (implode(',', (colorStringToArray(GETPOST('THEME_ELDY_TEXTBTNACTION'), array()))));
236 236
 		if ($val == '') {
237 237
 			dolibarr_del_const($db, 'THEME_ELDY_TEXTBTNACTION', $conf->entity);
238 238
 		} else {
@@ -273,7 +273,7 @@  discard block
 block discarded – undo
273 273
 		//dolibarr_set_const($db, "MAIN_HELP_DISABLELINK", GETPOST("MAIN_HELP_DISABLELINK", 'aZ09'), 'chaine', 0, '', 0); // Param for all entities
274 274
 
275 275
 		$varforimage = 'imagebackground';
276
-		$dirforimage = $conf->mycompany->dir_output . '/logos/';
276
+		$dirforimage = $conf->mycompany->dir_output.'/logos/';
277 277
 		if ($_FILES[$varforimage]["tmp_name"]) {
278 278
 			$reg = array();
279 279
 			if (preg_match('/([^\\/:]+)$/i', $_FILES[$varforimage]["name"], $reg)) {
@@ -281,11 +281,11 @@  discard block
 block discarded – undo
281 281
 
282 282
 				$isimage = image_format_supported($original_file);
283 283
 				if ($isimage >= 0) {
284
-					dol_syslog("Move file " . $_FILES[$varforimage]["tmp_name"] . " to " . $dirforimage . $original_file);
284
+					dol_syslog("Move file ".$_FILES[$varforimage]["tmp_name"]." to ".$dirforimage.$original_file);
285 285
 					if (!is_dir($dirforimage)) {
286 286
 						dol_mkdir($dirforimage);
287 287
 					}
288
-					$result = dol_move_uploaded_file($_FILES[$varforimage]["tmp_name"], $dirforimage . $original_file, 1, 0, $_FILES[$varforimage]['error']);
288
+					$result = dol_move_uploaded_file($_FILES[$varforimage]["tmp_name"], $dirforimage.$original_file, 1, 0, $_FILES[$varforimage]['error']);
289 289
 					if ($result > 0) {
290 290
 						dolibarr_set_const($db, "MAIN_LOGIN_BACKGROUND", $original_file, 'chaine', 0, '', $conf->entity);
291 291
 					} elseif (preg_match('/^ErrorFileIsInfectedWithAVirus/', $result)) {
@@ -381,17 +381,17 @@  discard block
 block discarded – undo
381 381
 	print '</tr>';
382 382
 
383 383
 	// Multilingual GUI
384
-	print '<tr class="oddeven"><td>' . $langs->trans("EnableMultilangInterface") . '</td><td>';
384
+	print '<tr class="oddeven"><td>'.$langs->trans("EnableMultilangInterface").'</td><td>';
385 385
 	print ajax_constantonoff("MAIN_MULTILANGS", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '', 'language');
386 386
 	print '</td>';
387 387
 	print '</tr>';
388 388
 
389
-	print '</table>' . "\n";
389
+	print '</table>'."\n";
390 390
 	print '</div>';
391 391
 
392 392
 	print '<div class="center">';
393
-	print '<input class="button button-save reposition" type="submit" name="submit" value="' . $langs->trans("Save") . '">';
394
-	print '<input class="button button-cancel reposition" type="submit" name="cancel" value="' . $langs->trans("Cancel") . '">';
393
+	print '<input class="button button-save reposition" type="submit" name="submit" value="'.$langs->trans("Save").'">';
394
+	print '<input class="button button-cancel reposition" type="submit" name="cancel" value="'.$langs->trans("Cancel").'">';
395 395
 	print '</div>';
396 396
 
397 397
 	print '<br>';
@@ -408,29 +408,29 @@  discard block
 block discarded – undo
408 408
 	print '</tr>';
409 409
 
410 410
 	// Show Quick Add link
411
-	print '<tr class="oddeven"><td>' . $langs->trans("ShowQuickAddLink") . '</td><td>';
411
+	print '<tr class="oddeven"><td>'.$langs->trans("ShowQuickAddLink").'</td><td>';
412 412
 	print ajax_constantonoff("MAIN_USE_TOP_MENU_QUICKADD_DROPDOWN", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '', 'other');
413 413
 	print '</td>';
414 414
 	print '</tr>';
415 415
 
416 416
 	// Hide wiki link on login page
417 417
 	$pictohelp = '<span class="fa fa-question-circle"></span>';
418
-	print '<tr class="oddeven"><td>' . str_replace('{picto}', $pictohelp, $langs->trans("DisableLinkToHelp", '{picto}')) . '</td><td>';
418
+	print '<tr class="oddeven"><td>'.str_replace('{picto}', $pictohelp, $langs->trans("DisableLinkToHelp", '{picto}')).'</td><td>';
419 419
 	print ajax_constantonoff("MAIN_HELP_DISABLELINK", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '', 'other');
420 420
 	//print $form->selectyesno('MAIN_HELP_DISABLELINK', isset($conf->global->MAIN_HELP_DISABLELINK) ? $conf->global->MAIN_HELP_DISABLELINK : 0, 1);
421 421
 	print '</td>';
422 422
 	print '</tr>';
423 423
 
424 424
 	// Max size of lists
425
-	print '<tr class="oddeven"><td>' . $langs->trans("DefaultMaxSizeList") . '</td><td><input class="flat" name="MAIN_SIZE_LISTE_LIMIT" size="4" value="' . getDolGlobalString('MAIN_SIZE_LISTE_LIMIT') . '"></td>';
425
+	print '<tr class="oddeven"><td>'.$langs->trans("DefaultMaxSizeList").'</td><td><input class="flat" name="MAIN_SIZE_LISTE_LIMIT" size="4" value="'.getDolGlobalString('MAIN_SIZE_LISTE_LIMIT').'"></td>';
426 426
 	print '</tr>';
427 427
 
428 428
 	// Max size of short lists on customer card
429
-	print '<tr class="oddeven"><td>' . $langs->trans("DefaultMaxSizeShortList") . '</td><td><input class="flat" name="main_size_shortliste_limit" size="4" value="' . getDolGlobalString('MAIN_SIZE_SHORTLIST_LIMIT') . '"></td>';
429
+	print '<tr class="oddeven"><td>'.$langs->trans("DefaultMaxSizeShortList").'</td><td><input class="flat" name="main_size_shortliste_limit" size="4" value="'.getDolGlobalString('MAIN_SIZE_SHORTLIST_LIMIT').'"></td>';
430 430
 	print '</tr>';
431 431
 
432 432
 	// Max size of lists
433
-	print '<tr class="oddeven"><td>' . $langs->trans("MAIN_CHECKBOX_LEFT_COLUMN") . '</td><td>';
433
+	print '<tr class="oddeven"><td>'.$langs->trans("MAIN_CHECKBOX_LEFT_COLUMN").'</td><td>';
434 434
 	print ajax_constantonoff("MAIN_CHECKBOX_LEFT_COLUMN", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '', 'other');
435 435
 	print '</td>';
436 436
 	print '</tr>';
@@ -444,39 +444,39 @@  discard block
 block discarded – undo
444 444
 	 */
445 445
 
446 446
 	// First day for weeks
447
-	print '<tr class="oddeven"><td>' . $langs->trans("WeekStartOnDay") . '</td><td>';
447
+	print '<tr class="oddeven"><td>'.$langs->trans("WeekStartOnDay").'</td><td>';
448 448
 	print $formother->select_dayofweek((isset($conf->global->MAIN_START_WEEK) ? $conf->global->MAIN_START_WEEK : '1'), 'MAIN_START_WEEK', 0);
449 449
 	print '</td>';
450 450
 	print '</tr>';
451 451
 
452 452
 	// DefaultWorkingDays
453
-	print '<tr class="oddeven"><td>' . $langs->trans("DefaultWorkingDays") . '</td><td>';
454
-	print '<input type="text" name="MAIN_DEFAULT_WORKING_DAYS" size="5" value="' . (isset($conf->global->MAIN_DEFAULT_WORKING_DAYS) ? $conf->global->MAIN_DEFAULT_WORKING_DAYS : '1-5') . '">';
453
+	print '<tr class="oddeven"><td>'.$langs->trans("DefaultWorkingDays").'</td><td>';
454
+	print '<input type="text" name="MAIN_DEFAULT_WORKING_DAYS" size="5" value="'.(isset($conf->global->MAIN_DEFAULT_WORKING_DAYS) ? $conf->global->MAIN_DEFAULT_WORKING_DAYS : '1-5').'">';
455 455
 	print '</td>';
456 456
 	print '</tr>';
457 457
 
458 458
 	// DefaultWorkingHours
459
-	print '<tr class="oddeven"><td>' . $langs->trans("DefaultWorkingHours") . '</td><td>';
460
-	print '<input type="text" name="MAIN_DEFAULT_WORKING_HOURS" size="5" value="' . (isset($conf->global->MAIN_DEFAULT_WORKING_HOURS) ? $conf->global->MAIN_DEFAULT_WORKING_HOURS : '9-18') . '">';
459
+	print '<tr class="oddeven"><td>'.$langs->trans("DefaultWorkingHours").'</td><td>';
460
+	print '<input type="text" name="MAIN_DEFAULT_WORKING_HOURS" size="5" value="'.(isset($conf->global->MAIN_DEFAULT_WORKING_HOURS) ? $conf->global->MAIN_DEFAULT_WORKING_HOURS : '9-18').'">';
461 461
 	print '</td>';
462 462
 	print '</tr>';
463 463
 
464 464
 	// Firstname/Name
465
-	print '<tr class="oddeven"><td>' . $langs->trans("FirstnameNamePosition") . '</td><td>';
466
-	$array = array(0 => $langs->trans("Firstname") . ' ' . $langs->trans("Lastname"), 1 => $langs->trans("Lastname") . ' ' . $langs->trans("Firstname"));
465
+	print '<tr class="oddeven"><td>'.$langs->trans("FirstnameNamePosition").'</td><td>';
466
+	$array = array(0 => $langs->trans("Firstname").' '.$langs->trans("Lastname"), 1 => $langs->trans("Lastname").' '.$langs->trans("Firstname"));
467 467
 	print $form->selectarray('MAIN_FIRSTNAME_NAME_POSITION', $array, (isset($conf->global->MAIN_FIRSTNAME_NAME_POSITION) ? $conf->global->MAIN_FIRSTNAME_NAME_POSITION : 0));
468 468
 	print '</td>';
469 469
 	print '</tr>';
470 470
 
471 471
 	// Hide unauthorized menus
472
-	print '<tr class="oddeven"><td>' . $langs->trans("HideUnauthorizedMenu") . '</td><td>';
472
+	print '<tr class="oddeven"><td>'.$langs->trans("HideUnauthorizedMenu").'</td><td>';
473 473
 	//print $form->selectyesno('MAIN_MENU_HIDE_UNAUTHORIZED', isset($conf->global->MAIN_MENU_HIDE_UNAUTHORIZED) ? $conf->global->MAIN_MENU_HIDE_UNAUTHORIZED : 0, 1);
474 474
 	print ajax_constantonoff("MAIN_MENU_HIDE_UNAUTHORIZED", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '', 'other');
475 475
 	print '</td>';
476 476
 	print '</tr>';
477 477
 
478 478
 	// Hide unauthorized button
479
-	print '<tr class="oddeven"><td>' . $langs->trans("ButtonHideUnauthorized") . '</td><td>';
479
+	print '<tr class="oddeven"><td>'.$langs->trans("ButtonHideUnauthorized").'</td><td>';
480 480
 	//print $form->selectyesno('MAIN_BUTTON_HIDE_UNAUTHORIZED', isset($conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED) ? $conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED : 0, 1);
481 481
 	print ajax_constantonoff("MAIN_BUTTON_HIDE_UNAUTHORIZED", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '', 'other');
482 482
 	print '</td>';
@@ -495,17 +495,17 @@  discard block
 block discarded – undo
495 495
 	print '<tr class="oddeven"><td>';
496 496
 	print $form->textwithpicto($langs->trans("ShowBugTrackLink", $langs->transnoentitiesnoconv("FindBug")), $langs->trans("ShowBugTrackLinkDesc"));
497 497
 	print '</td><td>';
498
-	print '<input type="text" name="MAIN_BUGTRACK_ENABLELINK" value="' . (!getDolGlobalString('MAIN_BUGTRACK_ENABLELINK') ? '' : $conf->global->MAIN_BUGTRACK_ENABLELINK) . '">';
498
+	print '<input type="text" name="MAIN_BUGTRACK_ENABLELINK" value="'.(!getDolGlobalString('MAIN_BUGTRACK_ENABLELINK') ? '' : $conf->global->MAIN_BUGTRACK_ENABLELINK).'">';
499 499
 	print '</td>';
500 500
 	print '</tr>';
501 501
 
502 502
 	// Disable javascript and ajax
503
-	print '<tr class="oddeven"><td>' . $form->textwithpicto($langs->trans("DisableJavascript"), $langs->trans("DisableJavascriptNote")) . '</td><td>';
503
+	print '<tr class="oddeven"><td>'.$form->textwithpicto($langs->trans("DisableJavascript"), $langs->trans("DisableJavascriptNote")).'</td><td>';
504 504
 	print ajax_constantonoff("MAIN_DISABLE_JAVASCRIPT", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '', 'other');
505 505
 	print '</td>';
506 506
 	print '</tr>';
507 507
 
508
-	print '</table>' . "\n";
508
+	print '</table>'."\n";
509 509
 	print '</div>';
510 510
 }
511 511
 
@@ -525,9 +525,9 @@  discard block
 block discarded – undo
525 525
 	complete_substitutions_array($substitutionarray, $langs);
526 526
 
527 527
 	print '<tr class="oddeven width25p"><td>';
528
-	$texthelp = $langs->trans("FollowingConstantsWillBeSubstituted") . '<br>';
528
+	$texthelp = $langs->trans("FollowingConstantsWillBeSubstituted").'<br>';
529 529
 	foreach ($substitutionarray as $key => $val) {
530
-		$texthelp .= $key . '<br>';
530
+		$texthelp .= $key.'<br>';
531 531
 	}
532 532
 	print $form->textwithpicto($langs->trans("MessageOfDay"), $texthelp, 1, 'help', '', 0, 2, 'tooltipmessageofday');
533 533
 
@@ -536,7 +536,7 @@  discard block
 block discarded – undo
536 536
 	$doleditor = new DolEditor('main_motd', (isset($conf->global->MAIN_MOTD) ? $conf->global->MAIN_MOTD : ''), '', 142, 'dolibarr_notes', 'In', false, true, true, ROWS_4, '90%');
537 537
 	$doleditor->Create();
538 538
 
539
-	print '</td></tr>' . "\n";
539
+	print '</td></tr>'."\n";
540 540
 
541 541
 	/* no more need for this option. It is now a widget already controlled by end user
542 542
 	 print '<tr class="oddeven"><td>' . $langs->trans('BoxstatsDisableGlobal') . '</td><td>';
@@ -558,80 +558,80 @@  discard block
 block discarded – undo
558 558
 	print '</td><td class="titlefieldmiddle">';
559 559
 	print '</td></tr>';
560 560
 
561
-	print '<tr class="oddeven"><td>' . $langs->trans('DashboardDisableGlobal') . '</td><td>';
561
+	print '<tr class="oddeven"><td>'.$langs->trans('DashboardDisableGlobal').'</td><td>';
562 562
 	print ajax_constantonoff("MAIN_DISABLE_GLOBAL_WORKBOARD", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '_red', 'dashboard');
563 563
 	print '</td>';
564 564
 	print '</tr>';
565 565
 
566 566
 	if (!getDolGlobalString('MAIN_DISABLE_GLOBAL_WORKBOARD')) {
567 567
 		// Block meteo
568
-		print '<tr class="oddeven"><td>' . $langs->trans('MAIN_DISABLE_METEO') . '</td><td>';
568
+		print '<tr class="oddeven"><td>'.$langs->trans('MAIN_DISABLE_METEO').'</td><td>';
569 569
 		print ajax_constantonoff("MAIN_DISABLE_METEO", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '_red', 'dashboard');
570 570
 		print '</td>';
571 571
 		print '</tr>';
572 572
 
573 573
 		// Block agenda
574
-		print '<tr class="oddeven"><td>' . $langs->trans('DashboardDisableBlockAgenda') . '</td><td>';
574
+		print '<tr class="oddeven"><td>'.$langs->trans('DashboardDisableBlockAgenda').'</td><td>';
575 575
 		print ajax_constantonoff("MAIN_DISABLE_BLOCK_AGENDA", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '_red', 'dashboard');
576 576
 		print '</td>';
577 577
 		print '</tr>';
578 578
 
579 579
 		// Block agenda
580
-		print '<tr class="oddeven"><td>' . $langs->trans('DashboardDisableBlockProject') . '</td><td>';
580
+		print '<tr class="oddeven"><td>'.$langs->trans('DashboardDisableBlockProject').'</td><td>';
581 581
 		print ajax_constantonoff("MAIN_DISABLE_BLOCK_PROJECT", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '_red', 'dashboard');
582 582
 		print '</td>';
583 583
 		print '</tr>';
584 584
 
585 585
 		// Block customer
586
-		print '<tr class="oddeven"><td>' . $langs->trans('DashboardDisableBlockCustomer') . '</td><td>';
586
+		print '<tr class="oddeven"><td>'.$langs->trans('DashboardDisableBlockCustomer').'</td><td>';
587 587
 		print ajax_constantonoff("MAIN_DISABLE_BLOCK_CUSTOMER", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '_red', 'dashboard');
588 588
 		print '</td>';
589 589
 		print '</tr>';
590 590
 
591 591
 		// Block supplier
592
-		print '<tr class="oddeven"><td>' . $langs->trans('DashboardDisableBlockSupplier') . '</td><td>';
592
+		print '<tr class="oddeven"><td>'.$langs->trans('DashboardDisableBlockSupplier').'</td><td>';
593 593
 		print ajax_constantonoff("MAIN_DISABLE_BLOCK_SUPPLIER", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '_red', 'dashboard');
594 594
 		print '</td>';
595 595
 		print '</tr>';
596 596
 
597 597
 		// Block contract
598
-		print '<tr class="oddeven"><td>' . $langs->trans('DashboardDisableBlockContract') . '</td><td>';
598
+		print '<tr class="oddeven"><td>'.$langs->trans('DashboardDisableBlockContract').'</td><td>';
599 599
 		print ajax_constantonoff("MAIN_DISABLE_BLOCK_CONTRACT", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '_red', 'dashboard');
600 600
 		print '</td>';
601 601
 		print '</tr>';
602 602
 
603 603
 		// Block ticket
604
-		print '<tr class="oddeven"><td>' . $langs->trans('DashboardDisableBlockTicket') . '</td><td>';
604
+		print '<tr class="oddeven"><td>'.$langs->trans('DashboardDisableBlockTicket').'</td><td>';
605 605
 		print ajax_constantonoff("MAIN_DISABLE_BLOCK_TICKET", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '_red', 'dashboard');
606 606
 		print '</td>';
607 607
 		print '</tr>';
608 608
 
609 609
 		// Block bank
610
-		print '<tr class="oddeven"><td>' . $langs->trans('DashboardDisableBlockBank') . '</td><td>';
610
+		print '<tr class="oddeven"><td>'.$langs->trans('DashboardDisableBlockBank').'</td><td>';
611 611
 		print ajax_constantonoff("MAIN_DISABLE_BLOCK_BANK", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '_red', 'dashboard');
612 612
 		print '</td>';
613 613
 		print '</tr>';
614 614
 
615 615
 		// Block adherent
616
-		print '<tr class="oddeven"><td>' . $langs->trans('DashboardDisableBlockAdherent') . '</td><td>';
616
+		print '<tr class="oddeven"><td>'.$langs->trans('DashboardDisableBlockAdherent').'</td><td>';
617 617
 		print ajax_constantonoff("MAIN_DISABLE_BLOCK_ADHERENT", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '_red', 'dashboard');
618 618
 		print '</td>';
619 619
 		print '</tr>';
620 620
 
621 621
 		// Block expense report
622
-		print '<tr class="oddeven"><td>' . $langs->trans('DashboardDisableBlockExpenseReport') . '</td><td>';
622
+		print '<tr class="oddeven"><td>'.$langs->trans('DashboardDisableBlockExpenseReport').'</td><td>';
623 623
 		print ajax_constantonoff("MAIN_DISABLE_BLOCK_EXPENSEREPORT", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '_red', 'dashboard');
624 624
 		print '</td>';
625 625
 		print '</tr>';
626 626
 
627 627
 		// Block holiday
628
-		print '<tr class="oddeven"><td>' . $langs->trans('DashboardDisableBlockHoliday') . '</td><td>';
628
+		print '<tr class="oddeven"><td>'.$langs->trans('DashboardDisableBlockHoliday').'</td><td>';
629 629
 		print ajax_constantonoff("MAIN_DISABLE_BLOCK_HOLIDAY", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '_red', 'dashboard');
630 630
 		print '</td>';
631 631
 		print '</tr>';
632 632
 	}
633 633
 
634
-	print '</table>' . "\n";
634
+	print '</table>'."\n";
635 635
 	print '</div>';
636 636
 }
637 637
 
@@ -648,7 +648,7 @@  discard block
 block discarded – undo
648 648
 	print '</td></tr>';
649 649
 
650 650
 	// Hide helpcenter link on login page
651
-	print '<tr class="oddeven"><td>' . $langs->trans("DisableLinkToHelpCenter") . '</td><td>';
651
+	print '<tr class="oddeven"><td>'.$langs->trans("DisableLinkToHelpCenter").'</td><td>';
652 652
 	print ajax_constantonoff("MAIN_HELPCENTER_DISABLELINK", array(), $conf->entity, 0, 0, 0, 0, 0, 0, '', 'login');
653 653
 	print '</td>';
654 654
 	print '</tr>';
@@ -657,18 +657,18 @@  discard block
 block discarded – undo
657 657
 	$substitutionarray = getCommonSubstitutionArray($langs, 0, array('object', 'objectamount', 'user'));
658 658
 	complete_substitutions_array($substitutionarray, $langs);
659 659
 	print '<tr class="oddeven"><td>';
660
-	$texthelp = $langs->trans("FollowingConstantsWillBeSubstituted") . '<br>';
660
+	$texthelp = $langs->trans("FollowingConstantsWillBeSubstituted").'<br>';
661 661
 	foreach ($substitutionarray as $key => $val) {
662
-		$texthelp .= $key . '<br>';
662
+		$texthelp .= $key.'<br>';
663 663
 	}
664 664
 	print $form->textwithpicto($langs->trans("MessageLogin"), $texthelp, 1, 'help', '', 0, 2, 'tooltipmessagelogin');
665 665
 	print '</td><td>';
666 666
 	$doleditor = new DolEditor('main_home', (isset($conf->global->MAIN_HOME) ? $conf->global->MAIN_HOME : ''), '', 142, 'dolibarr_notes', 'In', false, true, true, ROWS_4, '90%');
667 667
 	$doleditor->Create();
668
-	print '</td></tr>' . "\n";
668
+	print '</td></tr>'."\n";
669 669
 
670 670
 	// Background
671
-	print '<tr class="oddeven"><td><label for="imagebackground">' . $langs->trans("BackgroundImageLogin") . ' (png,jpg)</label></td><td>';
671
+	print '<tr class="oddeven"><td><label for="imagebackground">'.$langs->trans("BackgroundImageLogin").' (png,jpg)</label></td><td>';
672 672
 	print '<div class="centpercent inline-block">';
673 673
 	$disabled = '';
674 674
 	if (getDolGlobalString('ADD_UNSPLASH_LOGIN_BACKGROUND')) {
@@ -677,25 +677,25 @@  discard block
 block discarded – undo
677 677
 	$maxfilesizearray = getMaxFileSizeArray();
678 678
 	$maxmin = $maxfilesizearray['maxmin'];
679 679
 	if ($maxmin > 0) {
680
-		print '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">';	// MAX_FILE_SIZE must precede the field type=file
680
+		print '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file
681 681
 	}
682
-	print '<input type="file" class="flat maxwidthinputfileonsmartphone" name="imagebackground" id="imagebackground"' . $disabled . '>';
682
+	print '<input type="file" class="flat maxwidthinputfileonsmartphone" name="imagebackground" id="imagebackground"'.$disabled.'>';
683 683
 	if ($disabled) {
684
-		print '(' . $langs->trans("DisabledByOptionADD_UNSPLASH_LOGIN_BACKGROUND") . ') ';
684
+		print '('.$langs->trans("DisabledByOptionADD_UNSPLASH_LOGIN_BACKGROUND").') ';
685 685
 	}
686 686
 	if (getDolGlobalString('MAIN_LOGIN_BACKGROUND')) {
687
-		print '<a class="reposition" href="' . $_SERVER["PHP_SELF"] . '?action=removebackgroundlogin&token='.newToken().'&mode=login">' . img_delete($langs->trans("Delete")) . '</a>';
688
-		if (file_exists($conf->mycompany->dir_output . '/logos/' . getDolGlobalString('MAIN_LOGIN_BACKGROUND'))) {
687
+		print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=removebackgroundlogin&token='.newToken().'&mode=login">'.img_delete($langs->trans("Delete")).'</a>';
688
+		if (file_exists($conf->mycompany->dir_output.'/logos/'.getDolGlobalString('MAIN_LOGIN_BACKGROUND'))) {
689 689
 			print ' &nbsp; ';
690
-			print '<img class="paddingleft valignmiddle" width="100" src="' . DOL_URL_ROOT . '/viewimage.php?modulepart=mycompany&amp;file=' . urlencode('logos/' . getDolGlobalString('MAIN_LOGIN_BACKGROUND')) . '">';
690
+			print '<img class="paddingleft valignmiddle" width="100" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&amp;file='.urlencode('logos/'.getDolGlobalString('MAIN_LOGIN_BACKGROUND')).'">';
691 691
 		}
692 692
 	} else {
693
-		print '<img class="paddingleft valignmiddle" width="100" src="' . DOL_URL_ROOT . '/public/theme/common/nophoto.png">';
693
+		print '<img class="paddingleft valignmiddle" width="100" src="'.DOL_URL_ROOT.'/public/theme/common/nophoto.png">';
694 694
 	}
695 695
 	print '</div>';
696 696
 	print '</td></tr>';
697 697
 
698
-	print '</table>' . "\n";
698
+	print '</table>'."\n";
699 699
 	print '</div>';
700 700
 }
701 701
 
@@ -719,8 +719,8 @@  discard block
 block discarded – undo
719 719
 
720 720
 
721 721
 print '<div class="center">';
722
-print '<input class="button button-save reposition buttonforacesave" type="submit" name="submit" value="' . $langs->trans("Save") . '">';
723
-print '<input class="button button-cancel reposition" type="submit" name="cancel" value="' . $langs->trans("Cancel") . '">';
722
+print '<input class="button button-save reposition buttonforacesave" type="submit" name="submit" value="'.$langs->trans("Save").'">';
723
+print '<input class="button button-cancel reposition" type="submit" name="cancel" value="'.$langs->trans("Cancel").'">';
724 724
 print '</div>';
725 725
 
726 726
 print '</form>';
Please login to merge, or discard this patch.