Completed
Branch develop (b3a2d1)
by
unknown
18:27
created
htdocs/fourn/facture/card.php 1 patch
Spacing   +46 added lines, -46 removed lines patch added patch discarded remove patch
@@ -774,7 +774,7 @@  discard block
 block discarded – undo
774 774
 			$error++;
775 775
 		}
776 776
 
777
-		$dateinvoice = dol_mktime(0, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int'), 'tzserver');	// If we enter the 02 january, we need to save the 02 january for server
777
+		$dateinvoice = dol_mktime(0, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int'), 'tzserver'); // If we enter the 02 january, we need to save the 02 january for server
778 778
 		$datedue = dol_mktime(0, 0, 0, GETPOST('echmonth', 'int'), GETPOST('echday', 'int'), GETPOST('echyear', 'int'), 'tzserver');
779 779
 		//var_dump($dateinvoice.' '.dol_print_date($dateinvoice, 'dayhour'));
780 780
 		//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'));
@@ -812,7 +812,7 @@  discard block
 block discarded – undo
812 812
 				$object->ref = GETPOST('ref', 'alphanohtml');
813 813
 				$object->ref_supplier = GETPOST('ref_supplier', 'alpha');
814 814
 				$object->socid = GETPOST('socid', 'int');
815
-				$object->libelle = GETPOST('label', 'alphanohtml');	// deprecated
815
+				$object->libelle = GETPOST('label', 'alphanohtml'); // deprecated
816 816
 				$object->label = GETPOST('label', 'alphanohtml');
817 817
 				$object->date = $dateinvoice;
818 818
 				$object->date_echeance = $datedue;
@@ -1050,28 +1050,28 @@  discard block
 block discarded – undo
1050 1050
 				$tmpproject = GETPOST('projectid', 'int');
1051 1051
 
1052 1052
 				// Creation invoice
1053
+				$object->socid = GETPOST('socid', 'int');
1054
+				$object->type = GETPOST('type', 'alphanohtml');
1055
+				$object->subtype = GETPOST('subtype', 'alphanohtml');
1056
+				$object->ref = GETPOST('ref', 'alphanohtml');
1057
+				$object->ref_supplier = GETPOST('ref_supplier', 'alphanohtml');
1053 1058
 				$object->socid				= GETPOST('socid', 'int');
1054
-				$object->type				= GETPOST('type', 'alphanohtml');
1055
-				$object->subtype            = GETPOST('subtype', 'alphanohtml');
1056
-				$object->ref				= GETPOST('ref', 'alphanohtml');
1057
-				$object->ref_supplier		= GETPOST('ref_supplier', 'alphanohtml');
1058
-				$object->socid				= GETPOST('socid', 'int');
1059
-				$object->libelle			= GETPOST('label', 'alphanohtml');	// deprecated
1059
+				$object->libelle = GETPOST('label', 'alphanohtml'); // deprecated
1060 1060
 				$object->label				= GETPOST('label', 'alphanohtml');
1061
-				$object->date				= $dateinvoice;
1062
-				$object->date_echeance		= $datedue;
1063
-				$object->note_public		= GETPOST('note_public', 'restricthtml');
1064
-				$object->note_private		= GETPOST('note_private', 'restricthtml');
1061
+				$object->date = $dateinvoice;
1062
+				$object->date_echeance = $datedue;
1063
+				$object->note_public = GETPOST('note_public', 'restricthtml');
1064
+				$object->note_private = GETPOST('note_private', 'restricthtml');
1065 1065
 				$object->cond_reglement_id	= GETPOST('cond_reglement_id');
1066 1066
 				$object->mode_reglement_id	= GETPOST('mode_reglement_id');
1067 1067
 				$object->fk_account			= GETPOST('fk_account', 'int');
1068 1068
 				$object->vat_reverse_charge	= GETPOST('vat_reverse_charge') == 'on' ? 1 : 0;
1069 1069
 				$object->fk_project			= ($tmpproject > 0) ? $tmpproject : null;
1070
-				$object->fk_incoterms		= GETPOST('incoterm_id', 'int');
1070
+				$object->fk_incoterms = GETPOST('incoterm_id', 'int');
1071 1071
 				$object->location_incoterms	= GETPOST('location_incoterms', 'alpha');
1072 1072
 				$object->multicurrency_code	= GETPOST('multicurrency_code', 'alpha');
1073
-				$object->multicurrency_tx	= GETPOST('originmulticurrency_tx', 'int');
1074
-				$object->transport_mode_id	= GETPOST('transport_mode_id');
1073
+				$object->multicurrency_tx = GETPOST('originmulticurrency_tx', 'int');
1074
+				$object->transport_mode_id = GETPOST('transport_mode_id');
1075 1075
 
1076 1076
 				// Auto calculation of date due if not filled by user
1077 1077
 				if (empty($object->date_echeance)) {
@@ -1412,7 +1412,7 @@  discard block
 block discarded – undo
1412 1412
 		// Edit line
1413 1413
 		$db->begin();
1414 1414
 
1415
-		if (! $object->fetch($id) > 0) {
1415
+		if (!$object->fetch($id) > 0) {
1416 1416
 			dol_print_error($db);
1417 1417
 		}
1418 1418
 		$object->fetch_thirdparty();
@@ -1556,7 +1556,7 @@  discard block
 block discarded – undo
1556 1556
 			$idprod = GETPOST('idprod', 'int');
1557 1557
 		}
1558 1558
 
1559
-		$tva_tx = (GETPOST('tva_tx') ? GETPOST('tva_tx') : 0);		// Can be '1.2' or '1.2 (CODE)'
1559
+		$tva_tx = (GETPOST('tva_tx') ? GETPOST('tva_tx') : 0); // Can be '1.2' or '1.2 (CODE)'
1560 1560
 
1561 1561
 		$price_ht = price2num(GETPOST('price_ht'), 'MU', 2);
1562 1562
 		$price_ht_devise = price2num(GETPOST('multicurrency_price_ht'), 'CU', 2);
@@ -2252,7 +2252,7 @@  discard block
 block discarded – undo
2252 2252
 	print '<form name="add" action="'.$_SERVER["PHP_SELF"].'" method="post">';
2253 2253
 	print '<input type="hidden" name="token" value="'.newToken().'">';
2254 2254
 	print '<input type="hidden" name="action" value="add">';
2255
-	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
2255
+	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
2256 2256
 
2257 2257
 	if (!empty($societe->id) && $societe->id > 0) {
2258 2258
 		print '<input type="hidden" name="socid" value="'.$societe->id.'">'."\n";
@@ -2336,7 +2336,7 @@  discard block
 block discarded – undo
2336 2336
 
2337 2337
 			$sql = 'SELECT r.rowid, r.titre as title, r.total_ttc';
2338 2338
 			$sql .= ' FROM '.MAIN_DB_PREFIX.'facture_fourn_rec as r';
2339
-			$sql .= ' WHERE r.fk_soc = '. (int) $invoice_predefined->socid;
2339
+			$sql .= ' WHERE r.fk_soc = '.(int) $invoice_predefined->socid;
2340 2340
 
2341 2341
 			$resql = $db->query($sql);
2342 2342
 			if ($resql) {
@@ -2403,7 +2403,7 @@  discard block
 block discarded – undo
2403 2403
 			// Deposit - Down payment
2404 2404
 			if (!getDolGlobalString('INVOICE_DISABLE_DEPOSIT')) {
2405 2405
 				print '<div class="tagtr listofinvoicetype"><div class="tagtd listofinvoicetype">';
2406
-				$tmp='<input type="radio" id="radio_deposit" name="type" value="3"' . (GETPOSTINT('type') == 3 ? ' checked' : '') . '> ';
2406
+				$tmp = '<input type="radio" id="radio_deposit" name="type" value="3"'.(GETPOSTINT('type') == 3 ? ' checked' : '').'> ';
2407 2407
 				print '<script type="text/javascript">
2408 2408
 				jQuery(document).ready(function() {
2409 2409
 					jQuery("#typestandardinvoice, #valuestandardinvoice").click(function() {
@@ -2449,7 +2449,7 @@  discard block
 block discarded – undo
2449 2449
 					print $form->selectarray('typedeposit', $arraylist, GETPOST('typedeposit', 'aZ09'), 0, 0, 0, '', 1);
2450 2450
 					print '</td>';
2451 2451
 					print '<td class="nowrap" style="padding-left: 5px">';
2452
-					print '<span class="opacitymedium paddingleft">'.$langs->trans("AmountOrPercent").'</span><input type="text" id="valuedeposit" name="valuedeposit" class="width75 right" value="' . GETPOST('valuedeposit', 'int') . '"/>';
2452
+					print '<span class="opacitymedium paddingleft">'.$langs->trans("AmountOrPercent").'</span><input type="text" id="valuedeposit" name="valuedeposit" class="width75 right" value="'.GETPOST('valuedeposit', 'int').'"/>';
2453 2453
 					print '</td>';
2454 2454
 				}
2455 2455
 				print '</tr></table>';
@@ -2604,7 +2604,7 @@  discard block
 block discarded – undo
2604 2604
 				if (!getDolGlobalString('INVOICE_CREDIT_NOTE_STANDALONE')) {
2605 2605
 					$tmp = '<input type="radio" name="type" id="radio_creditnote" value="0" disabled> ';
2606 2606
 				} else {
2607
-					$tmp='<input type="radio" name="type" id="radio_creditnote" value="2"> ';
2607
+					$tmp = '<input type="radio" name="type" id="radio_creditnote" value="2"> ';
2608 2608
 				}
2609 2609
 				$text = $tmp.$langs->trans("InvoiceAvoir").' ';
2610 2610
 				$text .= '<span class="opacitymedium">('.$langs->trans("YouMustCreateInvoiceFromSupplierThird").')</span> ';
@@ -2697,8 +2697,8 @@  discard block
 block discarded – undo
2697 2697
 
2698 2698
 		// Vat reverse-charge by default
2699 2699
 		if (getDolGlobalString('ACCOUNTING_FORCE_ENABLE_VAT_REVERSE_CHARGE')) {
2700
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php';
2701
-			print '<tr><td>' . $langs->trans('VATReverseCharge') . '</td><td>';
2700
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
2701
+			print '<tr><td>'.$langs->trans('VATReverseCharge').'</td><td>';
2702 2702
 			// 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
2703 2703
 			if ($vat_reverse_charge == 1 || $societe->vat_reverse_charge == 1 || ($societe->country_code != 'FR' && isInEEC($societe) && !empty($societe->tva_intra))) {
2704 2704
 				$vat_reverse_charge = 1;
@@ -2706,7 +2706,7 @@  discard block
 block discarded – undo
2706 2706
 				$vat_reverse_charge = 0;
2707 2707
 			}
2708 2708
 
2709
-			print '<input type="checkbox" name="vat_reverse_charge"'. (!empty($vat_reverse_charge) ? ' checked ' : '') . '>';
2709
+			print '<input type="checkbox" name="vat_reverse_charge"'.(!empty($vat_reverse_charge) ? ' checked ' : '').'>';
2710 2710
 			print '</td></tr>';
2711 2711
 		}
2712 2712
 
@@ -3270,7 +3270,7 @@  discard block
 block discarded – undo
3270 3270
 					$facavoir->fetch($id);
3271 3271
 					$invoicecredits[] = $facavoir->getNomUrl(1);
3272 3272
 				}
3273
-				print ' <span class="opacitymediumbycolor paddingleft">'.$langs->transnoentities("InvoiceHasAvoir") . (count($invoicecredits) ? ' ' : '') . implode(',', $invoicecredits);
3273
+				print ' <span class="opacitymediumbycolor paddingleft">'.$langs->transnoentities("InvoiceHasAvoir").(count($invoicecredits) ? ' ' : '').implode(',', $invoicecredits);
3274 3274
 				print '</span>';
3275 3275
 			}
3276 3276
 			if (isset($objectidnext) && $objectidnext > 0) {
@@ -3466,12 +3466,12 @@  discard block
 block discarded – undo
3466 3466
 					print '<input type="hidden" name="action" value="setvatreversecharge">';
3467 3467
 					print '<input type="hidden" name="token" value="'.newToken().'">';
3468 3468
 
3469
-					print '<input type="checkbox" name="vat_reverse_charge"' . ($object->vat_reverse_charge == '1' ? ' checked ' : '') . '>';
3469
+					print '<input type="checkbox" name="vat_reverse_charge"'.($object->vat_reverse_charge == '1' ? ' checked ' : '').'>';
3470 3470
 
3471 3471
 					print '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
3472 3472
 					print '</form>';
3473 3473
 				} else {
3474
-					print '<input type="checkbox" name="vat_reverse_charge"'. ($object->vat_reverse_charge == '1' ? ' checked ' : '') . ' disabled>';
3474
+					print '<input type="checkbox" name="vat_reverse_charge"'.($object->vat_reverse_charge == '1' ? ' checked ' : '').' disabled>';
3475 3475
 				}
3476 3476
 				print '</td></tr>';
3477 3477
 			}
@@ -3533,15 +3533,15 @@  discard block
 block discarded – undo
3533 3533
 			print '<table class="border tableforfield centpercent">';
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, '', $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, '', $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, '', $langs, 0, -1, -1, $object->multicurrency_code) . '</td>';
3539
+				print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_ht, '', $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&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&calculationrule=totalofround">'.$langs->trans("Mode1").'</a>';
3560 3560
 				$s .= ' / ';
3561
-				$s .= '<a href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=calculate&calculationrule=roundoftotal">' . $langs->trans("Mode2") . '</a>';
3561
+				$s .= '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=calculate&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, '', $langs, 0, -1, -1, $object->multicurrency_code) . '</td>';
3570
+				print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_tva, '', $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, '', $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, '', $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, '', $langs, 0, -1, -1, $object->multicurrency_code) . '</td>';
3591
+				print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_ttc, '', $langs, 0, -1, -1, $object->multicurrency_code).'</td>';
3592 3592
 			}
3593 3593
 			print '</tr>';
3594 3594
 
@@ -3896,7 +3896,7 @@  discard block
 block discarded – undo
3896 3896
 					print '<tr><td colspan="'.$nbcols.'" class="right">';
3897 3897
 					print '<span class="opacitymedium">';
3898 3898
 					print $langs->trans('RemainderToPayBackMulticurrency');
3899
-					if ($resteapayeraffiche> 0) {
3899
+					if ($resteapayeraffiche > 0) {
3900 3900
 						print ' ('.$langs->trans('NegativeIfExcessRefunded').')';
3901 3901
 					}
3902 3902
 					print '</span>';
@@ -4131,7 +4131,7 @@  discard block
 block discarded – undo
4131 4131
 				}
4132 4132
 
4133 4133
 				// Clone as predefined / Create template
4134
-				if (($object->type ==  FactureFournisseur::TYPE_STANDARD || $object->type == FactureFournisseur::TYPE_DEPOSIT) && $object->statut == 0 && $usercancreate) {
4134
+				if (($object->type == FactureFournisseur::TYPE_STANDARD || $object->type == FactureFournisseur::TYPE_DEPOSIT) && $object->statut == 0 && $usercancreate) {
4135 4135
 					if (!$objectidnext && count($object->lines) > 0) {
4136 4136
 						print '<a class="butAction" href="'.DOL_URL_ROOT.'/fourn/facture/card-rec.php?facid='.$object->id.'&amp;action=create">'.$langs->trans("ChangeIntoRepeatableInvoice").'</a>';
4137 4137
 					}
Please login to merge, or discard this patch.
htdocs/fourn/class/fournisseur.facture.class.php 1 patch
Spacing   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
 	/**
216 216
 	 * @var int ID
217 217
 	 */
218
-	public $fk_account;		// default bank account
218
+	public $fk_account; // default bank account
219 219
 
220 220
 	/**
221 221
 	 * @var int Transport mode id
@@ -407,7 +407,7 @@  discard block
 block discarded – undo
407 407
 		if ($this->fac_rec > 0) {
408 408
 			$this->fk_fac_rec_source = $this->fac_rec;
409 409
 
410
-			require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.facture-rec.class.php';
410
+			require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture-rec.class.php';
411 411
 			$_facrec = new FactureFournisseurRec($this->db);
412 412
 			$result = $_facrec->fetch($this->fac_rec);
413 413
 			$result = $_facrec->fetchObjectLinked(null, '', null, '', 'OR', 1, 'sourcetype', 0); // This load $_facrec->linkedObjectsIds
@@ -442,13 +442,13 @@  discard block
 block discarded – undo
442 442
 			$this->location_incoterms = $_facrec->location_incoterms;
443 443
 
444 444
 			// Clean parameters
445
-			if (! $this->type) {
445
+			if (!$this->type) {
446 446
 				$this->type = self::TYPE_STANDARD;
447 447
 			}
448 448
 			if (!empty(GETPOST('ref_supplier'))) {
449 449
 				$this->ref_supplier = trim($this->ref_supplier);
450 450
 			} else {
451
-				$this->ref_supplier = trim($this->ref_supplier . '_' . ($_facrec->nb_gen_done + 1));
451
+				$this->ref_supplier = trim($this->ref_supplier.'_'.($_facrec->nb_gen_done + 1));
452 452
 			}
453 453
 			$this->note_public = trim($this->note_public);
454 454
 			$this->note_private = trim($this->note_private);
@@ -456,11 +456,11 @@  discard block
 block discarded – undo
456 456
 
457 457
 			$this->array_options = $_facrec->array_options;
458 458
 
459
-			if (! $this->mode_reglement_id) {
459
+			if (!$this->mode_reglement_id) {
460 460
 				$this->mode_reglement_id = 0;
461 461
 			}
462 462
 			$this->status = self::STATUS_DRAFT;
463
-			$this->statut = self::STATUS_DRAFT;	// deprecated
463
+			$this->statut = self::STATUS_DRAFT; // deprecated
464 464
 
465 465
 			$this->linked_objects = $_facrec->linkedObjectsIds;
466 466
 			// We do not add link to template invoice or next invoice will be linked to all generated invoices
@@ -708,7 +708,7 @@  discard block
 block discarded – undo
708 708
 			/*
709 709
 			 * Insert lines of template invoices
710 710
 			 */
711
-			if (! $error && $this->fac_rec > 0) {
711
+			if (!$error && $this->fac_rec > 0) {
712 712
 				foreach ($_facrec->lines as $i => $val) {
713 713
 					if ($_facrec->lines[$i]->fk_product) {
714 714
 						$prod = new Product($this->db);
@@ -723,7 +723,7 @@  discard block
 block discarded – undo
723 723
 					$localtax1_tx=get_localtax($tva_tx,1,$soc,$mysoc,$tva_npr);
724 724
 					$localtax2_tx=get_localtax($tva_tx,2,$soc,$mysoc,$tva_npr);
725 725
 					*/
726
-					$tva_tx = $_facrec->lines[$i]->tva_tx . ($_facrec->lines[$i]->vat_src_code ? '(' . $_facrec->lines[$i]->vat_src_code . ')' : '');
726
+					$tva_tx = $_facrec->lines[$i]->tva_tx.($_facrec->lines[$i]->vat_src_code ? '('.$_facrec->lines[$i]->vat_src_code.')' : '');
727 727
 					$tva_npr = $_facrec->lines[$i]->info_bits;
728 728
 					if (empty($tva_tx)) {
729 729
 						$tva_npr = 0;
@@ -735,8 +735,8 @@  discard block
 block discarded – undo
735 735
 					$buyprice = empty($_facrec->lines[$i]->buyprice) ? 0 : $_facrec->lines[$i]->buyprice;
736 736
 
737 737
 					// If buyprice not defined from template invoice, we try to guess the best value
738
-					if (! $buyprice && $_facrec->lines[$i]->fk_product > 0) {
739
-						require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.product.class.php';
738
+					if (!$buyprice && $_facrec->lines[$i]->fk_product > 0) {
739
+						require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php';
740 740
 						$producttmp = new ProductFournisseur($this->db);
741 741
 						$producttmp->fetch($_facrec->lines[$i]->fk_product);
742 742
 
@@ -921,11 +921,11 @@  discard block
 block discarded – undo
921 921
 				$this->id = $obj->rowid;
922 922
 				$this->ref = $obj->ref ? $obj->ref : $obj->rowid; // We take rowid if ref is empty for backward compatibility
923 923
 
924
-				$this->ref_supplier         = $obj->ref_supplier;
925
-				$this->ref_ext			    = $obj->ref_ext;
926
-				$this->entity				= $obj->entity;
924
+				$this->ref_supplier = $obj->ref_supplier;
925
+				$this->ref_ext = $obj->ref_ext;
926
+				$this->entity = $obj->entity;
927 927
 				$this->type					= empty($obj->type) ? self::TYPE_STANDARD : $obj->type;
928
-				$this->subtype				= $obj->subtype;
928
+				$this->subtype = $obj->subtype;
929 929
 				$this->socid				= $obj->fk_soc;
930 930
 				$this->datec				= $this->db->jdate($obj->datec);
931 931
 				$this->date					= $this->db->jdate($obj->datef);
@@ -943,13 +943,13 @@  discard block
 block discarded – undo
943 943
 				$this->total_tva			= $obj->total_tva;
944 944
 				$this->total_ttc			= $obj->total_ttc;
945 945
 				$this->status				= $obj->status;
946
-				$this->statut				= $obj->status;	// For backward compatibility
947
-				$this->fk_statut			= $obj->status;	// For backward compatibility
946
+				$this->statut				= $obj->status; // For backward compatibility
947
+				$this->fk_statut			= $obj->status; // For backward compatibility
948 948
 				$this->user_creation_id     = $obj->fk_user_author;
949
-				$this->author				= $obj->fk_user_author;	// deprecated
949
+				$this->author				= $obj->fk_user_author; // deprecated
950 950
 				$this->user_validation_id   = $obj->fk_user_valid;
951 951
 				$this->fk_facture_source	= $obj->fk_facture_source;
952
-				$this->vat_reverse_charge	= empty($obj->vat_reverse_charge) ? 0 : 1;
952
+				$this->vat_reverse_charge = empty($obj->vat_reverse_charge) ? 0 : 1;
953 953
 				$this->fk_fac_rec_source	= $obj->fk_fac_rec_source;
954 954
 				$this->fk_project           = $obj->fk_project;
955 955
 				$this->cond_reglement_id	= $obj->fk_cond_reglement;
@@ -984,7 +984,7 @@  discard block
 block discarded – undo
984 984
 
985 985
 				$this->extraparams = isset($obj->extraparams) ? (array) json_decode($obj->extraparams, true) : array();
986 986
 
987
-				$this->socid  = $obj->socid;
987
+				$this->socid = $obj->socid;
988 988
 
989 989
 				// Retrieve all extrafield
990 990
 				// fetch optionals attributes and labels
@@ -1051,11 +1051,11 @@  discard block
 block discarded – undo
1051 1051
 					$line->date_end         = $obj->date_end;
1052 1052
 					$line->product_ref      = $obj->product_ref;
1053 1053
 					$line->ref              = $obj->product_ref;
1054
-					$line->ref_supplier		= $obj->ref_supplier;
1054
+					$line->ref_supplier = $obj->ref_supplier;
1055 1055
 					$line->libelle			= $obj->label;
1056 1056
 					$line->label  			= $obj->label;
1057 1057
 					$line->product_barcode  = $obj->product_barcode;
1058
-					$line->product_desc		= $obj->product_desc;
1058
+					$line->product_desc = $obj->product_desc;
1059 1059
 					$line->subprice         = $obj->pu_ht;
1060 1060
 					$line->pu_ht            = $obj->pu_ht;
1061 1061
 					$line->pu_ttc			= $obj->pu_ttc;
@@ -1065,7 +1065,7 @@  discard block
 block discarded – undo
1065 1065
 					$line->localtax2_tx		= $obj->localtax2_tx;
1066 1066
 					$line->localtax1_type	= $obj->localtax1_type;
1067 1067
 					$line->localtax2_type	= $obj->localtax2_type;
1068
-					$line->qty				= $obj->qty;
1068
+					$line->qty = $obj->qty;
1069 1069
 					$line->remise_percent   = $obj->remise_percent;
1070 1070
 					$line->fk_remise_except = $obj->fk_remise_except;
1071 1071
 					//$line->tva			= $obj->total_tva; // deprecated
@@ -2710,7 +2710,7 @@  discard block
 block discarded – undo
2710 2710
 
2711 2711
 			while ($obj = $this->db->fetch_object($resql)) {
2712 2712
 				$facturestatic->date_echeance = $this->db->jdate($obj->datefin);
2713
-				$facturestatic->statut = $obj->status;	// For backward compatibility
2713
+				$facturestatic->statut = $obj->status; // For backward compatibility
2714 2714
 				$facturestatic->status = $obj->status;
2715 2715
 
2716 2716
 				$response->nbtodo++;
@@ -2921,7 +2921,7 @@  discard block
 block discarded – undo
2921 2921
 			}
2922 2922
 		}
2923 2923
 		global $action;
2924
-		$hookmanager->initHooks(array($this->element . 'dao'));
2924
+		$hookmanager->initHooks(array($this->element.'dao'));
2925 2925
 		$parameters = array('id' => $this->id, 'getnomurl' => &$result);
2926 2926
 		$reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
2927 2927
 		if ($reshook > 0) {
@@ -2952,7 +2952,7 @@  discard block
 block discarded – undo
2952 2952
 
2953 2953
 		$mybool = false;
2954 2954
 
2955
-		$file = getDolGlobalString('INVOICE_SUPPLIER_ADDON_NUMBER') . ".php";
2955
+		$file = getDolGlobalString('INVOICE_SUPPLIER_ADDON_NUMBER').".php";
2956 2956
 		$classname = getDolGlobalString('INVOICE_SUPPLIER_ADDON_NUMBER');
2957 2957
 
2958 2958
 		// Include file with class
@@ -3140,7 +3140,7 @@  discard block
 block discarded – undo
3140 3140
 		// Load source object
3141 3141
 		$object->fetch($fromid);
3142 3142
 		$object->id = 0;
3143
-		$object->statut = self::STATUS_DRAFT;	// For backward compatibility
3143
+		$object->statut = self::STATUS_DRAFT; // For backward compatibility
3144 3144
 		$object->status = self::STATUS_DRAFT;
3145 3145
 
3146 3146
 		$object->fetch_thirdparty(); // We need it to recalculate VAT localtaxes according to main sale taxes and vendor
@@ -3439,14 +3439,14 @@  discard block
 block discarded – undo
3439 3439
 		if (!empty($paymentmode) && $paymentmode != 'all') {
3440 3440
 			$sql .= ", ".MAIN_DB_PREFIX."c_paiement as cp";
3441 3441
 		}
3442
-		$sql .= " WHERE f.paye = 0";	// Only unpaid
3443
-		$sql .= " AND f.fk_statut = ".self::STATUS_VALIDATED;	// Only validated status
3442
+		$sql .= " WHERE f.paye = 0"; // Only unpaid
3443
+		$sql .= " AND f.fk_statut = ".self::STATUS_VALIDATED; // Only validated status
3444 3444
 		if ($datetouse == 'invoicedate') {
3445 3445
 			$sql .= " AND f.datef = '".$this->db->idate($tmpidate, 'gmt')."'";
3446 3446
 		} else {
3447 3447
 			$sql .= " AND f.date_lim_reglement = '".$this->db->idate($tmpidate, 'gmt')."'";
3448 3448
 		}
3449
-		$sql .= " AND f.entity IN (".getEntity('supplier_invoice', 0).")";	// One batch process only one company (no sharing)
3449
+		$sql .= " AND f.entity IN (".getEntity('supplier_invoice', 0).")"; // One batch process only one company (no sharing)
3450 3450
 		if (!empty($paymentmode) && $paymentmode != 'all') {
3451 3451
 			$sql .= " AND f.fk_mode_reglement = cp.id AND cp.code = '".$this->db->escape($paymentmode)."'";
3452 3452
 		}
@@ -3666,7 +3666,7 @@  discard block
 block discarded – undo
3666 3666
 								$actioncomm->create($user);
3667 3667
 							}
3668 3668
 
3669
-							$this->db->commit();	// We always commit
3669
+							$this->db->commit(); // We always commit
3670 3670
 						}
3671 3671
 
3672 3672
 						if ($errormesg) {
@@ -3975,11 +3975,11 @@  discard block
 block discarded – undo
3975 3975
 		$this->id = $obj->rowid;
3976 3976
 		$this->rowid = $obj->rowid;
3977 3977
 		$this->fk_facture_fourn = $obj->fk_facture_fourn;
3978
-		$this->description		= $obj->line_desc;
3979
-		$this->desc				= $obj->line_desc;
3978
+		$this->description = $obj->line_desc;
3979
+		$this->desc = $obj->line_desc;
3980 3980
 		$this->date_start = $obj->date_start;
3981 3981
 		$this->date_end = $obj->date_end;
3982
-		$this->product_ref		= $obj->product_ref;
3982
+		$this->product_ref = $obj->product_ref;
3983 3983
 		$this->ref_supplier		= $obj->ref_supplier;
3984 3984
 		$this->product_desc		= $obj->product_desc;
3985 3985
 
@@ -3992,7 +3992,7 @@  discard block
 block discarded – undo
3992 3992
 		$this->localtax1_type	= $obj->localtax1_type;
3993 3993
 		$this->localtax2_type	= $obj->localtax2_type;
3994 3994
 
3995
-		$this->qty				= $obj->qty;
3995
+		$this->qty = $obj->qty;
3996 3996
 		$this->remise_percent = $obj->remise_percent;
3997 3997
 		$this->fk_remise_except = $obj->fk_remise_except;
3998 3998
 		//$this->tva				= $obj->total_tva; // deprecated
Please login to merge, or discard this patch.
htdocs/core/actions_massactions.inc.php 1 patch
Spacing   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -359,7 +359,7 @@  discard block
 block discarded – undo
359 359
 					if (getDolGlobalString('MAIL_MASS_ACTION_ADD_LAST_IF_MAIN_DOC_NOT_FOUND') && !empty($objectobj->last_main_doc)) {
360 360
 						$file_check_list[] = array(
361 361
 							'name' => basename($objectobj->last_main_doc),
362
-							'path' => DOL_DATA_ROOT . '/' . $objectobj->last_main_doc,
362
+							'path' => DOL_DATA_ROOT.'/'.$objectobj->last_main_doc,
363 363
 						);
364 364
 					}
365 365
 					foreach ($file_check_list as $file_check_arr) {
@@ -405,7 +405,7 @@  discard block
 block discarded – undo
405 405
 				if ($fromtype === 'user') {
406 406
 					$from = dol_string_nospecial($user->getFullName($langs), ' ', array(",")).' <'.$user->email.'>';
407 407
 				} elseif ($fromtype === 'company') {
408
-					$from = getDolGlobalString('MAIN_INFO_SOCIETE_NOM') . ' <' . getDolGlobalString('MAIN_INFO_SOCIETE_MAIL').'>';
408
+					$from = getDolGlobalString('MAIN_INFO_SOCIETE_NOM').' <'.getDolGlobalString('MAIN_INFO_SOCIETE_MAIL').'>';
409 409
 				} elseif (preg_match('/user_aliases_(\d+)/', $fromtype, $reg)) {
410 410
 					$tmp = explode(',', $user->email_aliases);
411 411
 					$from = trim($tmp[($reg[1] - 1)]);
@@ -429,25 +429,25 @@  discard block
 block discarded – undo
429 429
 
430 430
 				$sendtobcc = GETPOST('sendtoccc');
431 431
 				if ($objectclass == 'Propal') {
432
-					$sendtobcc .= (!getDolGlobalString('MAIN_MAIL_AUTOCOPY_PROPOSAL_TO') ? '' : (($sendtobcc ? ", " : "") . getDolGlobalString('MAIN_MAIL_AUTOCOPY_PROPOSAL_TO')));
432
+					$sendtobcc .= (!getDolGlobalString('MAIN_MAIL_AUTOCOPY_PROPOSAL_TO') ? '' : (($sendtobcc ? ", " : "").getDolGlobalString('MAIN_MAIL_AUTOCOPY_PROPOSAL_TO')));
433 433
 				}
434 434
 				if ($objectclass == 'Commande') {
435
-					$sendtobcc .= (!getDolGlobalString('MAIN_MAIL_AUTOCOPY_ORDER_TO') ? '' : (($sendtobcc ? ", " : "") . getDolGlobalString('MAIN_MAIL_AUTOCOPY_ORDER_TO')));
435
+					$sendtobcc .= (!getDolGlobalString('MAIN_MAIL_AUTOCOPY_ORDER_TO') ? '' : (($sendtobcc ? ", " : "").getDolGlobalString('MAIN_MAIL_AUTOCOPY_ORDER_TO')));
436 436
 				}
437 437
 				if ($objectclass == 'Facture') {
438
-					$sendtobcc .= (!getDolGlobalString('MAIN_MAIL_AUTOCOPY_INVOICE_TO') ? '' : (($sendtobcc ? ", " : "") . getDolGlobalString('MAIN_MAIL_AUTOCOPY_INVOICE_TO')));
438
+					$sendtobcc .= (!getDolGlobalString('MAIN_MAIL_AUTOCOPY_INVOICE_TO') ? '' : (($sendtobcc ? ", " : "").getDolGlobalString('MAIN_MAIL_AUTOCOPY_INVOICE_TO')));
439 439
 				}
440 440
 				if ($objectclass == 'SupplierProposal') {
441
-					$sendtobcc .= (!getDolGlobalString('MAIN_MAIL_AUTOCOPY_SUPPLIER_PROPOSAL_TO') ? '' : (($sendtobcc ? ", " : "") . getDolGlobalString('MAIN_MAIL_AUTOCOPY_SUPPLIER_PROPOSAL_TO')));
441
+					$sendtobcc .= (!getDolGlobalString('MAIN_MAIL_AUTOCOPY_SUPPLIER_PROPOSAL_TO') ? '' : (($sendtobcc ? ", " : "").getDolGlobalString('MAIN_MAIL_AUTOCOPY_SUPPLIER_PROPOSAL_TO')));
442 442
 				}
443 443
 				if ($objectclass == 'CommandeFournisseur') {
444
-					$sendtobcc .= (!getDolGlobalString('MAIN_MAIL_AUTOCOPY_SUPPLIER_ORDER_TO') ? '' : (($sendtobcc ? ", " : "") . getDolGlobalString('MAIN_MAIL_AUTOCOPY_SUPPLIER_ORDER_TO')));
444
+					$sendtobcc .= (!getDolGlobalString('MAIN_MAIL_AUTOCOPY_SUPPLIER_ORDER_TO') ? '' : (($sendtobcc ? ", " : "").getDolGlobalString('MAIN_MAIL_AUTOCOPY_SUPPLIER_ORDER_TO')));
445 445
 				}
446 446
 				if ($objectclass == 'FactureFournisseur') {
447
-					$sendtobcc .= (!getDolGlobalString('MAIN_MAIL_AUTOCOPY_SUPPLIER_INVOICE_TO') ? '' : (($sendtobcc ? ", " : "") . getDolGlobalString('MAIN_MAIL_AUTOCOPY_SUPPLIER_INVOICE_TO')));
447
+					$sendtobcc .= (!getDolGlobalString('MAIN_MAIL_AUTOCOPY_SUPPLIER_INVOICE_TO') ? '' : (($sendtobcc ? ", " : "").getDolGlobalString('MAIN_MAIL_AUTOCOPY_SUPPLIER_INVOICE_TO')));
448 448
 				}
449 449
 				if ($objectclass == 'Project') {
450
-					$sendtobcc .= (!getDolGlobalString('MAIN_MAIL_AUTOCOPY_PROJECT_TO') ? '' : (($sendtobcc ? ", " : "") . getDolGlobalString('MAIN_MAIL_AUTOCOPY_PROJECT_TO')));
450
+					$sendtobcc .= (!getDolGlobalString('MAIN_MAIL_AUTOCOPY_PROJECT_TO') ? '' : (($sendtobcc ? ", " : "").getDolGlobalString('MAIN_MAIL_AUTOCOPY_PROJECT_TO')));
451 451
 				}
452 452
 
453 453
 				// $listofqualifiedobj is array with key = object id and value is instance of qualified objects, for the current thirdparty (but thirdparty property is not loaded yet)
@@ -603,7 +603,7 @@  discard block
 block discarded – undo
603 603
 								$objectobj2->fk_element		= $objid2;
604 604
 								$objectobj2->elementtype	= $objectobj2->element;
605 605
 								if (getDolGlobalString('MAIN_MAIL_REPLACE_EVENT_TITLE_BY_EMAIL_SUBJECT')) {
606
-									$objectobj2->actionmsg2		= $subjectreplaced; // Short text
606
+									$objectobj2->actionmsg2 = $subjectreplaced; // Short text
607 607
 								}
608 608
 
609 609
 								$triggername = strtoupper(get_class($objectobj2)).'_SENTBYMAIL';
@@ -659,7 +659,7 @@  discard block
 block discarded – undo
659 659
 							} elseif (getDolGlobalString('MAIN_DISABLE_ALL_MAILS')) {
660 660
 								$resaction .= '<div class="warning">No mail sent. Feature is disabled by option MAIN_DISABLE_ALL_MAILS</div>';
661 661
 							} else {
662
-								$resaction .= $langs->trans('ErrorFailedToSendMail', $from, $sendto) . '<br><div class="error">(unhandled error)</div>';
662
+								$resaction .= $langs->trans('ErrorFailedToSendMail', $from, $sendto).'<br><div class="error">(unhandled error)</div>';
663 663
 							}
664 664
 						}
665 665
 					}
@@ -1065,7 +1065,7 @@  discard block
 block discarded – undo
1065 1065
 				continue;
1066 1066
 			}
1067 1067
 
1068
-			if ($objectclass == 'Holiday' && ! in_array($objecttmp->statut, array(Holiday::STATUS_DRAFT, Holiday::STATUS_CANCELED, Holiday::STATUS_REFUSED))) {
1068
+			if ($objectclass == 'Holiday' && !in_array($objecttmp->statut, array(Holiday::STATUS_DRAFT, Holiday::STATUS_CANCELED, Holiday::STATUS_REFUSED))) {
1069 1069
 				$langs->load("errors");
1070 1070
 				$nbignored++;
1071 1071
 				$TMsg[] = '<div class="error">'.$langs->trans('ErrorLeaveRequestMustBeDraftCanceledOrRefusedToBeDeleted', $objecttmp->ref).'</div><br>';
@@ -1090,7 +1090,7 @@  discard block
 block discarded – undo
1090 1090
 				$result = $objecttmp->delete($objecttmp->id, $user, 0);
1091 1091
 			} elseif ($objecttmp->element == 'action') {
1092 1092
 				/** @var ActionComm $objecttmp */
1093
-				$result = $objecttmp->delete();	// TODO Add User $user as first param
1093
+				$result = $objecttmp->delete(); // TODO Add User $user as first param
1094 1094
 			} else {
1095 1095
 				$result = $objecttmp->delete($user);
1096 1096
 			}
@@ -1210,9 +1210,9 @@  discard block
 block discarded – undo
1210 1210
 if (!$error && ($action == 'affecttag' && $confirm == 'yes') && $permissiontoadd) {
1211 1211
 	$db->begin();
1212 1212
 
1213
-	$affecttag_type=GETPOST('affecttag_type', 'alpha');
1213
+	$affecttag_type = GETPOST('affecttag_type', 'alpha');
1214 1214
 	if (!empty($affecttag_type)) {
1215
-		$affecttag_type_array=explode(',', $affecttag_type);
1215
+		$affecttag_type_array = explode(',', $affecttag_type);
1216 1216
 	} else {
1217 1217
 		setEventMessage('CategTypeNotFound', 'errors');
1218 1218
 	}
@@ -1220,8 +1220,8 @@  discard block
 block discarded – undo
1220 1220
 		//check if tag type submitted exists into Tag Map categorie class
1221 1221
 		require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
1222 1222
 		$categ = new Categorie($db);
1223
-		$to_affecttag_type_array=array();
1224
-		$categ_type_array=$categ->getMapList();
1223
+		$to_affecttag_type_array = array();
1224
+		$categ_type_array = $categ->getMapList();
1225 1225
 		foreach ($categ_type_array as $categdef) {
1226 1226
 			if (in_array($categdef['code'], $affecttag_type_array)) {
1227 1227
 				$to_affecttag_type_array[] = $categdef['code'];
@@ -1232,7 +1232,7 @@  discard block
 block discarded – undo
1232 1232
 		$nbok = 0;
1233 1233
 		if (!empty($to_affecttag_type_array)) {
1234 1234
 			foreach ($to_affecttag_type_array as $categ_type) {
1235
-				$contcats = GETPOST('contcats_' . $categ_type, 'array');
1235
+				$contcats = GETPOST('contcats_'.$categ_type, 'array');
1236 1236
 				//var_dump($toselect);exit;
1237 1237
 				foreach ($toselect as $toselectid) {
1238 1238
 					$result = $object->fetch($toselectid);
@@ -1261,7 +1261,7 @@  discard block
 block discarded – undo
1261 1261
 			setEventMessages($langs->trans("RecordsModified", $nbok), null);
1262 1262
 		}
1263 1263
 		$db->commit();
1264
-		$toselect=array();
1264
+		$toselect = array();
1265 1265
 	} else {
1266 1266
 		$db->rollback();
1267 1267
 	}
@@ -1270,7 +1270,7 @@  discard block
 block discarded – undo
1270 1270
 if (!$error && ($action == 'updateprice' && $confirm == 'yes') && $permissiontoadd) {
1271 1271
 	$db->begin();
1272 1272
 	if (GETPOSTISSET('pricerate')) {
1273
-		$pricepercentage=GETPOST('pricerate', 'int');
1273
+		$pricepercentage = GETPOST('pricerate', 'int');
1274 1274
 		if ($pricepercentage == 0) {
1275 1275
 			setEventMessages($langs->trans("RecordsModified", 0), null);
1276 1276
 		} else {
@@ -1305,7 +1305,7 @@  discard block
 block discarded – undo
1305 1305
 			setEventMessages($langs->trans("RecordsModified", $nbok), null);
1306 1306
 		}
1307 1307
 		$db->commit();
1308
-		$toselect=array();
1308
+		$toselect = array();
1309 1309
 	} else {
1310 1310
 		$db->rollback();
1311 1311
 	}
@@ -1313,7 +1313,7 @@  discard block
 block discarded – undo
1313 1313
 
1314 1314
 if (!$error && ($action == 'setsupervisor' && $confirm == 'yes') && $permissiontoadd) {
1315 1315
 	$db->begin();
1316
-	$supervisortoset=GETPOST('supervisortoset');
1316
+	$supervisortoset = GETPOST('supervisortoset');
1317 1317
 	if (!empty($supervisortoset)) {
1318 1318
 		foreach ($toselect as $toselectid) {
1319 1319
 			$result = $object->fetch($toselectid);
@@ -1344,7 +1344,7 @@  discard block
 block discarded – undo
1344 1344
 			setEventMessages($langs->trans("RecordsModified", $nbok), null);
1345 1345
 		}
1346 1346
 		$db->commit();
1347
-		$toselect=array();
1347
+		$toselect = array();
1348 1348
 	} else {
1349 1349
 		$db->rollback();
1350 1350
 	}
@@ -1353,9 +1353,9 @@  discard block
 block discarded – undo
1353 1353
 if (!$error && ($action == 'affectuser' && $confirm == 'yes') && $permissiontoadd) {
1354 1354
 	$db->begin();
1355 1355
 
1356
-	$usertoaffect=GETPOST('usertoaffect');
1357
-	$projectrole=GETPOST('projectrole');
1358
-	$tasksrole=GETPOST('tasksrole');
1356
+	$usertoaffect = GETPOST('usertoaffect');
1357
+	$projectrole = GETPOST('projectrole');
1358
+	$tasksrole = GETPOST('tasksrole');
1359 1359
 	if (!empty($usertoaffect)) {
1360 1360
 		foreach ($toselect as $toselectid) {
1361 1361
 			$result = $object->fetch($toselectid);
@@ -1398,7 +1398,7 @@  discard block
 block discarded – undo
1398 1398
 			setEventMessages($langs->trans("RecordsModified", $nbok), null);
1399 1399
 		}
1400 1400
 		$db->commit();
1401
-		$toselect=array();
1401
+		$toselect = array();
1402 1402
 	} else {
1403 1403
 		$db->rollback();
1404 1404
 	}
@@ -1411,9 +1411,9 @@  discard block
 block discarded – undo
1411 1411
 	$nbok = 0;
1412 1412
 	foreach ($toselect as $toselectid) {
1413 1413
 		$result = $objecttmp->fetch($toselectid);
1414
-		if ($result>0) {
1414
+		if ($result > 0) {
1415 1415
 			if (in_array($objecttmp->element, array('societe'))) {
1416
-				$result =$objecttmp->setStatut(1);
1416
+				$result = $objecttmp->setStatut(1);
1417 1417
 			}
1418 1418
 			if ($result <= 0) {
1419 1419
 				setEventMessages($objecttmp->error, $objecttmp->errors, 'errors');
@@ -1448,9 +1448,9 @@  discard block
 block discarded – undo
1448 1448
 	$nbok = 0;
1449 1449
 	foreach ($toselect as $toselectid) {
1450 1450
 		$result = $objecttmp->fetch($toselectid);
1451
-		if ($result>0) {
1451
+		if ($result > 0) {
1452 1452
 			if (in_array($objecttmp->element, array('societe'))) {
1453
-				$result =$objecttmp->setStatut(0);
1453
+				$result = $objecttmp->setStatut(0);
1454 1454
 			}
1455 1455
 			if ($result <= 0) {
1456 1456
 				setEventMessages($objecttmp->error, $objecttmp->errors, 'errors');
@@ -1482,7 +1482,7 @@  discard block
 block discarded – undo
1482 1482
 	$db->begin();
1483 1483
 
1484 1484
 	$objecttmp = new $objectclass($db);
1485
-	$e = new ExtraFields($db);// fetch optionals attributes and labels
1485
+	$e = new ExtraFields($db); // fetch optionals attributes and labels
1486 1486
 	$e->fetch_name_optionals_label($objecttmp->table_element);
1487 1487
 
1488 1488
 	$nbok = 0;
@@ -1493,7 +1493,7 @@  discard block
 block discarded – undo
1493 1493
 		/** @var CommonObject $objecttmp */
1494 1494
 		$objecttmp = new $objectclass($db); // to avoid ghost data
1495 1495
 		$result = $objecttmp->fetch($toselectid);
1496
-		if ($result>0) {
1496
+		if ($result > 0) {
1497 1497
 			// Fill array 'array_options' with data from add form
1498 1498
 			$ret = $e->setOptionalsFromPost(null, $objecttmp, $extrafieldKeyToUpdate);
1499 1499
 			if ($ret > 0) {
@@ -1529,7 +1529,7 @@  discard block
 block discarded – undo
1529 1529
 
1530 1530
 	foreach ($toselect as $toselectid) {
1531 1531
 		$result = $objecttmp->fetch($toselectid);
1532
-		if ($result>0) {
1532
+		if ($result > 0) {
1533 1533
 			if (in_array($objecttmp->element, array('societe'))) {
1534 1534
 				$result = $objecttmp->setSalesRep(GETPOST("commercial", "alpha"));
1535 1535
 			}
@@ -1684,7 +1684,7 @@  discard block
 block discarded – undo
1684 1684
 	$objecttmp = new $objectclass($db);
1685 1685
 	$nbok = 0;
1686 1686
 	$typeholiday = GETPOST('typeholiday', 'alpha');
1687
-	$nbdaysholidays = GETPOSTFLOAT('nbdaysholidays');	// May be 1.5
1687
+	$nbdaysholidays = GETPOSTFLOAT('nbdaysholidays'); // May be 1.5
1688 1688
 
1689 1689
 	if ($nbdaysholidays <= 0) {
1690 1690
 		setEventMessages($langs->trans("WrongAmount"), "", 'errors');
@@ -1724,7 +1724,7 @@  discard block
 block discarded – undo
1724 1724
 			setEventMessages($langs->trans("HolidayRecordIncreased"), null, 'mesgs');
1725 1725
 		}
1726 1726
 		$db->commit();
1727
-		$toselect=array();
1727
+		$toselect = array();
1728 1728
 	} else {
1729 1729
 		$db->rollback();
1730 1730
 	}
@@ -1744,8 +1744,8 @@  discard block
 block discarded – undo
1744 1744
 
1745 1745
 		$defaultref = '';
1746 1746
 		$obj = !getDolGlobalString('PROJECT_TASK_ADDON') ? 'mod_task_simple' : $conf->global->PROJECT_TASK_ADDON;
1747
-		if (getDolGlobalString('PROJECT_TASK_ADDON') && is_readable(DOL_DOCUMENT_ROOT . "/core/modules/project/task/" . getDolGlobalString('PROJECT_TASK_ADDON') . ".php")) {
1748
-			require_once DOL_DOCUMENT_ROOT . "/core/modules/project/task/" . getDolGlobalString('PROJECT_TASK_ADDON') . '.php';
1747
+		if (getDolGlobalString('PROJECT_TASK_ADDON') && is_readable(DOL_DOCUMENT_ROOT."/core/modules/project/task/".getDolGlobalString('PROJECT_TASK_ADDON').".php")) {
1748
+			require_once DOL_DOCUMENT_ROOT."/core/modules/project/task/".getDolGlobalString('PROJECT_TASK_ADDON').'.php';
1749 1749
 			$modTask = new $obj();
1750 1750
 			$defaultref = $modTask->getNextValue(0, $clone_task);
1751 1751
 		}
@@ -1786,7 +1786,7 @@  discard block
 block discarded – undo
1786 1786
 
1787 1787
 	if (!$error) {
1788 1788
 		setEventMessage($langs->trans('NumberOfTasksCloned', $num));
1789
-		header("Refresh: 1;URL=".DOL_URL_ROOT.'/projet/tasks.php?id=' . GETPOST('projectid', 'int'));
1789
+		header("Refresh: 1;URL=".DOL_URL_ROOT.'/projet/tasks.php?id='.GETPOST('projectid', 'int'));
1790 1790
 	}
1791 1791
 }
1792 1792
 
Please login to merge, or discard this patch.
htdocs/core/class/html.formcategory.class.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -81,7 +81,7 @@
 block discarded – undo
81 81
 			$filter .= $langs->trans('UseOrOperatorShort');
82 82
 			$filter .= '</label>';
83 83
 
84
-			$filter .= '<script>'."\n";;
84
+			$filter .= '<script>'."\n"; ;
85 85
 			$filter .= "var nbSelected = jQuery('#".$htmlName."').val().length;";
86 86
 			$filter .= "console.log('Nb of element now = '+nbSelected);\n";
87 87
 			$filter .= "if (nbSelected > 1) { jQuery('.".$htmlName2."').show(); } else { jQuery('.".$htmlName2."').hide(); }\n";
Please login to merge, or discard this patch.
htdocs/core/modules/commande/doc/pdf_einstein.modules.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -270,7 +270,7 @@  discard block
 block discarded – undo
270 270
 					if (!empty($conf->mycompany->multidir_output[$object->entity])) {
271 271
 						$logodir = $conf->mycompany->multidir_output[$object->entity];
272 272
 					}
273
-					$pagecount = $pdf->setSourceFile($logodir.'/' . getDolGlobalString('MAIN_ADD_PDF_BACKGROUND'));
273
+					$pagecount = $pdf->setSourceFile($logodir.'/'.getDolGlobalString('MAIN_ADD_PDF_BACKGROUND'));
274 274
 					$tplidx = $pdf->importPage(1);
275 275
 				}
276 276
 
@@ -1456,7 +1456,7 @@  discard block
 block discarded – undo
1456 1456
 
1457 1457
 			$carac_client_name = pdfBuildThirdpartyName($thirdparty, $outputlangs);
1458 1458
 
1459
-			$mode =  'target';
1459
+			$mode = 'target';
1460 1460
 			$carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ($usecontact ? $object->contact : ''), $usecontact, $mode, $object);
1461 1461
 
1462 1462
 			// Show recipient
Please login to merge, or discard this patch.
htdocs/hrm/class/position.class.php 1 patch
Spacing   +60 added lines, -60 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
  */
27 27
 
28 28
 // Put here all includes required by your class file
29
-require_once DOL_DOCUMENT_ROOT . '/core/class/commonobject.class.php';
29
+require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php';
30 30
 //require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
31 31
 //require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
32 32
 
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
 	/**
103 103
 	 * @var array  Array with all fields and their property. Do not use it as a static var. It may be modified by constructor.
104 104
 	 */
105
-	public $fields=array(
105
+	public $fields = array(
106 106
 		'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>'1', 'position'=>1, 'notnull'=>1, 'visible'=>2, 'index'=>1, 'css'=>'left', 'comment'=>"Id"),
107 107
 		//'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>'1', 'position'=>20, 'notnull'=>1, 'visible'=>1, 'index'=>1, 'searchall'=>1, 'showoncombobox'=>'1', 'comment'=>"Reference of object"),
108 108
 		'date_creation' => array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>'1', 'position'=>500, 'notnull'=>1, 'visible'=>-2,),
@@ -267,10 +267,10 @@  discard block
 block discarded – undo
267 267
 
268 268
 		// Clear fields
269 269
 		if (property_exists($object, 'ref')) {
270
-			$object->ref = empty($this->fields['ref']['default']) ? "Copy_Of_" . $object->ref : $this->fields['ref']['default'];
270
+			$object->ref = empty($this->fields['ref']['default']) ? "Copy_Of_".$object->ref : $this->fields['ref']['default'];
271 271
 		}
272 272
 		if (property_exists($object, 'label')) {
273
-			$object->label = empty($this->fields['label']['default']) ? $langs->trans("CopyOf") . " " . $object->label : $this->fields['label']['default'];
273
+			$object->label = empty($this->fields['label']['default']) ? $langs->trans("CopyOf")." ".$object->label : $this->fields['label']['default'];
274 274
 		}
275 275
 		if (property_exists($object, 'status')) {
276 276
 			$object->status = self::STATUS_DRAFT;
@@ -382,9 +382,9 @@  discard block
 block discarded – undo
382 382
 
383 383
 		$sql = 'SELECT ';
384 384
 		$sql .= $this->getFieldList('t');
385
-		$sql .= ' FROM ' . MAIN_DB_PREFIX . $this->table_element . ' as t';
385
+		$sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.' as t';
386 386
 		if (isset($this->ismultientitymanaged) && $this->ismultientitymanaged == 1) {
387
-			$sql .= ' WHERE t.entity IN (' . getEntity($this->element) . ')';
387
+			$sql .= ' WHERE t.entity IN ('.getEntity($this->element).')';
388 388
 		} else {
389 389
 			$sql .= ' WHERE 1 = 1';
390 390
 		}
@@ -393,15 +393,15 @@  discard block
 block discarded – undo
393 393
 		if (count($filter) > 0) {
394 394
 			foreach ($filter as $key => $value) {
395 395
 				if ($key == 't.rowid') {
396
-					$sqlwhere[] = $key . '=' . $value;
396
+					$sqlwhere[] = $key.'='.$value;
397 397
 				} elseif ($key == 'customsql') {
398 398
 					$sqlwhere[] = $value;
399 399
 				} elseif (array_key_exists($key, $this->fields) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) {
400
-					$sqlwhere[] = $key . ' = \'' . $this->db->idate($value) . '\'';
400
+					$sqlwhere[] = $key.' = \''.$this->db->idate($value).'\'';
401 401
 				} elseif (strpos($value, '%') === false) {
402
-					$sqlwhere[] = $key . ' IN (' . $this->db->sanitize($this->db->escape($value)) . ')';
402
+					$sqlwhere[] = $key.' IN ('.$this->db->sanitize($this->db->escape($value)).')';
403 403
 				} else {
404
-					$sqlwhere[] = $key . ' LIKE \'%' . $this->db->escape($value) . '%\'';
404
+					$sqlwhere[] = $key.' LIKE \'%'.$this->db->escape($value).'%\'';
405 405
 				}
406 406
 			}
407 407
 		}
@@ -413,7 +413,7 @@  discard block
 block discarded – undo
413 413
 			$sql .= $this->db->order($sortfield, $sortorder);
414 414
 		}
415 415
 		if (!empty($limit)) {
416
-			$sql .= ' ' . $this->db->plimit($limit, $offset);
416
+			$sql .= ' '.$this->db->plimit($limit, $offset);
417 417
 		}
418 418
 
419 419
 		$resql = $this->db->query($sql);
@@ -434,8 +434,8 @@  discard block
 block discarded – undo
434 434
 
435 435
 			return $records;
436 436
 		} else {
437
-			$this->errors[] = 'Error ' . $this->db->lasterror();
438
-			dol_syslog(__METHOD__ . ' ' . implode(',', $this->errors), LOG_ERR);
437
+			$this->errors[] = 'Error '.$this->db->lasterror();
438
+			dol_syslog(__METHOD__.' '.implode(',', $this->errors), LOG_ERR);
439 439
 
440 440
 			return -1;
441 441
 		}
@@ -496,13 +496,13 @@  discard block
 block discarded – undo
496 496
 	{
497 497
 		global $conf, $langs;
498 498
 
499
-		require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
499
+		require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
500 500
 
501 501
 		$error = 0;
502 502
 
503 503
 		// Protection
504 504
 		if ($this->status == self::STATUS_VALIDATED) {
505
-			dol_syslog(get_class($this) . "::validate action abandoned: already validated", LOG_WARNING);
505
+			dol_syslog(get_class($this)."::validate action abandoned: already validated", LOG_WARNING);
506 506
 			return 0;
507 507
 		}
508 508
 
@@ -528,18 +528,18 @@  discard block
 block discarded – undo
528 528
 
529 529
 		if (!empty($num)) {
530 530
 			// Validate
531
-			$sql = "UPDATE " . MAIN_DB_PREFIX . $this->table_element;
532
-			$sql .= " SET ref = '" . $this->db->escape($num) . "',";
533
-			$sql .= " status = " . self::STATUS_VALIDATED;
531
+			$sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element;
532
+			$sql .= " SET ref = '".$this->db->escape($num)."',";
533
+			$sql .= " status = ".self::STATUS_VALIDATED;
534 534
 			if (!empty($this->fields['date_validation'])) {
535
-				$sql .= ", date_validation = '" . $this->db->idate($now) . "'";
535
+				$sql .= ", date_validation = '".$this->db->idate($now)."'";
536 536
 			}
537 537
 			if (!empty($this->fields['fk_user_valid'])) {
538
-				$sql .= ", fk_user_valid = " . ((int) $user->id);
538
+				$sql .= ", fk_user_valid = ".((int) $user->id);
539 539
 			}
540
-			$sql .= " WHERE rowid = " . ((int) $this->id);
540
+			$sql .= " WHERE rowid = ".((int) $this->id);
541 541
 
542
-			dol_syslog(get_class($this) . "::validate()", LOG_DEBUG);
542
+			dol_syslog(get_class($this)."::validate()", LOG_DEBUG);
543 543
 			$resql = $this->db->query($sql);
544 544
 			if (!$resql) {
545 545
 				dol_print_error($this->db);
@@ -563,8 +563,8 @@  discard block
 block discarded – undo
563 563
 			// Rename directory if dir was a temporary ref
564 564
 			if (preg_match('/^[\(]?PROV/i', $this->ref)) {
565 565
 				// Now we rename also files into index
566
-				$sql = 'UPDATE ' . MAIN_DB_PREFIX . "ecm_files set filename = CONCAT('" . $this->db->escape($this->newref) . "', SUBSTR(filename, " . (strlen($this->ref) + 1) . ")), filepath = 'position/" . $this->db->escape($this->newref) . "'";
567
-				$sql .= " WHERE filename LIKE '" . $this->db->escape($this->ref) . "%' AND filepath = 'position/" . $this->db->escape($this->ref) . "' and entity = " . $conf->entity;
566
+				$sql = 'UPDATE '.MAIN_DB_PREFIX."ecm_files set filename = CONCAT('".$this->db->escape($this->newref)."', SUBSTR(filename, ".(strlen($this->ref) + 1).")), filepath = 'position/".$this->db->escape($this->newref)."'";
567
+				$sql .= " WHERE filename LIKE '".$this->db->escape($this->ref)."%' AND filepath = 'position/".$this->db->escape($this->ref)."' and entity = ".$conf->entity;
568 568
 				$resql = $this->db->query($sql);
569 569
 				if (!$resql) {
570 570
 					$error++;
@@ -581,20 +581,20 @@  discard block
 block discarded – undo
581 581
 				// We rename directory ($this->ref = old ref, $num = new ref) in order not to lose the attachments
582 582
 				$oldref = dol_sanitizeFileName($this->ref);
583 583
 				$newref = dol_sanitizeFileName($num);
584
-				$dirsource = $conf->hrm->dir_output . '/position/' . $oldref;
585
-				$dirdest = $conf->hrm->dir_output . '/position/' . $newref;
584
+				$dirsource = $conf->hrm->dir_output.'/position/'.$oldref;
585
+				$dirdest = $conf->hrm->dir_output.'/position/'.$newref;
586 586
 				if (!$error && file_exists($dirsource)) {
587
-					dol_syslog(get_class($this) . "::validate() rename dir " . $dirsource . " into " . $dirdest);
587
+					dol_syslog(get_class($this)."::validate() rename dir ".$dirsource." into ".$dirdest);
588 588
 
589 589
 					if (@rename($dirsource, $dirdest)) {
590 590
 						dol_syslog("Rename ok");
591 591
 						// Rename docs starting with $oldref with $newref
592
-						$listoffiles = dol_dir_list($conf->hrm->dir_output . '/position/' . $newref, 'files', 1, '^' . preg_quote($oldref, '/'));
592
+						$listoffiles = dol_dir_list($conf->hrm->dir_output.'/position/'.$newref, 'files', 1, '^'.preg_quote($oldref, '/'));
593 593
 						foreach ($listoffiles as $fileentry) {
594 594
 							$dirsource = $fileentry['name'];
595
-							$dirdest = preg_replace('/^' . preg_quote($oldref, '/') . '/', $newref, $dirsource);
596
-							$dirsource = $fileentry['path'] . '/' . $dirsource;
597
-							$dirdest = $fileentry['path'] . '/' . $dirdest;
595
+							$dirdest = preg_replace('/^'.preg_quote($oldref, '/').'/', $newref, $dirsource);
596
+							$dirsource = $fileentry['path'].'/'.$dirsource;
597
+							$dirdest = $fileentry['path'].'/'.$dirdest;
598 598
 							@rename($dirsource, $dirdest);
599 599
 						}
600 600
 					}
@@ -710,14 +710,14 @@  discard block
 block discarded – undo
710 710
 
711 711
 		$result = '';
712 712
 
713
-		$label = img_picto('', $this->picto) . ' <u>' . $langs->trans("Position") . '</u>';
713
+		$label = img_picto('', $this->picto).' <u>'.$langs->trans("Position").'</u>';
714 714
 		if (isset($this->status)) {
715
-			$label .= ' ' . $this->getLibStatut(5);
715
+			$label .= ' '.$this->getLibStatut(5);
716 716
 		}
717 717
 		$label .= '<br>';
718
-		$label .= '<b>' . $langs->trans('Ref') . ':</b> ' . $this->ref;
718
+		$label .= '<b>'.$langs->trans('Ref').':</b> '.$this->ref;
719 719
 
720
-		$url = dol_buildpath('/hrm/position_card.php', 1) . '?id=' . $this->id;
720
+		$url = dol_buildpath('/hrm/position_card.php', 1).'?id='.$this->id;
721 721
 
722 722
 		if ($option != 'nolink') {
723 723
 			// Add param to save lastsearch_values or not
@@ -734,20 +734,20 @@  discard block
 block discarded – undo
734 734
 		if (empty($notooltip)) {
735 735
 			if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
736 736
 				$label = $langs->trans("ShowPosition");
737
-				$linkclose .= ' alt="' . dol_escape_htmltag($label, 1) . '"';
737
+				$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
738 738
 			}
739
-			$linkclose .= ' title="' . dol_escape_htmltag($label, 1) . '"';
740
-			$linkclose .= ' class="classfortooltip' . ($morecss ? ' ' . $morecss : '') . '"';
739
+			$linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"';
740
+			$linkclose .= ' class="classfortooltip'.($morecss ? ' '.$morecss : '').'"';
741 741
 		} else {
742
-			$linkclose = ($morecss ? ' class="' . $morecss . '"' : '');
742
+			$linkclose = ($morecss ? ' class="'.$morecss.'"' : '');
743 743
 		}
744 744
 
745 745
 		if ($option == 'nolink') {
746 746
 			$linkstart = '<span';
747 747
 		} else {
748
-			$linkstart = '<a href="' . $url . '"';
748
+			$linkstart = '<a href="'.$url.'"';
749 749
 		}
750
-		$linkstart .= $linkclose . '>';
750
+		$linkstart .= $linkclose.'>';
751 751
 		if ($option == 'nolink') {
752 752
 			$linkend = '</span>';
753 753
 		} else {
@@ -758,29 +758,29 @@  discard block
 block discarded – undo
758 758
 
759 759
 		if (empty($this->showphoto_on_popup)) {
760 760
 			if ($withpicto) {
761
-				$result .= img_object(($notooltip ? '' : $label), ($this->picto ? $this->picto : 'generic'), ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="' . (($withpicto != 2) ? 'paddingright ' : '') . 'classfortooltip"'), 0, 0, $notooltip ? 0 : 1);
761
+				$result .= img_object(($notooltip ? '' : $label), ($this->picto ? $this->picto : 'generic'), ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip ? 0 : 1);
762 762
 			}
763 763
 		} else {
764 764
 			if ($withpicto) {
765
-				require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
765
+				require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
766 766
 
767 767
 				list($class, $module) = explode('@', $this->picto);
768
-				$upload_dir = $conf->$module->multidir_output[$conf->entity] . "/$class/" . dol_sanitizeFileName($this->ref);
768
+				$upload_dir = $conf->$module->multidir_output[$conf->entity]."/$class/".dol_sanitizeFileName($this->ref);
769 769
 				$filearray = dol_dir_list($upload_dir, "files");
770 770
 				$filename = $filearray[0]['name'];
771 771
 				if (!empty($filename)) {
772 772
 					$pospoint = strpos($filearray[0]['name'], '.');
773 773
 
774
-					$pathtophoto = $class . '/' . $this->ref . '/thumbs/' . substr($filename, 0, $pospoint) . '_mini' . substr($filename, $pospoint);
775
-					if (!getDolGlobalString(strtoupper($module . '_' . $class) . '_FORMATLISTPHOTOSASUSERS')) {
776
-						$result .= '<div class="floatleft inline-block valignmiddle divphotoref"><div class="photoref"><img class="photo' . $module . '" alt="No photo" border="0" src="' . DOL_URL_ROOT . '/viewimage.php?modulepart=' . $module . '&entity=' . $conf->entity . '&file=' . urlencode($pathtophoto) . '"></div></div>';
774
+					$pathtophoto = $class.'/'.$this->ref.'/thumbs/'.substr($filename, 0, $pospoint).'_mini'.substr($filename, $pospoint);
775
+					if (!getDolGlobalString(strtoupper($module.'_'.$class).'_FORMATLISTPHOTOSASUSERS')) {
776
+						$result .= '<div class="floatleft inline-block valignmiddle divphotoref"><div class="photoref"><img class="photo'.$module.'" alt="No photo" border="0" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$module.'&entity='.$conf->entity.'&file='.urlencode($pathtophoto).'"></div></div>';
777 777
 					} else {
778
-						$result .= '<div class="floatleft inline-block valignmiddle divphotoref"><img class="photouserphoto userphoto" alt="No photo" border="0" src="' . DOL_URL_ROOT . '/viewimage.php?modulepart=' . $module . '&entity=' . $conf->entity . '&file=' . urlencode($pathtophoto) . '"></div>';
778
+						$result .= '<div class="floatleft inline-block valignmiddle divphotoref"><img class="photouserphoto userphoto" alt="No photo" border="0" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$module.'&entity='.$conf->entity.'&file='.urlencode($pathtophoto).'"></div>';
779 779
 					}
780 780
 
781 781
 					$result .= '</div>';
782 782
 				} else {
783
-					$result .= img_object(($notooltip ? '' : $label), ($this->picto ? $this->picto : 'generic'), ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="' . (($withpicto != 2) ? 'paddingright ' : '') . 'classfortooltip"'), 0, 0, $notooltip ? 0 : 1);
783
+					$result .= img_object(($notooltip ? '' : $label), ($this->picto ? $this->picto : 'generic'), ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip ? 0 : 1);
784 784
 				}
785 785
 			}
786 786
 		}
@@ -843,7 +843,7 @@  discard block
 block discarded – undo
843 843
 			$this->labelStatusShort[self::STATUS_CANCELED] = $langs->transnoentitiesnoconv('Disabled');
844 844
 		}
845 845
 
846
-		$statusType = 'status' . $status;
846
+		$statusType = 'status'.$status;
847 847
 		//if ($status == self::STATUS_VALIDATED) $statusType = 'status1';
848 848
 		if ($status == self::STATUS_CANCELED) {
849 849
 			$statusType = 'status6';
@@ -931,8 +931,8 @@  discard block
 block discarded – undo
931 931
 	{
932 932
 		$sql = 'SELECT rowid, date_creation as datec, tms as datem,';
933 933
 		$sql .= ' fk_user_creat, fk_user_modif';
934
-		$sql .= ' FROM ' . MAIN_DB_PREFIX . $this->table_element . ' as t';
935
-		$sql .= ' WHERE t.rowid = ' . ((int) $id);
934
+		$sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.' as t';
935
+		$sql .= ' WHERE t.rowid = '.((int) $id);
936 936
 		$result = $this->db->query($sql);
937 937
 		if ($result) {
938 938
 			if ($this->db->num_rows($result)) {
@@ -977,7 +977,7 @@  discard block
 block discarded – undo
977 977
 		$this->lines = array();
978 978
 
979 979
 		$objectline = new PositionLine($this->db);
980
-		$result = $objectline->fetchAll('ASC', 'position', 0, 0, array('customsql' => 'fk_position = ' . $this->id));
980
+		$result = $objectline->fetchAll('ASC', 'position', 0, 0, array('customsql' => 'fk_position = '.$this->id));
981 981
 
982 982
 		if (is_numeric($result)) {
983 983
 			$this->error = $objectline->error;
@@ -1006,20 +1006,20 @@  discard block
 block discarded – undo
1006 1006
 		if (getDolGlobalString('hrm_POSITION_ADDON')) {
1007 1007
 			$mybool = false;
1008 1008
 
1009
-			$file = getDolGlobalString('hrm_POSITION_ADDON') . ".php";
1009
+			$file = getDolGlobalString('hrm_POSITION_ADDON').".php";
1010 1010
 			$classname = getDolGlobalString('hrm_POSITION_ADDON');
1011 1011
 
1012 1012
 			// Include file with class
1013 1013
 			$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
1014 1014
 			foreach ($dirmodels as $reldir) {
1015
-				$dir = dol_buildpath($reldir . "core/modules/hrm/");
1015
+				$dir = dol_buildpath($reldir."core/modules/hrm/");
1016 1016
 
1017 1017
 				// Load file with numbering class (if found)
1018
-				$mybool |= @include_once $dir . $file;
1018
+				$mybool |= @include_once $dir.$file;
1019 1019
 			}
1020 1020
 
1021 1021
 			if ($mybool === false) {
1022
-				dol_print_error(null, "Failed to include file " . $file);
1022
+				dol_print_error(null, "Failed to include file ".$file);
1023 1023
 				return '';
1024 1024
 			}
1025 1025
 
@@ -1035,7 +1035,7 @@  discard block
 block discarded – undo
1035 1035
 					return "";
1036 1036
 				}
1037 1037
 			} else {
1038
-				print $langs->trans("Error") . " " . $langs->trans("ClassNotFound") . ' ' . $classname;
1038
+				print $langs->trans("Error")." ".$langs->trans("ClassNotFound").' '.$classname;
1039 1039
 				return "";
1040 1040
 			}
1041 1041
 		} else {
@@ -1054,7 +1054,7 @@  discard block
 block discarded – undo
1054 1054
 	{
1055 1055
 		$TPosition = array();
1056 1056
 
1057
-		$TPosition = $this->fetchAll('ASC', 't.rowid', 0, 0, array('customsql' => 'fk_user=' . $userid));
1057
+		$TPosition = $this->fetchAll('ASC', 't.rowid', 0, 0, array('customsql' => 'fk_user='.$userid));
1058 1058
 
1059 1059
 		return $TPosition;
1060 1060
 	}
@@ -1168,7 +1168,7 @@  discard block
 block discarded – undo
1168 1168
 }
1169 1169
 
1170 1170
 
1171
-require_once DOL_DOCUMENT_ROOT . '/core/class/commonobjectline.class.php';
1171
+require_once DOL_DOCUMENT_ROOT.'/core/class/commonobjectline.class.php';
1172 1172
 
1173 1173
 /**
1174 1174
  * Class PositionLine. You can also remove this and generate a CRUD class for lines objects.
Please login to merge, or discard this patch.
htdocs/compta/facture/card.php 1 patch
Spacing   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 }
80 80
 
81 81
 // General $Variables
82
-$id = (GETPOST('id', 'int') ? GETPOST('id', 'int') : GETPOST('facid', 'int'));    // For backward compatibility
82
+$id = (GETPOST('id', 'int') ? GETPOST('id', 'int') : GETPOST('facid', 'int')); // For backward compatibility
83 83
 $ref = GETPOST('ref', 'alpha');
84 84
 $socid = GETPOST('socid', 'int');
85 85
 $action = GETPOST('action', 'aZ09');
@@ -243,7 +243,7 @@  discard block
 block discarded – undo
243 243
 					setEventMessages('', $warningMsgLineList, 'warnings');
244 244
 				}
245 245
 
246
-				header("Location: " . $_SERVER['PHP_SELF'] . '?facid=' . $result);
246
+				header("Location: ".$_SERVER['PHP_SELF'].'?facid='.$result);
247 247
 				exit();
248 248
 			} else {
249 249
 				$langs->load("errors");
@@ -334,7 +334,7 @@  discard block
 block discarded – undo
334 334
 		// Validation
335 335
 		$object->fetch($id);
336 336
 
337
-		if ((preg_match('/^[\(]?PROV/i', $object->ref) || empty($object->ref)) &&	// empty should not happened, but when it occurs, the test save life
337
+		if ((preg_match('/^[\(]?PROV/i', $object->ref) || empty($object->ref)) && // empty should not happened, but when it occurs, the test save life
338 338
 			getDolGlobalString('FAC_FORCE_DATE_VALIDATION')								// If option enabled, we force invoice date
339 339
 		) {
340 340
 			$object->date = dol_now();
@@ -1039,7 +1039,7 @@  discard block
 block discarded – undo
1039 1039
 			$error++;
1040 1040
 		}
1041 1041
 
1042
-		$dateinvoice = dol_mktime(0, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int'), 'tzserver');	// If we enter the 02 january, we need to save the 02 january for server
1042
+		$dateinvoice = dol_mktime(0, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int'), 'tzserver'); // If we enter the 02 january, we need to save the 02 january for server
1043 1043
 		$date_pointoftax = dol_mktime(0, 0, 0, GETPOST('date_pointoftaxmonth', 'int'), GETPOST('date_pointoftaxday', 'int'), GETPOST('date_pointoftaxyear', 'int'), 'tzserver');
1044 1044
 
1045 1045
 		// Replacement invoice
@@ -1071,7 +1071,7 @@  discard block
 block discarded – undo
1071 1071
 				$object->note_private		= trim(GETPOST('note_private', 'restricthtml'));
1072 1072
 				$object->ref_client			= GETPOST('ref_client', 'alphanohtml');
1073 1073
 				$object->ref_customer		= GETPOST('ref_client', 'alphanohtml');
1074
-				$object->model_pdf          = GETPOST('model', 'alphanohtml');
1074
+				$object->model_pdf = GETPOST('model', 'alphanohtml');
1075 1075
 				$object->fk_project			= GETPOST('projectid', 'int');
1076 1076
 				$object->cond_reglement_id	= GETPOST('cond_reglement_id', 'int');
1077 1077
 				$object->mode_reglement_id	= GETPOST('mode_reglement_id', 'int');
@@ -1132,9 +1132,9 @@  discard block
 block discarded – undo
1132 1132
 				$object->note_private		= trim(GETPOST('note_private', 'restricthtml'));
1133 1133
 				$object->ref_client			= GETPOST('ref_client', 'alphanohtml');
1134 1134
 				$object->ref_customer		= GETPOST('ref_client', 'alphanohtml');
1135
-				$object->model_pdf          = GETPOST('model');
1135
+				$object->model_pdf = GETPOST('model');
1136 1136
 				$object->fk_project			= GETPOST('projectid', 'int');
1137
-				$object->cond_reglement_id	= 0;		// No payment term for a credit note
1137
+				$object->cond_reglement_id	= 0; // No payment term for a credit note
1138 1138
 				$object->mode_reglement_id	= GETPOST('mode_reglement_id', 'int');
1139 1139
 				$object->fk_account         = GETPOST('fk_account', 'int');
1140 1140
 				//$object->remise_absolue		= price2num(GETPOST('remise_absolue'), 'MU');
@@ -1456,7 +1456,7 @@  discard block
 block discarded – undo
1456 1456
 				$object->note_public		= trim(GETPOST('note_public', 'restricthtml'));
1457 1457
 				$object->note_private       = trim(GETPOST('note_private', 'restricthtml'));
1458 1458
 				$object->ref_client			= GETPOST('ref_client');
1459
-				$object->ref_customer		= GETPOST('ref_client');
1459
+				$object->ref_customer = GETPOST('ref_client');
1460 1460
 				$object->model_pdf          = GETPOST('model');
1461 1461
 				$object->fk_project			= GETPOST('projectid', 'int');
1462 1462
 				$object->cond_reglement_id	= (GETPOSTINT('type') == 3 ? 1 : GETPOST('cond_reglement_id'));
@@ -2093,7 +2093,7 @@  discard block
 block discarded – undo
2093 2093
 
2094 2094
 		// Set if we used free entry or predefined product
2095 2095
 		$predef = '';
2096
-		$product_desc =(GETPOSTISSET('dp_desc') ? GETPOST('dp_desc', 'restricthtml') : '');
2096
+		$product_desc = (GETPOSTISSET('dp_desc') ? GETPOST('dp_desc', 'restricthtml') : '');
2097 2097
 
2098 2098
 		$price_ht = '';
2099 2099
 		$price_ht_devise = '';
@@ -2292,8 +2292,8 @@  discard block
 block discarded – undo
2292 2292
 				}
2293 2293
 
2294 2294
 				//If text set in desc is the same as product descpription (as now it's preloaded) we add it only one time
2295
-				if ($product_desc==$desc && getDolGlobalString('PRODUIT_AUTOFILL_DESC')) {
2296
-					$product_desc='';
2295
+				if ($product_desc == $desc && getDolGlobalString('PRODUIT_AUTOFILL_DESC')) {
2296
+					$product_desc = '';
2297 2297
 				}
2298 2298
 
2299 2299
 				if (!empty($product_desc) && getDolGlobalString('MAIN_NO_CONCAT_DESCRIPTION')) {
@@ -2594,7 +2594,7 @@  discard block
 block discarded – undo
2594 2594
 		// Define special_code for special lines
2595 2595
 		$special_code = GETPOST('special_code', 'int');
2596 2596
 		if ($special_code == 3) {
2597
-			$special_code = 0;	// Options should not exists on invoices
2597
+			$special_code = 0; // Options should not exists on invoices
2598 2598
 		}
2599 2599
 
2600 2600
 		$line = new FactureLigne($db);
@@ -3207,8 +3207,8 @@  discard block
 block discarded – undo
3207 3207
 				//$remise_absolue 	= (!empty($expesrc->remise_absolue) ? $expesrc->remise_absolue : (!empty($soc->remise_absolue) ? $soc->remise_absolue : 0));
3208 3208
 
3209 3209
 				if (isModEnabled('multicurrency')) {
3210
-					$currency_code 	= (!empty($expesrc->multicurrency_code) ? $expesrc->multicurrency_code : (!empty($soc->multicurrency_code) ? $soc->multicurrency_code : $objectsrc->multicurrency_code));
3211
-					$currency_tx 	= (!empty($expesrc->multicurrency_tx) ? $expesrc->multicurrency_tx : (!empty($soc->multicurrency_tx) ? $soc->multicurrency_tx : $objectsrc->multicurrency_tx));
3210
+					$currency_code = (!empty($expesrc->multicurrency_code) ? $expesrc->multicurrency_code : (!empty($soc->multicurrency_code) ? $soc->multicurrency_code : $objectsrc->multicurrency_code));
3211
+					$currency_tx = (!empty($expesrc->multicurrency_tx) ? $expesrc->multicurrency_tx : (!empty($soc->multicurrency_tx) ? $soc->multicurrency_tx : $objectsrc->multicurrency_tx));
3212 3212
 				}
3213 3213
 
3214 3214
 				//Replicate extrafields
@@ -3304,7 +3304,7 @@  discard block
 block discarded – undo
3304 3304
 	print '<form name="add" action="'.$_SERVER["PHP_SELF"].'" method="POST" id="formtocreate" name="formtocreate">';
3305 3305
 	print '<input type="hidden" name="token" value="'.newToken().'">';
3306 3306
 	print '<input type="hidden" name="action" id="formtocreateaction" value="add">';
3307
-	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
3307
+	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
3308 3308
 	if ($soc->id > 0) {
3309 3309
 		print '<input type="hidden" name="socid" value="'.$soc->id.'">'."\n";
3310 3310
 	}
@@ -4345,7 +4345,7 @@  discard block
 block discarded – undo
4345 4345
 		$nbMandated = 0;
4346 4346
 		foreach ($object->lines as $line) {
4347 4347
 			$res = $line->fetch_product();
4348
-			if ($res  > 0) {
4348
+			if ($res > 0) {
4349 4349
 				if ($line->product->isService() && $line->product->isMandatoryPeriod() && (empty($line->date_start) || empty($line->date_end))) {
4350 4350
 					$nbMandated++;
4351 4351
 					break;
@@ -4546,7 +4546,7 @@  discard block
 block discarded – undo
4546 4546
 	}
4547 4547
 	// Ref customer
4548 4548
 	$morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_customer, $object, $usercancreate, 'string', '', 0, 1);
4549
-	$morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_customer, $object, $usercancreate, 'string'.(getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') ? ':' . getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') : ''), '', null, null, '', 1);
4549
+	$morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_customer, $object, $usercancreate, 'string'.(getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') ? ':'.getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') : ''), '', null, null, '', 1);
4550 4550
 	// Thirdparty
4551 4551
 	$morehtmlref .= '<br>'.$object->thirdparty->getNomUrl(1, 'customer');
4552 4552
 	if (!getDolGlobalString('MAIN_DISABLE_OTHER_LINK') && $object->thirdparty->id > 0) {
@@ -4977,40 +4977,40 @@  discard block
 block discarded – undo
4977 4977
 		}
4978 4978
 		print '<tr>';
4979 4979
 		// Amount HT
4980
-		print '<td class="titlefieldmiddle">' . $langs->trans('AmountHT') . '</td>';
4981
-		print '<td class="nowrap amountcard right">' . price($sign * $object->total_ht, '', $langs, 0, -1, -1, $conf->currency) . '</td>';
4980
+		print '<td class="titlefieldmiddle">'.$langs->trans('AmountHT').'</td>';
4981
+		print '<td class="nowrap amountcard right">'.price($sign * $object->total_ht, '', $langs, 0, -1, -1, $conf->currency).'</td>';
4982 4982
 		if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
4983 4983
 			// Multicurrency Amount HT
4984
-			print '<td class="nowrap amountcard right">' . price($sign * $object->multicurrency_total_ht, '', $langs, 0, -1, -1, $object->multicurrency_code) . '</td>';
4984
+			print '<td class="nowrap amountcard right">'.price($sign * $object->multicurrency_total_ht, '', $langs, 0, -1, -1, $object->multicurrency_code).'</td>';
4985 4985
 		}
4986 4986
 		print '</tr>';
4987 4987
 
4988 4988
 		print '<tr>';
4989 4989
 		// Amount VAT
4990
-		print '<td class="titlefieldmiddle">' . $langs->trans('AmountVAT') . '</td>';
4991
-		print '<td class="nowrap amountcard right">' . price($sign * $object->total_tva, '', $langs, 0, -1, -1, $conf->currency) . '</td>';
4990
+		print '<td class="titlefieldmiddle">'.$langs->trans('AmountVAT').'</td>';
4991
+		print '<td class="nowrap amountcard right">'.price($sign * $object->total_tva, '', $langs, 0, -1, -1, $conf->currency).'</td>';
4992 4992
 		if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
4993 4993
 			// Multicurrency Amount VAT
4994
-			print '<td class="nowrap amountcard right">' . price($sign * $object->multicurrency_total_tva, '', $langs, 0, -1, -1, $object->multicurrency_code) . '</td>';
4994
+			print '<td class="nowrap amountcard right">'.price($sign * $object->multicurrency_total_tva, '', $langs, 0, -1, -1, $object->multicurrency_code).'</td>';
4995 4995
 		}
4996 4996
 		print '</tr>';
4997 4997
 
4998 4998
 		// Amount Local Taxes
4999 4999
 		if (($mysoc->localtax1_assuj == "1" && $mysoc->useLocalTax(1)) || $object->total_localtax1 != 0) {
5000 5000
 			print '<tr>';
5001
-			print '<td class="titlefieldmiddle">' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '</td>';
5002
-			print '<td class="nowrap amountcard right">' . price($sign * $object->total_localtax1, '', $langs, 0, -1, -1, $conf->currency) . '</td>';
5001
+			print '<td class="titlefieldmiddle">'.$langs->transcountry("AmountLT1", $mysoc->country_code).'</td>';
5002
+			print '<td class="nowrap amountcard right">'.price($sign * $object->total_localtax1, '', $langs, 0, -1, -1, $conf->currency).'</td>';
5003 5003
 			if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
5004
-				print '<td class="nowrap amountcard right">' . price($sign * $object->total_localtax1, '', $langs, 0, -1, -1, $object->multicurrency_code) . '</td>';
5004
+				print '<td class="nowrap amountcard right">'.price($sign * $object->total_localtax1, '', $langs, 0, -1, -1, $object->multicurrency_code).'</td>';
5005 5005
 			}
5006 5006
 			print '</tr>';
5007 5007
 
5008 5008
 			if (($mysoc->localtax2_assuj == "1" && $mysoc->useLocalTax(2)) || $object->total_localtax2 != 0) {
5009 5009
 				print '<tr>';
5010
-				print '<td>' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '</td>';
5011
-				print '<td class="nowrap amountcard right">' . price($sign * $object->total_localtax2, '', $langs, 0, -1, -1, $conf->currency) . '</td>';
5010
+				print '<td>'.$langs->transcountry("AmountLT2", $mysoc->country_code).'</td>';
5011
+				print '<td class="nowrap amountcard right">'.price($sign * $object->total_localtax2, '', $langs, 0, -1, -1, $conf->currency).'</td>';
5012 5012
 				if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
5013
-					print '<td class="nowrap amountcard right">' . price($sign * $object->total_localtax2, '', $langs, 0, -1, -1, $object->multicurrency_code) . '</td>';
5013
+					print '<td class="nowrap amountcard right">'.price($sign * $object->total_localtax2, '', $langs, 0, -1, -1, $object->multicurrency_code).'</td>';
5014 5014
 				}
5015 5015
 				print '</tr>';
5016 5016
 			}
@@ -5072,11 +5072,11 @@  discard block
 block discarded – undo
5072 5072
 
5073 5073
 		print '<tr>';
5074 5074
 		// Amount TTC
5075
-		print '<td>' . $langs->trans('AmountTTC') . '</td>';
5076
-		print '<td class="nowrap amountcard right">' . price($sign * $object->total_ttc, '', $langs, 0, -1, -1, $conf->currency) . '</td>';
5075
+		print '<td>'.$langs->trans('AmountTTC').'</td>';
5076
+		print '<td class="nowrap amountcard right">'.price($sign * $object->total_ttc, '', $langs, 0, -1, -1, $conf->currency).'</td>';
5077 5077
 		if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
5078 5078
 			// Multicurrency Amount TTC
5079
-			print '<td class="nowrap amountcard right">' . price($sign * $object->multicurrency_total_ttc, '', $langs, 0, -1, -1, $object->multicurrency_code) . '</td>';
5079
+			print '<td class="nowrap amountcard right">'.price($sign * $object->multicurrency_total_ttc, '', $langs, 0, -1, -1, $object->multicurrency_code).'</td>';
5080 5080
 		}
5081 5081
 		print '</tr>';
5082 5082
 
@@ -5479,7 +5479,7 @@  discard block
 block discarded – undo
5479 5479
 				print '</td>';
5480 5480
 				print '<td class="right'.($resteapayeraffiche ? ' amountremaintopay' : (' '.$cssforamountpaymentcomplete)).'">';
5481 5481
 				//print (empty($object->multicurrency_code) ? $conf->currency : $object->multicurrency_code).' ';
5482
-				print price(price2num($object->multicurrency_tx*$resteapayeraffiche, 'MT'), 1, $langs, 1, -1, -1, (empty($object->multicurrency_code) ? $conf->currency : $object->multicurrency_code)).'</td><td>&nbsp;</td></tr>';
5482
+				print price(price2num($object->multicurrency_tx * $resteapayeraffiche, 'MT'), 1, $langs, 1, -1, -1, (empty($object->multicurrency_code) ? $conf->currency : $object->multicurrency_code)).'</td><td>&nbsp;</td></tr>';
5483 5483
 			}
5484 5484
 
5485 5485
 			// Retained warranty : usually use on construction industry
@@ -5734,7 +5734,7 @@  discard block
 block discarded – undo
5734 5734
 					$langs->load("contracts");
5735 5735
 
5736 5736
 					if ($usercancreatecontract) {
5737
-						print '<a class="butAction" href="' . DOL_URL_ROOT . '/contrat/card.php?action=create&amp;origin=' . $object->element . '&amp;originid=' . $object->id . '&amp;socid=' . $object->socid . '">' . $langs->trans('AddContract') . '</a>';
5737
+						print '<a class="butAction" href="'.DOL_URL_ROOT.'/contrat/card.php?action=create&amp;origin='.$object->element.'&amp;originid='.$object->id.'&amp;socid='.$object->socid.'">'.$langs->trans('AddContract').'</a>';
5738 5738
 					}
5739 5739
 				}
5740 5740
 			}
Please login to merge, or discard this patch.
htdocs/comm/mailing/card.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -292,15 +292,15 @@  discard block
 block discarded – undo
292 292
 								$substitutionarray['__SECUREKEYPAYMENT_INVOICE__'] = dol_hash(getDolGlobalString('PAYMENT_SECURITY_TOKEN'), 2);
293 293
 								$substitutionarray['__SECUREKEYPAYMENT_CONTRACTLINE__'] = dol_hash(getDolGlobalString('PAYMENT_SECURITY_TOKEN'), 2);
294 294
 							} else {
295
-								$substitutionarray['__SECUREKEYPAYMENT_MEMBER__'] = dol_hash(getDolGlobalString('PAYMENT_SECURITY_TOKEN') . 'member'.$obj->source_id, 2);
296
-								$substitutionarray['__SECUREKEYPAYMENT_DONATION__'] = dol_hash(getDolGlobalString('PAYMENT_SECURITY_TOKEN') . 'donation'.$obj->source_id, 2);
297
-								$substitutionarray['__SECUREKEYPAYMENT_ORDER__'] = dol_hash(getDolGlobalString('PAYMENT_SECURITY_TOKEN') . 'order'.$obj->source_id, 2);
298
-								$substitutionarray['__SECUREKEYPAYMENT_INVOICE__'] = dol_hash(getDolGlobalString('PAYMENT_SECURITY_TOKEN') . 'invoice'.$obj->source_id, 2);
299
-								$substitutionarray['__SECUREKEYPAYMENT_CONTRACTLINE__'] = dol_hash(getDolGlobalString('PAYMENT_SECURITY_TOKEN') . 'contractline'.$obj->source_id, 2);
295
+								$substitutionarray['__SECUREKEYPAYMENT_MEMBER__'] = dol_hash(getDolGlobalString('PAYMENT_SECURITY_TOKEN').'member'.$obj->source_id, 2);
296
+								$substitutionarray['__SECUREKEYPAYMENT_DONATION__'] = dol_hash(getDolGlobalString('PAYMENT_SECURITY_TOKEN').'donation'.$obj->source_id, 2);
297
+								$substitutionarray['__SECUREKEYPAYMENT_ORDER__'] = dol_hash(getDolGlobalString('PAYMENT_SECURITY_TOKEN').'order'.$obj->source_id, 2);
298
+								$substitutionarray['__SECUREKEYPAYMENT_INVOICE__'] = dol_hash(getDolGlobalString('PAYMENT_SECURITY_TOKEN').'invoice'.$obj->source_id, 2);
299
+								$substitutionarray['__SECUREKEYPAYMENT_CONTRACTLINE__'] = dol_hash(getDolGlobalString('PAYMENT_SECURITY_TOKEN').'contractline'.$obj->source_id, 2);
300 300
 							}
301 301
 						}
302 302
 						if (getDolGlobalString('MEMBER_ENABLE_PUBLIC')) {
303
-							$substitutionarray['__PUBLICLINK_NEWMEMBERFORM__'] = '<a target="_blank" rel="noopener noreferrer" href="'.DOL_MAIN_URL_ROOT.'/public/members/new.php'.((isModEnabled('multicompany')) ? '?entity='.$conf->entity : '').'">'.$langs->trans('BlankSubscriptionForm'). '</a>';
303
+							$substitutionarray['__PUBLICLINK_NEWMEMBERFORM__'] = '<a target="_blank" rel="noopener noreferrer" href="'.DOL_MAIN_URL_ROOT.'/public/members/new.php'.((isModEnabled('multicompany')) ? '?entity='.$conf->entity : '').'">'.$langs->trans('BlankSubscriptionForm').'</a>';
304 304
 						}
305 305
 						/* For backward compatibility, deprecated */
306 306
 						if (isModEnabled('paypal') && getDolGlobalString('PAYPAL_SECURITY_TOKEN')) {
@@ -309,25 +309,25 @@  discard block
 block discarded – undo
309 309
 							if (!getDolGlobalString('PAYPAL_SECURITY_TOKEN_UNIQUE')) {
310 310
 								$substitutionarray['__SECUREKEYPAYPAL_MEMBER__'] = dol_hash(getDolGlobalString('PAYPAL_SECURITY_TOKEN'), 2);
311 311
 							} else {
312
-								$substitutionarray['__SECUREKEYPAYPAL_MEMBER__'] = dol_hash(getDolGlobalString('PAYPAL_SECURITY_TOKEN') . 'membersubscription'.$obj->source_id, 2);
312
+								$substitutionarray['__SECUREKEYPAYPAL_MEMBER__'] = dol_hash(getDolGlobalString('PAYPAL_SECURITY_TOKEN').'membersubscription'.$obj->source_id, 2);
313 313
 							}
314 314
 
315 315
 							if (!getDolGlobalString('PAYPAL_SECURITY_TOKEN_UNIQUE')) {
316 316
 								$substitutionarray['__SECUREKEYPAYPAL_ORDER__'] = dol_hash(getDolGlobalString('PAYPAL_SECURITY_TOKEN'), 2);
317 317
 							} else {
318
-								$substitutionarray['__SECUREKEYPAYPAL_ORDER__'] = dol_hash(getDolGlobalString('PAYPAL_SECURITY_TOKEN') . 'order'.$obj->source_id, 2);
318
+								$substitutionarray['__SECUREKEYPAYPAL_ORDER__'] = dol_hash(getDolGlobalString('PAYPAL_SECURITY_TOKEN').'order'.$obj->source_id, 2);
319 319
 							}
320 320
 
321 321
 							if (!getDolGlobalString('PAYPAL_SECURITY_TOKEN_UNIQUE')) {
322 322
 								$substitutionarray['__SECUREKEYPAYPAL_INVOICE__'] = dol_hash(getDolGlobalString('PAYPAL_SECURITY_TOKEN'), 2);
323 323
 							} else {
324
-								$substitutionarray['__SECUREKEYPAYPAL_INVOICE__'] = dol_hash(getDolGlobalString('PAYPAL_SECURITY_TOKEN') . 'invoice'.$obj->source_id, 2);
324
+								$substitutionarray['__SECUREKEYPAYPAL_INVOICE__'] = dol_hash(getDolGlobalString('PAYPAL_SECURITY_TOKEN').'invoice'.$obj->source_id, 2);
325 325
 							}
326 326
 
327 327
 							if (!getDolGlobalString('PAYPAL_SECURITY_TOKEN_UNIQUE')) {
328 328
 								$substitutionarray['__SECUREKEYPAYPAL_CONTRACTLINE__'] = dol_hash(getDolGlobalString('PAYPAL_SECURITY_TOKEN'), 2);
329 329
 							} else {
330
-								$substitutionarray['__SECUREKEYPAYPAL_CONTRACTLINE__'] = dol_hash(getDolGlobalString('PAYPAL_SECURITY_TOKEN') . 'contractline'.$obj->source_id, 2);
330
+								$substitutionarray['__SECUREKEYPAYPAL_CONTRACTLINE__'] = dol_hash(getDolGlobalString('PAYPAL_SECURITY_TOKEN').'contractline'.$obj->source_id, 2);
331 331
 							}
332 332
 						}
333 333
 						//$substitutionisok=true;
@@ -468,7 +468,7 @@  discard block
 block discarded – undo
468 468
 	}
469 469
 
470 470
 	// Action send test emailing
471
-	if ($action == 'send' && ! $cancel) {
471
+	if ($action == 'send' && !$cancel) {
472 472
 		$error = 0;
473 473
 
474 474
 		$upload_dir = $conf->mailing->dir_output."/".get_exdir($object->id, 2, 0, 1, $object, 'mailing');
@@ -546,7 +546,7 @@  discard block
 block discarded – undo
546 546
 	if ($action == 'add') {
547 547
 		$mesgs = array();
548 548
 
549
-		$object->messtype       = (string) GETPOST("messtype");
549
+		$object->messtype = (string) GETPOST("messtype");
550 550
 		if ($object->messtype == 'sms') {
551 551
 			$object->email_from     = (string) GETPOST("from_phone", 'alphawithlgt'); // Must allow 'name <email>'
552 552
 		} else {
@@ -883,7 +883,7 @@  discard block
 block discarded – undo
883 883
 			print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id.(!empty($urlfrom) ? '&urlfrom='.urlencode($urlfrom) : ''), $langs->trans("DeleteAMailing"), $langs->trans("ConfirmDeleteMailing"), "confirm_delete", '', '', 1);
884 884
 		}
885 885
 
886
-		if ($action != 'edit' && $action != 'edittxt' &&$action != 'edithtml') {
886
+		if ($action != 'edit' && $action != 'edittxt' && $action != 'edithtml') {
887 887
 			print dol_get_fiche_head($head, 'card', $langs->trans("Mailing"), -1, 'email');
888 888
 
889 889
 			/*
@@ -1190,7 +1190,7 @@  discard block
 block discarded – undo
1190 1190
 				$formmail = new FormMail($db);
1191 1191
 				$formmail->fromname = $object->email_from;
1192 1192
 				$formmail->frommail = $object->email_from;
1193
-				$formmail->withsubstit =0;
1193
+				$formmail->withsubstit = 0;
1194 1194
 				$formmail->withfrom = 0;
1195 1195
 				$formmail->withto = $user->email ? $user->email : 1;
1196 1196
 				$formmail->withtocc = 0;
@@ -1463,7 +1463,7 @@  discard block
 block discarded – undo
1463 1463
 				$maxfilesizearray = getMaxFileSizeArray();
1464 1464
 				$maxmin = $maxfilesizearray['maxmin'];
1465 1465
 				if ($maxmin > 0) {
1466
-					$out .= '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">';	// MAX_FILE_SIZE must precede the field type=file
1466
+					$out .= '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file
1467 1467
 				}
1468 1468
 				$out .= '<input type="file" class="flat" id="addedfile" name="addedfile" value="'.$langs->trans("Upload").'" />';
1469 1469
 				$out .= ' ';
Please login to merge, or discard this patch.
dev/tools/phan/config_extended.php 1 patch
Spacing   +42 added lines, -42 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
 	//	'processes' => 6,
14 14
 	'backward_compatibility_checks' => false,
15 15
 	'simplify_ast' => true,
16
-	'analyzed_file_extensions' => ['php','inc'],
16
+	'analyzed_file_extensions' => ['php', 'inc'],
17 17
 	'globals_type_map' => [
18 18
 		'conf' => '\Conf',
19 19
 		'db' => '\DoliDB',
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
 	// your application should be included in this list.
44 44
 	'directory_list' => [
45 45
 		'htdocs',
46
-		PHAN_DIR . '/stubs/',
46
+		PHAN_DIR.'/stubs/',
47 47
 	],
48 48
 
49 49
 	// A directory list that defines files that will be excluded
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 	"exclude_analysis_directory_list" => [
61 61
 		'htdocs/includes/',
62 62
 		'htdocs/core/class/lessc.class.php', // External library
63
-		PHAN_DIR . '/stubs/',
63
+		PHAN_DIR.'/stubs/',
64 64
 	],
65 65
 	//'exclude_file_regex' => '@^vendor/.*/(tests?|Tests?)/@',
66 66
 	'exclude_file_regex' => '@^('  // @phpstan-ignore-line
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
 		.'|htdocs/includes/restler/.*'  // @phpstan-ignore-line
72 72
 		// Included as stub (did not seem properly analysed by phan without it)
73 73
 		.'|htdocs/includes/stripe/.*'  // @phpstan-ignore-line
74
-		.')@',  // @phpstan-ignore-line
74
+		.')@', // @phpstan-ignore-line
75 75
 
76 76
 	// A list of plugin files to execute.
77 77
 	// Plugins which are bundled with Phan can be added here by providing their name
@@ -135,22 +135,22 @@  discard block
 block discarded – undo
135 135
 	// Add any issue types (such as 'PhanUndeclaredMethod')
136 136
 	// here to inhibit them from being reported
137 137
 	'suppress_issue_types' => [
138
-		'PhanPluginWhitespaceTab',		// Dolibarr used tabs
139
-		'PhanPluginCanUsePHP71Void',	// Dolibarr is maintaining 7.0 compatibility
140
-		'PhanPluginShortArray',			// Dolibarr uses array()
141
-		'PhanPluginShortArrayList',		// Dolibarr uses array()
138
+		'PhanPluginWhitespaceTab', // Dolibarr used tabs
139
+		'PhanPluginCanUsePHP71Void', // Dolibarr is maintaining 7.0 compatibility
140
+		'PhanPluginShortArray', // Dolibarr uses array()
141
+		'PhanPluginShortArrayList', // Dolibarr uses array()
142 142
 		// Fixers From PHPDocToRealTypesPlugin:
143
-		'PhanPluginCanUseParamType',			// Fixer - Report/Add types in the function definition (function abc(string $var) (adds string)
144
-		'PhanPluginCanUseReturnType',			// Fixer - Report/Add return types in the function definition (function abc(string $var) (adds string)
145
-		'PhanPluginCanUseNullableParamType',	// Fixer - Report/Add nullable parameter types in the function definition
146
-		'PhanPluginCanUseNullableReturnType',	// Fixer - Report/Add nullable return types in the function definition
147
-		'PhanPluginNonBoolBranch',			// Not essential - 31240+ occurrences
148
-		'PhanPluginNumericalComparison',	// Not essential - 19870+ occurrences
149
-		'PhanTypeMismatchArgument',			// Not essential - 12300+ occurrences
150
-		'PhanPluginNonBoolInLogicalArith',	// Not essential - 11040+ occurrences
151
-		'PhanPluginConstantVariableScalar',	// Not essential - 5180+ occurrences
152
-		'PhanPluginDuplicateConditionalTernaryDuplication',		// 2750+ occurrences
153
-		'PhanPluginDuplicateConditionalNullCoalescing',	// Not essential - 990+ occurrences
143
+		'PhanPluginCanUseParamType', // Fixer - Report/Add types in the function definition (function abc(string $var) (adds string)
144
+		'PhanPluginCanUseReturnType', // Fixer - Report/Add return types in the function definition (function abc(string $var) (adds string)
145
+		'PhanPluginCanUseNullableParamType', // Fixer - Report/Add nullable parameter types in the function definition
146
+		'PhanPluginCanUseNullableReturnType', // Fixer - Report/Add nullable return types in the function definition
147
+		'PhanPluginNonBoolBranch', // Not essential - 31240+ occurrences
148
+		'PhanPluginNumericalComparison', // Not essential - 19870+ occurrences
149
+		'PhanTypeMismatchArgument', // Not essential - 12300+ occurrences
150
+		'PhanPluginNonBoolInLogicalArith', // Not essential - 11040+ occurrences
151
+		'PhanPluginConstantVariableScalar', // Not essential - 5180+ occurrences
152
+		'PhanPluginDuplicateConditionalTernaryDuplication', // 2750+ occurrences
153
+		'PhanPluginDuplicateConditionalNullCoalescing', // Not essential - 990+ occurrences
154 154
 
155 155
 	],
156 156
 	// You can put relative paths to internal stubs in this config option.
@@ -170,29 +170,29 @@  discard block
 block discarded – undo
170 170
 	//'xdebug'	=> 'vendor/phan/phan/.phan/internal_stubs/xdebug.phan_php',
171 171
 	//'memcached'  => PHAN_DIR . '/your_internal_stubs_folder_name/memcached.phan_php',
172 172
 	//'PDO'  => PHAN_DIR . '/stubs/PDO.phan_php',
173
-	'brotli'  => PHAN_DIR . '/stubs/brotli.phan_php',
174
-	'curl'  => PHAN_DIR . '/stubs/curl.phan_php',
175
-	'calendar'  => PHAN_DIR . '/stubs/calendar.phan_php',
176
-	'fileinfo'  => PHAN_DIR . '/stubs/fileinfo.phan_php',
177
-	'ftp'  => PHAN_DIR . '/stubs/ftp.phan_php',
178
-	'gd'  => PHAN_DIR . '/stubs/gd.phan_php',
179
-	'geoip'  => PHAN_DIR . '/stubs/geoip.phan_php',
180
-	'imap'  => PHAN_DIR . '/stubs/imap.phan_php',
181
-	'intl'  => PHAN_DIR . '/stubs/intl.phan_php',
182
-	'ldap'  => PHAN_DIR . '/stubs/ldap.phan_php',
183
-	'mcrypt'  => PHAN_DIR . '/stubs/mcrypt.phan_php',
184
-	'memcache'  => PHAN_DIR . '/stubs/memcache.phan_php',
185
-	'mysqli'  => PHAN_DIR . '/stubs/mysqli.phan_php',
186
-	'pdo_cubrid'  => PHAN_DIR . '/stubs/pdo_cubrid.phan_php',
187
-	'pdo_mysql'  => PHAN_DIR . '/stubs/pdo_mysql.phan_php',
188
-	'pdo_pgsql'  => PHAN_DIR . '/stubs/pdo_pgsql.phan_php',
189
-	'pdo_sqlite'  => PHAN_DIR . '/stubs/pdo_sqlite.phan_php',
190
-	'pgsql'  => PHAN_DIR . '/stubs/pgsql.phan_php',
191
-	'session'  => PHAN_DIR . '/stubs/session.phan_php',
192
-	'simplexml'  => PHAN_DIR . '/stubs/SimpleXML.phan_php',
193
-	'soap'  => PHAN_DIR . '/stubs/soap.phan_php',
194
-	'sockets'  => PHAN_DIR . '/stubs/sockets.phan_php',
195
-	'zip'  => PHAN_DIR . '/stubs/zip.phan_php',
173
+	'brotli'  => PHAN_DIR.'/stubs/brotli.phan_php',
174
+	'curl'  => PHAN_DIR.'/stubs/curl.phan_php',
175
+	'calendar'  => PHAN_DIR.'/stubs/calendar.phan_php',
176
+	'fileinfo'  => PHAN_DIR.'/stubs/fileinfo.phan_php',
177
+	'ftp'  => PHAN_DIR.'/stubs/ftp.phan_php',
178
+	'gd'  => PHAN_DIR.'/stubs/gd.phan_php',
179
+	'geoip'  => PHAN_DIR.'/stubs/geoip.phan_php',
180
+	'imap'  => PHAN_DIR.'/stubs/imap.phan_php',
181
+	'intl'  => PHAN_DIR.'/stubs/intl.phan_php',
182
+	'ldap'  => PHAN_DIR.'/stubs/ldap.phan_php',
183
+	'mcrypt'  => PHAN_DIR.'/stubs/mcrypt.phan_php',
184
+	'memcache'  => PHAN_DIR.'/stubs/memcache.phan_php',
185
+	'mysqli'  => PHAN_DIR.'/stubs/mysqli.phan_php',
186
+	'pdo_cubrid'  => PHAN_DIR.'/stubs/pdo_cubrid.phan_php',
187
+	'pdo_mysql'  => PHAN_DIR.'/stubs/pdo_mysql.phan_php',
188
+	'pdo_pgsql'  => PHAN_DIR.'/stubs/pdo_pgsql.phan_php',
189
+	'pdo_sqlite'  => PHAN_DIR.'/stubs/pdo_sqlite.phan_php',
190
+	'pgsql'  => PHAN_DIR.'/stubs/pgsql.phan_php',
191
+	'session'  => PHAN_DIR.'/stubs/session.phan_php',
192
+	'simplexml'  => PHAN_DIR.'/stubs/SimpleXML.phan_php',
193
+	'soap'  => PHAN_DIR.'/stubs/soap.phan_php',
194
+	'sockets'  => PHAN_DIR.'/stubs/sockets.phan_php',
195
+	'zip'  => PHAN_DIR.'/stubs/zip.phan_php',
196 196
 	],
197 197
 
198 198
 	];
Please login to merge, or discard this patch.