Pārlūkot izejas kodu

Scrutinizer Auto-Fixes

This commit consists of patches automatically generated for this project on https://scrutinizer-ci.com
Scrutinizer Auto-Fixer 3 gadi atpakaļ
vecāks
revīzija
5567310e44
72 mainītis faili ar 307 papildinājumiem un 291 dzēšanām
  1. 6 6
      htdocs/adherents/class/adherent_type.class.php
  2. 1 1
      htdocs/adherents/subscription/card.php
  3. 18 18
      htdocs/admin/agenda_other.php
  4. 1 1
      htdocs/admin/dolistore/class/dolistore.class.php
  5. 2 2
      htdocs/admin/prelevement.php
  6. 1 1
      htdocs/admin/taxes.php
  7. 1 1
      htdocs/admin/tools/export.php
  8. 2 2
      htdocs/admin/workstation.php
  9. 2 2
      htdocs/api/class/api_documents.class.php
  10. 2 2
      htdocs/asset/card.php
  11. 3 3
      htdocs/barcode/printsheet.php
  12. 2 3
      htdocs/categories/class/categorie.class.php
  13. 2 2
      htdocs/comm/action/pertype.php
  14. 1 1
      htdocs/compta/accounting-files.php
  15. 1 1
      htdocs/compta/bank/various_payment/card.php
  16. 6 6
      htdocs/compta/facture/class/facture-rec.class.php
  17. 5 2
      htdocs/compta/facture/class/facture.class.php
  18. 2 2
      htdocs/compta/prelevement/create.php
  19. 1 1
      htdocs/compta/sociales/class/paymentsocialcontribution.class.php
  20. 2 2
      htdocs/contrat/card.php
  21. 2 2
      htdocs/core/ajax/ajaxdirpreview.php
  22. 1 1
      htdocs/core/boxes/box_customers_outstanding_bill_reached.php
  23. 15 15
      htdocs/core/boxes/box_funnel_of_prospection.php
  24. 13 13
      htdocs/core/boxes/box_graph_nb_ticket_last_x_days.php
  25. 2 2
      htdocs/core/class/commoninvoice.class.php
  26. 7 3
      htdocs/core/class/defaultvalues.class.php
  27. 6 6
      htdocs/core/class/html.formfile.class.php
  28. 1 1
      htdocs/core/class/infobox.class.php
  29. 2 2
      htdocs/core/class/smtps.class.php
  30. 1 1
      htdocs/core/lib/date.lib.php
  31. 1 1
      htdocs/core/lib/import.lib.php
  32. 10 10
      htdocs/core/lib/memory.lib.php
  33. 3 3
      htdocs/core/lib/price.lib.php
  34. 1 1
      htdocs/core/lib/security.lib.php
  35. 1 1
      htdocs/core/lib/security2.lib.php
  36. 3 1
      htdocs/core/modules/commande/doc/pdf_einstein.modules.php
  37. 6 6
      htdocs/core/modules/modCategorie.class.php
  38. 1 1
      htdocs/core/modules/propale/doc/pdf_cyan.modules.php
  39. 1 1
      htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php
  40. 4 2
      htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php
  41. 1 1
      htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php
  42. 1 1
      htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php
  43. 1 1
      htdocs/core/modules/workstation/mod_workstation_advanced.php
  44. 1 1
      htdocs/core/photos_resize.php
  45. 10 10
      htdocs/core/tpl/extrafields_list_search_param.tpl.php
  46. 1 1
      htdocs/core/tpl/extrafields_view.tpl.php
  47. 8 8
      htdocs/core/tpl/massactions_pre.tpl.php
  48. 2 2
      htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php
  49. 2 2
      htdocs/ecm/index_auto.php
  50. 19 17
      htdocs/eventorganization/class/conferenceorbooth.class.php
  51. 1 1
      htdocs/exports/class/export.class.php
  52. 2 2
      htdocs/fourn/facture/paiement.php
  53. 1 1
      htdocs/index.php
  54. 1 1
      htdocs/install/upgrade2.php
  55. 1 1
      htdocs/mrp/mo_note.php
  56. 1 1
      htdocs/paypal/lib/paypal.lib.php
  57. 1 1
      htdocs/product/class/productcustomerprice.class.php
  58. 3 1
      htdocs/product/stock/productlot_document.php
  59. 1 1
      htdocs/product/stock/stockatdate.php
  60. 1 1
      htdocs/projet/element.php
  61. 2 2
      htdocs/projet/graph_opportunities.inc.php
  62. 2 2
      htdocs/projet/tasks/contact.php
  63. 41 41
      htdocs/societe/class/societe.class.php
  64. 1 1
      htdocs/societe/price.php
  65. 4 2
      htdocs/supplier_proposal/class/supplier_proposal.class.php
  66. 9 9
      htdocs/theme/eldy/manifest.json.php
  67. 1 1
      htdocs/theme/md/manifest.json.php
  68. 40 40
      htdocs/user/home.php
  69. 1 1
      htdocs/webservices/server_productorservice.php
  70. 2 2
      htdocs/workstation/class/workstationresource.class.php
  71. 2 2
      htdocs/workstation/class/workstationusergroup.class.php
  72. 1 1
      htdocs/workstation/lib/workstation.lib.php

+ 6 - 6
htdocs/adherents/class/adherent_type.class.php

@@ -250,12 +250,12 @@ class AdherentType extends CommonObject
 	}
 
 	   /**
-		* Delete a language for this member type
-		*
-		* @param string $langtodelete 	Language code to delete
-		* @param User   $user         	Object user making delete
-		* @return int                   <0 if KO, >0 if OK
-		*/
+	    * Delete a language for this member type
+	    *
+	    * @param string $langtodelete 	Language code to delete
+	    * @param User   $user         	Object user making delete
+	    * @return int                   <0 if KO, >0 if OK
+	    */
 	public function delMultiLangs($langtodelete, $user)
 	{
 		$sql = "DELETE FROM ".MAIN_DB_PREFIX."adherent_type_lang";

+ 1 - 1
htdocs/adherents/subscription/card.php

@@ -59,7 +59,7 @@ $permissiontoedit = $user->rights->adherent->cotisation->creer; // Used by the i
 $hookmanager->initHooks(array('subscriptioncard', 'globalcard'));
 
 // Security check
-$result = restrictedArea($user, 'subscription', 0);		// TODO Check on object id
+$result = restrictedArea($user, 'subscription', 0); // TODO Check on object id
 
 
 /*

+ 18 - 18
htdocs/admin/agenda_other.php

@@ -83,26 +83,26 @@ if ($action == 'set') {
 	dolibarr_set_const($db, 'AGENDA_DEFAULT_VIEW', GETPOST('AGENDA_DEFAULT_VIEW'), 'chaine', 0, '', $conf->entity);
 
 	$defaultValues = new DefaultValues($db);
-	$result = $defaultValues->fetchAll('', '', 0, 0, array('t.page'=>'comm/action/card.php', 't.param'=>'complete','t.user_id'=>'0', 't.type'=>'createform', 't.entity'=>$conf->entity));
-	if (!is_array($result) && $result<0) {
+	$result = $defaultValues->fetchAll('', '', 0, 0, array('t.page'=>'comm/action/card.php', 't.param'=>'complete', 't.user_id'=>'0', 't.type'=>'createform', 't.entity'=>$conf->entity));
+	if (!is_array($result) && $result < 0) {
 		setEventMessages($defaultValues->error, $defaultValues->errors, 'errors');
-	} elseif (count($result)>0) {
+	} elseif (count($result) > 0) {
 		foreach ($result as $defval) {
-			$defaultValues->id=$defval->id;
+			$defaultValues->id = $defval->id;
 			$resultDel = $defaultValues->delete($user);
-			if ($resultDel<0) {
+			if ($resultDel < 0) {
 				setEventMessages($defaultValues->error, $defaultValues->errors, 'errors');
 			}
 		}
 	}
-	$defaultValues->type='createform';
-	$defaultValues->entity=$conf->entity;
-	$defaultValues->user_id=0;
-	$defaultValues->page='comm/action/card.php';
-	$defaultValues->param='complete';
-	$defaultValues->value=GETPOST('AGENDA_EVENT_DEFAULT_STATUS');
-	$resultCreat=$defaultValues->create($user);
-	if ($resultCreat<0) {
+	$defaultValues->type = 'createform';
+	$defaultValues->entity = $conf->entity;
+	$defaultValues->user_id = 0;
+	$defaultValues->page = 'comm/action/card.php';
+	$defaultValues->param = 'complete';
+	$defaultValues->value = GETPOST('AGENDA_EVENT_DEFAULT_STATUS');
+	$resultCreat = $defaultValues->create($user);
+	if ($resultCreat < 0) {
 		setEventMessages($defaultValues->error, $defaultValues->errors, 'errors');
 	}
 } elseif ($action == 'specimen') {  // For orders
@@ -355,13 +355,13 @@ print '<tr class="oddeven">'."\n";
 print '<td>'.$langs->trans("AGENDA_EVENT_DEFAULT_STATUS").'</td>'."\n";
 print '<td class="center">&nbsp;</td>'."\n";
 print '<td class="right nowrap">'."\n";
-$defval='na';
+$defval = 'na';
 $defaultValues = new DefaultValues($db);
-$result = $defaultValues->fetchAll('', '', 0, 0, array('t.page'=>'comm/action/card.php', 't.param'=>'complete','t.user_id'=>'0', 't.type'=>'createform', 't.entity'=>$conf->entity));
-if (!is_array($result) && $result<0) {
+$result = $defaultValues->fetchAll('', '', 0, 0, array('t.page'=>'comm/action/card.php', 't.param'=>'complete', 't.user_id'=>'0', 't.type'=>'createform', 't.entity'=>$conf->entity));
+if (!is_array($result) && $result < 0) {
 	setEventMessages($defaultValues->error, $defaultValues->errors, 'errors');
-} elseif (count($result)>0) {
-	$defval=reset($result)->value;
+} elseif (count($result) > 0) {
+	$defval = reset($result)->value;
 }
 $formactions->form_select_status_action('agenda', $defval, 1, "AGENDA_EVENT_DEFAULT_STATUS", 0, 1, 'maxwidth200');
 print '</td></tr>'."\n";

+ 1 - 1
htdocs/admin/dolistore/class/dolistore.class.php

@@ -307,7 +307,7 @@ class Dolistore
 				}
 			} else {
 				//need update
-				$version    = '<span class="compatibleafterupdate">'.$langs->trans(
+				$version = '<span class="compatibleafterupdate">'.$langs->trans(
 					'CompatibleAfterUpdate',
 					DOL_VERSION,
 					$product->dolibarr_min,

+ 2 - 2
htdocs/admin/prelevement.php

@@ -102,11 +102,11 @@ if ($action == "set") {
 	}
 
 	$res = dolibarr_set_const($db, "PRELEVEMENT_ADDDAYS", GETPOST("PRELEVEMENT_ADDDAYS"), 'chaine', 0, '', $conf->entity);
-	if (! ($res > 0)) {
+	if (!($res > 0)) {
 		$error++;
 	}
 
-	if (! $error) {
+	if (!$error) {
 		$db->commit();
 		setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
 	} else {

+ 1 - 1
htdocs/admin/taxes.php

@@ -270,7 +270,7 @@ print '</form>';
 echo '<div>';
 echo '<table class="noborder centpercent">';
 echo '<thead>';
-echo '<tr class="liste_titre"><th>' . $langs->trans('Parameter') . '</th><th>' . $langs->trans('Value') . '</th></tr>';
+echo '<tr class="liste_titre"><th>'.$langs->trans('Parameter').'</th><th>'.$langs->trans('Value').'</th></tr>';
 echo '</thead>';
 echo '<tbody>';
 

+ 1 - 1
htdocs/admin/tools/export.php

@@ -90,7 +90,7 @@ $_SESSION["commandbackuptorun"] = '';
 $_SESSION["commandbackupresult"] = '';
 
 // Increase limit of time. Works only if we are not in safe mode
-$ExecTimeLimit = 600;	// Set it to 0 to not use a forced time limit
+$ExecTimeLimit = 600; // Set it to 0 to not use a forced time limit
 if (!empty($ExecTimeLimit)) {
 	$err = error_reporting();
 	error_reporting(0); // Disable all errors

+ 2 - 2
htdocs/admin/workstation.php

@@ -26,8 +26,8 @@
 require "../main.inc.php";
 
 // Libraries
-require_once DOL_DOCUMENT_ROOT . "/core/lib/admin.lib.php";
-require_once DOL_DOCUMENT_ROOT . '/workstation/lib/workstation.lib.php';
+require_once DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php";
+require_once DOL_DOCUMENT_ROOT.'/workstation/lib/workstation.lib.php';
 //require_once "../class/myclass.class.php";
 
 // Translations

+ 2 - 2
htdocs/api/class/api_documents.class.php

@@ -497,11 +497,11 @@ class Documents extends DolibarrApi
 			throw new RestException(404, 'Search for modulepart '.$modulepart.' with Id '.$object->id.(!empty($object->ref) ? ' or Ref '.$object->ref : '').' does not return any document.');
 		} else {
 			if (($object->id) > 0 && !empty($modulepart)) {
-				require_once DOL_DOCUMENT_ROOT . '/ecm/class/ecmfiles.class.php';
+				require_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmfiles.class.php';
 				$ecmfile = new EcmFiles($this->db);
 				$result = $ecmfile->fetchAll('', '', 0, 0, array('t.src_object_type' => $modulepart, 't.src_object_id' => $object->id));
 				if ($result < 0) {
-					throw new RestException(503, 'Error when retrieve ecm list : ' . $this->db->lasterror());
+					throw new RestException(503, 'Error when retrieve ecm list : '.$this->db->lasterror());
 				} elseif (is_array($ecmfile->lines) && count($ecmfile->lines) > 0) {
 					$filearray['ecmfiles_infos'] = $ecmfile->lines;
 				}

+ 2 - 2
htdocs/asset/card.php

@@ -316,8 +316,8 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
 		$filename = dol_sanitizeFileName($object->ref);
 		$filedir = $conf->contrat->dir_output."/".dol_sanitizeFileName($object->ref);
 		$urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id;
-		$genallowed = $user->rights->asset->read;	// If you can read, you can build the PDF to read content
-		$delallowed = $user->rights->asset->write;	// If you can create/edit, you can remove a file on card
+		$genallowed = $user->rights->asset->read; // If you can read, you can build the PDF to read content
+		$delallowed = $user->rights->asset->write; // If you can create/edit, you can remove a file on card
 
 		print $formfile->showdocuments('asset', $filename, $filedir, $urlsource, 0, $delallowed, $object->model_pdf, 1, 0, 0, 28, 0, '', '', '', $soc->default_lang);
 

+ 3 - 3
htdocs/barcode/printsheet.php

@@ -25,7 +25,7 @@
 
 if (!empty($_POST['mode']) && $_POST['mode'] === 'label') {	// Page is called to build a PDF and output, we must ne renew the token.
 	if (!defined('NOTOKENRENEWAL')) {
-		define('NOTOKENRENEWAL', '1');				// Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on)
+		define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on)
 	}
 }
 
@@ -277,10 +277,10 @@ dol_htmloutput_errors($mesg);
 //print img_picto('','puce').' '.$langs->trans("PrintsheetForOneBarCode").'<br>';
 //print '<br>';
 
-print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';		// The target is for brothers that open the file instead of downloading it
+print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">'; // The target is for brothers that open the file instead of downloading it
 print '<input type="hidden" name="mode" value="label">';
 print '<input type="hidden" name="action" value="builddoc">';
-print '<input type="hidden" name="token" value="'.currentToken().'">';	// The page will not renew the token but force download of a file, so we must use here currentToken
+print '<input type="hidden" name="token" value="'.currentToken().'">'; // The page will not renew the token but force download of a file, so we must use here currentToken
 
 print '<div class="tagtable">';
 

+ 2 - 3
htdocs/categories/class/categorie.class.php

@@ -244,7 +244,6 @@ class Categorie extends CommonObject
 	 * @see Categorie::TYPE_ACTIONCOMM
 	 * @see Categorie::TYPE_WEBSITE_PAGE
 	 * @see Categorie::TYPE_TICKET
-
 	 */
 	public $type;
 
@@ -385,8 +384,8 @@ class Categorie extends CommonObject
 			}
 		} else {
 			dol_print_error($this->db);
-			$this->error=$this->db->lasterror;
-			$this->errors[]=$this->db->lasterror;
+			$this->error = $this->db->lasterror;
+			$this->errors[] = $this->db->lasterror;
 			return -1;
 		}
 	}

