Completed
Branch develop (b41ef2)
by
unknown
24:57
created
htdocs/fourn/facture/card.php 1 patch
Spacing   +51 added lines, -51 removed lines patch added patch discarded remove patch
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
 	// Action clone object
200 200
 	if ($action == 'confirm_clone' && $confirm == 'yes' && $permissiontoadd) {
201 201
 		$objectutil = dol_clone($object, 1); // To avoid to denaturate loaded object when setting some properties for clone. We use native clone to keep this->db valid.
202
-		'@phan-var-force FactureFournisseur $objectutil';  // Same object type for cloned object
202
+		'@phan-var-force FactureFournisseur $objectutil'; // Same object type for cloned object
203 203
 
204 204
 		if (GETPOST('newsupplierref', 'alphanohtml')) {
205 205
 			$objectutil->ref_supplier = GETPOST('newsupplierref', 'alphanohtml');
@@ -784,7 +784,7 @@  discard block
 block discarded – undo
784 784
 		$db->begin();
785 785
 
786 786
 		$error = 0;
787
-		$tmpproject = 0;  // Ensure a value
787
+		$tmpproject = 0; // Ensure a value
788 788
 
789 789
 		// Fill array 'array_options' with data from add form
790 790
 		$ret = $extrafields->setOptionalsFromPost(null, $object);
@@ -792,7 +792,7 @@  discard block
 block discarded – undo
792 792
 			$error++;
793 793
 		}
794 794
 
795
-		$dateinvoice = dol_mktime(0, 0, 0, GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear'), 'tzserver');	// If we enter the 02 january, we need to save the 02 january for server
795
+		$dateinvoice = dol_mktime(0, 0, 0, GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear'), 'tzserver'); // If we enter the 02 january, we need to save the 02 january for server
796 796
 		$datedue = dol_mktime(0, 0, 0, GETPOSTINT('echmonth'), GETPOSTINT('echday'), GETPOSTINT('echyear'), 'tzserver');
797 797
 		//var_dump($dateinvoice.' '.dol_print_date($dateinvoice, 'dayhour'));
798 798
 		//var_dump(dol_now('tzuserrel').' '.dol_get_last_hour(dol_now('tzuserrel')).' '.dol_print_date(dol_now('tzuserrel'),'dayhour').' '.dol_print_date(dol_get_last_hour(dol_now('tzuserrel')), 'dayhour'));
@@ -831,7 +831,7 @@  discard block
 block discarded – undo
831 831
 				$object->ref_supplier = GETPOST('ref_supplier', 'alpha');
832 832
 				$object->socid = GETPOSTINT('socid');
833 833
 				$object->label = GETPOST('label', 'alphanohtml');
834
-				$object->libelle = $object->label;	// deprecated
834
+				$object->libelle = $object->label; // deprecated
835 835
 				$object->date = $dateinvoice;
836 836
 				$object->date_echeance = $datedue;
837 837
 				$object->note_public = GETPOST('note_public', 'restricthtml');
@@ -905,7 +905,7 @@  discard block
 block discarded – undo
905 905
 				$object->subtype            = GETPOST('subtype', 'alphanohtml');
906 906
 				$object->socid				= GETPOSTINT('socid');
907 907
 				$object->label				= GETPOST('label', 'alphanohtml');
908
-				$object->libelle            = $object->label;  // Deprecated
908
+				$object->libelle            = $object->label; // Deprecated
909 909
 				$object->date               = $dateinvoice;
910 910
 				$object->date_echeance      = $datedue;
911 911
 				$object->note_public        = GETPOST('note_public', 'restricthtml');
@@ -1015,7 +1015,7 @@  discard block
 block discarded – undo
1015 1015
 				$object->cond_reglement_id	= (GETPOSTINT('type') == 3 ? 1 : GETPOST('cond_reglement_id'));
1016 1016
 				$object->mode_reglement_id	= GETPOSTINT('mode_reglement_id');
1017 1017
 				$object->fk_account         = GETPOSTINT('fk_account');
1018
-				$object->amount             = (float) price2num(GETPOST('amount'));  // FIXME: FactureFournisseur::$amount is deprecated and not used?
1018
+				$object->amount             = (float) price2num(GETPOST('amount')); // FIXME: FactureFournisseur::$amount is deprecated and not used?
1019 1019
 				//$object->remise_absolue		= price2num(GETPOST('remise_absolue'), 'MU');
1020 1020
 				//$object->remise_percent		= price2num(GETPOST('remise_percent'), '', 2);
1021 1021
 				$object->fk_incoterms       = GETPOSTINT('incoterm_id');
@@ -1068,28 +1068,28 @@  discard block
 block discarded – undo
1068 1068
 				$tmpproject = GETPOSTINT('projectid');
1069 1069
 
1070 1070
 				// Creation invoice
1071
-				$object->socid				= GETPOSTINT('socid');
1072
-				$object->type				= GETPOST('type', 'alphanohtml');
1073
-				$object->subtype            = GETPOSTINT('subtype');
1074
-				$object->ref				= GETPOST('ref', 'alphanohtml');
1075
-				$object->ref_supplier		= GETPOST('ref_supplier', 'alphanohtml');
1071
+				$object->socid = GETPOSTINT('socid');
1072
+				$object->type = GETPOST('type', 'alphanohtml');
1073
+				$object->subtype = GETPOSTINT('subtype');
1074
+				$object->ref = GETPOST('ref', 'alphanohtml');
1075
+				$object->ref_supplier = GETPOST('ref_supplier', 'alphanohtml');
1076 1076
 				$object->socid				= GETPOSTINT('socid');
1077 1077
 				$object->label				= GETPOST('label', 'alphanohtml');
1078
-				$object->libelle			= $object->label;	// deprecated
1079
-				$object->date				= $dateinvoice;
1080
-				$object->date_echeance		= $datedue;
1081
-				$object->note_public		= GETPOST('note_public', 'restricthtml');
1082
-				$object->note_private		= GETPOST('note_private', 'restricthtml');
1078
+				$object->libelle = $object->label; // deprecated
1079
+				$object->date = $dateinvoice;
1080
+				$object->date_echeance = $datedue;
1081
+				$object->note_public = GETPOST('note_public', 'restricthtml');
1082
+				$object->note_private = GETPOST('note_private', 'restricthtml');
1083 1083
 				$object->cond_reglement_id	= GETPOST('cond_reglement_id');
1084 1084
 				$object->mode_reglement_id	= GETPOST('mode_reglement_id');
1085 1085
 				$object->fk_account			= GETPOSTINT('fk_account');
1086 1086
 				$object->vat_reverse_charge	= GETPOST('vat_reverse_charge') == 'on' ? 1 : 0;
1087 1087
 				$object->fk_project			= ($tmpproject > 0) ? $tmpproject : null;
1088
-				$object->fk_incoterms		= GETPOSTINT('incoterm_id');
1088
+				$object->fk_incoterms = GETPOSTINT('incoterm_id');
1089 1089
 				$object->location_incoterms	= GETPOST('location_incoterms', 'alpha');
1090 1090
 				$object->multicurrency_code	= GETPOST('multicurrency_code', 'alpha');
1091
-				$object->multicurrency_tx	= GETPOSTINT('originmulticurrency_tx');
1092
-				$object->transport_mode_id	= GETPOSTINT('transport_mode_id');
1091
+				$object->multicurrency_tx = GETPOSTINT('originmulticurrency_tx');
1092
+				$object->transport_mode_id = GETPOSTINT('transport_mode_id');
1093 1093
 
1094 1094
 				// Auto calculation of date due if not filled by user
1095 1095
 				if (empty($object->date_echeance)) {
@@ -1301,7 +1301,7 @@  discard block
 block discarded – undo
1301 1301
 									0,
1302 1302
 									$object->lines[0]->date_start,
1303 1303
 									$object->lines[0]->date_end,
1304
-									array(),  // array_options
1304
+									array(), // array_options
1305 1305
 									0,
1306 1306
 									0,
1307 1307
 									'',
@@ -1438,7 +1438,7 @@  discard block
 block discarded – undo
1438 1438
 		// Edit line
1439 1439
 		$db->begin();
1440 1440
 
1441
-		if (! $object->fetch($id) > 0) {
1441
+		if (!$object->fetch($id) > 0) {
1442 1442
 			dol_print_error($db);
1443 1443
 		}
1444 1444
 		$object->fetch_thirdparty();
@@ -1591,7 +1591,7 @@  discard block
 block discarded – undo
1591 1591
 			$idprod = GETPOSTINT('idprod');
1592 1592
 		}
1593 1593
 
1594
-		$tva_tx = (GETPOST('tva_tx') ? GETPOST('tva_tx') : 0);		// Can be '1.2' or '1.2 (CODE)'
1594
+		$tva_tx = (GETPOST('tva_tx') ? GETPOST('tva_tx') : 0); // Can be '1.2' or '1.2 (CODE)'
1595 1595
 
1596 1596
 		$price_ht = price2num(GETPOST('price_ht'), 'MU', 2);
1597 1597
 		$price_ht_devise = price2num(GETPOST('multicurrency_price_ht'), 'CU', 2);
@@ -1721,7 +1721,7 @@  discard block
 block discarded – undo
1721 1721
 
1722 1722
 				// Get vat rate
1723 1723
 				if (!GETPOSTISSET('tva_tx')) {	// If vat rate not provided from the form (the form has the priority)
1724
-					$tmpidprodfournprice = GETPOST('idprodfournprice', 'alpha');	// can be an id of price, or -1, -2, -99 or 'idprod_...'
1724
+					$tmpidprodfournprice = GETPOST('idprodfournprice', 'alpha'); // can be an id of price, or -1, -2, -99 or 'idprod_...'
1725 1725
 					if (is_numeric($tmpidprodfournprice) && (int) $tmpidprodfournprice > 0) {
1726 1726
 						$tmpidprodfournprice = (int) $tmpidprodfournprice;
1727 1727
 					} else {
@@ -2093,7 +2093,7 @@  discard block
 block discarded – undo
2093 2093
 // Mode creation
2094 2094
 if ($action == 'create') {
2095 2095
 	$facturestatic = new FactureFournisseur($db);
2096
-	$selectedLines = array();  // Ensure initialised
2096
+	$selectedLines = array(); // Ensure initialised
2097 2097
 
2098 2098
 	print load_fiche_titre($langs->trans('NewSupplierInvoice'), '', 'supplier_invoice');
2099 2099
 
@@ -2287,7 +2287,7 @@  discard block
 block discarded – undo
2287 2287
 	print '<form name="add" action="'.$_SERVER["PHP_SELF"].'" method="post">';
2288 2288
 	print '<input type="hidden" name="token" value="'.newToken().'">';
2289 2289
 	print '<input type="hidden" name="action" value="add">';
2290
-	print '<input type="hidden" name="changecompany" value="0">';	// will be set to 1 by javascript so we know post is done after a company change
2290
+	print '<input type="hidden" name="changecompany" value="0">'; // will be set to 1 by javascript so we know post is done after a company change
2291 2291
 
2292 2292
 	if (!empty($societe->id) && $societe->id > 0) {
2293 2293
 		print '<input type="hidden" name="socid" value="'.$societe->id.'">'."\n";
@@ -2371,7 +2371,7 @@  discard block
 block discarded – undo
2371 2371
 
2372 2372
 			$sql = 'SELECT r.rowid, r.titre as title, r.total_ttc';
2373 2373
 			$sql .= ' FROM '.MAIN_DB_PREFIX.'facture_fourn_rec as r';
2374
-			$sql .= ' WHERE r.fk_soc = '. (int) $invoice_predefined->socid;
2374
+			$sql .= ' WHERE r.fk_soc = '.(int) $invoice_predefined->socid;
2375 2375
 
2376 2376
 			$resql = $db->query($sql);
2377 2377
 			if ($resql) {
@@ -2438,7 +2438,7 @@  discard block
 block discarded – undo
2438 2438
 			// Deposit - Down payment
2439 2439
 			if (!getDolGlobalString('INVOICE_DISABLE_DEPOSIT')) {
2440 2440
 				print '<div class="tagtr listofinvoicetype"><div class="tagtd listofinvoicetype">';
2441
-				$tmp = '<input type="radio" id="radio_deposit" name="type" value="3"' . (GETPOSTINT('type') == 3 ? ' checked' : '') . '> ';
2441
+				$tmp = '<input type="radio" id="radio_deposit" name="type" value="3"'.(GETPOSTINT('type') == 3 ? ' checked' : '').'> ';
2442 2442
 				print '<script type="text/javascript">
2443 2443
 				jQuery(document).ready(function() {
2444 2444
 					jQuery("#typestandardinvoice, #valuestandardinvoice").click(function() {
@@ -2485,7 +2485,7 @@  discard block
 block discarded – undo
2485 2485
 					print $form->selectarray('typedeposit', $arraylist, GETPOST('typedeposit', 'aZ09'), 0, 0, 0, '', 1);
2486 2486
 					print '</td>';
2487 2487
 					print '<td class="nowrap" style="padding-left: 5px">';
2488
-					print '<span class="opacitymedium paddingleft">'.$langs->trans("AmountOrPercent").'</span><input type="text" id="valuedeposit" name="valuedeposit" class="width75 right" value="' . GETPOSTINT('valuedeposit') . '"/>';
2488
+					print '<span class="opacitymedium paddingleft">'.$langs->trans("AmountOrPercent").'</span><input type="text" id="valuedeposit" name="valuedeposit" class="width75 right" value="'.GETPOSTINT('valuedeposit').'"/>';
2489 2489
 					print '</td>';
2490 2490
 				}
2491 2491
 				print '</tr></table>';
@@ -2735,8 +2735,8 @@  discard block
 block discarded – undo
2735 2735
 
2736 2736
 		// Vat reverse-charge by default
2737 2737
 		if (getDolGlobalString('ACCOUNTING_FORCE_ENABLE_VAT_REVERSE_CHARGE')) {
2738
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php';
2739
-			print '<tr><td>' . $langs->trans('VATReverseCharge') . '</td><td>';
2738
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
2739
+			print '<tr><td>'.$langs->trans('VATReverseCharge').'</td><td>';
2740 2740
 			// Try to propose to use VAT reverse charge even if the VAT reverse charge is not activated in the supplier card, if this corresponds to the context of use, the activation is proposed
2741 2741
 			if (GETPOSTISSET('vat_reverse_charge')) {  // Check if form was submitted previously
2742 2742
 				$vat_reverse_charge = (GETPOST('vat_reverse_charge', 'alpha') == 'on' || GETPOST('vat_reverse_charge', 'alpha') == '1') ? 1 : 0;
@@ -2746,7 +2746,7 @@  discard block
 block discarded – undo
2746 2746
 				$vat_reverse_charge = 0;
2747 2747
 			}
2748 2748
 
2749
-			print '<input type="checkbox" name="vat_reverse_charge"'. (!empty($vat_reverse_charge) ? ' checked ' : '') . '>';
2749
+			print '<input type="checkbox" name="vat_reverse_charge"'.(!empty($vat_reverse_charge) ? ' checked ' : '').'>';
2750 2750
 			print '</td></tr>';
2751 2751
 		}
2752 2752
 
@@ -3313,7 +3313,7 @@  discard block
 block discarded – undo
3313 3313
 					$facavoir->fetch($id);
3314 3314
 					$invoicecredits[] = $facavoir->getNomUrl(1);
3315 3315
 				}
3316
-				print ' <span class="opacitymediumbycolor paddingleft">'.$langs->transnoentities("InvoiceHasAvoir") . (count($invoicecredits) ? ' ' : '') . implode(',', $invoicecredits);
3316
+				print ' <span class="opacitymediumbycolor paddingleft">'.$langs->transnoentities("InvoiceHasAvoir").(count($invoicecredits) ? ' ' : '').implode(',', $invoicecredits);
3317 3317
 				print '</span>';
3318 3318
 			}
3319 3319
 			if (isset($objectidnext) && $objectidnext > 0) {
@@ -3460,12 +3460,12 @@  discard block
 block discarded – undo
3460 3460
 					print '<input type="hidden" name="action" value="setvatreversecharge">';
3461 3461
 					print '<input type="hidden" name="token" value="'.newToken().'">';
3462 3462
 
3463
-					print '<input type="checkbox" name="vat_reverse_charge"' . ($object->vat_reverse_charge == '1' ? ' checked ' : '') . '>';
3463
+					print '<input type="checkbox" name="vat_reverse_charge"'.($object->vat_reverse_charge == '1' ? ' checked ' : '').'>';
3464 3464
 
3465 3465
 					print '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
3466 3466
 					print '</form>';
3467 3467
 				} else {
3468
-					print '<input type="checkbox" name="vat_reverse_charge"'. ($object->vat_reverse_charge == '1' ? ' checked ' : '') . ' disabled>';
3468
+					print '<input type="checkbox" name="vat_reverse_charge"'.($object->vat_reverse_charge == '1' ? ' checked ' : '').' disabled>';
3469 3469
 				}
3470 3470
 				print '</td></tr>';
3471 3471
 			}
@@ -3533,15 +3533,15 @@  discard block
 block discarded – undo
3533 3533
 			include DOL_DOCUMENT_ROOT.'/core/tpl/object_currency_amount.tpl.php';
3534 3534
 
3535 3535
 			print '<tr>';
3536
-			print '<td class="titlefieldmiddle">' . $langs->trans('AmountHT') . '</td>';
3537
-			print '<td class="nowrap amountcard right">' . price($object->total_ht, 0, $langs, 0, -1, -1, $conf->currency) . '</td>';
3536
+			print '<td class="titlefieldmiddle">'.$langs->trans('AmountHT').'</td>';
3537
+			print '<td class="nowrap amountcard right">'.price($object->total_ht, 0, $langs, 0, -1, -1, $conf->currency).'</td>';
3538 3538
 			if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
3539
-				print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_ht, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>';
3539
+				print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_ht, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>';
3540 3540
 			}
3541 3541
 			print '</tr>';
3542 3542
 
3543 3543
 			print '<tr>';
3544
-			print '<td>' . $langs->trans('AmountVAT') . '</td>';
3544
+			print '<td>'.$langs->trans('AmountVAT').'</td>';
3545 3545
 			print '<td class="nowrap amountcard right">';
3546 3546
 			if (GETPOST('calculationrule')) {
3547 3547
 				$calculationrule = GETPOST('calculationrule', 'alpha');
@@ -3555,40 +3555,40 @@  discard block
 block discarded – undo
3555 3555
 			}
3556 3556
 			// Show link for "recalculate"
3557 3557
 			if ($object->getVentilExportCompta() == 0) {
3558
-				$s = '<span class="hideonsmartphone opacitymedium">' . $langs->trans("ReCalculate") . ' </span>';
3559
-				$s .= '<a href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=calculate&token='.newToken().'&calculationrule=totalofround">' . $langs->trans("Mode1") . '</a>';
3558
+				$s = '<span class="hideonsmartphone opacitymedium">'.$langs->trans("ReCalculate").' </span>';
3559
+				$s .= '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=calculate&token='.newToken().'&calculationrule=totalofround">'.$langs->trans("Mode1").'</a>';
3560 3560
 				$s .= ' / ';
3561
-				$s .= '<a href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=calculate&token='.newToken().'&calculationrule=roundoftotal">' . $langs->trans("Mode2") . '</a>';
3561
+				$s .= '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=calculate&token='.newToken().'&calculationrule=roundoftotal">'.$langs->trans("Mode2").'</a>';
3562 3562
 				print '<div class="inline-block">';
3563
-				print $form->textwithtooltip($s, $langs->trans("CalculationRuleDesc", $calculationrulenum) . '<br>' . $langs->trans("CalculationRuleDescSupplier"), 2, 1, img_picto('', 'help'), '', 3, '', 0, 'recalculate');
3563
+				print $form->textwithtooltip($s, $langs->trans("CalculationRuleDesc", $calculationrulenum).'<br>'.$langs->trans("CalculationRuleDescSupplier"), 2, 1, img_picto('', 'help'), '', 3, '', 0, 'recalculate');
3564 3564
 				print '&nbsp; &nbsp; &nbsp; &nbsp;';
3565 3565
 				print '</div>';
3566 3566
 			}
3567 3567
 			print price($object->total_tva, 1, $langs, 0, -1, -1, $conf->currency);
3568 3568
 			print '</td>';
3569 3569
 			if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
3570
-				print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_tva, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>';
3570
+				print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_tva, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>';
3571 3571
 			}
3572 3572
 			print '</tr>';
3573 3573
 
3574 3574
 			if ($societe->localtax1_assuj == "1") { //Localtax1
3575 3575
 				print '<tr>';
3576
-				print '<td>' . $langs->transcountry("AmountLT1", $societe->country_code) . '</td>';
3577
-				print '<td class="nowrap amountcard right">' . price($object->total_localtax1, 1, $langs, 0, -1, -1, $conf->currency) . '</td>';
3576
+				print '<td>'.$langs->transcountry("AmountLT1", $societe->country_code).'</td>';
3577
+				print '<td class="nowrap amountcard right">'.price($object->total_localtax1, 1, $langs, 0, -1, -1, $conf->currency).'</td>';
3578 3578
 				print '</tr>';
3579 3579
 			}
3580 3580
 			if ($societe->localtax2_assuj == "1") { //Localtax2
3581 3581
 				print '<tr>';
3582
-				print '<td>' . $langs->transcountry("AmountLT2", $societe->country_code) . '</td>';
3583
-				print '<td class="nowrap amountcard right">' . price($object->total_localtax2, 1, $langs, 0, -1, -1, $conf->currency) . '</td>';
3582
+				print '<td>'.$langs->transcountry("AmountLT2", $societe->country_code).'</td>';
3583
+				print '<td class="nowrap amountcard right">'.price($object->total_localtax2, 1, $langs, 0, -1, -1, $conf->currency).'</td>';
3584 3584
 				print '</tr>';
3585 3585
 			}
3586 3586
 
3587 3587
 			print '<tr>';
3588
-			print '<td>' . $langs->trans('AmountTTC') . '</td>';
3589
-			print '<td class="nowrap amountcard right">' . price($object->total_ttc, 0, $langs, 0, -1, -1, $conf->currency) . '</td>';
3588
+			print '<td>'.$langs->trans('AmountTTC').'</td>';
3589
+			print '<td class="nowrap amountcard right">'.price($object->total_ttc, 0, $langs, 0, -1, -1, $conf->currency).'</td>';
3590 3590
 			if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
3591
-				print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_ttc, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>';
3591
+				print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_ttc, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>';
3592 3592
 			}
3593 3593
 			print '</tr>';
3594 3594
 
@@ -4129,7 +4129,7 @@  discard block
 block discarded – undo
4129 4129
 				}
4130 4130
 
4131 4131
 				// Clone as predefined / Create template
4132
-				if (($object->type ==  FactureFournisseur::TYPE_STANDARD || $object->type == FactureFournisseur::TYPE_DEPOSIT) && $object->status == 0 && $usercancreate) {
4132
+				if (($object->type == FactureFournisseur::TYPE_STANDARD || $object->type == FactureFournisseur::TYPE_DEPOSIT) && $object->status == 0 && $usercancreate) {
4133 4133
 					if (!$objectidnext && count($object->lines) > 0) {
4134 4134
 						print '<a class="butAction" href="'.DOL_URL_ROOT.'/fourn/facture/card-rec.php?facid='.$object->id.'&action=create">'.$langs->trans("ChangeIntoRepeatableInvoice").'</a>';
4135 4135
 					}
Please login to merge, or discard this patch.
htdocs/fourn/card.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -292,7 +292,7 @@  discard block
 block discarded – undo
292 292
 					if ($object->accountancy_code_supplier_general > 0) {
293 293
 						print ' - ';
294 294
 					}
295
-					$accountingAccountByDefault = '<span class="opacitymedium">' . $langs->trans("AccountingAccountByDefaultShort") . ": " . length_accountg(getDolGlobalString('ACCOUNTING_ACCOUNT_SUPPLIER')) . '</span>';
295
+					$accountingAccountByDefault = '<span class="opacitymedium">'.$langs->trans("AccountingAccountByDefaultShort").": ".length_accountg(getDolGlobalString('ACCOUNTING_ACCOUNT_SUPPLIER')).'</span>';
296 296
 					print $accountingAccountByDefault;
297 297
 				}
298 298
 			}
@@ -336,7 +336,7 @@  discard block
 block discarded – undo
336 336
 		print '<td class="titlefield">';
337 337
 		print $form->textwithpicto($langs->trans('VATReverseChargeByDefault'), $langs->trans('VATReverseChargeByDefaultDesc'));
338 338
 		print '</td><td>';
339
-		print '<input type="checkbox" name="vat_reverse_charge" ' . ($object->vat_reverse_charge == '1' ? ' checked' : '') . ' disabled>';
339
+		print '<input type="checkbox" name="vat_reverse_charge" '.($object->vat_reverse_charge == '1' ? ' checked' : '').' disabled>';
340 340
 		print '</td>';
341 341
 		print '</tr>';
342 342
 	}
Please login to merge, or discard this patch.
htdocs/website/index.php 1 patch
Spacing   +42 added lines, -42 removed lines patch added patch discarded remove patch
@@ -350,7 +350,7 @@  discard block
 block discarded – undo
350 350
 	}
351 351
 }
352 352
 
353
-$searchkey = GETPOST('searchstring', 'restricthtmlallowunvalid');	// or 'none', must be same then $searchstring
353
+$searchkey = GETPOST('searchstring', 'restricthtmlallowunvalid'); // or 'none', must be same then $searchstring
354 354
 
355 355
 if ($action == 'replacesite' || $mode == 'replacesite') {	// Test on permission not required
356 356
 	$containertype = GETPOST('optioncontainertype', 'aZ09') != '-1' ? GETPOST('optioncontainertype', 'aZ09') : '';
@@ -364,7 +364,7 @@  discard block
 block discarded – undo
364 364
 }
365 365
 
366 366
 $usercanedit = $user->hasRight('website', 'write');
367
-$permissiontoadd = $user->hasRight('website', 'write');	// Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles
367
+$permissiontoadd = $user->hasRight('website', 'write'); // Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles
368 368
 $permissiontodelete = $user->hasRight('website', 'delete');
369 369
 
370 370
 
@@ -431,7 +431,7 @@  discard block
 block discarded – undo
431 431
 if ($sortorder) {
432 432
 	$backtopage .= '&sortorder='.urlencode($sortorder);
433 433
 }
434
-include DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php';	// This manage 'sendit', 'confirm_deletefile', 'renamefile' action when submitting new file.
434
+include DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php'; // This manage 'sendit', 'confirm_deletefile', 'renamefile' action when submitting new file.
435 435
 
436 436
 $backtopage = $savbacktopage;
437 437
 //var_dump($backtopage);
@@ -591,7 +591,7 @@  discard block
 block discarded – undo
591 591
 
592 592
 // Replacement of string into pages
593 593
 if ($massaction == 'replace' && GETPOST('confirmmassaction', 'alpha') && $usercanedit) {
594
-	$replacestring = GETPOST('replacestring', 'restricthtmlallowunvalid');	// or 'none', must be same then $searchstring
594
+	$replacestring = GETPOST('replacestring', 'restricthtmlallowunvalid'); // or 'none', must be same then $searchstring
595 595
 
596 596
 	$dolibarrdataroot = preg_replace('/([\\/]+)$/i', '', DOL_DATA_ROOT);
597 597
 	$allowimportsite = true;
@@ -1161,7 +1161,7 @@  discard block
 block discarded – undo
1161 1161
 		$objectpage->image = GETPOST('WEBSITE_IMAGE', 'alpha');
1162 1162
 		$objectpage->keywords = str_replace(array('<', '>'), '', GETPOST('WEBSITE_KEYWORDS', 'alphanohtml'));
1163 1163
 		$objectpage->allowed_in_frames = GETPOST('WEBSITE_ALLOWED_IN_FRAMES', 'aZ09') ? 1 : 0;
1164
-		$objectpage->htmlheader = GETPOST('htmlheader', 'none');	// Must accept tags like '<script>' and '<link>'
1164
+		$objectpage->htmlheader = GETPOST('htmlheader', 'none'); // Must accept tags like '<script>' and '<link>'
1165 1165
 		$objectpage->author_alias = GETPOST('WEBSITE_AUTHORALIAS', 'alphanohtml');
1166 1166
 		$objectpage->object_type = GETPOST('WEBSITE_OBJECTCLASS');
1167 1167
 		$objectpage->fk_object = GETPOST('WEBSITE_OBJECTID');
@@ -1194,7 +1194,7 @@  discard block
 block discarded – undo
1194 1194
 		$content = '';
1195 1195
 		if (GETPOSTISSET('content')) {
1196 1196
 			//$content = GETPOST('content', 'restricthtmlallowunvalid');	// @TODO Use a restricthtmlallowunvalidwithphp
1197
-			$content = GETPOST('content', 'none');	// @TODO Use a restricthtmlallowunvalidwithphp
1197
+			$content = GETPOST('content', 'none'); // @TODO Use a restricthtmlallowunvalidwithphp
1198 1198
 
1199 1199
 			$objectpage->content = make_substitutions($content, $substitutionarray);
1200 1200
 		} else {
@@ -1567,7 +1567,7 @@  discard block
 block discarded – undo
1567 1567
 					$error++;
1568 1568
 					setEventMessages($langs->trans('ErrorFaviconMustBeASquaredImage'), array(), 'errors');
1569 1569
 				}
1570
-				if (! $error && ($filesize[0] != 16 && $filesize[0] != 32 && $filesize[0] != 64)) {
1570
+				if (!$error && ($filesize[0] != 16 && $filesize[0] != 32 && $filesize[0] != 64)) {
1571 1571
 					$error++;
1572 1572
 					setEventMessages($langs->trans('ErrorFaviconSize'), array(), 'errors');
1573 1573
 				}
@@ -1579,7 +1579,7 @@  discard block
 block discarded – undo
1579 1579
 				if (!GETPOSTISSET('updateandstay')) {	// If we click on "Save And Stay", we don not make the redirect
1580 1580
 					$action = 'preview';
1581 1581
 					if ($backtopage) {
1582
-						$backtopage = preg_replace('/searchstring=[^&]*/', '', $backtopage);	// Clean backtopage url
1582
+						$backtopage = preg_replace('/searchstring=[^&]*/', '', $backtopage); // Clean backtopage url
1583 1583
 						header("Location: ".$backtopage);
1584 1584
 						exit;
1585 1585
 					}
@@ -1603,7 +1603,7 @@  discard block
 block discarded – undo
1603 1603
 			}
1604 1604
 
1605 1605
 
1606
-			$dataposted = trim(GETPOST('WEBSITE_HTML_HEADER', 'restricthtmlallowlinkscript'));		// Must accept tags like '<script>' and '<link>'
1606
+			$dataposted = trim(GETPOST('WEBSITE_HTML_HEADER', 'restricthtmlallowlinkscript')); // Must accept tags like '<script>' and '<link>'
1607 1607
 			$dataposted = preg_replace(array('/<html>\n*/ims', '/<\/html>\n*/ims'), array('', ''), $dataposted);
1608 1608
 			$dataposted = str_replace('<?=', '<?php', $dataposted);
1609 1609
 
@@ -1612,7 +1612,7 @@  discard block
 block discarded – undo
1612 1612
 			$phpfullcodestring = dolKeepOnlyPhpCode($dataposted);
1613 1613
 
1614 1614
 			// Security analysis
1615
-			$errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring);	// Contains the setEventMessages
1615
+			$errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages
1616 1616
 
1617 1617
 			if (!$errorphpcheck) {
1618 1618
 				$htmlheadercontent = '';
@@ -1650,7 +1650,7 @@  discard block
 block discarded – undo
1650 1650
 			$phpfullcodestring = dolKeepOnlyPhpCode($dataposted);
1651 1651
 
1652 1652
 			// Security analysis
1653
-			$errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring);	// Contains the setEventMessages
1653
+			$errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages
1654 1654
 
1655 1655
 			if (!$errorphpcheck) {
1656 1656
 				$csscontent = '';
@@ -1693,7 +1693,7 @@  discard block
 block discarded – undo
1693 1693
 			$phpfullcodestring = dolKeepOnlyPhpCode($dataposted);
1694 1694
 
1695 1695
 			// Security analysis
1696
-			$errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring);	// Contains the setEventMessages
1696
+			$errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages
1697 1697
 
1698 1698
 			if (!$errorphpcheck) {
1699 1699
 				$jscontent = '';
@@ -1731,7 +1731,7 @@  discard block
 block discarded – undo
1731 1731
 			$phpfullcodestring = dolKeepOnlyPhpCode($dataposted);
1732 1732
 
1733 1733
 			// Security analysis
1734
-			$errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring);	// Contains the setEventMessages
1734
+			$errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages
1735 1735
 
1736 1736
 			if (!$errorphpcheck) {
1737 1737
 				$robotcontent = '';
@@ -1769,7 +1769,7 @@  discard block
 block discarded – undo
1769 1769
 			$phpfullcodestring = dolKeepOnlyPhpCode($dataposted);
1770 1770
 
1771 1771
 			// Security analysis
1772
-			$errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring);	// Contains the setEventMessages
1772
+			$errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages
1773 1773
 
1774 1774
 			if (!$errorphpcheck) {
1775 1775
 				if ($dataposted) {
@@ -1797,7 +1797,7 @@  discard block
 block discarded – undo
1797 1797
 			$phpfullcodestring = dolKeepOnlyPhpCode($dataposted);
1798 1798
 
1799 1799
 			// Security analysis
1800
-			$errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring);	// Contains the setEventMessages
1800
+			$errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages
1801 1801
 
1802 1802
 			if (!$errorphpcheck) {
1803 1803
 				$manifestjsoncontent = '';
@@ -1836,7 +1836,7 @@  discard block
 block discarded – undo
1836 1836
 			$phpfullcodestring = dolKeepOnlyPhpCode($dataposted);
1837 1837
 
1838 1838
 			// Security analysis
1839
-			$errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring);	// Contains the setEventMessages
1839
+			$errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages
1840 1840
 
1841 1841
 			if (!$errorphpcheck) {
1842 1842
 				$readmecontent = '';
@@ -1875,7 +1875,7 @@  discard block
 block discarded – undo
1875 1875
 			$phpfullcodestring = dolKeepOnlyPhpCode($dataposted);
1876 1876
 
1877 1877
 			// Security analysis
1878
-			$errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring);	// Contains the setEventMessages
1878
+			$errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages
1879 1879
 
1880 1880
 			if (!$errorphpcheck) {
1881 1881
 				$licensecontent = '';
@@ -1917,7 +1917,7 @@  discard block
 block discarded – undo
1917 1917
 			if (!GETPOSTISSET('updateandstay')) {	// If we click on "Save And Stay", we don not make the redirect
1918 1918
 				$action = 'preview';
1919 1919
 				if ($backtopage) {
1920
-					$backtopage = preg_replace('/searchstring=[^&]*/', '', $backtopage);	// Clean backtopage url
1920
+					$backtopage = preg_replace('/searchstring=[^&]*/', '', $backtopage); // Clean backtopage url
1921 1921
 					header("Location: ".$backtopage);
1922 1922
 					exit;
1923 1923
 				}
@@ -1936,7 +1936,7 @@  discard block
 block discarded – undo
1936 1936
 
1937 1937
 	$object->fk_default_home = $pageid;
1938 1938
 	$res = $object->update($user);
1939
-	if (! ($res > 0)) {
1939
+	if (!($res > 0)) {
1940 1940
 		$error++;
1941 1941
 		setEventMessages($object->error, $object->errors, 'errors');
1942 1942
 	}
@@ -2051,7 +2051,7 @@  discard block
 block discarded – undo
2051 2051
 		$objectpage->image = GETPOST('WEBSITE_IMAGE', 'alpha');
2052 2052
 		$objectpage->keywords = str_replace(array('<', '>'), '', GETPOST('WEBSITE_KEYWORDS', 'alphanohtml'));
2053 2053
 		$objectpage->allowed_in_frames = GETPOST('WEBSITE_ALLOWED_IN_FRAMES', 'aZ09') ? 1 : 0;
2054
-		$objectpage->htmlheader = trim(GETPOST('htmlheader', 'restricthtmlallowlinkscript'));		// Must accept tags like '<script>' and '<link>'
2054
+		$objectpage->htmlheader = trim(GETPOST('htmlheader', 'restricthtmlallowlinkscript')); // Must accept tags like '<script>' and '<link>'
2055 2055
 		$objectpage->fk_page = (GETPOSTINT('pageidfortranslation') > 0 ? GETPOSTINT('pageidfortranslation') : 0);
2056 2056
 		$objectpage->author_alias = trim(GETPOST('WEBSITE_AUTHORALIAS', 'alphanohtml'));
2057 2057
 		$objectpage->object_type = GETPOST('WEBSITE_OBJECTCLASS', 'alpha');
@@ -2327,7 +2327,7 @@  discard block
 block discarded – undo
2327 2327
 
2328 2328
 			$phpfullcodestringold = dolKeepOnlyPhpCode($objectpage->content);
2329 2329
 
2330
-			$objectpage->content = GETPOST('PAGE_CONTENT', 'none');	// any HTML content allowed
2330
+			$objectpage->content = GETPOST('PAGE_CONTENT', 'none'); // any HTML content allowed
2331 2331
 
2332 2332
 			$phpfullcodestring = dolKeepOnlyPhpCode($objectpage->content);
2333 2333
 
@@ -2548,7 +2548,7 @@  discard block
 block discarded – undo
2548 2548
 				$fileofzip = '';
2549 2549
 				if (GETPOSTISSET('templateuserfile')) {
2550 2550
 					// Case we selected one template
2551
-					$fileofzip = DOL_DATA_ROOT.'/doctemplates/websites/'.GETPOST('templateuserfile', 'alpha');	// $fileofzip will be sanitized later into the importWebSite()
2551
+					$fileofzip = DOL_DATA_ROOT.'/doctemplates/websites/'.GETPOST('templateuserfile', 'alpha'); // $fileofzip will be sanitized later into the importWebSite()
2552 2552
 				} elseif (!empty($_FILES) && is_array($_FILES['userfile'])) {
2553 2553
 					// Case we upload a new template
2554 2554
 					if (is_array($_FILES['userfile']['tmp_name'])) {
@@ -2630,7 +2630,7 @@  discard block
 block discarded – undo
2630 2630
 	if ($website->virtualhost) {
2631 2631
 		$domainname = $website->virtualhost;
2632 2632
 	}
2633
-	if (! preg_match('/^http/i', $domainname)) {
2633
+	if (!preg_match('/^http/i', $domainname)) {
2634 2634
 		$domainname = 'https://'.$domainname;
2635 2635
 	}
2636 2636
 
@@ -2696,7 +2696,7 @@  discard block
 block discarded – undo
2696 2696
 				$url->appendChild($lastmod);
2697 2697
 				// Add suggested frequency for refresh
2698 2698
 				if (getDolGlobalString('WEBSITE_SITEMAPS_ADD_WEEKLY_FREQ')) {
2699
-					$changefreq = $domtree->createElement('changefreq', 'weekly');	// TODO Manage other values
2699
+					$changefreq = $domtree->createElement('changefreq', 'weekly'); // TODO Manage other values
2700 2700
 					$url->appendChild($changefreq);
2701 2701
 				}
2702 2702
 				// Add higher priority for home page
@@ -2801,7 +2801,7 @@  discard block
 block discarded – undo
2801 2801
 				$url->appendChild($lastmod);
2802 2802
 				// Add suggested frequency for refresh
2803 2803
 				if (getDolGlobalString('WEBSITE_SITEMAPS_ADD_WEEKLY_FREQ')) {
2804
-					$changefreq = $domtree->createElement('changefreq', 'weekly');	// TODO Manage other values
2804
+					$changefreq = $domtree->createElement('changefreq', 'weekly'); // TODO Manage other values
2805 2805
 					$url->appendChild($changefreq);
2806 2806
 				}
2807 2807
 
@@ -3092,11 +3092,11 @@  discard block
 block discarded – undo
3092 3092
 
3093 3093
 			// // Export web site
3094 3094
 			$extraCssClass = getDolGlobalString('WEBSITE_ALLOW_OVERWRITE_GIT_SOURCE') ? 'hideobject' : '';
3095
-			print '<input type="submit" class="button bordertransp ' . $extraCssClass . '" ' . $disabledexport . ' value="' . dol_escape_htmltag($exportlabel) . '" name="exportsite">';
3095
+			print '<input type="submit" class="button bordertransp '.$extraCssClass.'" '.$disabledexport.' value="'.dol_escape_htmltag($exportlabel).'" name="exportsite">';
3096 3096
 
3097 3097
 			if (getDolGlobalString('WEBSITE_ALLOW_OVERWRITE_GIT_SOURCE')) {
3098 3098
 				// Overwrite template in sources
3099
-				$overwriteGitUrl = $_SERVER["PHP_SELF"] . '?action=overwritesite&website=' . urlencode($website->ref);
3099
+				$overwriteGitUrl = $_SERVER["PHP_SELF"].'?action=overwritesite&website='.urlencode($website->ref);
3100 3100
 				print dolButtonToOpenExportDialog('exportpopup', $langs->trans('ExportOptions'), $langs->trans('ExportSite'), 'exportsite', $overwriteGitUrl, $website);
3101 3101
 				//print '<a href="'.$_SERVER["PHP_SELF"].'?action=overwritesite&website='.urlencode($website->ref).'" class="button bordertransp hideobject" title="'.dol_escape_htmltag($langs->trans("ExportIntoGIT").". Directory ".getDolGlobalString('WEBSITE_ALLOW_OVERWRITE_GIT_SOURCE')).'">'.dol_escape_htmltag($langs->trans("ExportIntoGIT")).'</a>';
3102 3102
 			}
@@ -3463,7 +3463,7 @@  discard block
 block discarded – undo
3463 3463
 				print '<!-- button EditInLine and ShowSubcontainers -->'."\n";
3464 3464
 				print '<div class="websiteselectionsection inline-block">';
3465 3465
 
3466
-				print '<div class="inline-block marginrightonly">';	// Button includes dynamic content
3466
+				print '<div class="inline-block marginrightonly">'; // Button includes dynamic content
3467 3467
 				print $langs->trans("ShowSubcontainers");
3468 3468
 				if (!getDolGlobalString('WEBSITE_SUBCONTAINERSINLINE')) {
3469 3469
 					print '<a class="nobordertransp nohoverborder marginleftonlyshort valignmiddle"'.$disabled.' href="'.$_SERVER["PHP_SELF"].'?website='.$object->ref.'&pageid='.$websitepage->id.'&action=setshowsubcontainers&token='.newToken().'">'.img_picto($langs->trans("ShowSubContainersOnOff", $langs->transnoentitiesnoconv("Off")), 'switch_off', '', 0, 0, 0, '', 'nomarginleft').'</a>';
@@ -3472,7 +3472,7 @@  discard block
 block discarded – undo
3472 3472
 				}
3473 3473
 				print '</div>';
3474 3474
 
3475
-				print '<div class="inline-block marginrightonly">';	// Button edit inline
3475
+				print '<div class="inline-block marginrightonly">'; // Button edit inline
3476 3476
 
3477 3477
 				print '<span id="switchckeditorinline">'."\n";
3478 3478
 				// Enable CKEditor inline with js on section and div with conteneditable=true
@@ -3564,15 +3564,15 @@  discard block
 block discarded – undo
3564 3564
 													// Sending data via AJAX
3565 3565
 													$.ajax({
3566 3566
 														type: \'POST\',
3567
-														url: \'' . DOL_URL_ROOT . '/core/ajax/editinline.php\',
3567
+														url: \'' . DOL_URL_ROOT.'/core/ajax/editinline.php\',
3568 3568
 														data: {
3569 3569
 															website_ref: \''.$website->ref.'\',
3570
-															page_id: \'' . $websitepage->id . '\',
3570
+															page_id: \'' . $websitepage->id.'\',
3571 3571
 															content: content,
3572 3572
 															element_id: elementId,
3573 3573
 															element_type: elementType,
3574 3574
 															action: \'updatedElementContent\',
3575
-															token: \'' . newToken() . '\'
3575
+															token: \'' . newToken().'\'
3576 3576
 														},
3577 3577
 														success: function(response) {
3578 3578
 															console.log(response);
@@ -3658,7 +3658,7 @@  discard block
 block discarded – undo
3658 3658
 				} else {
3659 3659
 					$disabled = '';
3660 3660
 					$title = '';
3661
-					$url = $_SERVER["PHP_SELF"].'?action=delete&token='.newToken().'&pageid='.((int) $websitepage->id).'&website='.urlencode($website->ref);	// action=delete for webpage, deletesite for website
3661
+					$url = $_SERVER["PHP_SELF"].'?action=delete&token='.newToken().'&pageid='.((int) $websitepage->id).'&website='.urlencode($website->ref); // action=delete for webpage, deletesite for website
3662 3662
 				}
3663 3663
 				print '<a href="'.$url.'" class="button buttonDelete bordertransp'.($disabled ? ' disabled' : '').'"'.$disabled.' title="'.dol_escape_htmltag($title).'">'.img_picto('', 'delete', 'class=""').'<span class="hideonsmartphone paddingleft">'.$langs->trans("Delete").'</span></a>';
3664 3664
 				print '</span>';
@@ -3848,7 +3848,7 @@  discard block
 block discarded – undo
3848 3848
 		// Clean the php htmlheader file to remove php code and get only html part
3849 3849
 		$htmlheadercontent = preg_replace('/<\?php \/\/ BEGIN PHP[^\?]*END PHP( \?>)?\n*/ims', '', $htmlheadercontent);
3850 3850
 	} else {
3851
-		$htmlheadercontent = GETPOST('WEBSITE_HTML_HEADER', 'none');		// Must accept tags like '<script>' and '<link>'
3851
+		$htmlheadercontent = GETPOST('WEBSITE_HTML_HEADER', 'none'); // Must accept tags like '<script>' and '<link>'
3852 3852
 	}
3853 3853
 	if (!trim($htmlheadercontent)) {
3854 3854
 		$htmlheadercontent = "<html>\n";
@@ -3879,7 +3879,7 @@  discard block
 block discarded – undo
3879 3879
 		// Clean the php htaccesscontent file to remove php code and get only html part
3880 3880
 		$htaccesscontent = preg_replace('/<\?php \/\/ BEGIN PHP[^\?]*END PHP( \?>)?\n*/ims', '', $htaccesscontent);
3881 3881
 	} else {
3882
-		$htaccesscontent = GETPOST('WEBSITE_HTACCESS', 'nohtml');	// We must use 'nohtml' and not 'alphanohtml' because we must accept "
3882
+		$htaccesscontent = GETPOST('WEBSITE_HTACCESS', 'nohtml'); // We must use 'nohtml' and not 'alphanohtml' because we must accept "
3883 3883
 	}
3884 3884
 
3885 3885
 	if (!GETPOSTISSET('WEBSITE_MANIFEST_JSON')) {
@@ -3976,7 +3976,7 @@  discard block
 block discarded – undo
3976 3976
 	$maxfilesizearray = getMaxFileSizeArray();
3977 3977
 	$maxmin = $maxfilesizearray['maxmin'];
3978 3978
 	if ($maxmin > 0) {
3979
-		print '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">';	// MAX_FILE_SIZE must precede the field type=file
3979
+		print '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file
3980 3980
 	}
3981 3981
 	print '<input type="file" class="flat minwidth300" name="addedfile" id="addedfile"/>';
3982 3982
 
@@ -4018,7 +4018,7 @@  discard block
 block discarded – undo
4018 4018
 	print '<tr><td class="tdtop">';
4019 4019
 	print $langs->trans('WEBSITE_HTML_HEADER');
4020 4020
 	$htmlhelp = $langs->trans("Example").' :<br>';
4021
-	$htmlhelp .= dol_nl2br(dol_htmlentities($htmlheadercontentdefault));	// do not use dol_htmlentitiesbr here, $htmlheadercontentdefault is HTML with content like <link> and <script> that we want to be html encode as they must be show as doc content not executable instruction.
4021
+	$htmlhelp .= dol_nl2br(dol_htmlentities($htmlheadercontentdefault)); // do not use dol_htmlentitiesbr here, $htmlheadercontentdefault is HTML with content like <link> and <script> that we want to be html encode as they must be show as doc content not executable instruction.
4022 4022
 	$textwithhelp = $form->textwithpicto('', $htmlhelp, 1, 'help', '', 0, 2, 'htmlheadertooltip');
4023 4023
 	$htmlhelp2 = $langs->trans("LinkAndScriptsHereAreNotLoadedInEditor").'<br>';
4024 4024
 	print $form->textwithpicto($textwithhelp, $htmlhelp2, 1, 'warning', '', 0, 2, 'htmlheadertooltip2');
@@ -4239,7 +4239,7 @@  discard block
 block discarded – undo
4239 4239
 		$maxfilesizearray = getMaxFileSizeArray();
4240 4240
 		$maxmin = $maxfilesizearray['maxmin'];
4241 4241
 		if ($maxmin > 0) {
4242
-			print '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">';	// MAX_FILE_SIZE must precede the field type=file
4242
+			print '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file
4243 4243
 		}
4244 4244
 		print '<input class="flat minwidth400" type="file" name="userfile[]" accept=".zip">';
4245 4245
 		print '<input type="submit" class="button small" name="buttonsubmitimportfile" value="'.dol_escape_htmltag($langs->trans("Upload")).'">';
@@ -4760,7 +4760,7 @@  discard block
 block discarded – undo
4760 4760
 	print '<tr><td class="tdhtmlheader tdtop">';
4761 4761
 	$htmlhelp = $langs->trans("EditTheWebSiteForACommonHeader").'<br><br>';
4762 4762
 	$htmlhelp .= $langs->trans("Example").' :<br>';
4763
-	$htmlhelp .= dol_nl2br(dol_htmlentities($htmlheadercontentdefault));	// do not use dol_htmlentitiesbr here, $htmlheadercontentdefault is HTML with content like <link> and <script> that we want to be html encode as they must be show as doc content not executable instruction.
4763
+	$htmlhelp .= dol_nl2br(dol_htmlentities($htmlheadercontentdefault)); // do not use dol_htmlentitiesbr here, $htmlheadercontentdefault is HTML with content like <link> and <script> that we want to be html encode as they must be show as doc content not executable instruction.
4764 4764
 	print $form->textwithpicto($langs->transnoentitiesnoconv('HtmlHeaderPage'), $htmlhelp, 1, 'help', '', 0, 2, 'htmlheadertooltip');
4765 4765
 	print '</td><td>';
4766 4766
 	$poscursor = array('x' => GETPOST('htmlheader_x'), 'y' => GETPOST('htmlheader_y'));
@@ -4899,7 +4899,7 @@  discard block
 block discarded – undo
4899 4899
 
4900 4900
 
4901 4901
 	$module = 'medias';
4902
-	$formalreadyopen = 2;	// So the form to submit a new file will not be open another time inside the core/tpl/filemanager.tpl.php
4902
+	$formalreadyopen = 2; // So the form to submit a new file will not be open another time inside the core/tpl/filemanager.tpl.php
4903 4903
 	if (empty($url)) {
4904 4904
 		$url = DOL_URL_ROOT.'/website/index.php'; // Must be an url without param
4905 4905
 	}
@@ -5136,8 +5136,8 @@  discard block
 block discarded – undo
5136 5136
 			print getTitleFieldOfList("Categories", 0, $_SERVER['PHP_SELF'], '', '', $param, '', $sortfield, $sortorder, 'center ')."\n";
5137 5137
 			print getTitleFieldOfList("", 0, $_SERVER['PHP_SELF']);
5138 5138
 			print getTitleFieldOfList("UserCreation", 0, $_SERVER['PHP_SELF'], 'fk_user_creat', '', $param, '', $sortfield, $sortorder, '')."\n";
5139
-			print getTitleFieldOfList("DateCreation", 0, $_SERVER['PHP_SELF'], 'date_creation', '', $param, '', $sortfield, $sortorder, 'center ')."\n";		// Date creation
5140
-			print getTitleFieldOfList("DateLastModification", 0, $_SERVER['PHP_SELF'], 'tms', '', $param, '', $sortfield, $sortorder, 'center ')."\n";		// Date last modif
5139
+			print getTitleFieldOfList("DateCreation", 0, $_SERVER['PHP_SELF'], 'date_creation', '', $param, '', $sortfield, $sortorder, 'center ')."\n"; // Date creation
5140
+			print getTitleFieldOfList("DateLastModification", 0, $_SERVER['PHP_SELF'], 'tms', '', $param, '', $sortfield, $sortorder, 'center ')."\n"; // Date last modif
5141 5141
 			print getTitleFieldOfList("", 0, $_SERVER['PHP_SELF']);
5142 5142
 			// Action column
5143 5143
 			if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
Please login to merge, or discard this patch.
htdocs/holiday/card.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -505,7 +505,7 @@  discard block
 block discarded – undo
505 505
 
506 506
 				// option to warn the validator in case of too short delay
507 507
 				if (!getDolGlobalString('HOLIDAY_HIDE_APPROVER_ABOUT_TOO_LOW_DELAY')) {
508
-					$delayForRequest = 0;		// TODO Set delay depending of holiday leave type
508
+					$delayForRequest = 0; // TODO Set delay depending of holiday leave type
509 509
 					if ($delayForRequest) {
510 510
 						$nowplusdelay = dol_time_plus_duree($now, $delayForRequest, 'd');
511 511
 
@@ -547,7 +547,7 @@  discard block
 block discarded – undo
547 547
 					$endhalfdaykey = "";
548 548
 				}
549 549
 
550
-				$link = dol_buildpath("/holiday/card.php", 3) . '?id='.$object->id;
550
+				$link = dol_buildpath("/holiday/card.php", 3).'?id='.$object->id;
551 551
 
552 552
 				$message .= "<ul>";
553 553
 				$message .= "<li>".$langs->transnoentitiesnoconv("Name")." : ".dolGetFirstLastname($expediteur->firstname, $expediteur->lastname)."</li>\n";
@@ -1241,7 +1241,7 @@  discard block
 block discarded – undo
1241 1241
 			$result = $object->fetch($id, $ref);
1242 1242
 
1243 1243
 			$approverexpected = new User($db);
1244
-			$approverexpected->fetch($object->fk_validator);	// Use that should be the approver
1244
+			$approverexpected->fetch($object->fk_validator); // Use that should be the approver
1245 1245
 
1246 1246
 			$userRequest = new User($db);
1247 1247
 			$userRequest->fetch($object->fk_user);
@@ -1476,7 +1476,7 @@  discard block
 block discarded – undo
1476 1476
 					print '</tr>';
1477 1477
 				} else {
1478 1478
 					print '<tr>';
1479
-					print '<td class="titlefield">'.$langs->trans('ReviewedByCP').'</td>';	// Will be approved by
1479
+					print '<td class="titlefield">'.$langs->trans('ReviewedByCP').'</td>'; // Will be approved by
1480 1480
 					print '<td>';
1481 1481
 					$include_users = $object->fetch_users_approver_holiday();
1482 1482
 					if (!in_array($object->fk_validator, $include_users)) {  // Add the current validator to the list to not lose it when editing.
Please login to merge, or discard this patch.
htdocs/bom/bom_card.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -287,7 +287,7 @@  discard block
 block discarded – undo
287 287
 			$bomline->fetch($lineid);
288 288
 
289 289
 			$fk_default_workstation = $bomline->fk_default_workstation;
290
-			if (isModEnabled('workstation') &&  GETPOSTISSET('idworkstations')) {
290
+			if (isModEnabled('workstation') && GETPOSTISSET('idworkstations')) {
291 291
 				$fk_default_workstation = GETPOSTINT('idworkstations');
292 292
 			}
293 293
 
@@ -607,17 +607,17 @@  discard block
 block discarded – undo
607 607
 	if (!empty($object->table_element_line)) {
608 608
 		// Products
609 609
 
610
-		$res = $object->fetchLinesbytypeproduct(0);		// Load all lines products into ->lines
610
+		$res = $object->fetchLinesbytypeproduct(0); // Load all lines products into ->lines
611 611
 		$object->calculateCosts();
612 612
 
613 613
 		print ($res == 0 && $object->status >= $object::STATUS_VALIDATED) ? '' : load_fiche_titre($langs->trans('BOMProductsList'), '', 'product');
614 614
 
615
-		print '	<form name="addproduct" id="listbomproducts" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '" method="POST">
616
-    	<input type="hidden" name="token" value="' . newToken() . '">
617
-    	<input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline') . '">
615
+		print '	<form name="addproduct" id="listbomproducts" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="POST">
616
+    	<input type="hidden" name="token" value="' . newToken().'">
617
+    	<input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline').'">
618 618
     	<input type="hidden" name="mode" value="">
619 619
 		<input type="hidden" name="page_y" value="">
620
-    	<input type="hidden" name="id" value="' . $object->id . '">
620
+    	<input type="hidden" name="id" value="' . $object->id.'">
621 621
     	';
622 622
 
623 623
 		if (!empty($conf->use_javascript_ajax) && $object->status == 0) {
@@ -661,21 +661,21 @@  discard block
 block discarded – undo
661 661
 		// Services
662 662
 
663 663
 		$filtertype = 1;
664
-		$res = $object->fetchLinesbytypeproduct($filtertype);		// Load all lines services into ->lines
664
+		$res = $object->fetchLinesbytypeproduct($filtertype); // Load all lines services into ->lines
665 665
 		$object->calculateCosts();
666 666
 
667 667
 		print ($res == 0 && $object->status >= $object::STATUS_VALIDATED) ? '' : load_fiche_titre($langs->trans('BOMServicesList'), '', 'service');
668 668
 
669
-		print '	<form name="addservice" id="listbomservices" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '" method="POST">
670
-    	<input type="hidden" name="token" value="' . newToken() . '">
671
-    	<input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline') . '">
669
+		print '	<form name="addservice" id="listbomservices" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="POST">
670
+    	<input type="hidden" name="token" value="' . newToken().'">
671
+    	<input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline').'">
672 672
     	<input type="hidden" name="mode" value="">
673
-		<input type="hidden" name="page_y" value="">    		<input type="hidden" name="id" value="' . $object->id . '">
673
+		<input type="hidden" name="page_y" value="">    		<input type="hidden" name="id" value="' . $object->id.'">
674 674
     	';
675 675
 
676 676
 		if (!empty($conf->use_javascript_ajax) && $object->status == 0) {
677 677
 			$tagidfortablednd = 'tablelinesservice';
678
-			include DOL_DOCUMENT_ROOT . '/core/tpl/ajaxrow.tpl.php';
678
+			include DOL_DOCUMENT_ROOT.'/core/tpl/ajaxrow.tpl.php';
679 679
 		}
680 680
 
681 681
 		print '<div class="div-table-responsive-no-min">';
Please login to merge, or discard this patch.
htdocs/bom/tpl/objectline_create.tpl.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -97,27 +97,27 @@  discard block
 block discarded – undo
97 97
 			print '</span></td>';
98 98
 		}
99 99
 	} else { // Service
100
-		print '<td class="linecolunit left">' . $form->textwithpicto($langs->trans('Unit'), '').'</td>';
100
+		print '<td class="linecolunit left">'.$form->textwithpicto($langs->trans('Unit'), '').'</td>';
101 101
 	}
102 102
 	if ($filtertype != 1 || getDolGlobalString('STOCK_SUPPORTS_SERVICES')) { // Product or stock support for Services is active
103 103
 		// Qty frozen
104
-		print '<td class="linecolqtyfrozen right">' . $form->textwithpicto($langs->trans('QtyFrozen'), $langs->trans("QuantityConsumedInvariable")) . '</td>';
104
+		print '<td class="linecolqtyfrozen right">'.$form->textwithpicto($langs->trans('QtyFrozen'), $langs->trans("QuantityConsumedInvariable")).'</td>';
105 105
 
106 106
 		// Disable stock change
107
-		print '<td class="linecoldisablestockchange right">' . $form->textwithpicto($langs->trans('DisableStockChange'), $langs->trans('DisableStockChangeHelp')) . '</td>';
107
+		print '<td class="linecoldisablestockchange right">'.$form->textwithpicto($langs->trans('DisableStockChange'), $langs->trans('DisableStockChangeHelp')).'</td>';
108 108
 
109 109
 		// Efficiency
110
-		print '<td class="linecollost right">' . $form->textwithpicto($langs->trans('ManufacturingEfficiency'), $langs->trans('ValueOfMeansLoss')) . '</td>';
110
+		print '<td class="linecollost right">'.$form->textwithpicto($langs->trans('ManufacturingEfficiency'), $langs->trans('ValueOfMeansLoss')).'</td>';
111 111
 	}
112 112
 
113 113
 	// Service and workstations are active
114 114
 	if ($filtertype == 1 && isModEnabled('workstation')) {
115
-		print '<td class="linecolworkstation">' .  $form->textwithpicto($langs->trans('Workstation'), '') . '</td>';
115
+		print '<td class="linecolworkstation">'.$form->textwithpicto($langs->trans('Workstation'), '').'</td>';
116 116
 	}
117 117
 	// Cost
118
-	print '<td class="linecoltotalcost right">' .  $form->textwithpicto($langs->trans('TotalCost'), '') . '</td>';
118
+	print '<td class="linecoltotalcost right">'.$form->textwithpicto($langs->trans('TotalCost'), '').'</td>';
119 119
 
120
-	print '<td class="linecoledit" colspan="' . $colspan . '">&nbsp;</td>';
120
+	print '<td class="linecoledit" colspan="'.$colspan.'">&nbsp;</td>';
121 121
 	print '</tr>';
122 122
 }
123 123
 
@@ -195,18 +195,18 @@  discard block
 block discarded – undo
195 195
 if ($filtertype != 1 || getDolGlobalString('STOCK_SUPPORTS_SERVICES')) { // Product or stock support for Services is active
196 196
 	// Qty frozen
197 197
 	$coldisplay++;
198
-	print '<td class="bordertop nobottom linecolqtyfrozen right"><input type="checkbox" name="qty_frozen" id="qty_frozen" class="flat right" value="1"' . (GETPOST("qty_frozen", 'alpha') ? ' checked="checked"' : '') . '>';
198
+	print '<td class="bordertop nobottom linecolqtyfrozen right"><input type="checkbox" name="qty_frozen" id="qty_frozen" class="flat right" value="1"'.(GETPOST("qty_frozen", 'alpha') ? ' checked="checked"' : '').'>';
199 199
 	print '</td>';
200 200
 
201 201
 	// Disable stock change
202 202
 	$coldisplay++;
203
-	print '<td class="bordertop nobottom linecoldisablestockchange right"><input type="checkbox" name="disable_stock_change" id="disable_stock_change" class="flat right" value="1"' . (GETPOST("disable_stock_change", 'alpha') ? ' checked="checked"' : '') . '">';
203
+	print '<td class="bordertop nobottom linecoldisablestockchange right"><input type="checkbox" name="disable_stock_change" id="disable_stock_change" class="flat right" value="1"'.(GETPOST("disable_stock_change", 'alpha') ? ' checked="checked"' : '').'">';
204 204
 	print '</td>';
205 205
 
206 206
 	// Efficiency
207 207
 	$coldisplay++;
208 208
 	print '<td class="bordertop nobottom nowrap linecollost right">';
209
-	print '<input type="text" size="2" name="efficiency" id="efficiency" class="flat right" value="' . ((GETPOSTISSET("efficiency") && $action == 'addline') ? GETPOST("efficiency", 'alpha') : 1) . '">';
209
+	print '<input type="text" size="2" name="efficiency" id="efficiency" class="flat right" value="'.((GETPOSTISSET("efficiency") && $action == 'addline') ? GETPOST("efficiency", 'alpha') : 1).'">';
210 210
 	print '</td>';
211 211
 }
212 212
 // Service and workstations are active
@@ -225,8 +225,8 @@  discard block
 block discarded – undo
225 225
 
226 226
 
227 227
 $coldisplay += $colspan;
228
-print '<td class="bordertop nobottom linecoledit right valignmiddle" colspan="' . $colspan . '">';
229
-print '<input type="submit" class="button button-add small" name="addline" id="addline" value="' . $langs->trans('Add') . '">';
228
+print '<td class="bordertop nobottom linecoledit right valignmiddle" colspan="'.$colspan.'">';
229
+print '<input type="submit" class="button button-add small" name="addline" id="addline" value="'.$langs->trans('Add').'">';
230 230
 print '</td>';
231 231
 print '</tr>';
232 232
 
Please login to merge, or discard this patch.
htdocs/core/modules/oauth/google_oauthcallback.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
 
180 180
 	// Set approval_prompt. Note: A refresh token will be provided only if prompt is done.
181 181
 	if ($forlogin) {
182
-		$approval_prompt = getDolGlobalString('OAUTH_GOOGLE_FORCE_PROMPT_ON_LOGIN', 'auto');	// Can be 'force'
182
+		$approval_prompt = getDolGlobalString('OAUTH_GOOGLE_FORCE_PROMPT_ON_LOGIN', 'auto'); // Can be 'force'
183 183
 		$apiService->setApprouvalPrompt($approval_prompt);
184 184
 	} else {
185 185
 		$apiService->setApprouvalPrompt('force');
@@ -327,10 +327,10 @@  discard block
 block discarded – undo
327 327
 					$entitytosearchuser = ((isset($tmparray['entity']) && $tmparray['entity'] != '') ? $tmparray['entity'] : -1);
328 328
 
329 329
 					// Delete the old token
330
-					$storage->clearToken('Google');	// Delete the token called ("Google-".$storage->keyforprovider)
330
+					$storage->clearToken('Google'); // Delete the token called ("Google-".$storage->keyforprovider)
331 331
 
332 332
 					$tmpuser = new User($db);
333
-					$res = $tmpuser->fetch(0, '', '', 0, $entitytosearchuser, $useremail, 0, 1);	// Load user. Can load with email_oauth2.
333
+					$res = $tmpuser->fetch(0, '', '', 0, $entitytosearchuser, $useremail, 0, 1); // Load user. Can load with email_oauth2.
334 334
 
335 335
 					if ($res > 0) {
336 336
 						$username = $tmpuser->login;
Please login to merge, or discard this patch.
htdocs/core/modules/oauth/generic_oauthcallback.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
 // access type needed to have oauth provider refreshing token
150 150
 // also note that a refresh token is sent only after a prompt
151 151
 if (method_exists($apiService, 'setAccessType')) {
152
-	$apiService->setAccessType('offline');		// Most generic OAUTH provider does not provide AccessType online/offline. They are mostly offline.  // @phan-suppress-current-line PhanUndeclaredMethod
152
+	$apiService->setAccessType('offline'); // Most generic OAUTH provider does not provide AccessType online/offline. They are mostly offline.  // @phan-suppress-current-line PhanUndeclaredMethod
153 153
 }
154 154
 
155 155
 if (!getDolGlobalString($keyforparamid)) {
@@ -193,13 +193,13 @@  discard block
 block discarded – undo
193 193
 
194 194
 	// Set approval_prompt. Note: A refresh token will be provided only if prompt is done.
195 195
 	if ($forlogin) {
196
-		$approval_prompt = getDolGlobalString('OAUTH_'.$genericstring.'_FORCE_PROMPT_ON_LOGIN', 'auto');	// Can be 'force'
196
+		$approval_prompt = getDolGlobalString('OAUTH_'.$genericstring.'_FORCE_PROMPT_ON_LOGIN', 'auto'); // Can be 'force'
197 197
 		if (method_exists($apiService, 'setApprouvalPrompt')) {
198
-			$apiService->setApprouvalPrompt($approval_prompt);  // @phan-suppress-current-line PhanUndeclaredMethod
198
+			$apiService->setApprouvalPrompt($approval_prompt); // @phan-suppress-current-line PhanUndeclaredMethod
199 199
 		}
200 200
 	} else {
201 201
 		if (method_exists($apiService, 'setApprouvalPrompt')) {
202
-			$apiService->setApprouvalPrompt('force');  // @phan-suppress-current-line PhanUndeclaredMethod
202
+			$apiService->setApprouvalPrompt('force'); // @phan-suppress-current-line PhanUndeclaredMethod
203 203
 		}
204 204
 	}
205 205
 
@@ -337,10 +337,10 @@  discard block
 block discarded – undo
337 337
 					$entitytosearchuser = ((isset($tmparray['entity']) && $tmparray['entity'] != '') ? $tmparray['entity'] : -1);
338 338
 
339 339
 					// Delete the old token
340
-					$storage->clearToken($genericstring);	// Delete the token called ("Generic-".$storage->keyforprovider)
340
+					$storage->clearToken($genericstring); // Delete the token called ("Generic-".$storage->keyforprovider)
341 341
 
342 342
 					$tmpuser = new User($db);
343
-					$res = $tmpuser->fetch(0, '', '', 0, $entitytosearchuser, $useremail, 0, 1);	// Load user. Can load with email_oauth2.
343
+					$res = $tmpuser->fetch(0, '', '', 0, $entitytosearchuser, $useremail, 0, 1); // Load user. Can load with email_oauth2.
344 344
 
345 345
 					if ($res > 0) {
346 346
 						$username = $tmpuser->login;
Please login to merge, or discard this patch.