+ 2 - 2
htdocs/comm/action/pertype.php

@@ -965,8 +965,8 @@ function show_day_events_pertype($username, $day, $month, $year, $monthshown, $s
 	// We are in a particular day for $username, now we scan all events
 	foreach ($eventarray as $daykey => $notused) {
 		$annee = dol_print_date($daykey, '%Y');
-		$mois =  dol_print_date($daykey, '%m');
-		$jour =  dol_print_date($daykey, '%d');
+		$mois = dol_print_date($daykey, '%m');
+		$jour = dol_print_date($daykey, '%d');
 
 		if ($day == $jour && $month == $mois && $year == $annee) {	// Is it the day we are looking for when calling function ?
 			// Scan all event for this date

+ 1 - 1
htdocs/compta/accounting-files.php

@@ -578,7 +578,7 @@ print '<br>';
 
 foreach ($listofchoices as $choice => $val) {
 	if (empty($val['enabled'])) {
-		continue;		// list not qualified
+		continue; // list not qualified
 	}
 	$disabled = '';
 	if (empty($val['perms'])) {

+ 1 - 1
htdocs/compta/bank/various_payment/card.php

@@ -540,7 +540,7 @@ if ($id) {
 			array('type' => 'date', 'name' => 'clone_date_value', 'label' => $langs->trans("DateValue"), 'value' => -1),
 			array('type' => 'other', 'tdclass'=>'fieldrequired', 'name' => 'clone_accountid', 'label' => $langs->trans("BankAccount"), 'value' => $form->select_comptes($object->fk_account, "accountid", 0, '', 1, '', 0, 'minwidth200', 1)),
 			array('type' => 'text', 'name' => 'clone_amount', 'label' => $langs->trans("Amount"), 'value' => price($object->amount)),
-			array('type' => 'select', 'name' => 'clone_sens', 'label' => $langs->trans("Sens") . ' ' . $set_value_help, 'values' => $sensarray, 'default' => $object->sens),
+			array('type' => 'select', 'name' => 'clone_sens', 'label' => $langs->trans("Sens").' '.$set_value_help, 'values' => $sensarray, 'default' => $object->sens),
 		);
 
 		print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneVariousPayment', $object->ref), 'confirm_clone', $formquestion, 'yes', 1, 350);

+ 6 - 6
htdocs/compta/facture/class/facture-rec.class.php

@@ -126,8 +126,8 @@ class FactureRec extends CommonInvoice
 
 	public $suspended; // status
 
-	public $auto_validate;			// 0 to create in draft, 1 to create and validate the new invoice
-	public $generate_pdf;			// 1 to generate PDF on invoice generation (default)
+	public $auto_validate; // 0 to create in draft, 1 to create and validate the new invoice
+	public $generate_pdf; // 1 to generate PDF on invoice generation (default)
 
 	/**
 	 * @var int 1 if status is draft
@@ -712,12 +712,12 @@ class FactureRec extends CommonInvoice
 				//$line->code_ventilation = $objp->fk_code_ventilation;
 
 				$line->fk_product_fournisseur_price = $objp->fk_product_fournisseur_price;
-				$line->fk_fournprice = $objp->fk_product_fournisseur_price;	// For backward compatibility
+				$line->fk_fournprice = $objp->fk_product_fournisseur_price; // For backward compatibility
 
 				$marginInfos = getMarginInfos($objp->subprice, $objp->remise_percent, $objp->tva_tx, $objp->localtax1_tx, $objp->localtax2_tx, $objp->fk_product_fournisseur_price, $objp->pa_ht);
 
 				$line->buyprice = $marginInfos[0];
-				$line->pa_ht = $marginInfos[0];			// For backward compatibility
+				$line->pa_ht = $marginInfos[0]; // For backward compatibility
 				$line->marge_tx			= $marginInfos[1];
 				$line->marque_tx		= $marginInfos[2];
 				$line->rang = $objp->rang;
@@ -1930,14 +1930,14 @@ class FactureLigneRec extends CommonInvoiceLine
 
 
 	public $fk_product_fournisseur_price;
-	public $fk_fournprice;					// For backward compatibility
+	public $fk_fournprice; // For backward compatibility
 
 	public $rang;
 
 	public $desc;
 	public $description;
 
-	public $fk_product_type;	// Use instead product_type
+	public $fk_product_type; // Use instead product_type
 
 	public $fk_contract_line;
 

+ 5 - 2
htdocs/compta/facture/class/facture.class.php

@@ -1560,8 +1560,11 @@ class Facture extends CommonInvoice
 		$hookmanager->initHooks(array('invoicedao'));
 		$parameters = array('id'=>$this->id, 'getnomurl'=>$result, 'notooltip' => $notooltip, 'addlinktonotes' => $addlinktonotes, 'save_lastsearch_value'=> $save_lastsearch_value, 'target' => $target);
 		$reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
-		if ($reshook > 0) $result = $hookmanager->resPrint;
-		else $result .= $hookmanager->resPrint;
+		if ($reshook > 0) {
+			$result = $hookmanager->resPrint;
+		} else {
+			$result .= $hookmanager->resPrint;
+		}
 
 		return $result;
 	}

+ 2 - 2
htdocs/compta/prelevement/create.php

@@ -90,10 +90,10 @@ if (empty($reshook)) {
 		}
 	}
 	if ($action == 'create') {
-		$default_account=($type == 'bank-transfer' ? 'PAYMENTBYBANKTRANSFER_ID_BANKACCOUNT' : 'PRELEVEMENT_ID_BANKACCOUNT');
+		$default_account = ($type == 'bank-transfer' ? 'PAYMENTBYBANKTRANSFER_ID_BANKACCOUNT' : 'PRELEVEMENT_ID_BANKACCOUNT');
 
 		if ($id_bankaccount != $conf->global->{$default_account}) {
-			$res = dolibarr_set_const($db, $default_account, $id_bankaccount, 'chaine', 0, '', $conf->entity);	//Set as default
+			$res = dolibarr_set_const($db, $default_account, $id_bankaccount, 'chaine', 0, '', $conf->entity); //Set as default
 		}
 
 		require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';

+ 1 - 1
htdocs/compta/sociales/class/paymentsocialcontribution.class.php

@@ -600,7 +600,7 @@ class PaymentSocialContribution extends CommonObject
 							$result = $acc->add_url_line(
 								$bank_line_id,
 								$socialcontrib->fk_user,
-								DOL_URL_ROOT . '/user/card.php?id=',
+								DOL_URL_ROOT.'/user/card.php?id=',
 								$fuser->getFullName($langs),
 								'user'
 							);

+ 2 - 2
htdocs/contrat/card.php

@@ -505,8 +505,8 @@ if (empty($reshook)) {
 				$desc = $prod->description;
 
 				//If text set in desc is the same as product descpription (as now it's preloaded) whe add it only one time
-				if ($product_desc==$desc && !empty($conf->global->PRODUIT_AUTOFILL_DESC)) {
-					$product_desc='';
+				if ($product_desc == $desc && !empty($conf->global->PRODUIT_AUTOFILL_DESC)) {
+					$product_desc = '';
 				}
 
 				if (!empty($product_desc) && !empty($conf->global->MAIN_NO_CONCAT_DESCRIPTION)) {

+ 2 - 2
htdocs/core/ajax/ajaxdirpreview.php

@@ -218,8 +218,8 @@ if ($type == 'directory') {
 
 	$parameters = array('modulepart'=>$module);
 	$reshook = $hookmanager->executeHooks('addSectionECMAuto', $parameters);
-	if ($reshook > 0 && is_array($hookmanager->resArray) && count($hookmanager->resArray)>0) {
-		$automodules[]=$hookmanager->resArray['module'];
+	if ($reshook > 0 && is_array($hookmanager->resArray) && count($hookmanager->resArray) > 0) {
+		$automodules[] = $hookmanager->resArray['module'];
 	}
 
 	// TODO change for multicompany sharing

+ 1 - 1
htdocs/core/boxes/box_customers_outstanding_bill_reached.php

@@ -35,7 +35,7 @@ class box_customers_outstanding_bill_reached extends ModeleBoxes
 	public $boxcode = "customersoutstandingbillreached";
 	public $boximg = "object_company";
 	public $boxlabel = "BoxCustomersOutstandingBillReached";
-	public $depends = array("facture","societe");
+	public $depends = array("facture", "societe");
 
 	/**
 	 * @var DoliDB Database handler.

+ 15 - 15
htdocs/core/boxes/box_funnel_of_prospection.php

@@ -24,7 +24,7 @@
  *  \ingroup    projet
  *  \brief      Module to show the funnel of prospection
  */
-include_once DOL_DOCUMENT_ROOT . "/core/boxes/modules_boxes.php";
+include_once DOL_DOCUMENT_ROOT."/core/boxes/modules_boxes.php";
 
 /**
  * Class to manage the box to show last projet
@@ -91,8 +91,8 @@ class box_funnel_of_prospection extends ModeleBoxes
 		$badgeStatus7 = '#baa32b';
 		$badgeStatus8 = '#993013';
 		$badgeStatus9 = '#e7f0f0';
-		if (file_exists(DOL_DOCUMENT_ROOT . '/theme/' . $conf->theme . '/theme_vars.inc.php')) {
-			include DOL_DOCUMENT_ROOT . '/theme/' . $conf->theme . '/theme_vars.inc.php';
+		if (file_exists(DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/theme_vars.inc.php')) {
+			include DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/theme_vars.inc.php';
 		}
 		$listofoppstatus = array();
 		$listofopplabel = array();
@@ -100,7 +100,7 @@ class box_funnel_of_prospection extends ModeleBoxes
 		$colorseriesstat = array();
 		$bordercolorseries = array();
 		$sql = "SELECT cls.rowid, cls.code, cls.percent, cls.label";
-		$sql .= " FROM " . MAIN_DB_PREFIX . "c_lead_status as cls";
+		$sql .= " FROM ".MAIN_DB_PREFIX."c_lead_status as cls";
 		$sql .= " WHERE active=1";
 		$sql .= " AND cls.code <> 'LOST'";
 		$sql .= $this->db->order('cls.rowid', 'ASC');
@@ -148,14 +148,14 @@ class box_funnel_of_prospection extends ModeleBoxes
 		$this->max = $max;
 
 		$this->info_box_head = array(
-			'text' => $langs->trans("Statistics") . ' - ' . $langs->trans("BoxTitleFunnelOfProspection"),
+			'text' => $langs->trans("Statistics").' - '.$langs->trans("BoxTitleFunnelOfProspection"),
 			'graph' => '1'
 		);
 
 		if ($user->rights->projet->lire || !empty($conf->global->PROJECT_USE_OPPORTUNITIES)) {
 			$sql = "SELECT p.fk_opp_status as opp_status, cls.code, COUNT(p.rowid) as nb, SUM(p.opp_amount) as opp_amount, SUM(p.opp_amount * p.opp_percent) as ponderated_opp_amount";
-			$sql .= " FROM " . MAIN_DB_PREFIX . "projet as p, " . MAIN_DB_PREFIX . "c_lead_status as cls";
-			$sql .= " WHERE p.entity IN (" . getEntity('project') . ")";
+			$sql .= " FROM ".MAIN_DB_PREFIX."projet as p, ".MAIN_DB_PREFIX."c_lead_status as cls";
+			$sql .= " WHERE p.entity IN (".getEntity('project').")";
 			$sql .= " AND p.fk_opp_status = cls.rowid";
 			$sql .= " AND p.fk_statut = 1"; // Opend projects only
 			$sql .= " AND cls.code NOT IN ('LOST')";
@@ -200,14 +200,14 @@ class box_funnel_of_prospection extends ModeleBoxes
 				$liststatus = array();
 				$data = array('');
 				$customlabels = array();
-				$total=0;
+				$total = 0;
 				foreach ($listofstatus as $status) {
 					$customlabel = '';
 					$labelStatus = '';
 					if ($status != 7) {
 						$code = dol_getIdFromCode($this->db, $status, 'c_lead_status', 'rowid', 'code');
 						if ($code) {
-							$labelStatus = $langs->transnoentitiesnoconv("OppStatus" . $code);
+							$labelStatus = $langs->transnoentitiesnoconv("OppStatus".$code);
 						}
 						if (empty($labelStatus)) {
 							$labelStatus = $listofopplabel[$status];
@@ -218,16 +218,16 @@ class box_funnel_of_prospection extends ModeleBoxes
 						$liststatus[] = $labelStatus;
 						if (!$conf->use_javascript_ajax) {
 							$stringtoprint .= '<tr class="oddeven">';
-							$stringtoprint .= '<td>' . $labelStatus . '</td>';
-							$stringtoprint .= '<td class="right"><a href="list.php?statut=' . $status . '">' . price((isset($valsamount[$status]) ? (float) $valsamount[$status] : 0), 0, '', 1, -1, -1, $conf->currency) . '</a></td>';
+							$stringtoprint .= '<td>'.$labelStatus.'</td>';
+							$stringtoprint .= '<td class="right"><a href="list.php?statut='.$status.'">'.price((isset($valsamount[$status]) ? (float) $valsamount[$status] : 0), 0, '', 1, -1, -1, $conf->currency).'</a></td>';
 							$stringtoprint .= "</tr>\n";
 						}
 					}
-					$customlabels[]=$customlabel;
+					$customlabels[] = $customlabel;
 				}
 				$dataseries[] = $data;
 				if ($conf->use_javascript_ajax) {
-					include_once DOL_DOCUMENT_ROOT . '/core/class/dolgraph.class.php';
+					include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
 					$dolgraph = new DolGraph();
 					$dolgraph->SetMinValue(0);
 					$dolgraph->SetData($dataseries);
@@ -273,7 +273,7 @@ class box_funnel_of_prospection extends ModeleBoxes
 					'tr' => 'class="oddeven"',
 					'td' => 'class="left "',
 					'maxlength' => 500,
-					'text' => $langs->trans("OpportunityTotalAmount") . ' (' . $langs->trans("WonLostExcluded") . ')'
+					'text' => $langs->trans("OpportunityTotalAmount").' ('.$langs->trans("WonLostExcluded").')'
 				);
 				$this->info_box_contents[$line][] = array(
 					'tr' => 'class="oddeven"',
@@ -286,7 +286,7 @@ class box_funnel_of_prospection extends ModeleBoxes
 					'tr' => 'class="oddeven"',
 					'td' => 'class="left "',
 					'maxlength' => 500,
-					'text' => $form->textwithpicto($langs->trans("OpportunityPonderatedAmount") . ' (' . $langs->trans("WonLostExcluded") . ')', $langs->trans("OpportunityPonderatedAmountDesc"), 1)
+					'text' => $form->textwithpicto($langs->trans("OpportunityPonderatedAmount").' ('.$langs->trans("WonLostExcluded").')', $langs->trans("OpportunityPonderatedAmountDesc"), 1)
 
 				);
 				$this->info_box_contents[$line][] = array(

+ 13 - 13
htdocs/core/boxes/box_graph_nb_ticket_last_x_days.php

@@ -80,8 +80,8 @@ class box_graph_nb_ticket_last_x_days extends ModeleBoxes
 		$badgeStatus7 = '#baa32b';
 		$badgeStatus8 = '#993013';
 		$badgeStatus9 = '#e7f0f0';
-		if (file_exists(DOL_DOCUMENT_ROOT . '/theme/' . $conf->theme . '/theme_vars.inc.php')) {
-			include DOL_DOCUMENT_ROOT . '/theme/' . $conf->theme . '/theme_vars.inc.php';
+		if (file_exists(DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/theme_vars.inc.php')) {
+			include DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/theme_vars.inc.php';
 		}
 		$this->max = $max;
 
@@ -97,22 +97,22 @@ class box_graph_nb_ticket_last_x_days extends ModeleBoxes
 			$days = 7;
 		}
 		require_once DOL_DOCUMENT_ROOT."/ticket/class/ticket.class.php";
-		$text = $langs->trans("BoxTicketLastXDays", $days).'&nbsp;' . img_picto('', 'filter.png', 'id="idsubimgDOLUSERCOOKIE_ticket_last_days" class="linkobject"');
+		$text = $langs->trans("BoxTicketLastXDays", $days).'&nbsp;'.img_picto('', 'filter.png', 'id="idsubimgDOLUSERCOOKIE_ticket_last_days" class="linkobject"');
 		$this->info_box_head = array(
 			'text' => $text,
 			'limit' => dol_strlen($text)
 		);
 		$today = date_time_set(date_create(), 0, 0);
 		$todayformat = date('Y-m-d', date_timestamp_get($today));
-		$intervaltosub = new DateInterval('P' . dol_escape_htmltag($days - 1) . 'D');
+		$intervaltosub = new DateInterval('P'.dol_escape_htmltag($days - 1).'D');
 		$intervaltoadd = new DateInterval('P1D');
 		$minimumdatec = date_sub($today, $intervaltosub);
 		$minimumdatecformated = date('Y-m-d', date_timestamp_get($minimumdatec));
 
 		if ($user->rights->ticket->read) {
 			$sql = "SELECT CAST(t.datec AS DATE) as datec, COUNT(t.datec) as nb";
-			$sql .= " FROM " . MAIN_DB_PREFIX . "ticket as t";
-			$sql .= " WHERE CAST(t.datec AS DATE) > DATE_SUB(CURRENT_DATE, INTERVAL " . $days . " DAY)";
+			$sql .= " FROM ".MAIN_DB_PREFIX."ticket as t";
+			$sql .= " WHERE CAST(t.datec AS DATE) > DATE_SUB(CURRENT_DATE, INTERVAL ".$days." DAY)";
 			$sql .= " GROUP BY CAST(t.datec AS DATE)";
 			$resql = $this->db->query($sql);
 			if ($resql) {
@@ -148,12 +148,12 @@ class box_graph_nb_ticket_last_x_days extends ModeleBoxes
 				});
 				</script>';
 			$stringtoshow .= '<div class="center hideobject" id="idfilterDOLUSERCOOKIE_ticket_last_days">'; // hideobject is to start hidden
-			$stringtoshow .= '<form class="flat formboxfilter" method="POST" action="' . $_SERVER["PHP_SELF"] . '">';
-			$stringtoshow .= '<input type="hidden" name="token" value="' . newToken() . '">';
+			$stringtoshow .= '<form class="flat formboxfilter" method="POST" action="'.$_SERVER["PHP_SELF"].'">';
+			$stringtoshow .= '<input type="hidden" name="token" value="'.newToken().'">';
 			$stringtoshow .= '<input type="hidden" name="action" value="refresh">';
 			$stringtoshow .= '<input type="hidden" name="DOL_AUTOSET_COOKIE" value="DOLUSERCOOKIE_ticket_last_days:days">';
-			$stringtoshow .= ' <input class="flat" size="4" type="text" name="' . $param_day . '" value="' . $days . '">' . $langs->trans("Days");
-			$stringtoshow .= '<input type="image" alt="' . $langs->trans("Refresh") . '" src="' . img_picto($langs->trans("Refresh"), 'refresh.png', '', '', 1) . '">';
+			$stringtoshow .= ' <input class="flat" size="4" type="text" name="'.$param_day.'" value="'.$days.'">'.$langs->trans("Days");
+			$stringtoshow .= '<input type="image" alt="'.$langs->trans("Refresh").'" src="'.img_picto($langs->trans("Refresh"), 'refresh.png', '', '', 1).'">';
 			$stringtoshow .= '</form>';
 			$stringtoshow .= '</div>';
 
@@ -181,21 +181,21 @@ class box_graph_nb_ticket_last_x_days extends ModeleBoxes
 				$px1->mode = 'depth';
 
 				$px1->draw('idgraphticketlastxdays');
-				$graphtoshow= $px1->show($totalnb ? 0 : 1);
+				$graphtoshow = $px1->show($totalnb ? 0 : 1);
 			}
 			if ($totalnb) {
 				$stringtoshow .= $graphtoshow;
 			}
 			$stringtoshow .= '</div>';
 			if ($totalnb) {
-				$this->info_box_contents[][]=array(
+				$this->info_box_contents[][] = array(
 					'td' => 'center',
 					'text' => $stringtoshow
 				);
 			} else {
 				$this->info_box_contents[0][0] = array(
 					'td' => 'class="center opacitymedium"',
-					'text' => $stringtoshow . $langs->trans("BoxNoTicketLastXDays", $days)
+					'text' => $stringtoshow.$langs->trans("BoxNoTicketLastXDays", $days)
 				);
 			}
 		} else {

+ 2 - 2
htdocs/core/class/commoninvoice.class.php

@@ -970,8 +970,8 @@ abstract class CommonInvoiceLine extends CommonObjectLine
 	public $date_end_fill; // If set to 1, when invoice is created from a template invoice, it will also auto set the field date_end at creation
 
 	public $buy_price_ht;
-	public $buyprice;		// For backward compatibility
-	public $pa_ht;			// For backward compatibility
+	public $buyprice; // For backward compatibility
+	public $pa_ht; // For backward compatibility
 
 	public $marge_tx;
 	public $marque_tx;

+ 7 - 3
htdocs/core/class/defaultvalues.class.php

@@ -88,7 +88,7 @@ class DefaultValues extends CommonObject
 	/**
 	 * @var array  Array with all fields and their property. Do not use it as a static var. It may be modified by constructor.
 	 */
-	public $fields=array(
+	public $fields = array(
 		'rowid' =>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>10),
 		'entity' =>array('type'=>'integer', 'label'=>'Entity', 'default'=>1, 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>15, 'index'=>1),
 		'type' =>array('type'=>'varchar(10)', 'label'=>'Type', 'enabled'=>1, 'visible'=>-1, 'position'=>20),
@@ -145,8 +145,12 @@ class DefaultValues extends CommonObject
 
 		$this->db = $db;
 
-		if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && isset($this->fields['rowid'])) $this->fields['rowid']['visible'] = 0;
-		if (empty($conf->multicompany->enabled) && isset($this->fields['entity'])) $this->fields['entity']['enabled'] = 0;
+		if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && isset($this->fields['rowid'])) {
+			$this->fields['rowid']['visible'] = 0;
+		}
+		if (empty($conf->multicompany->enabled) && isset($this->fields['entity'])) {
+			$this->fields['entity']['enabled'] = 0;
+		}
 
 		// Unset fields that are disabled
 		foreach ($this->fields as $key => $val) {

+ 6 - 6
htdocs/core/class/html.formfile.class.php

@@ -500,7 +500,7 @@ class FormFile
 			$modellist = array();
 
 			if ($modulepart == 'company') {
-				$showempty = 1;		// can have no template active
+				$showempty = 1; // can have no template active
 				if (is_array($genallowed)) {
 					$modellist = $genallowed;
 				} else {
@@ -564,7 +564,7 @@ class FormFile
 					$modellist = ModelePDFFactures::liste_modeles($this->db);
 				}
 			} elseif ($modulepart == 'contract') {
-				$showempty = 1;		// can have no template active
+				$showempty = 1; // can have no template active
 				if (is_array($genallowed)) {
 					$modellist = $genallowed;
 				} else {
@@ -628,7 +628,7 @@ class FormFile
 					$modellist = ModelePDFSuppliersOrders::liste_modeles($this->db);
 				}
 			} elseif ($modulepart == 'facture_fournisseur' || $modulepart == 'supplier_invoice') {
-				$showempty = 1; 	// can have no template active
+				$showempty = 1; // can have no template active
 				if (is_array($genallowed)) {
 					$modellist = $genallowed;
 				} else {
@@ -1708,7 +1708,7 @@ class FormFile
 		} else {
 			$parameters = array('modulepart'=>$modulepart);
 			$reshook = $hookmanager->executeHooks('addSectionECMAuto', $parameters);
-			if ($reshook > 0 && is_array($hookmanager->resArray) && count($hookmanager->resArray)>0) {
+			if ($reshook > 0 && is_array($hookmanager->resArray) && count($hookmanager->resArray) > 0) {
 				if (array_key_exists('classpath', $hookmanager->resArray) && !empty($hookmanager->resArray['classpath'])) {
 					dol_include_once($hookmanager->resArray['classpath']);
 					if (array_key_exists('classname', $hookmanager->resArray) && !empty($hookmanager->resArray['classname'])) {
@@ -1789,9 +1789,9 @@ class FormFile
 					preg_match('/(.*)\/[^\/]+$/', $relativefile, $reg);
 					$ref = (isset($reg[1]) ? $reg[1] : '');
 				} else {
-					$parameters = array('modulepart'=>$modulepart,'fileinfo'=>$file);
+					$parameters = array('modulepart'=>$modulepart, 'fileinfo'=>$file);
 					$reshook = $hookmanager->executeHooks('addSectionECMAuto', $parameters);
-					if ($reshook > 0 && is_array($hookmanager->resArray) && count($hookmanager->resArray)>0) {
+					if ($reshook > 0 && is_array($hookmanager->resArray) && count($hookmanager->resArray) > 0) {
 						if (array_key_exists('ref', $hookmanager->resArray) && !empty($hookmanager->resArray['ref'])) {
 							$ref = $hookmanager->resArray['ref'];
 						}

+ 1 - 1
htdocs/core/class/infobox.class.php

@@ -151,7 +151,7 @@ class InfoBox
 						$box->rowid = (empty($obj->rowid) ? '' : $obj->rowid);
 						$box->id = (empty($obj->box_id) ? '' : $obj->box_id);
 						$box->position = ((isset($obj->position) && $obj->position == '') ? '' : (isset($obj->position) ? $obj->position : '')); // '0' must stay '0'
-						$box->box_order	= (empty($obj->box_order) ? '' : $obj->box_order);
+						$box->box_order = (empty($obj->box_order) ? '' : $obj->box_order);
 						$box->fk_user = (empty($obj->fk_user) ? 0 : $obj->fk_user);
 						$box->sourcefile = $relsourcefile;
 						$box->class = $boxname;

+ 2 - 2
htdocs/core/class/smtps.class.php

@@ -1422,7 +1422,7 @@ class SMTPs
 		$this->_msgContent[$strType]['dataText'] = $strContentAltText;
 
 		if ($this->getMD5flag()) {
-			$this->_msgContent[$strType]['md5']      = dol_hash($strContent, 3);
+			$this->_msgContent[$strType]['md5'] = dol_hash($strContent, 3);
 		}
 		//}
 	}
@@ -1622,7 +1622,7 @@ class SMTPs
 			$this->_msgContent['image'][$strImageName]['data']     = $strContent;
 
 			if ($this->getMD5flag()) {
-				$this->_msgContent['image'][$strImageName]['md5']      = dol_hash($strContent, 3);
+				$this->_msgContent['image'][$strImageName]['md5'] = dol_hash($strContent, 3);
 			}
 		}
 	}

+ 1 - 1
htdocs/core/lib/date.lib.php

@@ -681,7 +681,7 @@ function dol_get_first_day_week($day, $month, $year, $gm = false)
 function getGMTEasterDatetime($year)
 {
 	$base = new DateTime("$year-03-21", new DateTimeZone("UTC"));
-	$days = easter_days($year);	// Return number of days between 21 march and easter day.
+	$days = easter_days($year); // Return number of days between 21 march and easter day.
 	$tmp = $base->add(new DateInterval("P{$days}D"));
 	return $tmp->getTimestamp();
 }

+ 1 - 1
htdocs/core/lib/import.lib.php

@@ -48,7 +48,7 @@ function import_prepare_head($param, $maxstep = 0)
 		if ($i < 6) {
 			$head[$h][0] = DOL_URL_ROOT.'/imports/import.php?step='.$i.$param;
 		} else {
-			$head[$h][0] = DOL_URL_ROOT.'/imports/import.php?step=5'.$param;	// For step6, link is to step 5
+			$head[$h][0] = DOL_URL_ROOT.'/imports/import.php?step=5'.$param; // For step6, link is to step 5
 		}
 		$head[$h][1] = $langs->trans("Step")." ".$i;
 		$head[$h][2] = 'step'.$i;

+ 10 - 10
htdocs/core/lib/memory.lib.php

@@ -76,7 +76,7 @@ function dol_setcache($memoryid, $data, $expire = 0)
 		}
 	}
 
-	if (!empty($conf->memcached->enabled) &&  class_exists('Memcached')) {
+	if (!empty($conf->memcached->enabled) && class_exists('Memcached')) {
 		// Using a memcached server
 		global $dolmemcache;
 		if (empty($dolmemcache) || !is_object($dolmemcache)) {
@@ -88,7 +88,7 @@ function dol_setcache($memoryid, $data, $expire = 0)
 			}
 		}
 
-		$memoryid = session_name() . '_' . $memoryid;
+		$memoryid = session_name().'_'.$memoryid;
 		//$dolmemcache->setOption(Memcached::OPT_COMPRESSION, false);
 		$dolmemcache->add($memoryid, $data, $expire); // This fails if key already exists
 		$rescode = $dolmemcache->getResultCode();
@@ -109,7 +109,7 @@ function dol_setcache($memoryid, $data, $expire = 0)
 			}
 		}
 
-		$memoryid = session_name() . '_' . $memoryid;
+		$memoryid = session_name().'_'.$memoryid;
 		//$dolmemcache->setOption(Memcached::OPT_COMPRESSION, false);
 		$result = $dolmemcache->add($memoryid, $data, false, $expire); // This fails if key already exists
 		if ($result) {
@@ -154,7 +154,7 @@ function dol_getcache($memoryid)
 			}
 		}
 
-		$memoryid = session_name() . '_' . $memoryid;
+		$memoryid = session_name().'_'.$memoryid;
 		//$m->setOption(Memcached::OPT_COMPRESSION, false);
 		//print "Get memoryid=".$memoryid;
 		$data = $m->get($memoryid);
@@ -179,7 +179,7 @@ function dol_getcache($memoryid)
 			}
 		}
 
-		$memoryid = session_name() . '_' . $memoryid;
+		$memoryid = session_name().'_'.$memoryid;
 		//$m->setOption(Memcached::OPT_COMPRESSION, false);
 		$data = $m->get($memoryid);
 		//print "memoryid=".$memoryid." - rescode=".$rescode." - data=".count($data)."\n<br>";
@@ -187,7 +187,7 @@ function dol_getcache($memoryid)
 		if ($data) {
 			return $data;
 		} else {
-			return null;		// There is no way to make a difference between NOTFOUND and error when using Memcache. So do not use it, use Memcached instead.
+			return null; // There is no way to make a difference between NOTFOUND and error when using Memcache. So do not use it, use Memcached instead.
 		}
 	} elseif (isset($conf->global->MAIN_OPTIMIZE_SPEED) && ($conf->global->MAIN_OPTIMIZE_SPEED & 0x02)) {	// This is a really not reliable cache ! Use Memcached instead.
 		// Using shmop
@@ -252,7 +252,7 @@ function dol_setshmop($memoryid, $data, $expire)
 	}
 	$shmkey = dol_getshmopaddress($memoryid);
 	if (empty($shmkey)) {
-		return 0;	// No key reserved for this memoryid, we can't cache this memoryid
+		return 0; // No key reserved for this memoryid, we can't cache this memoryid
 	}
 
 	$newdata = serialize($data);
@@ -268,7 +268,7 @@ function dol_setshmop($memoryid, $data, $expire)
 		shmop_close($handle);
 		return ($shm_bytes_written1 + $shm_bytes_written2);
 	} else {
-		print 'Error in shmop_open for memoryid=' . $memoryid . ' shmkey=' . $shmkey . ' 6+size=6+' . $size;
+		print 'Error in shmop_open for memoryid='.$memoryid.' shmkey='.$shmkey.' 6+size=6+'.$size;
 		return -1;
 	}
 }
@@ -290,7 +290,7 @@ function dol_getshmop($memoryid)
 	}
 	$shmkey = dol_getshmopaddress($memoryid);
 	if (empty($shmkey)) {
-		return null;		// No key reserved for this memoryid, we can't cache this memoryid
+		return null; // No key reserved for this memoryid, we can't cache this memoryid
 	}
 
 	//print 'dol_getshmop memoryid='.$memoryid." shmkey=".$shmkey."<br>\n";
@@ -304,7 +304,7 @@ function dol_getshmop($memoryid)
 		}
 		shmop_close($handle);
 	} else {
-		return null;	// Can't open existing block, so we suppose it was not created, so nothing were cached yet for the memoryid
+		return null; // Can't open existing block, so we suppose it was not created, so nothing were cached yet for the memoryid
 	}
 	return $data;
 }

+ 3 - 3
htdocs/core/lib/price.lib.php

@@ -157,8 +157,8 @@ function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $uselocalt
 		if ($resql) {
 			$obj = $db->fetch_object($resql);
 			if ($obj) {
-				$localtax1_rate = (float) $obj->localtax1;		// Use float to force to get first numeric value when value is x:y:z
-				$localtax2_rate = (float) $obj->localtax2;		// Use float to force to get first numeric value when value is -19:-15:-9
+				$localtax1_rate = (float) $obj->localtax1; // Use float to force to get first numeric value when value is x:y:z
+				$localtax2_rate = (float) $obj->localtax2; // Use float to force to get first numeric value when value is -19:-15:-9
 				$localtax1_type = $obj->localtax1_type;
 				$localtax2_type = $obj->localtax2_type;
 				//var_dump($localtax1_rate.' '.$localtax2_rate.' '.$localtax1_type.' '.$localtax2_type);
@@ -443,7 +443,7 @@ function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $uselocalt
 	// initialize result array
 	//for ($i=0; $i <= 18; $i++) $result[$i] = (float) $result[$i];
 
-	dol_syslog('Price.lib::calcul_price_total MAIN_ROUNDING_RULE_TOT='.(empty($conf->global->MAIN_ROUNDING_RULE_TOT)?'':$conf->global->MAIN_ROUNDING_RULE_TOT).' pu='.$pu.' qty='.$qty.' price_base_type='.$price_base_type.' total_ht='.$result[0].'-total_vat='.$result[1].'-total_ttc='.$result[2]);
+	dol_syslog('Price.lib::calcul_price_total MAIN_ROUNDING_RULE_TOT='.(empty($conf->global->MAIN_ROUNDING_RULE_TOT) ? '' : $conf->global->MAIN_ROUNDING_RULE_TOT).' pu='.$pu.' qty='.$qty.' price_base_type='.$price_base_type.' total_ht='.$result[0].'-total_vat='.$result[1].'-total_ttc='.$result[2]);
 
 	return $result;
 }

+ 1 - 1
htdocs/core/lib/security.lib.php

@@ -618,7 +618,7 @@ function checkUserAccessToObject($user, array $featuresarray, $objectid = 0, $ta
 		$checksoc = array('societe'); // Test for societe object
 		$checkother = array('contact', 'agenda'); // Test on entity + link to third party on field $dbt_keyfield. Allowed if link is empty (Ex: contacts...).
 		$checkproject = array('projet', 'project'); // Test for project object
-		$checktask = array('projet_task');	// Test for task object
+		$checktask = array('projet_task'); // Test for task object
 		$nocheck = array('barcode', 'stock'); // No test
 		//$checkdefault = 'all other not already defined'; // Test on entity + link to third party on field $dbt_keyfield. Not allowed if link is empty (Ex: invoice, orders...).
 

+ 1 - 1
htdocs/core/lib/security2.lib.php

@@ -234,7 +234,7 @@ if (!function_exists('dol_loginfunction')) {
 
 		if (!empty($mysoc->logo_small) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_small)) {
 			$urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&amp;modulepart=mycompany&amp;file='.urlencode('logos/thumbs/'.$mysoc->logo_small);
-		} elseif (!empty($mysoc->logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$mysoc->logo))	{
+		} elseif (!empty($mysoc->logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$mysoc->logo)) {
 			$urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&amp;modulepart=mycompany&amp;file='.urlencode('logos/'.$mysoc->logo);
 			$width = 128;
 		} elseif (!empty($mysoc->logo_squarred_small) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_squarred_small)) {

+ 3 - 1
htdocs/core/modules/commande/doc/pdf_einstein.modules.php

@@ -1256,7 +1256,9 @@ class pdf_einstein extends ModelePDFCommandes
 		global $conf, $langs, $hookmanager;
 
 		$ltrdirection = 'L';
-		if ($outputlangs->trans("DIRECTION") == 'rtl') $ltrdirection = 'R';
+		if ($outputlangs->trans("DIRECTION") == 'rtl') {
+			$ltrdirection = 'R';
+		}
 
 		// Load traductions files required by page
 		$outputlangs->loadLangs(array("main", "bills", "propal", "orders", "companies"));

+ 6 - 6
htdocs/core/modules/modCategorie.class.php

@@ -164,8 +164,8 @@ class modCategorie extends DolibarrModules
 			$typeexample .= ($typeexample ? " / " : "")."11=Website page";
 		}
 
-		$this->export_fields_array[$r] = array('cat.rowid'=>"CategId", 'cat.label'=>"Label", 'cat.type'=>"Type", 'cat.description'=>"Description", 'cat.fk_parent'=>"ParentCategory", 'pcat.label'=>"ParentCategoryLabel" );
-		$this->export_TypeFields_array[$r] = array('cat.label'=>"Text", 'cat.type'=>"Numeric", 'cat.description'=>"Text", 'cat.fk_parent'=>'List:categorie:label:rowid', 'pcat.label'=>'Text' );
+		$this->export_fields_array[$r] = array('cat.rowid'=>"CategId", 'cat.label'=>"Label", 'cat.type'=>"Type", 'cat.description'=>"Description", 'cat.fk_parent'=>"ParentCategory", 'pcat.label'=>"ParentCategoryLabel");
+		$this->export_TypeFields_array[$r] = array('cat.label'=>"Text", 'cat.type'=>"Numeric", 'cat.description'=>"Text", 'cat.fk_parent'=>'List:categorie:label:rowid', 'pcat.label'=>'Text');
 		$this->export_entities_array[$r] = array(); // We define here only fields that use another picto
 		$this->export_help_array[$r] = array('cat.type'=>$typeexample);
 
@@ -460,7 +460,7 @@ class modCategorie extends DolibarrModules
 		);
 
 		$this->import_examplevalues_array[$r] = array(
-			'ca.label'=>"My Category Label", 'ca.type'=>$typeexample, 'ca.description'=>"My Category description",		// $typeexample built above in exports
+			'ca.label'=>"My Category Label", 'ca.type'=>$typeexample, 'ca.description'=>"My Category description", // $typeexample built above in exports
 			'ca.fk_parent' => 'rowid or label'
 		);
 		$this->import_updatekeys_array[$r] = array('ca.label'=>'Label');
@@ -538,7 +538,7 @@ class modCategorie extends DolibarrModules
 
 			$this->import_convertvalue_array[$r] = array(
 				'cs.fk_categorie'=>array('rule'=>'fetchidfromref', 'classfile'=>'/categories/class/categorie.class.php', 'class'=>'Categorie', 'method'=>'fetch', 'element'=>'category'),
-				'cs.fk_member'=>array('rule'=>'fetchidfromref','classfile'=>'/adherents/class/adherent.class.php','class'=>'Adherent','method'=>'fetch','element'=>'Member')
+				'cs.fk_member'=>array('rule'=>'fetchidfromref', 'classfile'=>'/adherents/class/adherent.class.php', 'class'=>'Adherent', 'method'=>'fetch', 'element'=>'Member')
 			);
 			$this->import_examplevalues_array[$r] = array('cs.fk_categorie'=>"rowid or label", 'cs.fk_member'=>"rowid or ref");
 		}
@@ -579,7 +579,7 @@ class modCategorie extends DolibarrModules
 
 			$this->import_convertvalue_array[$r] = array(
 				'cs.fk_categorie'=>array('rule'=>'fetchidfromref', 'classfile'=>'/categories/class/categorie.class.php', 'class'=>'Categorie', 'method'=>'fetch', 'element'=>'category'),
-				'cs.fk_project'=>array('rule'=>'fetchidfromref','classfile'=>'/projet/class/project.class.php','class'=>'Project','method'=>'fetch','element'=>'Project')
+				'cs.fk_project'=>array('rule'=>'fetchidfromref', 'classfile'=>'/projet/class/project.class.php', 'class'=>'Project', 'method'=>'fetch', 'element'=>'Project')
 			);
 			$this->import_examplevalues_array[$r] = array('cp.fk_categorie'=>"rowid or label", 'cp.fk_project'=>"rowid or ref");
 		}
@@ -597,7 +597,7 @@ class modCategorie extends DolibarrModules
 
 			$this->import_convertvalue_array[$r] = array(
 				'cu.fk_categorie'=>array('rule'=>'fetchidfromref', 'classfile'=>'/categories/class/categorie.class.php', 'class'=>'Categorie', 'method'=>'fetch', 'element'=>'category'),
-				'cu.fk_user'=>array('rule'=>'fetchidfromref','classfile'=>'/user/class/user.class.php','class'=>'User','method'=>'fetch','element'=>'User')
+				'cu.fk_user'=>array('rule'=>'fetchidfromref', 'classfile'=>'/user/class/user.class.php', 'class'=>'User', 'method'=>'fetch', 'element'=>'User')
 			);
 			$this->import_examplevalues_array[$r] = array('cu.fk_categorie'=>"rowid or label", 'cu.fk_user'=>"rowid or login");
 		}

+ 1 - 1
htdocs/core/modules/propale/doc/pdf_cyan.modules.php

@@ -1739,7 +1739,7 @@ class pdf_cyan extends ModelePDFPropales
 
 			$carac_client_name = pdfBuildThirdpartyName($thirdparty, $outputlangs);
 
-			$mode =  'target';
+			$mode = 'target';
 			$carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ($usecontact ? $object->contact : ''), $usecontact, $mode, $object);
 
 			// Show recipient

+ 1 - 1
htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php

@@ -133,7 +133,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
 		$this->db = $db;
 		$this->name = "canelle";
 		$this->description = $langs->trans('SuppliersInvoiceModel');
-		$this->update_main_doc_field = 1;		// Save the name of generated file as the main doc when generating a doc with this template
+		$this->update_main_doc_field = 1; // Save the name of generated file as the main doc when generating a doc with this template
 
 		// Page dimensions
 		$this->type = 'pdf';

+ 4 - 2
htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php

@@ -135,7 +135,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
 		$this->db = $db;
 		$this->name = "muscadet";
 		$this->description = $langs->trans('SuppliersCommandModelMuscadet');
-		$this->update_main_doc_field = 1;		// Save the name of generated file as the main doc when generating a doc with this template
+		$this->update_main_doc_field = 1; // Save the name of generated file as the main doc when generating a doc with this template
 
 		// Page size for A4 format
 		$this->type = 'pdf';
@@ -1127,7 +1127,9 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
 		global $langs, $conf, $mysoc;
 
 		$ltrdirection = 'L';
-		if ($outputlangs->trans("DIRECTION") == 'rtl') $ltrdirection = 'R';
+		if ($outputlangs->trans("DIRECTION") == 'rtl') {
+			$ltrdirection = 'R';
+		}
 
 		// Load translation files required by the page
 		$outputlangs->loadLangs(array("main", "orders", "companies", "bills", "sendings"));

+ 1 - 1
htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php

@@ -132,7 +132,7 @@ class pdf_standard extends ModelePDFSuppliersPayments
 		$this->db = $db;
 		$this->name = "standard";
 		$this->description = $langs->trans('DocumentModelStandardPDF');
-		$this->update_main_doc_field = 1;		// Save the name of generated file as the main doc when generating a doc with this template
+		$this->update_main_doc_field = 1; // Save the name of generated file as the main doc when generating a doc with this template
 
 		// Page size for A4 format
 		$this->type = 'pdf';

+ 1 - 1
htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php

@@ -132,7 +132,7 @@ class pdf_aurore extends ModelePDFSupplierProposal
 		$this->db = $db;
 		$this->name = "aurore";
 		$this->description = $langs->trans('DocModelAuroreDescription');
-		$this->update_main_doc_field = 1;		// Save the name of generated file as the main doc when generating a doc with this template
+		$this->update_main_doc_field = 1; // Save the name of generated file as the main doc when generating a doc with this template
 
 		// Page size for A4 format
 		$this->type = 'pdf';

+ 1 - 1
htdocs/core/modules/workstation/mod_workstation_advanced.php

@@ -27,7 +27,7 @@
  * \brief      File containing class for advanced numbering model of Workstation
  */
 
-require_once DOL_DOCUMENT_ROOT . '/core/modules/workstation/modules_workstation.php';
+require_once DOL_DOCUMENT_ROOT.'/core/modules/workstation/modules_workstation.php';
 
 
 /**

+ 1 - 1
htdocs/core/photos_resize.php

@@ -475,7 +475,7 @@ if ($action == 'confirm_crop') {
  * View
  */
 
-$title= $langs->trans("ImageEditor");
+$title = $langs->trans("ImageEditor");
 $morejs = array('/includes/jquery/plugins/jcrop/js/jquery.Jcrop.min.js', '/core/js/lib_photosresize.js');
 $morecss = array('/includes/jquery/plugins/jcrop/css/jquery.Jcrop.css');
 

+ 10 - 10
htdocs/core/tpl/extrafields_list_search_param.tpl.php

@@ -18,17 +18,17 @@ if (!empty($search_array_options) && is_array($search_array_options)) {	// $extr
 		if (is_array($val) && array_key_exists('start', $val) && array_key_exists('end', $val)) {
 			// date range from list filters is stored as array('start' => <timestamp>, 'end' => <timestamp>)
 			// start date
-			$param .= '&' . $search_options_pattern.$tmpkey.'_startyear='  . dol_print_date($val['start'], '%Y');
-			$param .= '&' . $search_options_pattern.$tmpkey.'_startmonth=' . dol_print_date($val['start'], '%m');
-			$param .= '&' . $search_options_pattern.$tmpkey.'_startday='   . dol_print_date($val['start'], '%d');
-			$param .= '&' . $search_options_pattern.$tmpkey.'_starthour='  . dol_print_date($val['start'], '%H');
-			$param .= '&' . $search_options_pattern.$tmpkey.'_startmin='   . dol_print_date($val['start'], '%M');
+			$param .= '&'.$search_options_pattern.$tmpkey.'_startyear='.dol_print_date($val['start'], '%Y');
+			$param .= '&'.$search_options_pattern.$tmpkey.'_startmonth='.dol_print_date($val['start'], '%m');
+			$param .= '&'.$search_options_pattern.$tmpkey.'_startday='.dol_print_date($val['start'], '%d');
+			$param .= '&'.$search_options_pattern.$tmpkey.'_starthour='.dol_print_date($val['start'], '%H');
+			$param .= '&'.$search_options_pattern.$tmpkey.'_startmin='.dol_print_date($val['start'], '%M');
 			// end date
-			$param .= '&' . $search_options_pattern.$tmpkey.'_endyear='  . dol_print_date($val['end'], '%Y');
-			$param .= '&' . $search_options_pattern.$tmpkey.'_endmonth=' . dol_print_date($val['end'], '%m');
-			$param .= '&' . $search_options_pattern.$tmpkey.'_endday='   . dol_print_date($val['end'], '%d');
-			$param .= '&' . $search_options_pattern.$tmpkey.'_endhour='  . dol_print_date($val['end'], '%H');
-			$param .= '&' . $search_options_pattern.$tmpkey.'_endmin='   . dol_print_date($val['end'], '%M');
+			$param .= '&'.$search_options_pattern.$tmpkey.'_endyear='.dol_print_date($val['end'], '%Y');
+			$param .= '&'.$search_options_pattern.$tmpkey.'_endmonth='.dol_print_date($val['end'], '%m');
+			$param .= '&'.$search_options_pattern.$tmpkey.'_endday='.dol_print_date($val['end'], '%d');
+			$param .= '&'.$search_options_pattern.$tmpkey.'_endhour='.dol_print_date($val['end'], '%H');
+			$param .= '&'.$search_options_pattern.$tmpkey.'_endmin='.dol_print_date($val['end'], '%M');
 			$val = '';
 		}
 		if ($val != '') {

+ 1 - 1
htdocs/core/tpl/extrafields_view.tpl.php

@@ -125,7 +125,7 @@ if (empty($reshook) && isset($extrafields->attributes[$object->table_element]['l
 
 			$lastseparatorkeyfound = $tmpkeyextra;
 		} else {
-			print '<tr class="trextrafields_collapse'.$extrafields_collapse_num.(!empty($object->id)?'_'.$object->id:'');
+			print '<tr class="trextrafields_collapse'.$extrafields_collapse_num.(!empty($object->id) ? '_'.$object->id : '');
 			/*if ($extrafields_collapse_num && $extrafields_collapse_num_old && $extrafields_collapse_num != $extrafields_collapse_num_old) {
 				print ' trextrafields_collapse_new';
 			}*/

+ 8 - 8
htdocs/core/tpl/massactions_pre.tpl.php

@@ -38,17 +38,17 @@ if ($massaction == 'predelete') {
 if ($massaction == 'preaffecttag') {
 	require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
 	$categ = new Categorie($db);
-	$categ_types=array();
-	$categ_type_array=$categ->getMapList();
+	$categ_types = array();
+	$categ_type_array = $categ->getMapList();
 	foreach ($categ_type_array as $categdef) {
-		if (isset($object) && $categdef['obj_table']==$object->table_element) {
+		if (isset($object) && $categdef['obj_table'] == $object->table_element) {
 			if (!array_key_exists($categdef['code'], $categ_types)) {
-				$categ_types[$categdef['code']] = array('code'=>$categdef['code'],'label'=>$langs->trans($categdef['obj_class']));
+				$categ_types[$categdef['code']] = array('code'=>$categdef['code'], 'label'=>$langs->trans($categdef['obj_class']));
 			}
 		}
-		if (isset($objecttmp) && $categdef['obj_table']==$objecttmp->table_element) {
+		if (isset($objecttmp) && $categdef['obj_table'] == $objecttmp->table_element) {
 			if (!array_key_exists($categdef['code'], $categ_types)) {
-				$categ_types[$categdef['code']] = array('code'=>$categdef['code'],'label'=>$langs->trans($categdef['obj_class']));
+				$categ_types[$categdef['code']] = array('code'=>$categdef['code'], 'label'=>$langs->trans($categdef['obj_class']));
 			}
 		}
 	}
@@ -57,12 +57,12 @@ if ($massaction == 'preaffecttag') {
 	if (!empty($categ_types)) {
 		foreach ($categ_types as $categ_type) {
 			$cate_arbo = $form->select_all_categories($categ_type['code'], null, 'parent', null, null, 1);
-			$formquestion[]=array('type' => 'other',
+			$formquestion[] = array('type' => 'other',
 					'name' => 'affecttag_'.$categ_type['code'],
 					'label' => $langs->trans("Tag").' '.$categ_type['label'],
 					'value' => $form->multiselectarray('contcats_'.$categ_type['code'], $cate_arbo, GETPOST('contcats_'.$categ_type['code'], 'array'), null, null, null, null, '60%'));
 		}
-		$formquestion[]=array('type' => 'other',
+		$formquestion[] = array('type' => 'other',
 				'name' => 'affecttag_type',
 				'label' => '',
 				'value' => '<input type="hidden" name="affecttag_type"  id="affecttag_type" value="'.implode(",", array_keys($categ_types)).'"/>');

+ 2 - 2
htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php

@@ -173,11 +173,11 @@ class InterfaceWorkflowManager extends DolibarrTriggers
 				}
 			}
 
-			if (! empty($conf->expedition->enabled) && ! empty($conf->workflow->enabled) && ! empty($conf->global->WORKFLOW_SHIPPING_CLASSIFY_CLOSED_INVOICE)) {
+			if (!empty($conf->expedition->enabled) && !empty($conf->workflow->enabled) && !empty($conf->global->WORKFLOW_SHIPPING_CLASSIFY_CLOSED_INVOICE)) {
 				/** @var Facture $object */
 				$object->fetchObjectLinked('', 'shipping', $object->id, $object->element);
 
-				if (! empty($object->linkedObjects)) {
+				if (!empty($object->linkedObjects)) {
 					/** @var Expedition $shipment */
 					$shipment = array_shift($object->linkedObjects['shipping']);
 

+ 2 - 2
htdocs/ecm/index_auto.php

@@ -366,8 +366,8 @@ if (!empty($conf->global->ECM_AUTO_TREE_ENABLED)) {
 
 	$parameters = array();
 	$reshook = $hookmanager->executeHooks('addSectionECMAuto', $parameters);
-	if ($reshook > 0 && is_array($hookmanager->resArray) && count($hookmanager->resArray)>0) {
-		$sectionauto[]=$hookmanager->resArray;
+	if ($reshook > 0 && is_array($hookmanager->resArray) && count($hookmanager->resArray) > 0) {
+		$sectionauto[] = $hookmanager->resArray;
 		$rowspan += count($hookmanager->resArray);
 	}
 }

+ 19 - 17
htdocs/eventorganization/class/conferenceorbooth.class.php

@@ -24,7 +24,7 @@
 
 // Put here all includes required by your class file
 require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php';
-require_once DOL_DOCUMENT_ROOT . '/comm/action/class/actioncomm.class.php';
+require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
 //require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
 
 /**
@@ -102,7 +102,7 @@ class ConferenceOrBooth extends ActionComm
 	/**
 	 * @var array  Array with all fields and their property. Do not use it as a static var. It may be modified by constructor.
 	 */
-	public $fields=array(
+	public $fields = array(
 		'id' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>'1', 'position'=>1, 'notnull'=>1, 'visible'=>0, 'noteditable'=>'1', 'index'=>1, 'css'=>'left', 'comment'=>"Id"),
 		'ref' => array('type'=>'integer', 'label'=>'Ref', 'enabled'=>'1', 'position'=>1, 'notnull'=>1, 'visible'=>2, 'noteditable'=>'1', 'index'=>1, 'css'=>'left', 'comment'=>"Id"),
 		'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>'1', 'position'=>30, 'notnull'=>0, 'visible'=>1, 'searchall'=>1, 'css'=>'minwidth300', 'help'=>"Help text", 'showoncombobox'=>'1',),
@@ -195,11 +195,11 @@ class ConferenceOrBooth extends ActionComm
 	 */
 	protected function setPercentageFromStatus()
 	{
-		if ($this->status==self::STATUS_DONE) {
-			$this->percentage=100;
+		if ($this->status == self::STATUS_DONE) {
+			$this->percentage = 100;
 		}
-		if ($this->status==self::STATUS_DRAFT) {
-			$this->percentage=0;
+		if ($this->status == self::STATUS_DRAFT) {
+			$this->percentage = 0;
 		}
 	}
 
@@ -211,12 +211,12 @@ class ConferenceOrBooth extends ActionComm
 	 */
 	protected function setActionCommFields(User $user)
 	{
-		$this->userownerid=$user->id;
-		$this->type_id=$this->fk_action;
-		$this->socid=$this->fk_soc;
-		$this->datef=$this->datep2;
-		$this->note_private=$this->note;
-		$this->fk_user_author=$this->fk_user_author;
+		$this->userownerid = $user->id;
+		$this->type_id = $this->fk_action;
+		$this->socid = $this->fk_soc;
+		$this->datef = $this->datep2;
+		$this->note_private = $this->note;
+		$this->fk_user_author = $this->fk_user_author;
 	}
 
 	/**
@@ -226,9 +226,9 @@ class ConferenceOrBooth extends ActionComm
 	 */
 	protected function getActionCommFields()
 	{
-		$this->fk_action=$this->type_id;
-		$this->fk_soc=$this->socid;
-		$this->datep2=$this->datef;
+		$this->fk_action = $this->type_id;
+		$this->fk_soc = $this->socid;
+		$this->datep2 = $this->datef;
 	}
 
 	/**
@@ -408,7 +408,9 @@ class ConferenceOrBooth extends ActionComm
 		if (!$error && !$notrigger) {
 			// Call trigger
 			$result = $this->call_trigger('CONFERENCEORBOOTH_VALIDATE', $user);
-			if ($result < 0) $error++;
+			if ($result < 0) {
+				$error++;
+			}
 			// End call triggers
 		}
 
@@ -540,7 +542,7 @@ class ConferenceOrBooth extends ActionComm
 			if ($add_save_lastsearch_values) {
 				$url .= '&save_lastsearch_values=1';
 			}
-			if ($option=='withproject') {
+			if ($option == 'withproject') {
 				$url .= '&withproject=1';
 			}
 		}

+ 1 - 1
htdocs/exports/class/export.class.php

@@ -178,7 +178,7 @@ class Export
 									// Code du dataset export
 									$this->array_export_code[$i] = $module->export_code[$r];
 									// Define a key for sort
-									$this->array_export_code_for_sort[$i] = $module->module_position.'_'.$module->export_code[$r];	// Add a key into the module
+									$this->array_export_code_for_sort[$i] = $module->module_position.'_'.$module->export_code[$r]; // Add a key into the module
 									// Libelle du dataset export
 									$this->array_export_label[$i] = $module->getExportDatasetLabel($r);
 									// Tableau des champ a exporter (cle=champ, valeur=libelle)

+ 2 - 2
htdocs/fourn/facture/paiement.php

@@ -682,10 +682,10 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
 									print img_picto("Auto fill", 'rightarrow', "class='AutoFillAmout' data-rowname='".$namef."' data-value='".($sign * $remaintopay)."'");
 								}
 									print '<input type="hidden" class="remain" name="'.$nameRemain.'" value="'.$remaintopay.'">';
-									print '<input type="text" size="8" class="amount" name="'.$namef.'" value="'.dol_escape_htmltag(GETPOST($namef)).'">';	// class is requied to be used by javascript callForResult();
+									print '<input type="text" size="8" class="amount" name="'.$namef.'" value="'.dol_escape_htmltag(GETPOST($namef)).'">'; // class is requied to be used by javascript callForResult();
 							} else {
 								print '<input type="text" size="8" name="'.$namef.'_disabled" value="'.dol_escape_htmltag(GETPOST($namef)).'" disabled>';
-								print '<input type="hidden" class="amount" name="'.$namef.'" value="'.dol_escape_htmltag(GETPOST($namef)).'">';	// class is requied to be used by javascript callForResult();
+								print '<input type="hidden" class="amount" name="'.$namef.'" value="'.dol_escape_htmltag(GETPOST($namef)).'">'; // class is requied to be used by javascript callForResult();
 							}
 							print "</td>";
 

+ 1 - 1
htdocs/index.php

@@ -26,7 +26,7 @@
  */
 
 
-define('CSRFCHECK_WITH_TOKEN', 1);	// We force need to use a token to login when making a POST
+define('CSRFCHECK_WITH_TOKEN', 1); // We force need to use a token to login when making a POST
 
 require 'main.inc.php';
 require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';

+ 1 - 1
htdocs/install/upgrade2.php

@@ -4360,7 +4360,7 @@ function migrate_reload_modules($db, $langs, $conf, $listofmodule = array(), $fo
 					$mod = new $classname($db);
 
 					//$mod->remove('noboxes');
-					$mod->delete_menus();	// We must delete to be sure it is inserted with new values
+					$mod->delete_menus(); // We must delete to be sure it is inserted with new values
 					$mod->init($reloadmode);
 				} else {
 					dolibarr_install_syslog('Failed to include '.DOL_DOCUMENT_ROOT.'/core/modules/mod'.$moduletoreloadshort.'.class.php');

+ 1 - 1
htdocs/mrp/mo_note.php

@@ -60,7 +60,7 @@ if ($id > 0 || !empty($ref)) {
 $isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
 $result = restrictedArea($user, 'mrp', $object->id, 'mrp_mo', '', 'fk_soc', 'rowid', $isdraft);
 
-$permissionnote = $user->rights->mrp->write;	// Used by the include of actions_setnotes.inc.php
+$permissionnote = $user->rights->mrp->write; // Used by the include of actions_setnotes.inc.php
 
 
 

+ 1 - 1
htdocs/paypal/lib/paypal.lib.php

@@ -282,7 +282,7 @@ function callSetExpressCheckout($paymentAmount, $currencyCodeType, $paymentType,
 	$_SESSION["FinalPaymentAmt"] = $paymentAmount;
 	$_SESSION["currencyCodeType"] = $currencyCodeType;
 	$_SESSION["PaymentType"] = $paymentType; // 'Mark', 'Sole'
-	$_SESSION['ipaddress'] = getUserRemoteIP();	// Payer ip
+	$_SESSION['ipaddress'] = getUserRemoteIP(); // Payer ip
 
 	//'---------------------------------------------------------------------------------------------------------------
 	//' Make the API call to PayPal

+ 1 - 1
htdocs/product/class/productcustomerprice.class.php

@@ -739,7 +739,7 @@ class Productcustomerprice extends CommonObject
 		$sql .= " tms=".(dol_strlen($this->tms) != 0 ? "'".$this->db->idate($this->tms)."'" : 'null').",";
 		$sql .= " fk_product=".(isset($this->fk_product) ? $this->fk_product : "null").",";
 		$sql .= " fk_soc=".(isset($this->fk_soc) ? $this->fk_soc : "null").",";
-		$sql .= " ref_customer=".(isset($this->ref_customer) ? "'" . $this->db->escape($this->ref_customer) . "'" : "null").",";
+		$sql .= " ref_customer=".(isset($this->ref_customer) ? "'".$this->db->escape($this->ref_customer)."'" : "null").",";
 		$sql .= " price=".(isset($this->price) ? $this->price : "null").",";
 		$sql .= " price_ttc=".(isset($this->price_ttc) ? $this->price_ttc : "null").",";
 		$sql .= " price_min=".(isset($this->price_min) ? $this->price_min : "null").",";

+ 3 - 1
htdocs/product/stock/productlot_document.php

@@ -113,7 +113,9 @@ if ($user->socid > 0) { // Protection if external user
 	accessforbidden();
 }
 //$result = restrictedArea($user, 'productbatch');
-if (!$permissiontoread) accessforbidden();
+if (!$permissiontoread) {
+	accessforbidden();
+}
 
 
 /*

+ 1 - 1
htdocs/product/stock/stockatdate.php

@@ -607,7 +607,7 @@ $parameters = array('sql'=>$sql);
 $reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters); // Note that $action and $object may have been modified by hook
 print $hookmanager->resPrint;
 
-if (empty($date) || ! $dateIsValid) {
+if (empty($date) || !$dateIsValid) {
 	$colspan = 8;
 	if ($mode == 'future') {
 		$colspan++;

+ 1 - 1
htdocs/projet/element.php

@@ -880,7 +880,7 @@ foreach ($listofreferent as $key => $value) {
 				}
 
 				// Add total if we have to
-				if ($qualifiedfortotal)	{
+				if ($qualifiedfortotal) {
 					$total_ht = $total_ht + $total_ht_by_line;
 					$total_ttc = $total_ttc + $total_ttc_by_line;
 				}

+ 2 - 2
htdocs/projet/graph_opportunities.inc.php

@@ -19,7 +19,7 @@
 
 if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) {
 	$sql = "SELECT p.fk_opp_status as opp_status, cls.code, COUNT(p.rowid) as nb, SUM(p.opp_amount) as opp_amount, SUM(p.opp_amount * p.opp_percent) as ponderated_opp_amount";
-	$sql .= " FROM ".MAIN_DB_PREFIX."projet as p LEFT JOIN ".MAIN_DB_PREFIX."c_lead_status as cls ON p.fk_opp_status = cls.rowid";	// If lead status has been removed, we must show it in stats as unknown
+	$sql .= " FROM ".MAIN_DB_PREFIX."projet as p LEFT JOIN ".MAIN_DB_PREFIX."c_lead_status as cls ON p.fk_opp_status = cls.rowid"; // If lead status has been removed, we must show it in stats as unknown
 	$sql .= " WHERE p.entity IN (".getEntity('project').")";
 	$sql .= " AND p.fk_statut = 1"; // Opend projects only
 	if ($mine || empty($user->rights->projet->all->lire)) {
@@ -91,7 +91,7 @@ if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) {
 				$labelStatus = $listofopplabel[$status];
 			}
 			if (empty($labelStatus)) {
-				$labelStatus = $langs->transnoentitiesnoconv('OldValue', $status);	// When id is id of an entry no more in dictionary for example.
+				$labelStatus = $langs->transnoentitiesnoconv('OldValue', $status); // When id is id of an entry no more in dictionary for example.
 			}
 
 			//$labelStatus .= ' ('.$langs->trans("Coeff").': '.price2num($listofoppstatus[$status]).')';

+ 2 - 2
htdocs/projet/tasks/contact.php

@@ -59,9 +59,9 @@ restrictedArea($user, 'projet', $object->fk_project, 'projet&project');
 
 // Add new contact
 if ($action == 'addcontact' && $user->rights->projet->creer) {
-	$source  = 'internal';
+	$source = 'internal';
 	if (GETPOST("addsourceexternal")) {
-		$source  ='external';
+		$source = 'external';
 	}
 
 	$result = $object->fetch($id, $ref);

+ 41 - 41
htdocs/societe/class/societe.class.php

@@ -853,7 +853,7 @@ class Societe extends CommonObject
 		$this->accountancy_code_customer = trim($this->code_compta);
 		$this->accountancy_code_supplier = trim($this->code_compta_fournisseur);
 		$this->accountancy_code_buy = trim($this->accountancy_code_buy);
-		$this->accountancy_code_sell= trim($this->accountancy_code_sell);
+		$this->accountancy_code_sell = trim($this->accountancy_code_sell);
 
 		if (!empty($this->multicurrency_code)) {
 			$this->fk_multicurrency = MultiCurrency::getIdFromCode($this->db, $this->multicurrency_code);
@@ -917,8 +917,8 @@ class Societe extends CommonObject
 			$sql .= ", ".(int) $this->fk_multicurrency;
 			$sql .= ", '".$this->db->escape($this->multicurrency_code)."'";
 			if (empty($conf->global->MAIN_COMPANY_PERENTITY_SHARED)) {
-				$sql .= ", '" . $this->db->escape($this->accountancy_code_buy) . "'";
-				$sql .= ", '" . $this->db->escape($this->accountancy_code_sell) . "'";
+				$sql .= ", '".$this->db->escape($this->accountancy_code_buy)."'";
+				$sql .= ", '".$this->db->escape($this->accountancy_code_sell)."'";
 			}
 			$sql .= ")";
 
@@ -931,9 +931,9 @@ class Societe extends CommonObject
 
 				// update accountancy for this entity
 				if (!$error && !empty($conf->global->MAIN_COMPANY_PERENTITY_SHARED)) {
-					$this->db->query("DELETE FROM " . MAIN_DB_PREFIX . "societe_perentity WHERE fk_soc = " . ((int) $this->id) . " AND entity = " . ((int) $conf->entity));
+					$this->db->query("DELETE FROM ".MAIN_DB_PREFIX."societe_perentity WHERE fk_soc = ".((int) $this->id)." AND entity = ".((int) $conf->entity));
 
-					$sql = "INSERT INTO " . MAIN_DB_PREFIX . "societe_perentity (";
+					$sql = "INSERT INTO ".MAIN_DB_PREFIX."societe_perentity (";
 					$sql .= " fk_soc";
 					$sql .= ", entity";
 					$sql .= ", accountancy_code_customer";
@@ -942,11 +942,11 @@ class Societe extends CommonObject
 					$sql .= ", accountancy_code_sell";
 					$sql .= ") VALUES (";
 					$sql .= $this->id;
-					$sql .= ", " . $conf->entity;
-					$sql .= ", '" . $this->db->escape($this->accountancy_code_customer) . "'";
-					$sql .= ", '" . $this->db->escape($this->accountancy_code_supplier) . "'";
-					$sql .= ", '" . $this->db->escape($this->accountancy_code_buy) . "'";
-					$sql .= ", '" . $this->db->escape($this->accountancy_code_sell) . "'";
+					$sql .= ", ".$conf->entity;
+					$sql .= ", '".$this->db->escape($this->accountancy_code_customer)."'";
+					$sql .= ", '".$this->db->escape($this->accountancy_code_supplier)."'";
+					$sql .= ", '".$this->db->escape($this->accountancy_code_buy)."'";
+					$sql .= ", '".$this->db->escape($this->accountancy_code_sell)."'";
 					$sql .= ")";
 					$result = $this->db->query($sql);
 					if (!$result) {
@@ -1053,7 +1053,7 @@ class Societe extends CommonObject
 				$error++;
 				$this->error = $contact->error;
 				$this->errors = array_merge($this->errors, $contact->errors);
-				dol_syslog(get_class($this) . "::create_individual Affect Tag ERROR:" . $this->error, LOG_ERR);
+				dol_syslog(get_class($this)."::create_individual Affect Tag ERROR:".$this->error, LOG_ERR);
 				$contactId = $result;
 			}
 		}
@@ -1063,7 +1063,7 @@ class Societe extends CommonObject
 			if ($result < 0) {
 				$this->error = $contact->error;
 				$this->errors = array_merge($this->errors, $contact->errors);
-				dol_syslog(get_class($this) . "::create_individual set mailing status ERROR:" . $this->error, LOG_ERR);
+				dol_syslog(get_class($this)."::create_individual set mailing status ERROR:".$this->error, LOG_ERR);
 				$contactId = $result;
 			}
 		}
@@ -1299,7 +1299,7 @@ class Societe extends CommonObject
 		}
 
 		$this->code_compta_client = trim(empty($this->code_compta) ? $this->code_compta_client : $this->code_compta);
-		$this->code_compta = $this->code_compta_client;		// for backward compatibility
+		$this->code_compta = $this->code_compta_client; // for backward compatibility
 		$this->code_compta_fournisseur = trim($this->code_compta_fournisseur);
 
 		// Check parameters. More tests are done later in the ->verify()
@@ -1340,7 +1340,7 @@ class Societe extends CommonObject
 		$this->webservices_key = trim($this->webservices_key);
 
 		$this->accountancy_code_buy = trim($this->accountancy_code_buy);
-		$this->accountancy_code_sell= trim($this->accountancy_code_sell);
+		$this->accountancy_code_sell = trim($this->accountancy_code_sell);
 
 		//Incoterms
 		$this->fk_incoterms = (int) $this->fk_incoterms;
@@ -1467,8 +1467,8 @@ class Societe extends CommonObject
 			$sql .= ",supplier_order_min_amount= ".($this->supplier_order_min_amount != '' ? $this->supplier_order_min_amount : 'null');
 			$sql .= ",fk_prospectlevel='".$this->db->escape($this->fk_prospectlevel)."'";
 			if (empty($conf->global->MAIN_COMPANY_PERENTITY_SHARED)) {
-				$sql .= ", accountancy_code_buy = '" . $this->db->escape($this->accountancy_code_buy) . "'";
-				$sql .= ", accountancy_code_sell= '" . $this->db->escape($this->accountancy_code_sell) . "'";
+				$sql .= ", accountancy_code_buy = '".$this->db->escape($this->accountancy_code_buy)."'";
+				$sql .= ", accountancy_code_sell= '".$this->db->escape($this->accountancy_code_sell)."'";
 
 				if ($customer) {
 					$sql .= ", code_compta = ".(!empty($this->code_compta_client) ? "'".$this->db->escape($this->code_compta_client)."'" : "null");
@@ -1559,9 +1559,9 @@ class Societe extends CommonObject
 
 				// update accountancy for this entity
 				if (!$error && !empty($conf->global->MAIN_COMPANY_PERENTITY_SHARED)) {
-					$this->db->query("DELETE FROM " . MAIN_DB_PREFIX . "societe_perentity WHERE fk_soc = " . ((int) $this->id) . " AND entity = " . ((int) $conf->entity));
+					$this->db->query("DELETE FROM ".MAIN_DB_PREFIX."societe_perentity WHERE fk_soc = ".((int) $this->id)." AND entity = ".((int) $conf->entity));
 
-					$sql = "INSERT INTO " . MAIN_DB_PREFIX . "societe_perentity (";
+					$sql = "INSERT INTO ".MAIN_DB_PREFIX."societe_perentity (";
 					$sql .= " fk_soc";
 					$sql .= ", entity";
 					$sql .= ", accountancy_code_customer";
@@ -1570,11 +1570,11 @@ class Societe extends CommonObject
 					$sql .= ", accountancy_code_sell";
 					$sql .= ") VALUES (";
 					$sql .= $this->id;
-					$sql .= ", " . $conf->entity;
-					$sql .= ", '" . $this->db->escape($this->code_compta_client)."'";
-					$sql .= ", '" . $this->db->escape($this->code_compta_fournisseur)."'";
-					$sql .= ", '" . $this->db->escape($this->accountancy_code_buy) . "'";
-					$sql .= ", '" . $this->db->escape($this->accountancy_code_sell) . "'";
+					$sql .= ", ".$conf->entity;
+					$sql .= ", '".$this->db->escape($this->code_compta_client)."'";
+					$sql .= ", '".$this->db->escape($this->code_compta_fournisseur)."'";
+					$sql .= ", '".$this->db->escape($this->accountancy_code_buy)."'";
+					$sql .= ", '".$this->db->escape($this->accountancy_code_sell)."'";
 					$sql .= ")";
 					$result = $this->db->query($sql);
 					if (!$result) {
@@ -1702,7 +1702,7 @@ class Societe extends CommonObject
 		}
 		$sql .= ' FROM '.MAIN_DB_PREFIX.'societe as s';
 		if (!empty($conf->global->MAIN_COMPANY_PERENTITY_SHARED)) {
-			$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "societe_perentity as spe ON spe.fk_soc = s.rowid AND spe.entity = " . ((int) $conf->entity);
+			$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_perentity as spe ON spe.fk_soc = s.rowid AND spe.entity = ".((int) $conf->entity);
 		}
 		$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_effectif as e ON s.fk_effectif = e.id';
 		$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as c ON s.fk_pays = c.rowid';
@@ -1792,7 +1792,7 @@ class Societe extends CommonObject
 				$this->state_id     = $obj->state_id;
 				$this->state_code   = $obj->state_code;
 				$this->region_id    = $obj->region_id;
-				$this->region_code   = $obj->region_code;
+				$this->region_code = $obj->region_code;
 				$this->state        = ($obj->state != '-' ? $obj->state : '');
 
 				$transcode = $langs->trans('StatusProspect'.$obj->fk_stcomm);
@@ -2630,7 +2630,7 @@ class Societe extends CommonObject
 			$label .= '<br>'.implode('&nbsp;', $phonelist);
 		}
 		if (!empty($this->address)) {
-			$label .= '<br><b>'.$langs->trans("Address").':</b> '.dol_format_address($this, 1, ' ', $langs);	// Address + country
+			$label .= '<br><b>'.$langs->trans("Address").':</b> '.dol_format_address($this, 1, ' ', $langs); // Address + country
 		} elseif (!empty($this->country_code)) {
 			$label .= '<br><b>'.$langs->trans('Country').':</b> '.$this->country_code;
 		}
@@ -3350,7 +3350,7 @@ class Societe extends CommonObject
 
 				if ($type == 'customer') {
 					$this->code_compta_client = $mod->code;
-					$this->code_compta = $this->code_compta_client;		// For backward compatibility
+					$this->code_compta = $this->code_compta_client; // For backward compatibility
 				} elseif ($type == 'supplier') {
 					$this->code_compta_fournisseur = $mod->code;
 				}
@@ -3385,7 +3385,7 @@ class Societe extends CommonObject
 		if ($this->id) {
 			// Check if the id we want to add as parent has not already one parent that is the current id we try to update
 			if ($id > 0) {
-				$sameparent	= $this->validateFamilyTree($id, $this->id, 0);
+				$sameparent = $this->validateFamilyTree($id, $this->id, 0);
 				if ($sameparent < 0) {
 					return -1;
 				}
@@ -3397,7 +3397,7 @@ class Societe extends CommonObject
 
 			$sql = 'UPDATE '.MAIN_DB_PREFIX.'societe SET parent = '.($id > 0 ? $id : 'null').' WHERE rowid = '.((int) $this->id);
 
-			$resql	= $this->db->query($sql);
+			$resql = $this->db->query($sql);
 			if ($resql) {
 				$this->parent = $id;
 				return 1;
@@ -3426,16 +3426,16 @@ class Societe extends CommonObject
 		$sql = 'SELECT s.parent';
 		$sql .= ' FROM '.MAIN_DB_PREFIX.'societe as s';
 		$sql .= ' WHERE rowid = '.((int) $idparent);
-		$resql	= $this->db->query($sql);
+		$resql = $this->db->query($sql);
 		if ($resql) {
 			$obj	= $this->db->fetch_object($resql);
 
-			if ($obj->parent == '')	{
+			if ($obj->parent == '') {
 				return 0;
-			} elseif ($obj->parent == $idchild)	{
+			} elseif ($obj->parent == $idchild) {
 				return 1;
 			} else {
-				$sameparent	= $this->validateFamilyTree($obj->parent, $idchild, ($counter + 1));
+				$sameparent = $this->validateFamilyTree($obj->parent, $idchild, ($counter + 1));
 			}
 			return $sameparent;
 		} else {
@@ -3936,7 +3936,7 @@ class Societe extends CommonObject
 	 */
 	public function create_from_member(Adherent $member, $socname = '', $socalias = '', $customercode = '')
 	{
-        // phpcs:enable
+		// phpcs:enable
 		global $conf, $user, $langs;
 
 		dol_syslog(get_class($this)."::create_from_member", LOG_DEBUG);
@@ -4819,19 +4819,19 @@ class Societe extends CommonObject
 		}
 
 		$sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element." SET ";
-		$sql.= $field." = '".$this->db->escape($value)."'";
-		$sql.= " WHERE rowid = ".((int) $this->id);
+		$sql .= $field." = '".$this->db->escape($value)."'";
+		$sql .= " WHERE rowid = ".((int) $this->id);
 
 		dol_syslog(get_class($this)."::".__FUNCTION__."", LOG_DEBUG);
 		$resql = $this->db->query($sql);
 
 		if ($resql) {
 			// Call triggers
-			include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
-			$interface=new Interfaces($this->db);
-			$result=$interface->run_triggers('COMPANY_MODIFY', $this, $user, $langs, $conf);
+			include_once DOL_DOCUMENT_ROOT.'/core/class/interfaces.class.php';
+			$interface = new Interfaces($this->db);
+			$result = $interface->run_triggers('COMPANY_MODIFY', $this, $user, $langs, $conf);
 			if ($result < 0) {
-				$this->errors=$interface->errors;
+				$this->errors = $interface->errors;
 				$this->db->rollback();
 				return -1;
 			}
@@ -4842,7 +4842,7 @@ class Societe extends CommonObject
 			$this->db->commit();
 			return 1;
 		} else {
-			$this->error=$this->db->lasterror();
+			$this->error = $this->db->lasterror();
 			$this->db->rollback();
 			return -1;
 		}

+ 1 - 1
htdocs/societe/price.php

@@ -374,7 +374,7 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) {
 
 			// Ref. Customer
 			print '<tr><td>'.$langs->trans('RefCustomer').'</td>';
-			print '<td><input name="ref_customer" size="12" value="' . dol_escape_htmltag($prodcustprice->ref_customer) . '"></td></tr>';
+			print '<td><input name="ref_customer" size="12" value="'.dol_escape_htmltag($prodcustprice->ref_customer).'"></td></tr>';
 
 			// VAT
 			print '<tr><td>'.$langs->trans("VATRate").'</td><td>';

+ 4 - 2
htdocs/supplier_proposal/class/supplier_proposal.class.php

@@ -1019,7 +1019,7 @@ class SupplierProposal extends CommonObject
 							$fk_parent_line,
 							$this->lines[$i]->fk_fournprice,
 							$this->lines[$i]->pa_ht,
-							empty($this->lines[$i]->label) ? '' : $this->lines[$i]->label,		// deprecated
+							empty($this->lines[$i]->label) ? '' : $this->lines[$i]->label, // deprecated
 							$this->lines[$i]->array_options,
 							$this->lines[$i]->ref_fourn,
 							$this->lines[$i]->fk_unit,
@@ -1405,7 +1405,9 @@ class SupplierProposal extends CommonObject
 			$soc = new Societe($this->db);
 			$result = $soc->fetch($this->socid);
 
-			if ($result < 0) return -1;
+			if ($result < 0) {
+				return -1;
+			}
 
 			// Define new ref
 			if (preg_match('/^[\(]?PROV/i', $this->ref) || empty($this->ref)) { // empty should not happened, but when it occurs, the test save life

+ 9 - 9
htdocs/theme/eldy/manifest.json.php

@@ -64,7 +64,7 @@ top_httphead('text/json');
 if (empty($dolibarr_nocache)) {
 	header('Cache-Control: max-age=10800, public, must-revalidate');
 	// For a text/json, we must set an Expires to avoid to have it forced to an expired value by the web server
-	header('Expires: '.gmdate('D, d M Y H:i:s', dol_now('gmt') + 10800) . ' GMT');
+	header('Expires: '.gmdate('D, d M Y H:i:s', dol_now('gmt') + 10800).' GMT');
 } else {
 	header('Cache-Control: no-cache');
 }
@@ -79,8 +79,8 @@ if (!empty($conf->global->MAIN_APPLICATION_TITLE)) {
 }
 
 
-$manifest->theme_color = !empty($conf->global->MAIN_MANIFEST_APPLI_THEME_COLOR)?$conf->global->MAIN_MANIFEST_APPLI_THEME_COLOR:'#F05F40';
-$manifest->background_color = !empty($conf->global->MAIN_MANIFEST_APPLI_BG_COLOR)?$conf->global->MAIN_MANIFEST_APPLI_BG_COLOR:"#ffffff";
+$manifest->theme_color = !empty($conf->global->MAIN_MANIFEST_APPLI_THEME_COLOR) ? $conf->global->MAIN_MANIFEST_APPLI_THEME_COLOR : '#F05F40';
+$manifest->background_color = !empty($conf->global->MAIN_MANIFEST_APPLI_BG_COLOR) ? $conf->global->MAIN_MANIFEST_APPLI_BG_COLOR : "#ffffff";
 $manifest->display = "standalone";
 $manifest->splash_pages = null;
 $manifest->icons = array();
@@ -97,8 +97,8 @@ if (!empty($conf->global->MAIN_MANIFEST_APPLI_LOGO_URL)) {
 	$manifest->icons[] = $icon;
 } elseif (!empty($conf->global->MAIN_INFO_SOCIETE_LOGO_SQUARRED)) {
 	if (!empty($conf->global->MAIN_INFO_SOCIETE_LOGO_SQUARRED_MINI)) {
-		$iconRelativePath 	= 'logos/thumbs/'.$conf->global->MAIN_INFO_SOCIETE_LOGO_SQUARRED_MINI;
-		$iconPath 	= $conf->mycompany->dir_output.'/'.$iconRelativePath;
+		$iconRelativePath = 'logos/thumbs/'.$conf->global->MAIN_INFO_SOCIETE_LOGO_SQUARRED_MINI;
+		$iconPath = $conf->mycompany->dir_output.'/'.$iconRelativePath;
 		if (is_readable($iconPath)) {
 			$imgSize = getimagesize($iconPath);
 			if ($imgSize) {
@@ -112,8 +112,8 @@ if (!empty($conf->global->MAIN_MANIFEST_APPLI_LOGO_URL)) {
 	}
 
 	if (!empty($conf->global->MAIN_INFO_SOCIETE_LOGO_SQUARRED_SMALL)) {
-		$iconRelativePath 	= 'logos/thumbs/'.$conf->global->MAIN_INFO_SOCIETE_LOGO_SQUARRED_SMALL;
-		$iconPath 	= $conf->mycompany->dir_output.'/'.$iconRelativePath;
+		$iconRelativePath = 'logos/thumbs/'.$conf->global->MAIN_INFO_SOCIETE_LOGO_SQUARRED_SMALL;
+		$iconPath = $conf->mycompany->dir_output.'/'.$iconRelativePath;
 		if (is_readable($iconPath)) {
 			$imgSize = getimagesize($iconPath);
 			if ($imgSize) {
@@ -127,8 +127,8 @@ if (!empty($conf->global->MAIN_MANIFEST_APPLI_LOGO_URL)) {
 	}
 
 	if (!empty($conf->global->MAIN_INFO_SOCIETE_LOGO_SQUARRED)) {
-		$iconRelativePath 	= 'logos/'.$conf->global->MAIN_INFO_SOCIETE_LOGO_SQUARRED;
-		$iconPath 	= $conf->mycompany->dir_output.'/'.$iconRelativePath;
+		$iconRelativePath = 'logos/'.$conf->global->MAIN_INFO_SOCIETE_LOGO_SQUARRED;
+		$iconPath = $conf->mycompany->dir_output.'/'.$iconRelativePath;
 		if (is_readable($iconPath)) {
 			$imgSize = getimagesize($iconPath);
 			if ($imgSize) {

+ 1 - 1
htdocs/theme/md/manifest.json.php

@@ -71,7 +71,7 @@ top_httphead('text/json');
 if (empty($dolibarr_nocache)) {
 	header('Cache-Control: max-age=10800, public, must-revalidate');
 	// For a text/json, we must set an Expires to avoid to have it forced to an expired value by the web server
-	header('Expires: '.gmdate('D, d M Y H:i:s', dol_now('gmt') + 10800) . ' GMT');
+	header('Expires: '.gmdate('D, d M Y H:i:s', dol_now('gmt') + 10800).' GMT');
 } else {
 	header('Cache-Control: no-cache');
 }

+ 40 - 40
htdocs/user/home.php

@@ -137,11 +137,11 @@ $resql = $db->query($sql);
 if ($resql) {
 	$num = $db->num_rows($resql);
 
-	$lastcreatedbox .='<div class="div-table-responsive-no-min">';
-	$lastcreatedbox .='<table class="noborder centpercent">';
-	$lastcreatedbox .='<tr class="liste_titre"><td colspan="3">'.$langs->trans("LastUsersCreated", min($num, $max)).'</td>';
-	$lastcreatedbox .='<td class="right" colspan="2"><a class="commonlink" href="'.DOL_URL_ROOT.'/user/list.php?sortfield=u.datec&sortorder=DESC">'.$langs->trans("FullList").'</td>';
-	$lastcreatedbox .='</tr>'."\n";
+	$lastcreatedbox .= '<div class="div-table-responsive-no-min">';
+	$lastcreatedbox .= '<table class="noborder centpercent">';
+	$lastcreatedbox .= '<tr class="liste_titre"><td colspan="3">'.$langs->trans("LastUsersCreated", min($num, $max)).'</td>';
+	$lastcreatedbox .= '<td class="right" colspan="2"><a class="commonlink" href="'.DOL_URL_ROOT.'/user/list.php?sortfield=u.datec&sortorder=DESC">'.$langs->trans("FullList").'</td>';
+	$lastcreatedbox .= '</tr>'."\n";
 	$i = 0;
 
 	while ($i < $num && $i < $max) {
@@ -162,24 +162,24 @@ if ($resql) {
 		$companystatic->code_client = $obj->code_client;
 		$companystatic->canvas = $obj->canvas;
 
-		$lastcreatedbox .='<tr class="oddeven">';
-		$lastcreatedbox .='<td class="nowraponall">';
-		$lastcreatedbox .=$fuserstatic->getNomUrl(-1);
+		$lastcreatedbox .= '<tr class="oddeven">';
+		$lastcreatedbox .= '<td class="nowraponall">';
+		$lastcreatedbox .= $fuserstatic->getNomUrl(-1);
 		if (!empty($conf->multicompany->enabled) && $obj->admin && !$obj->entity) {
-			$lastcreatedbox .=img_picto($langs->trans("SuperAdministrator"), 'redstar');
+			$lastcreatedbox .= img_picto($langs->trans("SuperAdministrator"), 'redstar');
 		} elseif ($obj->admin) {
-			$lastcreatedbox .=img_picto($langs->trans("Administrator"), 'star');
+			$lastcreatedbox .= img_picto($langs->trans("Administrator"), 'star');
 		}
-		$lastcreatedbox .="</td>";
-		$lastcreatedbox .='<td>'.$obj->login.'</td>';
-		$lastcreatedbox .="<td>";
+		$lastcreatedbox .= "</td>";
+		$lastcreatedbox .= '<td>'.$obj->login.'</td>';
+		$lastcreatedbox .= "<td>";
 		if ($obj->fk_soc) {
-			$lastcreatedbox .=$companystatic->getNomUrl(1);
+			$lastcreatedbox .= $companystatic->getNomUrl(1);
 		} else {
-			$lastcreatedbox .=$langs->trans("InternalUser");
+			$lastcreatedbox .= $langs->trans("InternalUser");
 		}
 		if ($obj->ldap_sid) {
-			$lastcreatedbox .=' ('.$langs->trans("DomainUser").')';
+			$lastcreatedbox .= ' ('.$langs->trans("DomainUser").')';
 		}
 
 		$entity = $obj->entity;
@@ -193,19 +193,19 @@ if ($resql) {
 				$entitystring = $mc->label;
 			}
 		}
-		$lastcreatedbox .=($entitystring ? ' ('.$entitystring.')' : '');
+		$lastcreatedbox .= ($entitystring ? ' ('.$entitystring.')' : '');
 
-		$lastcreatedbox .='</td>';
-		$lastcreatedbox .='<td class="center nowrap">'.dol_print_date($db->jdate($obj->datec), 'dayhour').'</td>';
-		$lastcreatedbox .='<td class="right">';
-		$lastcreatedbox .=$fuserstatic->getLibStatut(3);
-		$lastcreatedbox .='</td>';
+		$lastcreatedbox .= '</td>';
+		$lastcreatedbox .= '<td class="center nowrap">'.dol_print_date($db->jdate($obj->datec), 'dayhour').'</td>';
+		$lastcreatedbox .= '<td class="right">';
+		$lastcreatedbox .= $fuserstatic->getLibStatut(3);
+		$lastcreatedbox .= '</td>';
 
-		$lastcreatedbox .='</tr>';
+		$lastcreatedbox .= '</tr>';
 		$i++;
 	}
-	$lastcreatedbox .="</table>";
-	$lastcreatedbox .="</div><br>";
+	$lastcreatedbox .= "</table>";
+	$lastcreatedbox .= "</div><br>";
 
 	$db->free($resql);
 } else {
@@ -238,11 +238,11 @@ if ($canreadperms) {
 		}
 		$num = $db->num_rows($resql);
 
-		$lastgroupbox .='<div class="div-table-responsive-no-min">';
-		$lastgroupbox .='<table class="noborder centpercent">';
-		$lastgroupbox .='<tr class="liste_titre"><td colspan="'.$colspan.'">'.$langs->trans("LastGroupsCreated", ($num ? $num : $max)).'</td>';
-		$lastgroupbox .='<td class="right"><a class="commonlink" href="'.DOL_URL_ROOT.'/user/group/list.php?sortfield=g.datec&sortorder=DESC">'.$langs->trans("FullList").'</td>';
-		$lastgroupbox .='</tr>';
+		$lastgroupbox .= '<div class="div-table-responsive-no-min">';
+		$lastgroupbox .= '<table class="noborder centpercent">';
+		$lastgroupbox .= '<tr class="liste_titre"><td colspan="'.$colspan.'">'.$langs->trans("LastGroupsCreated", ($num ? $num : $max)).'</td>';
+		$lastgroupbox .= '<td class="right"><a class="commonlink" href="'.DOL_URL_ROOT.'/user/group/list.php?sortfield=g.datec&sortorder=DESC">'.$langs->trans("FullList").'</td>';
+		$lastgroupbox .= '</tr>';
 		$i = 0;
 
 		$grouptemp = new UserGroup($db);
@@ -254,21 +254,21 @@ if ($canreadperms) {
 			$grouptemp->name = $obj->name;
 			$grouptemp->note = $obj->note;
 
-			$lastgroupbox .='<tr class="oddeven">';
-			$lastgroupbox .='<td>';
-			$lastgroupbox .=$grouptemp->getNomUrl(1);
+			$lastgroupbox .= '<tr class="oddeven">';
+			$lastgroupbox .= '<td>';
+			$lastgroupbox .= $grouptemp->getNomUrl(1);
 			if (!$obj->entity) {
-				$lastgroupbox .=img_picto($langs->trans("GlobalGroup"), 'redstar');
+				$lastgroupbox .= img_picto($langs->trans("GlobalGroup"), 'redstar');
 			}
-			$lastgroupbox .="</td>";
+			$lastgroupbox .= "</td>";
 			if (!empty($conf->multicompany->enabled) && is_object($mc)) {
 				$mc->getInfo($obj->entity);
-				$lastgroupbox .='<td>';
-				$lastgroupbox .=$mc->label;
-				$lastgroupbox .='</td>';
+				$lastgroupbox .= '<td>';
+				$lastgroupbox .= $mc->label;
+				$lastgroupbox .= '</td>';
 			}
-			$lastgroupbox .='<td class="nowrap right">'.dol_print_date($db->jdate($obj->datec), 'dayhour').'</td>';
-			$lastgroupbox .="</tr>";
+			$lastgroupbox .= '<td class="nowrap right">'.dol_print_date($db->jdate($obj->datec), 'dayhour').'</td>';
+			$lastgroupbox .= "</tr>";
 			$i++;
 		}
 		$lastgroupbox .= "</table>";

+ 1 - 1
htdocs/webservices/server_productorservice.php

@@ -527,7 +527,7 @@ function createProductOrService($authentication, $product)
 		$newobject->label = empty($product['label']) ? '' : $product['label'];
 		$newobject->description = empty($product['description']) ? '' : $product['description'];
 		$newobject->note_public = empty($product['note_public']) ? '' : $product['note_public'];
-		$newobject->note_private = empty($product['note_private']) ? '' :$product['note_private'];
+		$newobject->note_private = empty($product['note_private']) ? '' : $product['note_private'];
 		$newobject->status = empty($product['status_tosell']) ? 0 : $product['status_tosell'];
 		$newobject->status_buy = empty($product['status_tobuy']) ? 0 : $product['status_tobuy'];
 		$newobject->price = isset($product['price_net']) ? $product['price_net'] : 0;

+ 2 - 2
htdocs/workstation/class/workstationresource.class.php

@@ -38,8 +38,8 @@ class WorkstationResource extends CommonObject
 	 * @var array  Array with all fields and their property. Do not use it as a static var. It may be modified by constructor.
 	 */
 	public $fields = array(
-		'fk_workstation' => array ('type' => 'integer'),
-		'fk_resource' => array ('type' => 'integer')
+		'fk_workstation' => array('type' => 'integer'),
+		'fk_resource' => array('type' => 'integer')
 	);
 
 	/**

+ 2 - 2
htdocs/workstation/class/workstationusergroup.class.php

@@ -37,8 +37,8 @@ class WorkstationUserGroup extends CommonObject
 	 * @var array  Array with all fields and their property. Do not use it as a static var. It may be modified by constructor.
 	 */
 	public $fields = array(
-		'fk_workstation' => array ('type' => 'integer'),
-		'fk_usergroup' => array ('type' => 'integer')
+		'fk_workstation' => array('type' => 'integer'),
+		'fk_usergroup' => array('type' => 'integer')
 	);
 
 	/**

+ 1 - 1
htdocs/workstation/lib/workstation.lib.php

@@ -34,7 +34,7 @@ function workstationAdminPrepareHead()
 
 	$h = 0;
 	$head = array();
-	$head[$h][0] = DOL_URL_ROOT . "/admin/workstation.php";
+	$head[$h][0] = DOL_URL_ROOT."/admin/workstation.php";
 	$head[$h][1] = $langs->trans("Settings");
 	$head[$h][2] = 'settings';
 	$h++;