@@ -751,7 +751,7 @@ discard block |
||
751 | 751 | $error++; |
752 | 752 | } |
753 | 753 | |
754 | - $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 |
|
754 | + $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 |
|
755 | 755 | $datedue = dol_mktime(0, 0, 0, GETPOST('echmonth', 'int'), GETPOST('echday', 'int'), GETPOST('echyear', 'int'), 'tzserver'); |
756 | 756 | //var_dump($dateinvoice.' '.dol_print_date($dateinvoice, 'dayhour')); |
757 | 757 | //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')); |
@@ -789,7 +789,7 @@ discard block |
||
789 | 789 | $object->ref = GETPOST('ref', 'alphanohtml'); |
790 | 790 | $object->ref_supplier = GETPOST('ref_supplier', 'alpha'); |
791 | 791 | $object->socid = GETPOST('socid', 'int'); |
792 | - $object->libelle = GETPOST('label', 'alphanohtml'); // deprecated |
|
792 | + $object->libelle = GETPOST('label', 'alphanohtml'); // deprecated |
|
793 | 793 | $object->label = GETPOST('label', 'alphanohtml'); |
794 | 794 | $object->date = $dateinvoice; |
795 | 795 | $object->date_echeance = $datedue; |
@@ -1027,28 +1027,28 @@ discard block |
||
1027 | 1027 | $tmpproject = GETPOST('projectid', 'int'); |
1028 | 1028 | |
1029 | 1029 | // Creation invoice |
1030 | + $object->socid = GETPOST('socid', 'int'); |
|
1031 | + $object->type = GETPOST('type', 'alphanohtml'); |
|
1032 | + $object->subtype = GETPOST('subtype', 'alphanohtml'); |
|
1033 | + $object->ref = GETPOST('ref', 'alphanohtml'); |
|
1034 | + $object->ref_supplier = GETPOST('ref_supplier', 'alphanohtml'); |
|
1030 | 1035 | $object->socid = GETPOST('socid', 'int'); |
1031 | - $object->type = GETPOST('type', 'alphanohtml'); |
|
1032 | - $object->subtype = GETPOST('subtype', 'alphanohtml'); |
|
1033 | - $object->ref = GETPOST('ref', 'alphanohtml'); |
|
1034 | - $object->ref_supplier = GETPOST('ref_supplier', 'alphanohtml'); |
|
1035 | - $object->socid = GETPOST('socid', 'int'); |
|
1036 | - $object->libelle = GETPOST('label', 'alphanohtml'); // deprecated |
|
1036 | + $object->libelle = GETPOST('label', 'alphanohtml'); // deprecated |
|
1037 | 1037 | $object->label = GETPOST('label', 'alphanohtml'); |
1038 | - $object->date = $dateinvoice; |
|
1039 | - $object->date_echeance = $datedue; |
|
1040 | - $object->note_public = GETPOST('note_public', 'restricthtml'); |
|
1041 | - $object->note_private = GETPOST('note_private', 'restricthtml'); |
|
1038 | + $object->date = $dateinvoice; |
|
1039 | + $object->date_echeance = $datedue; |
|
1040 | + $object->note_public = GETPOST('note_public', 'restricthtml'); |
|
1041 | + $object->note_private = GETPOST('note_private', 'restricthtml'); |
|
1042 | 1042 | $object->cond_reglement_id = GETPOST('cond_reglement_id'); |
1043 | 1043 | $object->mode_reglement_id = GETPOST('mode_reglement_id'); |
1044 | 1044 | $object->fk_account = GETPOST('fk_account', 'int'); |
1045 | 1045 | $object->vat_reverse_charge = GETPOST('vat_reverse_charge') == 'on' ? 1 : 0; |
1046 | 1046 | $object->fk_project = ($tmpproject > 0) ? $tmpproject : null; |
1047 | - $object->fk_incoterms = GETPOST('incoterm_id', 'int'); |
|
1047 | + $object->fk_incoterms = GETPOST('incoterm_id', 'int'); |
|
1048 | 1048 | $object->location_incoterms = GETPOST('location_incoterms', 'alpha'); |
1049 | 1049 | $object->multicurrency_code = GETPOST('multicurrency_code', 'alpha'); |
1050 | - $object->multicurrency_tx = GETPOST('originmulticurrency_tx', 'int'); |
|
1051 | - $object->transport_mode_id = GETPOST('transport_mode_id'); |
|
1050 | + $object->multicurrency_tx = GETPOST('originmulticurrency_tx', 'int'); |
|
1051 | + $object->transport_mode_id = GETPOST('transport_mode_id'); |
|
1052 | 1052 | |
1053 | 1053 | // Auto calculation of date due if not filled by user |
1054 | 1054 | if (empty($object->date_echeance)) { |
@@ -1387,7 +1387,7 @@ discard block |
||
1387 | 1387 | // Edit line |
1388 | 1388 | $db->begin(); |
1389 | 1389 | |
1390 | - if (! $object->fetch($id) > 0) { |
|
1390 | + if (!$object->fetch($id) > 0) { |
|
1391 | 1391 | dol_print_error($db); |
1392 | 1392 | } |
1393 | 1393 | $object->fetch_thirdparty(); |
@@ -1531,7 +1531,7 @@ discard block |
||
1531 | 1531 | $idprod = GETPOST('idprod', 'int'); |
1532 | 1532 | } |
1533 | 1533 | |
1534 | - $tva_tx = (GETPOST('tva_tx') ? GETPOST('tva_tx') : 0); // Can be '1.2' or '1.2 (CODE)' |
|
1534 | + $tva_tx = (GETPOST('tva_tx') ? GETPOST('tva_tx') : 0); // Can be '1.2' or '1.2 (CODE)' |
|
1535 | 1535 | |
1536 | 1536 | $price_ht = price2num(GETPOST('price_ht'), 'MU', 2); |
1537 | 1537 | $price_ht_devise = price2num(GETPOST('multicurrency_price_ht'), 'CU', 2); |
@@ -2298,7 +2298,7 @@ discard block |
||
2298 | 2298 | |
2299 | 2299 | $sql = 'SELECT r.rowid, r.titre as title, r.total_ttc'; |
2300 | 2300 | $sql .= ' FROM '.MAIN_DB_PREFIX.'facture_fourn_rec as r'; |
2301 | - $sql .= ' WHERE r.fk_soc = '. (int) $invoice_predefined->socid; |
|
2301 | + $sql .= ' WHERE r.fk_soc = '.(int) $invoice_predefined->socid; |
|
2302 | 2302 | |
2303 | 2303 | $resql = $db->query($sql); |
2304 | 2304 | if ($resql) { |
@@ -2356,7 +2356,7 @@ discard block |
||
2356 | 2356 | |
2357 | 2357 | // Standard invoice |
2358 | 2358 | print '<div class="tagtr listofinvoicetype"><div class="tagtd listofinvoicetype">'; |
2359 | - $tmp = '<input type="radio" id="radio_standard" name="type" value="0"'.(GETPOST('type', 'int')? '' : 'checked').'> '; |
|
2359 | + $tmp = '<input type="radio" id="radio_standard" name="type" value="0"'.(GETPOST('type', 'int') ? '' : 'checked').'> '; |
|
2360 | 2360 | $desc = $form->textwithpicto($tmp.'<label for="radio_standard">'.$langs->trans("InvoiceStandardAsk").'</label>', $langs->transnoentities("InvoiceStandardDesc"), 1, 'help', '', 0, 3); |
2361 | 2361 | print $desc; |
2362 | 2362 | print '</div></div>'; |
@@ -2365,7 +2365,7 @@ discard block |
||
2365 | 2365 | // Deposit - Down payment |
2366 | 2366 | if (empty($conf->global->INVOICE_DISABLE_DEPOSIT)) { |
2367 | 2367 | print '<div class="tagtr listofinvoicetype"><div class="tagtd listofinvoicetype">'; |
2368 | - $tmp='<input type="radio" id="radio_deposit" name="type" value="3"' . (GETPOST('type') == 3 ? ' checked' : '') . '> '; |
|
2368 | + $tmp = '<input type="radio" id="radio_deposit" name="type" value="3"'.(GETPOST('type') == 3 ? ' checked' : '').'> '; |
|
2369 | 2369 | print '<script type="text/javascript"> |
2370 | 2370 | jQuery(document).ready(function() { |
2371 | 2371 | jQuery("#typestandardinvoice, #valuestandardinvoice").click(function() { |
@@ -2411,7 +2411,7 @@ discard block |
||
2411 | 2411 | print $form->selectarray('typedeposit', $arraylist, GETPOST('typedeposit', 'aZ09'), 0, 0, 0, '', 1); |
2412 | 2412 | print '</td>'; |
2413 | 2413 | print '<td class="nowrap" style="padding-left: 5px">'; |
2414 | - print '<span class="opacitymedium paddingleft">'.$langs->trans("AmountOrPercent").'</span><input type="text" id="valuedeposit" name="valuedeposit" class="width75 right" value="' . GETPOST('valuedeposit', 'int') . '"/>'; |
|
2414 | + print '<span class="opacitymedium paddingleft">'.$langs->trans("AmountOrPercent").'</span><input type="text" id="valuedeposit" name="valuedeposit" class="width75 right" value="'.GETPOST('valuedeposit', 'int').'"/>'; |
|
2415 | 2415 | print '</td>'; |
2416 | 2416 | } |
2417 | 2417 | print '</tr></table>'; |
@@ -2566,7 +2566,7 @@ discard block |
||
2566 | 2566 | if (empty($conf->global->INVOICE_CREDIT_NOTE_STANDALONE)) { |
2567 | 2567 | $tmp = '<input type="radio" name="type" id="radio_creditnote" value="0" disabled> '; |
2568 | 2568 | } else { |
2569 | - $tmp='<input type="radio" name="type" id="radio_creditnote" value="2"> '; |
|
2569 | + $tmp = '<input type="radio" name="type" id="radio_creditnote" value="2"> '; |
|
2570 | 2570 | } |
2571 | 2571 | $text = $tmp.$langs->trans("InvoiceAvoir").' '; |
2572 | 2572 | $text .= '<span class="opacitymedium">('.$langs->trans("YouMustCreateInvoiceFromSupplierThird").')</span> '; |
@@ -2657,7 +2657,7 @@ discard block |
||
2657 | 2657 | |
2658 | 2658 | // Vat reverse-charge by default |
2659 | 2659 | if (!empty($conf->global->ACCOUNTING_FORCE_ENABLE_VAT_REVERSE_CHARGE)) { |
2660 | - print '<tr><td>' . $langs->trans('VATReverseCharge') . '</td><td>'; |
|
2660 | + print '<tr><td>'.$langs->trans('VATReverseCharge').'</td><td>'; |
|
2661 | 2661 | // 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 |
2662 | 2662 | if ($vat_reverse_charge == 1 || $societe->vat_reverse_charge == 1 || ($societe->country_code != 'FR' && isInEEC($societe) && !empty($societe->tva_intra))) { |
2663 | 2663 | $vat_reverse_charge = 1; |
@@ -2665,7 +2665,7 @@ discard block |
||
2665 | 2665 | $vat_reverse_charge = 0; |
2666 | 2666 | } |
2667 | 2667 | |
2668 | - print '<input type="checkbox" name="vat_reverse_charge"'. (!empty($vat_reverse_charge) ? ' checked ' : '') . '>'; |
|
2668 | + print '<input type="checkbox" name="vat_reverse_charge"'.(!empty($vat_reverse_charge) ? ' checked ' : '').'>'; |
|
2669 | 2669 | print '</td></tr>'; |
2670 | 2670 | } |
2671 | 2671 | |
@@ -3220,7 +3220,7 @@ discard block |
||
3220 | 3220 | $facavoir->fetch($id); |
3221 | 3221 | $invoicecredits[] = $facavoir->getNomUrl(1); |
3222 | 3222 | } |
3223 | - print ' <span class="opacitymediumbycolor paddingleft">'.$langs->transnoentities("InvoiceHasAvoir") . (count($invoicecredits) ? ' ' : '') . implode(',', $invoicecredits); |
|
3223 | + print ' <span class="opacitymediumbycolor paddingleft">'.$langs->transnoentities("InvoiceHasAvoir").(count($invoicecredits) ? ' ' : '').implode(',', $invoicecredits); |
|
3224 | 3224 | print '</span>'; |
3225 | 3225 | } |
3226 | 3226 | if (isset($objectidnext) && $objectidnext > 0) { |
@@ -3416,12 +3416,12 @@ discard block |
||
3416 | 3416 | print '<input type="hidden" name="action" value="setvatreversecharge">'; |
3417 | 3417 | print '<input type="hidden" name="token" value="'.newToken().'">'; |
3418 | 3418 | |
3419 | - print '<input type="checkbox" name="vat_reverse_charge"' . ($object->vat_reverse_charge == '1' ? ' checked ' : '') . '>'; |
|
3419 | + print '<input type="checkbox" name="vat_reverse_charge"'.($object->vat_reverse_charge == '1' ? ' checked ' : '').'>'; |
|
3420 | 3420 | |
3421 | 3421 | print '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">'; |
3422 | 3422 | print '</form>'; |
3423 | 3423 | } else { |
3424 | - print '<input type="checkbox" name="vat_reverse_charge"'. ($object->vat_reverse_charge == '1' ? ' checked ' : '') . ' disabled>'; |
|
3424 | + print '<input type="checkbox" name="vat_reverse_charge"'.($object->vat_reverse_charge == '1' ? ' checked ' : '').' disabled>'; |
|
3425 | 3425 | } |
3426 | 3426 | print '</td></tr>'; |
3427 | 3427 | } |
@@ -3482,15 +3482,15 @@ discard block |
||
3482 | 3482 | print '<table class="border tableforfield centpercent">'; |
3483 | 3483 | |
3484 | 3484 | print '<tr>'; |
3485 | - print '<td class="titlefieldmiddle">' . $langs->trans('AmountHT') . '</td>'; |
|
3486 | - print '<td class="nowrap amountcard right">' . price($object->total_ht, '', $langs, 0, -1, -1, $conf->currency) . '</td>'; |
|
3485 | + print '<td class="titlefieldmiddle">'.$langs->trans('AmountHT').'</td>'; |
|
3486 | + print '<td class="nowrap amountcard right">'.price($object->total_ht, '', $langs, 0, -1, -1, $conf->currency).'</td>'; |
|
3487 | 3487 | if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { |
3488 | - print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_ht, '', $langs, 0, -1, -1, $object->multicurrency_code) . '</td>'; |
|
3488 | + print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_ht, '', $langs, 0, -1, -1, $object->multicurrency_code).'</td>'; |
|
3489 | 3489 | } |
3490 | 3490 | print '</tr>'; |
3491 | 3491 | |
3492 | 3492 | print '<tr>'; |
3493 | - print '<td>' . $langs->trans('AmountVAT') . '</td>'; |
|
3493 | + print '<td>'.$langs->trans('AmountVAT').'</td>'; |
|
3494 | 3494 | print '<td class="nowrap amountcard right">'; |
3495 | 3495 | if (GETPOST('calculationrule')) { |
3496 | 3496 | $calculationrule = GETPOST('calculationrule', 'alpha'); |
@@ -3504,40 +3504,40 @@ discard block |
||
3504 | 3504 | } |
3505 | 3505 | // Show link for "recalculate" |
3506 | 3506 | if ($object->getVentilExportCompta() == 0) { |
3507 | - $s = '<span class="hideonsmartphone opacitymedium">' . $langs->trans("ReCalculate") . ' </span>'; |
|
3508 | - $s .= '<a href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=calculate&calculationrule=totalofround">' . $langs->trans("Mode1") . '</a>'; |
|
3507 | + $s = '<span class="hideonsmartphone opacitymedium">'.$langs->trans("ReCalculate").' </span>'; |
|
3508 | + $s .= '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=calculate&calculationrule=totalofround">'.$langs->trans("Mode1").'</a>'; |
|
3509 | 3509 | $s .= ' / '; |
3510 | - $s .= '<a href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=calculate&calculationrule=roundoftotal">' . $langs->trans("Mode2") . '</a>'; |
|
3510 | + $s .= '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=calculate&calculationrule=roundoftotal">'.$langs->trans("Mode2").'</a>'; |
|
3511 | 3511 | print '<div class="inline-block">'; |
3512 | - print $form->textwithtooltip($s, $langs->trans("CalculationRuleDesc", $calculationrulenum) . '<br>' . $langs->trans("CalculationRuleDescSupplier"), 2, 1, img_picto('', 'help'), '', 3, '', 0, 'recalculate'); |
|
3512 | + print $form->textwithtooltip($s, $langs->trans("CalculationRuleDesc", $calculationrulenum).'<br>'.$langs->trans("CalculationRuleDescSupplier"), 2, 1, img_picto('', 'help'), '', 3, '', 0, 'recalculate'); |
|
3513 | 3513 | print ' '; |
3514 | 3514 | print '</div>'; |
3515 | 3515 | } |
3516 | 3516 | print price($object->total_tva, 1, $langs, 0, -1, -1, $conf->currency); |
3517 | 3517 | print '</td>'; |
3518 | 3518 | if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { |
3519 | - print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_tva, '', $langs, 0, -1, -1, $object->multicurrency_code) . '</td>'; |
|
3519 | + print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_tva, '', $langs, 0, -1, -1, $object->multicurrency_code).'</td>'; |
|
3520 | 3520 | } |
3521 | 3521 | print '</tr>'; |
3522 | 3522 | |
3523 | 3523 | if ($societe->localtax1_assuj == "1") { //Localtax1 |
3524 | 3524 | print '<tr>'; |
3525 | - print '<td>' . $langs->transcountry("AmountLT1", $societe->country_code) . '</td>'; |
|
3526 | - print '<td class="nowrap amountcard right">' . price($object->total_localtax1, 1, $langs, 0, -1, -1, $conf->currency) . '</td>'; |
|
3525 | + print '<td>'.$langs->transcountry("AmountLT1", $societe->country_code).'</td>'; |
|
3526 | + print '<td class="nowrap amountcard right">'.price($object->total_localtax1, 1, $langs, 0, -1, -1, $conf->currency).'</td>'; |
|
3527 | 3527 | print '</tr>'; |
3528 | 3528 | } |
3529 | 3529 | if ($societe->localtax2_assuj == "1") { //Localtax2 |
3530 | 3530 | print '<tr>'; |
3531 | - print '<td>' . $langs->transcountry("AmountLT2", $societe->country_code) . '</td>'; |
|
3532 | - print '<td class="nowrap amountcard right">' . price($object->total_localtax2, 1, $langs, 0, -1, -1, $conf->currency) . '</td>'; |
|
3531 | + print '<td>'.$langs->transcountry("AmountLT2", $societe->country_code).'</td>'; |
|
3532 | + print '<td class="nowrap amountcard right">'.price($object->total_localtax2, 1, $langs, 0, -1, -1, $conf->currency).'</td>'; |
|
3533 | 3533 | print '</tr>'; |
3534 | 3534 | } |
3535 | 3535 | |
3536 | 3536 | print '<tr>'; |
3537 | - print '<td>' . $langs->trans('AmountTTC') . '</td>'; |
|
3538 | - print '<td class="nowrap amountcard right">' . price($object->total_ttc, '', $langs, 0, -1, -1, $conf->currency) . '</td>'; |
|
3537 | + print '<td>'.$langs->trans('AmountTTC').'</td>'; |
|
3538 | + print '<td class="nowrap amountcard right">'.price($object->total_ttc, '', $langs, 0, -1, -1, $conf->currency).'</td>'; |
|
3539 | 3539 | if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { |
3540 | - print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_ttc, '', $langs, 0, -1, -1, $object->multicurrency_code) . '</td>'; |
|
3540 | + print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_ttc, '', $langs, 0, -1, -1, $object->multicurrency_code).'</td>'; |
|
3541 | 3541 | } |
3542 | 3542 | print '</tr>'; |
3543 | 3543 | |
@@ -3843,7 +3843,7 @@ discard block |
||
3843 | 3843 | print '<tr><td colspan="'.$nbcols.'" class="right">'; |
3844 | 3844 | print '<span class="opacitymedium">'; |
3845 | 3845 | print $langs->trans('RemainderToPayBackMulticurrency'); |
3846 | - if ($resteapayeraffiche> 0) { |
|
3846 | + if ($resteapayeraffiche > 0) { |
|
3847 | 3847 | print ' ('.$langs->trans('NegativeIfExcessRefunded').')'; |
3848 | 3848 | } |
3849 | 3849 | print '</span>'; |
@@ -4072,7 +4072,7 @@ discard block |
||
4072 | 4072 | } |
4073 | 4073 | |
4074 | 4074 | // Clone as predefined / Create template |
4075 | - if (($object->type == FactureFournisseur::TYPE_STANDARD || $object->type == FactureFournisseur::TYPE_DEPOSIT) && $object->statut == 0 && $usercancreate) { |
|
4075 | + if (($object->type == FactureFournisseur::TYPE_STANDARD || $object->type == FactureFournisseur::TYPE_DEPOSIT) && $object->statut == 0 && $usercancreate) { |
|
4076 | 4076 | if (!$objectidnext && count($object->lines) > 0) { |
4077 | 4077 | print '<a class="butAction" href="'.DOL_URL_ROOT.'/fourn/facture/card-rec.php?facid='.$object->id.'&action=create">'.$langs->trans("ChangeIntoRepeatableInvoice").'</a>'; |
4078 | 4078 | } |
@@ -204,7 +204,7 @@ discard block |
||
204 | 204 | /** |
205 | 205 | * @var int ID |
206 | 206 | */ |
207 | - public $fk_account; // default bank account |
|
207 | + public $fk_account; // default bank account |
|
208 | 208 | |
209 | 209 | /** |
210 | 210 | * @var int transport mode id |
@@ -407,7 +407,7 @@ discard block |
||
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 |
@@ -441,13 +441,13 @@ discard block |
||
441 | 441 | $this->location_incoterms = $_facrec->location_incoterms; |
442 | 442 | |
443 | 443 | // Clean parameters |
444 | - if (! $this->type) { |
|
444 | + if (!$this->type) { |
|
445 | 445 | $this->type = self::TYPE_STANDARD; |
446 | 446 | } |
447 | 447 | if (!empty(GETPOST('ref_supplier'))) { |
448 | 448 | $this->ref_supplier = trim($this->ref_supplier); |
449 | 449 | } else { |
450 | - $this->ref_supplier = trim($this->ref_supplier . '_' . ($_facrec->nb_gen_done + 1)); |
|
450 | + $this->ref_supplier = trim($this->ref_supplier.'_'.($_facrec->nb_gen_done + 1)); |
|
451 | 451 | } |
452 | 452 | $this->note_public = trim($this->note_public); |
453 | 453 | $this->note_private = trim($this->note_private); |
@@ -455,11 +455,11 @@ discard block |
||
455 | 455 | |
456 | 456 | $this->array_options = $_facrec->array_options; |
457 | 457 | |
458 | - if (! $this->mode_reglement_id) { |
|
458 | + if (!$this->mode_reglement_id) { |
|
459 | 459 | $this->mode_reglement_id = 0; |
460 | 460 | } |
461 | 461 | $this->status = self::STATUS_DRAFT; |
462 | - $this->statut = self::STATUS_DRAFT; // deprecated |
|
462 | + $this->statut = self::STATUS_DRAFT; // deprecated |
|
463 | 463 | |
464 | 464 | $this->linked_objects = $_facrec->linkedObjectsIds; |
465 | 465 | // We do not add link to template invoice or next invoice will be linked to all generated invoices |
@@ -708,7 +708,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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->fk_user_author = $obj->fk_user_author; |
949 | 949 | $this->author = $obj->fk_user_author; |
950 | 950 | $this->fk_user_valid = $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; |
@@ -1064,7 +1064,7 @@ discard block |
||
1064 | 1064 | $line->localtax2_tx = $obj->localtax2_tx; |
1065 | 1065 | $line->localtax1_type = $obj->localtax1_type; |
1066 | 1066 | $line->localtax2_type = $obj->localtax2_type; |
1067 | - $line->qty = $obj->qty; |
|
1067 | + $line->qty = $obj->qty; |
|
1068 | 1068 | $line->remise_percent = $obj->remise_percent; |
1069 | 1069 | $line->fk_remise_except = $obj->fk_remise_except; |
1070 | 1070 | //$line->tva = $obj->total_tva; // deprecated |
@@ -1349,7 +1349,7 @@ discard block |
||
1349 | 1349 | $facligne->rang = 1; |
1350 | 1350 | $linecount = count($this->lines); |
1351 | 1351 | for ($ii = 1; $ii <= $linecount; $ii++) { |
1352 | - $this->updateRangOfLine($this->lines[$ii - 1]->id, $ii+1); |
|
1352 | + $this->updateRangOfLine($this->lines[$ii - 1]->id, $ii + 1); |
|
1353 | 1353 | } |
1354 | 1354 | } |
1355 | 1355 | |
@@ -2707,7 +2707,7 @@ discard block |
||
2707 | 2707 | |
2708 | 2708 | while ($obj = $this->db->fetch_object($resql)) { |
2709 | 2709 | $facturestatic->date_echeance = $this->db->jdate($obj->datefin); |
2710 | - $facturestatic->statut = $obj->status; // For backward compatibility |
|
2710 | + $facturestatic->statut = $obj->status; // For backward compatibility |
|
2711 | 2711 | $facturestatic->status = $obj->status; |
2712 | 2712 | |
2713 | 2713 | $response->nbtodo++; |
@@ -2889,7 +2889,7 @@ discard block |
||
2889 | 2889 | $label = $langs->trans("ShowSupplierInvoice"); |
2890 | 2890 | $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"'; |
2891 | 2891 | } |
2892 | - $linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"'); |
|
2892 | + $linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"'); |
|
2893 | 2893 | $linkclose .= $dataparams.' class="'.$classfortooltip.'"'; |
2894 | 2894 | } |
2895 | 2895 | |
@@ -2918,7 +2918,7 @@ discard block |
||
2918 | 2918 | } |
2919 | 2919 | } |
2920 | 2920 | global $action; |
2921 | - $hookmanager->initHooks(array($this->element . 'dao')); |
|
2921 | + $hookmanager->initHooks(array($this->element.'dao')); |
|
2922 | 2922 | $parameters = array('id'=>$this->id, 'getnomurl' => &$result); |
2923 | 2923 | $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks |
2924 | 2924 | if ($reshook > 0) { |
@@ -2949,7 +2949,7 @@ discard block |
||
2949 | 2949 | |
2950 | 2950 | $mybool = false; |
2951 | 2951 | |
2952 | - $file = getDolGlobalString('INVOICE_SUPPLIER_ADDON_NUMBER') . ".php"; |
|
2952 | + $file = getDolGlobalString('INVOICE_SUPPLIER_ADDON_NUMBER').".php"; |
|
2953 | 2953 | $classname = $conf->global->INVOICE_SUPPLIER_ADDON_NUMBER; |
2954 | 2954 | |
2955 | 2955 | // Include file with class |
@@ -3140,7 +3140,7 @@ discard block |
||
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 |
@@ -3690,7 +3690,7 @@ discard block |
||
3690 | 3690 | $this->localtax1_type = $obj->localtax1_type; |
3691 | 3691 | $this->localtax2_type = $obj->localtax2_type; |
3692 | 3692 | |
3693 | - $this->qty = $obj->qty; |
|
3693 | + $this->qty = $obj->qty; |
|
3694 | 3694 | $this->remise_percent = $obj->remise_percent; |
3695 | 3695 | $this->fk_remise_except = $obj->fk_remise_except; |
3696 | 3696 | //$this->tva = $obj->total_tva; // deprecated |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context |
90 | 90 | $hookmanager->initHooks(array('agendacontract', 'globalcard')); |
91 | 91 | |
92 | -$permissiontoadd = $user->hasRight('contrat', 'creer'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php |
|
92 | +$permissiontoadd = $user->hasRight('contrat', 'creer'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php |
|
93 | 93 | |
94 | 94 | $result = restrictedArea($user, 'contrat', $object->id); |
95 | 95 | |
@@ -270,7 +270,7 @@ discard block |
||
270 | 270 | $cachekey = 'count_events_thirdparty_'.$object->id; |
271 | 271 | $nbEvent = dol_getcache($cachekey); |
272 | 272 | |
273 | - print load_fiche_titre($langs->trans("ActionsOnContract").(is_numeric($nbEvent) ? '<span class="opacitymedium colorblack paddingleft">('.$nbEvent.')</span>': ''), $newcardbutton, ''); |
|
273 | + print load_fiche_titre($langs->trans("ActionsOnContract").(is_numeric($nbEvent) ? '<span class="opacitymedium colorblack paddingleft">('.$nbEvent.')</span>' : ''), $newcardbutton, ''); |
|
274 | 274 | //print_barre_liste($langs->trans("ActionsOnCompany"), 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, '', 0, -1, '', 0, $newcardbutton, '', 0, 1, 1); |
275 | 275 | |
276 | 276 | // List of all actions |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | $object = new Contrat($db); |
53 | 53 | $object->fetch($id, $ref); |
54 | 54 | |
55 | -$permissiontoadd = $user->hasRight('contrat', 'creer'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php |
|
55 | +$permissiontoadd = $user->hasRight('contrat', 'creer'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php |
|
56 | 56 | $permissionnote = $user->hasRight('contrat', 'creer'); // Used by the include of actions_setnotes.inc.php |
57 | 57 | |
58 | 58 | $result = restrictedArea($user, 'contrat', $object->id); |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | |
181 | 181 | //print '<br>'; |
182 | 182 | |
183 | - $cssclass='titlefield'; |
|
183 | + $cssclass = 'titlefield'; |
|
184 | 184 | include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php'; |
185 | 185 | |
186 | 186 | print dol_get_fiche_end(); |
@@ -83,7 +83,7 @@ |
||
83 | 83 | // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context |
84 | 84 | $hookmanager->initHooks(array('contractcard', 'globalcard')); |
85 | 85 | |
86 | -$permissiontoadd = $user->hasRight('contrat', 'creer'); // Used by the include of actions_dellink.inc.php |
|
86 | +$permissiontoadd = $user->hasRight('contrat', 'creer'); // Used by the include of actions_dellink.inc.php |
|
87 | 87 | |
88 | 88 | $result = restrictedArea($user, 'contrat', $object->id); |
89 | 89 |
@@ -53,7 +53,7 @@ |
||
53 | 53 | // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context |
54 | 54 | $hookmanager->initHooks(array('contractcard', 'globalcard')); |
55 | 55 | |
56 | -$permissiontoadd = $user->hasRight('contrat', 'creer'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php |
|
56 | +$permissiontoadd = $user->hasRight('contrat', 'creer'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php |
|
57 | 57 | |
58 | 58 | $result = restrictedArea($user, 'contrat', $object->id); |
59 | 59 |
@@ -319,9 +319,9 @@ |
||
319 | 319 | |
320 | 320 | // Add font-awesome (if $val2['level'] == 0, we are on level2 |
321 | 321 | if ($val2['level'] == 0 && !empty($val2['prefix'])) { |
322 | - print $val2['prefix']; // the picto must have class="pictofixedwidth paddingright" |
|
322 | + print $val2['prefix']; // the picto must have class="pictofixedwidth paddingright" |
|
323 | 323 | } else { |
324 | - print '<span class="paddingright"></span>'; // we also add class="paddingright". width similar to pictofixedwidth is managed by class=lilevel2 |
|
324 | + print '<span class="paddingright"></span>'; // we also add class="paddingright". width similar to pictofixedwidth is managed by class=lilevel2 |
|
325 | 325 | } |
326 | 326 | |
327 | 327 | print $val2['titre']; |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | // Members |
97 | 97 | $tmpentry = array( |
98 | 98 | 'enabled' => isModEnabled('adherent'), |
99 | - 'perms' => $user->hasRight('adherent', 'lire'), |
|
99 | + 'perms' => $user->hasRight('adherent', 'lire'), |
|
100 | 100 | 'module' => 'adherent' |
101 | 101 | ); |
102 | 102 | $menu_arr[] = array( |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | ) |
126 | 126 | || (isModEnabled('supplier_proposal') || isModEnabled('supplier_order') || isModEnabled('supplier_invoice')) |
127 | 127 | ), |
128 | - 'perms'=> ($user->hasRight('societe', 'lire') || $user->hasRight('fournisseur', 'lire') || $user->hasRight('supplier_order', 'lire') || $user->hasRight('supplier_invoice', 'lire') || $user->hasRight('supplier_proposal', 'lire')), |
|
128 | + 'perms'=> ($user->hasRight('societe', 'lire') || $user->hasRight('fournisseur', 'lire') || $user->hasRight('supplier_order', 'lire') || $user->hasRight('supplier_invoice', 'lire') || $user->hasRight('supplier_proposal', 'lire')), |
|
129 | 129 | 'module'=>'societe|fournisseur' |
130 | 130 | ); |
131 | 131 | $menu_arr[] = array( |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | // Products-Services |
151 | 151 | $tmpentry = array( |
152 | 152 | 'enabled'=> (isModEnabled('product') || isModEnabled('service') || isModEnabled('expedition')), |
153 | - 'perms'=> ($user->hasRight('product', 'read') || $user->hasRight('service', 'read') || $user->hasRight('expedition', 'lire')), |
|
153 | + 'perms'=> ($user->hasRight('product', 'read') || $user->hasRight('service', 'read') || $user->hasRight('expedition', 'lire')), |
|
154 | 154 | 'module'=>'product|service' |
155 | 155 | ); |
156 | 156 | $menu_arr[] = array( |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | // MRP - GPAO |
178 | 178 | $tmpentry = array( |
179 | 179 | 'enabled'=>(isModEnabled('bom') || isModEnabled('mrp')), |
180 | - 'perms'=>($user->hasRight('bom', 'read') || $user->hasRight('mrp', 'read')), |
|
180 | + 'perms'=>($user->hasRight('bom', 'read') || $user->hasRight('mrp', 'read')), |
|
181 | 181 | 'module'=>'bom|mrp' |
182 | 182 | ); |
183 | 183 | $menu_arr[] = array( |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | // Projects |
203 | 203 | $tmpentry = array( |
204 | 204 | 'enabled'=> (isModEnabled('projet') ? 1 : 0), |
205 | - 'perms'=> ($user->hasRight('projet', 'lire') ? 1 : 0), |
|
205 | + 'perms'=> ($user->hasRight('projet', 'lire') ? 1 : 0), |
|
206 | 206 | 'module'=>'projet' |
207 | 207 | ); |
208 | 208 | |
@@ -247,25 +247,25 @@ discard block |
||
247 | 247 | || isModEnabled('contrat') |
248 | 248 | || isModEnabled('ficheinter') |
249 | 249 | ) ? 1 : 0, |
250 | - 'perms'=>($user->hasRight('propal', 'read') |
|
251 | - || $user->hasRight('commande', 'lire') |
|
252 | - || $user->hasRight('supplier_proposal', 'lire') |
|
253 | - || $user->hasRight('fournisseur', 'lire') |
|
254 | - || $user->hasRight('fournisseur', 'commande', 'lire') |
|
255 | - || $user->hasRight('supplier_order', 'lire') |
|
256 | - || $user->hasRight('contrat', 'lire') |
|
257 | - || $user->hasRight('ficheinter', 'lire') |
|
250 | + 'perms'=>($user->hasRight('propal', 'read') |
|
251 | + || $user->hasRight('commande', 'lire') |
|
252 | + || $user->hasRight('supplier_proposal', 'lire') |
|
253 | + || $user->hasRight('fournisseur', 'lire') |
|
254 | + || $user->hasRight('fournisseur', 'commande', 'lire') |
|
255 | + || $user->hasRight('supplier_order', 'lire') |
|
256 | + || $user->hasRight('contrat', 'lire') |
|
257 | + || $user->hasRight('ficheinter', 'lire') |
|
258 | 258 | ), |
259 | 259 | 'module'=>'propal|commande|supplier_proposal|supplier_order|contrat|ficheinter' |
260 | 260 | ); |
261 | 261 | |
262 | - $onlysupplierorder = $user->hasRight('fournisseur', 'commande', 'lire') && |
|
263 | - !$user->hasRight('propal', 'lire') && |
|
264 | - !$user->hasRight('commande', 'lire') && |
|
265 | - !$user->hasRight('supplier_order', 'lire') && |
|
266 | - !$user->hasRight('supplier_proposal', 'lire') && |
|
267 | - !$user->hasRight('contrat', 'lire') && |
|
268 | - !$user->hasRight('ficheinter', 'lire'); |
|
262 | + $onlysupplierorder = $user->hasRight('fournisseur', 'commande', 'lire') && |
|
263 | + !$user->hasRight('propal', 'lire') && |
|
264 | + !$user->hasRight('commande', 'lire') && |
|
265 | + !$user->hasRight('supplier_order', 'lire') && |
|
266 | + !$user->hasRight('supplier_proposal', 'lire') && |
|
267 | + !$user->hasRight('contrat', 'lire') && |
|
268 | + !$user->hasRight('ficheinter', 'lire'); |
|
269 | 269 | |
270 | 270 | $menu_arr[] = array( |
271 | 271 | 'name' => 'Commercial', |
@@ -296,9 +296,9 @@ discard block |
||
296 | 296 | isModEnabled('loan') || |
297 | 297 | isModEnabled('margins') |
298 | 298 | ) ? 1 : 0, |
299 | - 'perms'=>($user->hasRight('facture', 'lire') || $user->hasRight('don', 'contact', 'lire') |
|
300 | - || $user->hasRight('tax', 'charges', 'lire') || $user->hasRight('salaries', 'read') |
|
301 | - || $user->hasRight('fournisseur', 'facture', 'lire') || $user->hasRight('loan', 'read') || $user->hasRight('margins', 'liretous')), |
|
299 | + 'perms'=>($user->hasRight('facture', 'lire') || $user->hasRight('don', 'contact', 'lire') |
|
300 | + || $user->hasRight('tax', 'charges', 'lire') || $user->hasRight('salaries', 'read') |
|
301 | + || $user->hasRight('fournisseur', 'facture', 'lire') || $user->hasRight('loan', 'read') || $user->hasRight('margins', 'liretous')), |
|
302 | 302 | 'module'=>'facture|supplier_invoice|don|tax|salaries|loan' |
303 | 303 | ); |
304 | 304 | $menu_arr[] = array( |
@@ -323,7 +323,7 @@ discard block |
||
323 | 323 | // Bank |
324 | 324 | $tmpentry = array( |
325 | 325 | 'enabled'=>(isModEnabled('banque') || isModEnabled('prelevement')), |
326 | - 'perms'=>($user->hasRight('banque', 'lire') || $user->hasRight('prelevement', 'lire') || $user->hasRight('paymentbybanktransfer', 'read')), |
|
326 | + 'perms'=>($user->hasRight('banque', 'lire') || $user->hasRight('prelevement', 'lire') || $user->hasRight('paymentbybanktransfer', 'read')), |
|
327 | 327 | 'module'=>'banque|prelevement|paymentbybanktransfer' |
328 | 328 | ); |
329 | 329 | $menu_arr[] = array( |
@@ -348,7 +348,7 @@ discard block |
||
348 | 348 | // Accounting |
349 | 349 | $tmpentry = array( |
350 | 350 | 'enabled'=>(isModEnabled('comptabilite') || isModEnabled('accounting') || isModEnabled('asset') || isModEnabled('intracommreport')), |
351 | - 'perms'=>($user->hasRight('compta', 'resultat', 'lire') || $user->hasRight('accounting', 'comptarapport', 'lire') || $user->hasRight('accounting', 'mouvements', 'lire') || $user->hasRight('asset', 'read') || $user->hasRight('intracommreport', 'read')), |
|
351 | + 'perms'=>($user->hasRight('compta', 'resultat', 'lire') || $user->hasRight('accounting', 'comptarapport', 'lire') || $user->hasRight('accounting', 'mouvements', 'lire') || $user->hasRight('asset', 'read') || $user->hasRight('intracommreport', 'read')), |
|
352 | 352 | 'module'=>'comptabilite|accounting|asset|intracommreport' |
353 | 353 | ); |
354 | 354 | $menu_arr[] = array( |
@@ -373,7 +373,7 @@ discard block |
||
373 | 373 | // HRM |
374 | 374 | $tmpentry = array( |
375 | 375 | 'enabled'=>(isModEnabled('hrm') || (isModEnabled('holiday')) || isModEnabled('deplacement') || isModEnabled('expensereport') || isModEnabled('recruitment')), |
376 | - 'perms'=>($user->hasRight('user', 'user', 'lire') || $user->hasRight('holiday', 'read') || $user->hasRight('deplacement', 'lire') || $user->hasRight('expensereport', 'lire') || $user->hasRight('recruitment', 'recruitmentjobposition', 'read')), |
|
376 | + 'perms'=>($user->hasRight('user', 'user', 'lire') || $user->hasRight('holiday', 'read') || $user->hasRight('deplacement', 'lire') || $user->hasRight('expensereport', 'lire') || $user->hasRight('recruitment', 'recruitmentjobposition', 'read')), |
|
377 | 377 | 'module'=>'hrm|holiday|deplacement|expensereport|recruitment' |
378 | 378 | ); |
379 | 379 | |
@@ -399,7 +399,7 @@ discard block |
||
399 | 399 | // Tickets and Knowledge base |
400 | 400 | $tmpentry = array( |
401 | 401 | 'enabled'=>(isModEnabled('ticket') || isModEnabled('knowledgemanagement')), |
402 | - 'perms'=>($user->hasRight('ticket', 'read') || $user->hasRight('knowledgemanagement', 'knowledgerecord', 'read')), |
|
402 | + 'perms'=>($user->hasRight('ticket', 'read') || $user->hasRight('knowledgemanagement', 'knowledgerecord', 'read')), |
|
403 | 403 | 'module'=>'ticket|knowledgemanagement' |
404 | 404 | ); |
405 | 405 | $link = ''; |
@@ -1196,17 +1196,17 @@ discard block |
||
1196 | 1196 | $newmenu->add("/user/home.php?leftmenu=users", $langs->trans("MenuUsersAndGroups"), 0, $user->hasRight('user', 'user', 'read'), '', $mainmenu, 'users', 0, '', '', '', img_picto('', 'user', 'class="paddingright pictofixedwidth"')); |
1197 | 1197 | if ($user->hasRight('user', 'user', 'read')) { |
1198 | 1198 | if ($usemenuhider || empty($leftmenu) || $leftmenu == "users") { |
1199 | - $newmenu->add("", $langs->trans("Users"), 1, $user->hasRight('user', 'user', 'lire') || $user->admin); |
|
1199 | + $newmenu->add("", $langs->trans("Users"), 1, $user->hasRight('user', 'user', 'lire') || $user->admin); |
|
1200 | 1200 | $newmenu->add("/user/card.php?leftmenu=users&action=create", $langs->trans("NewUser"), 2, ($user->hasRight("user", "user", "write") || $user->admin) && !(isModEnabled('multicompany') && $conf->entity > 1 && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)), '', 'home'); |
1201 | - $newmenu->add("/user/list.php?leftmenu=users", $langs->trans("ListOfUsers"), 2, $user->hasRight('user', 'user', 'lire') || $user->admin); |
|
1202 | - $newmenu->add("/user/hierarchy.php?leftmenu=users", $langs->trans("HierarchicView"), 2, $user->hasRight('user', 'user', 'lire') || $user->admin); |
|
1201 | + $newmenu->add("/user/list.php?leftmenu=users", $langs->trans("ListOfUsers"), 2, $user->hasRight('user', 'user', 'lire') || $user->admin); |
|
1202 | + $newmenu->add("/user/hierarchy.php?leftmenu=users", $langs->trans("HierarchicView"), 2, $user->hasRight('user', 'user', 'lire') || $user->admin); |
|
1203 | 1203 | if (isModEnabled('categorie')) { |
1204 | 1204 | $langs->load("categories"); |
1205 | - $newmenu->add("/categories/index.php?leftmenu=users&type=7", $langs->trans("UsersCategoriesShort"), 2, $user->hasRight('categorie', 'lire'), '', $mainmenu, 'cat'); |
|
1205 | + $newmenu->add("/categories/index.php?leftmenu=users&type=7", $langs->trans("UsersCategoriesShort"), 2, $user->hasRight('categorie', 'lire'), '', $mainmenu, 'cat'); |
|
1206 | 1206 | } |
1207 | - $newmenu->add("", $langs->trans("Groups"), 1, ($user->hasRight('user', 'user', 'lire') || $user->admin) && !(isModEnabled('multicompany') && $conf->entity > 1 && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE))); |
|
1207 | + $newmenu->add("", $langs->trans("Groups"), 1, ($user->hasRight('user', 'user', 'lire') || $user->admin) && !(isModEnabled('multicompany') && $conf->entity > 1 && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE))); |
|
1208 | 1208 | $newmenu->add("/user/group/card.php?leftmenu=users&action=create", $langs->trans("NewGroup"), 2, ((!empty($conf->global->MAIN_USE_ADVANCED_PERMS) ? $user->hasRight("user", "group_advance", "create") : $user->hasRight("user", "user", "create")) || $user->admin) && !(isModEnabled('multicompany') && $conf->entity > 1 && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE))); |
1209 | - $newmenu->add("/user/group/list.php?leftmenu=users", $langs->trans("ListOfGroups"), 2, ((!empty($conf->global->MAIN_USE_ADVANCED_PERMS) ? $user->hasRight('user', 'group_advance', 'read') : $user->hasRight('user', 'user', 'lire')) || $user->admin) && !(isModEnabled('multicompany') && $conf->entity > 1 && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE))); |
|
1209 | + $newmenu->add("/user/group/list.php?leftmenu=users", $langs->trans("ListOfGroups"), 2, ((!empty($conf->global->MAIN_USE_ADVANCED_PERMS) ? $user->hasRight('user', 'group_advance', 'read') : $user->hasRight('user', 'user', 'lire')) || $user->admin) && !(isModEnabled('multicompany') && $conf->entity > 1 && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE))); |
|
1210 | 1210 | } |
1211 | 1211 | } |
1212 | 1212 | } |
@@ -1230,9 +1230,9 @@ discard block |
||
1230 | 1230 | // Societes |
1231 | 1231 | if (isModEnabled('societe')) { |
1232 | 1232 | $langs->load("companies"); |
1233 | - $newmenu->add("/societe/index.php?leftmenu=thirdparties", $langs->trans("ThirdParty"), 0, $user->hasRight('societe', 'lire'), '', $mainmenu, 'thirdparties', 0, '', '', '', img_picto('', 'company', 'class="paddingright pictofixedwidth"')); |
|
1233 | + $newmenu->add("/societe/index.php?leftmenu=thirdparties", $langs->trans("ThirdParty"), 0, $user->hasRight('societe', 'lire'), '', $mainmenu, 'thirdparties', 0, '', '', '', img_picto('', 'company', 'class="paddingright pictofixedwidth"')); |
|
1234 | 1234 | |
1235 | - if ($user->hasRight('societe', 'creer')) { |
|
1235 | + if ($user->hasRight('societe', 'creer')) { |
|
1236 | 1236 | $newmenu->add("/societe/card.php?action=create", $langs->trans("MenuNewThirdParty"), 1); |
1237 | 1237 | if (!$conf->use_javascript_ajax) { |
1238 | 1238 | $newmenu->add("/societe/card.php?action=create&private=1", $langs->trans("MenuNewPrivateIndividual"), 1); |
@@ -1245,7 +1245,7 @@ discard block |
||
1245 | 1245 | // Prospects |
1246 | 1246 | if (isModEnabled('societe') && empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) { |
1247 | 1247 | $langs->load("commercial"); |
1248 | - $newmenu->add("/societe/list.php?type=p&leftmenu=prospects", $langs->trans("ListProspectsShort"), 2, $user->hasRight('societe', 'lire'), '', $mainmenu, 'prospects'); |
|
1248 | + $newmenu->add("/societe/list.php?type=p&leftmenu=prospects", $langs->trans("ListProspectsShort"), 2, $user->hasRight('societe', 'lire'), '', $mainmenu, 'prospects'); |
|
1249 | 1249 | /* no more required, there is a filter that can do more |
1250 | 1250 | if ($usemenuhider || empty($leftmenu) || $leftmenu=="prospects") $newmenu->add("/societe/list.php?type=p&sortfield=s.datec&sortorder=desc&begin=&search_stcomm=-1", $langs->trans("LastProspectDoNotContact"), 2, $user->hasRight('societe', 'lire')); |
1251 | 1251 | if ($usemenuhider || empty($leftmenu) || $leftmenu=="prospects") $newmenu->add("/societe/list.php?type=p&sortfield=s.datec&sortorder=desc&begin=&search_stcomm=0", $langs->trans("LastProspectNeverContacted"), 2, $user->hasRight('societe', 'lire')); |
@@ -1253,22 +1253,22 @@ discard block |
||
1253 | 1253 | if ($usemenuhider || empty($leftmenu) || $leftmenu=="prospects") $newmenu->add("/societe/list.php?type=p&sortfield=s.datec&sortorder=desc&begin=&search_stcomm=2", $langs->trans("LastProspectContactInProcess"), 2, $user->hasRight('societe', 'lire')); |
1254 | 1254 | if ($usemenuhider || empty($leftmenu) || $leftmenu=="prospects") $newmenu->add("/societe/list.php?type=p&sortfield=s.datec&sortorder=desc&begin=&search_stcomm=3", $langs->trans("LastProspectContactDone"), 2, $user->hasRight('societe', 'lire')); |
1255 | 1255 | */ |
1256 | - $newmenu->add("/societe/card.php?leftmenu=prospects&action=create&type=p", $langs->trans("MenuNewProspect"), 3, $user->hasRight('societe', 'creer')); |
|
1256 | + $newmenu->add("/societe/card.php?leftmenu=prospects&action=create&type=p", $langs->trans("MenuNewProspect"), 3, $user->hasRight('societe', 'creer')); |
|
1257 | 1257 | } |
1258 | 1258 | |
1259 | 1259 | // Customers/Prospects |
1260 | 1260 | if (isModEnabled('societe') && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) { |
1261 | 1261 | $langs->load("commercial"); |
1262 | - $newmenu->add("/societe/list.php?type=c&leftmenu=customers", $langs->trans("ListCustomersShort"), 2, $user->hasRight('societe', 'lire'), '', $mainmenu, 'customers'); |
|
1262 | + $newmenu->add("/societe/list.php?type=c&leftmenu=customers", $langs->trans("ListCustomersShort"), 2, $user->hasRight('societe', 'lire'), '', $mainmenu, 'customers'); |
|
1263 | 1263 | |
1264 | - $newmenu->add("/societe/card.php?leftmenu=customers&action=create&type=c", $langs->trans("MenuNewCustomer"), 3, $user->hasRight('societe', 'creer')); |
|
1264 | + $newmenu->add("/societe/card.php?leftmenu=customers&action=create&type=c", $langs->trans("MenuNewCustomer"), 3, $user->hasRight('societe', 'creer')); |
|
1265 | 1265 | } |
1266 | 1266 | |
1267 | 1267 | // Suppliers |
1268 | 1268 | if (isModEnabled('societe') && (isModEnabled('supplier_order') || isModEnabled('supplier_invoice') || isModEnabled('supplier_proposal'))) { |
1269 | 1269 | $langs->load("suppliers"); |
1270 | - $newmenu->add("/societe/list.php?type=f&leftmenu=suppliers", $langs->trans("ListSuppliersShort"), 2, ($user->hasRight('fournisseur', 'lire') || $user->hasRight('supplier_order', 'lire') || $user->hasRight('supplier_invoice', 'lire') || $user->hasRight('supplier_proposal', 'lire')), '', $mainmenu, 'suppliers'); |
|
1271 | - $newmenu->add("/societe/card.php?leftmenu=suppliers&action=create&type=f", $langs->trans("MenuNewSupplier"), 3, $user->hasRight('societe', 'creer') && ($user->hasRight('fournisseur', 'lire') || $user->hasRight('supplier_order', 'lire') || $user->hasRight('supplier_invoice', 'lire') || $user->hasRight('supplier_proposal', 'lire'))); |
|
1270 | + $newmenu->add("/societe/list.php?type=f&leftmenu=suppliers", $langs->trans("ListSuppliersShort"), 2, ($user->hasRight('fournisseur', 'lire') || $user->hasRight('supplier_order', 'lire') || $user->hasRight('supplier_invoice', 'lire') || $user->hasRight('supplier_proposal', 'lire')), '', $mainmenu, 'suppliers'); |
|
1271 | + $newmenu->add("/societe/card.php?leftmenu=suppliers&action=create&type=f", $langs->trans("MenuNewSupplier"), 3, $user->hasRight('societe', 'creer') && ($user->hasRight('fournisseur', 'lire') || $user->hasRight('supplier_order', 'lire') || $user->hasRight('supplier_invoice', 'lire') || $user->hasRight('supplier_proposal', 'lire'))); |
|
1272 | 1272 | } |
1273 | 1273 | |
1274 | 1274 | // Categories |
@@ -1283,36 +1283,36 @@ discard block |
||
1283 | 1283 | if (!empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) { |
1284 | 1284 | $menutoshow = $langs->trans("ProspectsCategoriesShort"); |
1285 | 1285 | } |
1286 | - $newmenu->add("/categories/index.php?leftmenu=cat&type=2", $menutoshow, 1, $user->hasRight('categorie', 'lire'), '', $mainmenu, 'cat'); |
|
1286 | + $newmenu->add("/categories/index.php?leftmenu=cat&type=2", $menutoshow, 1, $user->hasRight('categorie', 'lire'), '', $mainmenu, 'cat'); |
|
1287 | 1287 | } |
1288 | 1288 | // Categories suppliers |
1289 | 1289 | if (isModEnabled('supplier_proposal') || isModEnabled('supplier_order') || isModEnabled('supplier_invoice')) { |
1290 | - $newmenu->add("/categories/index.php?leftmenu=catfournish&type=1", $langs->trans("SuppliersCategoriesShort"), 1, $user->hasRight('categorie', 'lire')); |
|
1290 | + $newmenu->add("/categories/index.php?leftmenu=catfournish&type=1", $langs->trans("SuppliersCategoriesShort"), 1, $user->hasRight('categorie', 'lire')); |
|
1291 | 1291 | } |
1292 | 1292 | } |
1293 | 1293 | |
1294 | 1294 | // Contacts |
1295 | - $newmenu->add("/societe/index.php?leftmenu=thirdparties", (!empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("Contacts") : $langs->trans("ContactsAddresses")), 0, $user->hasRight('societe', 'contact', 'lire'), '', $mainmenu, 'contacts', 0, '', '', '', img_picto('', 'contact', 'class="paddingright pictofixedwidth"')); |
|
1295 | + $newmenu->add("/societe/index.php?leftmenu=thirdparties", (!empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("Contacts") : $langs->trans("ContactsAddresses")), 0, $user->hasRight('societe', 'contact', 'lire'), '', $mainmenu, 'contacts', 0, '', '', '', img_picto('', 'contact', 'class="paddingright pictofixedwidth"')); |
|
1296 | 1296 | |
1297 | - $newmenu->add("/contact/card.php?leftmenu=contacts&action=create", (!empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("NewContact") : $langs->trans("NewContactAddress")), 1, $user->hasRight('societe', 'contact', 'creer')); |
|
1298 | - $newmenu->add("/contact/list.php?leftmenu=contacts", $langs->trans("List"), 1, $user->hasRight('societe', 'contact', 'lire')); |
|
1297 | + $newmenu->add("/contact/card.php?leftmenu=contacts&action=create", (!empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("NewContact") : $langs->trans("NewContactAddress")), 1, $user->hasRight('societe', 'contact', 'creer')); |
|
1298 | + $newmenu->add("/contact/list.php?leftmenu=contacts", $langs->trans("List"), 1, $user->hasRight('societe', 'contact', 'lire')); |
|
1299 | 1299 | if (empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) { |
1300 | - $newmenu->add("/contact/list.php?leftmenu=contacts&type=p", $langs->trans("Prospects"), 2, $user->hasRight('societe', 'contact', 'lire')); |
|
1300 | + $newmenu->add("/contact/list.php?leftmenu=contacts&type=p", $langs->trans("Prospects"), 2, $user->hasRight('societe', 'contact', 'lire')); |
|
1301 | 1301 | } |
1302 | 1302 | if (empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) { |
1303 | - $newmenu->add("/contact/list.php?leftmenu=contacts&type=c", $langs->trans("Customers"), 2, $user->hasRight('societe', 'contact', 'lire')); |
|
1303 | + $newmenu->add("/contact/list.php?leftmenu=contacts&type=c", $langs->trans("Customers"), 2, $user->hasRight('societe', 'contact', 'lire')); |
|
1304 | 1304 | } |
1305 | 1305 | if (isModEnabled('supplier_proposal') || isModEnabled('supplier_order') || isModEnabled('supplier_invoice')) { |
1306 | - $newmenu->add("/contact/list.php?leftmenu=contacts&type=f", $langs->trans("Suppliers"), 2, $user->hasRight('fournisseur', 'lire')); |
|
1306 | + $newmenu->add("/contact/list.php?leftmenu=contacts&type=f", $langs->trans("Suppliers"), 2, $user->hasRight('fournisseur', 'lire')); |
|
1307 | 1307 | } |
1308 | - $newmenu->add("/contact/list.php?leftmenu=contacts&type=o", $langs->trans("ContactOthers"), 2, $user->hasRight('societe', 'contact', 'lire')); |
|
1308 | + $newmenu->add("/contact/list.php?leftmenu=contacts&type=o", $langs->trans("ContactOthers"), 2, $user->hasRight('societe', 'contact', 'lire')); |
|
1309 | 1309 | //$newmenu->add("/contact/list.php?userid=$user->id", $langs->trans("MyContacts"), 1, $user->hasRight('societe', 'contact', 'lire')); |
1310 | 1310 | |
1311 | 1311 | // Categories |
1312 | 1312 | if (isModEnabled('categorie')) { |
1313 | 1313 | $langs->load("categories"); |
1314 | 1314 | // Categories Contact |
1315 | - $newmenu->add("/categories/index.php?leftmenu=catcontact&type=4", $langs->trans("ContactCategoriesShort"), 1, $user->hasRight('categorie', 'lire'), '', $mainmenu, 'cat'); |
|
1315 | + $newmenu->add("/categories/index.php?leftmenu=catcontact&type=4", $langs->trans("ContactCategoriesShort"), 1, $user->hasRight('categorie', 'lire'), '', $mainmenu, 'cat'); |
|
1316 | 1316 | } |
1317 | 1317 | } |
1318 | 1318 | } |
@@ -1337,108 +1337,108 @@ discard block |
||
1337 | 1337 | // Customer proposal |
1338 | 1338 | if (isModEnabled('propal')) { |
1339 | 1339 | $langs->load("propal"); |
1340 | - $newmenu->add("/comm/propal/index.php?leftmenu=propals", $langs->trans("Proposals"), 0, $user->hasRight('propal', 'read'), '', $mainmenu, 'propals', 100, '', '', '', img_picto('', 'propal', 'class="paddingright pictofixedwidth"')); |
|
1341 | - $newmenu->add("/comm/propal/card.php?action=create&leftmenu=propals", $langs->trans("NewPropal"), 1, $user->hasRight('propal', 'write')); |
|
1342 | - $newmenu->add("/comm/propal/list.php?leftmenu=propals", $langs->trans("List"), 1, $user->hasRight('propal', 'read')); |
|
1340 | + $newmenu->add("/comm/propal/index.php?leftmenu=propals", $langs->trans("Proposals"), 0, $user->hasRight('propal', 'read'), '', $mainmenu, 'propals', 100, '', '', '', img_picto('', 'propal', 'class="paddingright pictofixedwidth"')); |
|
1341 | + $newmenu->add("/comm/propal/card.php?action=create&leftmenu=propals", $langs->trans("NewPropal"), 1, $user->hasRight('propal', 'write')); |
|
1342 | + $newmenu->add("/comm/propal/list.php?leftmenu=propals", $langs->trans("List"), 1, $user->hasRight('propal', 'read')); |
|
1343 | 1343 | if ($usemenuhider || empty($leftmenu) || $leftmenu == "propals") { |
1344 | - $newmenu->add("/comm/propal/list.php?leftmenu=propals&search_status=0", $langs->trans("PropalsDraft"), 2, $user->hasRight('propal', 'read')); |
|
1345 | - $newmenu->add("/comm/propal/list.php?leftmenu=propals&search_status=1", $langs->trans("PropalsOpened"), 2, $user->hasRight('propal', 'read')); |
|
1346 | - $newmenu->add("/comm/propal/list.php?leftmenu=propals&search_status=2", $langs->trans("PropalStatusSigned"), 2, $user->hasRight('propal', 'read')); |
|
1347 | - $newmenu->add("/comm/propal/list.php?leftmenu=propals&search_status=3", $langs->trans("PropalStatusNotSigned"), 2, $user->hasRight('propal', 'read')); |
|
1348 | - $newmenu->add("/comm/propal/list.php?leftmenu=propals&search_status=4", $langs->trans("PropalStatusBilled"), 2, $user->hasRight('propal', 'read')); |
|
1344 | + $newmenu->add("/comm/propal/list.php?leftmenu=propals&search_status=0", $langs->trans("PropalsDraft"), 2, $user->hasRight('propal', 'read')); |
|
1345 | + $newmenu->add("/comm/propal/list.php?leftmenu=propals&search_status=1", $langs->trans("PropalsOpened"), 2, $user->hasRight('propal', 'read')); |
|
1346 | + $newmenu->add("/comm/propal/list.php?leftmenu=propals&search_status=2", $langs->trans("PropalStatusSigned"), 2, $user->hasRight('propal', 'read')); |
|
1347 | + $newmenu->add("/comm/propal/list.php?leftmenu=propals&search_status=3", $langs->trans("PropalStatusNotSigned"), 2, $user->hasRight('propal', 'read')); |
|
1348 | + $newmenu->add("/comm/propal/list.php?leftmenu=propals&search_status=4", $langs->trans("PropalStatusBilled"), 2, $user->hasRight('propal', 'read')); |
|
1349 | 1349 | //$newmenu->add("/comm/propal/list.php?leftmenu=propals&search_status=2,3,4", $langs->trans("PropalStatusClosedShort"), 2, $user->hasRight('propal', 'read')); |
1350 | 1350 | } |
1351 | - $newmenu->add("/comm/propal/stats/index.php?leftmenu=propals", $langs->trans("Statistics"), 1, $user->hasRight('propal', 'read')); |
|
1351 | + $newmenu->add("/comm/propal/stats/index.php?leftmenu=propals", $langs->trans("Statistics"), 1, $user->hasRight('propal', 'read')); |
|
1352 | 1352 | } |
1353 | 1353 | |
1354 | 1354 | // Customers orders |
1355 | 1355 | if (isModEnabled('commande')) { |
1356 | 1356 | $langs->load("orders"); |
1357 | - $newmenu->add("/commande/index.php?leftmenu=orders", $langs->trans("CustomersOrders"), 0, $user->hasRight('commande', 'lire'), '', $mainmenu, 'orders', 200, '', '', '', img_picto('', 'order', 'class="paddingright pictofixedwidth"')); |
|
1358 | - $newmenu->add("/commande/card.php?action=create&leftmenu=orders", $langs->trans("NewOrder"), 1, $user->hasRight('commande', 'creer')); |
|
1359 | - $newmenu->add("/commande/list.php?leftmenu=orders", $langs->trans("List"), 1, $user->hasRight('commande', 'lire')); |
|
1357 | + $newmenu->add("/commande/index.php?leftmenu=orders", $langs->trans("CustomersOrders"), 0, $user->hasRight('commande', 'lire'), '', $mainmenu, 'orders', 200, '', '', '', img_picto('', 'order', 'class="paddingright pictofixedwidth"')); |
|
1358 | + $newmenu->add("/commande/card.php?action=create&leftmenu=orders", $langs->trans("NewOrder"), 1, $user->hasRight('commande', 'creer')); |
|
1359 | + $newmenu->add("/commande/list.php?leftmenu=orders", $langs->trans("List"), 1, $user->hasRight('commande', 'lire')); |
|
1360 | 1360 | if ($usemenuhider || empty($leftmenu) || $leftmenu == "orders") { |
1361 | - $newmenu->add("/commande/list.php?leftmenu=orders&search_status=0", $langs->trans("StatusOrderDraftShort"), 2, $user->hasRight('commande', 'lire')); |
|
1362 | - $newmenu->add("/commande/list.php?leftmenu=orders&search_status=1", $langs->trans("StatusOrderValidated"), 2, $user->hasRight('commande', 'lire')); |
|
1361 | + $newmenu->add("/commande/list.php?leftmenu=orders&search_status=0", $langs->trans("StatusOrderDraftShort"), 2, $user->hasRight('commande', 'lire')); |
|
1362 | + $newmenu->add("/commande/list.php?leftmenu=orders&search_status=1", $langs->trans("StatusOrderValidated"), 2, $user->hasRight('commande', 'lire')); |
|
1363 | 1363 | if (isModEnabled('expedition')) { |
1364 | - $newmenu->add("/commande/list.php?leftmenu=orders&search_status=2", $langs->trans("StatusOrderSentShort"), 2, $user->hasRight('commande', 'lire')); |
|
1364 | + $newmenu->add("/commande/list.php?leftmenu=orders&search_status=2", $langs->trans("StatusOrderSentShort"), 2, $user->hasRight('commande', 'lire')); |
|
1365 | 1365 | } |
1366 | - $newmenu->add("/commande/list.php?leftmenu=orders&search_status=3", $langs->trans("StatusOrderDelivered"), 2, $user->hasRight('commande', 'lire')); |
|
1366 | + $newmenu->add("/commande/list.php?leftmenu=orders&search_status=3", $langs->trans("StatusOrderDelivered"), 2, $user->hasRight('commande', 'lire')); |
|
1367 | 1367 | //$newmenu->add("/commande/list.php?leftmenu=orders&search_status=4", $langs->trans("StatusOrderProcessed"), 2, $user->hasRight('commande', 'lire')); |
1368 | - $newmenu->add("/commande/list.php?leftmenu=orders&search_status=-1", $langs->trans("StatusOrderCanceledShort"), 2, $user->hasRight('commande', 'lire')); |
|
1368 | + $newmenu->add("/commande/list.php?leftmenu=orders&search_status=-1", $langs->trans("StatusOrderCanceledShort"), 2, $user->hasRight('commande', 'lire')); |
|
1369 | 1369 | } |
1370 | 1370 | if ($conf->global->MAIN_FEATURES_LEVEL >= 2 && empty($user->socid)) { |
1371 | - $newmenu->add("/commande/list_det.php?leftmenu=orders", $langs->trans("ListOrderLigne"), 1, $user->hasRight('commande', 'lire')); |
|
1371 | + $newmenu->add("/commande/list_det.php?leftmenu=orders", $langs->trans("ListOrderLigne"), 1, $user->hasRight('commande', 'lire')); |
|
1372 | 1372 | } |
1373 | 1373 | if (getDolGlobalInt('MAIN_NEED_EXPORT_PERMISSION_TO_READ_STATISTICS')) { |
1374 | 1374 | $newmenu->add("/commande/stats/index.php?leftmenu=orders", $langs->trans("Statistics"), 1, $user->hasRight('commande', 'commande', 'export')); |
1375 | 1375 | } else { |
1376 | - $newmenu->add("/commande/stats/index.php?leftmenu=orders", $langs->trans("Statistics"), 1, $user->hasRight('commande', 'lire')); |
|
1376 | + $newmenu->add("/commande/stats/index.php?leftmenu=orders", $langs->trans("Statistics"), 1, $user->hasRight('commande', 'lire')); |
|
1377 | 1377 | } |
1378 | 1378 | } |
1379 | 1379 | |
1380 | 1380 | // Supplier proposal |
1381 | 1381 | if (isModEnabled('supplier_proposal')) { |
1382 | 1382 | $langs->load("supplier_proposal"); |
1383 | - $newmenu->add("/supplier_proposal/index.php?leftmenu=propals_supplier", $langs->trans("SupplierProposalsShort"), 0, $user->hasRight('supplier_proposal', 'lire'), '', $mainmenu, 'propals_supplier', 300, '', '', '', img_picto('', 'supplier_proposal', 'class="paddingright pictofixedwidth"')); |
|
1384 | - $newmenu->add("/supplier_proposal/card.php?action=create&leftmenu=supplier_proposals", $langs->trans("SupplierProposalNew"), 1, $user->hasRight('supplier_proposal', 'creer')); |
|
1385 | - $newmenu->add("/supplier_proposal/list.php?leftmenu=supplier_proposals", $langs->trans("List"), 1, $user->hasRight('supplier_proposal', 'lire')); |
|
1386 | - $newmenu->add("/comm/propal/stats/index.php?leftmenu=supplier_proposals&mode=supplier", $langs->trans("Statistics"), 1, $user->hasRight('supplier_proposal', 'lire')); |
|
1383 | + $newmenu->add("/supplier_proposal/index.php?leftmenu=propals_supplier", $langs->trans("SupplierProposalsShort"), 0, $user->hasRight('supplier_proposal', 'lire'), '', $mainmenu, 'propals_supplier', 300, '', '', '', img_picto('', 'supplier_proposal', 'class="paddingright pictofixedwidth"')); |
|
1384 | + $newmenu->add("/supplier_proposal/card.php?action=create&leftmenu=supplier_proposals", $langs->trans("SupplierProposalNew"), 1, $user->hasRight('supplier_proposal', 'creer')); |
|
1385 | + $newmenu->add("/supplier_proposal/list.php?leftmenu=supplier_proposals", $langs->trans("List"), 1, $user->hasRight('supplier_proposal', 'lire')); |
|
1386 | + $newmenu->add("/comm/propal/stats/index.php?leftmenu=supplier_proposals&mode=supplier", $langs->trans("Statistics"), 1, $user->hasRight('supplier_proposal', 'lire')); |
|
1387 | 1387 | } |
1388 | 1388 | |
1389 | 1389 | // Suppliers orders |
1390 | 1390 | if (isModEnabled('supplier_order')) { |
1391 | 1391 | $langs->load("orders"); |
1392 | - $newmenu->add("/fourn/commande/index.php?leftmenu=orders_suppliers", $langs->trans("SuppliersOrders"), 0, $user->hasRight('fournisseur', 'commande', 'lire'), '', $mainmenu, 'orders_suppliers', 400, '', '', '', img_picto('', 'supplier_order', 'class="paddingright pictofixedwidth"')); |
|
1393 | - $newmenu->add("/fourn/commande/card.php?action=create&leftmenu=orders_suppliers", $langs->trans("NewSupplierOrderShort"), 1, $user->hasRight('fournisseur', 'commande', 'creer')); |
|
1394 | - $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers", $langs->trans("List"), 1, $user->hasRight('fournisseur', 'commande', 'lire')); |
|
1392 | + $newmenu->add("/fourn/commande/index.php?leftmenu=orders_suppliers", $langs->trans("SuppliersOrders"), 0, $user->hasRight('fournisseur', 'commande', 'lire'), '', $mainmenu, 'orders_suppliers', 400, '', '', '', img_picto('', 'supplier_order', 'class="paddingright pictofixedwidth"')); |
|
1393 | + $newmenu->add("/fourn/commande/card.php?action=create&leftmenu=orders_suppliers", $langs->trans("NewSupplierOrderShort"), 1, $user->hasRight('fournisseur', 'commande', 'creer')); |
|
1394 | + $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers", $langs->trans("List"), 1, $user->hasRight('fournisseur', 'commande', 'lire')); |
|
1395 | 1395 | |
1396 | 1396 | if ($usemenuhider || empty($leftmenu) || $leftmenu == "orders_suppliers") { |
1397 | - $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=0", $langs->trans("StatusSupplierOrderDraftShort"), 2, $user->hasRight('fournisseur', 'commande', 'lire')); |
|
1397 | + $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=0", $langs->trans("StatusSupplierOrderDraftShort"), 2, $user->hasRight('fournisseur', 'commande', 'lire')); |
|
1398 | 1398 | if (empty($conf->global->SUPPLIER_ORDER_HIDE_VALIDATED)) { |
1399 | - $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=1", $langs->trans("StatusSupplierOrderValidated"), 2, $user->hasRight('fournisseur', 'commande', 'lire')); |
|
1399 | + $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=1", $langs->trans("StatusSupplierOrderValidated"), 2, $user->hasRight('fournisseur', 'commande', 'lire')); |
|
1400 | 1400 | } |
1401 | - $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=2", $langs->trans("StatusSupplierOrderApprovedShort"), 2, $user->hasRight('fournisseur', 'commande', 'lire')); |
|
1402 | - $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=3", $langs->trans("StatusSupplierOrderOnProcessShort"), 2, $user->hasRight('fournisseur', 'commande', 'lire')); |
|
1403 | - $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=4", $langs->trans("StatusSupplierOrderReceivedPartiallyShort"), 2, $user->hasRight('fournisseur', 'commande', 'lire')); |
|
1404 | - $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=5", $langs->trans("StatusSupplierOrderReceivedAll"), 2, $user->hasRight('fournisseur', 'commande', 'lire')); |
|
1405 | - $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=6,7", $langs->trans("StatusSupplierOrderCanceled"), 2, $user->hasRight('fournisseur', 'commande', 'lire')); |
|
1406 | - $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=9", $langs->trans("StatusSupplierOrderRefused"), 2, $user->hasRight('fournisseur', 'commande', 'lire')); |
|
1401 | + $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=2", $langs->trans("StatusSupplierOrderApprovedShort"), 2, $user->hasRight('fournisseur', 'commande', 'lire')); |
|
1402 | + $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=3", $langs->trans("StatusSupplierOrderOnProcessShort"), 2, $user->hasRight('fournisseur', 'commande', 'lire')); |
|
1403 | + $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=4", $langs->trans("StatusSupplierOrderReceivedPartiallyShort"), 2, $user->hasRight('fournisseur', 'commande', 'lire')); |
|
1404 | + $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=5", $langs->trans("StatusSupplierOrderReceivedAll"), 2, $user->hasRight('fournisseur', 'commande', 'lire')); |
|
1405 | + $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=6,7", $langs->trans("StatusSupplierOrderCanceled"), 2, $user->hasRight('fournisseur', 'commande', 'lire')); |
|
1406 | + $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=9", $langs->trans("StatusSupplierOrderRefused"), 2, $user->hasRight('fournisseur', 'commande', 'lire')); |
|
1407 | 1407 | } |
1408 | 1408 | // Billed is another field. We should add instead a dedicated filter on list. if ($usemenuhider || empty($leftmenu) || $leftmenu=="orders_suppliers") $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&billed=1", $langs->trans("Billed"), 2, $user->hasRight('fournisseur', 'commande', 'lire')); |
1409 | 1409 | |
1410 | 1410 | if (getDolGlobalInt('MAIN_NEED_EXPORT_PERMISSION_TO_READ_STATISTICS')) { |
1411 | 1411 | $newmenu->add("/commande/stats/index.php?leftmenu=orders_suppliers&mode=supplier", $langs->trans("Statistics"), 1, $user->hasRight('fournisseur', 'commande', 'export')); |
1412 | 1412 | } else { |
1413 | - $newmenu->add("/commande/stats/index.php?leftmenu=orders_suppliers&mode=supplier", $langs->trans("Statistics"), 1, $user->hasRight('fournisseur', 'commande', 'lire')); |
|
1413 | + $newmenu->add("/commande/stats/index.php?leftmenu=orders_suppliers&mode=supplier", $langs->trans("Statistics"), 1, $user->hasRight('fournisseur', 'commande', 'lire')); |
|
1414 | 1414 | } |
1415 | 1415 | } |
1416 | 1416 | |
1417 | 1417 | // Contrat |
1418 | 1418 | if (isModEnabled('contrat')) { |
1419 | 1419 | $langs->load("contracts"); |
1420 | - $newmenu->add("/contrat/index.php?leftmenu=contracts", $langs->trans("ContractsSubscriptions"), 0, $user->hasRight('contrat', 'lire'), '', $mainmenu, 'contracts', 2000, '', '', '', img_picto('', 'contract', 'class="paddingright pictofixedwidth"')); |
|
1421 | - $newmenu->add("/contrat/card.php?action=create&leftmenu=contracts", $langs->trans("NewContractSubscription"), 1, $user->hasRight('contrat', 'creer')); |
|
1422 | - $newmenu->add("/contrat/list.php?leftmenu=contracts", $langs->trans("List"), 1, $user->hasRight('contrat', 'lire')); |
|
1423 | - $newmenu->add("/contrat/services_list.php?leftmenu=contracts", $langs->trans("MenuServices"), 1, $user->hasRight('contrat', 'lire')); |
|
1420 | + $newmenu->add("/contrat/index.php?leftmenu=contracts", $langs->trans("ContractsSubscriptions"), 0, $user->hasRight('contrat', 'lire'), '', $mainmenu, 'contracts', 2000, '', '', '', img_picto('', 'contract', 'class="paddingright pictofixedwidth"')); |
|
1421 | + $newmenu->add("/contrat/card.php?action=create&leftmenu=contracts", $langs->trans("NewContractSubscription"), 1, $user->hasRight('contrat', 'creer')); |
|
1422 | + $newmenu->add("/contrat/list.php?leftmenu=contracts", $langs->trans("List"), 1, $user->hasRight('contrat', 'lire')); |
|
1423 | + $newmenu->add("/contrat/services_list.php?leftmenu=contracts", $langs->trans("MenuServices"), 1, $user->hasRight('contrat', 'lire')); |
|
1424 | 1424 | if ($usemenuhider || empty($leftmenu) || $leftmenu == "contracts") { |
1425 | - $newmenu->add("/contrat/services_list.php?leftmenu=contracts&search_status=0", $langs->trans("MenuInactiveServices"), 2, $user->hasRight('contrat', 'lire')); |
|
1426 | - $newmenu->add("/contrat/services_list.php?leftmenu=contracts&search_status=4", $langs->trans("MenuRunningServices"), 2, $user->hasRight('contrat', 'lire')); |
|
1427 | - $newmenu->add("/contrat/services_list.php?leftmenu=contracts&search_status=4&filter=expired", $langs->trans("MenuExpiredServices"), 2, $user->hasRight('contrat', 'lire')); |
|
1428 | - $newmenu->add("/contrat/services_list.php?leftmenu=contracts&search_status=5", $langs->trans("MenuClosedServices"), 2, $user->hasRight('contrat', 'lire')); |
|
1425 | + $newmenu->add("/contrat/services_list.php?leftmenu=contracts&search_status=0", $langs->trans("MenuInactiveServices"), 2, $user->hasRight('contrat', 'lire')); |
|
1426 | + $newmenu->add("/contrat/services_list.php?leftmenu=contracts&search_status=4", $langs->trans("MenuRunningServices"), 2, $user->hasRight('contrat', 'lire')); |
|
1427 | + $newmenu->add("/contrat/services_list.php?leftmenu=contracts&search_status=4&filter=expired", $langs->trans("MenuExpiredServices"), 2, $user->hasRight('contrat', 'lire')); |
|
1428 | + $newmenu->add("/contrat/services_list.php?leftmenu=contracts&search_status=5", $langs->trans("MenuClosedServices"), 2, $user->hasRight('contrat', 'lire')); |
|
1429 | 1429 | } |
1430 | 1430 | } |
1431 | 1431 | |
1432 | 1432 | // Interventions |
1433 | 1433 | if (isModEnabled('ficheinter')) { |
1434 | 1434 | $langs->load("interventions"); |
1435 | - $newmenu->add("/fichinter/index.php?leftmenu=ficheinter", $langs->trans("Interventions"), 0, $user->hasRight('ficheinter', 'lire'), '', $mainmenu, 'ficheinter', 2200, '', '', '', img_picto('', 'intervention', 'class="paddingright pictofixedwidth"')); |
|
1436 | - $newmenu->add("/fichinter/card.php?action=create&leftmenu=ficheinter", $langs->trans("NewIntervention"), 1, $user->hasRight('ficheinter', 'creer'), '', '', '', 201); |
|
1437 | - $newmenu->add("/fichinter/list.php?leftmenu=ficheinter", $langs->trans("List"), 1, $user->hasRight('ficheinter', 'lire'), '', '', '', 202); |
|
1435 | + $newmenu->add("/fichinter/index.php?leftmenu=ficheinter", $langs->trans("Interventions"), 0, $user->hasRight('ficheinter', 'lire'), '', $mainmenu, 'ficheinter', 2200, '', '', '', img_picto('', 'intervention', 'class="paddingright pictofixedwidth"')); |
|
1436 | + $newmenu->add("/fichinter/card.php?action=create&leftmenu=ficheinter", $langs->trans("NewIntervention"), 1, $user->hasRight('ficheinter', 'creer'), '', '', '', 201); |
|
1437 | + $newmenu->add("/fichinter/list.php?leftmenu=ficheinter", $langs->trans("List"), 1, $user->hasRight('ficheinter', 'lire'), '', '', '', 202); |
|
1438 | 1438 | if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { |
1439 | - $newmenu->add("/fichinter/card-rec.php?leftmenu=ficheinter", $langs->trans("ListOfTemplates"), 1, $user->hasRight('ficheinter', 'lire'), '', '', '', 203); |
|
1439 | + $newmenu->add("/fichinter/card-rec.php?leftmenu=ficheinter", $langs->trans("ListOfTemplates"), 1, $user->hasRight('ficheinter', 'lire'), '', '', '', 203); |
|
1440 | 1440 | } |
1441 | - $newmenu->add("/fichinter/stats/index.php?leftmenu=ficheinter", $langs->trans("Statistics"), 1, $user->hasRight('ficheinter', 'lire')); |
|
1441 | + $newmenu->add("/fichinter/stats/index.php?leftmenu=ficheinter", $langs->trans("Statistics"), 1, $user->hasRight('ficheinter', 'lire')); |
|
1442 | 1442 | } |
1443 | 1443 | } |
1444 | 1444 | } |
@@ -1463,59 +1463,59 @@ discard block |
||
1463 | 1463 | // Customers invoices |
1464 | 1464 | if (isModEnabled('facture')) { |
1465 | 1465 | $langs->load("bills"); |
1466 | - $newmenu->add("/compta/facture/index.php?leftmenu=customers_bills", $langs->trans("BillsCustomers"), 0, $user->hasRight('facture', 'lire'), '', $mainmenu, 'customers_bills', 0, '', '', '', img_picto('', 'bill', 'class="paddingright pictofixedwidth"')); |
|
1467 | - $newmenu->add("/compta/facture/card.php?action=create", $langs->trans("NewBill"), 1, $user->hasRight('facture', 'creer')); |
|
1468 | - $newmenu->add("/compta/facture/list.php?leftmenu=customers_bills", $langs->trans("List"), 1, $user->hasRight('facture', 'lire'), '', $mainmenu, 'customers_bills_list'); |
|
1466 | + $newmenu->add("/compta/facture/index.php?leftmenu=customers_bills", $langs->trans("BillsCustomers"), 0, $user->hasRight('facture', 'lire'), '', $mainmenu, 'customers_bills', 0, '', '', '', img_picto('', 'bill', 'class="paddingright pictofixedwidth"')); |
|
1467 | + $newmenu->add("/compta/facture/card.php?action=create", $langs->trans("NewBill"), 1, $user->hasRight('facture', 'creer')); |
|
1468 | + $newmenu->add("/compta/facture/list.php?leftmenu=customers_bills", $langs->trans("List"), 1, $user->hasRight('facture', 'lire'), '', $mainmenu, 'customers_bills_list'); |
|
1469 | 1469 | |
1470 | 1470 | if ($usemenuhider || empty($leftmenu) || preg_match('/customers_bills(|_draft|_notpaid|_paid|_canceled)$/', $leftmenu)) { |
1471 | - $newmenu->add("/compta/facture/list.php?leftmenu=customers_bills_draft&search_status=0", $langs->trans("BillShortStatusDraft"), 2, $user->hasRight('facture', 'lire')); |
|
1472 | - $newmenu->add("/compta/facture/list.php?leftmenu=customers_bills_notpaid&search_status=1", $langs->trans("BillShortStatusNotPaid"), 2, $user->hasRight('facture', 'lire')); |
|
1473 | - $newmenu->add("/compta/facture/list.php?leftmenu=customers_bills_paid&search_status=2", $langs->trans("BillShortStatusPaid"), 2, $user->hasRight('facture', 'lire')); |
|
1474 | - $newmenu->add("/compta/facture/list.php?leftmenu=customers_bills_canceled&search_status=3", $langs->trans("BillShortStatusCanceled"), 2, $user->hasRight('facture', 'lire')); |
|
1471 | + $newmenu->add("/compta/facture/list.php?leftmenu=customers_bills_draft&search_status=0", $langs->trans("BillShortStatusDraft"), 2, $user->hasRight('facture', 'lire')); |
|
1472 | + $newmenu->add("/compta/facture/list.php?leftmenu=customers_bills_notpaid&search_status=1", $langs->trans("BillShortStatusNotPaid"), 2, $user->hasRight('facture', 'lire')); |
|
1473 | + $newmenu->add("/compta/facture/list.php?leftmenu=customers_bills_paid&search_status=2", $langs->trans("BillShortStatusPaid"), 2, $user->hasRight('facture', 'lire')); |
|
1474 | + $newmenu->add("/compta/facture/list.php?leftmenu=customers_bills_canceled&search_status=3", $langs->trans("BillShortStatusCanceled"), 2, $user->hasRight('facture', 'lire')); |
|
1475 | 1475 | } |
1476 | - $newmenu->add("/compta/facture/invoicetemplate_list.php?leftmenu=customers_bills_templates", $langs->trans("ListOfTemplates"), 1, $user->hasRight('facture', 'creer'), '', $mainmenu, 'customers_bills_templates'); // No need to see recurring invoices, if user has no permission to create invoice. |
|
1476 | + $newmenu->add("/compta/facture/invoicetemplate_list.php?leftmenu=customers_bills_templates", $langs->trans("ListOfTemplates"), 1, $user->hasRight('facture', 'creer'), '', $mainmenu, 'customers_bills_templates'); // No need to see recurring invoices, if user has no permission to create invoice. |
|
1477 | 1477 | |
1478 | - $newmenu->add("/compta/paiement/list.php?leftmenu=customers_bills_payment", $langs->trans("Payments"), 1, $user->hasRight('facture', 'lire'), '', $mainmenu, 'customers_bills_payment'); |
|
1478 | + $newmenu->add("/compta/paiement/list.php?leftmenu=customers_bills_payment", $langs->trans("Payments"), 1, $user->hasRight('facture', 'lire'), '', $mainmenu, 'customers_bills_payment'); |
|
1479 | 1479 | |
1480 | 1480 | if (!empty($conf->global->BILL_ADD_PAYMENT_VALIDATION)) { |
1481 | - $newmenu->add("/compta/paiement/tovalidate.php?leftmenu=customers_bills_tovalid", $langs->trans("MenuToValid"), 2, $user->hasRight('facture', 'lire'), '', $mainmenu, 'customer_bills_tovalid'); |
|
1481 | + $newmenu->add("/compta/paiement/tovalidate.php?leftmenu=customers_bills_tovalid", $langs->trans("MenuToValid"), 2, $user->hasRight('facture', 'lire'), '', $mainmenu, 'customer_bills_tovalid'); |
|
1482 | 1482 | } |
1483 | 1483 | if ($usemenuhider || empty($leftmenu) || preg_match('/customers_bills/', $leftmenu)) { |
1484 | - $newmenu->add("/compta/paiement/rapport.php?leftmenu=customers_bills_payment_report", $langs->trans("Reportings"), 2, $user->hasRight('facture', 'lire'), '', $mainmenu, 'customers_bills_payment_report'); |
|
1484 | + $newmenu->add("/compta/paiement/rapport.php?leftmenu=customers_bills_payment_report", $langs->trans("Reportings"), 2, $user->hasRight('facture', 'lire'), '', $mainmenu, 'customers_bills_payment_report'); |
|
1485 | 1485 | } |
1486 | 1486 | |
1487 | - $newmenu->add("/compta/facture/stats/index.php?leftmenu=customers_bills_stats", $langs->trans("Statistics"), 1, $user->hasRight('facture', 'lire'), '', $mainmenu, 'customers_bills_stats'); |
|
1487 | + $newmenu->add("/compta/facture/stats/index.php?leftmenu=customers_bills_stats", $langs->trans("Statistics"), 1, $user->hasRight('facture', 'lire'), '', $mainmenu, 'customers_bills_stats'); |
|
1488 | 1488 | } |
1489 | 1489 | |
1490 | 1490 | // Suppliers invoices |
1491 | 1491 | if (isModEnabled('societe') && isModEnabled('supplier_invoice')) { |
1492 | 1492 | $langs->load("bills"); |
1493 | - $newmenu->add("/fourn/facture/index.php?leftmenu=suppliers_bills", $langs->trans("BillsSuppliers"), 0, $user->hasRight('fournisseur', 'facture', 'lire'), '', $mainmenu, 'suppliers_bills', 0, '', '', '', img_picto('', 'supplier_invoice', 'class="paddingright pictofixedwidth"')); |
|
1494 | - $newmenu->add("/fourn/facture/card.php?leftmenu=suppliers_bills&action=create", $langs->trans("NewBill"), 1, ($user->hasRight('fournisseur', 'facture', 'creer') || $user->hasRight('supplier_invoice', 'creer')), '', $mainmenu, 'suppliers_bills_create'); |
|
1495 | - $newmenu->add("/fourn/facture/list.php?leftmenu=suppliers_bills", $langs->trans("List"), 1, $user->hasRight('fournisseur', 'facture', 'lire'), '', $mainmenu, 'suppliers_bills_list'); |
|
1493 | + $newmenu->add("/fourn/facture/index.php?leftmenu=suppliers_bills", $langs->trans("BillsSuppliers"), 0, $user->hasRight('fournisseur', 'facture', 'lire'), '', $mainmenu, 'suppliers_bills', 0, '', '', '', img_picto('', 'supplier_invoice', 'class="paddingright pictofixedwidth"')); |
|
1494 | + $newmenu->add("/fourn/facture/card.php?leftmenu=suppliers_bills&action=create", $langs->trans("NewBill"), 1, ($user->hasRight('fournisseur', 'facture', 'creer') || $user->hasRight('supplier_invoice', 'creer')), '', $mainmenu, 'suppliers_bills_create'); |
|
1495 | + $newmenu->add("/fourn/facture/list.php?leftmenu=suppliers_bills", $langs->trans("List"), 1, $user->hasRight('fournisseur', 'facture', 'lire'), '', $mainmenu, 'suppliers_bills_list'); |
|
1496 | 1496 | |
1497 | 1497 | if ($usemenuhider || empty($leftmenu) || preg_match('/suppliers_bills/', $leftmenu)) { |
1498 | - $newmenu->add("/fourn/facture/list.php?leftmenu=suppliers_bills_draft&search_status=0", $langs->trans("BillShortStatusDraft"), 2, $user->hasRight('fournisseur', 'facture', 'lire'), '', $mainmenu, 'suppliers_bills_draft'); |
|
1499 | - $newmenu->add("/fourn/facture/list.php?leftmenu=suppliers_bills_notpaid&search_status=1", $langs->trans("BillShortStatusNotPaid"), 2, $user->hasRight('fournisseur', 'facture', 'lire'), '', $mainmenu, 'suppliers_bills_notpaid'); |
|
1500 | - $newmenu->add("/fourn/facture/list.php?leftmenu=suppliers_bills_paid&search_status=2", $langs->trans("BillShortStatusPaid"), 2, $user->hasRight('fournisseur', 'facture', 'lire'), '', $mainmenu, 'suppliers_bills_paid'); |
|
1498 | + $newmenu->add("/fourn/facture/list.php?leftmenu=suppliers_bills_draft&search_status=0", $langs->trans("BillShortStatusDraft"), 2, $user->hasRight('fournisseur', 'facture', 'lire'), '', $mainmenu, 'suppliers_bills_draft'); |
|
1499 | + $newmenu->add("/fourn/facture/list.php?leftmenu=suppliers_bills_notpaid&search_status=1", $langs->trans("BillShortStatusNotPaid"), 2, $user->hasRight('fournisseur', 'facture', 'lire'), '', $mainmenu, 'suppliers_bills_notpaid'); |
|
1500 | + $newmenu->add("/fourn/facture/list.php?leftmenu=suppliers_bills_paid&search_status=2", $langs->trans("BillShortStatusPaid"), 2, $user->hasRight('fournisseur', 'facture', 'lire'), '', $mainmenu, 'suppliers_bills_paid'); |
|
1501 | 1501 | } |
1502 | 1502 | |
1503 | - $newmenu->add("/fourn/facture/list-rec.php?leftmenu=supplierinvoicestemplate_list", $langs->trans("ListOfTemplates"), 1, $user->hasRight('fournisseur', 'facture', 'lire'), '', $mainmenu, 'supplierinvoicestemplate_list'); |
|
1503 | + $newmenu->add("/fourn/facture/list-rec.php?leftmenu=supplierinvoicestemplate_list", $langs->trans("ListOfTemplates"), 1, $user->hasRight('fournisseur', 'facture', 'lire'), '', $mainmenu, 'supplierinvoicestemplate_list'); |
|
1504 | 1504 | |
1505 | - $newmenu->add("/fourn/paiement/list.php?leftmenu=suppliers_bills_payment", $langs->trans("Payments"), 1, $user->hasRight('fournisseur', 'facture', 'lire'), '', $mainmenu, 'suppliers_bills_payment'); |
|
1505 | + $newmenu->add("/fourn/paiement/list.php?leftmenu=suppliers_bills_payment", $langs->trans("Payments"), 1, $user->hasRight('fournisseur', 'facture', 'lire'), '', $mainmenu, 'suppliers_bills_payment'); |
|
1506 | 1506 | |
1507 | 1507 | if ($usemenuhider || empty($leftmenu) || preg_match('/suppliers_bills/', $leftmenu)) { |
1508 | - $newmenu->add("/fourn/facture/rapport.php?leftmenu=suppliers_bills_payment_report", $langs->trans("Reportings"), 2, $user->hasRight('fournisseur', 'facture', 'lire'), '', $mainmenu, 'suppliers_bills_payment_report'); |
|
1508 | + $newmenu->add("/fourn/facture/rapport.php?leftmenu=suppliers_bills_payment_report", $langs->trans("Reportings"), 2, $user->hasRight('fournisseur', 'facture', 'lire'), '', $mainmenu, 'suppliers_bills_payment_report'); |
|
1509 | 1509 | } |
1510 | 1510 | |
1511 | - $newmenu->add("/compta/facture/stats/index.php?mode=supplier&leftmenu=suppliers_bills_stats", $langs->trans("Statistics"), 1, $user->hasRight('fournisseur', 'facture', 'lire'), '', $mainmenu, 'suppliers_bills_stats'); |
|
1511 | + $newmenu->add("/compta/facture/stats/index.php?mode=supplier&leftmenu=suppliers_bills_stats", $langs->trans("Statistics"), 1, $user->hasRight('fournisseur', 'facture', 'lire'), '', $mainmenu, 'suppliers_bills_stats'); |
|
1512 | 1512 | } |
1513 | 1513 | |
1514 | 1514 | // Orders |
1515 | 1515 | if (isModEnabled('commande')) { |
1516 | 1516 | $langs->load("orders"); |
1517 | 1517 | if (isModEnabled('facture')) { |
1518 | - $newmenu->add("/commande/list.php?leftmenu=orders&search_status=-3&billed=0&contextpage=billableorders", $langs->trans("MenuOrdersToBill2"), 0, $user->hasRight('commande', 'lire'), '', $mainmenu, 'orders', 0, '', '', '', img_picto('', 'order', 'class="paddingright pictofixedwidth"')); |
|
1518 | + $newmenu->add("/commande/list.php?leftmenu=orders&search_status=-3&billed=0&contextpage=billableorders", $langs->trans("MenuOrdersToBill2"), 0, $user->hasRight('commande', 'lire'), '', $mainmenu, 'orders', 0, '', '', '', img_picto('', 'order', 'class="paddingright pictofixedwidth"')); |
|
1519 | 1519 | } |
1520 | 1520 | //if ($usemenuhider || empty($leftmenu) || $leftmenu=="orders") $newmenu->add("/commande/", $langs->trans("StatusOrderToBill"), 1, $user->hasRight('commande', 'lire')); |
1521 | 1521 | } |
@@ -1524,7 +1524,7 @@ discard block |
||
1524 | 1524 | if (isModEnabled('supplier_invoice')) { |
1525 | 1525 | if (!empty($conf->global->SUPPLIER_MENU_ORDER_RECEIVED_INTO_INVOICE)) { |
1526 | 1526 | $langs->load("supplier"); |
1527 | - $newmenu->add("/fourn/commande/list.php?leftmenu=orders&search_status=5&billed=0", $langs->trans("MenuOrdersSupplierToBill"), 0, $user->hasRight('commande', 'lire'), '', $mainmenu, 'orders', 0, '', '', '', img_picto('', 'supplier_order', 'class="paddingright pictofixedwidth"')); |
|
1527 | + $newmenu->add("/fourn/commande/list.php?leftmenu=orders&search_status=5&billed=0", $langs->trans("MenuOrdersSupplierToBill"), 0, $user->hasRight('commande', 'lire'), '', $mainmenu, 'orders', 0, '', '', '', img_picto('', 'supplier_order', 'class="paddingright pictofixedwidth"')); |
|
1528 | 1528 | //if ($usemenuhider || empty($leftmenu) || $leftmenu=="orders") $newmenu->add("/commande/", $langs->trans("StatusOrderToBill"), 1, $user->hasRight('commande', 'lire')); |
1529 | 1529 | } |
1530 | 1530 | } |
@@ -1533,58 +1533,58 @@ discard block |
||
1533 | 1533 | // Donations |
1534 | 1534 | if (isModEnabled('don')) { |
1535 | 1535 | $langs->load("donations"); |
1536 | - $newmenu->add("/don/index.php?leftmenu=donations&mainmenu=billing", $langs->trans("Donations"), 0, $user->hasRight('don', 'lire'), '', $mainmenu, 'donations', 0, '', '', '', img_picto('', 'donation', 'class="paddingright pictofixedwidth"')); |
|
1536 | + $newmenu->add("/don/index.php?leftmenu=donations&mainmenu=billing", $langs->trans("Donations"), 0, $user->hasRight('don', 'lire'), '', $mainmenu, 'donations', 0, '', '', '', img_picto('', 'donation', 'class="paddingright pictofixedwidth"')); |
|
1537 | 1537 | if ($usemenuhider || empty($leftmenu) || $leftmenu == "donations") { |
1538 | - $newmenu->add("/don/card.php?leftmenu=donations&action=create", $langs->trans("NewDonation"), 1, $user->hasRight('don', 'creer')); |
|
1539 | - $newmenu->add("/don/list.php?leftmenu=donations", $langs->trans("List"), 1, $user->hasRight('don', 'lire')); |
|
1538 | + $newmenu->add("/don/card.php?leftmenu=donations&action=create", $langs->trans("NewDonation"), 1, $user->hasRight('don', 'creer')); |
|
1539 | + $newmenu->add("/don/list.php?leftmenu=donations", $langs->trans("List"), 1, $user->hasRight('don', 'lire')); |
|
1540 | 1540 | } |
1541 | 1541 | // if ($leftmenu=="donations") $newmenu->add("/don/stats/index.php",$langs->trans("Statistics"), 1, $user->hasRight('don', 'lire')); |
1542 | 1542 | } |
1543 | 1543 | |
1544 | 1544 | // Taxes and social contributions |
1545 | 1545 | if (isModEnabled('tax')) { |
1546 | - $newmenu->add("/compta/charges/index.php?leftmenu=tax&mainmenu=billing", $langs->trans("MenuTaxesAndSpecialExpenses"), 0, $user->hasRight('tax', 'charges', 'lire'), '', $mainmenu, 'tax', 0, '', '', '', img_picto('', 'payment', 'class="paddingright pictofixedwidth"')); |
|
1546 | + $newmenu->add("/compta/charges/index.php?leftmenu=tax&mainmenu=billing", $langs->trans("MenuTaxesAndSpecialExpenses"), 0, $user->hasRight('tax', 'charges', 'lire'), '', $mainmenu, 'tax', 0, '', '', '', img_picto('', 'payment', 'class="paddingright pictofixedwidth"')); |
|
1547 | 1547 | |
1548 | - $newmenu->add("/compta/sociales/list.php?leftmenu=tax_social", $langs->trans("MenuSocialContributions"), 1, $user->hasRight('tax', 'charges', 'lire')); |
|
1548 | + $newmenu->add("/compta/sociales/list.php?leftmenu=tax_social", $langs->trans("MenuSocialContributions"), 1, $user->hasRight('tax', 'charges', 'lire')); |
|
1549 | 1549 | if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_social/i', $leftmenu)) { |
1550 | - $newmenu->add("/compta/sociales/card.php?leftmenu=tax_social&action=create", $langs->trans("MenuNewSocialContribution"), 2, $user->hasRight('tax', 'charges', 'creer')); |
|
1551 | - $newmenu->add("/compta/sociales/list.php?leftmenu=tax_social", $langs->trans("List"), 2, $user->hasRight('tax', 'charges', 'lire')); |
|
1552 | - $newmenu->add("/compta/sociales/payments.php?leftmenu=tax_social&mainmenu=billing", $langs->trans("Payments"), 2, $user->hasRight('tax', 'charges', 'lire')); |
|
1550 | + $newmenu->add("/compta/sociales/card.php?leftmenu=tax_social&action=create", $langs->trans("MenuNewSocialContribution"), 2, $user->hasRight('tax', 'charges', 'creer')); |
|
1551 | + $newmenu->add("/compta/sociales/list.php?leftmenu=tax_social", $langs->trans("List"), 2, $user->hasRight('tax', 'charges', 'lire')); |
|
1552 | + $newmenu->add("/compta/sociales/payments.php?leftmenu=tax_social&mainmenu=billing", $langs->trans("Payments"), 2, $user->hasRight('tax', 'charges', 'lire')); |
|
1553 | 1553 | } |
1554 | 1554 | // VAT |
1555 | 1555 | if (empty($conf->global->TAX_DISABLE_VAT_MENUS)) { |
1556 | 1556 | global $mysoc; |
1557 | 1557 | |
1558 | - $newmenu->add("/compta/tva/list.php?leftmenu=tax_vat&mainmenu=billing", $langs->transcountry("VAT", $mysoc->country_code), 1, $user->hasRight('tax', 'charges', 'lire'), '', $mainmenu, 'tax_vat'); |
|
1558 | + $newmenu->add("/compta/tva/list.php?leftmenu=tax_vat&mainmenu=billing", $langs->transcountry("VAT", $mysoc->country_code), 1, $user->hasRight('tax', 'charges', 'lire'), '', $mainmenu, 'tax_vat'); |
|
1559 | 1559 | if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_vat/i', $leftmenu)) { |
1560 | - $newmenu->add("/compta/tva/card.php?leftmenu=tax_vat&action=create", $langs->trans("New"), 2, $user->hasRight('tax', 'charges', 'creer')); |
|
1561 | - $newmenu->add("/compta/tva/list.php?leftmenu=tax_vat", $langs->trans("List"), 2, $user->hasRight('tax', 'charges', 'lire')); |
|
1562 | - $newmenu->add("/compta/tva/payments.php?mode=tvaonly&leftmenu=tax_vat", $langs->trans("Payments"), 2, $user->hasRight('tax', 'charges', 'lire')); |
|
1563 | - $newmenu->add("/compta/tva/index.php?leftmenu=tax_vat", $langs->trans("ReportByMonth"), 2, $user->hasRight('tax', 'charges', 'lire')); |
|
1564 | - $newmenu->add("/compta/tva/clients.php?leftmenu=tax_vat", $langs->trans("ReportByThirdparties"), 2, $user->hasRight('tax', 'charges', 'lire')); |
|
1565 | - $newmenu->add("/compta/tva/quadri_detail.php?leftmenu=tax_vat", $langs->trans("ReportByQuarter"), 2, $user->hasRight('tax', 'charges', 'lire')); |
|
1560 | + $newmenu->add("/compta/tva/card.php?leftmenu=tax_vat&action=create", $langs->trans("New"), 2, $user->hasRight('tax', 'charges', 'creer')); |
|
1561 | + $newmenu->add("/compta/tva/list.php?leftmenu=tax_vat", $langs->trans("List"), 2, $user->hasRight('tax', 'charges', 'lire')); |
|
1562 | + $newmenu->add("/compta/tva/payments.php?mode=tvaonly&leftmenu=tax_vat", $langs->trans("Payments"), 2, $user->hasRight('tax', 'charges', 'lire')); |
|
1563 | + $newmenu->add("/compta/tva/index.php?leftmenu=tax_vat", $langs->trans("ReportByMonth"), 2, $user->hasRight('tax', 'charges', 'lire')); |
|
1564 | + $newmenu->add("/compta/tva/clients.php?leftmenu=tax_vat", $langs->trans("ReportByThirdparties"), 2, $user->hasRight('tax', 'charges', 'lire')); |
|
1565 | + $newmenu->add("/compta/tva/quadri_detail.php?leftmenu=tax_vat", $langs->trans("ReportByQuarter"), 2, $user->hasRight('tax', 'charges', 'lire')); |
|
1566 | 1566 | } |
1567 | 1567 | |
1568 | 1568 | //Local Taxes 1 |
1569 | 1569 | if ($mysoc->useLocalTax(1) && (isset($mysoc->localtax1_assuj) && $mysoc->localtax1_assuj == "1")) { |
1570 | - $newmenu->add("/compta/localtax/list.php?leftmenu=tax_1_vat&mainmenu=billing&localTaxType=1", $langs->transcountry("LT1", $mysoc->country_code), 1, $user->hasRight('tax', 'charges', 'lire')); |
|
1570 | + $newmenu->add("/compta/localtax/list.php?leftmenu=tax_1_vat&mainmenu=billing&localTaxType=1", $langs->transcountry("LT1", $mysoc->country_code), 1, $user->hasRight('tax', 'charges', 'lire')); |
|
1571 | 1571 | if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_1_vat/i', $leftmenu)) { |
1572 | - $newmenu->add("/compta/localtax/card.php?leftmenu=tax_1_vat&action=create&localTaxType=1", $langs->trans("New"), 2, $user->hasRight('tax', 'charges', 'creer')); |
|
1573 | - $newmenu->add("/compta/localtax/list.php?leftmenu=tax_1_vat&localTaxType=1", $langs->trans("List"), 2, $user->hasRight('tax', 'charges', 'lire')); |
|
1574 | - $newmenu->add("/compta/localtax/index.php?leftmenu=tax_1_vat&localTaxType=1", $langs->trans("ReportByMonth"), 2, $user->hasRight('tax', 'charges', 'lire')); |
|
1575 | - $newmenu->add("/compta/localtax/clients.php?leftmenu=tax_1_vat&localTaxType=1", $langs->trans("ReportByThirdparties"), 2, $user->hasRight('tax', 'charges', 'lire')); |
|
1576 | - $newmenu->add("/compta/localtax/quadri_detail.php?leftmenu=tax_1_vat&localTaxType=1", $langs->trans("ReportByQuarter"), 2, $user->hasRight('tax', 'charges', 'lire')); |
|
1572 | + $newmenu->add("/compta/localtax/card.php?leftmenu=tax_1_vat&action=create&localTaxType=1", $langs->trans("New"), 2, $user->hasRight('tax', 'charges', 'creer')); |
|
1573 | + $newmenu->add("/compta/localtax/list.php?leftmenu=tax_1_vat&localTaxType=1", $langs->trans("List"), 2, $user->hasRight('tax', 'charges', 'lire')); |
|
1574 | + $newmenu->add("/compta/localtax/index.php?leftmenu=tax_1_vat&localTaxType=1", $langs->trans("ReportByMonth"), 2, $user->hasRight('tax', 'charges', 'lire')); |
|
1575 | + $newmenu->add("/compta/localtax/clients.php?leftmenu=tax_1_vat&localTaxType=1", $langs->trans("ReportByThirdparties"), 2, $user->hasRight('tax', 'charges', 'lire')); |
|
1576 | + $newmenu->add("/compta/localtax/quadri_detail.php?leftmenu=tax_1_vat&localTaxType=1", $langs->trans("ReportByQuarter"), 2, $user->hasRight('tax', 'charges', 'lire')); |
|
1577 | 1577 | } |
1578 | 1578 | } |
1579 | 1579 | //Local Taxes 2 |
1580 | 1580 | if ($mysoc->useLocalTax(2) && (isset($mysoc->localtax2_assuj) && $mysoc->localtax2_assuj == "1")) { |
1581 | - $newmenu->add("/compta/localtax/list.php?leftmenu=tax_2_vat&mainmenu=billing&localTaxType=2", $langs->transcountry("LT2", $mysoc->country_code), 1, $user->hasRight('tax', 'charges', 'lire')); |
|
1581 | + $newmenu->add("/compta/localtax/list.php?leftmenu=tax_2_vat&mainmenu=billing&localTaxType=2", $langs->transcountry("LT2", $mysoc->country_code), 1, $user->hasRight('tax', 'charges', 'lire')); |
|
1582 | 1582 | if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_2_vat/i', $leftmenu)) { |
1583 | - $newmenu->add("/compta/localtax/card.php?leftmenu=tax_2_vat&action=create&localTaxType=2", $langs->trans("New"), 2, $user->hasRight('tax', 'charges', 'creer')); |
|
1584 | - $newmenu->add("/compta/localtax/list.php?leftmenu=tax_2_vat&localTaxType=2", $langs->trans("List"), 2, $user->hasRight('tax', 'charges', 'lire')); |
|
1585 | - $newmenu->add("/compta/localtax/index.php?leftmenu=tax_2_vat&localTaxType=2", $langs->trans("ReportByMonth"), 2, $user->hasRight('tax', 'charges', 'lire')); |
|
1586 | - $newmenu->add("/compta/localtax/clients.php?leftmenu=tax_2_vat&localTaxType=2", $langs->trans("ReportByThirdparties"), 2, $user->hasRight('tax', 'charges', 'lire')); |
|
1587 | - $newmenu->add("/compta/localtax/quadri_detail.php?leftmenu=tax_2_vat&localTaxType=2", $langs->trans("ReportByQuarter"), 2, $user->hasRight('tax', 'charges', 'lire')); |
|
1583 | + $newmenu->add("/compta/localtax/card.php?leftmenu=tax_2_vat&action=create&localTaxType=2", $langs->trans("New"), 2, $user->hasRight('tax', 'charges', 'creer')); |
|
1584 | + $newmenu->add("/compta/localtax/list.php?leftmenu=tax_2_vat&localTaxType=2", $langs->trans("List"), 2, $user->hasRight('tax', 'charges', 'lire')); |
|
1585 | + $newmenu->add("/compta/localtax/index.php?leftmenu=tax_2_vat&localTaxType=2", $langs->trans("ReportByMonth"), 2, $user->hasRight('tax', 'charges', 'lire')); |
|
1586 | + $newmenu->add("/compta/localtax/clients.php?leftmenu=tax_2_vat&localTaxType=2", $langs->trans("ReportByThirdparties"), 2, $user->hasRight('tax', 'charges', 'lire')); |
|
1587 | + $newmenu->add("/compta/localtax/quadri_detail.php?leftmenu=tax_2_vat&localTaxType=2", $langs->trans("ReportByQuarter"), 2, $user->hasRight('tax', 'charges', 'lire')); |
|
1588 | 1588 | } |
1589 | 1589 | } |
1590 | 1590 | } |
@@ -1593,21 +1593,21 @@ discard block |
||
1593 | 1593 | // Salaries |
1594 | 1594 | if (isModEnabled('salaries')) { |
1595 | 1595 | $langs->load("salaries"); |
1596 | - $newmenu->add("/salaries/list.php?leftmenu=tax_salary&mainmenu=billing", $langs->trans("Salaries"), 0, $user->hasRight('salaries', 'read'), '', $mainmenu, 'tax_salary', 0, '', '', '', img_picto('', 'salary', 'class="paddingright pictofixedwidth"')); |
|
1596 | + $newmenu->add("/salaries/list.php?leftmenu=tax_salary&mainmenu=billing", $langs->trans("Salaries"), 0, $user->hasRight('salaries', 'read'), '', $mainmenu, 'tax_salary', 0, '', '', '', img_picto('', 'salary', 'class="paddingright pictofixedwidth"')); |
|
1597 | 1597 | if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_salary/i', $leftmenu)) { |
1598 | - $newmenu->add("/salaries/card.php?leftmenu=tax_salary&action=create", $langs->trans("New"), 1, $user->hasRight('salaries', 'write')); |
|
1599 | - $newmenu->add("/salaries/list.php?leftmenu=tax_salary", $langs->trans("List"), 1, $user->hasRight('salaries', 'read')); |
|
1600 | - $newmenu->add("/salaries/payments.php?leftmenu=tax_salary", $langs->trans("Payments"), 1, $user->hasRight('salaries', 'read')); |
|
1601 | - $newmenu->add("/salaries/stats/index.php?leftmenu=tax_salary", $langs->trans("Statistics"), 1, $user->hasRight('salaries', 'read')); |
|
1598 | + $newmenu->add("/salaries/card.php?leftmenu=tax_salary&action=create", $langs->trans("New"), 1, $user->hasRight('salaries', 'write')); |
|
1599 | + $newmenu->add("/salaries/list.php?leftmenu=tax_salary", $langs->trans("List"), 1, $user->hasRight('salaries', 'read')); |
|
1600 | + $newmenu->add("/salaries/payments.php?leftmenu=tax_salary", $langs->trans("Payments"), 1, $user->hasRight('salaries', 'read')); |
|
1601 | + $newmenu->add("/salaries/stats/index.php?leftmenu=tax_salary", $langs->trans("Statistics"), 1, $user->hasRight('salaries', 'read')); |
|
1602 | 1602 | } |
1603 | 1603 | } |
1604 | 1604 | |
1605 | 1605 | // Loan |
1606 | 1606 | if (isModEnabled('loan')) { |
1607 | 1607 | $langs->load("loan"); |
1608 | - $newmenu->add("/loan/list.php?leftmenu=tax_loan&mainmenu=billing", $langs->trans("Loans"), 0, $user->hasRight('loan', 'read'), '', $mainmenu, 'tax_loan', 0, '', '', '', img_picto('', 'loan', 'class="paddingright pictofixedwidth"')); |
|
1608 | + $newmenu->add("/loan/list.php?leftmenu=tax_loan&mainmenu=billing", $langs->trans("Loans"), 0, $user->hasRight('loan', 'read'), '', $mainmenu, 'tax_loan', 0, '', '', '', img_picto('', 'loan', 'class="paddingright pictofixedwidth"')); |
|
1609 | 1609 | if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_loan/i', $leftmenu)) { |
1610 | - $newmenu->add("/loan/card.php?leftmenu=tax_loan&action=create", $langs->trans("NewLoan"), 1, $user->hasRight('loan', 'write')); |
|
1610 | + $newmenu->add("/loan/card.php?leftmenu=tax_loan&action=create", $langs->trans("NewLoan"), 1, $user->hasRight('loan', 'write')); |
|
1611 | 1611 | //$newmenu->add("/loan/payment/list.php?leftmenu=tax_loan",$langs->trans("Payments"),2,$user->hasRight('loan', 'read')); |
1612 | 1612 | } |
1613 | 1613 | } |
@@ -1615,10 +1615,10 @@ discard block |
||
1615 | 1615 | // Various payment |
1616 | 1616 | if (isModEnabled('banque') && empty($conf->global->BANK_USE_OLD_VARIOUS_PAYMENT)) { |
1617 | 1617 | $langs->load("banks"); |
1618 | - $newmenu->add("/compta/bank/various_payment/list.php?leftmenu=tax_various&mainmenu=billing", $langs->trans("MenuVariousPayment"), 0, $user->hasRight('banque', 'lire'), '', $mainmenu, 'tax_various', 0, '', '', '', img_picto('', 'payment', 'class="paddingright pictofixedwidth"')); |
|
1618 | + $newmenu->add("/compta/bank/various_payment/list.php?leftmenu=tax_various&mainmenu=billing", $langs->trans("MenuVariousPayment"), 0, $user->hasRight('banque', 'lire'), '', $mainmenu, 'tax_various', 0, '', '', '', img_picto('', 'payment', 'class="paddingright pictofixedwidth"')); |
|
1619 | 1619 | if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_various/i', $leftmenu)) { |
1620 | - $newmenu->add("/compta/bank/various_payment/card.php?leftmenu=tax_various&action=create", $langs->trans("New"), 1, $user->hasRight('banque', 'modifier')); |
|
1621 | - $newmenu->add("/compta/bank/various_payment/list.php?leftmenu=tax_various", $langs->trans("List"), 1, $user->hasRight('banque', 'lire')); |
|
1620 | + $newmenu->add("/compta/bank/various_payment/card.php?leftmenu=tax_various&action=create", $langs->trans("New"), 1, $user->hasRight('banque', 'modifier')); |
|
1621 | + $newmenu->add("/compta/bank/various_payment/list.php?leftmenu=tax_various", $langs->trans("List"), 1, $user->hasRight('banque', 'lire')); |
|
1622 | 1622 | } |
1623 | 1623 | } |
1624 | 1624 | } |
@@ -1648,71 +1648,71 @@ discard block |
||
1648 | 1648 | //$newmenu->add("/accountancy/index.php?leftmenu=accountancy", $langs->trans("MenuAccountancy"), 0, $permtoshowmenu, '', $mainmenu, 'accountancy'); |
1649 | 1649 | |
1650 | 1650 | // Configuration |
1651 | - $newmenu->add("/accountancy/index.php?leftmenu=accountancy_admin", $langs->trans("Setup"), 0, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin', 1, '', '', '', img_picto('', 'technic', 'class="paddingright pictofixedwidth"')); |
|
1651 | + $newmenu->add("/accountancy/index.php?leftmenu=accountancy_admin", $langs->trans("Setup"), 0, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin', 1, '', '', '', img_picto('', 'technic', 'class="paddingright pictofixedwidth"')); |
|
1652 | 1652 | if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_admin/', $leftmenu)) { |
1653 | 1653 | global $mysoc; |
1654 | - $newmenu->add("/accountancy/admin/index.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("General"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_general', 10); |
|
1654 | + $newmenu->add("/accountancy/admin/index.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("General"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_general', 10); |
|
1655 | 1655 | |
1656 | 1656 | // Fiscal year - Not really yet used. In a future will lock some periods. |
1657 | 1657 | if ($conf->global->MAIN_FEATURES_LEVEL > 1) { |
1658 | - $newmenu->add("/accountancy/admin/fiscalyear.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("FiscalPeriod"), 1, $user->hasRight('accounting', 'fiscalyear', 'write'), '', $mainmenu, 'fiscalyear', 20); |
|
1658 | + $newmenu->add("/accountancy/admin/fiscalyear.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("FiscalPeriod"), 1, $user->hasRight('accounting', 'fiscalyear', 'write'), '', $mainmenu, 'fiscalyear', 20); |
|
1659 | 1659 | } |
1660 | 1660 | |
1661 | - $newmenu->add("/accountancy/admin/journals_list.php?id=35&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("AccountingJournals"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_journal', 30); |
|
1662 | - $newmenu->add("/accountancy/admin/accountmodel.php?id=31&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("Pcg_version"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_chartmodel', 40); |
|
1663 | - $newmenu->add("/accountancy/admin/account.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("Chartofaccounts"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_chart', 41); |
|
1664 | - $newmenu->add("/accountancy/admin/subaccount.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("ChartOfSubaccounts"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_chart', 41); |
|
1665 | - $newmenu->add("/accountancy/admin/defaultaccounts.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuDefaultAccounts"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_default', 60); |
|
1661 | + $newmenu->add("/accountancy/admin/journals_list.php?id=35&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("AccountingJournals"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_journal', 30); |
|
1662 | + $newmenu->add("/accountancy/admin/accountmodel.php?id=31&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("Pcg_version"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_chartmodel', 40); |
|
1663 | + $newmenu->add("/accountancy/admin/account.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("Chartofaccounts"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_chart', 41); |
|
1664 | + $newmenu->add("/accountancy/admin/subaccount.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("ChartOfSubaccounts"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_chart', 41); |
|
1665 | + $newmenu->add("/accountancy/admin/defaultaccounts.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuDefaultAccounts"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_default', 60); |
|
1666 | 1666 | if (isModEnabled('banque')) { |
1667 | - $newmenu->add("/compta/bank/list.php?mainmenu=accountancy&leftmenu=accountancy_admin&search_status=-1", $langs->trans("MenuBankAccounts"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_bank', 70); |
|
1667 | + $newmenu->add("/compta/bank/list.php?mainmenu=accountancy&leftmenu=accountancy_admin&search_status=-1", $langs->trans("MenuBankAccounts"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_bank', 70); |
|
1668 | 1668 | } |
1669 | 1669 | if (isModEnabled('facture') || isModEnabled('supplier_invoice')) { |
1670 | - $newmenu->add("/admin/dict.php?id=10&from=accountancy&search_country_id=".$mysoc->country_id."&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuVatAccounts"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_default', 80); |
|
1670 | + $newmenu->add("/admin/dict.php?id=10&from=accountancy&search_country_id=".$mysoc->country_id."&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuVatAccounts"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_default', 80); |
|
1671 | 1671 | } |
1672 | 1672 | if (isModEnabled('tax')) { |
1673 | - $newmenu->add("/admin/dict.php?id=7&from=accountancy&search_country_id=".$mysoc->country_id."&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuTaxAccounts"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_default', 90); |
|
1673 | + $newmenu->add("/admin/dict.php?id=7&from=accountancy&search_country_id=".$mysoc->country_id."&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuTaxAccounts"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_default', 90); |
|
1674 | 1674 | } |
1675 | 1675 | if (isModEnabled('expensereport')) { |
1676 | - $newmenu->add("/admin/dict.php?id=17&from=accountancy&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuExpenseReportAccounts"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_default', 100); |
|
1676 | + $newmenu->add("/admin/dict.php?id=17&from=accountancy&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuExpenseReportAccounts"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_default', 100); |
|
1677 | 1677 | } |
1678 | - $newmenu->add("/accountancy/admin/productaccount.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuProductsAccounts"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_product', 110); |
|
1678 | + $newmenu->add("/accountancy/admin/productaccount.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuProductsAccounts"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_product', 110); |
|
1679 | 1679 | if ($conf->global->MAIN_FEATURES_LEVEL > 1) { |
1680 | - $newmenu->add("/accountancy/admin/closure.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuClosureAccounts"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_closure', 120); |
|
1680 | + $newmenu->add("/accountancy/admin/closure.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuClosureAccounts"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_closure', 120); |
|
1681 | 1681 | } |
1682 | - $newmenu->add("/accountancy/admin/categories_list.php?id=32&search_country_id=".$mysoc->country_id."&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("AccountingCategory"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_chart', 125); |
|
1683 | - $newmenu->add("/accountancy/admin/export.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("ExportOptions"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_export', 130); |
|
1682 | + $newmenu->add("/accountancy/admin/categories_list.php?id=32&search_country_id=".$mysoc->country_id."&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("AccountingCategory"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_chart', 125); |
|
1683 | + $newmenu->add("/accountancy/admin/export.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("ExportOptions"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_export', 130); |
|
1684 | 1684 | } |
1685 | 1685 | |
1686 | 1686 | // Transfer in accounting |
1687 | - $newmenu->add("/accountancy/index.php?leftmenu=accountancy_transfer", $langs->trans("TransferInAccounting"), 0, $user->hasRight('accounting', 'bind', 'write'), '', $mainmenu, 'transfer', 1, '', '', '', img_picto('', 'long-arrow-alt-right', 'class="paddingright pictofixedwidth"')); |
|
1687 | + $newmenu->add("/accountancy/index.php?leftmenu=accountancy_transfer", $langs->trans("TransferInAccounting"), 0, $user->hasRight('accounting', 'bind', 'write'), '', $mainmenu, 'transfer', 1, '', '', '', img_picto('', 'long-arrow-alt-right', 'class="paddingright pictofixedwidth"')); |
|
1688 | 1688 | |
1689 | 1689 | // Binding |
1690 | 1690 | // $newmenu->add("", $langs->trans("Binding"), 0, $user->hasRight('accounting', 'bind', 'write'), '', $mainmenu, 'dispatch'); |
1691 | 1691 | if (isModEnabled('facture') && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_SALES)) { |
1692 | - $newmenu->add("/accountancy/customer/index.php?leftmenu=accountancy_dispatch_customer&mainmenu=accountancy", $langs->trans("CustomersVentilation"), 1, $user->hasRight('accounting', 'bind', 'write'), '', $mainmenu, 'dispatch_customer'); |
|
1692 | + $newmenu->add("/accountancy/customer/index.php?leftmenu=accountancy_dispatch_customer&mainmenu=accountancy", $langs->trans("CustomersVentilation"), 1, $user->hasRight('accounting', 'bind', 'write'), '', $mainmenu, 'dispatch_customer'); |
|
1693 | 1693 | if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_dispatch_customer/', $leftmenu)) { |
1694 | - $newmenu->add("/accountancy/customer/list.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_customer", $langs->trans("ToBind"), 2, $user->hasRight('accounting', 'bind', 'write')); |
|
1695 | - $newmenu->add("/accountancy/customer/lines.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_customer", $langs->trans("Binded"), 2, $user->hasRight('accounting', 'bind', 'write')); |
|
1694 | + $newmenu->add("/accountancy/customer/list.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_customer", $langs->trans("ToBind"), 2, $user->hasRight('accounting', 'bind', 'write')); |
|
1695 | + $newmenu->add("/accountancy/customer/lines.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_customer", $langs->trans("Binded"), 2, $user->hasRight('accounting', 'bind', 'write')); |
|
1696 | 1696 | } |
1697 | 1697 | } |
1698 | 1698 | if (isModEnabled('supplier_invoice') && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_PURCHASES)) { |
1699 | - $newmenu->add("/accountancy/supplier/index.php?leftmenu=accountancy_dispatch_supplier&mainmenu=accountancy", $langs->trans("SuppliersVentilation"), 1, $user->hasRight('accounting', 'bind', 'write'), '', $mainmenu, 'dispatch_supplier'); |
|
1699 | + $newmenu->add("/accountancy/supplier/index.php?leftmenu=accountancy_dispatch_supplier&mainmenu=accountancy", $langs->trans("SuppliersVentilation"), 1, $user->hasRight('accounting', 'bind', 'write'), '', $mainmenu, 'dispatch_supplier'); |
|
1700 | 1700 | if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_dispatch_supplier/', $leftmenu)) { |
1701 | - $newmenu->add("/accountancy/supplier/list.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_supplier", $langs->trans("ToBind"), 2, $user->hasRight('accounting', 'bind', 'write')); |
|
1702 | - $newmenu->add("/accountancy/supplier/lines.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_supplier", $langs->trans("Binded"), 2, $user->hasRight('accounting', 'bind', 'write')); |
|
1701 | + $newmenu->add("/accountancy/supplier/list.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_supplier", $langs->trans("ToBind"), 2, $user->hasRight('accounting', 'bind', 'write')); |
|
1702 | + $newmenu->add("/accountancy/supplier/lines.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_supplier", $langs->trans("Binded"), 2, $user->hasRight('accounting', 'bind', 'write')); |
|
1703 | 1703 | } |
1704 | 1704 | } |
1705 | 1705 | if (isModEnabled('expensereport') && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS)) { |
1706 | - $newmenu->add("/accountancy/expensereport/index.php?leftmenu=accountancy_dispatch_expensereport&mainmenu=accountancy", $langs->trans("ExpenseReportsVentilation"), 1, $user->hasRight('accounting', 'bind', 'write'), '', $mainmenu, 'dispatch_expensereport'); |
|
1706 | + $newmenu->add("/accountancy/expensereport/index.php?leftmenu=accountancy_dispatch_expensereport&mainmenu=accountancy", $langs->trans("ExpenseReportsVentilation"), 1, $user->hasRight('accounting', 'bind', 'write'), '', $mainmenu, 'dispatch_expensereport'); |
|
1707 | 1707 | if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_dispatch_expensereport/', $leftmenu)) { |
1708 | - $newmenu->add("/accountancy/expensereport/list.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_expensereport", $langs->trans("ToBind"), 2, $user->hasRight('accounting', 'bind', 'write')); |
|
1709 | - $newmenu->add("/accountancy/expensereport/lines.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_expensereport", $langs->trans("Binded"), 2, $user->hasRight('accounting', 'bind', 'write')); |
|
1708 | + $newmenu->add("/accountancy/expensereport/list.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_expensereport", $langs->trans("ToBind"), 2, $user->hasRight('accounting', 'bind', 'write')); |
|
1709 | + $newmenu->add("/accountancy/expensereport/lines.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_expensereport", $langs->trans("Binded"), 2, $user->hasRight('accounting', 'bind', 'write')); |
|
1710 | 1710 | } |
1711 | 1711 | } |
1712 | 1712 | |
1713 | 1713 | // Journals |
1714 | - if (isModEnabled('accounting') && $user->hasRight('accounting', 'comptarapport', 'lire') && $mainmenu == 'accountancy') { |
|
1715 | - $newmenu->add('', $langs->trans("RegistrationInAccounting"), 1, $user->hasRight('accounting', 'comptarapport', 'lire'), '', $mainmenu, 'accountancy_journal'); |
|
1714 | + if (isModEnabled('accounting') && $user->hasRight('accounting', 'comptarapport', 'lire') && $mainmenu == 'accountancy') { |
|
1715 | + $newmenu->add('', $langs->trans("RegistrationInAccounting"), 1, $user->hasRight('accounting', 'comptarapport', 'lire'), '', $mainmenu, 'accountancy_journal'); |
|
1716 | 1716 | |
1717 | 1717 | // Multi journal |
1718 | 1718 | $sql = "SELECT rowid, code, label, nature"; |
@@ -1748,7 +1748,7 @@ discard block |
||
1748 | 1748 | $nature = "expensereports"; |
1749 | 1749 | } |
1750 | 1750 | if ($objp->nature == 1 && isModEnabled('asset')) { |
1751 | - $nature = "various"; // Warning: The page /accountancy/journal/variousjournal.php is bugged. It read tables that does not exists. |
|
1751 | + $nature = "various"; // Warning: The page /accountancy/journal/variousjournal.php is bugged. It read tables that does not exists. |
|
1752 | 1752 | } |
1753 | 1753 | if ($objp->nature == 8) { |
1754 | 1754 | $nature = "inventory"; |
@@ -1772,16 +1772,16 @@ discard block |
||
1772 | 1772 | $journallabel = '<span class="opacitymedium">('.$langs->trans($objp->label).')</span>'; // Label of bank account in llx_accounting_journal |
1773 | 1773 | } |
1774 | 1774 | |
1775 | - $key = $langs->trans("AccountingJournalType".$objp->nature); // $objp->nature is 1, 2, 3 ... |
|
1776 | - $transferlabel = (($objp->nature && $key != "AccountingJournalType".$objp->nature) ? $key.($journallabelwithoutspan != $key ? ' '.$journallabel : ''): $journallabel); |
|
1775 | + $key = $langs->trans("AccountingJournalType".$objp->nature); // $objp->nature is 1, 2, 3 ... |
|
1776 | + $transferlabel = (($objp->nature && $key != "AccountingJournalType".$objp->nature) ? $key.($journallabelwithoutspan != $key ? ' '.$journallabel : '') : $journallabel); |
|
1777 | 1777 | |
1778 | - $newmenu->add('/accountancy/journal/'.$nature.'journal.php?mainmenu=accountancy&leftmenu=accountancy_journal&id_journal='.$objp->rowid, $transferlabel, 2, $user->hasRight('accounting', 'comptarapport', 'lire')); |
|
1778 | + $newmenu->add('/accountancy/journal/'.$nature.'journal.php?mainmenu=accountancy&leftmenu=accountancy_journal&id_journal='.$objp->rowid, $transferlabel, 2, $user->hasRight('accounting', 'comptarapport', 'lire')); |
|
1779 | 1779 | } |
1780 | 1780 | $i++; |
1781 | 1781 | } |
1782 | 1782 | } else { |
1783 | 1783 | // Should not happend. Entries are added |
1784 | - $newmenu->add('', $langs->trans("NoJournalDefined"), 2, $user->hasRight('accounting', 'comptarapport', 'lire')); |
|
1784 | + $newmenu->add('', $langs->trans("NoJournalDefined"), 2, $user->hasRight('accounting', 'comptarapport', 'lire')); |
|
1785 | 1785 | } |
1786 | 1786 | } else { |
1787 | 1787 | dol_print_error($db); |
@@ -1791,48 +1791,48 @@ discard block |
||
1791 | 1791 | |
1792 | 1792 | // Files |
1793 | 1793 | if (empty($conf->global->ACCOUNTANCY_HIDE_EXPORT_FILES_MENU)) { |
1794 | - $newmenu->add("/compta/accounting-files.php?mainmenu=accountancy&leftmenu=accountancy_files", $langs->trans("AccountantFiles"), 1, $user->hasRight('accounting', 'mouvements', 'lire')); |
|
1794 | + $newmenu->add("/compta/accounting-files.php?mainmenu=accountancy&leftmenu=accountancy_files", $langs->trans("AccountantFiles"), 1, $user->hasRight('accounting', 'mouvements', 'lire')); |
|
1795 | 1795 | } |
1796 | 1796 | |
1797 | 1797 | |
1798 | 1798 | // Accounting |
1799 | - $newmenu->add("/accountancy/index.php?leftmenu=accountancy_accountancy", $langs->trans("MenuAccountancy"), 0, $user->hasRight('accounting', 'mouvements', 'lire') || $user->hasRight('accounting', 'comptarapport', 'lire'), '', $mainmenu, 'accountancy', 1, '', '', '', img_picto('', 'accountancy', 'class="paddingright pictofixedwidth"')); |
|
1799 | + $newmenu->add("/accountancy/index.php?leftmenu=accountancy_accountancy", $langs->trans("MenuAccountancy"), 0, $user->hasRight('accounting', 'mouvements', 'lire') || $user->hasRight('accounting', 'comptarapport', 'lire'), '', $mainmenu, 'accountancy', 1, '', '', '', img_picto('', 'accountancy', 'class="paddingright pictofixedwidth"')); |
|
1800 | 1800 | |
1801 | 1801 | // General Ledger |
1802 | - $newmenu->add("/accountancy/bookkeeping/listbyaccount.php?mainmenu=accountancy&leftmenu=accountancy_accountancy", $langs->trans("Bookkeeping"), 1, $user->hasRight('accounting', 'mouvements', 'lire')); |
|
1802 | + $newmenu->add("/accountancy/bookkeeping/listbyaccount.php?mainmenu=accountancy&leftmenu=accountancy_accountancy", $langs->trans("Bookkeeping"), 1, $user->hasRight('accounting', 'mouvements', 'lire')); |
|
1803 | 1803 | |
1804 | 1804 | // Journals |
1805 | - $newmenu->add("/accountancy/bookkeeping/list.php?mainmenu=accountancy&leftmenu=accountancy_accountancy", $langs->trans("Journals"), 1, $user->hasRight('accounting', 'mouvements', 'lire')); |
|
1805 | + $newmenu->add("/accountancy/bookkeeping/list.php?mainmenu=accountancy&leftmenu=accountancy_accountancy", $langs->trans("Journals"), 1, $user->hasRight('accounting', 'mouvements', 'lire')); |
|
1806 | 1806 | |
1807 | 1807 | // Account Balance |
1808 | - $newmenu->add("/accountancy/bookkeeping/balance.php?mainmenu=accountancy&leftmenu=accountancy_accountancy", $langs->trans("AccountBalance"), 1, $user->hasRight('accounting', 'mouvements', 'lire')); |
|
1808 | + $newmenu->add("/accountancy/bookkeeping/balance.php?mainmenu=accountancy&leftmenu=accountancy_accountancy", $langs->trans("AccountBalance"), 1, $user->hasRight('accounting', 'mouvements', 'lire')); |
|
1809 | 1809 | |
1810 | 1810 | // Export accountancy |
1811 | - $newmenu->add("/accountancy/bookkeeping/export.php?mainmenu=accountancy&leftmenu=accountancy_accountancy", $langs->trans("MenuExportAccountancy"), 1, $user->hasRight('accounting', 'mouvements', 'lire')); |
|
1811 | + $newmenu->add("/accountancy/bookkeeping/export.php?mainmenu=accountancy&leftmenu=accountancy_accountancy", $langs->trans("MenuExportAccountancy"), 1, $user->hasRight('accounting', 'mouvements', 'lire')); |
|
1812 | 1812 | |
1813 | 1813 | // Closure |
1814 | - $newmenu->add("/accountancy/closure/index.php?mainmenu=accountancy&leftmenu=accountancy_closure", $langs->trans("MenuAccountancyClosure"), 1, $user->hasRight('accounting', 'fiscalyear', 'write'), '', $mainmenu, 'closure'); |
|
1814 | + $newmenu->add("/accountancy/closure/index.php?mainmenu=accountancy&leftmenu=accountancy_closure", $langs->trans("MenuAccountancyClosure"), 1, $user->hasRight('accounting', 'fiscalyear', 'write'), '', $mainmenu, 'closure'); |
|
1815 | 1815 | |
1816 | 1816 | // Reports |
1817 | - $newmenu->add("/accountancy/index.php?leftmenu=accountancy_report", $langs->trans("Reportings"), 1, $user->hasRight('accounting', 'comptarapport', 'lire'), '', $mainmenu, 'ca'); |
|
1817 | + $newmenu->add("/accountancy/index.php?leftmenu=accountancy_report", $langs->trans("Reportings"), 1, $user->hasRight('accounting', 'comptarapport', 'lire'), '', $mainmenu, 'ca'); |
|
1818 | 1818 | |
1819 | 1819 | if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/', $leftmenu)) { |
1820 | - $newmenu->add("/compta/resultat/index.php?leftmenu=accountancy_report", $langs->trans("MenuReportInOut"), 2, $user->hasRight('accounting', 'comptarapport', 'lire')); |
|
1821 | - $newmenu->add("/compta/resultat/clientfourn.php?leftmenu=accountancy_report", $langs->trans("ByPredefinedAccountGroups"), 3, $user->hasRight('accounting', 'comptarapport', 'lire')); |
|
1822 | - $newmenu->add("/compta/resultat/result.php?leftmenu=accountancy_report", $langs->trans("ByPersonalizedAccountGroups"), 3, $user->hasRight('accounting', 'comptarapport', 'lire')); |
|
1820 | + $newmenu->add("/compta/resultat/index.php?leftmenu=accountancy_report", $langs->trans("MenuReportInOut"), 2, $user->hasRight('accounting', 'comptarapport', 'lire')); |
|
1821 | + $newmenu->add("/compta/resultat/clientfourn.php?leftmenu=accountancy_report", $langs->trans("ByPredefinedAccountGroups"), 3, $user->hasRight('accounting', 'comptarapport', 'lire')); |
|
1822 | + $newmenu->add("/compta/resultat/result.php?leftmenu=accountancy_report", $langs->trans("ByPersonalizedAccountGroups"), 3, $user->hasRight('accounting', 'comptarapport', 'lire')); |
|
1823 | 1823 | } |
1824 | 1824 | |
1825 | 1825 | $modecompta = 'CREANCES-DETTES'; |
1826 | - if (isModEnabled('accounting') && $user->hasRight('accounting', 'comptarapport', 'lire') && $mainmenu == 'accountancy') { |
|
1826 | + if (isModEnabled('accounting') && $user->hasRight('accounting', 'comptarapport', 'lire') && $mainmenu == 'accountancy') { |
|
1827 | 1827 | $modecompta = 'BOOKKEEPING'; // Not yet implemented. Should be BOOKKEEPINGCOLLECTED |
1828 | 1828 | } |
1829 | 1829 | if ($modecompta) { |
1830 | 1830 | if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/', $leftmenu)) { |
1831 | - $newmenu->add("/compta/stats/index.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ReportTurnover"), 2, $user->hasRight('accounting', 'comptarapport', 'lire')); |
|
1832 | - $newmenu->add("/compta/stats/casoc.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByCompanies"), 3, $user->hasRight('accounting', 'comptarapport', 'lire')); |
|
1833 | - $newmenu->add("/compta/stats/cabyuser.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByUsers"), 3, $user->hasRight('accounting', 'comptarapport', 'lire')); |
|
1834 | - $newmenu->add("/compta/stats/cabyprodserv.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByProductsAndServices"), 3, $user->hasRight('accounting', 'comptarapport', 'lire')); |
|
1835 | - $newmenu->add("/compta/stats/byratecountry.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByVatRate"), 3, $user->hasRight('accounting', 'comptarapport', 'lire')); |
|
1831 | + $newmenu->add("/compta/stats/index.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ReportTurnover"), 2, $user->hasRight('accounting', 'comptarapport', 'lire')); |
|
1832 | + $newmenu->add("/compta/stats/casoc.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByCompanies"), 3, $user->hasRight('accounting', 'comptarapport', 'lire')); |
|
1833 | + $newmenu->add("/compta/stats/cabyuser.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByUsers"), 3, $user->hasRight('accounting', 'comptarapport', 'lire')); |
|
1834 | + $newmenu->add("/compta/stats/cabyprodserv.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByProductsAndServices"), 3, $user->hasRight('accounting', 'comptarapport', 'lire')); |
|
1835 | + $newmenu->add("/compta/stats/byratecountry.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByVatRate"), 3, $user->hasRight('accounting', 'comptarapport', 'lire')); |
|
1836 | 1836 | } |
1837 | 1837 | } |
1838 | 1838 | |
@@ -1840,34 +1840,34 @@ discard block |
||
1840 | 1840 | //if (isModEnabled('accounting') && $user->hasRight('accounting', 'comptarapport', 'lire') && $mainmenu == 'accountancy') $modecompta=''; // Not yet implemented. Should be BOOKKEEPINGCOLLECTED |
1841 | 1841 | if ($modecompta) { |
1842 | 1842 | if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/', $leftmenu)) { |
1843 | - $newmenu->add("/compta/stats/index.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ReportTurnoverCollected"), 2, $user->hasRight('accounting', 'comptarapport', 'lire')); |
|
1844 | - $newmenu->add("/compta/stats/casoc.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByCompanies"), 3, $user->hasRight('accounting', 'comptarapport', 'lire')); |
|
1845 | - $newmenu->add("/compta/stats/cabyuser.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByUsers"), 3, $user->hasRight('accounting', 'comptarapport', 'lire')); |
|
1843 | + $newmenu->add("/compta/stats/index.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ReportTurnoverCollected"), 2, $user->hasRight('accounting', 'comptarapport', 'lire')); |
|
1844 | + $newmenu->add("/compta/stats/casoc.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByCompanies"), 3, $user->hasRight('accounting', 'comptarapport', 'lire')); |
|
1845 | + $newmenu->add("/compta/stats/cabyuser.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByUsers"), 3, $user->hasRight('accounting', 'comptarapport', 'lire')); |
|
1846 | 1846 | //$newmenu->add("/compta/stats/cabyprodserv.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByProductsAndServices"),3,$user->hasRight('accounting', 'comptarapport', 'lire')); |
1847 | 1847 | //$newmenu->add("/compta/stats/byratecountry.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByVatRate"),3,$user->hasRight('accounting', 'comptarapport', 'lire')); |
1848 | 1848 | } |
1849 | 1849 | } |
1850 | 1850 | |
1851 | 1851 | $modecompta = 'CREANCES-DETTES'; |
1852 | - if (isModEnabled('accounting') && $user->hasRight('accounting', 'comptarapport', 'lire') && $mainmenu == 'accountancy') { |
|
1852 | + if (isModEnabled('accounting') && $user->hasRight('accounting', 'comptarapport', 'lire') && $mainmenu == 'accountancy') { |
|
1853 | 1853 | $modecompta = 'BOOKKEEPING'; // Not yet implemented. |
1854 | 1854 | } |
1855 | 1855 | if ($modecompta && isModEnabled('supplier_invoice')) { |
1856 | 1856 | if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/', $leftmenu)) { |
1857 | - $newmenu->add("/compta/stats/supplier_turnover.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ReportPurchaseTurnover"), 2, $user->hasRight('accounting', 'comptarapport', 'lire')); |
|
1858 | - $newmenu->add("/compta/stats/supplier_turnover_by_thirdparty.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByCompanies"), 3, $user->hasRight('accounting', 'comptarapport', 'lire')); |
|
1859 | - $newmenu->add("/compta/stats/supplier_turnover_by_prodserv.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByProductsAndServices"), 3, $user->hasRight('accounting', 'comptarapport', 'lire')); |
|
1857 | + $newmenu->add("/compta/stats/supplier_turnover.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ReportPurchaseTurnover"), 2, $user->hasRight('accounting', 'comptarapport', 'lire')); |
|
1858 | + $newmenu->add("/compta/stats/supplier_turnover_by_thirdparty.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByCompanies"), 3, $user->hasRight('accounting', 'comptarapport', 'lire')); |
|
1859 | + $newmenu->add("/compta/stats/supplier_turnover_by_prodserv.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByProductsAndServices"), 3, $user->hasRight('accounting', 'comptarapport', 'lire')); |
|
1860 | 1860 | } |
1861 | 1861 | } |
1862 | 1862 | |
1863 | 1863 | $modecompta = 'RECETTES-DEPENSES'; |
1864 | - if (isModEnabled('accounting') && $user->hasRight('accounting', 'comptarapport', 'lire') && $mainmenu == 'accountancy') { |
|
1864 | + if (isModEnabled('accounting') && $user->hasRight('accounting', 'comptarapport', 'lire') && $mainmenu == 'accountancy') { |
|
1865 | 1865 | $modecompta = 'BOOKKEEPINGCOLLECTED'; // Not yet implemented. |
1866 | 1866 | } |
1867 | 1867 | if ($modecompta && ((isModEnabled('fournisseur') && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled('supplier_invoice'))) { |
1868 | 1868 | if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/', $leftmenu)) { |
1869 | - $newmenu->add("/compta/stats/supplier_turnover.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ReportPurchaseTurnoverCollected"), 2, $user->hasRight('accounting', 'comptarapport', 'lire')); |
|
1870 | - $newmenu->add("/compta/stats/supplier_turnover_by_thirdparty.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByCompanies"), 3, $user->hasRight('accounting', 'comptarapport', 'lire')); |
|
1869 | + $newmenu->add("/compta/stats/supplier_turnover.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ReportPurchaseTurnoverCollected"), 2, $user->hasRight('accounting', 'comptarapport', 'lire')); |
|
1870 | + $newmenu->add("/compta/stats/supplier_turnover_by_thirdparty.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByCompanies"), 3, $user->hasRight('accounting', 'comptarapport', 'lire')); |
|
1871 | 1871 | } |
1872 | 1872 | } |
1873 | 1873 | } |
@@ -1876,15 +1876,15 @@ discard block |
||
1876 | 1876 | if (isModEnabled('comptabilite')) { |
1877 | 1877 | // Files |
1878 | 1878 | if (empty($conf->global->ACCOUNTANCY_HIDE_EXPORT_FILES_MENU)) { |
1879 | - $newmenu->add("/compta/accounting-files.php?mainmenu=accountancy&leftmenu=accountancy_files", $langs->trans("AccountantFiles"), 0, $user->hasRight('compta', 'resultat', 'lire'), '', $mainmenu, 'files', 0, '', '', '', img_picto('', 'accountancy', 'class="paddingright pictofixedwidth"')); |
|
1879 | + $newmenu->add("/compta/accounting-files.php?mainmenu=accountancy&leftmenu=accountancy_files", $langs->trans("AccountantFiles"), 0, $user->hasRight('compta', 'resultat', 'lire'), '', $mainmenu, 'files', 0, '', '', '', img_picto('', 'accountancy', 'class="paddingright pictofixedwidth"')); |
|
1880 | 1880 | } |
1881 | 1881 | |
1882 | 1882 | // Bilan, resultats |
1883 | - $newmenu->add("/compta/resultat/index.php?leftmenu=report&mainmenu=accountancy", $langs->trans("Reportings"), 0, $user->hasRight('compta', 'resultat', 'lire'), '', $mainmenu, 'ca', 0, '', '', '', img_picto('', 'accountancy', 'class="paddingright pictofixedwidth"')); |
|
1883 | + $newmenu->add("/compta/resultat/index.php?leftmenu=report&mainmenu=accountancy", $langs->trans("Reportings"), 0, $user->hasRight('compta', 'resultat', 'lire'), '', $mainmenu, 'ca', 0, '', '', '', img_picto('', 'accountancy', 'class="paddingright pictofixedwidth"')); |
|
1884 | 1884 | |
1885 | 1885 | if ($usemenuhider || empty($leftmenu) || preg_match('/report/', $leftmenu)) { |
1886 | - $newmenu->add("/compta/resultat/index.php?leftmenu=report", $langs->trans("MenuReportInOut"), 1, $user->hasRight('compta', 'resultat', 'lire')); |
|
1887 | - $newmenu->add("/compta/resultat/clientfourn.php?leftmenu=report", $langs->trans("ByCompanies"), 2, $user->hasRight('compta', 'resultat', 'lire')); |
|
1886 | + $newmenu->add("/compta/resultat/index.php?leftmenu=report", $langs->trans("MenuReportInOut"), 1, $user->hasRight('compta', 'resultat', 'lire')); |
|
1887 | + $newmenu->add("/compta/resultat/clientfourn.php?leftmenu=report", $langs->trans("ByCompanies"), 2, $user->hasRight('compta', 'resultat', 'lire')); |
|
1888 | 1888 | /* On verra ca avec module compabilite expert |
1889 | 1889 | $newmenu->add("/compta/resultat/compteres.php?leftmenu=report","Compte de resultat",2,$user->hasRight('compta', 'resultat', 'lire')); |
1890 | 1890 | $newmenu->add("/compta/resultat/bilan.php?leftmenu=report","Bilan",2,$user->hasRight('compta', 'resultat', 'lire')); |
@@ -1899,22 +1899,22 @@ discard block |
||
1899 | 1899 | */ |
1900 | 1900 | |
1901 | 1901 | $modecompta = 'CREANCES-DETTES'; |
1902 | - $newmenu->add("/compta/stats/index.php?leftmenu=report&modecompta=".$modecompta, $langs->trans("ReportTurnover"), 1, $user->hasRight('compta', 'resultat', 'lire')); |
|
1903 | - $newmenu->add("/compta/stats/casoc.php?leftmenu=report&modecompta=".$modecompta, $langs->trans("ByCompanies"), 2, $user->hasRight('compta', 'resultat', 'lire')); |
|
1904 | - $newmenu->add("/compta/stats/cabyuser.php?leftmenu=report&modecompta=".$modecompta, $langs->trans("ByUsers"), 2, $user->hasRight('compta', 'resultat', 'lire')); |
|
1905 | - $newmenu->add("/compta/stats/cabyprodserv.php?leftmenu=report&modecompta=".$modecompta, $langs->trans("ByProductsAndServices"), 2, $user->hasRight('compta', 'resultat', 'lire')); |
|
1906 | - $newmenu->add("/compta/stats/byratecountry.php?leftmenu=report&modecompta=".$modecompta, $langs->trans("ByVatRate"), 2, $user->hasRight('compta', 'resultat', 'lire')); |
|
1902 | + $newmenu->add("/compta/stats/index.php?leftmenu=report&modecompta=".$modecompta, $langs->trans("ReportTurnover"), 1, $user->hasRight('compta', 'resultat', 'lire')); |
|
1903 | + $newmenu->add("/compta/stats/casoc.php?leftmenu=report&modecompta=".$modecompta, $langs->trans("ByCompanies"), 2, $user->hasRight('compta', 'resultat', 'lire')); |
|
1904 | + $newmenu->add("/compta/stats/cabyuser.php?leftmenu=report&modecompta=".$modecompta, $langs->trans("ByUsers"), 2, $user->hasRight('compta', 'resultat', 'lire')); |
|
1905 | + $newmenu->add("/compta/stats/cabyprodserv.php?leftmenu=report&modecompta=".$modecompta, $langs->trans("ByProductsAndServices"), 2, $user->hasRight('compta', 'resultat', 'lire')); |
|
1906 | + $newmenu->add("/compta/stats/byratecountry.php?leftmenu=report&modecompta=".$modecompta, $langs->trans("ByVatRate"), 2, $user->hasRight('compta', 'resultat', 'lire')); |
|
1907 | 1907 | |
1908 | 1908 | $modecompta = 'RECETTES-DEPENSES'; |
1909 | - $newmenu->add("/compta/stats/index.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ReportTurnoverCollected"), 1, $user->hasRight('compta', 'resultat', 'lire')); |
|
1910 | - $newmenu->add("/compta/stats/casoc.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByCompanies"), 2, $user->hasRight('compta', 'resultat', 'lire')); |
|
1911 | - $newmenu->add("/compta/stats/cabyuser.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByUsers"), 2, $user->hasRight('compta', 'resultat', 'lire')); |
|
1909 | + $newmenu->add("/compta/stats/index.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ReportTurnoverCollected"), 1, $user->hasRight('compta', 'resultat', 'lire')); |
|
1910 | + $newmenu->add("/compta/stats/casoc.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByCompanies"), 2, $user->hasRight('compta', 'resultat', 'lire')); |
|
1911 | + $newmenu->add("/compta/stats/cabyuser.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByUsers"), 2, $user->hasRight('compta', 'resultat', 'lire')); |
|
1912 | 1912 | |
1913 | 1913 | //Achats |
1914 | 1914 | $modecompta = 'CREANCES-DETTES'; |
1915 | - $newmenu->add("/compta/stats/supplier_turnover.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ReportPurchaseTurnover"), 1, $user->hasRight('compta', 'resultat', 'lire')); |
|
1916 | - $newmenu->add("/compta/stats/supplier_turnover_by_thirdparty.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByCompanies"), 2, $user->hasRight('compta', 'resultat', 'lire')); |
|
1917 | - $newmenu->add("/compta/stats/supplier_turnover_by_prodserv.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByProductsAndServices"), 2, $user->hasRight('compta', 'resultat', 'lire')); |
|
1915 | + $newmenu->add("/compta/stats/supplier_turnover.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ReportPurchaseTurnover"), 1, $user->hasRight('compta', 'resultat', 'lire')); |
|
1916 | + $newmenu->add("/compta/stats/supplier_turnover_by_thirdparty.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByCompanies"), 2, $user->hasRight('compta', 'resultat', 'lire')); |
|
1917 | + $newmenu->add("/compta/stats/supplier_turnover_by_prodserv.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByProductsAndServices"), 2, $user->hasRight('compta', 'resultat', 'lire')); |
|
1918 | 1918 | |
1919 | 1919 | /* |
1920 | 1920 | $modecompta = 'RECETTES-DEPENSES'; |
@@ -1924,31 +1924,31 @@ discard block |
||
1924 | 1924 | */ |
1925 | 1925 | |
1926 | 1926 | // Journals |
1927 | - $newmenu->add("/compta/journal/sellsjournal.php?leftmenu=report", $langs->trans("SellsJournal"), 1, $user->hasRight('compta', 'resultat', 'lire'), '', '', '', 50); |
|
1928 | - $newmenu->add("/compta/journal/purchasesjournal.php?leftmenu=report", $langs->trans("PurchasesJournal"), 1, $user->hasRight('compta', 'resultat', 'lire'), '', '', '', 51); |
|
1927 | + $newmenu->add("/compta/journal/sellsjournal.php?leftmenu=report", $langs->trans("SellsJournal"), 1, $user->hasRight('compta', 'resultat', 'lire'), '', '', '', 50); |
|
1928 | + $newmenu->add("/compta/journal/purchasesjournal.php?leftmenu=report", $langs->trans("PurchasesJournal"), 1, $user->hasRight('compta', 'resultat', 'lire'), '', '', '', 51); |
|
1929 | 1929 | } |
1930 | 1930 | //if ($leftmenu=="ca") $newmenu->add("/compta/journaux/index.php?leftmenu=ca",$langs->trans("Journals"),1,$user->hasRight('compta', 'resultat', 'lire')||$user->hasRight('accounting', 'comptarapport', 'lire')); |
1931 | 1931 | } |
1932 | 1932 | |
1933 | 1933 | // Intracomm report |
1934 | 1934 | if (isModEnabled('intracommreport')) { |
1935 | - $newmenu->add("/intracommreport/list.php?leftmenu=intracommreport", $langs->trans("MenuIntracommReport"), 0, $user->hasRight('intracommreport', 'read'), '', $mainmenu, 'intracommreport', 60, '', '', '', img_picto('', 'intracommreport', 'class="paddingright pictofixedwidth"')); |
|
1935 | + $newmenu->add("/intracommreport/list.php?leftmenu=intracommreport", $langs->trans("MenuIntracommReport"), 0, $user->hasRight('intracommreport', 'read'), '', $mainmenu, 'intracommreport', 60, '', '', '', img_picto('', 'intracommreport', 'class="paddingright pictofixedwidth"')); |
|
1936 | 1936 | if ($usemenuhider || empty($leftmenu) || preg_match('/intracommreport/', $leftmenu)) { |
1937 | 1937 | // DEB / DES |
1938 | - $newmenu->add("/intracommreport/card.php?action=create&leftmenu=intracommreport", $langs->trans("MenuIntracommReportNew"), 1, $user->hasRight('intracommreport', 'write'), '', $mainmenu, 'intracommreport', 1); |
|
1939 | - $newmenu->add("/intracommreport/list.php?leftmenu=intracommreport", $langs->trans("MenuIntracommReportList"), 1, $user->hasRight('intracommreport', 'read'), '', $mainmenu, 'intracommreport', 1); |
|
1938 | + $newmenu->add("/intracommreport/card.php?action=create&leftmenu=intracommreport", $langs->trans("MenuIntracommReportNew"), 1, $user->hasRight('intracommreport', 'write'), '', $mainmenu, 'intracommreport', 1); |
|
1939 | + $newmenu->add("/intracommreport/list.php?leftmenu=intracommreport", $langs->trans("MenuIntracommReportList"), 1, $user->hasRight('intracommreport', 'read'), '', $mainmenu, 'intracommreport', 1); |
|
1940 | 1940 | } |
1941 | 1941 | } |
1942 | 1942 | |
1943 | 1943 | // Assets |
1944 | 1944 | if (isModEnabled('asset')) { |
1945 | - $newmenu->add("/asset/list.php?leftmenu=asset&mainmenu=accountancy", $langs->trans("MenuAssets"), 0, $user->hasRight('asset', 'read'), '', $mainmenu, 'asset', 100, '', '', '', img_picto('', 'payment', 'class="paddingright pictofixedwidth"')); |
|
1946 | - $newmenu->add("/asset/card.php?leftmenu=asset&action=create", $langs->trans("MenuNewAsset"), 1, $user->hasRight('asset', 'write')); |
|
1947 | - $newmenu->add("/asset/list.php?leftmenu=asset&mainmenu=accountancy", $langs->trans("MenuListAssets"), 1, $user->hasRight('asset', 'read')); |
|
1948 | - $newmenu->add("/asset/model/list.php?leftmenu=asset_model", $langs->trans("MenuAssetModels"), 1, (empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->hasRight('asset', 'read')) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->hasRight('asset', 'model_advance', 'read')), '', $mainmenu, 'asset_model'); |
|
1945 | + $newmenu->add("/asset/list.php?leftmenu=asset&mainmenu=accountancy", $langs->trans("MenuAssets"), 0, $user->hasRight('asset', 'read'), '', $mainmenu, 'asset', 100, '', '', '', img_picto('', 'payment', 'class="paddingright pictofixedwidth"')); |
|
1946 | + $newmenu->add("/asset/card.php?leftmenu=asset&action=create", $langs->trans("MenuNewAsset"), 1, $user->hasRight('asset', 'write')); |
|
1947 | + $newmenu->add("/asset/list.php?leftmenu=asset&mainmenu=accountancy", $langs->trans("MenuListAssets"), 1, $user->hasRight('asset', 'read')); |
|
1948 | + $newmenu->add("/asset/model/list.php?leftmenu=asset_model", $langs->trans("MenuAssetModels"), 1, (empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->hasRight('asset', 'read')) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->hasRight('asset', 'model_advance', 'read')), '', $mainmenu, 'asset_model'); |
|
1949 | 1949 | if ($usemenuhider || empty($leftmenu) || preg_match('/asset_model/', $leftmenu)) { |
1950 | - $newmenu->add("/asset/model/card.php?leftmenu=asset_model&action=create", $langs->trans("MenuNewAssetModel"), 2, (empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->hasRight('asset', 'write')) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->hasRight('asset', 'model_advance', 'write'))); |
|
1951 | - $newmenu->add("/asset/model/list.php?leftmenu=asset_model", $langs->trans("MenuListAssetModels"), 2, (empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->hasRight('asset', 'read')) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->hasRight('asset', 'model_advance', 'read'))); |
|
1950 | + $newmenu->add("/asset/model/card.php?leftmenu=asset_model&action=create", $langs->trans("MenuNewAssetModel"), 2, (empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->hasRight('asset', 'write')) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->hasRight('asset', 'model_advance', 'write'))); |
|
1951 | + $newmenu->add("/asset/model/list.php?leftmenu=asset_model", $langs->trans("MenuListAssetModels"), 2, (empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->hasRight('asset', 'read')) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->hasRight('asset', 'model_advance', 'read'))); |
|
1952 | 1952 | } |
1953 | 1953 | } |
1954 | 1954 | } |
@@ -1974,62 +1974,62 @@ discard block |
||
1974 | 1974 | |
1975 | 1975 | // Bank-Cash account |
1976 | 1976 | if (isModEnabled('banque')) { |
1977 | - $newmenu->add("/compta/bank/list.php?leftmenu=bank&mainmenu=bank", $langs->trans("MenuBankCash"), 0, $user->hasRight('banque', 'lire'), '', $mainmenu, 'bank', 0, '', '', '', img_picto('', 'bank_account', 'class="paddingright pictofixedwidth"')); |
|
1977 | + $newmenu->add("/compta/bank/list.php?leftmenu=bank&mainmenu=bank", $langs->trans("MenuBankCash"), 0, $user->hasRight('banque', 'lire'), '', $mainmenu, 'bank', 0, '', '', '', img_picto('', 'bank_account', 'class="paddingright pictofixedwidth"')); |
|
1978 | 1978 | |
1979 | - $newmenu->add("/compta/bank/card.php?action=create", $langs->trans("MenuNewFinancialAccount"), 1, $user->hasRight('banque', 'configurer')); |
|
1980 | - $newmenu->add("/compta/bank/list.php?leftmenu=bank&mainmenu=bank", $langs->trans("List"), 1, $user->hasRight('banque', 'lire'), '', $mainmenu, 'bank'); |
|
1981 | - $newmenu->add("/compta/bank/bankentries_list.php", $langs->trans("ListTransactions"), 1, $user->hasRight('banque', 'lire')); |
|
1982 | - $newmenu->add("/compta/bank/budget.php", $langs->trans("ListTransactionsByCategory"), 1, $user->hasRight('banque', 'lire')); |
|
1979 | + $newmenu->add("/compta/bank/card.php?action=create", $langs->trans("MenuNewFinancialAccount"), 1, $user->hasRight('banque', 'configurer')); |
|
1980 | + $newmenu->add("/compta/bank/list.php?leftmenu=bank&mainmenu=bank", $langs->trans("List"), 1, $user->hasRight('banque', 'lire'), '', $mainmenu, 'bank'); |
|
1981 | + $newmenu->add("/compta/bank/bankentries_list.php", $langs->trans("ListTransactions"), 1, $user->hasRight('banque', 'lire')); |
|
1982 | + $newmenu->add("/compta/bank/budget.php", $langs->trans("ListTransactionsByCategory"), 1, $user->hasRight('banque', 'lire')); |
|
1983 | 1983 | |
1984 | - $newmenu->add("/compta/bank/transfer.php", $langs->trans("MenuBankInternalTransfer"), 1, $user->hasRight('banque', 'transfer')); |
|
1984 | + $newmenu->add("/compta/bank/transfer.php", $langs->trans("MenuBankInternalTransfer"), 1, $user->hasRight('banque', 'transfer')); |
|
1985 | 1985 | } |
1986 | 1986 | |
1987 | 1987 | if (isModEnabled('categorie')) { |
1988 | 1988 | $langs->load("categories"); |
1989 | - $newmenu->add("/categories/index.php?type=5", $langs->trans("Rubriques"), 1, $user->hasRight('categorie', 'creer'), '', $mainmenu, 'tags'); |
|
1990 | - $newmenu->add("/compta/bank/categ.php", $langs->trans("RubriquesTransactions"), 1, $user->hasRight('banque', 'configurer'), '', $mainmenu, 'tags'); |
|
1989 | + $newmenu->add("/categories/index.php?type=5", $langs->trans("Rubriques"), 1, $user->hasRight('categorie', 'creer'), '', $mainmenu, 'tags'); |
|
1990 | + $newmenu->add("/compta/bank/categ.php", $langs->trans("RubriquesTransactions"), 1, $user->hasRight('banque', 'configurer'), '', $mainmenu, 'tags'); |
|
1991 | 1991 | } |
1992 | 1992 | |
1993 | 1993 | // Direct debit order |
1994 | 1994 | if (isModEnabled('prelevement')) { |
1995 | - $newmenu->add("/compta/prelevement/index.php?leftmenu=withdraw&mainmenu=bank", $langs->trans("PaymentByDirectDebit"), 0, $user->hasRight('prelevement', 'bons', 'lire'), '', $mainmenu, 'withdraw', 0, '', '', '', img_picto('', 'payment', 'class="paddingright pictofixedwidth"')); |
|
1995 | + $newmenu->add("/compta/prelevement/index.php?leftmenu=withdraw&mainmenu=bank", $langs->trans("PaymentByDirectDebit"), 0, $user->hasRight('prelevement', 'bons', 'lire'), '', $mainmenu, 'withdraw', 0, '', '', '', img_picto('', 'payment', 'class="paddingright pictofixedwidth"')); |
|
1996 | 1996 | |
1997 | 1997 | if ($usemenuhider || empty($leftmenu) || $leftmenu == "withdraw") { |
1998 | - $newmenu->add("/compta/prelevement/create.php?mainmenu=bank", $langs->trans("NewStandingOrder"), 1, $user->hasRight('prelevement', 'bons', 'creer')); |
|
1998 | + $newmenu->add("/compta/prelevement/create.php?mainmenu=bank", $langs->trans("NewStandingOrder"), 1, $user->hasRight('prelevement', 'bons', 'creer')); |
|
1999 | 1999 | |
2000 | - $newmenu->add("/compta/prelevement/orders_list.php?mainmenu=bank", $langs->trans("WithdrawalsReceipts"), 1, $user->hasRight('prelevement', 'bons', 'lire')); |
|
2001 | - $newmenu->add("/compta/prelevement/list.php?mainmenu=bank", $langs->trans("WithdrawalsLines"), 1, $user->hasRight('prelevement', 'bons', 'lire')); |
|
2002 | - $newmenu->add("/compta/prelevement/rejets.php?mainmenu=bank", $langs->trans("Rejects"), 1, $user->hasRight('prelevement', 'bons', 'lire')); |
|
2003 | - $newmenu->add("/compta/prelevement/stats.php?mainmenu=bank", $langs->trans("Statistics"), 1, $user->hasRight('prelevement', 'bons', 'lire')); |
|
2000 | + $newmenu->add("/compta/prelevement/orders_list.php?mainmenu=bank", $langs->trans("WithdrawalsReceipts"), 1, $user->hasRight('prelevement', 'bons', 'lire')); |
|
2001 | + $newmenu->add("/compta/prelevement/list.php?mainmenu=bank", $langs->trans("WithdrawalsLines"), 1, $user->hasRight('prelevement', 'bons', 'lire')); |
|
2002 | + $newmenu->add("/compta/prelevement/rejets.php?mainmenu=bank", $langs->trans("Rejects"), 1, $user->hasRight('prelevement', 'bons', 'lire')); |
|
2003 | + $newmenu->add("/compta/prelevement/stats.php?mainmenu=bank", $langs->trans("Statistics"), 1, $user->hasRight('prelevement', 'bons', 'lire')); |
|
2004 | 2004 | } |
2005 | 2005 | } |
2006 | 2006 | |
2007 | 2007 | // Bank transfer order |
2008 | 2008 | if (isModEnabled('paymentbybanktransfer')) { |
2009 | - $newmenu->add("/compta/paymentbybanktransfer/index.php?leftmenu=banktransfer&mainmenu=bank", $langs->trans("PaymentByBankTransfer"), 0, $user->hasRight('paymentbybanktransfer', 'read'), '', $mainmenu, 'banktransfer', 0, '', '', '', img_picto('', 'payment', 'class="paddingright pictofixedwidth"')); |
|
2009 | + $newmenu->add("/compta/paymentbybanktransfer/index.php?leftmenu=banktransfer&mainmenu=bank", $langs->trans("PaymentByBankTransfer"), 0, $user->hasRight('paymentbybanktransfer', 'read'), '', $mainmenu, 'banktransfer', 0, '', '', '', img_picto('', 'payment', 'class="paddingright pictofixedwidth"')); |
|
2010 | 2010 | |
2011 | 2011 | if ($usemenuhider || empty($leftmenu) || $leftmenu == "banktransfer") { |
2012 | - $newmenu->add("/compta/prelevement/create.php?type=bank-transfer&mainmenu=bank", $langs->trans("NewPaymentByBankTransfer"), 1, $user->hasRight('paymentbybanktransfer', 'create')); |
|
2012 | + $newmenu->add("/compta/prelevement/create.php?type=bank-transfer&mainmenu=bank", $langs->trans("NewPaymentByBankTransfer"), 1, $user->hasRight('paymentbybanktransfer', 'create')); |
|
2013 | 2013 | |
2014 | - $newmenu->add("/compta/prelevement/orders_list.php?type=bank-transfer&mainmenu=bank", $langs->trans("PaymentByBankTransferReceipts"), 1, $user->hasRight('paymentbybanktransfer', 'read')); |
|
2015 | - $newmenu->add("/compta/prelevement/list.php?type=bank-transfer&mainmenu=bank", $langs->trans("PaymentByBankTransferLines"), 1, $user->hasRight('paymentbybanktransfer', 'read')); |
|
2016 | - $newmenu->add("/compta/prelevement/rejets.php?type=bank-transfer&mainmenu=bank", $langs->trans("Rejects"), 1, $user->hasRight('paymentbybanktransfer', 'read')); |
|
2017 | - $newmenu->add("/compta/prelevement/stats.php?type=bank-transfer&mainmenu=bank", $langs->trans("Statistics"), 1, $user->hasRight('paymentbybanktransfer', 'read')); |
|
2014 | + $newmenu->add("/compta/prelevement/orders_list.php?type=bank-transfer&mainmenu=bank", $langs->trans("PaymentByBankTransferReceipts"), 1, $user->hasRight('paymentbybanktransfer', 'read')); |
|
2015 | + $newmenu->add("/compta/prelevement/list.php?type=bank-transfer&mainmenu=bank", $langs->trans("PaymentByBankTransferLines"), 1, $user->hasRight('paymentbybanktransfer', 'read')); |
|
2016 | + $newmenu->add("/compta/prelevement/rejets.php?type=bank-transfer&mainmenu=bank", $langs->trans("Rejects"), 1, $user->hasRight('paymentbybanktransfer', 'read')); |
|
2017 | + $newmenu->add("/compta/prelevement/stats.php?type=bank-transfer&mainmenu=bank", $langs->trans("Statistics"), 1, $user->hasRight('paymentbybanktransfer', 'read')); |
|
2018 | 2018 | } |
2019 | 2019 | } |
2020 | 2020 | |
2021 | 2021 | // Management of checks |
2022 | 2022 | if (empty($conf->global->BANK_DISABLE_CHECK_DEPOSIT) && isModEnabled('banque') && (isModEnabled('facture') || !empty($conf->global->MAIN_MENU_CHEQUE_DEPOSIT_ON))) { |
2023 | - $newmenu->add("/compta/paiement/cheque/index.php?leftmenu=checks&mainmenu=bank", $langs->trans("MenuChequeDeposits"), 0, $user->hasRight('banque', 'cheque'), '', $mainmenu, 'checks', 0, '', '', '', img_picto('', 'payment', 'class="paddingright pictofixedwidth"')); |
|
2023 | + $newmenu->add("/compta/paiement/cheque/index.php?leftmenu=checks&mainmenu=bank", $langs->trans("MenuChequeDeposits"), 0, $user->hasRight('banque', 'cheque'), '', $mainmenu, 'checks', 0, '', '', '', img_picto('', 'payment', 'class="paddingright pictofixedwidth"')); |
|
2024 | 2024 | if (preg_match('/checks/', $leftmenu)) { |
2025 | - $newmenu->add("/compta/paiement/cheque/card.php?leftmenu=checks_bis&action=new&mainmenu=bank", $langs->trans("NewChequeDeposit"), 1, $user->hasRight('banque', 'cheque')); |
|
2026 | - $newmenu->add("/compta/paiement/cheque/list.php?leftmenu=checks_bis&mainmenu=bank", $langs->trans("List"), 1, $user->hasRight('banque', 'cheque')); |
|
2025 | + $newmenu->add("/compta/paiement/cheque/card.php?leftmenu=checks_bis&action=new&mainmenu=bank", $langs->trans("NewChequeDeposit"), 1, $user->hasRight('banque', 'cheque')); |
|
2026 | + $newmenu->add("/compta/paiement/cheque/list.php?leftmenu=checks_bis&mainmenu=bank", $langs->trans("List"), 1, $user->hasRight('banque', 'cheque')); |
|
2027 | 2027 | } |
2028 | 2028 | } |
2029 | 2029 | |
2030 | 2030 | // Cash Control |
2031 | 2031 | if (isModEnabled('takepos') || isModEnabled('cashdesk')) { |
2032 | - $permtomakecashfence = ($user->hasRight('cashdesk', 'run')|| $user->hasRight('takepos', 'run')); |
|
2032 | + $permtomakecashfence = ($user->hasRight('cashdesk', 'run') || $user->hasRight('takepos', 'run')); |
|
2033 | 2033 | $newmenu->add("/compta/cashcontrol/cashcontrol_list.php?action=list", $langs->trans("CashControl"), 0, $permtomakecashfence, '', $mainmenu, 'cashcontrol', 0, '', '', '', img_picto('', 'pos', 'class="paddingright pictofixedwidth"')); |
2034 | 2034 | $newmenu->add("/compta/cashcontrol/cashcontrol_card.php?action=create", $langs->trans("NewCashFence"), 1, $permtomakecashfence); |
2035 | 2035 | $newmenu->add("/compta/cashcontrol/cashcontrol_list.php?action=list", $langs->trans("List"), 1, $permtomakecashfence); |
@@ -2054,51 +2054,51 @@ discard block |
||
2054 | 2054 | if ($mainmenu == 'products') { |
2055 | 2055 | // Products |
2056 | 2056 | if (isModEnabled('product')) { |
2057 | - $newmenu->add("/product/index.php?leftmenu=product&type=0", $langs->trans("Products"), 0, $user->hasRight('product', 'read'), '', $mainmenu, 'product', 0, '', '', '', img_picto('', 'product', 'class="paddingright pictofixedwidth"')); |
|
2058 | - $newmenu->add("/product/card.php?leftmenu=product&action=create&type=0", $langs->trans("NewProduct"), 1, $user->hasRight('product', 'creer')); |
|
2059 | - $newmenu->add("/product/list.php?leftmenu=product&type=0", $langs->trans("List"), 1, $user->hasRight('product', 'read')); |
|
2057 | + $newmenu->add("/product/index.php?leftmenu=product&type=0", $langs->trans("Products"), 0, $user->hasRight('product', 'read'), '', $mainmenu, 'product', 0, '', '', '', img_picto('', 'product', 'class="paddingright pictofixedwidth"')); |
|
2058 | + $newmenu->add("/product/card.php?leftmenu=product&action=create&type=0", $langs->trans("NewProduct"), 1, $user->hasRight('product', 'creer')); |
|
2059 | + $newmenu->add("/product/list.php?leftmenu=product&type=0", $langs->trans("List"), 1, $user->hasRight('product', 'read')); |
|
2060 | 2060 | if (isModEnabled('stock')) { |
2061 | - $newmenu->add("/product/reassort.php?type=0", $langs->trans("MenuStocks"), 1, $user->hasRight('product', 'read') && $user->hasRight('stock', 'lire')); |
|
2061 | + $newmenu->add("/product/reassort.php?type=0", $langs->trans("MenuStocks"), 1, $user->hasRight('product', 'read') && $user->hasRight('stock', 'lire')); |
|
2062 | 2062 | } |
2063 | 2063 | if (isModEnabled('productbatch')) { |
2064 | 2064 | $langs->load("stocks"); |
2065 | - $newmenu->add("/product/reassortlot.php?type=0&search_subjecttolotserial=1", $langs->trans("StocksByLotSerial"), 1, $user->hasRight('product', 'read') && $user->hasRight('stock', 'lire')); |
|
2066 | - $newmenu->add("/product/stock/productlot_list.php", $langs->trans("LotSerial"), 1, $user->hasRight('product', 'read') && $user->hasRight('stock', 'lire')); |
|
2065 | + $newmenu->add("/product/reassortlot.php?type=0&search_subjecttolotserial=1", $langs->trans("StocksByLotSerial"), 1, $user->hasRight('product', 'read') && $user->hasRight('stock', 'lire')); |
|
2066 | + $newmenu->add("/product/stock/productlot_list.php", $langs->trans("LotSerial"), 1, $user->hasRight('product', 'read') && $user->hasRight('stock', 'lire')); |
|
2067 | 2067 | } |
2068 | 2068 | if (isModEnabled('variants')) { |
2069 | - $newmenu->add("/variants/list.php", $langs->trans("VariantAttributes"), 1, $user->hasRight('product', 'read')); |
|
2069 | + $newmenu->add("/variants/list.php", $langs->trans("VariantAttributes"), 1, $user->hasRight('product', 'read')); |
|
2070 | 2070 | } |
2071 | 2071 | if (isModEnabled('propal') || isModEnabled('commande') || isModEnabled('facture') || isModEnabled('supplier_proposal') || isModEnabled('supplier_order') || isModEnabled('supplier_invoice')) { |
2072 | - $newmenu->add("/product/stats/card.php?id=all&leftmenu=stats&type=0", $langs->trans("Statistics"), 1, $user->hasRight('product', 'read')); |
|
2072 | + $newmenu->add("/product/stats/card.php?id=all&leftmenu=stats&type=0", $langs->trans("Statistics"), 1, $user->hasRight('product', 'read')); |
|
2073 | 2073 | } |
2074 | 2074 | |
2075 | 2075 | // Categories |
2076 | 2076 | if (isModEnabled('categorie')) { |
2077 | 2077 | $langs->load("categories"); |
2078 | - $newmenu->add("/categories/index.php?leftmenu=cat&type=0", $langs->trans("Categories"), 1, $user->hasRight('categorie', 'lire'), '', $mainmenu, 'cat'); |
|
2078 | + $newmenu->add("/categories/index.php?leftmenu=cat&type=0", $langs->trans("Categories"), 1, $user->hasRight('categorie', 'lire'), '', $mainmenu, 'cat'); |
|
2079 | 2079 | //if ($usemenuhider || empty($leftmenu) || $leftmenu=="cat") $newmenu->add("/categories/list.php", $langs->trans("List"), 1, $user->hasRight('categorie', 'lire')); |
2080 | 2080 | } |
2081 | 2081 | } |
2082 | 2082 | |
2083 | 2083 | // Services |
2084 | 2084 | if (isModEnabled('service')) { |
2085 | - $newmenu->add("/product/index.php?leftmenu=service&type=1", $langs->trans("Services"), 0, $user->hasRight('service', 'read'), '', $mainmenu, 'service', 0, '', '', '', img_picto('', 'service', 'class="paddingright pictofixedwidth"')); |
|
2086 | - $newmenu->add("/product/card.php?leftmenu=service&action=create&type=1", $langs->trans("NewService"), 1, $user->hasRight('service', 'creer')); |
|
2087 | - $newmenu->add("/product/list.php?leftmenu=service&type=1", $langs->trans("List"), 1, $user->hasRight('service', 'read')); |
|
2085 | + $newmenu->add("/product/index.php?leftmenu=service&type=1", $langs->trans("Services"), 0, $user->hasRight('service', 'read'), '', $mainmenu, 'service', 0, '', '', '', img_picto('', 'service', 'class="paddingright pictofixedwidth"')); |
|
2086 | + $newmenu->add("/product/card.php?leftmenu=service&action=create&type=1", $langs->trans("NewService"), 1, $user->hasRight('service', 'creer')); |
|
2087 | + $newmenu->add("/product/list.php?leftmenu=service&type=1", $langs->trans("List"), 1, $user->hasRight('service', 'read')); |
|
2088 | 2088 | |
2089 | 2089 | if (isModEnabled('Stock') && getDolGlobalString('STOCK_SUPPORTS_SERVICES')) { |
2090 | - $newmenu->add("/product/reassort.php?type=1", $langs->trans("MenuStocks"), 1, $user->hasRight('service', 'read') && $user->hasRight('stock', 'lire')); |
|
2090 | + $newmenu->add("/product/reassort.php?type=1", $langs->trans("MenuStocks"), 1, $user->hasRight('service', 'read') && $user->hasRight('stock', 'lire')); |
|
2091 | 2091 | } |
2092 | 2092 | if (isModEnabled('variants')) { |
2093 | - $newmenu->add("/variants/list.php", $langs->trans("VariantAttributes"), 1, $user->hasRight('service', 'read')); |
|
2093 | + $newmenu->add("/variants/list.php", $langs->trans("VariantAttributes"), 1, $user->hasRight('service', 'read')); |
|
2094 | 2094 | } |
2095 | 2095 | if (isModEnabled('propal') || isModEnabled('commande') || isModEnabled('facture') || isModEnabled('supplier_proposal') || isModEnabled('supplier_order') || isModEnabled('supplier_invoice')) { |
2096 | - $newmenu->add("/product/stats/card.php?id=all&leftmenu=stats&type=1", $langs->trans("Statistics"), 1, $user->hasRight('service', 'read')); |
|
2096 | + $newmenu->add("/product/stats/card.php?id=all&leftmenu=stats&type=1", $langs->trans("Statistics"), 1, $user->hasRight('service', 'read')); |
|
2097 | 2097 | } |
2098 | 2098 | // Categories |
2099 | 2099 | if (isModEnabled('categorie')) { |
2100 | 2100 | $langs->load("categories"); |
2101 | - $newmenu->add("/categories/index.php?leftmenu=cat&type=0", $langs->trans("Categories"), 1, $user->hasRight('categorie', 'lire'), '', $mainmenu, 'cat'); |
|
2101 | + $newmenu->add("/categories/index.php?leftmenu=cat&type=0", $langs->trans("Categories"), 1, $user->hasRight('categorie', 'lire'), '', $mainmenu, 'cat'); |
|
2102 | 2102 | //if ($usemenuhider || empty($leftmenu) || $leftmenu=="cat") $newmenu->add("/categories/list.php", $langs->trans("List"), 1, $user->hasRight('categorie', 'lire')); |
2103 | 2103 | } |
2104 | 2104 | } |
@@ -2108,41 +2108,41 @@ discard block |
||
2108 | 2108 | $langs->load("stocks"); |
2109 | 2109 | $newmenu->add("/product/stock/index.php?leftmenu=stock", $langs->trans("Warehouses"), 0, $user->hasRight('stock', 'lire'), '', $mainmenu, 'stock', 0, '', '', '', img_picto('', 'stock', 'class="paddingright pictofixedwidth"')); |
2110 | 2110 | $newmenu->add("/product/stock/card.php?action=create", $langs->trans("MenuNewWarehouse"), 1, $user->hasRight('stock', 'creer')); |
2111 | - $newmenu->add("/product/stock/list.php", $langs->trans("List"), 1, $user->hasRight('stock', 'lire')); |
|
2111 | + $newmenu->add("/product/stock/list.php", $langs->trans("List"), 1, $user->hasRight('stock', 'lire')); |
|
2112 | 2112 | $newmenu->add("/product/stock/movement_list.php", $langs->trans("Movements"), 1, $user->hasRight('stock', 'mouvement', 'lire')); |
2113 | 2113 | |
2114 | 2114 | $newmenu->add("/product/stock/massstockmove.php?init=1", $langs->trans("MassStockTransferShort"), 1, $user->hasRight('stock', 'mouvement', 'creer')); |
2115 | 2115 | if (isModEnabled('supplier_order')) { |
2116 | - $newmenu->add("/product/stock/replenish.php", $langs->trans("Replenishment"), 1, $user->hasRight('stock', 'mouvement', 'creer') && $user->hasRight('fournisseur', 'lire')); |
|
2116 | + $newmenu->add("/product/stock/replenish.php", $langs->trans("Replenishment"), 1, $user->hasRight('stock', 'mouvement', 'creer') && $user->hasRight('fournisseur', 'lire')); |
|
2117 | 2117 | } |
2118 | 2118 | $newmenu->add("/product/stock/stockatdate.php", $langs->trans("StockAtDate"), 1, $user->hasRight('product', 'read') && $user->hasRight('stock', 'lire')); |
2119 | 2119 | |
2120 | 2120 | // Categories for warehouses |
2121 | 2121 | if (isModEnabled('categorie')) { |
2122 | - $newmenu->add("/categories/index.php?leftmenu=stock&type=9", $langs->trans("Categories"), 1, $user->hasRight('categorie', 'lire'), '', $mainmenu, 'cat'); |
|
2122 | + $newmenu->add("/categories/index.php?leftmenu=stock&type=9", $langs->trans("Categories"), 1, $user->hasRight('categorie', 'lire'), '', $mainmenu, 'cat'); |
|
2123 | 2123 | } |
2124 | 2124 | } |
2125 | 2125 | |
2126 | 2126 | if (isModEnabled('stocktransfer')) { |
2127 | - $newmenu->add('/product/stock/stocktransfer/stocktransfer_list.php', $langs->trans("ModuleStockTransferName"), 0, $user->hasRight('stocktransfer', 'stocktransfer', 'read'), '', $mainmenu, 'stocktransfer', 0, '', '', '', img_picto('', 'stock', 'class="paddingright pictofixedwidth"')); |
|
2128 | - $newmenu->add('/product/stock/stocktransfer/stocktransfer_card.php?action=create', $langs->trans('StockTransferNew'), 1, $user->hasRight('stocktransfer', 'stocktransfer', 'write')); |
|
2129 | - $newmenu->add('/product/stock/stocktransfer/stocktransfer_list.php', $langs->trans('List'), 1, $user->hasRight('stocktransfer', 'stocktransfer', 'read')); |
|
2127 | + $newmenu->add('/product/stock/stocktransfer/stocktransfer_list.php', $langs->trans("ModuleStockTransferName"), 0, $user->hasRight('stocktransfer', 'stocktransfer', 'read'), '', $mainmenu, 'stocktransfer', 0, '', '', '', img_picto('', 'stock', 'class="paddingright pictofixedwidth"')); |
|
2128 | + $newmenu->add('/product/stock/stocktransfer/stocktransfer_card.php?action=create', $langs->trans('StockTransferNew'), 1, $user->hasRight('stocktransfer', 'stocktransfer', 'write')); |
|
2129 | + $newmenu->add('/product/stock/stocktransfer/stocktransfer_list.php', $langs->trans('List'), 1, $user->hasRight('stocktransfer', 'stocktransfer', 'read')); |
|
2130 | 2130 | } |
2131 | 2131 | |
2132 | 2132 | // Inventory |
2133 | 2133 | if (isModEnabled('stock')) { |
2134 | 2134 | $langs->load("stocks"); |
2135 | 2135 | if (empty($conf->global->MAIN_USE_ADVANCED_PERMS)) { |
2136 | - $newmenu->add("/product/inventory/list.php?leftmenu=stock_inventories", $langs->trans("Inventories"), 0, $user->hasRight('stock', 'lire'), '', $mainmenu, 'stock', 0, '', '', '', img_picto('', 'inventory', 'class="paddingright pictofixedwidth"')); |
|
2136 | + $newmenu->add("/product/inventory/list.php?leftmenu=stock_inventories", $langs->trans("Inventories"), 0, $user->hasRight('stock', 'lire'), '', $mainmenu, 'stock', 0, '', '', '', img_picto('', 'inventory', 'class="paddingright pictofixedwidth"')); |
|
2137 | 2137 | if ($usemenuhider || empty($leftmenu) || $leftmenu == "stock_inventories") { |
2138 | - $newmenu->add("/product/inventory/card.php?action=create&leftmenu=stock_inventories", $langs->trans("NewInventory"), 1, $user->hasRight('stock', 'creer')); |
|
2139 | - $newmenu->add("/product/inventory/list.php?leftmenu=stock_inventories", $langs->trans("List"), 1, $user->hasRight('stock', 'lire')); |
|
2138 | + $newmenu->add("/product/inventory/card.php?action=create&leftmenu=stock_inventories", $langs->trans("NewInventory"), 1, $user->hasRight('stock', 'creer')); |
|
2139 | + $newmenu->add("/product/inventory/list.php?leftmenu=stock_inventories", $langs->trans("List"), 1, $user->hasRight('stock', 'lire')); |
|
2140 | 2140 | } |
2141 | 2141 | } else { |
2142 | - $newmenu->add("/product/inventory/list.php?leftmenu=stock_inventories", $langs->trans("Inventories"), 0, $user->hasRight('stock', 'inventory_advance', 'read'), '', $mainmenu, 'stock', 0, '', '', '', img_picto('', 'inventory', 'class="paddingright pictofixedwidth"')); |
|
2142 | + $newmenu->add("/product/inventory/list.php?leftmenu=stock_inventories", $langs->trans("Inventories"), 0, $user->hasRight('stock', 'inventory_advance', 'read'), '', $mainmenu, 'stock', 0, '', '', '', img_picto('', 'inventory', 'class="paddingright pictofixedwidth"')); |
|
2143 | 2143 | if ($usemenuhider || empty($leftmenu) || $leftmenu == "stock_inventories") { |
2144 | - $newmenu->add("/product/inventory/card.php?action=create&leftmenu=stock_inventories", $langs->trans("NewInventory"), 1, $user->hasRight('stock', 'inventory_advance', 'write')); |
|
2145 | - $newmenu->add("/product/inventory/list.php?leftmenu=stock_inventories", $langs->trans("List"), 1, $user->hasRight('stock', 'inventory_advance', 'read')); |
|
2144 | + $newmenu->add("/product/inventory/card.php?action=create&leftmenu=stock_inventories", $langs->trans("NewInventory"), 1, $user->hasRight('stock', 'inventory_advance', 'write')); |
|
2145 | + $newmenu->add("/product/inventory/list.php?leftmenu=stock_inventories", $langs->trans("List"), 1, $user->hasRight('stock', 'inventory_advance', 'read')); |
|
2146 | 2146 | } |
2147 | 2147 | } |
2148 | 2148 | } |
@@ -2150,33 +2150,33 @@ discard block |
||
2150 | 2150 | // Shipments |
2151 | 2151 | if (isModEnabled('expedition')) { |
2152 | 2152 | $langs->load("sendings"); |
2153 | - $newmenu->add("/expedition/index.php?leftmenu=sendings", $langs->trans("Shipments"), 0, $user->hasRight('expedition', 'lire'), '', $mainmenu, 'sendings', 0, '', '', '', img_picto('', 'shipment', 'class="paddingright pictofixedwidth"')); |
|
2154 | - $newmenu->add("/expedition/card.php?action=create2&leftmenu=sendings", $langs->trans("NewSending"), 1, $user->hasRight('expedition', 'creer')); |
|
2155 | - $newmenu->add("/expedition/list.php?leftmenu=sendings", $langs->trans("List"), 1, $user->hasRight('expedition', 'lire')); |
|
2153 | + $newmenu->add("/expedition/index.php?leftmenu=sendings", $langs->trans("Shipments"), 0, $user->hasRight('expedition', 'lire'), '', $mainmenu, 'sendings', 0, '', '', '', img_picto('', 'shipment', 'class="paddingright pictofixedwidth"')); |
|
2154 | + $newmenu->add("/expedition/card.php?action=create2&leftmenu=sendings", $langs->trans("NewSending"), 1, $user->hasRight('expedition', 'creer')); |
|
2155 | + $newmenu->add("/expedition/list.php?leftmenu=sendings", $langs->trans("List"), 1, $user->hasRight('expedition', 'lire')); |
|
2156 | 2156 | if ($usemenuhider || empty($leftmenu) || $leftmenu == "sendings") { |
2157 | - $newmenu->add("/expedition/list.php?leftmenu=sendings&search_status=0", $langs->trans("StatusSendingDraftShort"), 2, $user->hasRight('expedition', 'lire')); |
|
2158 | - $newmenu->add("/expedition/list.php?leftmenu=sendings&search_status=1", $langs->trans("StatusSendingValidatedShort"), 2, $user->hasRight('expedition', 'lire')); |
|
2159 | - $newmenu->add("/expedition/list.php?leftmenu=sendings&search_status=2", $langs->trans("StatusSendingProcessedShort"), 2, $user->hasRight('expedition', 'lire')); |
|
2157 | + $newmenu->add("/expedition/list.php?leftmenu=sendings&search_status=0", $langs->trans("StatusSendingDraftShort"), 2, $user->hasRight('expedition', 'lire')); |
|
2158 | + $newmenu->add("/expedition/list.php?leftmenu=sendings&search_status=1", $langs->trans("StatusSendingValidatedShort"), 2, $user->hasRight('expedition', 'lire')); |
|
2159 | + $newmenu->add("/expedition/list.php?leftmenu=sendings&search_status=2", $langs->trans("StatusSendingProcessedShort"), 2, $user->hasRight('expedition', 'lire')); |
|
2160 | 2160 | } |
2161 | - $newmenu->add("/expedition/stats/index.php?leftmenu=sendings", $langs->trans("Statistics"), 1, $user->hasRight('expedition', 'lire')); |
|
2161 | + $newmenu->add("/expedition/stats/index.php?leftmenu=sendings", $langs->trans("Statistics"), 1, $user->hasRight('expedition', 'lire')); |
|
2162 | 2162 | } |
2163 | 2163 | |
2164 | 2164 | // Receptions |
2165 | 2165 | if (isModEnabled('reception')) { |
2166 | 2166 | $langs->load("receptions"); |
2167 | - $newmenu->add("/reception/index.php?leftmenu=receptions", $langs->trans("Receptions"), 0, $user->hasRight('reception', 'lire'), '', $mainmenu, 'receptions', 0, '', '', '', img_picto('', 'dollyrevert', 'class="paddingright pictofixedwidth"')); |
|
2168 | - $newmenu->add("/reception/card.php?action=create2&leftmenu=receptions", $langs->trans("NewReception"), 1, $user->hasRight('reception', 'creer')); |
|
2169 | - $newmenu->add("/reception/list.php?leftmenu=receptions", $langs->trans("List"), 1, $user->hasRight('reception', 'lire')); |
|
2167 | + $newmenu->add("/reception/index.php?leftmenu=receptions", $langs->trans("Receptions"), 0, $user->hasRight('reception', 'lire'), '', $mainmenu, 'receptions', 0, '', '', '', img_picto('', 'dollyrevert', 'class="paddingright pictofixedwidth"')); |
|
2168 | + $newmenu->add("/reception/card.php?action=create2&leftmenu=receptions", $langs->trans("NewReception"), 1, $user->hasRight('reception', 'creer')); |
|
2169 | + $newmenu->add("/reception/list.php?leftmenu=receptions", $langs->trans("List"), 1, $user->hasRight('reception', 'lire')); |
|
2170 | 2170 | if ($usemenuhider || empty($leftmenu) || $leftmenu == "receptions") { |
2171 | - $newmenu->add("/reception/list.php?leftmenu=receptions&search_status=0", $langs->trans("StatusReceptionDraftShort"), 2, $user->hasRight('reception', 'lire')); |
|
2171 | + $newmenu->add("/reception/list.php?leftmenu=receptions&search_status=0", $langs->trans("StatusReceptionDraftShort"), 2, $user->hasRight('reception', 'lire')); |
|
2172 | 2172 | } |
2173 | 2173 | if ($usemenuhider || empty($leftmenu) || $leftmenu == "receptions") { |
2174 | - $newmenu->add("/reception/list.php?leftmenu=receptions&search_status=1", $langs->trans("StatusReceptionValidatedShort"), 2, $user->hasRight('reception', 'lire')); |
|
2174 | + $newmenu->add("/reception/list.php?leftmenu=receptions&search_status=1", $langs->trans("StatusReceptionValidatedShort"), 2, $user->hasRight('reception', 'lire')); |
|
2175 | 2175 | } |
2176 | 2176 | if ($usemenuhider || empty($leftmenu) || $leftmenu == "receptions") { |
2177 | - $newmenu->add("/reception/list.php?leftmenu=receptions&search_status=2", $langs->trans("StatusReceptionProcessedShort"), 2, $user->hasRight('reception', 'lire')); |
|
2177 | + $newmenu->add("/reception/list.php?leftmenu=receptions&search_status=2", $langs->trans("StatusReceptionProcessedShort"), 2, $user->hasRight('reception', 'lire')); |
|
2178 | 2178 | } |
2179 | - $newmenu->add("/reception/stats/index.php?leftmenu=receptions", $langs->trans("Statistics"), 1, $user->hasRight('reception', 'lire')); |
|
2179 | + $newmenu->add("/reception/stats/index.php?leftmenu=receptions", $langs->trans("Statistics"), 1, $user->hasRight('reception', 'lire')); |
|
2180 | 2180 | } |
2181 | 2181 | } |
2182 | 2182 | } |
@@ -2200,17 +2200,17 @@ discard block |
||
2200 | 2200 | if (isModEnabled('bom') || isModEnabled('mrp')) { |
2201 | 2201 | $langs->load("mrp"); |
2202 | 2202 | |
2203 | - $newmenu->add("", $langs->trans("MenuBOM"), 0, $user->hasRight('bom', 'read'), '', $mainmenu, 'bom', 0, '', '', '', img_picto('', 'bom', 'class="paddingright pictofixedwidth"')); |
|
2204 | - $newmenu->add("/bom/bom_card.php?leftmenu=bom&action=create", $langs->trans("NewBOM"), 1, $user->hasRight('bom', 'write'), '', $mainmenu, 'bom'); |
|
2205 | - $newmenu->add("/bom/bom_list.php?leftmenu=bom", $langs->trans("List"), 1, $user->hasRight('bom', 'read'), '', $mainmenu, 'bom'); |
|
2203 | + $newmenu->add("", $langs->trans("MenuBOM"), 0, $user->hasRight('bom', 'read'), '', $mainmenu, 'bom', 0, '', '', '', img_picto('', 'bom', 'class="paddingright pictofixedwidth"')); |
|
2204 | + $newmenu->add("/bom/bom_card.php?leftmenu=bom&action=create", $langs->trans("NewBOM"), 1, $user->hasRight('bom', 'write'), '', $mainmenu, 'bom'); |
|
2205 | + $newmenu->add("/bom/bom_list.php?leftmenu=bom", $langs->trans("List"), 1, $user->hasRight('bom', 'read'), '', $mainmenu, 'bom'); |
|
2206 | 2206 | } |
2207 | 2207 | |
2208 | 2208 | if (isModEnabled('mrp')) { |
2209 | 2209 | $langs->load("mrp"); |
2210 | 2210 | |
2211 | - $newmenu->add("", $langs->trans("MenuMRP"), 0, $user->hasRight('mrp', 'read'), '', $mainmenu, 'mrp', 0, '', '', '', img_picto('', 'mrp', 'class="paddingright pictofixedwidth"')); |
|
2212 | - $newmenu->add("/mrp/mo_card.php?leftmenu=mo&action=create", $langs->trans("NewMO"), 1, $user->hasRight('mrp', 'write'), '', $mainmenu, ''); |
|
2213 | - $newmenu->add("/mrp/mo_list.php?leftmenu=mo", $langs->trans("List"), 1, $user->hasRight('mrp', 'read'), '', $mainmenu, ''); |
|
2211 | + $newmenu->add("", $langs->trans("MenuMRP"), 0, $user->hasRight('mrp', 'read'), '', $mainmenu, 'mrp', 0, '', '', '', img_picto('', 'mrp', 'class="paddingright pictofixedwidth"')); |
|
2212 | + $newmenu->add("/mrp/mo_card.php?leftmenu=mo&action=create", $langs->trans("NewMO"), 1, $user->hasRight('mrp', 'write'), '', $mainmenu, ''); |
|
2213 | + $newmenu->add("/mrp/mo_list.php?leftmenu=mo", $langs->trans("List"), 1, $user->hasRight('mrp', 'read'), '', $mainmenu, ''); |
|
2214 | 2214 | } |
2215 | 2215 | } |
2216 | 2216 | } |
@@ -2237,7 +2237,7 @@ discard block |
||
2237 | 2237 | |
2238 | 2238 | $tmpentry = array( |
2239 | 2239 | 'enabled'=>isModEnabled('projet'), |
2240 | - 'perms'=>$user->hasRight('projet', 'lire'), |
|
2240 | + 'perms'=>$user->hasRight('projet', 'lire'), |
|
2241 | 2241 | 'module'=>'projet' |
2242 | 2242 | ); |
2243 | 2243 | $listofmodulesforexternal = explode(',', $conf->global->MAIN_MODULES_FOR_EXTERNAL); |
@@ -2255,8 +2255,8 @@ discard block |
||
2255 | 2255 | } |
2256 | 2256 | |
2257 | 2257 | // Project assigned to user |
2258 | - $newmenu->add("/projet/index.php?leftmenu=projects".($search_project_user ? '&search_project_user='.$search_project_user : ''), $titleboth, 0, $user->hasRight('projet', 'lire'), '', $mainmenu, 'projects', 0, '', '', '', img_picto('', 'project', 'class="paddingright pictofixedwidth"')); |
|
2259 | - $newmenu->add("/projet/card.php?leftmenu=projects&action=create".($search_project_user ? '&search_project_user='.$search_project_user : ''), $titlenew, 1, $user->hasRight('projet', 'creer')); |
|
2258 | + $newmenu->add("/projet/index.php?leftmenu=projects".($search_project_user ? '&search_project_user='.$search_project_user : ''), $titleboth, 0, $user->hasRight('projet', 'lire'), '', $mainmenu, 'projects', 0, '', '', '', img_picto('', 'project', 'class="paddingright pictofixedwidth"')); |
|
2259 | + $newmenu->add("/projet/card.php?leftmenu=projects&action=create".($search_project_user ? '&search_project_user='.$search_project_user : ''), $titlenew, 1, $user->hasRight('projet', 'creer')); |
|
2260 | 2260 | |
2261 | 2261 | if (empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { |
2262 | 2262 | $newmenu->add("/projet/list.php?leftmenu=projets".($search_project_user ? '&search_project_user='.$search_project_user : '').'&search_status=99', $langs->trans("List"), 1, $showmode, '', 'project', 'list'); |
@@ -2268,23 +2268,23 @@ discard block |
||
2268 | 2268 | $newmenu->add('/projet/list.php?mainmenu=project&leftmenu=list&search_usage_opportunity=1&search_status=99', $langs->trans("List"), 2, $showmode); |
2269 | 2269 | } |
2270 | 2270 | |
2271 | - $newmenu->add("/projet/stats/index.php?leftmenu=projects", $langs->trans("Statistics"), 1, $user->hasRight('projet', 'lire')); |
|
2271 | + $newmenu->add("/projet/stats/index.php?leftmenu=projects", $langs->trans("Statistics"), 1, $user->hasRight('projet', 'lire')); |
|
2272 | 2272 | |
2273 | 2273 | // Categories |
2274 | 2274 | if (isModEnabled('categorie')) { |
2275 | 2275 | $langs->load("categories"); |
2276 | - $newmenu->add("/categories/index.php?leftmenu=cat&type=6", $langs->trans("Categories"), 1, $user->hasRight('categorie', 'lire'), '', $mainmenu, 'cat'); |
|
2276 | + $newmenu->add("/categories/index.php?leftmenu=cat&type=6", $langs->trans("Categories"), 1, $user->hasRight('categorie', 'lire'), '', $mainmenu, 'cat'); |
|
2277 | 2277 | } |
2278 | 2278 | |
2279 | 2279 | if (empty($conf->global->PROJECT_HIDE_TASKS)) { |
2280 | 2280 | // Project affected to user |
2281 | - $newmenu->add("/projet/activity/index.php?leftmenu=tasks".($search_project_user ? '&search_project_user='.$search_project_user : ''), $langs->trans("Activities"), 0, $user->hasRight('projet', 'lire'), '', 'project', 'tasks', 0, '', '', '', img_picto('', 'projecttask', 'class="paddingright pictofixedwidth"')); |
|
2282 | - $newmenu->add("/projet/tasks.php?leftmenu=tasks&action=create", $langs->trans("NewTask"), 1, $user->hasRight('projet', 'creer')); |
|
2283 | - $newmenu->add("/projet/tasks/list.php?leftmenu=tasks".($search_project_user ? '&search_project_user='.$search_project_user : ''), $langs->trans("List"), 1, $user->hasRight('projet', 'lire')); |
|
2284 | - $newmenu->add("/projet/tasks/stats/index.php?leftmenu=projects", $langs->trans("Statistics"), 1, $user->hasRight('projet', 'lire')); |
|
2281 | + $newmenu->add("/projet/activity/index.php?leftmenu=tasks".($search_project_user ? '&search_project_user='.$search_project_user : ''), $langs->trans("Activities"), 0, $user->hasRight('projet', 'lire'), '', 'project', 'tasks', 0, '', '', '', img_picto('', 'projecttask', 'class="paddingright pictofixedwidth"')); |
|
2282 | + $newmenu->add("/projet/tasks.php?leftmenu=tasks&action=create", $langs->trans("NewTask"), 1, $user->hasRight('projet', 'creer')); |
|
2283 | + $newmenu->add("/projet/tasks/list.php?leftmenu=tasks".($search_project_user ? '&search_project_user='.$search_project_user : ''), $langs->trans("List"), 1, $user->hasRight('projet', 'lire')); |
|
2284 | + $newmenu->add("/projet/tasks/stats/index.php?leftmenu=projects", $langs->trans("Statistics"), 1, $user->hasRight('projet', 'lire')); |
|
2285 | 2285 | |
2286 | - $newmenu->add("/projet/activity/perweek.php?leftmenu=tasks".($search_project_user ? '&search_project_user='.$search_project_user : ''), $langs->trans("NewTimeSpent"), 0, $user->hasRight('projet', 'lire'), '', 'project', 'timespent', 0, '', '', '', img_picto('', 'timespent', 'class="paddingright pictofixedwidth"')); |
|
2287 | - $newmenu->add("/projet/tasks/time.php?leftmenu=tasks".($search_project_user ? '&search_project_user='.$search_project_user : ''), $langs->trans("List"), 1, $user->hasRight('projet', 'lire')); |
|
2286 | + $newmenu->add("/projet/activity/perweek.php?leftmenu=tasks".($search_project_user ? '&search_project_user='.$search_project_user : ''), $langs->trans("NewTimeSpent"), 0, $user->hasRight('projet', 'lire'), '', 'project', 'timespent', 0, '', '', '', img_picto('', 'timespent', 'class="paddingright pictofixedwidth"')); |
|
2287 | + $newmenu->add("/projet/tasks/time.php?leftmenu=tasks".($search_project_user ? '&search_project_user='.$search_project_user : ''), $langs->trans("List"), 1, $user->hasRight('projet', 'lire')); |
|
2288 | 2288 | } |
2289 | 2289 | } |
2290 | 2290 | } |
@@ -2342,47 +2342,47 @@ discard block |
||
2342 | 2342 | // Load translation files required by the page |
2343 | 2343 | $langs->loadLangs(array("holiday", "trips")); |
2344 | 2344 | |
2345 | - $newmenu->add("/holiday/list.php?mainmenu=hrm&leftmenu=holiday", $langs->trans("CPTitreMenu"), 0, $user->hasRight('holiday', 'read'), '', $mainmenu, 'holiday', 0, '', '', '', img_picto('', 'holiday', 'class="paddingright pictofixedwidth"')); |
|
2346 | - $newmenu->add("/holiday/card.php?mainmenu=hrm&leftmenu=holiday&action=create", $langs->trans("New"), 1, $user->hasRight('holiday', 'write'), '', $mainmenu); |
|
2347 | - $newmenu->add("/holiday/card_group.php?mainmenu=hrm&leftmenu=holiday&action=create", $langs->trans("NewHolidayForGroup"), 1, ($user->hasRight('holiday', 'writeall') && $user->hasRight('holiday', 'readall')), '', $mainmenu, 'holiday_sm'); |
|
2348 | - $newmenu->add("/holiday/list.php?mainmenu=hrm&leftmenu=holiday", $langs->trans("List"), 1, $user->hasRight('holiday', 'read'), '', $mainmenu); |
|
2345 | + $newmenu->add("/holiday/list.php?mainmenu=hrm&leftmenu=holiday", $langs->trans("CPTitreMenu"), 0, $user->hasRight('holiday', 'read'), '', $mainmenu, 'holiday', 0, '', '', '', img_picto('', 'holiday', 'class="paddingright pictofixedwidth"')); |
|
2346 | + $newmenu->add("/holiday/card.php?mainmenu=hrm&leftmenu=holiday&action=create", $langs->trans("New"), 1, $user->hasRight('holiday', 'write'), '', $mainmenu); |
|
2347 | + $newmenu->add("/holiday/card_group.php?mainmenu=hrm&leftmenu=holiday&action=create", $langs->trans("NewHolidayForGroup"), 1, ($user->hasRight('holiday', 'writeall') && $user->hasRight('holiday', 'readall')), '', $mainmenu, 'holiday_sm'); |
|
2348 | + $newmenu->add("/holiday/list.php?mainmenu=hrm&leftmenu=holiday", $langs->trans("List"), 1, $user->hasRight('holiday', 'read'), '', $mainmenu); |
|
2349 | 2349 | if ($usemenuhider || empty($leftmenu) || $leftmenu == "holiday") { |
2350 | - $newmenu->add("/holiday/list.php?search_status=1&mainmenu=hrm&leftmenu=holiday", $langs->trans("DraftCP"), 2, $user->hasRight('holiday', 'read'), '', $mainmenu, 'holiday_sm'); |
|
2351 | - $newmenu->add("/holiday/list.php?search_status=2&mainmenu=hrm&leftmenu=holiday", $langs->trans("ToReviewCP"), 2, $user->hasRight('holiday', 'read'), '', $mainmenu, 'holiday_sm'); |
|
2352 | - $newmenu->add("/holiday/list.php?search_status=3&mainmenu=hrm&leftmenu=holiday", $langs->trans("ApprovedCP"), 2, $user->hasRight('holiday', 'read'), '', $mainmenu, 'holiday_sm'); |
|
2353 | - $newmenu->add("/holiday/list.php?search_status=4&mainmenu=hrm&leftmenu=holiday", $langs->trans("CancelCP"), 2, $user->hasRight('holiday', 'read'), '', $mainmenu, 'holiday_sm'); |
|
2354 | - $newmenu->add("/holiday/list.php?search_status=5&mainmenu=hrm&leftmenu=holiday", $langs->trans("RefuseCP"), 2, $user->hasRight('holiday', 'read'), '', $mainmenu, 'holiday_sm'); |
|
2350 | + $newmenu->add("/holiday/list.php?search_status=1&mainmenu=hrm&leftmenu=holiday", $langs->trans("DraftCP"), 2, $user->hasRight('holiday', 'read'), '', $mainmenu, 'holiday_sm'); |
|
2351 | + $newmenu->add("/holiday/list.php?search_status=2&mainmenu=hrm&leftmenu=holiday", $langs->trans("ToReviewCP"), 2, $user->hasRight('holiday', 'read'), '', $mainmenu, 'holiday_sm'); |
|
2352 | + $newmenu->add("/holiday/list.php?search_status=3&mainmenu=hrm&leftmenu=holiday", $langs->trans("ApprovedCP"), 2, $user->hasRight('holiday', 'read'), '', $mainmenu, 'holiday_sm'); |
|
2353 | + $newmenu->add("/holiday/list.php?search_status=4&mainmenu=hrm&leftmenu=holiday", $langs->trans("CancelCP"), 2, $user->hasRight('holiday', 'read'), '', $mainmenu, 'holiday_sm'); |
|
2354 | + $newmenu->add("/holiday/list.php?search_status=5&mainmenu=hrm&leftmenu=holiday", $langs->trans("RefuseCP"), 2, $user->hasRight('holiday', 'read'), '', $mainmenu, 'holiday_sm'); |
|
2355 | 2355 | } |
2356 | - $newmenu->add("/holiday/define_holiday.php?mainmenu=hrm", $langs->trans("MenuConfCP"), 1, $user->hasRight('holiday', 'read'), '', $mainmenu, 'holiday_sm'); |
|
2357 | - $newmenu->add("/holiday/month_report.php?mainmenu=hrm&leftmenu=holiday", $langs->trans("MenuReportMonth"), 1, $user->hasRight('holiday', 'readall'), '', $mainmenu, 'holiday_sm'); |
|
2358 | - $newmenu->add("/holiday/view_log.php?mainmenu=hrm&leftmenu=holiday", $langs->trans("MenuLogCP"), 1, $user->hasRight('holiday', 'define_holiday'), '', $mainmenu, 'holiday_sm'); |
|
2356 | + $newmenu->add("/holiday/define_holiday.php?mainmenu=hrm", $langs->trans("MenuConfCP"), 1, $user->hasRight('holiday', 'read'), '', $mainmenu, 'holiday_sm'); |
|
2357 | + $newmenu->add("/holiday/month_report.php?mainmenu=hrm&leftmenu=holiday", $langs->trans("MenuReportMonth"), 1, $user->hasRight('holiday', 'readall'), '', $mainmenu, 'holiday_sm'); |
|
2358 | + $newmenu->add("/holiday/view_log.php?mainmenu=hrm&leftmenu=holiday", $langs->trans("MenuLogCP"), 1, $user->hasRight('holiday', 'define_holiday'), '', $mainmenu, 'holiday_sm'); |
|
2359 | 2359 | } |
2360 | 2360 | |
2361 | 2361 | // Trips and expenses (old module) |
2362 | 2362 | if (isModEnabled('deplacement')) { |
2363 | 2363 | $langs->load("trips"); |
2364 | - $newmenu->add("/compta/deplacement/index.php?leftmenu=tripsandexpenses&mainmenu=hrm", $langs->trans("TripsAndExpenses"), 0, $user->hasRight('deplacement', 'lire'), '', $mainmenu, 'tripsandexpenses', 0, '', '', '', img_picto('', 'trip', 'class="paddingright pictofixedwidth"')); |
|
2365 | - $newmenu->add("/compta/deplacement/card.php?action=create&leftmenu=tripsandexpenses&mainmenu=hrm", $langs->trans("New"), 1, $user->hasRight('deplacement', 'creer')); |
|
2366 | - $newmenu->add("/compta/deplacement/list.php?leftmenu=tripsandexpenses&mainmenu=hrm", $langs->trans("List"), 1, $user->hasRight('deplacement', 'lire')); |
|
2367 | - $newmenu->add("/compta/deplacement/stats/index.php?leftmenu=tripsandexpenses&mainmenu=hrm", $langs->trans("Statistics"), 1, $user->hasRight('deplacement', 'lire')); |
|
2364 | + $newmenu->add("/compta/deplacement/index.php?leftmenu=tripsandexpenses&mainmenu=hrm", $langs->trans("TripsAndExpenses"), 0, $user->hasRight('deplacement', 'lire'), '', $mainmenu, 'tripsandexpenses', 0, '', '', '', img_picto('', 'trip', 'class="paddingright pictofixedwidth"')); |
|
2365 | + $newmenu->add("/compta/deplacement/card.php?action=create&leftmenu=tripsandexpenses&mainmenu=hrm", $langs->trans("New"), 1, $user->hasRight('deplacement', 'creer')); |
|
2366 | + $newmenu->add("/compta/deplacement/list.php?leftmenu=tripsandexpenses&mainmenu=hrm", $langs->trans("List"), 1, $user->hasRight('deplacement', 'lire')); |
|
2367 | + $newmenu->add("/compta/deplacement/stats/index.php?leftmenu=tripsandexpenses&mainmenu=hrm", $langs->trans("Statistics"), 1, $user->hasRight('deplacement', 'lire')); |
|
2368 | 2368 | } |
2369 | 2369 | |
2370 | 2370 | // Expense report |
2371 | 2371 | if (isModEnabled('expensereport')) { |
2372 | 2372 | $langs->loadLangs(array("trips", "bills")); |
2373 | - $newmenu->add("/expensereport/index.php?leftmenu=expensereport&mainmenu=hrm", $langs->trans("TripsAndExpenses"), 0, $user->hasRight('expensereport', 'lire'), '', $mainmenu, 'expensereport', 0, '', '', '', img_picto('', 'trip', 'class="paddingright pictofixedwidth"')); |
|
2374 | - $newmenu->add("/expensereport/card.php?action=create&leftmenu=expensereport&mainmenu=hrm", $langs->trans("New"), 1, $user->hasRight('expensereport', 'creer')); |
|
2375 | - $newmenu->add("/expensereport/list.php?leftmenu=expensereport&mainmenu=hrm", $langs->trans("List"), 1, $user->hasRight('expensereport', 'lire')); |
|
2373 | + $newmenu->add("/expensereport/index.php?leftmenu=expensereport&mainmenu=hrm", $langs->trans("TripsAndExpenses"), 0, $user->hasRight('expensereport', 'lire'), '', $mainmenu, 'expensereport', 0, '', '', '', img_picto('', 'trip', 'class="paddingright pictofixedwidth"')); |
|
2374 | + $newmenu->add("/expensereport/card.php?action=create&leftmenu=expensereport&mainmenu=hrm", $langs->trans("New"), 1, $user->hasRight('expensereport', 'creer')); |
|
2375 | + $newmenu->add("/expensereport/list.php?leftmenu=expensereport&mainmenu=hrm", $langs->trans("List"), 1, $user->hasRight('expensereport', 'lire')); |
|
2376 | 2376 | if ($usemenuhider || empty($leftmenu) || $leftmenu == "expensereport") { |
2377 | - $newmenu->add("/expensereport/list.php?search_status=0&leftmenu=expensereport&mainmenu=hrm", $langs->trans("Draft"), 2, $user->hasRight('expensereport', 'lire')); |
|
2378 | - $newmenu->add("/expensereport/list.php?search_status=2&leftmenu=expensereport&mainmenu=hrm", $langs->trans("Validated"), 2, $user->hasRight('expensereport', 'lire')); |
|
2379 | - $newmenu->add("/expensereport/list.php?search_status=5&leftmenu=expensereport&mainmenu=hrm", $langs->trans("Approved"), 2, $user->hasRight('expensereport', 'lire')); |
|
2380 | - $newmenu->add("/expensereport/list.php?search_status=6&leftmenu=expensereport&mainmenu=hrm", $langs->trans("Paid"), 2, $user->hasRight('expensereport', 'lire')); |
|
2381 | - $newmenu->add("/expensereport/list.php?search_status=4&leftmenu=expensereport&mainmenu=hrm", $langs->trans("Canceled"), 2, $user->hasRight('expensereport', 'lire')); |
|
2382 | - $newmenu->add("/expensereport/list.php?search_status=99&leftmenu=expensereport&mainmenu=hrm", $langs->trans("Refused"), 2, $user->hasRight('expensereport', 'lire')); |
|
2377 | + $newmenu->add("/expensereport/list.php?search_status=0&leftmenu=expensereport&mainmenu=hrm", $langs->trans("Draft"), 2, $user->hasRight('expensereport', 'lire')); |
|
2378 | + $newmenu->add("/expensereport/list.php?search_status=2&leftmenu=expensereport&mainmenu=hrm", $langs->trans("Validated"), 2, $user->hasRight('expensereport', 'lire')); |
|
2379 | + $newmenu->add("/expensereport/list.php?search_status=5&leftmenu=expensereport&mainmenu=hrm", $langs->trans("Approved"), 2, $user->hasRight('expensereport', 'lire')); |
|
2380 | + $newmenu->add("/expensereport/list.php?search_status=6&leftmenu=expensereport&mainmenu=hrm", $langs->trans("Paid"), 2, $user->hasRight('expensereport', 'lire')); |
|
2381 | + $newmenu->add("/expensereport/list.php?search_status=4&leftmenu=expensereport&mainmenu=hrm", $langs->trans("Canceled"), 2, $user->hasRight('expensereport', 'lire')); |
|
2382 | + $newmenu->add("/expensereport/list.php?search_status=99&leftmenu=expensereport&mainmenu=hrm", $langs->trans("Refused"), 2, $user->hasRight('expensereport', 'lire')); |
|
2383 | 2383 | } |
2384 | - $newmenu->add("/expensereport/payment/list.php?leftmenu=expensereport_payments&mainmenu=hrm", $langs->trans("Payments"), 1, $user->hasRight('expensereport', 'lire')); |
|
2385 | - $newmenu->add("/expensereport/stats/index.php?leftmenu=expensereport&mainmenu=hrm", $langs->trans("Statistics"), 1, $user->hasRight('expensereport', 'lire')); |
|
2384 | + $newmenu->add("/expensereport/payment/list.php?leftmenu=expensereport_payments&mainmenu=hrm", $langs->trans("Payments"), 1, $user->hasRight('expensereport', 'lire')); |
|
2385 | + $newmenu->add("/expensereport/stats/index.php?leftmenu=expensereport&mainmenu=hrm", $langs->trans("Statistics"), 1, $user->hasRight('expensereport', 'lire')); |
|
2386 | 2386 | } |
2387 | 2387 | |
2388 | 2388 | if (isModEnabled('projet')) { |
@@ -2391,7 +2391,7 @@ discard block |
||
2391 | 2391 | |
2392 | 2392 | $search_project_user = GETPOST('search_project_user', 'int'); |
2393 | 2393 | |
2394 | - $newmenu->add("/projet/activity/perweek.php?leftmenu=tasks".($search_project_user ? '&search_project_user='.$search_project_user : ''), $langs->trans("NewTimeSpent"), 0, $user->hasRight('projet', 'lire'), '', $mainmenu, 'timespent', 0, '', '', '', img_picto('', 'timespent', 'class="paddingright pictofixedwidth"')); |
|
2394 | + $newmenu->add("/projet/activity/perweek.php?leftmenu=tasks".($search_project_user ? '&search_project_user='.$search_project_user : ''), $langs->trans("NewTimeSpent"), 0, $user->hasRight('projet', 'lire'), '', $mainmenu, 'timespent', 0, '', '', '', img_picto('', 'timespent', 'class="paddingright pictofixedwidth"')); |
|
2395 | 2395 | } |
2396 | 2396 | } |
2397 | 2397 | } |
@@ -2419,22 +2419,22 @@ discard block |
||
2419 | 2419 | } |
2420 | 2420 | |
2421 | 2421 | if (isModEnabled('mailing')) { |
2422 | - $newmenu->add("/comm/mailing/index.php?leftmenu=mailing", $langs->trans("EMailings"), 0, $user->hasRight('mailing', 'lire'), '', $mainmenu, 'mailing', 0, '', '', '', img_picto('', 'email', 'class="paddingright pictofixedwidth"')); |
|
2423 | - $newmenu->add("/comm/mailing/card.php?leftmenu=mailing&action=create", $langs->trans("NewMailing"), 1, $user->hasRight('mailing', 'creer')); |
|
2424 | - $newmenu->add("/comm/mailing/list.php?leftmenu=mailing", $langs->trans("List"), 1, $user->hasRight('mailing', 'lire')); |
|
2422 | + $newmenu->add("/comm/mailing/index.php?leftmenu=mailing", $langs->trans("EMailings"), 0, $user->hasRight('mailing', 'lire'), '', $mainmenu, 'mailing', 0, '', '', '', img_picto('', 'email', 'class="paddingright pictofixedwidth"')); |
|
2423 | + $newmenu->add("/comm/mailing/card.php?leftmenu=mailing&action=create", $langs->trans("NewMailing"), 1, $user->hasRight('mailing', 'creer')); |
|
2424 | + $newmenu->add("/comm/mailing/list.php?leftmenu=mailing", $langs->trans("List"), 1, $user->hasRight('mailing', 'lire')); |
|
2425 | 2425 | } |
2426 | 2426 | |
2427 | 2427 | if (isModEnabled('export')) { |
2428 | 2428 | $langs->load("exports"); |
2429 | - $newmenu->add("/exports/index.php?leftmenu=export", $langs->trans("FormatedExport"), 0, $user->hasRight('export', 'lire'), '', $mainmenu, 'export', 0, '', '', '', img_picto('', 'technic', 'class="paddingright pictofixedwidth"')); |
|
2430 | - $newmenu->add("/exports/export.php?leftmenu=export", $langs->trans("NewExport"), 1, $user->hasRight('export', 'creer')); |
|
2429 | + $newmenu->add("/exports/index.php?leftmenu=export", $langs->trans("FormatedExport"), 0, $user->hasRight('export', 'lire'), '', $mainmenu, 'export', 0, '', '', '', img_picto('', 'technic', 'class="paddingright pictofixedwidth"')); |
|
2430 | + $newmenu->add("/exports/export.php?leftmenu=export", $langs->trans("NewExport"), 1, $user->hasRight('export', 'creer')); |
|
2431 | 2431 | //$newmenu->add("/exports/export.php?leftmenu=export",$langs->trans("List"),1, $user->hasRight('export', 'lire')); |
2432 | 2432 | } |
2433 | 2433 | |
2434 | 2434 | if (isModEnabled('import')) { |
2435 | 2435 | $langs->load("exports"); |
2436 | - $newmenu->add("/imports/index.php?leftmenu=import", $langs->trans("FormatedImport"), 0, $user->hasRight('import', 'run'), '', $mainmenu, 'import', 0, '', '', '', img_picto('', 'technic', 'class="paddingright pictofixedwidth"')); |
|
2437 | - $newmenu->add("/imports/import.php?leftmenu=import", $langs->trans("NewImport"), 1, $user->hasRight('import', 'run')); |
|
2436 | + $newmenu->add("/imports/index.php?leftmenu=import", $langs->trans("FormatedImport"), 0, $user->hasRight('import', 'run'), '', $mainmenu, 'import', 0, '', '', '', img_picto('', 'technic', 'class="paddingright pictofixedwidth"')); |
|
2437 | + $newmenu->add("/imports/import.php?leftmenu=import", $langs->trans("NewImport"), 1, $user->hasRight('import', 'run')); |
|
2438 | 2438 | } |
2439 | 2439 | } |
2440 | 2440 | } |
@@ -2472,7 +2472,7 @@ discard block |
||
2472 | 2472 | |
2473 | 2473 | $newmenu->add("/adherents/cartes/carte.php?leftmenu=export", $langs->trans("MembersCards"), 1, $user->hasRight('adherent', 'export')); |
2474 | 2474 | if (!empty($conf->global->MEMBER_LINK_TO_HTPASSWDFILE) && ($usemenuhider || empty($leftmenu) || $leftmenu == 'none' || $leftmenu == "members" || $leftmenu == "export")) { |
2475 | - $newmenu->add("/adherents/htpasswd.php?leftmenu=export", $langs->trans("Filehtpasswd"), 1, $user->hasRight('adherent', 'export')); |
|
2475 | + $newmenu->add("/adherents/htpasswd.php?leftmenu=export", $langs->trans("Filehtpasswd"), 1, $user->hasRight('adherent', 'export')); |
|
2476 | 2476 | } |
2477 | 2477 | |
2478 | 2478 | if (isModEnabled('categorie')) { |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | if (!empty($conf->global->MAIN_USE_JQUERY_JEDITABLE) && !preg_match('/^select;/', $typeofdata)) { |
120 | 120 | if (!empty($perm)) { |
121 | 121 | $tmp = explode(':', $typeofdata); |
122 | - $ret .= '<div class="editkey_' . $tmp[0] . (!empty($tmp[1]) ? ' ' . $tmp[1] : '') . '" id="' . $htmlname . '">'; |
|
122 | + $ret .= '<div class="editkey_'.$tmp[0].(!empty($tmp[1]) ? ' '.$tmp[1] : '').'" id="'.$htmlname.'">'; |
|
123 | 123 | if ($fieldrequired) { |
124 | 124 | $ret .= '<span class="fieldrequired">'; |
125 | 125 | } |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | if ($fieldrequired) { |
132 | 132 | $ret .= '</span>'; |
133 | 133 | } |
134 | - $ret .= '</div>' . "\n"; |
|
134 | + $ret .= '</div>'."\n"; |
|
135 | 135 | } else { |
136 | 136 | if ($fieldrequired) { |
137 | 137 | $ret .= '<span class="fieldrequired">'; |
@@ -169,8 +169,8 @@ discard block |
||
169 | 169 | if (empty($notabletag) && $perm) { |
170 | 170 | $ret .= '<td class="right">'; |
171 | 171 | } |
172 | - if ($htmlname && GETPOST('action', 'aZ09') != 'edit' . $htmlname && $perm) { |
|
173 | - $ret .= '<a class="editfielda reposition" href="' . $_SERVER["PHP_SELF"] . '?action=edit' . $htmlname . '&token=' . newToken() . '&' . $paramid . '=' . $object->id . $moreparam . '">' . img_edit($langs->trans('Edit'), ($notabletag ? 0 : 1)) . '</a>'; |
|
172 | + if ($htmlname && GETPOST('action', 'aZ09') != 'edit'.$htmlname && $perm) { |
|
173 | + $ret .= '<a class="editfielda reposition" href="'.$_SERVER["PHP_SELF"].'?action=edit'.$htmlname.'&token='.newToken().'&'.$paramid.'='.$object->id.$moreparam.'">'.img_edit($langs->trans('Edit'), ($notabletag ? 0 : 1)).'</a>'; |
|
174 | 174 | } |
175 | 175 | if (!empty($notabletag) && $notabletag == 1) { |
176 | 176 | if ($text) { |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | } elseif ($reg[1] == 'int') { |
238 | 238 | $typeofdata = 'numeric'; |
239 | 239 | } else { |
240 | - return 'ErrorBadParameter ' . $typeofdata; |
|
240 | + return 'ErrorBadParameter '.$typeofdata; |
|
241 | 241 | } |
242 | 242 | } |
243 | 243 | |
@@ -248,13 +248,13 @@ discard block |
||
248 | 248 | if ($editaction == '') { |
249 | 249 | $editaction = GETPOST('action', 'aZ09'); |
250 | 250 | } |
251 | - $editmode = ($editaction == 'edit' . $htmlname); |
|
251 | + $editmode = ($editaction == 'edit'.$htmlname); |
|
252 | 252 | if ($editmode) { // edit mode |
253 | 253 | $ret .= "\n"; |
254 | - $ret .= '<form method="post" action="' . $_SERVER["PHP_SELF"] . ($moreparam ? '?' . $moreparam : '') . '">'; |
|
255 | - $ret .= '<input type="hidden" name="action" value="set' . $htmlname . '">'; |
|
256 | - $ret .= '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
257 | - $ret .= '<input type="hidden" name="' . $paramid . '" value="' . $object->id . '">'; |
|
254 | + $ret .= '<form method="post" action="'.$_SERVER["PHP_SELF"].($moreparam ? '?'.$moreparam : '').'">'; |
|
255 | + $ret .= '<input type="hidden" name="action" value="set'.$htmlname.'">'; |
|
256 | + $ret .= '<input type="hidden" name="token" value="'.newToken().'">'; |
|
257 | + $ret .= '<input type="hidden" name="'.$paramid.'" value="'.$object->id.'">'; |
|
258 | 258 | if (empty($notabletag)) { |
259 | 259 | $ret .= '<table class="nobordernopadding centpercent">'; |
260 | 260 | } |
@@ -263,28 +263,28 @@ discard block |
||
263 | 263 | } |
264 | 264 | if (preg_match('/^(string|safehtmlstring|email|phone|url)/', $typeofdata)) { |
265 | 265 | $tmp = explode(':', $typeofdata); |
266 | - $ret .= '<input type="text" id="' . $htmlname . '" name="' . $htmlname . '" value="' . ($editvalue ? $editvalue : $value) . '"' . (empty($tmp[1]) ? '' : ' size="' . $tmp[1] . '"') . ' autofocus>'; |
|
266 | + $ret .= '<input type="text" id="'.$htmlname.'" name="'.$htmlname.'" value="'.($editvalue ? $editvalue : $value).'"'.(empty($tmp[1]) ? '' : ' size="'.$tmp[1].'"').' autofocus>'; |
|
267 | 267 | } elseif (preg_match('/^(integer)/', $typeofdata)) { |
268 | 268 | $tmp = explode(':', $typeofdata); |
269 | 269 | $valuetoshow = price2num($editvalue ? $editvalue : $value, 0); |
270 | - $ret .= '<input type="text" id="' . $htmlname . '" name="' . $htmlname . '" value="' . $valuetoshow . '"' . (empty($tmp[1]) ? '' : ' size="' . $tmp[1] . '"') . ' autofocus>'; |
|
270 | + $ret .= '<input type="text" id="'.$htmlname.'" name="'.$htmlname.'" value="'.$valuetoshow.'"'.(empty($tmp[1]) ? '' : ' size="'.$tmp[1].'"').' autofocus>'; |
|
271 | 271 | } elseif (preg_match('/^(numeric|amount)/', $typeofdata)) { |
272 | 272 | $tmp = explode(':', $typeofdata); |
273 | 273 | $valuetoshow = price2num($editvalue ? $editvalue : $value); |
274 | - $ret .= '<input type="text" id="' . $htmlname . '" name="' . $htmlname . '" value="' . ($valuetoshow != '' ? price($valuetoshow) : '') . '"' . (empty($tmp[1]) ? '' : ' size="' . $tmp[1] . '"') . ' autofocus>'; |
|
274 | + $ret .= '<input type="text" id="'.$htmlname.'" name="'.$htmlname.'" value="'.($valuetoshow != '' ? price($valuetoshow) : '').'"'.(empty($tmp[1]) ? '' : ' size="'.$tmp[1].'"').' autofocus>'; |
|
275 | 275 | } elseif (preg_match('/^(checkbox)/', $typeofdata)) { |
276 | 276 | $tmp = explode(':', $typeofdata); |
277 | - $ret .= '<input type="checkbox" id="' . $htmlname . '" name="' . $htmlname . '" value="' . ($value ? $value : 'on') . '"' . ($value ? ' checked' : '') . (empty($tmp[1]) ? '' : $tmp[1]) . '/>'; |
|
277 | + $ret .= '<input type="checkbox" id="'.$htmlname.'" name="'.$htmlname.'" value="'.($value ? $value : 'on').'"'.($value ? ' checked' : '').(empty($tmp[1]) ? '' : $tmp[1]).'/>'; |
|
278 | 278 | } elseif (preg_match('/^text/', $typeofdata) || preg_match('/^note/', $typeofdata)) { // if wysiwyg is enabled $typeofdata = 'ckeditor' |
279 | 279 | $tmp = explode(':', $typeofdata); |
280 | 280 | $cols = (empty($tmp[2]) ? '' : $tmp[2]); |
281 | 281 | $morealt = ''; |
282 | 282 | if (preg_match('/%/', $cols)) { |
283 | - $morealt = ' style="width: ' . $cols . '"'; |
|
283 | + $morealt = ' style="width: '.$cols.'"'; |
|
284 | 284 | $cols = ''; |
285 | 285 | } |
286 | 286 | $valuetoshow = ($editvalue ? $editvalue : $value); |
287 | - $ret .= '<textarea id="' . $htmlname . '" name="' . $htmlname . '" wrap="soft" rows="' . (empty($tmp[1]) ? '20' : $tmp[1]) . '"' . ($cols ? ' cols="' . $cols . '"' : 'class="quatrevingtpercent"') . $morealt . '" autofocus>'; |
|
287 | + $ret .= '<textarea id="'.$htmlname.'" name="'.$htmlname.'" wrap="soft" rows="'.(empty($tmp[1]) ? '20' : $tmp[1]).'"'.($cols ? ' cols="'.$cols.'"' : 'class="quatrevingtpercent"').$morealt.'" autofocus>'; |
|
288 | 288 | // textarea convert automatically entities chars into simple chars. |
289 | 289 | // So we convert & into & so a string like 'a < <b>b</b><br>é<br><script>alert('X');<script>' stay a correct html and is not converted by textarea component when wysiwig is off. |
290 | 290 | $valuetoshow = str_replace('&', '&', $valuetoshow); |
@@ -294,12 +294,12 @@ discard block |
||
294 | 294 | $addnowlink = empty($moreoptions['addnowlink']) ? 0 : $moreoptions['addnowlink']; |
295 | 295 | $adddateof = empty($moreoptions['adddateof']) ? '' : $moreoptions['adddateof']; |
296 | 296 | $labeladddateof = empty($moreoptions['labeladddateof']) ? '' : $moreoptions['labeladddateof']; |
297 | - $ret .= $this->selectDate($value, $htmlname, 0, 0, 1, 'form' . $htmlname, 1, $addnowlink, 0, '', '', $adddateof, '', 1, $labeladddateof, '', $gm); |
|
297 | + $ret .= $this->selectDate($value, $htmlname, 0, 0, 1, 'form'.$htmlname, 1, $addnowlink, 0, '', '', $adddateof, '', 1, $labeladddateof, '', $gm); |
|
298 | 298 | } elseif ($typeofdata == 'dayhour' || $typeofdata == 'datehourpicker') { |
299 | 299 | $addnowlink = empty($moreoptions['addnowlink']) ? 0 : $moreoptions['addnowlink']; |
300 | 300 | $adddateof = empty($moreoptions['adddateof']) ? '' : $moreoptions['adddateof']; |
301 | 301 | $labeladddateof = empty($moreoptions['labeladddateof']) ? '' : $moreoptions['labeladddateof']; |
302 | - $ret .= $this->selectDate($value, $htmlname, 1, 1, 1, 'form' . $htmlname, 1, $addnowlink, 0, '', '', $adddateof, '', 1, $labeladddateof, '', $gm); |
|
302 | + $ret .= $this->selectDate($value, $htmlname, 1, 1, 1, 'form'.$htmlname, 1, $addnowlink, 0, '', '', $adddateof, '', 1, $labeladddateof, '', $gm); |
|
303 | 303 | } elseif (preg_match('/^select;/', $typeofdata)) { |
304 | 304 | $arraydata = explode(',', preg_replace('/^select;/', '', $typeofdata)); |
305 | 305 | $arraylist = array(); |
@@ -313,7 +313,7 @@ discard block |
||
313 | 313 | // TODO Not yet implemented. See code for extrafields |
314 | 314 | } elseif (preg_match('/^ckeditor/', $typeofdata)) { |
315 | 315 | $tmp = explode(':', $typeofdata); // Example: ckeditor:dolibarr_zzz:width:height:savemethod:toolbarstartexpanded:rows:cols:uselocalbrowser |
316 | - require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php'; |
|
316 | + require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; |
|
317 | 317 | $doleditor = new DolEditor($htmlname, ($editvalue ? $editvalue : $value), (empty($tmp[2]) ? '' : $tmp[2]), (empty($tmp[3]) ? '100' : $tmp[3]), (empty($tmp[1]) ? 'dolibarr_notes' : $tmp[1]), 'In', (empty($tmp[5]) ? 0 : $tmp[5]), (isset($tmp[8]) ? ($tmp[8] ? true : false) : true), true, (empty($tmp[6]) ? '20' : $tmp[6]), (empty($tmp[7]) ? '100' : $tmp[7])); |
318 | 318 | $ret .= $doleditor->Create(1); |
319 | 319 | } elseif ($typeofdata == 'asis') { |
@@ -328,19 +328,19 @@ discard block |
||
328 | 328 | $ret .= '<td>'; |
329 | 329 | } |
330 | 330 | //else $ret.='<div class="clearboth"></div>'; |
331 | - $ret .= '<input type="submit" class="smallpaddingimp button' . (empty($notabletag) ? '' : ' ') . '" name="modify" value="' . $langs->trans("Modify") . '">'; |
|
331 | + $ret .= '<input type="submit" class="smallpaddingimp button'.(empty($notabletag) ? '' : ' ').'" name="modify" value="'.$langs->trans("Modify").'">'; |
|
332 | 332 | if (preg_match('/ckeditor|textarea/', $typeofdata) && empty($notabletag)) { |
333 | - $ret .= '<br>' . "\n"; |
|
333 | + $ret .= '<br>'."\n"; |
|
334 | 334 | } |
335 | - $ret .= '<input type="submit" class="smallpaddingimp button button-cancel' . (empty($notabletag) ? '' : ' ') . '" name="cancel" value="' . $langs->trans("Cancel") . '">'; |
|
335 | + $ret .= '<input type="submit" class="smallpaddingimp button button-cancel'.(empty($notabletag) ? '' : ' ').'" name="cancel" value="'.$langs->trans("Cancel").'">'; |
|
336 | 336 | if (empty($notabletag)) { |
337 | 337 | $ret .= '</td>'; |
338 | 338 | } |
339 | 339 | |
340 | 340 | if (empty($notabletag)) { |
341 | - $ret .= '</tr></table>' . "\n"; |
|
341 | + $ret .= '</tr></table>'."\n"; |
|
342 | 342 | } |
343 | - $ret .= '</form>' . "\n"; |
|
343 | + $ret .= '</form>'."\n"; |
|
344 | 344 | } else { // view mode |
345 | 345 | if (preg_match('/^email/', $typeofdata)) { |
346 | 346 | $ret .= dol_print_email($value, 0, 0, 0, 0, 1); |
@@ -352,15 +352,15 @@ discard block |
||
352 | 352 | $ret .= ($value != '' ? price($value, '', $langs, 0, -1, -1, $conf->currency) : ''); |
353 | 353 | } elseif (preg_match('/^checkbox/', $typeofdata)) { |
354 | 354 | $tmp = explode(':', $typeofdata); |
355 | - $ret .= '<input type="checkbox" disabled id="' . $htmlname . '" name="' . $htmlname . '" value="' . $value . '"' . ($value ? ' checked' : '') . ($tmp[1] ? $tmp[1] : '') . '/>'; |
|
355 | + $ret .= '<input type="checkbox" disabled id="'.$htmlname.'" name="'.$htmlname.'" value="'.$value.'"'.($value ? ' checked' : '').($tmp[1] ? $tmp[1] : '').'/>'; |
|
356 | 356 | } elseif (preg_match('/^text/', $typeofdata) || preg_match('/^note/', $typeofdata)) { |
357 | 357 | $ret .= dol_htmlwithnojs(dol_string_onlythesehtmltags(dol_htmlentitiesbr($value), 1, 1, 1)); |
358 | 358 | } elseif (preg_match('/^(safehtmlstring|restricthtml)/', $typeofdata)) { // 'restricthtml' is not an allowed type for editfieldval. Value is 'safehtmlstring' |
359 | 359 | $ret .= dol_htmlwithnojs(dol_string_onlythesehtmltags($value)); |
360 | 360 | } elseif ($typeofdata == 'day' || $typeofdata == 'datepicker') { |
361 | - $ret .= '<span class="valuedate">' . dol_print_date($value, 'day', $gm) . '</span>'; |
|
361 | + $ret .= '<span class="valuedate">'.dol_print_date($value, 'day', $gm).'</span>'; |
|
362 | 362 | } elseif ($typeofdata == 'dayhour' || $typeofdata == 'datehourpicker') { |
363 | - $ret .= '<span class="valuedate">' . dol_print_date($value, 'dayhour', $gm) . '</span>'; |
|
363 | + $ret .= '<span class="valuedate">'.dol_print_date($value, 'dayhour', $gm).'</span>'; |
|
364 | 364 | } elseif (preg_match('/^select;/', $typeofdata)) { |
365 | 365 | $arraydata = explode(',', preg_replace('/^select;/', '', $typeofdata)); |
366 | 366 | $arraylist = array(); |
@@ -371,9 +371,9 @@ discard block |
||
371 | 371 | $ret .= $arraylist[$value]; |
372 | 372 | if ($htmlname == 'fk_product_type') { |
373 | 373 | if ($value == 0) { |
374 | - $ret = img_picto($langs->trans("Product"), 'product', 'class="paddingleftonly paddingrightonly colorgrey"') . $ret; |
|
374 | + $ret = img_picto($langs->trans("Product"), 'product', 'class="paddingleftonly paddingrightonly colorgrey"').$ret; |
|
375 | 375 | } else { |
376 | - $ret = img_picto($langs->trans("Service"), 'service', 'class="paddingleftonly paddingrightonly colorgrey"') . $ret; |
|
376 | + $ret = img_picto($langs->trans("Service"), 'service', 'class="paddingleftonly paddingrightonly colorgrey"').$ret; |
|
377 | 377 | } |
378 | 378 | } |
379 | 379 | } elseif (preg_match('/^ckeditor/', $typeofdata)) { |
@@ -381,7 +381,7 @@ discard block |
||
381 | 381 | if (!empty($conf->global->MAIN_DISABLE_NOTES_TAB)) { |
382 | 382 | $firstline = preg_replace('/<br>.*/', '', $tmpcontent); |
383 | 383 | $firstline = preg_replace('/[\n\r].*/', '', $firstline); |
384 | - $tmpcontent = $firstline . ((strlen($firstline) != strlen($tmpcontent)) ? '...' : ''); |
|
384 | + $tmpcontent = $firstline.((strlen($firstline) != strlen($tmpcontent)) ? '...' : ''); |
|
385 | 385 | } |
386 | 386 | // We dont use dol_escape_htmltag to get the html formating active, but this need we must also |
387 | 387 | // clean data from some dangerous html |
@@ -390,7 +390,7 @@ discard block |
||
390 | 390 | if (empty($moreoptions['valuealreadyhtmlescaped'])) { |
391 | 391 | $ret .= dol_escape_htmltag($value); |
392 | 392 | } else { |
393 | - $ret .= $value; // $value must be already html escaped. |
|
393 | + $ret .= $value; // $value must be already html escaped. |
|
394 | 394 | } |
395 | 395 | } |
396 | 396 | |
@@ -428,7 +428,7 @@ discard block |
||
428 | 428 | |
429 | 429 | if (is_array($arrayoflangcode) && count($arrayoflangcode)) { |
430 | 430 | if (!is_object($extralanguages)) { |
431 | - include_once DOL_DOCUMENT_ROOT . '/core/class/extralanguages.class.php'; |
|
431 | + include_once DOL_DOCUMENT_ROOT.'/core/class/extralanguages.class.php'; |
|
432 | 432 | $extralanguages = new ExtraLanguages($this->db); |
433 | 433 | } |
434 | 434 | $extralanguages->fetch_name_extralanguages('societe'); |
@@ -437,17 +437,17 @@ discard block |
||
437 | 437 | return ''; // No extralang field to show |
438 | 438 | } |
439 | 439 | |
440 | - $result .= '<!-- Widget for translation -->' . "\n"; |
|
441 | - $result .= '<div class="inline-block paddingleft image-' . $object->element . '-' . $fieldname . '">'; |
|
440 | + $result .= '<!-- Widget for translation -->'."\n"; |
|
441 | + $result .= '<div class="inline-block paddingleft image-'.$object->element.'-'.$fieldname.'">'; |
|
442 | 442 | $s = img_picto($langs->trans("ShowOtherLanguages"), 'language', '', false, 0, 0, '', 'fa-15 editfieldlang'); |
443 | 443 | $result .= $s; |
444 | 444 | $result .= '</div>'; |
445 | 445 | |
446 | - $result .= '<div class="inline-block hidden field-' . $object->element . '-' . $fieldname . '">'; |
|
446 | + $result .= '<div class="inline-block hidden field-'.$object->element.'-'.$fieldname.'">'; |
|
447 | 447 | |
448 | 448 | $resultforextrlang = ''; |
449 | 449 | foreach ($arrayoflangcode as $langcode) { |
450 | - $valuetoshow = GETPOSTISSET('field-' . $object->element . "-" . $fieldname . "-" . $langcode) ? GETPOST('field-' . $object->element . '-' . $fieldname . "-" . $langcode, $check) : ''; |
|
450 | + $valuetoshow = GETPOSTISSET('field-'.$object->element."-".$fieldname."-".$langcode) ? GETPOST('field-'.$object->element.'-'.$fieldname."-".$langcode, $check) : ''; |
|
451 | 451 | if (empty($valuetoshow)) { |
452 | 452 | $object->fetchValuesForExtraLanguages(); |
453 | 453 | //var_dump($object->array_languages); |
@@ -459,17 +459,17 @@ discard block |
||
459 | 459 | |
460 | 460 | // TODO Use the showInputField() method of ExtraLanguages object |
461 | 461 | if ($typeofdata == 'textarea') { |
462 | - $resultforextrlang .= '<textarea name="field-' . $object->element . "-" . $fieldname . "-" . $langcode . '" id="' . $fieldname . "-" . $langcode . '" class="' . $morecss . '" rows="' . ROWS_2 . '" wrap="soft">'; |
|
462 | + $resultforextrlang .= '<textarea name="field-'.$object->element."-".$fieldname."-".$langcode.'" id="'.$fieldname."-".$langcode.'" class="'.$morecss.'" rows="'.ROWS_2.'" wrap="soft">'; |
|
463 | 463 | $resultforextrlang .= $valuetoshow; |
464 | 464 | $resultforextrlang .= '</textarea>'; |
465 | 465 | } else { |
466 | - $resultforextrlang .= '<input type="text" class="inputfieldforlang ' . ($morecss ? ' ' . $morecss : '') . '" name="field-' . $object->element . '-' . $fieldname . '-' . $langcode . '" value="' . $valuetoshow . '">'; |
|
466 | + $resultforextrlang .= '<input type="text" class="inputfieldforlang '.($morecss ? ' '.$morecss : '').'" name="field-'.$object->element.'-'.$fieldname.'-'.$langcode.'" value="'.$valuetoshow.'">'; |
|
467 | 467 | } |
468 | 468 | } |
469 | 469 | $result .= $resultforextrlang; |
470 | 470 | |
471 | 471 | $result .= '</div>'; |
472 | - $result .= '<script nonce="' . getNonce() . '">$(".image-' . $object->element . '-' . $fieldname . '").click(function() { console.log("Toggle lang widget"); jQuery(".field-' . $object->element . '-' . $fieldname . '").toggle(); });</script>'; |
|
472 | + $result .= '<script nonce="'.getNonce().'">$(".image-'.$object->element.'-'.$fieldname.'").click(function() { console.log("Toggle lang widget"); jQuery(".field-'.$object->element.'-'.$fieldname.'").toggle(); });</script>'; |
|
473 | 473 | } |
474 | 474 | |
475 | 475 | return $result; |
@@ -534,7 +534,7 @@ discard block |
||
534 | 534 | if (!empty($tmp[2])) { |
535 | 535 | $savemethod = $tmp[2]; |
536 | 536 | } |
537 | - $out .= '<input id="width_' . $htmlname . '" value="' . $inputOption . '" type="hidden"/>' . "\n"; |
|
537 | + $out .= '<input id="width_'.$htmlname.'" value="'.$inputOption.'" type="hidden"/>'."\n"; |
|
538 | 538 | } elseif ((preg_match('/^day$/', $inputType)) || (preg_match('/^datepicker/', $inputType)) || (preg_match('/^datehourpicker/', $inputType))) { |
539 | 539 | $tmp = explode(':', $inputType); |
540 | 540 | $inputType = $tmp[0]; |
@@ -545,7 +545,7 @@ discard block |
||
545 | 545 | $savemethod = $tmp[2]; |
546 | 546 | } |
547 | 547 | |
548 | - $out .= '<input id="timestamp" type="hidden"/>' . "\n"; // Use for timestamp format |
|
548 | + $out .= '<input id="timestamp" type="hidden"/>'."\n"; // Use for timestamp format |
|
549 | 549 | } elseif (preg_match('/^(select|autocomplete)/', $inputType)) { |
550 | 550 | $tmp = explode(':', $inputType); |
551 | 551 | $inputType = $tmp[0]; |
@@ -576,40 +576,40 @@ discard block |
||
576 | 576 | } |
577 | 577 | |
578 | 578 | if (isModEnabled('fckeditor')) { |
579 | - $out .= '<input id="ckeditor_toolbar" value="' . $toolbar . '" type="hidden"/>' . "\n"; |
|
579 | + $out .= '<input id="ckeditor_toolbar" value="'.$toolbar.'" type="hidden"/>'."\n"; |
|
580 | 580 | } else { |
581 | 581 | $inputType = 'textarea'; |
582 | 582 | } |
583 | 583 | } |
584 | 584 | |
585 | - $out .= '<input id="element_' . $htmlname . '" value="' . $element . '" type="hidden"/>' . "\n"; |
|
586 | - $out .= '<input id="table_element_' . $htmlname . '" value="' . $table_element . '" type="hidden"/>' . "\n"; |
|
587 | - $out .= '<input id="fk_element_' . $htmlname . '" value="' . $fk_element . '" type="hidden"/>' . "\n"; |
|
588 | - $out .= '<input id="loadmethod_' . $htmlname . '" value="' . $loadmethod . '" type="hidden"/>' . "\n"; |
|
585 | + $out .= '<input id="element_'.$htmlname.'" value="'.$element.'" type="hidden"/>'."\n"; |
|
586 | + $out .= '<input id="table_element_'.$htmlname.'" value="'.$table_element.'" type="hidden"/>'."\n"; |
|
587 | + $out .= '<input id="fk_element_'.$htmlname.'" value="'.$fk_element.'" type="hidden"/>'."\n"; |
|
588 | + $out .= '<input id="loadmethod_'.$htmlname.'" value="'.$loadmethod.'" type="hidden"/>'."\n"; |
|
589 | 589 | if (!empty($savemethod)) { |
590 | - $out .= '<input id="savemethod_' . $htmlname . '" value="' . $savemethod . '" type="hidden"/>' . "\n"; |
|
590 | + $out .= '<input id="savemethod_'.$htmlname.'" value="'.$savemethod.'" type="hidden"/>'."\n"; |
|
591 | 591 | } |
592 | 592 | if (!empty($ext_element)) { |
593 | - $out .= '<input id="ext_element_' . $htmlname . '" value="' . $ext_element . '" type="hidden"/>' . "\n"; |
|
593 | + $out .= '<input id="ext_element_'.$htmlname.'" value="'.$ext_element.'" type="hidden"/>'."\n"; |
|
594 | 594 | } |
595 | 595 | if (!empty($custommsg)) { |
596 | 596 | if (is_array($custommsg)) { |
597 | 597 | if (!empty($custommsg['success'])) { |
598 | - $out .= '<input id="successmsg_' . $htmlname . '" value="' . $custommsg['success'] . '" type="hidden"/>' . "\n"; |
|
598 | + $out .= '<input id="successmsg_'.$htmlname.'" value="'.$custommsg['success'].'" type="hidden"/>'."\n"; |
|
599 | 599 | } |
600 | 600 | if (!empty($custommsg['error'])) { |
601 | - $out .= '<input id="errormsg_' . $htmlname . '" value="' . $custommsg['error'] . '" type="hidden"/>' . "\n"; |
|
601 | + $out .= '<input id="errormsg_'.$htmlname.'" value="'.$custommsg['error'].'" type="hidden"/>'."\n"; |
|
602 | 602 | } |
603 | 603 | } else { |
604 | - $out .= '<input id="successmsg_' . $htmlname . '" value="' . $custommsg . '" type="hidden"/>' . "\n"; |
|
604 | + $out .= '<input id="successmsg_'.$htmlname.'" value="'.$custommsg.'" type="hidden"/>'."\n"; |
|
605 | 605 | } |
606 | 606 | } |
607 | 607 | if ($inputType == 'textarea') { |
608 | - $out .= '<input id="textarea_' . $htmlname . '_rows" value="' . $rows . '" type="hidden"/>' . "\n"; |
|
609 | - $out .= '<input id="textarea_' . $htmlname . '_cols" value="' . $cols . '" type="hidden"/>' . "\n"; |
|
608 | + $out .= '<input id="textarea_'.$htmlname.'_rows" value="'.$rows.'" type="hidden"/>'."\n"; |
|
609 | + $out .= '<input id="textarea_'.$htmlname.'_cols" value="'.$cols.'" type="hidden"/>'."\n"; |
|
610 | 610 | } |
611 | - $out .= '<span id="viewval_' . $htmlname . '" class="viewval_' . $inputType . ($button_only ? ' inactive' : ' active') . '">' . $value . '</span>' . "\n"; |
|
612 | - $out .= '<span id="editval_' . $htmlname . '" class="editval_' . $inputType . ($button_only ? ' inactive' : ' active') . ' hideobject">' . (!empty($editvalue) ? $editvalue : $value) . '</span>' . "\n"; |
|
611 | + $out .= '<span id="viewval_'.$htmlname.'" class="viewval_'.$inputType.($button_only ? ' inactive' : ' active').'">'.$value.'</span>'."\n"; |
|
612 | + $out .= '<span id="editval_'.$htmlname.'" class="editval_'.$inputType.($button_only ? ' inactive' : ' active').' hideobject">'.(!empty($editvalue) ? $editvalue : $value).'</span>'."\n"; |
|
613 | 613 | } else { |
614 | 614 | $out = $value; |
615 | 615 | } |
@@ -638,12 +638,12 @@ discard block |
||
638 | 638 | public function textwithtooltip($text, $htmltext, $tooltipon = 1, $direction = 0, $img = '', $extracss = '', $notabs = 3, $incbefore = '', $noencodehtmltext = 0, $tooltiptrigger = '', $forcenowrap = 0) |
639 | 639 | { |
640 | 640 | if ($incbefore) { |
641 | - $text = $incbefore . $text; |
|
641 | + $text = $incbefore.$text; |
|
642 | 642 | } |
643 | 643 | if (!$htmltext) { |
644 | 644 | return $text; |
645 | 645 | } |
646 | - $direction = (int) $direction; // For backward compatibility when $direction was set to '' instead of 0 |
|
646 | + $direction = (int) $direction; // For backward compatibility when $direction was set to '' instead of 0 |
|
647 | 647 | |
648 | 648 | $tag = 'td'; |
649 | 649 | if ($notabs == 2) { |
@@ -657,11 +657,11 @@ discard block |
||
657 | 657 | |
658 | 658 | $extrastyle = ''; |
659 | 659 | if ($direction < 0) { |
660 | - $extracss = ($extracss ? $extracss . ' ' : '') . ($notabs != 3 ? 'inline-block' : ''); |
|
660 | + $extracss = ($extracss ? $extracss.' ' : '').($notabs != 3 ? 'inline-block' : ''); |
|
661 | 661 | $extrastyle = 'padding: 0px; padding-left: 3px;'; |
662 | 662 | } |
663 | 663 | if ($direction > 0) { |
664 | - $extracss = ($extracss ? $extracss . ' ' : '') . ($notabs != 3 ? 'inline-block' : ''); |
|
664 | + $extracss = ($extracss ? $extracss.' ' : '').($notabs != 3 ? 'inline-block' : ''); |
|
665 | 665 | $extrastyle = 'padding: 0px; padding-right: 3px;'; |
666 | 666 | } |
667 | 667 | |
@@ -674,53 +674,53 @@ discard block |
||
674 | 674 | $htmltext = str_replace('"', '"', $htmltext); |
675 | 675 | } else { |
676 | 676 | $classfortooltip = 'classfortooltiponclick'; |
677 | - $textfordialog .= '<div style="display: none;" id="idfortooltiponclick_' . $tooltiptrigger . '" class="classfortooltiponclicktext">' . $htmltext . '</div>'; |
|
677 | + $textfordialog .= '<div style="display: none;" id="idfortooltiponclick_'.$tooltiptrigger.'" class="classfortooltiponclicktext">'.$htmltext.'</div>'; |
|
678 | 678 | } |
679 | 679 | if ($tooltipon == 2 || $tooltipon == 3) { |
680 | - $paramfortooltipimg = ' class="' . $classfortooltip . ($notabs != 3 ? ' inline-block' : '') . ($extracss ? ' ' . $extracss : '') . '" style="padding: 0px;' . ($extrastyle ? ' ' . $extrastyle : '') . '"'; |
|
680 | + $paramfortooltipimg = ' class="'.$classfortooltip.($notabs != 3 ? ' inline-block' : '').($extracss ? ' '.$extracss : '').'" style="padding: 0px;'.($extrastyle ? ' '.$extrastyle : '').'"'; |
|
681 | 681 | if ($tooltiptrigger == '') { |
682 | - $paramfortooltipimg .= ' title="' . ($noencodehtmltext ? $htmltext : dol_escape_htmltag($htmltext, 1)) . '"'; // Attribut to put on img tag to store tooltip |
|
682 | + $paramfortooltipimg .= ' title="'.($noencodehtmltext ? $htmltext : dol_escape_htmltag($htmltext, 1)).'"'; // Attribut to put on img tag to store tooltip |
|
683 | 683 | } else { |
684 | - $paramfortooltipimg .= ' dolid="' . $tooltiptrigger . '"'; |
|
684 | + $paramfortooltipimg .= ' dolid="'.$tooltiptrigger.'"'; |
|
685 | 685 | } |
686 | 686 | } else { |
687 | - $paramfortooltipimg = ($extracss ? ' class="' . $extracss . '"' : '') . ($extrastyle ? ' style="' . $extrastyle . '"' : ''); // Attribut to put on td text tag |
|
687 | + $paramfortooltipimg = ($extracss ? ' class="'.$extracss.'"' : '').($extrastyle ? ' style="'.$extrastyle.'"' : ''); // Attribut to put on td text tag |
|
688 | 688 | } |
689 | 689 | if ($tooltipon == 1 || $tooltipon == 3) { |
690 | - $paramfortooltiptd = ' class="' . ($tooltipon == 3 ? 'cursorpointer ' : '') . $classfortooltip . ' inline-block' . ($extracss ? ' ' . $extracss : '') . '" style="padding: 0px;' . ($extrastyle ? ' ' . $extrastyle : '') . '" '; |
|
690 | + $paramfortooltiptd = ' class="'.($tooltipon == 3 ? 'cursorpointer ' : '').$classfortooltip.' inline-block'.($extracss ? ' '.$extracss : '').'" style="padding: 0px;'.($extrastyle ? ' '.$extrastyle : '').'" '; |
|
691 | 691 | if ($tooltiptrigger == '') { |
692 | - $paramfortooltiptd .= ' title="' . ($noencodehtmltext ? $htmltext : dol_escape_htmltag($htmltext, 1)) . '"'; // Attribut to put on td tag to store tooltip |
|
692 | + $paramfortooltiptd .= ' title="'.($noencodehtmltext ? $htmltext : dol_escape_htmltag($htmltext, 1)).'"'; // Attribut to put on td tag to store tooltip |
|
693 | 693 | } else { |
694 | - $paramfortooltiptd .= ' dolid="' . $tooltiptrigger . '"'; |
|
694 | + $paramfortooltiptd .= ' dolid="'.$tooltiptrigger.'"'; |
|
695 | 695 | } |
696 | 696 | } else { |
697 | - $paramfortooltiptd = ($extracss ? ' class="' . $extracss . '"' : '') . ($extrastyle ? ' style="' . $extrastyle . '"' : ''); // Attribut to put on td text tag |
|
697 | + $paramfortooltiptd = ($extracss ? ' class="'.$extracss.'"' : '').($extrastyle ? ' style="'.$extrastyle.'"' : ''); // Attribut to put on td text tag |
|
698 | 698 | } |
699 | 699 | if (empty($notabs)) { |
700 | 700 | $s .= '<table class="nobordernopadding"><tr style="height: auto;">'; |
701 | 701 | } elseif ($notabs == 2) { |
702 | - $s .= '<div class="inline-block' . ($forcenowrap ? ' nowrap' : '') . '">'; |
|
702 | + $s .= '<div class="inline-block'.($forcenowrap ? ' nowrap' : '').'">'; |
|
703 | 703 | } |
704 | 704 | // Define value if value is before |
705 | 705 | if ($direction < 0) { |
706 | - $s .= '<' . $tag . $paramfortooltipimg; |
|
706 | + $s .= '<'.$tag.$paramfortooltipimg; |
|
707 | 707 | if ($tag == 'td') { |
708 | 708 | $s .= ' class="valigntop" width="14"'; |
709 | 709 | } |
710 | - $s .= '>' . $textfordialog . $img . '</' . $tag . '>'; |
|
710 | + $s .= '>'.$textfordialog.$img.'</'.$tag.'>'; |
|
711 | 711 | } |
712 | 712 | // Use another method to help avoid having a space in value in order to use this value with jquery |
713 | 713 | // Define label |
714 | 714 | if ((string) $text != '') { |
715 | - $s .= '<' . $tag . $paramfortooltiptd . '>' . $text . '</' . $tag . '>'; |
|
715 | + $s .= '<'.$tag.$paramfortooltiptd.'>'.$text.'</'.$tag.'>'; |
|
716 | 716 | } |
717 | 717 | // Define value if value is after |
718 | 718 | if ($direction > 0) { |
719 | - $s .= '<' . $tag . $paramfortooltipimg; |
|
719 | + $s .= '<'.$tag.$paramfortooltipimg; |
|
720 | 720 | if ($tag == 'td') { |
721 | 721 | $s .= ' class="valignmiddle" width="14"'; |
722 | 722 | } |
723 | - $s .= '>' . $textfordialog . $img . '</' . $tag . '>'; |
|
723 | + $s .= '>'.$textfordialog.$img.'</'.$tag.'>'; |
|
724 | 724 | } |
725 | 725 | if (empty($notabs)) { |
726 | 726 | $s .= '</tr></table>'; |
@@ -825,7 +825,7 @@ discard block |
||
825 | 825 | |
826 | 826 | $disabled = 0; |
827 | 827 | $ret = '<div class="centpercent center">'; |
828 | - $ret .= '<select class="flat' . (empty($conf->use_javascript_ajax) ? '' : ' hideobject') . ' ' . $name . ' ' . $name . 'select valignmiddle alignstart" id="' . $name . '" name="' . $name . '"' . ($disabled ? ' disabled="disabled"' : '') . '>'; |
|
828 | + $ret .= '<select class="flat'.(empty($conf->use_javascript_ajax) ? '' : ' hideobject').' '.$name.' '.$name.'select valignmiddle alignstart" id="'.$name.'" name="'.$name.'"'.($disabled ? ' disabled="disabled"' : '').'>'; |
|
829 | 829 | |
830 | 830 | // Complete list with data from external modules. THe module can use $_SERVER['PHP_SELF'] to know on which page we are, or use the $parameters['currentcontext'] completed by executeHooks. |
831 | 831 | $parameters = array(); |
@@ -835,9 +835,9 @@ discard block |
||
835 | 835 | return; |
836 | 836 | } |
837 | 837 | if (empty($reshook)) { |
838 | - $ret .= '<option value="0"' . ($disabled ? ' disabled="disabled"' : '') . '>-- ' . $langs->trans("SelectAction") . ' --</option>'; |
|
838 | + $ret .= '<option value="0"'.($disabled ? ' disabled="disabled"' : '').'>-- '.$langs->trans("SelectAction").' --</option>'; |
|
839 | 839 | foreach ($arrayofaction as $code => $label) { |
840 | - $ret .= '<option value="' . $code . '"' . ($disabled ? ' disabled="disabled"' : '') . ' data-html="' . dol_escape_htmltag($label) . '">' . $label . '</option>'; |
|
840 | + $ret .= '<option value="'.$code.'"'.($disabled ? ' disabled="disabled"' : '').' data-html="'.dol_escape_htmltag($label).'">'.$label.'</option>'; |
|
841 | 841 | } |
842 | 842 | } |
843 | 843 | $ret .= $hookmanager->resPrint; |
@@ -845,17 +845,17 @@ discard block |
||
845 | 845 | $ret .= '</select>'; |
846 | 846 | |
847 | 847 | if (empty($conf->dol_optimize_smallscreen)) { |
848 | - $ret .= ajax_combobox('.' . $name . 'select'); |
|
848 | + $ret .= ajax_combobox('.'.$name.'select'); |
|
849 | 849 | } |
850 | 850 | |
851 | 851 | // Warning: if you set submit button to disabled, post using 'Enter' will no more work if there is no another input submit. So we add a hidden button |
852 | 852 | $ret .= '<input type="submit" name="confirmmassactioninvisible" style="display: none" tabindex="-1">'; // Hidden button BEFORE so it is the one used when we submit with ENTER. |
853 | - $ret .= '<input type="submit" disabled name="confirmmassaction"' . (empty($conf->use_javascript_ajax) ? '' : ' style="display: none"') . ' class="reposition button smallpaddingimp' . (empty($conf->use_javascript_ajax) ? '' : ' hideobject') . ' ' . $name . ' ' . $name . 'confirmed" value="' . dol_escape_htmltag($langs->trans("Confirm")) . '">'; |
|
853 | + $ret .= '<input type="submit" disabled name="confirmmassaction"'.(empty($conf->use_javascript_ajax) ? '' : ' style="display: none"').' class="reposition button smallpaddingimp'.(empty($conf->use_javascript_ajax) ? '' : ' hideobject').' '.$name.' '.$name.'confirmed" value="'.dol_escape_htmltag($langs->trans("Confirm")).'">'; |
|
854 | 854 | $ret .= '</div>'; |
855 | 855 | |
856 | 856 | if (!empty($conf->use_javascript_ajax)) { |
857 | 857 | $ret .= '<!-- JS CODE TO ENABLE mass action select --> |
858 | - <script nonce="' . getNonce() . '"> |
|
858 | + <script nonce="' . getNonce().'"> |
|
859 | 859 | function initCheckForSelect(mode, name, cssclass) /* mode is 0 during init of page or click all, 1 when we click on 1 checkboxi, "name" refers to the class of the massaction button, "cssclass" to the class of the checkfor select boxes */ |
860 | 860 | { |
861 | 861 | atleastoneselected=0; |
@@ -866,11 +866,11 @@ discard block |
||
866 | 866 | |
867 | 867 | console.log("initCheckForSelect mode="+mode+" name="+name+" cssclass="+cssclass+" atleastoneselected="+atleastoneselected); |
868 | 868 | |
869 | - if (atleastoneselected || ' . $alwaysvisible . ') |
|
869 | + if (atleastoneselected || ' . $alwaysvisible.') |
|
870 | 870 | { |
871 | 871 | jQuery("."+name).show(); |
872 | - ' . ($selected ? 'if (atleastoneselected) { jQuery("."+name+"select").val("' . $selected . '").trigger(\'change\'); jQuery("."+name+"confirmed").prop(\'disabled\', false); }' : '') . ' |
|
873 | - ' . ($selected ? 'if (! atleastoneselected) { jQuery("."+name+"select").val("0").trigger(\'change\'); jQuery("."+name+"confirmed").prop(\'disabled\', true); } ' : '') . ' |
|
872 | + ' . ($selected ? 'if (atleastoneselected) { jQuery("."+name+"select").val("'.$selected.'").trigger(\'change\'); jQuery("."+name+"confirmed").prop(\'disabled\', false); }' : '').' |
|
873 | + ' . ($selected ? 'if (! atleastoneselected) { jQuery("."+name+"select").val("0").trigger(\'change\'); jQuery("."+name+"confirmed").prop(\'disabled\', true); } ' : '').' |
|
874 | 874 | } |
875 | 875 | else |
876 | 876 | { |
@@ -880,11 +880,11 @@ discard block |
||
880 | 880 | } |
881 | 881 | |
882 | 882 | jQuery(document).ready(function () { |
883 | - initCheckForSelect(0, "' . $name . '", "' . $cssclass . '"); |
|
884 | - jQuery(".' . $cssclass . '").click(function() { |
|
885 | - initCheckForSelect(1, "' . $name . '", "' . $cssclass . '"); |
|
883 | + initCheckForSelect(0, "' . $name.'", "'.$cssclass.'"); |
|
884 | + jQuery(".' . $cssclass.'").click(function() { |
|
885 | + initCheckForSelect(1, "' . $name.'", "'.$cssclass.'"); |
|
886 | 886 | }); |
887 | - jQuery(".' . $name . 'select").change(function() { |
|
887 | + jQuery(".' . $name.'select").change(function() { |
|
888 | 888 | var massaction = $( this ).val(); |
889 | 889 | var urlform = $( this ).closest("form").attr("action").replace("#show_files",""); |
890 | 890 | if (massaction == "builddoc") |
@@ -892,18 +892,18 @@ discard block |
||
892 | 892 | urlform = urlform + "#show_files"; |
893 | 893 | } |
894 | 894 | $( this ).closest("form").attr("action", urlform); |
895 | - console.log("we select a mass action name=' . $name . ' massaction="+massaction+" - "+urlform); |
|
895 | + console.log("we select a mass action name=' . $name.' massaction="+massaction+" - "+urlform); |
|
896 | 896 | /* Warning: if you set submit button to disabled, post using Enter will no more work if there is no other button */ |
897 | 897 | if ($(this).val() != \'0\') |
898 | 898 | { |
899 | - jQuery(".' . $name . 'confirmed").prop(\'disabled\', false); |
|
900 | - jQuery(".' . $name . 'other").hide(); /* To disable if another div was open */ |
|
901 | - jQuery(".' . $name . '"+massaction).show(); |
|
899 | + jQuery(".' . $name.'confirmed").prop(\'disabled\', false); |
|
900 | + jQuery(".' . $name.'other").hide(); /* To disable if another div was open */ |
|
901 | + jQuery(".' . $name.'"+massaction).show(); |
|
902 | 902 | } |
903 | 903 | else |
904 | 904 | { |
905 | - jQuery(".' . $name . 'confirmed").prop(\'disabled\', true); |
|
906 | - jQuery(".' . $name . 'other").hide(); /* To disable any div open */ |
|
905 | + jQuery(".' . $name.'confirmed").prop(\'disabled\', true); |
|
906 | + jQuery(".' . $name.'other").hide(); /* To disable any div open */ |
|
907 | 907 | } |
908 | 908 | }); |
909 | 909 | }); |
@@ -946,14 +946,14 @@ discard block |
||
946 | 946 | $atleastonefavorite = 0; |
947 | 947 | |
948 | 948 | $sql = "SELECT rowid, code as code_iso, code_iso as code_iso3, label, favorite, eec"; |
949 | - $sql .= " FROM " . $this->db->prefix() . "c_country"; |
|
949 | + $sql .= " FROM ".$this->db->prefix()."c_country"; |
|
950 | 950 | $sql .= " WHERE active > 0"; |
951 | 951 | //$sql.= " ORDER BY code ASC"; |
952 | 952 | |
953 | - dol_syslog(get_class($this) . "::select_country", LOG_DEBUG); |
|
953 | + dol_syslog(get_class($this)."::select_country", LOG_DEBUG); |
|
954 | 954 | $resql = $this->db->query($sql); |
955 | 955 | if ($resql) { |
956 | - $out .= '<select id="select' . $htmlname . '" class="flat maxwidth200onsmartphone selectcountry' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" ' . $htmloption . '>'; |
|
956 | + $out .= '<select id="select'.$htmlname.'" class="flat maxwidth200onsmartphone selectcountry'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" '.$htmloption.'>'; |
|
957 | 957 | $num = $this->db->num_rows($resql); |
958 | 958 | $i = 0; |
959 | 959 | if ($num) { |
@@ -963,7 +963,7 @@ discard block |
||
963 | 963 | $countryArray[$i]['rowid'] = $obj->rowid; |
964 | 964 | $countryArray[$i]['code_iso'] = $obj->code_iso; |
965 | 965 | $countryArray[$i]['code_iso3'] = $obj->code_iso3; |
966 | - $countryArray[$i]['label'] = ($obj->code_iso && $langs->transnoentitiesnoconv("Country" . $obj->code_iso) != "Country" . $obj->code_iso ? $langs->transnoentitiesnoconv("Country" . $obj->code_iso) : ($obj->label != '-' ? $obj->label : '')); |
|
966 | + $countryArray[$i]['label'] = ($obj->code_iso && $langs->transnoentitiesnoconv("Country".$obj->code_iso) != "Country".$obj->code_iso ? $langs->transnoentitiesnoconv("Country".$obj->code_iso) : ($obj->label != '-' ? $obj->label : '')); |
|
967 | 967 | $countryArray[$i]['favorite'] = $obj->favorite; |
968 | 968 | $countryArray[$i]['eec'] = $obj->eec; |
969 | 969 | $favorite[$i] = $obj->favorite; |
@@ -981,20 +981,20 @@ discard block |
||
981 | 981 | |
982 | 982 | if ($showempty) { |
983 | 983 | if (is_numeric($showempty)) { |
984 | - $out .= '<option value=""> </option>' . "\n"; |
|
984 | + $out .= '<option value=""> </option>'."\n"; |
|
985 | 985 | } else { |
986 | - $out .= '<option value="-1">' . $langs->trans($showempty) . '</option>' . "\n"; |
|
986 | + $out .= '<option value="-1">'.$langs->trans($showempty).'</option>'."\n"; |
|
987 | 987 | } |
988 | 988 | } |
989 | 989 | |
990 | 990 | if ($addspecialentries) { // Add dedicated entries for groups of countries |
991 | 991 | //if ($showempty) $out.= '<option value="" disabled class="selectoptiondisabledwhite">--------------</option>'; |
992 | - $out .= '<option value="special_allnotme"' . ($selected == 'special_allnotme' ? ' selected' : '') . '>' . $langs->trans("CountriesExceptMe", $langs->transnoentitiesnoconv("Country" . $mysoc->country_code)) . '</option>'; |
|
993 | - $out .= '<option value="special_eec"' . ($selected == 'special_eec' ? ' selected' : '') . '>' . $langs->trans("CountriesInEEC") . '</option>'; |
|
992 | + $out .= '<option value="special_allnotme"'.($selected == 'special_allnotme' ? ' selected' : '').'>'.$langs->trans("CountriesExceptMe", $langs->transnoentitiesnoconv("Country".$mysoc->country_code)).'</option>'; |
|
993 | + $out .= '<option value="special_eec"'.($selected == 'special_eec' ? ' selected' : '').'>'.$langs->trans("CountriesInEEC").'</option>'; |
|
994 | 994 | if ($mysoc->isInEEC()) { |
995 | - $out .= '<option value="special_eecnotme"' . ($selected == 'special_eecnotme' ? ' selected' : '') . '>' . $langs->trans("CountriesInEECExceptMe", $langs->transnoentitiesnoconv("Country" . $mysoc->country_code)) . '</option>'; |
|
995 | + $out .= '<option value="special_eecnotme"'.($selected == 'special_eecnotme' ? ' selected' : '').'>'.$langs->trans("CountriesInEECExceptMe", $langs->transnoentitiesnoconv("Country".$mysoc->country_code)).'</option>'; |
|
996 | 996 | } |
997 | - $out .= '<option value="special_noteec"' . ($selected == 'special_noteec' ? ' selected' : '') . '>' . $langs->trans("CountriesNotInEEC") . '</option>'; |
|
997 | + $out .= '<option value="special_noteec"'.($selected == 'special_noteec' ? ' selected' : '').'>'.$langs->trans("CountriesNotInEEC").'</option>'; |
|
998 | 998 | $out .= '<option value="" disabled class="selectoptiondisabledwhite">------------</option>'; |
999 | 999 | } |
1000 | 1000 | |
@@ -1022,20 +1022,20 @@ discard block |
||
1022 | 1022 | $labeltoshow .= ' '; |
1023 | 1023 | } |
1024 | 1024 | if ($row['code_iso']) { |
1025 | - $labeltoshow .= ' <span class="opacitymedium">(' . $row['code_iso'] . ')</span>'; |
|
1025 | + $labeltoshow .= ' <span class="opacitymedium">('.$row['code_iso'].')</span>'; |
|
1026 | 1026 | if (empty($hideflags)) { |
1027 | 1027 | $tmpflag = picto_from_langcode($row['code_iso'], 'class="saturatemedium paddingrightonly"', 1); |
1028 | - $labeltoshow = $tmpflag . ' ' . $labeltoshow; |
|
1028 | + $labeltoshow = $tmpflag.' '.$labeltoshow; |
|
1029 | 1029 | } |
1030 | 1030 | } |
1031 | 1031 | |
1032 | 1032 | if ($selected && $selected != '-1' && ($selected == $row['rowid'] || $selected == $row['code_iso'] || $selected == $row['code_iso3'] || $selected == $row['label'])) { |
1033 | - $out .= '<option value="' . ($usecodeaskey ? ($usecodeaskey == 'code2' ? $row['code_iso'] : $row['code_iso3']) : $row['rowid']) . '" selected data-html="' . dol_escape_htmltag($labeltoshow) . '" data-eec="' . ((int) $row['eec']) . '">'; |
|
1033 | + $out .= '<option value="'.($usecodeaskey ? ($usecodeaskey == 'code2' ? $row['code_iso'] : $row['code_iso3']) : $row['rowid']).'" selected data-html="'.dol_escape_htmltag($labeltoshow).'" data-eec="'.((int) $row['eec']).'">'; |
|
1034 | 1034 | } else { |
1035 | - $out .= '<option value="' . ($usecodeaskey ? ($usecodeaskey == 'code2' ? $row['code_iso'] : $row['code_iso3']) : $row['rowid']) . '" data-html="' . dol_escape_htmltag($labeltoshow) . '" data-eec="' . ((int) $row['eec']) . '">'; |
|
1035 | + $out .= '<option value="'.($usecodeaskey ? ($usecodeaskey == 'code2' ? $row['code_iso'] : $row['code_iso3']) : $row['rowid']).'" data-html="'.dol_escape_htmltag($labeltoshow).'" data-eec="'.((int) $row['eec']).'">'; |
|
1036 | 1036 | } |
1037 | 1037 | $out .= $labeltoshow; |
1038 | - $out .= '</option>' . "\n"; |
|
1038 | + $out .= '</option>'."\n"; |
|
1039 | 1039 | } |
1040 | 1040 | } |
1041 | 1041 | $out .= '</select>'; |
@@ -1044,8 +1044,8 @@ discard block |
||
1044 | 1044 | } |
1045 | 1045 | |
1046 | 1046 | // Make select dynamic |
1047 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
1048 | - $out .= ajax_combobox('select' . $htmlname, array(), 0, 0, 'resolve'); |
|
1047 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
1048 | + $out .= ajax_combobox('select'.$htmlname, array(), 0, 0, 'resolve'); |
|
1049 | 1049 | |
1050 | 1050 | return $out; |
1051 | 1051 | } |
@@ -1077,25 +1077,25 @@ discard block |
||
1077 | 1077 | $incotermArray = array(); |
1078 | 1078 | |
1079 | 1079 | $sql = "SELECT rowid, code"; |
1080 | - $sql .= " FROM " . $this->db->prefix() . "c_incoterms"; |
|
1080 | + $sql .= " FROM ".$this->db->prefix()."c_incoterms"; |
|
1081 | 1081 | $sql .= " WHERE active > 0"; |
1082 | 1082 | $sql .= " ORDER BY code ASC"; |
1083 | 1083 | |
1084 | - dol_syslog(get_class($this) . "::select_incoterm", LOG_DEBUG); |
|
1084 | + dol_syslog(get_class($this)."::select_incoterm", LOG_DEBUG); |
|
1085 | 1085 | $resql = $this->db->query($sql); |
1086 | 1086 | if ($resql) { |
1087 | 1087 | if ($conf->use_javascript_ajax && !$forcecombo) { |
1088 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
1088 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
1089 | 1089 | $out .= ajax_combobox($htmlname, $events); |
1090 | 1090 | } |
1091 | 1091 | |
1092 | 1092 | if (!empty($page)) { |
1093 | - $out .= '<form method="post" action="' . $page . '">'; |
|
1093 | + $out .= '<form method="post" action="'.$page.'">'; |
|
1094 | 1094 | $out .= '<input type="hidden" name="action" value="set_incoterms">'; |
1095 | - $out .= '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
1095 | + $out .= '<input type="hidden" name="token" value="'.newToken().'">'; |
|
1096 | 1096 | } |
1097 | 1097 | |
1098 | - $out .= '<select id="' . $htmlname . '" class="flat selectincoterm width75" name="' . $htmlname . '" ' . $htmloption . '>'; |
|
1098 | + $out .= '<select id="'.$htmlname.'" class="flat selectincoterm width75" name="'.$htmlname.'" '.$htmloption.'>'; |
|
1099 | 1099 | $out .= '<option value="0"> </option>'; |
1100 | 1100 | $num = $this->db->num_rows($resql); |
1101 | 1101 | $i = 0; |
@@ -1109,9 +1109,9 @@ discard block |
||
1109 | 1109 | |
1110 | 1110 | foreach ($incotermArray as $row) { |
1111 | 1111 | if ($selected && ($selected == $row['rowid'] || $selected == $row['code'])) { |
1112 | - $out .= '<option value="' . $row['rowid'] . '" selected>'; |
|
1112 | + $out .= '<option value="'.$row['rowid'].'" selected>'; |
|
1113 | 1113 | } else { |
1114 | - $out .= '<option value="' . $row['rowid'] . '">'; |
|
1114 | + $out .= '<option value="'.$row['rowid'].'">'; |
|
1115 | 1115 | } |
1116 | 1116 | |
1117 | 1117 | if ($row['code']) { |
@@ -1124,13 +1124,13 @@ discard block |
||
1124 | 1124 | $out .= '</select>'; |
1125 | 1125 | |
1126 | 1126 | if ($conf->use_javascript_ajax && empty($disableautocomplete)) { |
1127 | - $out .= ajax_multiautocompleter('location_incoterms', array(), DOL_URL_ROOT . '/core/ajax/locationincoterms.php') . "\n"; |
|
1127 | + $out .= ajax_multiautocompleter('location_incoterms', array(), DOL_URL_ROOT.'/core/ajax/locationincoterms.php')."\n"; |
|
1128 | 1128 | $moreattrib .= ' autocomplete="off"'; |
1129 | 1129 | } |
1130 | - $out .= '<input id="location_incoterms" class="maxwidthonsmartphone type="text" name="location_incoterms" value="' . $location_incoterms . '">' . "\n"; |
|
1130 | + $out .= '<input id="location_incoterms" class="maxwidthonsmartphone type="text" name="location_incoterms" value="'.$location_incoterms.'">'."\n"; |
|
1131 | 1131 | |
1132 | 1132 | if (!empty($page)) { |
1133 | - $out .= '<input type="submit" class="button valignmiddle smallpaddingimp nomargintop nomarginbottom" value="' . $langs->trans("Modify") . '"></form>'; |
|
1133 | + $out .= '<input type="submit" class="button valignmiddle smallpaddingimp nomargintop nomarginbottom" value="'.$langs->trans("Modify").'"></form>'; |
|
1134 | 1134 | } |
1135 | 1135 | } else { |
1136 | 1136 | dol_print_error($this->db); |
@@ -1161,9 +1161,9 @@ discard block |
||
1161 | 1161 | if ($forceall == 1 || (empty($forceall) && isModEnabled("product") && isModEnabled("service")) |
1162 | 1162 | || (empty($forceall) && !isModEnabled('product') && !isModEnabled('service'))) { |
1163 | 1163 | if (empty($hidetext)) { |
1164 | - print $langs->trans("Type") . ': '; |
|
1164 | + print $langs->trans("Type").': '; |
|
1165 | 1165 | } |
1166 | - print '<select class="flat" id="select_' . $htmlname . '" name="' . $htmlname . '">'; |
|
1166 | + print '<select class="flat" id="select_'.$htmlname.'" name="'.$htmlname.'">'; |
|
1167 | 1167 | if ($showempty) { |
1168 | 1168 | print '<option value="-1"'; |
1169 | 1169 | if ($selected == -1) { |
@@ -1176,28 +1176,28 @@ discard block |
||
1176 | 1176 | if (0 == $selected || ($selected == -1 && getDolGlobalString('MAIN_FREE_PRODUCT_CHECKED_BY_DEFAULT') == 'product')) { |
1177 | 1177 | print ' selected'; |
1178 | 1178 | } |
1179 | - print '>' . $langs->trans("Product"); |
|
1179 | + print '>'.$langs->trans("Product"); |
|
1180 | 1180 | |
1181 | 1181 | print '<option value="1"'; |
1182 | 1182 | if (1 == $selected || ($selected == -1 && getDolGlobalString('MAIN_FREE_PRODUCT_CHECKED_BY_DEFAULT') == 'service')) { |
1183 | 1183 | print ' selected'; |
1184 | 1184 | } |
1185 | - print '>' . $langs->trans("Service"); |
|
1185 | + print '>'.$langs->trans("Service"); |
|
1186 | 1186 | |
1187 | 1187 | print '</select>'; |
1188 | - print ajax_combobox('select_' . $htmlname); |
|
1188 | + print ajax_combobox('select_'.$htmlname); |
|
1189 | 1189 | //if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); |
1190 | 1190 | } |
1191 | 1191 | if ((empty($forceall) && !isModEnabled('product') && isModEnabled("service")) || $forceall == 3) { |
1192 | 1192 | print $langs->trans("Service"); |
1193 | - print '<input type="hidden" name="' . $htmlname . '" value="1">'; |
|
1193 | + print '<input type="hidden" name="'.$htmlname.'" value="1">'; |
|
1194 | 1194 | } |
1195 | 1195 | if ((empty($forceall) && isModEnabled("product") && !isModEnabled('service')) || $forceall == 2) { |
1196 | 1196 | print $langs->trans("Product"); |
1197 | - print '<input type="hidden" name="' . $htmlname . '" value="0">'; |
|
1197 | + print '<input type="hidden" name="'.$htmlname.'" value="0">'; |
|
1198 | 1198 | } |
1199 | 1199 | if ($forceall < 0) { // This should happened only for contracts when both predefined product and service are disabled. |
1200 | - print '<input type="hidden" name="' . $htmlname . '" value="1">'; // By default we set on service for contract. If CONTRACT_SUPPORT_PRODUCTS is set, forceall should be 1 not -1 |
|
1200 | + print '<input type="hidden" name="'.$htmlname.'" value="1">'; // By default we set on service for contract. If CONTRACT_SUPPORT_PRODUCTS is set, forceall should be 1 not -1 |
|
1201 | 1201 | } |
1202 | 1202 | } |
1203 | 1203 | |
@@ -1223,7 +1223,7 @@ discard block |
||
1223 | 1223 | $langs->load("trips"); |
1224 | 1224 | |
1225 | 1225 | $sql = "SELECT c.code, c.label"; |
1226 | - $sql .= " FROM " . $this->db->prefix() . "c_type_fees as c"; |
|
1226 | + $sql .= " FROM ".$this->db->prefix()."c_type_fees as c"; |
|
1227 | 1227 | $sql .= " WHERE active > 0"; |
1228 | 1228 | |
1229 | 1229 | $resql = $this->db->query($sql); |
@@ -1264,11 +1264,11 @@ discard block |
||
1264 | 1264 | // phpcs:enable |
1265 | 1265 | global $user, $langs; |
1266 | 1266 | |
1267 | - dol_syslog(__METHOD__ . " selected=" . $selected . ", htmlname=" . $htmlname, LOG_DEBUG); |
|
1267 | + dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG); |
|
1268 | 1268 | |
1269 | 1269 | $this->load_cache_types_fees(); |
1270 | 1270 | |
1271 | - print '<select id="select_' . $htmlname . '" class="flat" name="' . $htmlname . '">'; |
|
1271 | + print '<select id="select_'.$htmlname.'" class="flat" name="'.$htmlname.'">'; |
|
1272 | 1272 | if ($showempty) { |
1273 | 1273 | print '<option value="-1"'; |
1274 | 1274 | if ($selected == -1) { |
@@ -1278,7 +1278,7 @@ discard block |
||
1278 | 1278 | } |
1279 | 1279 | |
1280 | 1280 | foreach ($this->cache_types_fees as $key => $value) { |
1281 | - print '<option value="' . $key . '"'; |
|
1281 | + print '<option value="'.$key.'"'; |
|
1282 | 1282 | if ($key == $selected) { |
1283 | 1283 | print ' selected'; |
1284 | 1284 | } |
@@ -1329,12 +1329,12 @@ discard block |
||
1329 | 1329 | $ajaxoptions = array(); |
1330 | 1330 | } |
1331 | 1331 | |
1332 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
1332 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
1333 | 1333 | |
1334 | 1334 | // No immediate load of all database |
1335 | 1335 | $placeholder = ''; |
1336 | 1336 | if ($selected && empty($selected_input_value)) { |
1337 | - require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php'; |
|
1337 | + require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; |
|
1338 | 1338 | $societetmp = new Societe($this->db); |
1339 | 1339 | $societetmp->fetch($selected); |
1340 | 1340 | $selected_input_value = $societetmp->name; |
@@ -1342,25 +1342,25 @@ discard block |
||
1342 | 1342 | } |
1343 | 1343 | |
1344 | 1344 | // mode 1 |
1345 | - $urloption = 'htmlname=' . urlencode(str_replace('.', '_', $htmlname)) . '&outjson=1&filter=' . urlencode($filter) . (empty($excludeids) ? '' : '&excludeids=' . join(',', $excludeids)) . ($showtype ? '&showtype=' . urlencode($showtype) : '') . ($showcode ? '&showcode=' . urlencode($showcode) : ''); |
|
1345 | + $urloption = 'htmlname='.urlencode(str_replace('.', '_', $htmlname)).'&outjson=1&filter='.urlencode($filter).(empty($excludeids) ? '' : '&excludeids='.join(',', $excludeids)).($showtype ? '&showtype='.urlencode($showtype) : '').($showcode ? '&showcode='.urlencode($showcode) : ''); |
|
1346 | 1346 | |
1347 | 1347 | $out .= '<!-- force css to be higher than dialog popup --><style type="text/css">.ui-autocomplete { z-index: 1010; }</style>'; |
1348 | 1348 | if (empty($hidelabel)) { |
1349 | - print $langs->trans("RefOrLabel") . ' : '; |
|
1349 | + print $langs->trans("RefOrLabel").' : '; |
|
1350 | 1350 | } elseif ($hidelabel > 1) { |
1351 | 1351 | $placeholder = $langs->trans("RefOrLabel"); |
1352 | 1352 | if ($hidelabel == 2) { |
1353 | 1353 | $out .= img_picto($langs->trans("Search"), 'search'); |
1354 | 1354 | } |
1355 | 1355 | } |
1356 | - $out .= '<input type="text" class="' . $morecss . '" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . ($placeholder ? ' placeholder="' . dol_escape_htmltag($placeholder) . '"' : '') . ' ' . (!empty($conf->global->THIRDPARTY_SEARCH_AUTOFOCUS) ? 'autofocus' : '') . ' />'; |
|
1356 | + $out .= '<input type="text" class="'.$morecss.'" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.($placeholder ? ' placeholder="'.dol_escape_htmltag($placeholder).'"' : '').' '.(!empty($conf->global->THIRDPARTY_SEARCH_AUTOFOCUS) ? 'autofocus' : '').' />'; |
|
1357 | 1357 | if ($hidelabel == 3) { |
1358 | 1358 | $out .= img_picto($langs->trans("Search"), 'search'); |
1359 | 1359 | } |
1360 | 1360 | |
1361 | 1361 | $out .= ajax_event($htmlname, $events); |
1362 | 1362 | |
1363 | - $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/societe/ajax/company.php', $urloption, $conf->global->COMPANY_USE_SEARCH_TO_SELECT, 0, $ajaxoptions); |
|
1363 | + $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/societe/ajax/company.php', $urloption, $conf->global->COMPANY_USE_SEARCH_TO_SELECT, 0, $ajaxoptions); |
|
1364 | 1364 | } else { |
1365 | 1365 | // Immediate load of all database |
1366 | 1366 | $out .= $this->select_thirdparty_list($selected, $htmlname, $filter, $showempty, $showtype, $forcecombo, $events, '', 0, $limit, $morecss, $moreparam, $multiple, $excludeids, $showcode); |
@@ -1444,30 +1444,30 @@ discard block |
||
1444 | 1444 | $sql .= ", s.address, s.zip, s.town"; |
1445 | 1445 | $sql .= ", dictp.code as country_code"; |
1446 | 1446 | } |
1447 | - $sql .= " FROM " . $this->db->prefix() . "societe as s"; |
|
1447 | + $sql .= " FROM ".$this->db->prefix()."societe as s"; |
|
1448 | 1448 | if (!empty($conf->global->COMPANY_SHOW_ADDRESS_SELECTLIST)) { |
1449 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "c_country as dictp ON dictp.rowid = s.fk_pays"; |
|
1449 | + $sql .= " LEFT JOIN ".$this->db->prefix()."c_country as dictp ON dictp.rowid = s.fk_pays"; |
|
1450 | 1450 | } |
1451 | 1451 | if (!$user->hasRight('societe', 'client', 'voir') && !$user->socid) { |
1452 | - $sql .= ", " . $this->db->prefix() . "societe_commerciaux as sc"; |
|
1452 | + $sql .= ", ".$this->db->prefix()."societe_commerciaux as sc"; |
|
1453 | 1453 | } |
1454 | - $sql .= " WHERE s.entity IN (" . getEntity('societe') . ")"; |
|
1454 | + $sql .= " WHERE s.entity IN (".getEntity('societe').")"; |
|
1455 | 1455 | if (!empty($user->socid)) { |
1456 | - $sql .= " AND s.rowid = " . ((int) $user->socid); |
|
1456 | + $sql .= " AND s.rowid = ".((int) $user->socid); |
|
1457 | 1457 | } |
1458 | 1458 | if ($filter) { |
1459 | 1459 | // $filter is safe because, if it contains '(' or ')', it has been sanitized by testSqlAndScriptInject() and forgeSQLFromUniversalSearchCriteria() |
1460 | 1460 | // if not, by testSqlAndScriptInject() only. |
1461 | - $sql .= " AND (" . $filter . ")"; |
|
1461 | + $sql .= " AND (".$filter.")"; |
|
1462 | 1462 | } |
1463 | 1463 | if (!$user->hasRight('societe', 'client', 'voir') && !$user->socid) { |
1464 | - $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " . ((int) $user->id); |
|
1464 | + $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); |
|
1465 | 1465 | } |
1466 | 1466 | if (!empty($conf->global->COMPANY_HIDE_INACTIVE_IN_COMBOBOX)) { |
1467 | 1467 | $sql .= " AND s.status <> 0"; |
1468 | 1468 | } |
1469 | 1469 | if (!empty($excludeids)) { |
1470 | - $sql .= " AND s.rowid NOT IN (" . $this->db->sanitize(join(',', $excludeids)) . ")"; |
|
1470 | + $sql .= " AND s.rowid NOT IN (".$this->db->sanitize(join(',', $excludeids)).")"; |
|
1471 | 1471 | } |
1472 | 1472 | // Add where from hooks |
1473 | 1473 | $parameters = array(); |
@@ -1487,17 +1487,17 @@ discard block |
||
1487 | 1487 | if ($i > 0) { |
1488 | 1488 | $sql .= " AND "; |
1489 | 1489 | } |
1490 | - $sql .= "(s.nom LIKE '" . $this->db->escape($prefix . $crit) . "%')"; |
|
1490 | + $sql .= "(s.nom LIKE '".$this->db->escape($prefix.$crit)."%')"; |
|
1491 | 1491 | $i++; |
1492 | 1492 | } |
1493 | 1493 | if (count($scrit) > 1) { |
1494 | 1494 | $sql .= ")"; |
1495 | 1495 | } |
1496 | 1496 | if (isModEnabled('barcode')) { |
1497 | - $sql .= " OR s.barcode LIKE '" . $this->db->escape($prefix . $filterkey) . "%'"; |
|
1497 | + $sql .= " OR s.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'"; |
|
1498 | 1498 | } |
1499 | - $sql .= " OR s.code_client LIKE '" . $this->db->escape($prefix . $filterkey) . "%' OR s.code_fournisseur LIKE '" . $this->db->escape($prefix . $filterkey) . "%'"; |
|
1500 | - $sql .= " OR s.name_alias LIKE '" . $this->db->escape($prefix . $filterkey) . "%' OR s.tva_intra LIKE '" . $this->db->escape($prefix . $filterkey) . "%'"; |
|
1499 | + $sql .= " OR s.code_client LIKE '".$this->db->escape($prefix.$filterkey)."%' OR s.code_fournisseur LIKE '".$this->db->escape($prefix.$filterkey)."%'"; |
|
1500 | + $sql .= " OR s.name_alias LIKE '".$this->db->escape($prefix.$filterkey)."%' OR s.tva_intra LIKE '".$this->db->escape($prefix.$filterkey)."%'"; |
|
1501 | 1501 | $sql .= ")"; |
1502 | 1502 | } |
1503 | 1503 | $sql .= $this->db->order("nom", "ASC"); |
@@ -1508,12 +1508,12 @@ discard block |
||
1508 | 1508 | $resql = $this->db->query($sql); |
1509 | 1509 | if ($resql) { |
1510 | 1510 | if (!$forcecombo) { |
1511 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
1511 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
1512 | 1512 | $out .= ajax_combobox($htmlname, $events, getDolGlobalString("COMPANY_USE_SEARCH_TO_SELECT")); |
1513 | 1513 | } |
1514 | 1514 | |
1515 | 1515 | // Construct $out and $outarray |
1516 | - $out .= '<select id="' . $htmlname . '" class="flat' . ($morecss ? ' ' . $morecss : '') . '"' . ($moreparam ? ' ' . $moreparam : '') . ' name="' . $htmlname . ($multiple ? '[]' : '') . '" ' . ($multiple ? 'multiple' : '') . '>' . "\n"; |
|
1516 | + $out .= '<select id="'.$htmlname.'" class="flat'.($morecss ? ' '.$morecss : '').'"'.($moreparam ? ' '.$moreparam : '').' name="'.$htmlname.($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').'>'."\n"; |
|
1517 | 1517 | |
1518 | 1518 | $textifempty = (($showempty && !is_numeric($showempty)) ? $langs->trans($showempty) : ''); |
1519 | 1519 | if (!empty($conf->global->COMPANY_USE_SEARCH_TO_SELECT)) { |
@@ -1526,7 +1526,7 @@ discard block |
||
1526 | 1526 | } |
1527 | 1527 | } |
1528 | 1528 | if ($showempty) { |
1529 | - $out .= '<option value="-1" data-html="' . dol_escape_htmltag('<span class="opacitymedium">' . ($textifempty ? $textifempty : ' ') . '</span>') . '">' . $textifempty . '</option>' . "\n"; |
|
1529 | + $out .= '<option value="-1" data-html="'.dol_escape_htmltag('<span class="opacitymedium">'.($textifempty ? $textifempty : ' ').'</span>').'">'.$textifempty.'</option>'."\n"; |
|
1530 | 1530 | } |
1531 | 1531 | |
1532 | 1532 | $companytemp = new Societe($this->db); |
@@ -1539,18 +1539,18 @@ discard block |
||
1539 | 1539 | $label = ''; |
1540 | 1540 | if ($showcode || !empty($conf->global->SOCIETE_ADD_REF_IN_LIST)) { |
1541 | 1541 | if (($obj->client) && (!empty($obj->code_client))) { |
1542 | - $label = $obj->code_client . ' - '; |
|
1542 | + $label = $obj->code_client.' - '; |
|
1543 | 1543 | } |
1544 | 1544 | if (($obj->fournisseur) && (!empty($obj->code_fournisseur))) { |
1545 | - $label .= $obj->code_fournisseur . ' - '; |
|
1545 | + $label .= $obj->code_fournisseur.' - '; |
|
1546 | 1546 | } |
1547 | - $label .= ' ' . $obj->name; |
|
1547 | + $label .= ' '.$obj->name; |
|
1548 | 1548 | } else { |
1549 | 1549 | $label = $obj->name; |
1550 | 1550 | } |
1551 | 1551 | |
1552 | 1552 | if (!empty($obj->name_alias)) { |
1553 | - $label .= ' (' . $obj->name_alias . ')'; |
|
1553 | + $label .= ' ('.$obj->name_alias.')'; |
|
1554 | 1554 | } |
1555 | 1555 | |
1556 | 1556 | if (!empty($conf->global->SOCIETE_SHOW_VAT_IN_LIST) && !empty($obj->tva_intra)) { |
@@ -1565,7 +1565,7 @@ discard block |
||
1565 | 1565 | $companytemp->fournisseur = $obj->fournisseur; |
1566 | 1566 | $tmptype = $companytemp->getTypeUrl(1, '', 0, 'span'); |
1567 | 1567 | if ($tmptype) { |
1568 | - $labelhtml .= ' ' . $tmptype; |
|
1568 | + $labelhtml .= ' '.$tmptype; |
|
1569 | 1569 | } |
1570 | 1570 | |
1571 | 1571 | if ($obj->client || $obj->fournisseur) { |
@@ -1575,10 +1575,10 @@ discard block |
||
1575 | 1575 | $label .= $langs->trans("Customer"); |
1576 | 1576 | } |
1577 | 1577 | if ($obj->client == 2 || $obj->client == 3) { |
1578 | - $label .= ($obj->client == 3 ? ', ' : '') . $langs->trans("Prospect"); |
|
1578 | + $label .= ($obj->client == 3 ? ', ' : '').$langs->trans("Prospect"); |
|
1579 | 1579 | } |
1580 | 1580 | if ($obj->fournisseur) { |
1581 | - $label .= ($obj->client ? ', ' : '') . $langs->trans("Supplier"); |
|
1581 | + $label .= ($obj->client ? ', ' : '').$langs->trans("Supplier"); |
|
1582 | 1582 | } |
1583 | 1583 | if ($obj->client || $obj->fournisseur) { |
1584 | 1584 | $label .= ')'; |
@@ -1586,9 +1586,9 @@ discard block |
||
1586 | 1586 | } |
1587 | 1587 | |
1588 | 1588 | if (!empty($conf->global->COMPANY_SHOW_ADDRESS_SELECTLIST)) { |
1589 | - $s = ($obj->address ? ' - ' . $obj->address : '') . ($obj->zip ? ' - ' . $obj->zip : '') . ($obj->town ? ' ' . $obj->town : ''); |
|
1589 | + $s = ($obj->address ? ' - '.$obj->address : '').($obj->zip ? ' - '.$obj->zip : '').($obj->town ? ' '.$obj->town : ''); |
|
1590 | 1590 | if (!empty($obj->country_code)) { |
1591 | - $s .= ', ' . $langs->trans('Country' . $obj->country_code); |
|
1591 | + $s .= ', '.$langs->trans('Country'.$obj->country_code); |
|
1592 | 1592 | } |
1593 | 1593 | $label .= $s; |
1594 | 1594 | $labelhtml .= $s; |
@@ -1596,9 +1596,9 @@ discard block |
||
1596 | 1596 | |
1597 | 1597 | if (empty($outputmode)) { |
1598 | 1598 | if (in_array($obj->rowid, $selected)) { |
1599 | - $out .= '<option value="' . $obj->rowid . '" selected data-html="' . dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1) . '">' . dol_escape_htmltag($label, 0, 0, '', 0, 1) . '</option>'; |
|
1599 | + $out .= '<option value="'.$obj->rowid.'" selected data-html="'.dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1).'">'.dol_escape_htmltag($label, 0, 0, '', 0, 1).'</option>'; |
|
1600 | 1600 | } else { |
1601 | - $out .= '<option value="' . $obj->rowid . '" data-html="' . dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1) . '">' . dol_escape_htmltag($label, 0, 0, '', 0, 1) . '</option>'; |
|
1601 | + $out .= '<option value="'.$obj->rowid.'" data-html="'.dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1).'">'.dol_escape_htmltag($label, 0, 0, '', 0, 1).'</option>'; |
|
1602 | 1602 | } |
1603 | 1603 | } else { |
1604 | 1604 | array_push($outarray, array('key' => $obj->rowid, 'value' => $label, 'label' => $label, 'labelhtml' => $labelhtml)); |
@@ -1610,7 +1610,7 @@ discard block |
||
1610 | 1610 | } |
1611 | 1611 | } |
1612 | 1612 | } |
1613 | - $out .= '</select>' . "\n"; |
|
1613 | + $out .= '</select>'."\n"; |
|
1614 | 1614 | } else { |
1615 | 1615 | dol_print_error($this->db); |
1616 | 1616 | } |
@@ -1644,18 +1644,18 @@ discard block |
||
1644 | 1644 | // On recherche les remises |
1645 | 1645 | $sql = "SELECT re.rowid, re.amount_ht, re.amount_tva, re.amount_ttc,"; |
1646 | 1646 | $sql .= " re.description, re.fk_facture_source"; |
1647 | - $sql .= " FROM " . $this->db->prefix() . "societe_remise_except as re"; |
|
1648 | - $sql .= " WHERE re.fk_soc = " . (int) $socid; |
|
1649 | - $sql .= " AND re.entity = " . $conf->entity; |
|
1647 | + $sql .= " FROM ".$this->db->prefix()."societe_remise_except as re"; |
|
1648 | + $sql .= " WHERE re.fk_soc = ".(int) $socid; |
|
1649 | + $sql .= " AND re.entity = ".$conf->entity; |
|
1650 | 1650 | if ($filter) { |
1651 | - $sql .= " AND " . $filter; |
|
1651 | + $sql .= " AND ".$filter; |
|
1652 | 1652 | } |
1653 | 1653 | $sql .= " ORDER BY re.description ASC"; |
1654 | 1654 | |
1655 | - dol_syslog(get_class($this) . "::select_remises", LOG_DEBUG); |
|
1655 | + dol_syslog(get_class($this)."::select_remises", LOG_DEBUG); |
|
1656 | 1656 | $resql = $this->db->query($sql); |
1657 | 1657 | if ($resql) { |
1658 | - print '<select id="select_' . $htmlname . '" class="flat maxwidthonsmartphone" name="' . $htmlname . '">'; |
|
1658 | + print '<select id="select_'.$htmlname.'" class="flat maxwidthonsmartphone" name="'.$htmlname.'">'; |
|
1659 | 1659 | $num = $this->db->num_rows($resql); |
1660 | 1660 | |
1661 | 1661 | $qualifiedlines = $num; |
@@ -1693,16 +1693,16 @@ discard block |
||
1693 | 1693 | if (!empty($conf->global->MAIN_SHOW_FACNUMBER_IN_DISCOUNT_LIST) && !empty($obj->fk_facture_source)) { |
1694 | 1694 | $tmpfac = new Facture($this->db); |
1695 | 1695 | if ($tmpfac->fetch($obj->fk_facture_source) > 0) { |
1696 | - $desc = $desc . ' - ' . $tmpfac->ref; |
|
1696 | + $desc = $desc.' - '.$tmpfac->ref; |
|
1697 | 1697 | } |
1698 | 1698 | } |
1699 | 1699 | |
1700 | - print '<option value="' . $obj->rowid . '"' . $selectstring . $disabled . '>' . $desc . ' (' . price($obj->amount_ht) . ' ' . $langs->trans("HT") . ' - ' . price($obj->amount_ttc) . ' ' . $langs->trans("TTC") . ')</option>'; |
|
1700 | + print '<option value="'.$obj->rowid.'"'.$selectstring.$disabled.'>'.$desc.' ('.price($obj->amount_ht).' '.$langs->trans("HT").' - '.price($obj->amount_ttc).' '.$langs->trans("TTC").')</option>'; |
|
1701 | 1701 | $i++; |
1702 | 1702 | } |
1703 | 1703 | } |
1704 | 1704 | print '</select>'; |
1705 | - print ajax_combobox('select_' . $htmlname); |
|
1705 | + print ajax_combobox('select_'.$htmlname); |
|
1706 | 1706 | |
1707 | 1707 | return $qualifiedlines; |
1708 | 1708 | } else { |
@@ -1783,7 +1783,7 @@ discard block |
||
1783 | 1783 | $out = ''; |
1784 | 1784 | |
1785 | 1785 | if (!is_object($hookmanager)) { |
1786 | - include_once DOL_DOCUMENT_ROOT . '/core/class/hookmanager.class.php'; |
|
1786 | + include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'; |
|
1787 | 1787 | $hookmanager = new HookManager($this->db); |
1788 | 1788 | } |
1789 | 1789 | |
@@ -1792,13 +1792,13 @@ discard block |
||
1792 | 1792 | if ($showsoc > 0 || !empty($conf->global->CONTACT_SHOW_EMAIL_PHONE_TOWN_SELECTLIST)) { |
1793 | 1793 | $sql .= ", s.nom as company, s.town AS company_town"; |
1794 | 1794 | } |
1795 | - $sql .= " FROM " . $this->db->prefix() . "socpeople as sp"; |
|
1795 | + $sql .= " FROM ".$this->db->prefix()."socpeople as sp"; |
|
1796 | 1796 | if ($showsoc > 0 || !empty($conf->global->CONTACT_SHOW_EMAIL_PHONE_TOWN_SELECTLIST)) { |
1797 | - $sql .= " LEFT OUTER JOIN " . $this->db->prefix() . "societe as s ON s.rowid=sp.fk_soc"; |
|
1797 | + $sql .= " LEFT OUTER JOIN ".$this->db->prefix()."societe as s ON s.rowid=sp.fk_soc"; |
|
1798 | 1798 | } |
1799 | - $sql .= " WHERE sp.entity IN (" . getEntity('contact') . ")"; |
|
1799 | + $sql .= " WHERE sp.entity IN (".getEntity('contact').")"; |
|
1800 | 1800 | if ($socid > 0 || $socid == -1) { |
1801 | - $sql .= " AND sp.fk_soc = " . ((int) $socid); |
|
1801 | + $sql .= " AND sp.fk_soc = ".((int) $socid); |
|
1802 | 1802 | } |
1803 | 1803 | if (!empty($conf->global->CONTACT_HIDE_INACTIVE_IN_COMBOBOX)) { |
1804 | 1804 | $sql .= " AND sp.statut <> 0"; |
@@ -1809,30 +1809,30 @@ discard block |
||
1809 | 1809 | $sql .= $hookmanager->resPrint; |
1810 | 1810 | $sql .= " ORDER BY sp.lastname ASC"; |
1811 | 1811 | |
1812 | - dol_syslog(get_class($this) . "::selectcontacts", LOG_DEBUG); |
|
1812 | + dol_syslog(get_class($this)."::selectcontacts", LOG_DEBUG); |
|
1813 | 1813 | $resql = $this->db->query($sql); |
1814 | 1814 | if ($resql) { |
1815 | 1815 | $num = $this->db->num_rows($resql); |
1816 | 1816 | |
1817 | 1817 | if ($htmlname != 'none' && !$options_only) { |
1818 | - $out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlid . '" name="' . $htmlname . (($num || empty($disableifempty)) ? '' : ' disabled') . ($multiple ? '[]' : '') . '" ' . ($multiple ? 'multiple' : '') . ' ' . (!empty($moreparam) ? $moreparam : '') . '>'; |
|
1818 | + $out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" id="'.$htmlid.'" name="'.$htmlname.(($num || empty($disableifempty)) ? '' : ' disabled').($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').' '.(!empty($moreparam) ? $moreparam : '').'>'; |
|
1819 | 1819 | } |
1820 | 1820 | |
1821 | 1821 | if ($showempty && !is_numeric($showempty)) { |
1822 | 1822 | $textforempty = $showempty; |
1823 | - $out .= '<option class="optiongrey" value="-1"' . (in_array(-1, $selected) ? ' selected' : '') . '>' . $textforempty . '</option>'; |
|
1823 | + $out .= '<option class="optiongrey" value="-1"'.(in_array(-1, $selected) ? ' selected' : '').'>'.$textforempty.'</option>'; |
|
1824 | 1824 | } else { |
1825 | 1825 | if (($showempty == 1 || ($showempty == 3 && $num > 1)) && !$multiple) { |
1826 | - $out .= '<option value="0"' . (in_array(0, $selected) ? ' selected' : '') . '> </option>'; |
|
1826 | + $out .= '<option value="0"'.(in_array(0, $selected) ? ' selected' : '').'> </option>'; |
|
1827 | 1827 | } |
1828 | 1828 | if ($showempty == 2) { |
1829 | - $out .= '<option value="0"' . (in_array(0, $selected) ? ' selected' : '') . '>-- ' . $langs->trans("Internal") . ' --</option>'; |
|
1829 | + $out .= '<option value="0"'.(in_array(0, $selected) ? ' selected' : '').'>-- '.$langs->trans("Internal").' --</option>'; |
|
1830 | 1830 | } |
1831 | 1831 | } |
1832 | 1832 | |
1833 | 1833 | $i = 0; |
1834 | 1834 | if ($num) { |
1835 | - include_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php'; |
|
1835 | + include_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; |
|
1836 | 1836 | $contactstatic = new Contact($this->db); |
1837 | 1837 | |
1838 | 1838 | while ($i < $num) { |
@@ -1868,7 +1868,7 @@ discard block |
||
1868 | 1868 | } |
1869 | 1869 | $extendedInfos = implode(' - ', $extendedInfos); |
1870 | 1870 | if (!empty($extendedInfos)) { |
1871 | - $extendedInfos = ' - ' . $extendedInfos; |
|
1871 | + $extendedInfos = ' - '.$extendedInfos; |
|
1872 | 1872 | } |
1873 | 1873 | } |
1874 | 1874 | |
@@ -1885,42 +1885,42 @@ discard block |
||
1885 | 1885 | $disabled = 1; |
1886 | 1886 | } |
1887 | 1887 | if (!empty($selected) && in_array($obj->rowid, $selected)) { |
1888 | - $out .= '<option value="' . $obj->rowid . '"'; |
|
1888 | + $out .= '<option value="'.$obj->rowid.'"'; |
|
1889 | 1889 | if ($disabled) { |
1890 | 1890 | $out .= ' disabled'; |
1891 | 1891 | } |
1892 | 1892 | $out .= ' selected>'; |
1893 | - $out .= $contactstatic->getFullName($langs) . $extendedInfos; |
|
1893 | + $out .= $contactstatic->getFullName($langs).$extendedInfos; |
|
1894 | 1894 | if ($showfunction && $obj->poste) { |
1895 | - $out .= ' (' . $obj->poste . ')'; |
|
1895 | + $out .= ' ('.$obj->poste.')'; |
|
1896 | 1896 | } |
1897 | 1897 | if (($showsoc > 0) && $obj->company) { |
1898 | - $out .= ' - (' . $obj->company . ')'; |
|
1898 | + $out .= ' - ('.$obj->company.')'; |
|
1899 | 1899 | } |
1900 | 1900 | $out .= '</option>'; |
1901 | 1901 | } else { |
1902 | - $out .= '<option value="' . $obj->rowid . '"'; |
|
1902 | + $out .= '<option value="'.$obj->rowid.'"'; |
|
1903 | 1903 | if ($disabled) { |
1904 | 1904 | $out .= ' disabled'; |
1905 | 1905 | } |
1906 | 1906 | $out .= '>'; |
1907 | - $out .= $contactstatic->getFullName($langs) . $extendedInfos; |
|
1907 | + $out .= $contactstatic->getFullName($langs).$extendedInfos; |
|
1908 | 1908 | if ($showfunction && $obj->poste) { |
1909 | - $out .= ' (' . $obj->poste . ')'; |
|
1909 | + $out .= ' ('.$obj->poste.')'; |
|
1910 | 1910 | } |
1911 | 1911 | if (($showsoc > 0) && $obj->company) { |
1912 | - $out .= ' - (' . $obj->company . ')'; |
|
1912 | + $out .= ' - ('.$obj->company.')'; |
|
1913 | 1913 | } |
1914 | 1914 | $out .= '</option>'; |
1915 | 1915 | } |
1916 | 1916 | } else { |
1917 | 1917 | if (in_array($obj->rowid, $selected)) { |
1918 | - $out .= $contactstatic->getFullName($langs) . $extendedInfos; |
|
1918 | + $out .= $contactstatic->getFullName($langs).$extendedInfos; |
|
1919 | 1919 | if ($showfunction && $obj->poste) { |
1920 | - $out .= ' (' . $obj->poste . ')'; |
|
1920 | + $out .= ' ('.$obj->poste.')'; |
|
1921 | 1921 | } |
1922 | 1922 | if (($showsoc > 0) && $obj->company) { |
1923 | - $out .= ' - (' . $obj->company . ')'; |
|
1923 | + $out .= ' - ('.$obj->company.')'; |
|
1924 | 1924 | } |
1925 | 1925 | } |
1926 | 1926 | } |
@@ -1929,7 +1929,7 @@ discard block |
||
1929 | 1929 | } |
1930 | 1930 | } else { |
1931 | 1931 | $labeltoshow = ($socid != -1) ? ($langs->trans($socid ? "NoContactDefinedForThirdParty" : "NoContactDefined")) : $langs->trans('SelectAThirdPartyFirst'); |
1932 | - $out .= '<option class="disabled" value="-1"' . (($showempty == 2 || $multiple) ? '' : ' selected') . ' disabled="disabled">'; |
|
1932 | + $out .= '<option class="disabled" value="-1"'.(($showempty == 2 || $multiple) ? '' : ' selected').' disabled="disabled">'; |
|
1933 | 1933 | $out .= $labeltoshow; |
1934 | 1934 | $out .= '</option>'; |
1935 | 1935 | } |
@@ -1950,7 +1950,7 @@ discard block |
||
1950 | 1950 | } |
1951 | 1951 | |
1952 | 1952 | if ($conf->use_javascript_ajax && !$forcecombo && !$options_only) { |
1953 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
1953 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
1954 | 1954 | $out .= ajax_combobox($htmlid, $events, getDolGlobalString("CONTACT_USE_SEARCH_TO_SELECT")); |
1955 | 1955 | } |
1956 | 1956 | |
@@ -2055,11 +2055,11 @@ discard block |
||
2055 | 2055 | if (isModEnabled('multicompany') && $conf->entity == 1 && $user->admin && !$user->entity) { |
2056 | 2056 | $sql .= ", e.label"; |
2057 | 2057 | } |
2058 | - $sql .= " FROM " . $this->db->prefix() . "user as u"; |
|
2058 | + $sql .= " FROM ".$this->db->prefix()."user as u"; |
|
2059 | 2059 | if (isModEnabled('multicompany') && $conf->entity == 1 && $user->admin && !$user->entity) { |
2060 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "entity as e ON e.rowid = u.entity"; |
|
2060 | + $sql .= " LEFT JOIN ".$this->db->prefix()."entity as e ON e.rowid = u.entity"; |
|
2061 | 2061 | if (!empty($force_entity)) { |
2062 | - $sql .= " WHERE u.entity IN (0, " . $this->db->sanitize($force_entity) . ")"; |
|
2062 | + $sql .= " WHERE u.entity IN (0, ".$this->db->sanitize($force_entity).")"; |
|
2063 | 2063 | } else { |
2064 | 2064 | $sql .= " WHERE u.entity IS NOT NULL"; |
2065 | 2065 | } |
@@ -2067,23 +2067,23 @@ discard block |
||
2067 | 2067 | if (isModEnabled('multicompany') && getDolGlobalInt('MULTICOMPANY_TRANSVERSE_MODE')) { |
2068 | 2068 | $sql .= " WHERE u.rowid IN (SELECT ug.fk_user FROM ".$this->db->prefix()."usergroup_user as ug WHERE ug.entity IN (".getEntity('usergroup')."))"; |
2069 | 2069 | } else { |
2070 | - $sql .= " WHERE u.entity IN (" . getEntity('user') . ")"; |
|
2070 | + $sql .= " WHERE u.entity IN (".getEntity('user').")"; |
|
2071 | 2071 | } |
2072 | 2072 | } |
2073 | 2073 | if (!empty($user->socid)) { |
2074 | - $sql .= " AND u.fk_soc = " . ((int) $user->socid); |
|
2074 | + $sql .= " AND u.fk_soc = ".((int) $user->socid); |
|
2075 | 2075 | } |
2076 | 2076 | if (is_array($exclude) && $excludeUsers) { |
2077 | - $sql .= " AND u.rowid NOT IN (" . $this->db->sanitize($excludeUsers) . ")"; |
|
2077 | + $sql .= " AND u.rowid NOT IN (".$this->db->sanitize($excludeUsers).")"; |
|
2078 | 2078 | } |
2079 | 2079 | if ($includeUsers) { |
2080 | - $sql .= " AND u.rowid IN (" . $this->db->sanitize($includeUsers) . ")"; |
|
2080 | + $sql .= " AND u.rowid IN (".$this->db->sanitize($includeUsers).")"; |
|
2081 | 2081 | } |
2082 | 2082 | if (!empty($conf->global->USER_HIDE_INACTIVE_IN_COMBOBOX) || $notdisabled) { |
2083 | 2083 | $sql .= " AND u.statut <> 0"; |
2084 | 2084 | } |
2085 | 2085 | if (!empty($morefilter)) { |
2086 | - $sql .= " " . $morefilter; |
|
2086 | + $sql .= " ".$morefilter; |
|
2087 | 2087 | } |
2088 | 2088 | |
2089 | 2089 | //Add hook to filter on user (for exemple on usergroup define in custom modules) |
@@ -2098,7 +2098,7 @@ discard block |
||
2098 | 2098 | $sql .= " ORDER BY u.statut DESC, u.lastname ASC, u.firstname ASC"; |
2099 | 2099 | } |
2100 | 2100 | |
2101 | - dol_syslog(get_class($this) . "::select_dolusers", LOG_DEBUG); |
|
2101 | + dol_syslog(get_class($this)."::select_dolusers", LOG_DEBUG); |
|
2102 | 2102 | |
2103 | 2103 | $resql = $this->db->query($sql); |
2104 | 2104 | if ($resql) { |
@@ -2106,7 +2106,7 @@ discard block |
||
2106 | 2106 | $i = 0; |
2107 | 2107 | if ($num) { |
2108 | 2108 | // do not use maxwidthonsmartphone by default. Set it by caller so auto size to 100% will work when not defined |
2109 | - $out .= '<select class="flat' . ($morecss ? ' ' . $morecss : ' minwidth200') . '" id="' . $htmlname . '" name="' . $htmlname . ($multiple ? '[]' : '') . '" ' . ($multiple ? 'multiple' : '') . ' ' . ($disabled ? ' disabled' : '') . '>'; |
|
2109 | + $out .= '<select class="flat'.($morecss ? ' '.$morecss : ' minwidth200').'" id="'.$htmlname.'" name="'.$htmlname.($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').' '.($disabled ? ' disabled' : '').'>'; |
|
2110 | 2110 | if ($show_empty && !$multiple) { |
2111 | 2111 | $textforempty = ' '; |
2112 | 2112 | if (!empty($conf->use_javascript_ajax)) { |
@@ -2115,10 +2115,10 @@ discard block |
||
2115 | 2115 | if (!is_numeric($show_empty)) { |
2116 | 2116 | $textforempty = $show_empty; |
2117 | 2117 | } |
2118 | - $out .= '<option class="optiongrey" value="' . ($show_empty < 0 ? $show_empty : -1) . '"' . ((empty($selected) || in_array(-1, $selected)) ? ' selected' : '') . '>' . $textforempty . '</option>' . "\n"; |
|
2118 | + $out .= '<option class="optiongrey" value="'.($show_empty < 0 ? $show_empty : -1).'"'.((empty($selected) || in_array(-1, $selected)) ? ' selected' : '').'>'.$textforempty.'</option>'."\n"; |
|
2119 | 2119 | } |
2120 | 2120 | if ($show_every) { |
2121 | - $out .= '<option value="-2"' . ((in_array(-2, $selected)) ? ' selected' : '') . '>-- ' . $langs->trans("Everybody") . ' --</option>' . "\n"; |
|
2121 | + $out .= '<option value="-2"'.((in_array(-2, $selected)) ? ' selected' : '').'>-- '.$langs->trans("Everybody").' --</option>'."\n"; |
|
2122 | 2122 | } |
2123 | 2123 | |
2124 | 2124 | $userstatic = new User($this->db); |
@@ -2165,22 +2165,22 @@ discard block |
||
2165 | 2165 | } |
2166 | 2166 | if ($showstatus >= 0) { |
2167 | 2167 | if ($obj->status == 1 && $showstatus == 1) { |
2168 | - $moreinfo .= ($moreinfo ? ' - ' : ' (') . $langs->trans('Enabled'); |
|
2169 | - $moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(') . $langs->trans('Enabled'); |
|
2168 | + $moreinfo .= ($moreinfo ? ' - ' : ' (').$langs->trans('Enabled'); |
|
2169 | + $moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(').$langs->trans('Enabled'); |
|
2170 | 2170 | } |
2171 | 2171 | if ($obj->status == 0 && $showstatus == 1) { |
2172 | - $moreinfo .= ($moreinfo ? ' - ' : ' (') . $langs->trans('Disabled'); |
|
2173 | - $moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(') . $langs->trans('Disabled'); |
|
2172 | + $moreinfo .= ($moreinfo ? ' - ' : ' (').$langs->trans('Disabled'); |
|
2173 | + $moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(').$langs->trans('Disabled'); |
|
2174 | 2174 | } |
2175 | 2175 | } |
2176 | 2176 | if (isModEnabled('multicompany') && !getDolGlobalInt('MULTICOMPANY_TRANSVERSE_MODE') && $conf->entity == 1 && !empty($user->admin) && empty($user->entity)) { |
2177 | 2177 | if (empty($obj->entity)) { |
2178 | - $moreinfo .= ($moreinfo ? ' - ' : ' (') . $langs->trans("AllEntities"); |
|
2179 | - $moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(') . $langs->trans("AllEntities"); |
|
2178 | + $moreinfo .= ($moreinfo ? ' - ' : ' (').$langs->trans("AllEntities"); |
|
2179 | + $moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(').$langs->trans("AllEntities"); |
|
2180 | 2180 | } else { |
2181 | 2181 | if ($obj->entity != $conf->entity) { |
2182 | - $moreinfo .= ($moreinfo ? ' - ' : ' (') . ($obj->label ? $obj->label : $langs->trans("EntityNameNotDefined")); |
|
2183 | - $moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(') . ($obj->label ? $obj->label : $langs->trans("EntityNameNotDefined")); |
|
2182 | + $moreinfo .= ($moreinfo ? ' - ' : ' (').($obj->label ? $obj->label : $langs->trans("EntityNameNotDefined")); |
|
2183 | + $moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(').($obj->label ? $obj->label : $langs->trans("EntityNameNotDefined")); |
|
2184 | 2184 | } |
2185 | 2185 | } |
2186 | 2186 | } |
@@ -2188,13 +2188,13 @@ discard block |
||
2188 | 2188 | $moreinfohtml .= (!empty($moreinfohtml) ? ')</span>' : ''); |
2189 | 2189 | if (!empty($disableline) && $disableline != '1') { |
2190 | 2190 | // Add text from $enableonlytext parameter |
2191 | - $moreinfo .= ' - ' . $disableline; |
|
2192 | - $moreinfohtml .= ' - ' . $disableline; |
|
2191 | + $moreinfo .= ' - '.$disableline; |
|
2192 | + $moreinfohtml .= ' - '.$disableline; |
|
2193 | 2193 | } |
2194 | 2194 | $labeltoshow .= $moreinfo; |
2195 | 2195 | $labeltoshowhtml .= $moreinfohtml; |
2196 | 2196 | |
2197 | - $out .= '<option value="' . $obj->rowid . '"'; |
|
2197 | + $out .= '<option value="'.$obj->rowid.'"'; |
|
2198 | 2198 | if (!empty($disableline)) { |
2199 | 2199 | $out .= ' disabled'; |
2200 | 2200 | } |
@@ -2202,7 +2202,7 @@ discard block |
||
2202 | 2202 | $out .= ' selected'; |
2203 | 2203 | } |
2204 | 2204 | $out .= ' data-html="'; |
2205 | - $outhtml = $userstatic->getNomUrl(-3, '', 0, 1, 24, 1, 'login', '', 1) . ' '; |
|
2205 | + $outhtml = $userstatic->getNomUrl(-3, '', 0, 1, 24, 1, 'login', '', 1).' '; |
|
2206 | 2206 | if ($showstatus >= 0 && $obj->status == 0) { |
2207 | 2207 | $outhtml .= '<strike class="opacitymediumxxx">'; |
2208 | 2208 | } |
@@ -2215,7 +2215,7 @@ discard block |
||
2215 | 2215 | $out .= $labeltoshow; |
2216 | 2216 | $out .= '</option>'; |
2217 | 2217 | |
2218 | - $outarray[$userstatic->id] = $userstatic->getFullName($langs, $fullNameMode, -1, $maxlength) . $moreinfo; |
|
2218 | + $outarray[$userstatic->id] = $userstatic->getFullName($langs, $fullNameMode, -1, $maxlength).$moreinfo; |
|
2219 | 2219 | $outarray2[$userstatic->id] = array( |
2220 | 2220 | 'id'=>$userstatic->id, |
2221 | 2221 | 'label'=>$labeltoshow, |
@@ -2227,14 +2227,14 @@ discard block |
||
2227 | 2227 | $i++; |
2228 | 2228 | } |
2229 | 2229 | } else { |
2230 | - $out .= '<select class="flat" id="' . $htmlname . '" name="' . $htmlname . '" disabled>'; |
|
2231 | - $out .= '<option value="">' . $langs->trans("None") . '</option>'; |
|
2230 | + $out .= '<select class="flat" id="'.$htmlname.'" name="'.$htmlname.'" disabled>'; |
|
2231 | + $out .= '<option value="">'.$langs->trans("None").'</option>'; |
|
2232 | 2232 | } |
2233 | 2233 | $out .= '</select>'; |
2234 | 2234 | |
2235 | 2235 | if ($num && !$forcecombo) { |
2236 | 2236 | // Enhance with select2 |
2237 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
2237 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
2238 | 2238 | $out .= ajax_combobox($htmlname); |
2239 | 2239 | } |
2240 | 2240 | } else { |
@@ -2304,16 +2304,16 @@ discard block |
||
2304 | 2304 | $out .= $userstatic->getNomUrl(-1); |
2305 | 2305 | if ($i == 0) { |
2306 | 2306 | $ownerid = $value['id']; |
2307 | - $out .= ' (' . $langs->trans("Owner") . ')'; |
|
2307 | + $out .= ' ('.$langs->trans("Owner").')'; |
|
2308 | 2308 | } |
2309 | 2309 | if ($nbassignetouser > 1 && $action != 'view') { |
2310 | - $out .= ' <input type="image" style="border: 0px;" src="' . img_picto($langs->trans("Remove"), 'delete', '', 0, 1) . '" value="' . $userstatic->id . '" class="removedassigned reposition" id="removedassigned_' . $userstatic->id . '" name="removedassigned_' . $userstatic->id . '">'; |
|
2310 | + $out .= ' <input type="image" style="border: 0px;" src="'.img_picto($langs->trans("Remove"), 'delete', '', 0, 1).'" value="'.$userstatic->id.'" class="removedassigned reposition" id="removedassigned_'.$userstatic->id.'" name="removedassigned_'.$userstatic->id.'">'; |
|
2311 | 2311 | } |
2312 | 2312 | // Show my availability |
2313 | 2313 | if ($showproperties) { |
2314 | 2314 | if ($ownerid == $value['id'] && is_array($listofuserid) && count($listofuserid) && in_array($ownerid, array_keys($listofuserid))) { |
2315 | 2315 | $out .= '<div class="myavailability inline-block">'; |
2316 | - $out .= '<span class="hideonsmartphone"> - <span class="opacitymedium">' . $langs->trans("Availability") . ':</span> </span><input id="transparency" class="paddingrightonly" ' . ($action == 'view' ? 'disabled' : '') . ' type="checkbox" name="transparency"' . ($listofuserid[$ownerid]['transparency'] ? ' checked' : '') . '><label for="transparency">' . $langs->trans("Busy") . '</label>'; |
|
2316 | + $out .= '<span class="hideonsmartphone"> - <span class="opacitymedium">'.$langs->trans("Availability").':</span> </span><input id="transparency" class="paddingrightonly" '.($action == 'view' ? 'disabled' : '').' type="checkbox" name="transparency"'.($listofuserid[$ownerid]['transparency'] ? ' checked' : '').'><label for="transparency">'.$langs->trans("Busy").'</label>'; |
|
2317 | 2317 | $out .= '</div>'; |
2318 | 2318 | } |
2319 | 2319 | } |
@@ -2330,15 +2330,15 @@ discard block |
||
2330 | 2330 | // Method with no ajax |
2331 | 2331 | if ($action != 'view') { |
2332 | 2332 | $out .= '<input type="hidden" class="removedassignedhidden" name="removedassigned" value="">'; |
2333 | - $out .= '<script nonce="' . getNonce() . '" type="text/javascript">jQuery(document).ready(function () {'; |
|
2333 | + $out .= '<script nonce="'.getNonce().'" type="text/javascript">jQuery(document).ready(function () {'; |
|
2334 | 2334 | $out .= 'jQuery(".removedassigned").click(function() { jQuery(".removedassignedhidden").val(jQuery(this).val()); });'; |
2335 | 2335 | $out .= 'jQuery(".assignedtouser").change(function() { console.log(jQuery(".assignedtouser option:selected").val());'; |
2336 | - $out .= ' if (jQuery(".assignedtouser option:selected").val() > 0) { jQuery("#' . $action . 'assignedtouser").attr("disabled", false); }'; |
|
2337 | - $out .= ' else { jQuery("#' . $action . 'assignedtouser").attr("disabled", true); }'; |
|
2336 | + $out .= ' if (jQuery(".assignedtouser option:selected").val() > 0) { jQuery("#'.$action.'assignedtouser").attr("disabled", false); }'; |
|
2337 | + $out .= ' else { jQuery("#'.$action.'assignedtouser").attr("disabled", true); }'; |
|
2338 | 2338 | $out .= '});'; |
2339 | 2339 | $out .= '})</script>'; |
2340 | 2340 | $out .= $this->select_dolusers('', $htmlname, $show_empty, $exclude, $disabled, $include, $enableonly, $force_entity, $maxlength, $showstatus, $morefilter); |
2341 | - $out .= ' <input type="submit" disabled class="button valignmiddle smallpaddingimp reposition" id="' . $action . 'assignedtouser" name="' . $action . 'assignedtouser" value="' . dol_escape_htmltag($langs->trans("Add")) . '">'; |
|
2341 | + $out .= ' <input type="submit" disabled class="button valignmiddle smallpaddingimp reposition" id="'.$action.'assignedtouser" name="'.$action.'assignedtouser" value="'.dol_escape_htmltag($langs->trans("Add")).'">'; |
|
2342 | 2342 | $out .= '<br>'; |
2343 | 2343 | } |
2344 | 2344 | |
@@ -2393,13 +2393,13 @@ discard block |
||
2393 | 2393 | $resourcestatic->fetch($value['id']); |
2394 | 2394 | $out .= $resourcestatic->getNomUrl(-1); |
2395 | 2395 | if ($nbassignetoresource > 1 && $action != 'view') { |
2396 | - $out .= ' <input type="image" style="border: 0px;" src="' . img_picto($langs->trans("Remove"), 'delete', '', 0, 1) . '" value="' . $resourcestatic->id . '" class="removedassigned reposition" id="removedassignedresource_' . $resourcestatic->id . '" name="removedassignedresource_' . $resourcestatic->id . '">'; |
|
2396 | + $out .= ' <input type="image" style="border: 0px;" src="'.img_picto($langs->trans("Remove"), 'delete', '', 0, 1).'" value="'.$resourcestatic->id.'" class="removedassigned reposition" id="removedassignedresource_'.$resourcestatic->id.'" name="removedassignedresource_'.$resourcestatic->id.'">'; |
|
2397 | 2397 | } |
2398 | 2398 | // Show my availability |
2399 | 2399 | if ($showproperties) { |
2400 | 2400 | if (is_array($listofresourceid) && count($listofresourceid)) { |
2401 | 2401 | $out .= '<div class="myavailability inline-block">'; |
2402 | - $out .= '<span class="hideonsmartphone"> - <span class="opacitymedium">' . $langs->trans("Availability") . ':</span> </span><input id="transparencyresource" class="paddingrightonly" ' . ($action == 'view' ? 'disabled' : '') . ' type="checkbox" name="transparency"' . ($listofresourceid[$value['id']]['transparency'] ? ' checked' : '') . '><label for="transparency">' . $langs->trans("Busy") . '</label>'; |
|
2402 | + $out .= '<span class="hideonsmartphone"> - <span class="opacitymedium">'.$langs->trans("Availability").':</span> </span><input id="transparencyresource" class="paddingrightonly" '.($action == 'view' ? 'disabled' : '').' type="checkbox" name="transparency"'.($listofresourceid[$value['id']]['transparency'] ? ' checked' : '').'><label for="transparency">'.$langs->trans("Busy").'</label>'; |
|
2403 | 2403 | $out .= '</div>'; |
2404 | 2404 | } |
2405 | 2405 | } |
@@ -2416,11 +2416,11 @@ discard block |
||
2416 | 2416 | // Method with no ajax |
2417 | 2417 | if ($action != 'view') { |
2418 | 2418 | $out .= '<input type="hidden" class="removedassignedhidden" name="removedassignedresource" value="">'; |
2419 | - $out .= '<script nonce="' . getNonce() . '" type="text/javascript">jQuery(document).ready(function () {'; |
|
2419 | + $out .= '<script nonce="'.getNonce().'" type="text/javascript">jQuery(document).ready(function () {'; |
|
2420 | 2420 | $out .= 'jQuery(".removedassignedresource").click(function() { jQuery(".removedassignedresourcehidden").val(jQuery(this).val()); });'; |
2421 | 2421 | $out .= 'jQuery(".assignedtoresource").change(function() { console.log(jQuery(".assignedtoresource option:selected").val());'; |
2422 | - $out .= ' if (jQuery(".assignedtoresource option:selected").val() > 0) { jQuery("#' . $action . 'assignedtoresource").attr("disabled", false); }'; |
|
2423 | - $out .= ' else { jQuery("#' . $action . 'assignedtoresource").attr("disabled", true); }'; |
|
2422 | + $out .= ' if (jQuery(".assignedtoresource option:selected").val() > 0) { jQuery("#'.$action.'assignedtoresource").attr("disabled", false); }'; |
|
2423 | + $out .= ' else { jQuery("#'.$action.'assignedtoresource").attr("disabled", true); }'; |
|
2424 | 2424 | $out .= '});'; |
2425 | 2425 | $out .= '})</script>'; |
2426 | 2426 | |
@@ -2428,7 +2428,7 @@ discard block |
||
2428 | 2428 | $out .= img_picto('', 'resource', 'class="pictofixedwidth"'); |
2429 | 2429 | $out .= $formresources->select_resource_list('', $htmlname, '', 1, 1, 0, $events, '', 2, null); |
2430 | 2430 | //$out .= $this->select_dolusers('', $htmlname, $show_empty, $exclude, $disabled, $include, $enableonly, $force_entity, $maxlength, $showstatus, $morefilter); |
2431 | - $out .= ' <input type="submit" disabled class="button valignmiddle smallpaddingimp reposition" id="' . $action . 'assignedtoresource" name="' . $action . 'assignedtoresource" value="' . dol_escape_htmltag($langs->trans("Add")) . '">'; |
|
2431 | + $out .= ' <input type="submit" disabled class="button valignmiddle smallpaddingimp reposition" id="'.$action.'assignedtoresource" name="'.$action.'assignedtoresource" value="'.dol_escape_htmltag($langs->trans("Add")).'">'; |
|
2432 | 2432 | $out .= '<br>'; |
2433 | 2433 | } |
2434 | 2434 | |
@@ -2489,7 +2489,7 @@ discard block |
||
2489 | 2489 | $placeholder = ''; |
2490 | 2490 | |
2491 | 2491 | if ($selected && empty($selected_input_value)) { |
2492 | - require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; |
|
2492 | + require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; |
|
2493 | 2493 | $producttmpselect = new Product($this->db); |
2494 | 2494 | $producttmpselect->fetch($selected); |
2495 | 2495 | $selected_input_value = $producttmpselect->ref; |
@@ -2504,17 +2504,17 @@ discard block |
||
2504 | 2504 | } |
2505 | 2505 | } |
2506 | 2506 | // mode=1 means customers products |
2507 | - $urloption = ($socid > 0 ? 'socid=' . $socid . '&' : '') . 'htmlname=' . $htmlname . '&outjson=1&price_level=' . $price_level . '&type=' . $filtertype . '&mode=1&status=' . $status . '&status_purchase=' . $status_purchase . '&finished=' . $finished . '&hidepriceinlabel=' . $hidepriceinlabel . '&warehousestatus=' . $warehouseStatus; |
|
2508 | - $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/product/ajax/products.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions); |
|
2507 | + $urloption = ($socid > 0 ? 'socid='.$socid.'&' : '').'htmlname='.$htmlname.'&outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=1&status='.$status.'&status_purchase='.$status_purchase.'&finished='.$finished.'&hidepriceinlabel='.$hidepriceinlabel.'&warehousestatus='.$warehouseStatus; |
|
2508 | + $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/product/ajax/products.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions); |
|
2509 | 2509 | |
2510 | 2510 | if (isModEnabled('variants') && is_array($selected_combinations)) { |
2511 | 2511 | // Code to automatically insert with javascript the select of attributes under the select of product |
2512 | 2512 | // when a parent of variant has been selected. |
2513 | 2513 | $out .= ' |
2514 | 2514 | <!-- script to auto show attributes select tags if a variant was selected --> |
2515 | - <script nonce="' . getNonce() . '"> |
|
2515 | + <script nonce="' . getNonce().'"> |
|
2516 | 2516 | // auto show attributes fields |
2517 | - selected = ' . json_encode($selected_combinations) . '; |
|
2517 | + selected = ' . json_encode($selected_combinations).'; |
|
2518 | 2518 | combvalues = {}; |
2519 | 2519 | |
2520 | 2520 | jQuery(document).ready(function () { |
@@ -2525,7 +2525,7 @@ discard block |
||
2525 | 2525 | } |
2526 | 2526 | }); |
2527 | 2527 | |
2528 | - jQuery("input#' . $htmlname . '").change(function () { |
|
2528 | + jQuery("input#' . $htmlname.'").change(function () { |
|
2529 | 2529 | |
2530 | 2530 | if (!jQuery(this).val()) { |
2531 | 2531 | jQuery(\'div#attributes_box\').empty(); |
@@ -2534,7 +2534,7 @@ discard block |
||
2534 | 2534 | |
2535 | 2535 | console.log("A change has started. We get variants fields to inject html select"); |
2536 | 2536 | |
2537 | - jQuery.getJSON("' . DOL_URL_ROOT . '/variants/ajax/getCombinations.php", { |
|
2537 | + jQuery.getJSON("' . DOL_URL_ROOT.'/variants/ajax/getCombinations.php", { |
|
2538 | 2538 | id: jQuery(this).val() |
2539 | 2539 | }, function (data) { |
2540 | 2540 | jQuery(\'div#attributes_box\').empty(); |
@@ -2577,21 +2577,21 @@ discard block |
||
2577 | 2577 | }) |
2578 | 2578 | }); |
2579 | 2579 | |
2580 | - ' . ($selected ? 'jQuery("input#' . $htmlname . '").change();' : '') . ' |
|
2580 | + ' . ($selected ? 'jQuery("input#'.$htmlname.'").change();' : '').' |
|
2581 | 2581 | }); |
2582 | 2582 | </script> |
2583 | 2583 | '; |
2584 | 2584 | } |
2585 | 2585 | |
2586 | 2586 | if (empty($hidelabel)) { |
2587 | - $out .= $langs->trans("RefOrLabel") . ' : '; |
|
2587 | + $out .= $langs->trans("RefOrLabel").' : '; |
|
2588 | 2588 | } elseif ($hidelabel > 1) { |
2589 | - $placeholder = ' placeholder="' . $langs->trans("RefOrLabel") . '"'; |
|
2589 | + $placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"'; |
|
2590 | 2590 | if ($hidelabel == 2) { |
2591 | 2591 | $out .= img_picto($langs->trans("Search"), 'search'); |
2592 | 2592 | } |
2593 | 2593 | } |
2594 | - $out .= '<input type="text" class="minwidth100' . ($morecss ? ' ' . $morecss : '') . '" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (!empty($conf->global->PRODUCT_SEARCH_AUTOFOCUS) ? 'autofocus' : '') . ' />'; |
|
2594 | + $out .= '<input type="text" class="minwidth100'.($morecss ? ' '.$morecss : '').'" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(!empty($conf->global->PRODUCT_SEARCH_AUTOFOCUS) ? 'autofocus' : '').' />'; |
|
2595 | 2595 | if ($hidelabel == 3) { |
2596 | 2596 | $out .= img_picto($langs->trans("Search"), 'search'); |
2597 | 2597 | } |
@@ -2628,26 +2628,26 @@ discard block |
||
2628 | 2628 | // phpcs:enable |
2629 | 2629 | global $conf, $user, $langs, $db; |
2630 | 2630 | |
2631 | - require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; |
|
2631 | + require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; |
|
2632 | 2632 | |
2633 | 2633 | $error = 0; |
2634 | 2634 | $out = ''; |
2635 | 2635 | |
2636 | 2636 | if (!$forcecombo) { |
2637 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
2637 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
2638 | 2638 | $events = array(); |
2639 | 2639 | $out .= ajax_combobox($htmlname, $events, getDolGlobalInt("PRODUIT_USE_SEARCH_TO_SELECT")); |
2640 | 2640 | } |
2641 | 2641 | |
2642 | - $out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">'; |
|
2642 | + $out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">'; |
|
2643 | 2643 | |
2644 | 2644 | $sql = 'SELECT b.rowid, b.ref, b.label, b.fk_product'; |
2645 | - $sql .= ' FROM ' . MAIN_DB_PREFIX . 'bom_bom as b'; |
|
2646 | - $sql .= ' WHERE b.entity IN (' . getEntity('bom') . ')'; |
|
2647 | - if (!empty($status)) $sql .= ' AND status = ' . (int) $status; |
|
2648 | - if (!empty($type)) $sql .= ' AND bomtype = ' . (int) $type; |
|
2649 | - if (!empty($TProducts)) $sql .= ' AND fk_product IN (' . $this->db->sanitize(implode(',', $TProducts)) . ')'; |
|
2650 | - if (!empty($limit)) $sql .= ' LIMIT ' . (int) $limit; |
|
2645 | + $sql .= ' FROM '.MAIN_DB_PREFIX.'bom_bom as b'; |
|
2646 | + $sql .= ' WHERE b.entity IN ('.getEntity('bom').')'; |
|
2647 | + if (!empty($status)) $sql .= ' AND status = '.(int) $status; |
|
2648 | + if (!empty($type)) $sql .= ' AND bomtype = '.(int) $type; |
|
2649 | + if (!empty($TProducts)) $sql .= ' AND fk_product IN ('.$this->db->sanitize(implode(',', $TProducts)).')'; |
|
2650 | + if (!empty($limit)) $sql .= ' LIMIT '.(int) $limit; |
|
2651 | 2651 | $resql = $db->query($sql); |
2652 | 2652 | if ($resql) { |
2653 | 2653 | if ($showempty) { |
@@ -2658,9 +2658,9 @@ discard block |
||
2658 | 2658 | while ($obj = $db->fetch_object($resql)) { |
2659 | 2659 | $product = new Product($db); |
2660 | 2660 | $res = $product->fetch($obj->fk_product); |
2661 | - $out .= '<option value="' . $obj->rowid . '"'; |
|
2661 | + $out .= '<option value="'.$obj->rowid.'"'; |
|
2662 | 2662 | if ($obj->rowid == $selected) $out .= 'selected'; |
2663 | - $out .= '>' . $obj->ref . ' - ' . $product->label . ' - ' . $obj->label . '</option>'; |
|
2663 | + $out .= '>'.$obj->ref.' - '.$product->label.' - '.$obj->label.'</option>'; |
|
2664 | 2664 | } |
2665 | 2665 | } else { |
2666 | 2666 | $error++; |
@@ -2717,7 +2717,7 @@ discard block |
||
2717 | 2717 | |
2718 | 2718 | $warehouseStatusArray = array(); |
2719 | 2719 | if (!empty($warehouseStatus)) { |
2720 | - require_once DOL_DOCUMENT_ROOT . '/product/stock/class/entrepot.class.php'; |
|
2720 | + require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php'; |
|
2721 | 2721 | if (preg_match('/warehouseclosed/', $warehouseStatus)) { |
2722 | 2722 | $warehouseStatusArray[] = Entrepot::STATUS_CLOSED; |
2723 | 2723 | } |
@@ -2731,9 +2731,9 @@ discard block |
||
2731 | 2731 | |
2732 | 2732 | $selectFields = " p.rowid, p.ref, p.label, p.description, p.barcode, p.fk_country, p.fk_product_type, p.price, p.price_ttc, p.price_base_type, p.tva_tx, p.default_vat_code, p.duration, p.fk_price_expression"; |
2733 | 2733 | if (count($warehouseStatusArray)) { |
2734 | - $selectFieldsGrouped = ", sum(" . $this->db->ifsql("e.statut IS NULL", "0", "ps.reel") . ") as stock"; // e.statut is null if there is no record in stock |
|
2734 | + $selectFieldsGrouped = ", sum(".$this->db->ifsql("e.statut IS NULL", "0", "ps.reel").") as stock"; // e.statut is null if there is no record in stock |
|
2735 | 2735 | } else { |
2736 | - $selectFieldsGrouped = ", " . $this->db->ifsql("p.stock IS NULL", 0, "p.stock") . " AS stock"; |
|
2736 | + $selectFieldsGrouped = ", ".$this->db->ifsql("p.stock IS NULL", 0, "p.stock")." AS stock"; |
|
2737 | 2737 | } |
2738 | 2738 | |
2739 | 2739 | $sql = "SELECT "; |
@@ -2749,9 +2749,9 @@ discard block |
||
2749 | 2749 | |
2750 | 2750 | if (!empty($conf->global->PRODUCT_SORT_BY_CATEGORY)) { |
2751 | 2751 | //Product category |
2752 | - $sql .= ", (SELECT " . $this->db->prefix() . "categorie_product.fk_categorie |
|
2753 | - FROM " . $this->db->prefix() . "categorie_product |
|
2754 | - WHERE " . $this->db->prefix() . "categorie_product.fk_product=p.rowid |
|
2752 | + $sql .= ", (SELECT ".$this->db->prefix()."categorie_product.fk_categorie |
|
2753 | + FROM " . $this->db->prefix()."categorie_product |
|
2754 | + WHERE " . $this->db->prefix()."categorie_product.fk_product=p.rowid |
|
2755 | 2755 | LIMIT 1 |
2756 | 2756 | ) AS categorie_product_id "; |
2757 | 2757 | } |
@@ -2777,15 +2777,15 @@ discard block |
||
2777 | 2777 | } |
2778 | 2778 | // Price by quantity |
2779 | 2779 | if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY) || !empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) { |
2780 | - $sql .= ", (SELECT pp.rowid FROM " . $this->db->prefix() . "product_price as pp WHERE pp.fk_product = p.rowid"; |
|
2780 | + $sql .= ", (SELECT pp.rowid FROM ".$this->db->prefix()."product_price as pp WHERE pp.fk_product = p.rowid"; |
|
2781 | 2781 | if ($price_level >= 1 && !empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) { |
2782 | - $sql .= " AND price_level = " . ((int) $price_level); |
|
2782 | + $sql .= " AND price_level = ".((int) $price_level); |
|
2783 | 2783 | } |
2784 | 2784 | $sql .= " ORDER BY date_price"; |
2785 | 2785 | $sql .= " DESC LIMIT 1) as price_rowid"; |
2786 | - $sql .= ", (SELECT pp.price_by_qty FROM " . $this->db->prefix() . "product_price as pp WHERE pp.fk_product = p.rowid"; // price_by_qty is 1 if some prices by qty exists in subtable |
|
2786 | + $sql .= ", (SELECT pp.price_by_qty FROM ".$this->db->prefix()."product_price as pp WHERE pp.fk_product = p.rowid"; // price_by_qty is 1 if some prices by qty exists in subtable |
|
2787 | 2787 | if ($price_level >= 1 && !empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) { |
2788 | - $sql .= " AND price_level = " . ((int) $price_level); |
|
2788 | + $sql .= " AND price_level = ".((int) $price_level); |
|
2789 | 2789 | } |
2790 | 2790 | $sql .= " ORDER BY date_price"; |
2791 | 2791 | $sql .= " DESC LIMIT 1) as price_by_qty"; |
@@ -2799,67 +2799,67 @@ discard block |
||
2799 | 2799 | $sql .= $hookmanager->resPrint; |
2800 | 2800 | |
2801 | 2801 | if (count($warehouseStatusArray)) { |
2802 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "product_stock as ps on ps.fk_product = p.rowid"; |
|
2803 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "entrepot as e on ps.fk_entrepot = e.rowid AND e.entity IN (" . getEntity('stock') . ")"; |
|
2804 | - $sql .= ' AND e.statut IN (' . $this->db->sanitize($this->db->escape(implode(',', $warehouseStatusArray))) . ')'; // Return line if product is inside the selected stock. If not, an empty line will be returned so we will count 0. |
|
2802 | + $sql .= " LEFT JOIN ".$this->db->prefix()."product_stock as ps on ps.fk_product = p.rowid"; |
|
2803 | + $sql .= " LEFT JOIN ".$this->db->prefix()."entrepot as e on ps.fk_entrepot = e.rowid AND e.entity IN (".getEntity('stock').")"; |
|
2804 | + $sql .= ' AND e.statut IN ('.$this->db->sanitize($this->db->escape(implode(',', $warehouseStatusArray))).')'; // Return line if product is inside the selected stock. If not, an empty line will be returned so we will count 0. |
|
2805 | 2805 | } |
2806 | 2806 | |
2807 | 2807 | // include search in supplier ref |
2808 | 2808 | if (!empty($conf->global->MAIN_SEARCH_PRODUCT_BY_FOURN_REF)) { |
2809 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "product_fournisseur_price as pfp ON p.rowid = pfp.fk_product"; |
|
2809 | + $sql .= " LEFT JOIN ".$this->db->prefix()."product_fournisseur_price as pfp ON p.rowid = pfp.fk_product"; |
|
2810 | 2810 | } |
2811 | 2811 | |
2812 | 2812 | //Price by customer |
2813 | 2813 | if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES) && !empty($socid)) { |
2814 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "product_customer_price as pcp ON pcp.fk_soc=" . ((int) $socid) . " AND pcp.fk_product=p.rowid"; |
|
2814 | + $sql .= " LEFT JOIN ".$this->db->prefix()."product_customer_price as pcp ON pcp.fk_soc=".((int) $socid)." AND pcp.fk_product=p.rowid"; |
|
2815 | 2815 | } |
2816 | 2816 | // Units |
2817 | 2817 | if (getDolGlobalInt('PRODUCT_USE_UNITS')) { |
2818 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "c_units u ON u.rowid = p.fk_unit"; |
|
2818 | + $sql .= " LEFT JOIN ".$this->db->prefix()."c_units u ON u.rowid = p.fk_unit"; |
|
2819 | 2819 | } |
2820 | 2820 | // Multilang : we add translation |
2821 | 2821 | if (getDolGlobalInt('MAIN_MULTILANGS')) { |
2822 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "product_lang as pl ON pl.fk_product = p.rowid "; |
|
2822 | + $sql .= " LEFT JOIN ".$this->db->prefix()."product_lang as pl ON pl.fk_product = p.rowid "; |
|
2823 | 2823 | if (!empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE) && !empty($socid)) { |
2824 | - require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php'; |
|
2824 | + require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; |
|
2825 | 2825 | $soc = new Societe($this->db); |
2826 | 2826 | $result = $soc->fetch($socid); |
2827 | 2827 | if ($result > 0 && !empty($soc->default_lang)) { |
2828 | - $sql .= " AND pl.lang = '" . $this->db->escape($soc->default_lang) . "'"; |
|
2828 | + $sql .= " AND pl.lang = '".$this->db->escape($soc->default_lang)."'"; |
|
2829 | 2829 | } else { |
2830 | - $sql .= " AND pl.lang = '" . $this->db->escape($langs->getDefaultLang()) . "'"; |
|
2830 | + $sql .= " AND pl.lang = '".$this->db->escape($langs->getDefaultLang())."'"; |
|
2831 | 2831 | } |
2832 | 2832 | } else { |
2833 | - $sql .= " AND pl.lang = '" . $this->db->escape($langs->getDefaultLang()) . "'"; |
|
2833 | + $sql .= " AND pl.lang = '".$this->db->escape($langs->getDefaultLang())."'"; |
|
2834 | 2834 | } |
2835 | 2835 | } |
2836 | 2836 | |
2837 | 2837 | if (!empty($conf->global->PRODUIT_ATTRIBUTES_HIDECHILD)) { |
2838 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "product_attribute_combination pac ON pac.fk_product_child = p.rowid"; |
|
2838 | + $sql .= " LEFT JOIN ".$this->db->prefix()."product_attribute_combination pac ON pac.fk_product_child = p.rowid"; |
|
2839 | 2839 | } |
2840 | 2840 | |
2841 | - $sql .= ' WHERE p.entity IN (' . getEntity('product') . ')'; |
|
2841 | + $sql .= ' WHERE p.entity IN ('.getEntity('product').')'; |
|
2842 | 2842 | |
2843 | 2843 | if (!empty($conf->global->PRODUIT_ATTRIBUTES_HIDECHILD)) { |
2844 | 2844 | $sql .= " AND pac.rowid IS NULL"; |
2845 | 2845 | } |
2846 | 2846 | |
2847 | 2847 | if ($finished == 0) { |
2848 | - $sql .= " AND p.finished = " . ((int) $finished); |
|
2848 | + $sql .= " AND p.finished = ".((int) $finished); |
|
2849 | 2849 | } elseif ($finished == 1) { |
2850 | - $sql .= " AND p.finished = " . ((int) $finished); |
|
2850 | + $sql .= " AND p.finished = ".((int) $finished); |
|
2851 | 2851 | if ($status >= 0) { |
2852 | - $sql .= " AND p.tosell = " . ((int) $status); |
|
2852 | + $sql .= " AND p.tosell = ".((int) $status); |
|
2853 | 2853 | } |
2854 | 2854 | } elseif ($status >= 0) { |
2855 | - $sql .= " AND p.tosell = " . ((int) $status); |
|
2855 | + $sql .= " AND p.tosell = ".((int) $status); |
|
2856 | 2856 | } |
2857 | 2857 | if ($status_purchase >= 0) { |
2858 | - $sql .= " AND p.tobuy = " . ((int) $status_purchase); |
|
2858 | + $sql .= " AND p.tobuy = ".((int) $status_purchase); |
|
2859 | 2859 | } |
2860 | 2860 | // Filter by product type |
2861 | 2861 | if (strval($filtertype) != '') { |
2862 | - $sql .= " AND p.fk_product_type = " . ((int) $filtertype); |
|
2862 | + $sql .= " AND p.fk_product_type = ".((int) $filtertype); |
|
2863 | 2863 | } elseif (!isModEnabled('product')) { // when product module is disabled, show services only |
2864 | 2864 | $sql .= " AND p.fk_product_type = 1"; |
2865 | 2865 | } elseif (!isModEnabled('service')) { // when service module is disabled, show products only |
@@ -2883,21 +2883,21 @@ discard block |
||
2883 | 2883 | if ($i > 0) { |
2884 | 2884 | $sql .= " AND "; |
2885 | 2885 | } |
2886 | - $sql .= "(p.ref LIKE '" . $this->db->escape($prefix . $crit) . "%' OR p.label LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
2886 | + $sql .= "(p.ref LIKE '".$this->db->escape($prefix.$crit)."%' OR p.label LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
2887 | 2887 | if (getDolGlobalInt('MAIN_MULTILANGS')) { |
2888 | - $sql .= " OR pl.label LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
2888 | + $sql .= " OR pl.label LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
2889 | 2889 | } |
2890 | 2890 | if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES) && !empty($socid)) { |
2891 | - $sql .= " OR pcp.ref_customer LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
2891 | + $sql .= " OR pcp.ref_customer LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
2892 | 2892 | } |
2893 | 2893 | if (!empty($conf->global->PRODUCT_AJAX_SEARCH_ON_DESCRIPTION)) { |
2894 | - $sql .= " OR p.description LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
2894 | + $sql .= " OR p.description LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
2895 | 2895 | if (getDolGlobalInt('MAIN_MULTILANGS')) { |
2896 | - $sql .= " OR pl.description LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
2896 | + $sql .= " OR pl.description LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
2897 | 2897 | } |
2898 | 2898 | } |
2899 | 2899 | if (!empty($conf->global->MAIN_SEARCH_PRODUCT_BY_FOURN_REF)) { |
2900 | - $sql .= " OR pfp.ref_fourn LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
2900 | + $sql .= " OR pfp.ref_fourn LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
2901 | 2901 | } |
2902 | 2902 | $sql .= ")"; |
2903 | 2903 | $i++; |
@@ -2906,12 +2906,12 @@ discard block |
||
2906 | 2906 | $sql .= ")"; |
2907 | 2907 | } |
2908 | 2908 | if (isModEnabled('barcode')) { |
2909 | - $sql .= " OR p.barcode LIKE '" . $this->db->escape($prefix . $filterkey) . "%'"; |
|
2909 | + $sql .= " OR p.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'"; |
|
2910 | 2910 | } |
2911 | 2911 | $sql .= ')'; |
2912 | 2912 | } |
2913 | 2913 | if (count($warehouseStatusArray)) { |
2914 | - $sql .= " GROUP BY " . $selectFields; |
|
2914 | + $sql .= " GROUP BY ".$selectFields; |
|
2915 | 2915 | } |
2916 | 2916 | |
2917 | 2917 | //Sort by category |
@@ -2926,23 +2926,23 @@ discard block |
||
2926 | 2926 | $sql .= $this->db->plimit($limit, 0); |
2927 | 2927 | |
2928 | 2928 | // Build output string |
2929 | - dol_syslog(get_class($this) . "::select_produits_list search products", LOG_DEBUG); |
|
2929 | + dol_syslog(get_class($this)."::select_produits_list search products", LOG_DEBUG); |
|
2930 | 2930 | $result = $this->db->query($sql); |
2931 | 2931 | if ($result) { |
2932 | - require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; |
|
2933 | - require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php'; |
|
2934 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/product.lib.php'; |
|
2932 | + require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; |
|
2933 | + require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php'; |
|
2934 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php'; |
|
2935 | 2935 | |
2936 | 2936 | $num = $this->db->num_rows($result); |
2937 | 2937 | |
2938 | 2938 | $events = null; |
2939 | 2939 | |
2940 | 2940 | if (!$forcecombo) { |
2941 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
2941 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
2942 | 2942 | $out .= ajax_combobox($htmlname, $events, getDolGlobalInt("PRODUIT_USE_SEARCH_TO_SELECT")); |
2943 | 2943 | } |
2944 | 2944 | |
2945 | - $out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">'; |
|
2945 | + $out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">'; |
|
2946 | 2946 | |
2947 | 2947 | $textifempty = ''; |
2948 | 2948 | // Do not use textifempty = ' ' or ' ' here, or search on key will search on ' key'. |
@@ -2959,7 +2959,7 @@ discard block |
||
2959 | 2959 | } |
2960 | 2960 | } |
2961 | 2961 | if ($showempty) { |
2962 | - $out .= '<option value="-1" selected>' . ($textifempty ? $textifempty : ' ') . '</option>'; |
|
2962 | + $out .= '<option value="-1" selected>'.($textifempty ? $textifempty : ' ').'</option>'; |
|
2963 | 2963 | } |
2964 | 2964 | |
2965 | 2965 | $i = 0; |
@@ -2970,11 +2970,11 @@ discard block |
||
2970 | 2970 | |
2971 | 2971 | if ((!empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY) || !empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) && !empty($objp->price_by_qty) && $objp->price_by_qty == 1) { // Price by quantity will return many prices for the same product |
2972 | 2972 | $sql = "SELECT rowid, quantity, price, unitprice, remise_percent, remise, price_base_type"; |
2973 | - $sql .= " FROM " . $this->db->prefix() . "product_price_by_qty"; |
|
2974 | - $sql .= " WHERE fk_product_price = " . ((int) $objp->price_rowid); |
|
2973 | + $sql .= " FROM ".$this->db->prefix()."product_price_by_qty"; |
|
2974 | + $sql .= " WHERE fk_product_price = ".((int) $objp->price_rowid); |
|
2975 | 2975 | $sql .= " ORDER BY quantity ASC"; |
2976 | 2976 | |
2977 | - dol_syslog(get_class($this) . "::select_produits_list search prices by qty", LOG_DEBUG); |
|
2977 | + dol_syslog(get_class($this)."::select_produits_list search prices by qty", LOG_DEBUG); |
|
2978 | 2978 | $result2 = $this->db->query($sql); |
2979 | 2979 | if ($result2) { |
2980 | 2980 | $nb_prices = $this->db->num_rows($result2); |
@@ -3012,7 +3012,7 @@ discard block |
||
3012 | 3012 | $price_product = new Product($this->db); |
3013 | 3013 | $price_product->fetch($objp->rowid, '', '', 1); |
3014 | 3014 | |
3015 | - require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php'; |
|
3015 | + require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php'; |
|
3016 | 3016 | $priceparser = new PriceParser($this->db); |
3017 | 3017 | $price_result = $priceparser->parseProduct($price_product); |
3018 | 3018 | if ($price_result >= 0) { |
@@ -3096,7 +3096,7 @@ discard block |
||
3096 | 3096 | $label = $objp->label_translated; |
3097 | 3097 | } |
3098 | 3098 | if (!empty($filterkey) && $filterkey != '') { |
3099 | - $label = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $label, 1); |
|
3099 | + $label = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $label, 1); |
|
3100 | 3100 | } |
3101 | 3101 | |
3102 | 3102 | $outkey = $objp->rowid; |
@@ -3117,32 +3117,32 @@ discard block |
||
3117 | 3117 | $outdurationunit = $outtype == Product::TYPE_SERVICE ? substr($objp->duration, -1) : ''; |
3118 | 3118 | |
3119 | 3119 | if ($outorigin && !empty($conf->global->PRODUCT_SHOW_ORIGIN_IN_COMBO)) { |
3120 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php'; |
|
3120 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; |
|
3121 | 3121 | } |
3122 | 3122 | |
3123 | 3123 | // Units |
3124 | 3124 | $outvalUnits = ''; |
3125 | 3125 | if (getDolGlobalInt('PRODUCT_USE_UNITS')) { |
3126 | 3126 | if (!empty($objp->unit_short)) { |
3127 | - $outvalUnits .= ' - ' . $objp->unit_short; |
|
3127 | + $outvalUnits .= ' - '.$objp->unit_short; |
|
3128 | 3128 | } |
3129 | 3129 | } |
3130 | 3130 | if (!empty($conf->global->PRODUCT_SHOW_DIMENSIONS_IN_COMBO)) { |
3131 | 3131 | if (!empty($objp->weight) && $objp->weight_units !== null) { |
3132 | 3132 | $unitToShow = showDimensionInBestUnit($objp->weight, $objp->weight_units, 'weight', $langs); |
3133 | - $outvalUnits .= ' - ' . $unitToShow; |
|
3133 | + $outvalUnits .= ' - '.$unitToShow; |
|
3134 | 3134 | } |
3135 | 3135 | if ((!empty($objp->length) || !empty($objp->width) || !empty($objp->height)) && $objp->length_units !== null) { |
3136 | - $unitToShow = $objp->length . ' x ' . $objp->width . ' x ' . $objp->height . ' ' . measuringUnitString(0, 'size', $objp->length_units); |
|
3137 | - $outvalUnits .= ' - ' . $unitToShow; |
|
3136 | + $unitToShow = $objp->length.' x '.$objp->width.' x '.$objp->height.' '.measuringUnitString(0, 'size', $objp->length_units); |
|
3137 | + $outvalUnits .= ' - '.$unitToShow; |
|
3138 | 3138 | } |
3139 | 3139 | if (!empty($objp->surface) && $objp->surface_units !== null) { |
3140 | 3140 | $unitToShow = showDimensionInBestUnit($objp->surface, $objp->surface_units, 'surface', $langs); |
3141 | - $outvalUnits .= ' - ' . $unitToShow; |
|
3141 | + $outvalUnits .= ' - '.$unitToShow; |
|
3142 | 3142 | } |
3143 | 3143 | if (!empty($objp->volume) && $objp->volume_units !== null) { |
3144 | 3144 | $unitToShow = showDimensionInBestUnit($objp->volume, $objp->volume_units, 'volume', $langs); |
3145 | - $outvalUnits .= ' - ' . $unitToShow; |
|
3145 | + $outvalUnits .= ' - '.$unitToShow; |
|
3146 | 3146 | } |
3147 | 3147 | } |
3148 | 3148 | if ($outdurationvalue && $outdurationunit) { |
@@ -3154,14 +3154,14 @@ discard block |
||
3154 | 3154 | 'y' => $langs->trans('Year') |
3155 | 3155 | ); |
3156 | 3156 | if (isset($da[$outdurationunit])) { |
3157 | - $outvalUnits .= ' - ' . $outdurationvalue . ' ' . $langs->transnoentities($da[$outdurationunit] . ($outdurationvalue > 1 ? 's' : '')); |
|
3157 | + $outvalUnits .= ' - '.$outdurationvalue.' '.$langs->transnoentities($da[$outdurationunit].($outdurationvalue > 1 ? 's' : '')); |
|
3158 | 3158 | } |
3159 | 3159 | } |
3160 | 3160 | |
3161 | - $opt = '<option value="' . $objp->rowid . '"'; |
|
3161 | + $opt = '<option value="'.$objp->rowid.'"'; |
|
3162 | 3162 | $opt .= ($objp->rowid == $selected) ? ' selected' : ''; |
3163 | 3163 | if (!empty($objp->price_by_qty_rowid) && $objp->price_by_qty_rowid > 0) { |
3164 | - $opt .= ' pbq="' . $objp->price_by_qty_rowid . '" data-pbq="' . $objp->price_by_qty_rowid . '" data-pbqup="' . $objp->price_by_qty_unitprice . '" data-pbqbase="' . $objp->price_by_qty_price_base_type . '" data-pbqqty="' . $objp->price_by_qty_quantity . '" data-pbqpercent="' . $objp->price_by_qty_remise_percent . '"'; |
|
3164 | + $opt .= ' pbq="'.$objp->price_by_qty_rowid.'" data-pbq="'.$objp->price_by_qty_rowid.'" data-pbqup="'.$objp->price_by_qty_unitprice.'" data-pbqbase="'.$objp->price_by_qty_price_base_type.'" data-pbqqty="'.$objp->price_by_qty_quantity.'" data-pbqpercent="'.$objp->price_by_qty_remise_percent.'"'; |
|
3165 | 3165 | } |
3166 | 3166 | if (isModEnabled('stock') && isset($objp->stock) && ($objp->fk_product_type == Product::TYPE_PRODUCT || !empty($conf->global->STOCK_SUPPORTS_SERVICES))) { |
3167 | 3167 | if ($user->hasRight('stock', 'lire')) { |
@@ -3173,36 +3173,36 @@ discard block |
||
3173 | 3173 | } |
3174 | 3174 | } |
3175 | 3175 | if (!empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) { |
3176 | - $opt .= ' data-labeltrans="' . $outlabel_translated . '"'; |
|
3177 | - $opt .= ' data-desctrans="' . dol_escape_htmltag($outdesc_translated) . '"'; |
|
3176 | + $opt .= ' data-labeltrans="'.$outlabel_translated.'"'; |
|
3177 | + $opt .= ' data-desctrans="'.dol_escape_htmltag($outdesc_translated).'"'; |
|
3178 | 3178 | } |
3179 | 3179 | $opt .= '>'; |
3180 | 3180 | $opt .= $objp->ref; |
3181 | 3181 | if (!empty($objp->custref)) { |
3182 | - $opt .= ' (' . $objp->custref . ')'; |
|
3182 | + $opt .= ' ('.$objp->custref.')'; |
|
3183 | 3183 | } |
3184 | 3184 | if ($outbarcode) { |
3185 | - $opt .= ' (' . $outbarcode . ')'; |
|
3185 | + $opt .= ' ('.$outbarcode.')'; |
|
3186 | 3186 | } |
3187 | - $opt .= ' - ' . dol_trunc($label, $maxlengtharticle); |
|
3187 | + $opt .= ' - '.dol_trunc($label, $maxlengtharticle); |
|
3188 | 3188 | if ($outorigin && !empty($conf->global->PRODUCT_SHOW_ORIGIN_IN_COMBO)) { |
3189 | - $opt .= ' (' . getCountry($outorigin, 1) . ')'; |
|
3189 | + $opt .= ' ('.getCountry($outorigin, 1).')'; |
|
3190 | 3190 | } |
3191 | 3191 | |
3192 | 3192 | $objRef = $objp->ref; |
3193 | 3193 | if (!empty($objp->custref)) { |
3194 | - $objRef .= ' (' . $objp->custref . ')'; |
|
3194 | + $objRef .= ' ('.$objp->custref.')'; |
|
3195 | 3195 | } |
3196 | 3196 | if (!empty($filterkey) && $filterkey != '') { |
3197 | - $objRef = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRef, 1); |
|
3197 | + $objRef = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRef, 1); |
|
3198 | 3198 | } |
3199 | 3199 | $outval .= $objRef; |
3200 | 3200 | if ($outbarcode) { |
3201 | - $outval .= ' (' . $outbarcode . ')'; |
|
3201 | + $outval .= ' ('.$outbarcode.')'; |
|
3202 | 3202 | } |
3203 | - $outval .= ' - ' . dol_trunc($label, $maxlengtharticle); |
|
3203 | + $outval .= ' - '.dol_trunc($label, $maxlengtharticle); |
|
3204 | 3204 | if ($outorigin && !empty($conf->global->PRODUCT_SHOW_ORIGIN_IN_COMBO)) { |
3205 | - $outval .= ' (' . getCountry($outorigin, 1) . ')'; |
|
3205 | + $outval .= ' ('.getCountry($outorigin, 1).')'; |
|
3206 | 3206 | } |
3207 | 3207 | |
3208 | 3208 | // Units |
@@ -3215,35 +3215,35 @@ discard block |
||
3215 | 3215 | // If we need a particular price level (from 1 to n) |
3216 | 3216 | if (empty($hidepriceinlabel) && $price_level >= 1 && (!empty($conf->global->PRODUIT_MULTIPRICES) || !empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES))) { |
3217 | 3217 | $sql = "SELECT price, price_ttc, price_base_type, tva_tx, default_vat_code"; |
3218 | - $sql .= " FROM " . $this->db->prefix() . "product_price"; |
|
3219 | - $sql .= " WHERE fk_product = " . ((int) $objp->rowid); |
|
3220 | - $sql .= " AND entity IN (" . getEntity('productprice') . ")"; |
|
3221 | - $sql .= " AND price_level = " . ((int) $price_level); |
|
3218 | + $sql .= " FROM ".$this->db->prefix()."product_price"; |
|
3219 | + $sql .= " WHERE fk_product = ".((int) $objp->rowid); |
|
3220 | + $sql .= " AND entity IN (".getEntity('productprice').")"; |
|
3221 | + $sql .= " AND price_level = ".((int) $price_level); |
|
3222 | 3222 | $sql .= " ORDER BY date_price DESC, rowid DESC"; // Warning DESC must be both on date_price and rowid. |
3223 | 3223 | $sql .= " LIMIT 1"; |
3224 | 3224 | |
3225 | - dol_syslog(get_class($this) . '::constructProductListOption search price for product ' . $objp->rowid . ' AND level ' . $price_level, LOG_DEBUG); |
|
3225 | + dol_syslog(get_class($this).'::constructProductListOption search price for product '.$objp->rowid.' AND level '.$price_level, LOG_DEBUG); |
|
3226 | 3226 | $result2 = $this->db->query($sql); |
3227 | 3227 | if ($result2) { |
3228 | 3228 | $objp2 = $this->db->fetch_object($result2); |
3229 | 3229 | if ($objp2) { |
3230 | 3230 | $found = 1; |
3231 | 3231 | if ($objp2->price_base_type == 'HT') { |
3232 | - $opt .= ' - ' . price($objp2->price, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("HT"); |
|
3233 | - $outval .= ' - ' . price($objp2->price, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("HT"); |
|
3232 | + $opt .= ' - '.price($objp2->price, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("HT"); |
|
3233 | + $outval .= ' - '.price($objp2->price, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("HT"); |
|
3234 | 3234 | } else { |
3235 | - $opt .= ' - ' . price($objp2->price_ttc, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("TTC"); |
|
3236 | - $outval .= ' - ' . price($objp2->price_ttc, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("TTC"); |
|
3235 | + $opt .= ' - '.price($objp2->price_ttc, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("TTC"); |
|
3236 | + $outval .= ' - '.price($objp2->price_ttc, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("TTC"); |
|
3237 | 3237 | } |
3238 | 3238 | $outprice_ht = price($objp2->price); |
3239 | 3239 | $outprice_ttc = price($objp2->price_ttc); |
3240 | 3240 | $outpricebasetype = $objp2->price_base_type; |
3241 | 3241 | if (!empty($conf->global->PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL)) { // using this option is a bug. kept for backward compatibility |
3242 | - $outtva_tx = $objp2->tva_tx; // We use the vat rate on line of multiprice |
|
3243 | - $outdefault_vat_code = $objp2->default_vat_code; // We use the vat code on line of multiprice |
|
3242 | + $outtva_tx = $objp2->tva_tx; // We use the vat rate on line of multiprice |
|
3243 | + $outdefault_vat_code = $objp2->default_vat_code; // We use the vat code on line of multiprice |
|
3244 | 3244 | } else { |
3245 | - $outtva_tx = $objp->tva_tx; // We use the vat rate of product, not the one on line of multiprice |
|
3246 | - $outdefault_vat_code = $objp->default_vat_code; // We use the vat code or product, not the one on line of multiprice |
|
3245 | + $outtva_tx = $objp->tva_tx; // We use the vat rate of product, not the one on line of multiprice |
|
3246 | + $outdefault_vat_code = $objp->default_vat_code; // We use the vat code or product, not the one on line of multiprice |
|
3247 | 3247 | } |
3248 | 3248 | } |
3249 | 3249 | } else { |
@@ -3257,13 +3257,13 @@ discard block |
||
3257 | 3257 | $outqty = $objp->quantity; |
3258 | 3258 | $outdiscount = $objp->remise_percent; |
3259 | 3259 | if ($objp->quantity == 1) { |
3260 | - $opt .= ' - ' . price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency) . "/"; |
|
3261 | - $outval .= ' - ' . price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency) . "/"; |
|
3260 | + $opt .= ' - '.price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency)."/"; |
|
3261 | + $outval .= ' - '.price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency)."/"; |
|
3262 | 3262 | $opt .= $langs->trans("Unit"); // Do not use strtolower because it breaks utf8 encoding |
3263 | 3263 | $outval .= $langs->transnoentities("Unit"); |
3264 | 3264 | } else { |
3265 | - $opt .= ' - ' . price($objp->price, 1, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity; |
|
3266 | - $outval .= ' - ' . price($objp->price, 0, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity; |
|
3265 | + $opt .= ' - '.price($objp->price, 1, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity; |
|
3266 | + $outval .= ' - '.price($objp->price, 0, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity; |
|
3267 | 3267 | $opt .= $langs->trans("Units"); // Do not use strtolower because it breaks utf8 encoding |
3268 | 3268 | $outval .= $langs->transnoentities("Units"); |
3269 | 3269 | } |
@@ -3271,16 +3271,16 @@ discard block |
||
3271 | 3271 | $outprice_ht = price($objp->unitprice); |
3272 | 3272 | $outprice_ttc = price($objp->unitprice * (1 + ($objp->tva_tx / 100))); |
3273 | 3273 | $outpricebasetype = $objp->price_base_type; |
3274 | - $outtva_tx = $objp->tva_tx; // This value is the value on product when constructProductListOption is called by select_produits_list even if other field $objp-> are from table price_by_qty |
|
3275 | - $outdefault_vat_code = $objp->default_vat_code; // This value is the value on product when constructProductListOption is called by select_produits_list even if other field $objp-> are from table price_by_qty |
|
3274 | + $outtva_tx = $objp->tva_tx; // This value is the value on product when constructProductListOption is called by select_produits_list even if other field $objp-> are from table price_by_qty |
|
3275 | + $outdefault_vat_code = $objp->default_vat_code; // This value is the value on product when constructProductListOption is called by select_produits_list even if other field $objp-> are from table price_by_qty |
|
3276 | 3276 | } |
3277 | 3277 | if (empty($hidepriceinlabel) && !empty($objp->quantity) && $objp->quantity >= 1) { |
3278 | - $opt .= " (" . price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency) . "/" . $langs->trans("Unit") . ")"; // Do not use strtolower because it breaks utf8 encoding |
|
3279 | - $outval .= " (" . price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency) . "/" . $langs->transnoentities("Unit") . ")"; // Do not use strtolower because it breaks utf8 encoding |
|
3278 | + $opt .= " (".price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency)."/".$langs->trans("Unit").")"; // Do not use strtolower because it breaks utf8 encoding |
|
3279 | + $outval .= " (".price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency)."/".$langs->transnoentities("Unit").")"; // Do not use strtolower because it breaks utf8 encoding |
|
3280 | 3280 | } |
3281 | 3281 | if (empty($hidepriceinlabel) && !empty($objp->remise_percent) && $objp->remise_percent >= 1) { |
3282 | - $opt .= " - " . $langs->trans("Discount") . " : " . vatrate($objp->remise_percent) . ' %'; |
|
3283 | - $outval .= " - " . $langs->transnoentities("Discount") . " : " . vatrate($objp->remise_percent) . ' %'; |
|
3282 | + $opt .= " - ".$langs->trans("Discount")." : ".vatrate($objp->remise_percent).' %'; |
|
3283 | + $outval .= " - ".$langs->transnoentities("Discount")." : ".vatrate($objp->remise_percent).' %'; |
|
3284 | 3284 | } |
3285 | 3285 | |
3286 | 3286 | // Price by customer |
@@ -3289,11 +3289,11 @@ discard block |
||
3289 | 3289 | $found = 1; |
3290 | 3290 | |
3291 | 3291 | if ($objp->custprice_base_type == 'HT') { |
3292 | - $opt .= ' - ' . price($objp->custprice, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("HT"); |
|
3293 | - $outval .= ' - ' . price($objp->custprice, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("HT"); |
|
3292 | + $opt .= ' - '.price($objp->custprice, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("HT"); |
|
3293 | + $outval .= ' - '.price($objp->custprice, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("HT"); |
|
3294 | 3294 | } else { |
3295 | - $opt .= ' - ' . price($objp->custprice_ttc, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("TTC"); |
|
3296 | - $outval .= ' - ' . price($objp->custprice_ttc, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("TTC"); |
|
3295 | + $opt .= ' - '.price($objp->custprice_ttc, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("TTC"); |
|
3296 | + $outval .= ' - '.price($objp->custprice_ttc, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("TTC"); |
|
3297 | 3297 | } |
3298 | 3298 | |
3299 | 3299 | $outprice_ht = price($objp->custprice); |
@@ -3307,11 +3307,11 @@ discard block |
||
3307 | 3307 | // If level no defined or multiprice not found, we used the default price |
3308 | 3308 | if (empty($hidepriceinlabel) && !$found) { |
3309 | 3309 | if ($objp->price_base_type == 'HT') { |
3310 | - $opt .= ' - ' . price($objp->price, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("HT"); |
|
3311 | - $outval .= ' - ' . price($objp->price, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("HT"); |
|
3310 | + $opt .= ' - '.price($objp->price, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("HT"); |
|
3311 | + $outval .= ' - '.price($objp->price, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("HT"); |
|
3312 | 3312 | } else { |
3313 | - $opt .= ' - ' . price($objp->price_ttc, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("TTC"); |
|
3314 | - $outval .= ' - ' . price($objp->price_ttc, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("TTC"); |
|
3313 | + $opt .= ' - '.price($objp->price_ttc, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("TTC"); |
|
3314 | + $outval .= ' - '.price($objp->price_ttc, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("TTC"); |
|
3315 | 3315 | } |
3316 | 3316 | $outprice_ht = price($objp->price); |
3317 | 3317 | $outprice_ttc = price($objp->price_ttc); |
@@ -3322,14 +3322,14 @@ discard block |
||
3322 | 3322 | |
3323 | 3323 | if (isModEnabled('stock') && isset($objp->stock) && ($objp->fk_product_type == Product::TYPE_PRODUCT || !empty($conf->global->STOCK_SUPPORTS_SERVICES))) { |
3324 | 3324 | if ($user->hasRight('stock', 'lire')) { |
3325 | - $opt .= ' - ' . $langs->trans("Stock") . ': ' . price(price2num($objp->stock, 'MS')); |
|
3325 | + $opt .= ' - '.$langs->trans("Stock").': '.price(price2num($objp->stock, 'MS')); |
|
3326 | 3326 | |
3327 | 3327 | if ($objp->stock > 0) { |
3328 | 3328 | $outval .= ' - <span class="product_line_stock_ok">'; |
3329 | 3329 | } elseif ($objp->stock <= 0) { |
3330 | 3330 | $outval .= ' - <span class="product_line_stock_too_low">'; |
3331 | 3331 | } |
3332 | - $outval .= $langs->transnoentities("Stock") . ': ' . price(price2num($objp->stock, 'MS')); |
|
3332 | + $outval .= $langs->transnoentities("Stock").': '.price(price2num($objp->stock, 'MS')); |
|
3333 | 3333 | $outval .= '</span>'; |
3334 | 3334 | if (empty($novirtualstock) && !empty($conf->global->STOCK_SHOW_VIRTUAL_STOCK_IN_PRODUCTS_COMBO)) { // Warning, this option may slow down combo list generation |
3335 | 3335 | $langs->load("stocks"); |
@@ -3339,9 +3339,9 @@ discard block |
||
3339 | 3339 | $tmpproduct->load_virtual_stock(); |
3340 | 3340 | $virtualstock = $tmpproduct->stock_theorique; |
3341 | 3341 | |
3342 | - $opt .= ' - ' . $langs->trans("VirtualStock") . ':' . $virtualstock; |
|
3342 | + $opt .= ' - '.$langs->trans("VirtualStock").':'.$virtualstock; |
|
3343 | 3343 | |
3344 | - $outval .= ' - ' . $langs->transnoentities("VirtualStock") . ':'; |
|
3344 | + $outval .= ' - '.$langs->transnoentities("VirtualStock").':'; |
|
3345 | 3345 | if ($virtualstock > 0) { |
3346 | 3346 | $outval .= '<span class="product_line_stock_ok">'; |
3347 | 3347 | } elseif ($virtualstock <= 0) { |
@@ -3419,7 +3419,7 @@ discard block |
||
3419 | 3419 | $selected_input_value = ''; |
3420 | 3420 | if (!empty($conf->use_javascript_ajax) && !empty($conf->global->PRODUIT_USE_SEARCH_TO_SELECT)) { |
3421 | 3421 | if ($selected > 0) { |
3422 | - require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; |
|
3422 | + require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; |
|
3423 | 3423 | $producttmpselect = new Product($this->db); |
3424 | 3424 | $producttmpselect->fetch($selected); |
3425 | 3425 | $selected_input_value = $producttmpselect->ref; |
@@ -3427,10 +3427,10 @@ discard block |
||
3427 | 3427 | } |
3428 | 3428 | |
3429 | 3429 | // mode=2 means suppliers products |
3430 | - $urloption = ($socid > 0 ? 'socid=' . $socid . '&' : '') . 'htmlname=' . $htmlname . '&outjson=1&price_level=' . $price_level . '&type=' . $filtertype . '&mode=2&status=' . $status . '&finished=' . $finished . '&alsoproductwithnosupplierprice=' . $alsoproductwithnosupplierprice; |
|
3431 | - print ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/product/ajax/products.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 0, $ajaxoptions); |
|
3430 | + $urloption = ($socid > 0 ? 'socid='.$socid.'&' : '').'htmlname='.$htmlname.'&outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=2&status='.$status.'&finished='.$finished.'&alsoproductwithnosupplierprice='.$alsoproductwithnosupplierprice; |
|
3431 | + print ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/product/ajax/products.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 0, $ajaxoptions); |
|
3432 | 3432 | |
3433 | - print ($hidelabel ? '' : $langs->trans("RefOrLabel") . ' : ') . '<input type="text" class="minwidth300" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . ($placeholder ? ' placeholder="' . $placeholder . '"' : '') . '>'; |
|
3433 | + print ($hidelabel ? '' : $langs->trans("RefOrLabel").' : ').'<input type="text" class="minwidth300" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.($placeholder ? ' placeholder="'.$placeholder.'"' : '').'>'; |
|
3434 | 3434 | } else { |
3435 | 3435 | print $this->select_produits_fournisseurs_list($socid, $selected, $htmlname, $filtertype, $filtre, '', $status, 0, 0, $alsoproductwithnosupplierprice, $morecss, 0, $placeholder); |
3436 | 3436 | } |
@@ -3490,25 +3490,25 @@ discard block |
||
3490 | 3490 | if (isModEnabled('barcode')) { |
3491 | 3491 | $sql .= ", pfp.barcode"; |
3492 | 3492 | } |
3493 | - $sql .= " FROM " . $this->db->prefix() . "product as p"; |
|
3494 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "product_fournisseur_price as pfp ON ( p.rowid = pfp.fk_product AND pfp.entity IN (" . getEntity('product') . ") )"; |
|
3493 | + $sql .= " FROM ".$this->db->prefix()."product as p"; |
|
3494 | + $sql .= " LEFT JOIN ".$this->db->prefix()."product_fournisseur_price as pfp ON ( p.rowid = pfp.fk_product AND pfp.entity IN (".getEntity('product').") )"; |
|
3495 | 3495 | if ($socid > 0) { |
3496 | - $sql .= " AND pfp.fk_soc = " . ((int) $socid); |
|
3496 | + $sql .= " AND pfp.fk_soc = ".((int) $socid); |
|
3497 | 3497 | } |
3498 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "societe as s ON pfp.fk_soc = s.rowid"; |
|
3498 | + $sql .= " LEFT JOIN ".$this->db->prefix()."societe as s ON pfp.fk_soc = s.rowid"; |
|
3499 | 3499 | // Units |
3500 | 3500 | if (getDolGlobalInt('PRODUCT_USE_UNITS')) { |
3501 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "c_units u ON u.rowid = p.fk_unit"; |
|
3501 | + $sql .= " LEFT JOIN ".$this->db->prefix()."c_units u ON u.rowid = p.fk_unit"; |
|
3502 | 3502 | } |
3503 | - $sql .= " WHERE p.entity IN (" . getEntity('product') . ")"; |
|
3503 | + $sql .= " WHERE p.entity IN (".getEntity('product').")"; |
|
3504 | 3504 | if ($statut != -1) { |
3505 | - $sql .= " AND p.tobuy = " . ((int) $statut); |
|
3505 | + $sql .= " AND p.tobuy = ".((int) $statut); |
|
3506 | 3506 | } |
3507 | 3507 | if (strval($filtertype) != '') { |
3508 | - $sql .= " AND p.fk_product_type = " . ((int) $filtertype); |
|
3508 | + $sql .= " AND p.fk_product_type = ".((int) $filtertype); |
|
3509 | 3509 | } |
3510 | 3510 | if (!empty($filtre)) { |
3511 | - $sql .= " " . $filtre; |
|
3511 | + $sql .= " ".$filtre; |
|
3512 | 3512 | } |
3513 | 3513 | // Add where from hooks |
3514 | 3514 | $parameters = array(); |
@@ -3528,9 +3528,9 @@ discard block |
||
3528 | 3528 | if ($i > 0) { |
3529 | 3529 | $sql .= " AND "; |
3530 | 3530 | } |
3531 | - $sql .= "(pfp.ref_fourn LIKE '" . $this->db->escape($prefix . $crit) . "%' OR p.ref LIKE '" . $this->db->escape($prefix . $crit) . "%' OR p.label LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
3531 | + $sql .= "(pfp.ref_fourn LIKE '".$this->db->escape($prefix.$crit)."%' OR p.ref LIKE '".$this->db->escape($prefix.$crit)."%' OR p.label LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
3532 | 3532 | if (!empty($conf->global->PRODUIT_FOURN_TEXTS)) { |
3533 | - $sql .= " OR pfp.desc_fourn LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
3533 | + $sql .= " OR pfp.desc_fourn LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
3534 | 3534 | } |
3535 | 3535 | $sql .= ")"; |
3536 | 3536 | $i++; |
@@ -3539,8 +3539,8 @@ discard block |
||
3539 | 3539 | $sql .= ")"; |
3540 | 3540 | } |
3541 | 3541 | if (isModEnabled('barcode')) { |
3542 | - $sql .= " OR p.barcode LIKE '" . $this->db->escape($prefix . $filterkey) . "%'"; |
|
3543 | - $sql .= " OR pfp.barcode LIKE '" . $this->db->escape($prefix . $filterkey) . "%'"; |
|
3542 | + $sql .= " OR p.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'"; |
|
3543 | + $sql .= " OR pfp.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'"; |
|
3544 | 3544 | } |
3545 | 3545 | $sql .= ')'; |
3546 | 3546 | } |
@@ -3549,20 +3549,20 @@ discard block |
||
3549 | 3549 | |
3550 | 3550 | // Build output string |
3551 | 3551 | |
3552 | - dol_syslog(get_class($this) . "::select_produits_fournisseurs_list", LOG_DEBUG); |
|
3552 | + dol_syslog(get_class($this)."::select_produits_fournisseurs_list", LOG_DEBUG); |
|
3553 | 3553 | $result = $this->db->query($sql); |
3554 | 3554 | if ($result) { |
3555 | - require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php'; |
|
3556 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/product.lib.php'; |
|
3555 | + require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php'; |
|
3556 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php'; |
|
3557 | 3557 | |
3558 | 3558 | $num = $this->db->num_rows($result); |
3559 | 3559 | |
3560 | 3560 | //$out.='<select class="flat" id="select'.$htmlname.'" name="'.$htmlname.'">'; // remove select to have id same with combo and ajax |
3561 | - $out .= '<select class="flat ' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlname . '" name="' . $htmlname . '">'; |
|
3561 | + $out .= '<select class="flat '.($morecss ? ' '.$morecss : '').'" id="'.$htmlname.'" name="'.$htmlname.'">'; |
|
3562 | 3562 | if (!$selected) { |
3563 | - $out .= '<option value="-1" selected>' . ($placeholder ? $placeholder : ' ') . '</option>'; |
|
3563 | + $out .= '<option value="-1" selected>'.($placeholder ? $placeholder : ' ').'</option>'; |
|
3564 | 3564 | } else { |
3565 | - $out .= '<option value="-1">' . ($placeholder ? $placeholder : ' ') . '</option>'; |
|
3565 | + $out .= '<option value="-1">'.($placeholder ? $placeholder : ' ').'</option>'; |
|
3566 | 3566 | } |
3567 | 3567 | |
3568 | 3568 | $i = 0; |
@@ -3577,7 +3577,7 @@ discard block |
||
3577 | 3577 | |
3578 | 3578 | $outkey = $objp->idprodfournprice; // id in table of price |
3579 | 3579 | if (!$outkey && $alsoproductwithnosupplierprice) { |
3580 | - $outkey = 'idprod_' . $objp->rowid; // id of product |
|
3580 | + $outkey = 'idprod_'.$objp->rowid; // id of product |
|
3581 | 3581 | } |
3582 | 3582 | |
3583 | 3583 | $outref = $objp->ref; |
@@ -3592,23 +3592,23 @@ discard block |
||
3592 | 3592 | $outvalUnits = ''; |
3593 | 3593 | if (getDolGlobalInt('PRODUCT_USE_UNITS')) { |
3594 | 3594 | if (!empty($objp->unit_short)) { |
3595 | - $outvalUnits .= ' - ' . $objp->unit_short; |
|
3595 | + $outvalUnits .= ' - '.$objp->unit_short; |
|
3596 | 3596 | } |
3597 | 3597 | if (!empty($objp->weight) && $objp->weight_units !== null) { |
3598 | 3598 | $unitToShow = showDimensionInBestUnit($objp->weight, $objp->weight_units, 'weight', $langs); |
3599 | - $outvalUnits .= ' - ' . $unitToShow; |
|
3599 | + $outvalUnits .= ' - '.$unitToShow; |
|
3600 | 3600 | } |
3601 | 3601 | if ((!empty($objp->length) || !empty($objp->width) || !empty($objp->height)) && $objp->length_units !== null) { |
3602 | - $unitToShow = $objp->length . ' x ' . $objp->width . ' x ' . $objp->height . ' ' . measuringUnitString(0, 'size', $objp->length_units); |
|
3603 | - $outvalUnits .= ' - ' . $unitToShow; |
|
3602 | + $unitToShow = $objp->length.' x '.$objp->width.' x '.$objp->height.' '.measuringUnitString(0, 'size', $objp->length_units); |
|
3603 | + $outvalUnits .= ' - '.$unitToShow; |
|
3604 | 3604 | } |
3605 | 3605 | if (!empty($objp->surface) && $objp->surface_units !== null) { |
3606 | 3606 | $unitToShow = showDimensionInBestUnit($objp->surface, $objp->surface_units, 'surface', $langs); |
3607 | - $outvalUnits .= ' - ' . $unitToShow; |
|
3607 | + $outvalUnits .= ' - '.$unitToShow; |
|
3608 | 3608 | } |
3609 | 3609 | if (!empty($objp->volume) && $objp->volume_units !== null) { |
3610 | 3610 | $unitToShow = showDimensionInBestUnit($objp->volume, $objp->volume_units, 'volume', $langs); |
3611 | - $outvalUnits .= ' - ' . $unitToShow; |
|
3611 | + $outvalUnits .= ' - '.$unitToShow; |
|
3612 | 3612 | } |
3613 | 3613 | if ($outdurationvalue && $outdurationunit) { |
3614 | 3614 | $da = array( |
@@ -3619,22 +3619,22 @@ discard block |
||
3619 | 3619 | 'y' => $langs->trans('Year') |
3620 | 3620 | ); |
3621 | 3621 | if (isset($da[$outdurationunit])) { |
3622 | - $outvalUnits .= ' - ' . $outdurationvalue . ' ' . $langs->transnoentities($da[$outdurationunit] . ($outdurationvalue > 1 ? 's' : '')); |
|
3622 | + $outvalUnits .= ' - '.$outdurationvalue.' '.$langs->transnoentities($da[$outdurationunit].($outdurationvalue > 1 ? 's' : '')); |
|
3623 | 3623 | } |
3624 | 3624 | } |
3625 | 3625 | } |
3626 | 3626 | |
3627 | 3627 | $objRef = $objp->ref; |
3628 | 3628 | if ($filterkey && $filterkey != '') { |
3629 | - $objRef = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRef, 1); |
|
3629 | + $objRef = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRef, 1); |
|
3630 | 3630 | } |
3631 | 3631 | $objRefFourn = $objp->ref_fourn; |
3632 | 3632 | if ($filterkey && $filterkey != '') { |
3633 | - $objRefFourn = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRefFourn, 1); |
|
3633 | + $objRefFourn = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRefFourn, 1); |
|
3634 | 3634 | } |
3635 | 3635 | $label = $objp->label; |
3636 | 3636 | if ($filterkey && $filterkey != '') { |
3637 | - $label = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $label, 1); |
|
3637 | + $label = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $label, 1); |
|
3638 | 3638 | } |
3639 | 3639 | |
3640 | 3640 | switch ($objp->fk_product_type) { |
@@ -3657,21 +3657,21 @@ discard block |
||
3657 | 3657 | |
3658 | 3658 | $optlabel .= $objp->ref; |
3659 | 3659 | if (!empty($objp->idprodfournprice) && ($objp->ref != $objp->ref_fourn)) { |
3660 | - $optlabel .= ' <span class="opacitymedium">(' . $objp->ref_fourn . ')</span>'; |
|
3660 | + $optlabel .= ' <span class="opacitymedium">('.$objp->ref_fourn.')</span>'; |
|
3661 | 3661 | } |
3662 | 3662 | if (isModEnabled('barcode') && !empty($objp->barcode)) { |
3663 | - $optlabel .= ' (' . $outbarcode . ')'; |
|
3663 | + $optlabel .= ' ('.$outbarcode.')'; |
|
3664 | 3664 | } |
3665 | - $optlabel .= ' - ' . dol_trunc($label, $maxlengtharticle); |
|
3665 | + $optlabel .= ' - '.dol_trunc($label, $maxlengtharticle); |
|
3666 | 3666 | |
3667 | 3667 | $outvallabel = $objRef; |
3668 | 3668 | if (!empty($objp->idprodfournprice) && ($objp->ref != $objp->ref_fourn)) { |
3669 | - $outvallabel .= ' (' . $objRefFourn . ')'; |
|
3669 | + $outvallabel .= ' ('.$objRefFourn.')'; |
|
3670 | 3670 | } |
3671 | 3671 | if (isModEnabled('barcode') && !empty($objp->barcode)) { |
3672 | - $outvallabel .= ' (' . $outbarcode . ')'; |
|
3672 | + $outvallabel .= ' ('.$outbarcode.')'; |
|
3673 | 3673 | } |
3674 | - $outvallabel .= ' - ' . dol_trunc($label, $maxlengtharticle); |
|
3674 | + $outvallabel .= ' - '.dol_trunc($label, $maxlengtharticle); |
|
3675 | 3675 | |
3676 | 3676 | // Units |
3677 | 3677 | $optlabel .= $outvalUnits; |
@@ -3688,7 +3688,7 @@ discard block |
||
3688 | 3688 | $prod_supplier->fourn_tva_tx = $objp->tva_tx; |
3689 | 3689 | $prod_supplier->fk_supplier_price_expression = $objp->fk_supplier_price_expression; |
3690 | 3690 | |
3691 | - require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php'; |
|
3691 | + require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php'; |
|
3692 | 3692 | $priceparser = new PriceParser($this->db); |
3693 | 3693 | $price_result = $priceparser->parseProductSupplier($prod_supplier); |
3694 | 3694 | if ($price_result >= 0) { |
@@ -3699,48 +3699,48 @@ discard block |
||
3699 | 3699 | } |
3700 | 3700 | } |
3701 | 3701 | if ($objp->quantity == 1) { |
3702 | - $optlabel .= ' - ' . price($objp->fprice * (!empty($conf->global->DISPLAY_DISCOUNTED_SUPPLIER_PRICE) ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/"; |
|
3703 | - $outvallabel .= ' - ' . price($objp->fprice * (!empty($conf->global->DISPLAY_DISCOUNTED_SUPPLIER_PRICE) ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency) . "/"; |
|
3702 | + $optlabel .= ' - '.price($objp->fprice * (!empty($conf->global->DISPLAY_DISCOUNTED_SUPPLIER_PRICE) ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency)."/"; |
|
3703 | + $outvallabel .= ' - '.price($objp->fprice * (!empty($conf->global->DISPLAY_DISCOUNTED_SUPPLIER_PRICE) ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency)."/"; |
|
3704 | 3704 | $optlabel .= $langs->trans("Unit"); // Do not use strtolower because it breaks utf8 encoding |
3705 | 3705 | $outvallabel .= $langs->transnoentities("Unit"); |
3706 | 3706 | } else { |
3707 | - $optlabel .= ' - ' . price($objp->fprice * (!empty($conf->global->DISPLAY_DISCOUNTED_SUPPLIER_PRICE) ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity; |
|
3708 | - $outvallabel .= ' - ' . price($objp->fprice * (!empty($conf->global->DISPLAY_DISCOUNTED_SUPPLIER_PRICE) ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity; |
|
3709 | - $optlabel .= ' ' . $langs->trans("Units"); // Do not use strtolower because it breaks utf8 encoding |
|
3710 | - $outvallabel .= ' ' . $langs->transnoentities("Units"); |
|
3707 | + $optlabel .= ' - '.price($objp->fprice * (!empty($conf->global->DISPLAY_DISCOUNTED_SUPPLIER_PRICE) ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity; |
|
3708 | + $outvallabel .= ' - '.price($objp->fprice * (!empty($conf->global->DISPLAY_DISCOUNTED_SUPPLIER_PRICE) ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity; |
|
3709 | + $optlabel .= ' '.$langs->trans("Units"); // Do not use strtolower because it breaks utf8 encoding |
|
3710 | + $outvallabel .= ' '.$langs->transnoentities("Units"); |
|
3711 | 3711 | } |
3712 | 3712 | |
3713 | 3713 | if ($objp->quantity > 1) { |
3714 | - $optlabel .= " (" . price($objp->unitprice * (!empty($conf->global->DISPLAY_DISCOUNTED_SUPPLIER_PRICE) ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/" . $langs->trans("Unit") . ")"; // Do not use strtolower because it breaks utf8 encoding |
|
3715 | - $outvallabel .= " (" . price($objp->unitprice * (!empty($conf->global->DISPLAY_DISCOUNTED_SUPPLIER_PRICE) ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency) . "/" . $langs->transnoentities("Unit") . ")"; // Do not use strtolower because it breaks utf8 encoding |
|
3714 | + $optlabel .= " (".price($objp->unitprice * (!empty($conf->global->DISPLAY_DISCOUNTED_SUPPLIER_PRICE) ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency)."/".$langs->trans("Unit").")"; // Do not use strtolower because it breaks utf8 encoding |
|
3715 | + $outvallabel .= " (".price($objp->unitprice * (!empty($conf->global->DISPLAY_DISCOUNTED_SUPPLIER_PRICE) ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency)."/".$langs->transnoentities("Unit").")"; // Do not use strtolower because it breaks utf8 encoding |
|
3716 | 3716 | } |
3717 | 3717 | if ($objp->remise_percent >= 1) { |
3718 | - $optlabel .= " - " . $langs->trans("Discount") . " : " . vatrate($objp->remise_percent) . ' %'; |
|
3719 | - $outvallabel .= " - " . $langs->transnoentities("Discount") . " : " . vatrate($objp->remise_percent) . ' %'; |
|
3718 | + $optlabel .= " - ".$langs->trans("Discount")." : ".vatrate($objp->remise_percent).' %'; |
|
3719 | + $outvallabel .= " - ".$langs->transnoentities("Discount")." : ".vatrate($objp->remise_percent).' %'; |
|
3720 | 3720 | } |
3721 | 3721 | if ($objp->duration) { |
3722 | - $optlabel .= " - " . $objp->duration; |
|
3723 | - $outvallabel .= " - " . $objp->duration; |
|
3722 | + $optlabel .= " - ".$objp->duration; |
|
3723 | + $outvallabel .= " - ".$objp->duration; |
|
3724 | 3724 | } |
3725 | 3725 | if (!$socid) { |
3726 | - $optlabel .= " - " . dol_trunc($objp->name, 8); |
|
3727 | - $outvallabel .= " - " . dol_trunc($objp->name, 8); |
|
3726 | + $optlabel .= " - ".dol_trunc($objp->name, 8); |
|
3727 | + $outvallabel .= " - ".dol_trunc($objp->name, 8); |
|
3728 | 3728 | } |
3729 | 3729 | if ($objp->supplier_reputation) { |
3730 | 3730 | //TODO dictionary |
3731 | 3731 | $reputations = array('' => $langs->trans('Standard'), 'FAVORITE' => $langs->trans('Favorite'), 'NOTTHGOOD' => $langs->trans('NotTheGoodQualitySupplier'), 'DONOTORDER' => $langs->trans('DoNotOrderThisProductToThisSupplier')); |
3732 | 3732 | |
3733 | - $optlabel .= " - " . $reputations[$objp->supplier_reputation]; |
|
3734 | - $outvallabel .= " - " . $reputations[$objp->supplier_reputation]; |
|
3733 | + $optlabel .= " - ".$reputations[$objp->supplier_reputation]; |
|
3734 | + $outvallabel .= " - ".$reputations[$objp->supplier_reputation]; |
|
3735 | 3735 | } |
3736 | 3736 | } else { |
3737 | 3737 | if (empty($alsoproductwithnosupplierprice)) { // No supplier price defined for couple product/supplier |
3738 | - $optlabel .= " - <span class='opacitymedium'>" . $langs->trans("NoPriceDefinedForThisSupplier") . '</span>'; |
|
3739 | - $outvallabel .= ' - ' . $langs->transnoentities("NoPriceDefinedForThisSupplier"); |
|
3738 | + $optlabel .= " - <span class='opacitymedium'>".$langs->trans("NoPriceDefinedForThisSupplier").'</span>'; |
|
3739 | + $outvallabel .= ' - '.$langs->transnoentities("NoPriceDefinedForThisSupplier"); |
|
3740 | 3740 | } else // No supplier price defined for product, even on other suppliers |
3741 | 3741 | { |
3742 | - $optlabel .= " - <span class='opacitymedium'>" . $langs->trans("NoPriceDefinedForThisSupplier") . '</span>'; |
|
3743 | - $outvallabel .= ' - ' . $langs->transnoentities("NoPriceDefinedForThisSupplier"); |
|
3742 | + $optlabel .= " - <span class='opacitymedium'>".$langs->trans("NoPriceDefinedForThisSupplier").'</span>'; |
|
3743 | + $outvallabel .= ' - '.$langs->transnoentities("NoPriceDefinedForThisSupplier"); |
|
3744 | 3744 | } |
3745 | 3745 | } |
3746 | 3746 | |
@@ -3748,14 +3748,14 @@ discard block |
||
3748 | 3748 | $novirtualstock = ($showstockinlist == 2); |
3749 | 3749 | |
3750 | 3750 | if ($user->hasRight('stock', 'lire')) { |
3751 | - $outvallabel .= ' - ' . $langs->trans("Stock") . ': ' . price(price2num($objp->stock, 'MS')); |
|
3751 | + $outvallabel .= ' - '.$langs->trans("Stock").': '.price(price2num($objp->stock, 'MS')); |
|
3752 | 3752 | |
3753 | 3753 | if ($objp->stock > 0) { |
3754 | 3754 | $optlabel .= ' - <span class="product_line_stock_ok">'; |
3755 | 3755 | } elseif ($objp->stock <= 0) { |
3756 | 3756 | $optlabel .= ' - <span class="product_line_stock_too_low">'; |
3757 | 3757 | } |
3758 | - $optlabel .= $langs->transnoentities("Stock") . ':' . price(price2num($objp->stock, 'MS')); |
|
3758 | + $optlabel .= $langs->transnoentities("Stock").':'.price(price2num($objp->stock, 'MS')); |
|
3759 | 3759 | $optlabel .= '</span>'; |
3760 | 3760 | if (empty($novirtualstock) && !empty($conf->global->STOCK_SHOW_VIRTUAL_STOCK_IN_PRODUCTS_COMBO)) { // Warning, this option may slow down combo list generation |
3761 | 3761 | $langs->load("stocks"); |
@@ -3765,9 +3765,9 @@ discard block |
||
3765 | 3765 | $tmpproduct->load_virtual_stock(); |
3766 | 3766 | $virtualstock = $tmpproduct->stock_theorique; |
3767 | 3767 | |
3768 | - $outvallabel .= ' - ' . $langs->trans("VirtualStock") . ':' . $virtualstock; |
|
3768 | + $outvallabel .= ' - '.$langs->trans("VirtualStock").':'.$virtualstock; |
|
3769 | 3769 | |
3770 | - $optlabel .= ' - ' . $langs->transnoentities("VirtualStock") . ':'; |
|
3770 | + $optlabel .= ' - '.$langs->transnoentities("VirtualStock").':'; |
|
3771 | 3771 | if ($virtualstock > 0) { |
3772 | 3772 | $optlabel .= '<span class="product_line_stock_ok">'; |
3773 | 3773 | } elseif ($virtualstock <= 0) { |
@@ -3781,7 +3781,7 @@ discard block |
||
3781 | 3781 | } |
3782 | 3782 | } |
3783 | 3783 | |
3784 | - $optstart = '<option value="' . $outkey . '"'; |
|
3784 | + $optstart = '<option value="'.$outkey.'"'; |
|
3785 | 3785 | if ($selected && $selected == $objp->idprodfournprice) { |
3786 | 3786 | $optstart .= ' selected'; |
3787 | 3787 | } |
@@ -3790,26 +3790,26 @@ discard block |
||
3790 | 3790 | } |
3791 | 3791 | |
3792 | 3792 | if (!empty($objp->idprodfournprice) && $objp->idprodfournprice > 0) { |
3793 | - $optstart .= ' data-product-id="' . dol_escape_htmltag($objp->rowid) . '"'; |
|
3794 | - $optstart .= ' data-price-id="' . dol_escape_htmltag($objp->idprodfournprice) . '"'; |
|
3795 | - $optstart .= ' data-qty="' . dol_escape_htmltag($objp->quantity) . '"'; |
|
3796 | - $optstart .= ' data-up="' . dol_escape_htmltag(price2num($objp->unitprice)) . '"'; |
|
3797 | - $optstart .= ' data-up-locale="' . dol_escape_htmltag(price($objp->unitprice)) . '"'; |
|
3798 | - $optstart .= ' data-discount="' . dol_escape_htmltag($outdiscount) . '"'; |
|
3799 | - $optstart .= ' data-tvatx="' . dol_escape_htmltag(price2num($objp->tva_tx)) . '"'; |
|
3800 | - $optstart .= ' data-tvatx-formated="' . dol_escape_htmltag(price($objp->tva_tx, 0, $langs, 1, -1, 2)) . '"'; |
|
3801 | - $optstart .= ' data-default-vat-code="' . dol_escape_htmltag($objp->default_vat_code) . '"'; |
|
3802 | - } |
|
3803 | - $optstart .= ' data-description="' . dol_escape_htmltag($objp->description, 0, 1) . '"'; |
|
3793 | + $optstart .= ' data-product-id="'.dol_escape_htmltag($objp->rowid).'"'; |
|
3794 | + $optstart .= ' data-price-id="'.dol_escape_htmltag($objp->idprodfournprice).'"'; |
|
3795 | + $optstart .= ' data-qty="'.dol_escape_htmltag($objp->quantity).'"'; |
|
3796 | + $optstart .= ' data-up="'.dol_escape_htmltag(price2num($objp->unitprice)).'"'; |
|
3797 | + $optstart .= ' data-up-locale="'.dol_escape_htmltag(price($objp->unitprice)).'"'; |
|
3798 | + $optstart .= ' data-discount="'.dol_escape_htmltag($outdiscount).'"'; |
|
3799 | + $optstart .= ' data-tvatx="'.dol_escape_htmltag(price2num($objp->tva_tx)).'"'; |
|
3800 | + $optstart .= ' data-tvatx-formated="'.dol_escape_htmltag(price($objp->tva_tx, 0, $langs, 1, -1, 2)).'"'; |
|
3801 | + $optstart .= ' data-default-vat-code="'.dol_escape_htmltag($objp->default_vat_code).'"'; |
|
3802 | + } |
|
3803 | + $optstart .= ' data-description="'.dol_escape_htmltag($objp->description, 0, 1).'"'; |
|
3804 | 3804 | |
3805 | 3805 | $outarrayentry = array( |
3806 | 3806 | 'key' => $outkey, |
3807 | 3807 | 'value' => $outref, |
3808 | 3808 | 'label' => $outvallabel, |
3809 | 3809 | 'qty' => $outqty, |
3810 | - 'price_qty_ht' => price2num($objp->fprice, 'MU'), // Keep higher resolution for price for the min qty |
|
3811 | - 'price_unit_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price |
|
3812 | - 'price_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price (for compatibility) |
|
3810 | + 'price_qty_ht' => price2num($objp->fprice, 'MU'), // Keep higher resolution for price for the min qty |
|
3811 | + 'price_unit_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price |
|
3812 | + 'price_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price (for compatibility) |
|
3813 | 3813 | 'tva_tx_formated' => price($objp->tva_tx, 0, $langs, 1, -1, 2), |
3814 | 3814 | 'tva_tx' => price2num($objp->tva_tx), |
3815 | 3815 | 'default_vat_code' => $objp->default_vat_code, |
@@ -3834,18 +3834,18 @@ discard block |
||
3834 | 3834 | // Add new entry |
3835 | 3835 | // "key" value of json key array is used by jQuery automatically as selected value. Example: 'type' = product or service, 'price_ht' = unit price without tax |
3836 | 3836 | // "label" value of json key array is used by jQuery automatically as text for combo box |
3837 | - $out .= $optstart . ' data-html="' . dol_escape_htmltag($optlabel) . '">' . $optlabel . "</option>\n"; |
|
3837 | + $out .= $optstart.' data-html="'.dol_escape_htmltag($optlabel).'">'.$optlabel."</option>\n"; |
|
3838 | 3838 | array_push( |
3839 | 3839 | $outarray, |
3840 | 3840 | array('key' => $outkey, |
3841 | 3841 | 'value' => $outref, |
3842 | 3842 | 'label' => $outvallabel, |
3843 | 3843 | 'qty' => $outqty, |
3844 | - 'price_qty_ht' => price2num($objp->fprice, 'MU'), // Keep higher resolution for price for the min qty |
|
3844 | + 'price_qty_ht' => price2num($objp->fprice, 'MU'), // Keep higher resolution for price for the min qty |
|
3845 | 3845 | 'price_qty_ht_locale' => price($objp->fprice), |
3846 | - 'price_unit_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price |
|
3846 | + 'price_unit_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price |
|
3847 | 3847 | 'price_unit_ht_locale' => price($objp->unitprice), |
3848 | - 'price_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price (for compatibility) |
|
3848 | + 'price_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price (for compatibility) |
|
3849 | 3849 | 'tva_tx_formated' => price($objp->tva_tx), |
3850 | 3850 | 'tva_tx' => price2num($objp->tva_tx), |
3851 | 3851 | 'default_vat_code' => $objp->default_vat_code, |
@@ -3872,7 +3872,7 @@ discard block |
||
3872 | 3872 | |
3873 | 3873 | $this->db->free($result); |
3874 | 3874 | |
3875 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
3875 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
3876 | 3876 | $out .= ajax_combobox($htmlname); |
3877 | 3877 | } else { |
3878 | 3878 | dol_print_error($this->db); |
@@ -3904,43 +3904,43 @@ discard block |
||
3904 | 3904 | $sql = "SELECT p.rowid, p.ref, p.label, p.price, p.duration, pfp.fk_soc,"; |
3905 | 3905 | $sql .= " pfp.ref_fourn, pfp.rowid as idprodfournprice, pfp.price as fprice, pfp.remise_percent, pfp.quantity, pfp.unitprice,"; |
3906 | 3906 | $sql .= " pfp.fk_supplier_price_expression, pfp.fk_product, pfp.tva_tx, s.nom as name"; |
3907 | - $sql .= " FROM " . $this->db->prefix() . "product as p"; |
|
3908 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "product_fournisseur_price as pfp ON p.rowid = pfp.fk_product"; |
|
3909 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "societe as s ON pfp.fk_soc = s.rowid"; |
|
3910 | - $sql .= " WHERE pfp.entity IN (" . getEntity('productsupplierprice') . ")"; |
|
3907 | + $sql .= " FROM ".$this->db->prefix()."product as p"; |
|
3908 | + $sql .= " LEFT JOIN ".$this->db->prefix()."product_fournisseur_price as pfp ON p.rowid = pfp.fk_product"; |
|
3909 | + $sql .= " LEFT JOIN ".$this->db->prefix()."societe as s ON pfp.fk_soc = s.rowid"; |
|
3910 | + $sql .= " WHERE pfp.entity IN (".getEntity('productsupplierprice').")"; |
|
3911 | 3911 | $sql .= " AND p.tobuy = 1"; |
3912 | 3912 | $sql .= " AND s.fournisseur = 1"; |
3913 | - $sql .= " AND p.rowid = " . ((int) $productid); |
|
3913 | + $sql .= " AND p.rowid = ".((int) $productid); |
|
3914 | 3914 | if (empty($conf->global->PRODUCT_BEST_SUPPLIER_PRICE_PRESELECTED)) { |
3915 | 3915 | $sql .= " ORDER BY s.nom, pfp.ref_fourn DESC"; |
3916 | 3916 | } else { |
3917 | 3917 | $sql .= " ORDER BY pfp.unitprice ASC"; |
3918 | 3918 | } |
3919 | 3919 | |
3920 | - dol_syslog(get_class($this) . "::select_product_fourn_price", LOG_DEBUG); |
|
3920 | + dol_syslog(get_class($this)."::select_product_fourn_price", LOG_DEBUG); |
|
3921 | 3921 | $result = $this->db->query($sql); |
3922 | 3922 | |
3923 | 3923 | if ($result) { |
3924 | 3924 | $num = $this->db->num_rows($result); |
3925 | 3925 | |
3926 | - $form = '<select class="flat" id="select_' . $htmlname . '" name="' . $htmlname . '">'; |
|
3926 | + $form = '<select class="flat" id="select_'.$htmlname.'" name="'.$htmlname.'">'; |
|
3927 | 3927 | |
3928 | 3928 | if (!$num) { |
3929 | - $form .= '<option value="0">-- ' . $langs->trans("NoSupplierPriceDefinedForThisProduct") . ' --</option>'; |
|
3929 | + $form .= '<option value="0">-- '.$langs->trans("NoSupplierPriceDefinedForThisProduct").' --</option>'; |
|
3930 | 3930 | } else { |
3931 | - require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php'; |
|
3931 | + require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php'; |
|
3932 | 3932 | $form .= '<option value="0"> </option>'; |
3933 | 3933 | |
3934 | 3934 | $i = 0; |
3935 | 3935 | while ($i < $num) { |
3936 | 3936 | $objp = $this->db->fetch_object($result); |
3937 | 3937 | |
3938 | - $opt = '<option value="' . $objp->idprodfournprice . '"'; |
|
3938 | + $opt = '<option value="'.$objp->idprodfournprice.'"'; |
|
3939 | 3939 | //if there is only one supplier, preselect it |
3940 | 3940 | if ($num == 1 || ($selected_supplier > 0 && $objp->fk_soc == $selected_supplier) || ($i == 0 && !empty($conf->global->PRODUCT_BEST_SUPPLIER_PRICE_PRESELECTED))) { |
3941 | 3941 | $opt .= ' selected'; |
3942 | 3942 | } |
3943 | - $opt .= '>' . $objp->name . ' - ' . $objp->ref_fourn . ' - '; |
|
3943 | + $opt .= '>'.$objp->name.' - '.$objp->ref_fourn.' - '; |
|
3944 | 3944 | |
3945 | 3945 | if (isModEnabled('dynamicprices') && !empty($objp->fk_supplier_price_expression)) { |
3946 | 3946 | $prod_supplier = new ProductFournisseur($this->db); |
@@ -3950,7 +3950,7 @@ discard block |
||
3950 | 3950 | $prod_supplier->fourn_tva_tx = $objp->tva_tx; |
3951 | 3951 | $prod_supplier->fk_supplier_price_expression = $objp->fk_supplier_price_expression; |
3952 | 3952 | |
3953 | - require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php'; |
|
3953 | + require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php'; |
|
3954 | 3954 | $priceparser = new PriceParser($this->db); |
3955 | 3955 | $price_result = $priceparser->parseProductSupplier($prod_supplier); |
3956 | 3956 | if ($price_result >= 0) { |
@@ -3961,10 +3961,10 @@ discard block |
||
3961 | 3961 | } |
3962 | 3962 | } |
3963 | 3963 | if ($objp->quantity == 1) { |
3964 | - $opt .= price($objp->fprice * (!empty($conf->global->DISPLAY_DISCOUNTED_SUPPLIER_PRICE) ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/"; |
|
3964 | + $opt .= price($objp->fprice * (!empty($conf->global->DISPLAY_DISCOUNTED_SUPPLIER_PRICE) ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency)."/"; |
|
3965 | 3965 | } |
3966 | 3966 | |
3967 | - $opt .= $objp->quantity . ' '; |
|
3967 | + $opt .= $objp->quantity.' '; |
|
3968 | 3968 | |
3969 | 3969 | if ($objp->quantity == 1) { |
3970 | 3970 | $opt .= $langs->trans("Unit"); |
@@ -3973,10 +3973,10 @@ discard block |
||
3973 | 3973 | } |
3974 | 3974 | if ($objp->quantity > 1) { |
3975 | 3975 | $opt .= " - "; |
3976 | - $opt .= price($objp->unitprice * (!empty($conf->global->DISPLAY_DISCOUNTED_SUPPLIER_PRICE) ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/" . $langs->trans("Unit"); |
|
3976 | + $opt .= price($objp->unitprice * (!empty($conf->global->DISPLAY_DISCOUNTED_SUPPLIER_PRICE) ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency)."/".$langs->trans("Unit"); |
|
3977 | 3977 | } |
3978 | 3978 | if ($objp->duration) { |
3979 | - $opt .= " - " . $objp->duration; |
|
3979 | + $opt .= " - ".$objp->duration; |
|
3980 | 3980 | } |
3981 | 3981 | $opt .= "</option>\n"; |
3982 | 3982 | |
@@ -4010,14 +4010,14 @@ discard block |
||
4010 | 4010 | // phpcs:enable |
4011 | 4011 | // looking for users |
4012 | 4012 | $sql = "SELECT a.rowid, a.label"; |
4013 | - $sql .= " FROM " . $this->db->prefix() . "societe_address as a"; |
|
4014 | - $sql .= " WHERE a.fk_soc = " . ((int) $socid); |
|
4013 | + $sql .= " FROM ".$this->db->prefix()."societe_address as a"; |
|
4014 | + $sql .= " WHERE a.fk_soc = ".((int) $socid); |
|
4015 | 4015 | $sql .= " ORDER BY a.label ASC"; |
4016 | 4016 | |
4017 | - dol_syslog(get_class($this) . "::select_address", LOG_DEBUG); |
|
4017 | + dol_syslog(get_class($this)."::select_address", LOG_DEBUG); |
|
4018 | 4018 | $resql = $this->db->query($sql); |
4019 | 4019 | if ($resql) { |
4020 | - print '<select class="flat" id="select_' . $htmlname . '" name="' . $htmlname . '">'; |
|
4020 | + print '<select class="flat" id="select_'.$htmlname.'" name="'.$htmlname.'">'; |
|
4021 | 4021 | if ($showempty) { |
4022 | 4022 | print '<option value="0"> </option>'; |
4023 | 4023 | } |
@@ -4028,9 +4028,9 @@ discard block |
||
4028 | 4028 | $obj = $this->db->fetch_object($resql); |
4029 | 4029 | |
4030 | 4030 | if ($selected && $selected == $obj->rowid) { |
4031 | - print '<option value="' . $obj->rowid . '" selected>' . $obj->label . '</option>'; |
|
4031 | + print '<option value="'.$obj->rowid.'" selected>'.$obj->label.'</option>'; |
|
4032 | 4032 | } else { |
4033 | - print '<option value="' . $obj->rowid . '">' . $obj->label . '</option>'; |
|
4033 | + print '<option value="'.$obj->rowid.'">'.$obj->label.'</option>'; |
|
4034 | 4034 | } |
4035 | 4035 | $i++; |
4036 | 4036 | } |
@@ -4063,8 +4063,8 @@ discard block |
||
4063 | 4063 | dol_syslog(__METHOD__, LOG_DEBUG); |
4064 | 4064 | |
4065 | 4065 | $sql = "SELECT rowid, code, libelle as label, deposit_percent"; |
4066 | - $sql .= " FROM " . $this->db->prefix() . 'c_payment_term'; |
|
4067 | - $sql .= " WHERE entity IN (" . getEntity('c_payment_term') . ")"; |
|
4066 | + $sql .= " FROM ".$this->db->prefix().'c_payment_term'; |
|
4067 | + $sql .= " WHERE entity IN (".getEntity('c_payment_term').")"; |
|
4068 | 4068 | $sql .= " AND active > 0"; |
4069 | 4069 | $sql .= " ORDER BY sortorder"; |
4070 | 4070 | |
@@ -4076,7 +4076,7 @@ discard block |
||
4076 | 4076 | $obj = $this->db->fetch_object($resql); |
4077 | 4077 | |
4078 | 4078 | // Si traduction existe, on l'utilise, sinon on prend le libelle par defaut |
4079 | - $label = ($langs->trans("PaymentConditionShort" . $obj->code) != ("PaymentConditionShort" . $obj->code) ? $langs->trans("PaymentConditionShort" . $obj->code) : ($obj->label != '-' ? $obj->label : '')); |
|
4079 | + $label = ($langs->trans("PaymentConditionShort".$obj->code) != ("PaymentConditionShort".$obj->code) ? $langs->trans("PaymentConditionShort".$obj->code) : ($obj->label != '-' ? $obj->label : '')); |
|
4080 | 4080 | $this->cache_conditions_paiements[$obj->rowid]['code'] = $obj->code; |
4081 | 4081 | $this->cache_conditions_paiements[$obj->rowid]['label'] = $label; |
4082 | 4082 | $this->cache_conditions_paiements[$obj->rowid]['deposit_percent'] = $obj->deposit_percent; |
@@ -4104,7 +4104,7 @@ discard block |
||
4104 | 4104 | // phpcs:enable |
4105 | 4105 | global $langs; |
4106 | 4106 | |
4107 | - $num = count($this->cache_availability); // TODO Use $conf->cache['availability'] instead of $this->cache_availability |
|
4107 | + $num = count($this->cache_availability); // TODO Use $conf->cache['availability'] instead of $this->cache_availability |
|
4108 | 4108 | if ($num > 0) { |
4109 | 4109 | return 0; // Cache already loaded |
4110 | 4110 | } |
@@ -4114,7 +4114,7 @@ discard block |
||
4114 | 4114 | $langs->load('propal'); |
4115 | 4115 | |
4116 | 4116 | $sql = "SELECT rowid, code, label, position"; |
4117 | - $sql .= " FROM " . $this->db->prefix() . 'c_availability'; |
|
4117 | + $sql .= " FROM ".$this->db->prefix().'c_availability'; |
|
4118 | 4118 | $sql .= " WHERE active > 0"; |
4119 | 4119 | |
4120 | 4120 | $resql = $this->db->query($sql); |
@@ -4125,7 +4125,7 @@ discard block |
||
4125 | 4125 | $obj = $this->db->fetch_object($resql); |
4126 | 4126 | |
4127 | 4127 | // Si traduction existe, on l'utilise, sinon on prend le libelle par defaut |
4128 | - $label = ($langs->trans("AvailabilityType" . $obj->code) != ("AvailabilityType" . $obj->code) ? $langs->trans("AvailabilityType" . $obj->code) : ($obj->label != '-' ? $obj->label : '')); |
|
4128 | + $label = ($langs->trans("AvailabilityType".$obj->code) != ("AvailabilityType".$obj->code) ? $langs->trans("AvailabilityType".$obj->code) : ($obj->label != '-' ? $obj->label : '')); |
|
4129 | 4129 | $this->cache_availability[$obj->rowid]['code'] = $obj->code; |
4130 | 4130 | $this->cache_availability[$obj->rowid]['label'] = $label; |
4131 | 4131 | $this->cache_availability[$obj->rowid]['position'] = $obj->position; |
@@ -4157,17 +4157,17 @@ discard block |
||
4157 | 4157 | |
4158 | 4158 | $this->load_cache_availability(); |
4159 | 4159 | |
4160 | - dol_syslog(__METHOD__ . " selected=" . $selected . ", htmlname=" . $htmlname, LOG_DEBUG); |
|
4160 | + dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG); |
|
4161 | 4161 | |
4162 | - print '<select id="' . $htmlname . '" class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">'; |
|
4162 | + print '<select id="'.$htmlname.'" class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">'; |
|
4163 | 4163 | if ($addempty) { |
4164 | 4164 | print '<option value="0"> </option>'; |
4165 | 4165 | } |
4166 | 4166 | foreach ($this->cache_availability as $id => $arrayavailability) { |
4167 | 4167 | if ($selected == $id) { |
4168 | - print '<option value="' . $id . '" selected>'; |
|
4168 | + print '<option value="'.$id.'" selected>'; |
|
4169 | 4169 | } else { |
4170 | - print '<option value="' . $id . '">'; |
|
4170 | + print '<option value="'.$id.'">'; |
|
4171 | 4171 | } |
4172 | 4172 | print dol_escape_htmltag($arrayavailability['label']); |
4173 | 4173 | print '</option>'; |
@@ -4188,13 +4188,13 @@ discard block |
||
4188 | 4188 | { |
4189 | 4189 | global $langs; |
4190 | 4190 | |
4191 | - $num = count($this->cache_demand_reason); // TODO Use $conf->cache['input_reason'] instead of $this->cache_demand_reason |
|
4191 | + $num = count($this->cache_demand_reason); // TODO Use $conf->cache['input_reason'] instead of $this->cache_demand_reason |
|
4192 | 4192 | if ($num > 0) { |
4193 | 4193 | return 0; // Cache already loaded |
4194 | 4194 | } |
4195 | 4195 | |
4196 | 4196 | $sql = "SELECT rowid, code, label"; |
4197 | - $sql .= " FROM " . $this->db->prefix() . 'c_input_reason'; |
|
4197 | + $sql .= " FROM ".$this->db->prefix().'c_input_reason'; |
|
4198 | 4198 | $sql .= " WHERE active > 0"; |
4199 | 4199 | |
4200 | 4200 | $resql = $this->db->query($sql); |
@@ -4207,8 +4207,8 @@ discard block |
||
4207 | 4207 | |
4208 | 4208 | // Si traduction existe, on l'utilise, sinon on prend le libelle par defaut |
4209 | 4209 | $label = ($obj->label != '-' ? $obj->label : ''); |
4210 | - if ($langs->trans("DemandReasonType" . $obj->code) != ("DemandReasonType" . $obj->code)) { |
|
4211 | - $label = $langs->trans("DemandReasonType" . $obj->code); // So translation key DemandReasonTypeSRC_XXX will work |
|
4210 | + if ($langs->trans("DemandReasonType".$obj->code) != ("DemandReasonType".$obj->code)) { |
|
4211 | + $label = $langs->trans("DemandReasonType".$obj->code); // So translation key DemandReasonTypeSRC_XXX will work |
|
4212 | 4212 | } |
4213 | 4213 | if ($langs->trans($obj->code) != $obj->code) { |
4214 | 4214 | $label = $langs->trans($obj->code); // So translation key SRC_XXX will work |
@@ -4248,9 +4248,9 @@ discard block |
||
4248 | 4248 | |
4249 | 4249 | $this->loadCacheInputReason(); |
4250 | 4250 | |
4251 | - print '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" id="select_' . $htmlname . '" name="' . $htmlname . '">'; |
|
4251 | + print '<select class="flat'.($morecss ? ' '.$morecss : '').'" id="select_'.$htmlname.'" name="'.$htmlname.'">'; |
|
4252 | 4252 | if ($addempty) { |
4253 | - print '<option value="0"' . (empty($selected) ? ' selected' : '') . '> </option>'; |
|
4253 | + print '<option value="0"'.(empty($selected) ? ' selected' : '').'> </option>'; |
|
4254 | 4254 | } |
4255 | 4255 | foreach ($this->cache_demand_reason as $id => $arraydemandreason) { |
4256 | 4256 | if ($arraydemandreason['code'] == $exclude) { |
@@ -4258,9 +4258,9 @@ discard block |
||
4258 | 4258 | } |
4259 | 4259 | |
4260 | 4260 | if ($selected && ($selected == $arraydemandreason['id'] || $selected == $arraydemandreason['code'])) { |
4261 | - print '<option value="' . $arraydemandreason['id'] . '" selected>'; |
|
4261 | + print '<option value="'.$arraydemandreason['id'].'" selected>'; |
|
4262 | 4262 | } else { |
4263 | - print '<option value="' . $arraydemandreason['id'] . '">'; |
|
4263 | + print '<option value="'.$arraydemandreason['id'].'">'; |
|
4264 | 4264 | } |
4265 | 4265 | $label = $arraydemandreason['label']; // Translation of label was already done into the ->loadCacheInputReason |
4266 | 4266 | print $langs->trans($label); |
@@ -4270,7 +4270,7 @@ discard block |
||
4270 | 4270 | if ($user->admin && empty($notooltip)) { |
4271 | 4271 | print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); |
4272 | 4272 | } |
4273 | - print ajax_combobox('select_' . $htmlname); |
|
4273 | + print ajax_combobox('select_'.$htmlname); |
|
4274 | 4274 | } |
4275 | 4275 | |
4276 | 4276 | // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
@@ -4285,7 +4285,7 @@ discard block |
||
4285 | 4285 | // phpcs:enable |
4286 | 4286 | global $langs; |
4287 | 4287 | |
4288 | - $num = count($this->cache_types_paiements); // TODO Use $conf->cache['payment_mode'] instead of $this->cache_types_paiements |
|
4288 | + $num = count($this->cache_types_paiements); // TODO Use $conf->cache['payment_mode'] instead of $this->cache_types_paiements |
|
4289 | 4289 | if ($num > 0) { |
4290 | 4290 | return $num; // Cache already loaded |
4291 | 4291 | } |
@@ -4295,8 +4295,8 @@ discard block |
||
4295 | 4295 | $this->cache_types_paiements = array(); |
4296 | 4296 | |
4297 | 4297 | $sql = "SELECT id, code, libelle as label, type, active"; |
4298 | - $sql .= " FROM " . $this->db->prefix() . "c_paiement"; |
|
4299 | - $sql .= " WHERE entity IN (" . getEntity('c_paiement') . ")"; |
|
4298 | + $sql .= " FROM ".$this->db->prefix()."c_paiement"; |
|
4299 | + $sql .= " WHERE entity IN (".getEntity('c_paiement').")"; |
|
4300 | 4300 | |
4301 | 4301 | $resql = $this->db->query($sql); |
4302 | 4302 | if ($resql) { |
@@ -4306,7 +4306,7 @@ discard block |
||
4306 | 4306 | $obj = $this->db->fetch_object($resql); |
4307 | 4307 | |
4308 | 4308 | // Si traduction existe, on l'utilise, sinon on prend le libelle par defaut |
4309 | - $label = ($langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) != ("PaymentTypeShort" . $obj->code) ? $langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) : ($obj->label != '-' ? $obj->label : '')); |
|
4309 | + $label = ($langs->transnoentitiesnoconv("PaymentTypeShort".$obj->code) != ("PaymentTypeShort".$obj->code) ? $langs->transnoentitiesnoconv("PaymentTypeShort".$obj->code) : ($obj->label != '-' ? $obj->label : '')); |
|
4310 | 4310 | $this->cache_types_paiements[$obj->id]['id'] = $obj->id; |
4311 | 4311 | $this->cache_types_paiements[$obj->id]['code'] = $obj->code; |
4312 | 4312 | $this->cache_types_paiements[$obj->id]['label'] = $label; |
@@ -4372,17 +4372,17 @@ discard block |
||
4372 | 4372 | global $langs, $user, $conf; |
4373 | 4373 | |
4374 | 4374 | $out = ''; |
4375 | - dol_syslog(__METHOD__ . " selected=" . $selected . ", htmlname=" . $htmlname, LOG_DEBUG); |
|
4375 | + dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG); |
|
4376 | 4376 | |
4377 | 4377 | $this->load_cache_conditions_paiements(); |
4378 | 4378 | |
4379 | 4379 | // Set default value if not already set by caller |
4380 | 4380 | if (empty($selected) && !empty($conf->global->MAIN_DEFAULT_PAYMENT_TERM_ID)) { |
4381 | - dol_syslog(__METHOD__ . "Using deprecated option MAIN_DEFAULT_PAYMENT_TERM_ID", LOG_NOTICE); |
|
4381 | + dol_syslog(__METHOD__."Using deprecated option MAIN_DEFAULT_PAYMENT_TERM_ID", LOG_NOTICE); |
|
4382 | 4382 | $selected = $conf->global->MAIN_DEFAULT_PAYMENT_TERM_ID; |
4383 | 4383 | } |
4384 | 4384 | |
4385 | - $out .= '<select id="' . $htmlname . '" class="flat selectpaymentterms' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">'; |
|
4385 | + $out .= '<select id="'.$htmlname.'" class="flat selectpaymentterms'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">'; |
|
4386 | 4386 | if ($addempty) { |
4387 | 4387 | $out .= '<option value="0"> </option>'; |
4388 | 4388 | } |
@@ -4396,9 +4396,9 @@ discard block |
||
4396 | 4396 | |
4397 | 4397 | if ($selected == $id) { |
4398 | 4398 | $selectedDepositPercent = $deposit_percent > 0 ? $deposit_percent : $arrayconditions['deposit_percent']; |
4399 | - $out .= '<option value="' . $id . '" data-deposit_percent="' . $arrayconditions['deposit_percent'] . '" selected>'; |
|
4399 | + $out .= '<option value="'.$id.'" data-deposit_percent="'.$arrayconditions['deposit_percent'].'" selected>'; |
|
4400 | 4400 | } else { |
4401 | - $out .= '<option value="' . $id . '" data-deposit_percent="' . $arrayconditions['deposit_percent'] . '">'; |
|
4401 | + $out .= '<option value="'.$id.'" data-deposit_percent="'.$arrayconditions['deposit_percent'].'">'; |
|
4402 | 4402 | } |
4403 | 4403 | $label = $arrayconditions['label']; |
4404 | 4404 | |
@@ -4416,21 +4416,21 @@ discard block |
||
4416 | 4416 | $out .= ajax_combobox($htmlname); |
4417 | 4417 | |
4418 | 4418 | if ($deposit_percent >= 0) { |
4419 | - $out .= ' <span id="' . $htmlname . '_deposit_percent_container"' . (empty($selectedDepositPercent) ? ' style="display: none"' : '') . '>'; |
|
4420 | - $out .= $langs->trans('DepositPercent') . ' : '; |
|
4421 | - $out .= '<input id="' . $htmlname . '_deposit_percent" name="' . $htmlname . '_deposit_percent" class="maxwidth50" value="' . $deposit_percent . '" />'; |
|
4419 | + $out .= ' <span id="'.$htmlname.'_deposit_percent_container"'.(empty($selectedDepositPercent) ? ' style="display: none"' : '').'>'; |
|
4420 | + $out .= $langs->trans('DepositPercent').' : '; |
|
4421 | + $out .= '<input id="'.$htmlname.'_deposit_percent" name="'.$htmlname.'_deposit_percent" class="maxwidth50" value="'.$deposit_percent.'" />'; |
|
4422 | 4422 | $out .= '</span>'; |
4423 | 4423 | $out .= ' |
4424 | - <script nonce="' . getNonce() . '"> |
|
4424 | + <script nonce="' . getNonce().'"> |
|
4425 | 4425 | $(document).ready(function () { |
4426 | - $("#' . $htmlname . '").change(function () { |
|
4426 | + $("#' . $htmlname.'").change(function () { |
|
4427 | 4427 | let $selected = $(this).find("option:selected"); |
4428 | 4428 | let depositPercent = $selected.attr("data-deposit_percent"); |
4429 | 4429 | |
4430 | 4430 | if (depositPercent.length > 0) { |
4431 | - $("#' . $htmlname . '_deposit_percent_container").show().find("#' . $htmlname . '_deposit_percent").val(depositPercent); |
|
4431 | + $("#' . $htmlname.'_deposit_percent_container").show().find("#'.$htmlname.'_deposit_percent").val(depositPercent); |
|
4432 | 4432 | } else { |
4433 | - $("#' . $htmlname . '_deposit_percent_container").hide(); |
|
4433 | + $("#' . $htmlname.'_deposit_percent_container").hide(); |
|
4434 | 4434 | } |
4435 | 4435 | |
4436 | 4436 | return true; |
@@ -4468,7 +4468,7 @@ discard block |
||
4468 | 4468 | |
4469 | 4469 | $out = ''; |
4470 | 4470 | |
4471 | - dol_syslog(__METHOD__ . " " . $selected . ", " . $htmlname . ", " . $filtertype . ", " . $format, LOG_DEBUG); |
|
4471 | + dol_syslog(__METHOD__." ".$selected.", ".$htmlname.", ".$filtertype.", ".$format, LOG_DEBUG); |
|
4472 | 4472 | |
4473 | 4473 | $filterarray = array(); |
4474 | 4474 | if ($filtertype == 'CRDT') { |
@@ -4483,11 +4483,11 @@ discard block |
||
4483 | 4483 | |
4484 | 4484 | // Set default value if not already set by caller |
4485 | 4485 | if (empty($selected) && !empty($conf->global->MAIN_DEFAULT_PAYMENT_TYPE_ID)) { |
4486 | - dol_syslog(__METHOD__ . "Using deprecated option MAIN_DEFAULT_PAYMENT_TYPE_ID", LOG_NOTICE); |
|
4486 | + dol_syslog(__METHOD__."Using deprecated option MAIN_DEFAULT_PAYMENT_TYPE_ID", LOG_NOTICE); |
|
4487 | 4487 | $selected = $conf->global->MAIN_DEFAULT_PAYMENT_TYPE_ID; |
4488 | 4488 | } |
4489 | 4489 | |
4490 | - $out .= '<select id="select' . $htmlname . '" class="flat selectpaymenttypes' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">'; |
|
4490 | + $out .= '<select id="select'.$htmlname.'" class="flat selectpaymenttypes'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">'; |
|
4491 | 4491 | if ($empty) { |
4492 | 4492 | $out .= '<option value=""> </option>'; |
4493 | 4493 | } |
@@ -4508,13 +4508,13 @@ discard block |
||
4508 | 4508 | } |
4509 | 4509 | |
4510 | 4510 | if ($format == 0) { |
4511 | - $out .= '<option value="' . $id . '"'; |
|
4511 | + $out .= '<option value="'.$id.'"'; |
|
4512 | 4512 | } elseif ($format == 1) { |
4513 | - $out .= '<option value="' . $arraytypes['code'] . '"'; |
|
4513 | + $out .= '<option value="'.$arraytypes['code'].'"'; |
|
4514 | 4514 | } elseif ($format == 2) { |
4515 | - $out .= '<option value="' . $arraytypes['code'] . '"'; |
|
4515 | + $out .= '<option value="'.$arraytypes['code'].'"'; |
|
4516 | 4516 | } elseif ($format == 3) { |
4517 | - $out .= '<option value="' . $id . '"'; |
|
4517 | + $out .= '<option value="'.$id.'"'; |
|
4518 | 4518 | } |
4519 | 4519 | // Print attribute selected or not |
4520 | 4520 | if ($format == 1 || $format == 2) { |
@@ -4544,7 +4544,7 @@ discard block |
||
4544 | 4544 | if ($user->admin && !$noadmininfo) { |
4545 | 4545 | $out .= info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); |
4546 | 4546 | } |
4547 | - $out .= ajax_combobox('select' . $htmlname); |
|
4547 | + $out .= ajax_combobox('select'.$htmlname); |
|
4548 | 4548 | |
4549 | 4549 | if (empty($nooutput)) { |
4550 | 4550 | print $out; |
@@ -4566,22 +4566,22 @@ discard block |
||
4566 | 4566 | { |
4567 | 4567 | global $langs; |
4568 | 4568 | |
4569 | - $return = '<select class="flat maxwidth100" id="select_' . $htmlname . '" name="' . $htmlname . '">'; |
|
4569 | + $return = '<select class="flat maxwidth100" id="select_'.$htmlname.'" name="'.$htmlname.'">'; |
|
4570 | 4570 | $options = array( |
4571 | 4571 | 'HT' => $langs->trans("HT"), |
4572 | 4572 | 'TTC' => $langs->trans("TTC") |
4573 | 4573 | ); |
4574 | 4574 | foreach ($options as $id => $value) { |
4575 | 4575 | if ($selected == $id) { |
4576 | - $return .= '<option value="' . $id . '" selected>' . $value; |
|
4576 | + $return .= '<option value="'.$id.'" selected>'.$value; |
|
4577 | 4577 | } else { |
4578 | - $return .= '<option value="' . $id . '">' . $value; |
|
4578 | + $return .= '<option value="'.$id.'">'.$value; |
|
4579 | 4579 | } |
4580 | 4580 | $return .= '</option>'; |
4581 | 4581 | } |
4582 | 4582 | $return .= '</select>'; |
4583 | 4583 | if ($addjscombo) { |
4584 | - $return .= ajax_combobox('select_' . $htmlname); |
|
4584 | + $return .= ajax_combobox('select_'.$htmlname); |
|
4585 | 4585 | } |
4586 | 4586 | |
4587 | 4587 | return $return; |
@@ -4599,7 +4599,7 @@ discard block |
||
4599 | 4599 | // phpcs:enable |
4600 | 4600 | global $langs; |
4601 | 4601 | |
4602 | - $num = count($this->cache_transport_mode); // TODO Use $conf->cache['payment_mode'] instead of $this->cache_transport_mode |
|
4602 | + $num = count($this->cache_transport_mode); // TODO Use $conf->cache['payment_mode'] instead of $this->cache_transport_mode |
|
4603 | 4603 | if ($num > 0) { |
4604 | 4604 | return $num; // Cache already loaded |
4605 | 4605 | } |
@@ -4609,8 +4609,8 @@ discard block |
||
4609 | 4609 | $this->cache_transport_mode = array(); |
4610 | 4610 | |
4611 | 4611 | $sql = "SELECT rowid, code, label, active"; |
4612 | - $sql .= " FROM " . $this->db->prefix() . "c_transport_mode"; |
|
4613 | - $sql .= " WHERE entity IN (" . getEntity('c_transport_mode') . ")"; |
|
4612 | + $sql .= " FROM ".$this->db->prefix()."c_transport_mode"; |
|
4613 | + $sql .= " WHERE entity IN (".getEntity('c_transport_mode').")"; |
|
4614 | 4614 | |
4615 | 4615 | $resql = $this->db->query($sql); |
4616 | 4616 | if ($resql) { |
@@ -4620,7 +4620,7 @@ discard block |
||
4620 | 4620 | $obj = $this->db->fetch_object($resql); |
4621 | 4621 | |
4622 | 4622 | // If traduction exist, we use it else we take the default label |
4623 | - $label = ($langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) != ("PaymentTypeShort" . $obj->code) ? $langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) : ($obj->label != '-' ? $obj->label : '')); |
|
4623 | + $label = ($langs->transnoentitiesnoconv("PaymentTypeShort".$obj->code) != ("PaymentTypeShort".$obj->code) ? $langs->transnoentitiesnoconv("PaymentTypeShort".$obj->code) : ($obj->label != '-' ? $obj->label : '')); |
|
4624 | 4624 | $this->cache_transport_mode[$obj->rowid]['rowid'] = $obj->rowid; |
4625 | 4625 | $this->cache_transport_mode[$obj->rowid]['code'] = $obj->code; |
4626 | 4626 | $this->cache_transport_mode[$obj->rowid]['label'] = $label; |
@@ -4654,11 +4654,11 @@ discard block |
||
4654 | 4654 | { |
4655 | 4655 | global $langs, $user; |
4656 | 4656 | |
4657 | - dol_syslog(__METHOD__ . " " . $selected . ", " . $htmlname . ", " . $format, LOG_DEBUG); |
|
4657 | + dol_syslog(__METHOD__." ".$selected.", ".$htmlname.", ".$format, LOG_DEBUG); |
|
4658 | 4658 | |
4659 | 4659 | $this->load_cache_transport_mode(); |
4660 | 4660 | |
4661 | - print '<select id="select' . $htmlname . '" class="flat selectmodetransport' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">'; |
|
4661 | + print '<select id="select'.$htmlname.'" class="flat selectmodetransport'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">'; |
|
4662 | 4662 | if ($empty) { |
4663 | 4663 | print '<option value=""> </option>'; |
4664 | 4664 | } |
@@ -4674,13 +4674,13 @@ discard block |
||
4674 | 4674 | } |
4675 | 4675 | |
4676 | 4676 | if ($format == 0) { |
4677 | - print '<option value="' . $id . '"'; |
|
4677 | + print '<option value="'.$id.'"'; |
|
4678 | 4678 | } elseif ($format == 1) { |
4679 | - print '<option value="' . $arraytypes['code'] . '"'; |
|
4679 | + print '<option value="'.$arraytypes['code'].'"'; |
|
4680 | 4680 | } elseif ($format == 2) { |
4681 | - print '<option value="' . $arraytypes['code'] . '"'; |
|
4681 | + print '<option value="'.$arraytypes['code'].'"'; |
|
4682 | 4682 | } elseif ($format == 3) { |
4683 | - print '<option value="' . $id . '"'; |
|
4683 | + print '<option value="'.$id.'"'; |
|
4684 | 4684 | } |
4685 | 4685 | // If text is selected, we compare with code, else with id |
4686 | 4686 | if (preg_match('/[a-z]/i', $selected) && $selected == $arraytypes['code']) { |
@@ -4728,31 +4728,31 @@ discard block |
||
4728 | 4728 | $langs->load("deliveries"); |
4729 | 4729 | |
4730 | 4730 | $sql = "SELECT rowid, code, libelle as label"; |
4731 | - $sql .= " FROM " . $this->db->prefix() . "c_shipment_mode"; |
|
4731 | + $sql .= " FROM ".$this->db->prefix()."c_shipment_mode"; |
|
4732 | 4732 | $sql .= " WHERE active > 0"; |
4733 | 4733 | if ($filtre) { |
4734 | - $sql .= " AND " . $filtre; |
|
4734 | + $sql .= " AND ".$filtre; |
|
4735 | 4735 | } |
4736 | 4736 | $sql .= " ORDER BY libelle ASC"; |
4737 | 4737 | |
4738 | - dol_syslog(get_class($this) . "::selectShippingMode", LOG_DEBUG); |
|
4738 | + dol_syslog(get_class($this)."::selectShippingMode", LOG_DEBUG); |
|
4739 | 4739 | $result = $this->db->query($sql); |
4740 | 4740 | if ($result) { |
4741 | 4741 | $num = $this->db->num_rows($result); |
4742 | 4742 | $i = 0; |
4743 | 4743 | if ($num) { |
4744 | - print '<select id="select' . $htmlname . '" class="flat selectshippingmethod' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '"' . ($moreattrib ? ' ' . $moreattrib : '') . '>'; |
|
4744 | + print '<select id="select'.$htmlname.'" class="flat selectshippingmethod'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'"'.($moreattrib ? ' '.$moreattrib : '').'>'; |
|
4745 | 4745 | if ($useempty == 1 || ($useempty == 2 && $num > 1)) { |
4746 | 4746 | print '<option value="-1"> </option>'; |
4747 | 4747 | } |
4748 | 4748 | while ($i < $num) { |
4749 | 4749 | $obj = $this->db->fetch_object($result); |
4750 | 4750 | if ($selected == $obj->rowid) { |
4751 | - print '<option value="' . $obj->rowid . '" selected>'; |
|
4751 | + print '<option value="'.$obj->rowid.'" selected>'; |
|
4752 | 4752 | } else { |
4753 | - print '<option value="' . $obj->rowid . '">'; |
|
4753 | + print '<option value="'.$obj->rowid.'">'; |
|
4754 | 4754 | } |
4755 | - print ($langs->trans("SendingMethod" . strtoupper($obj->code)) != "SendingMethod" . strtoupper($obj->code)) ? $langs->trans("SendingMethod" . strtoupper($obj->code)) : $obj->label; |
|
4755 | + print ($langs->trans("SendingMethod".strtoupper($obj->code)) != "SendingMethod".strtoupper($obj->code)) ? $langs->trans("SendingMethod".strtoupper($obj->code)) : $obj->label; |
|
4756 | 4756 | print '</option>'; |
4757 | 4757 | $i++; |
4758 | 4758 | } |
@@ -4761,7 +4761,7 @@ discard block |
||
4761 | 4761 | print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); |
4762 | 4762 | } |
4763 | 4763 | |
4764 | - print ajax_combobox('select' . $htmlname); |
|
4764 | + print ajax_combobox('select'.$htmlname); |
|
4765 | 4765 | } else { |
4766 | 4766 | print $langs->trans("NoShippingMethodDefined"); |
4767 | 4767 | } |
@@ -4786,16 +4786,16 @@ discard block |
||
4786 | 4786 | $langs->load("deliveries"); |
4787 | 4787 | |
4788 | 4788 | if ($htmlname != "none") { |
4789 | - print '<form method="POST" action="' . $page . '">'; |
|
4789 | + print '<form method="POST" action="'.$page.'">'; |
|
4790 | 4790 | print '<input type="hidden" name="action" value="setshippingmethod">'; |
4791 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
4791 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
4792 | 4792 | $this->selectShippingMethod($selected, $htmlname, '', $addempty); |
4793 | - print '<input type="submit" class="button valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
4793 | + print '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">'; |
|
4794 | 4794 | print '</form>'; |
4795 | 4795 | } else { |
4796 | 4796 | if ($selected) { |
4797 | 4797 | $code = $langs->getLabelFromKey($this->db, $selected, 'c_shipment_mode', 'rowid', 'code'); |
4798 | - print $langs->trans("SendingMethod" . strtoupper($code)); |
|
4798 | + print $langs->trans("SendingMethod".strtoupper($code)); |
|
4799 | 4799 | } else { |
4800 | 4800 | print " "; |
4801 | 4801 | } |
@@ -4818,10 +4818,10 @@ discard block |
||
4818 | 4818 | |
4819 | 4819 | $opt = '<option value="" selected></option>'; |
4820 | 4820 | $sql = "SELECT rowid, ref, situation_cycle_ref, situation_counter, situation_final, fk_soc"; |
4821 | - $sql .= ' FROM ' . $this->db->prefix() . 'facture'; |
|
4822 | - $sql .= ' WHERE entity IN (' . getEntity('invoice') . ')'; |
|
4821 | + $sql .= ' FROM '.$this->db->prefix().'facture'; |
|
4822 | + $sql .= ' WHERE entity IN ('.getEntity('invoice').')'; |
|
4823 | 4823 | $sql .= ' AND situation_counter >= 1'; |
4824 | - $sql .= ' AND fk_soc = ' . (int) $socid; |
|
4824 | + $sql .= ' AND fk_soc = '.(int) $socid; |
|
4825 | 4825 | $sql .= ' AND type <> 2'; |
4826 | 4826 | $sql .= ' ORDER by situation_cycle_ref, situation_counter desc'; |
4827 | 4827 | $resql = $this->db->query($sql); |
@@ -4839,19 +4839,19 @@ discard block |
||
4839 | 4839 | //Not prov? |
4840 | 4840 | if (substr($obj->ref, 1, 4) != 'PROV') { |
4841 | 4841 | if ($selected == $obj->rowid) { |
4842 | - $opt .= '<option value="' . $obj->rowid . '" selected>' . $obj->ref . '</option>'; |
|
4842 | + $opt .= '<option value="'.$obj->rowid.'" selected>'.$obj->ref.'</option>'; |
|
4843 | 4843 | } else { |
4844 | - $opt .= '<option value="' . $obj->rowid . '">' . $obj->ref . '</option>'; |
|
4844 | + $opt .= '<option value="'.$obj->rowid.'">'.$obj->ref.'</option>'; |
|
4845 | 4845 | } |
4846 | 4846 | } |
4847 | 4847 | } |
4848 | 4848 | } |
4849 | 4849 | } |
4850 | 4850 | } else { |
4851 | - dol_syslog("Error sql=" . $sql . ", error=" . $this->error, LOG_ERR); |
|
4851 | + dol_syslog("Error sql=".$sql.", error=".$this->error, LOG_ERR); |
|
4852 | 4852 | } |
4853 | 4853 | if ($opt == '<option value ="" selected></option>') { |
4854 | - $opt = '<option value ="0" selected>' . $langs->trans('NoSituations') . '</option>'; |
|
4854 | + $opt = '<option value ="0" selected>'.$langs->trans('NoSituations').'</option>'; |
|
4855 | 4855 | } |
4856 | 4856 | return $opt; |
4857 | 4857 | } |
@@ -4871,12 +4871,12 @@ discard block |
||
4871 | 4871 | |
4872 | 4872 | $langs->load('products'); |
4873 | 4873 | |
4874 | - $return = '<select class="flat" id="' . $htmlname . '" name="' . $htmlname . '">'; |
|
4874 | + $return = '<select class="flat" id="'.$htmlname.'" name="'.$htmlname.'">'; |
|
4875 | 4875 | |
4876 | - $sql = "SELECT rowid, label, code FROM " . $this->db->prefix() . "c_units"; |
|
4876 | + $sql = "SELECT rowid, label, code FROM ".$this->db->prefix()."c_units"; |
|
4877 | 4877 | $sql .= ' WHERE active > 0'; |
4878 | 4878 | if (!empty($unit_type)) { |
4879 | - $sql .= " AND unit_type = '" . $this->db->escape($unit_type) . "'"; |
|
4879 | + $sql .= " AND unit_type = '".$this->db->escape($unit_type)."'"; |
|
4880 | 4880 | } |
4881 | 4881 | $sql .= " ORDER BY sortorder"; |
4882 | 4882 | |
@@ -4888,14 +4888,14 @@ discard block |
||
4888 | 4888 | |
4889 | 4889 | while ($res = $this->db->fetch_object($resql)) { |
4890 | 4890 | $unitLabel = $res->label; |
4891 | - if (!empty($langs->tab_translate['unit' . $res->code])) { // check if Translation is available before |
|
4892 | - $unitLabel = $langs->trans('unit' . $res->code) != $res->label ? $langs->trans('unit' . $res->code) : $res->label; |
|
4891 | + if (!empty($langs->tab_translate['unit'.$res->code])) { // check if Translation is available before |
|
4892 | + $unitLabel = $langs->trans('unit'.$res->code) != $res->label ? $langs->trans('unit'.$res->code) : $res->label; |
|
4893 | 4893 | } |
4894 | 4894 | |
4895 | 4895 | if ($selected == $res->rowid) { |
4896 | - $return .= '<option value="' . $res->rowid . '" selected>' . $unitLabel . '</option>'; |
|
4896 | + $return .= '<option value="'.$res->rowid.'" selected>'.$unitLabel.'</option>'; |
|
4897 | 4897 | } else { |
4898 | - $return .= '<option value="' . $res->rowid . '">' . $unitLabel . '</option>'; |
|
4898 | + $return .= '<option value="'.$res->rowid.'">'.$unitLabel.'</option>'; |
|
4899 | 4899 | } |
4900 | 4900 | } |
4901 | 4901 | $return .= '</select>'; |
@@ -4930,23 +4930,23 @@ discard block |
||
4930 | 4930 | $num = 0; |
4931 | 4931 | |
4932 | 4932 | $sql = "SELECT rowid, label, bank, clos as status, currency_code"; |
4933 | - $sql .= " FROM " . $this->db->prefix() . "bank_account"; |
|
4934 | - $sql .= " WHERE entity IN (" . getEntity('bank_account') . ")"; |
|
4933 | + $sql .= " FROM ".$this->db->prefix()."bank_account"; |
|
4934 | + $sql .= " WHERE entity IN (".getEntity('bank_account').")"; |
|
4935 | 4935 | if ($status != 2) { |
4936 | - $sql .= " AND clos = " . (int) $status; |
|
4936 | + $sql .= " AND clos = ".(int) $status; |
|
4937 | 4937 | } |
4938 | 4938 | if ($filtre) { |
4939 | - $sql .= " AND " . $filtre; |
|
4939 | + $sql .= " AND ".$filtre; |
|
4940 | 4940 | } |
4941 | 4941 | $sql .= " ORDER BY label"; |
4942 | 4942 | |
4943 | - dol_syslog(get_class($this) . "::select_comptes", LOG_DEBUG); |
|
4943 | + dol_syslog(get_class($this)."::select_comptes", LOG_DEBUG); |
|
4944 | 4944 | $result = $this->db->query($sql); |
4945 | 4945 | if ($result) { |
4946 | 4946 | $num = $this->db->num_rows($result); |
4947 | 4947 | $i = 0; |
4948 | 4948 | if ($num) { |
4949 | - $out .= '<select id="select' . $htmlname . '" class="flat selectbankaccount' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '"' . ($moreattrib ? ' ' . $moreattrib : '') . '>'; |
|
4949 | + $out .= '<select id="select'.$htmlname.'" class="flat selectbankaccount'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'"'.($moreattrib ? ' '.$moreattrib : '').'>'; |
|
4950 | 4950 | if ($useempty == 1 || ($useempty == 2 && $num > 1)) { |
4951 | 4951 | $out .= '<option value="-1"> </option>'; |
4952 | 4952 | } |
@@ -4954,27 +4954,27 @@ discard block |
||
4954 | 4954 | while ($i < $num) { |
4955 | 4955 | $obj = $this->db->fetch_object($result); |
4956 | 4956 | if ($selected == $obj->rowid || ($useempty == 2 && $num == 1 && empty($selected))) { |
4957 | - $out .= '<option value="' . $obj->rowid . '" data-currency-code="' . $obj->currency_code . '" selected>'; |
|
4957 | + $out .= '<option value="'.$obj->rowid.'" data-currency-code="'.$obj->currency_code.'" selected>'; |
|
4958 | 4958 | } else { |
4959 | - $out .= '<option value="' . $obj->rowid . '" data-currency-code="' . $obj->currency_code . '">'; |
|
4959 | + $out .= '<option value="'.$obj->rowid.'" data-currency-code="'.$obj->currency_code.'">'; |
|
4960 | 4960 | } |
4961 | 4961 | $out .= trim($obj->label); |
4962 | 4962 | if ($showcurrency) { |
4963 | - $out .= ' (' . $obj->currency_code . ')'; |
|
4963 | + $out .= ' ('.$obj->currency_code.')'; |
|
4964 | 4964 | } |
4965 | 4965 | if ($status == 2 && $obj->status == 1) { |
4966 | - $out .= ' (' . $langs->trans("Closed") . ')'; |
|
4966 | + $out .= ' ('.$langs->trans("Closed").')'; |
|
4967 | 4967 | } |
4968 | 4968 | $out .= '</option>'; |
4969 | 4969 | $i++; |
4970 | 4970 | } |
4971 | 4971 | $out .= "</select>"; |
4972 | - $out .= ajax_combobox('select' . $htmlname); |
|
4972 | + $out .= ajax_combobox('select'.$htmlname); |
|
4973 | 4973 | } else { |
4974 | 4974 | if ($status == 0) { |
4975 | - $out .= '<span class="opacitymedium">' . $langs->trans("NoActiveBankAccountDefined") . '</span>'; |
|
4975 | + $out .= '<span class="opacitymedium">'.$langs->trans("NoActiveBankAccountDefined").'</span>'; |
|
4976 | 4976 | } else { |
4977 | - $out .= '<span class="opacitymedium">' . $langs->trans("NoBankAccountFound") . '</span>'; |
|
4977 | + $out .= '<span class="opacitymedium">'.$langs->trans("NoBankAccountFound").'</span>'; |
|
4978 | 4978 | } |
4979 | 4979 | } |
4980 | 4980 | } else { |
@@ -5010,23 +5010,23 @@ discard block |
||
5010 | 5010 | $num = 0; |
5011 | 5011 | |
5012 | 5012 | $sql = "SELECT rowid, name, fk_country, status, entity"; |
5013 | - $sql .= " FROM " . $this->db->prefix() . "establishment"; |
|
5013 | + $sql .= " FROM ".$this->db->prefix()."establishment"; |
|
5014 | 5014 | $sql .= " WHERE 1=1"; |
5015 | 5015 | if ($status != 2) { |
5016 | - $sql .= " AND status = " . (int) $status; |
|
5016 | + $sql .= " AND status = ".(int) $status; |
|
5017 | 5017 | } |
5018 | 5018 | if ($filtre) { |
5019 | - $sql .= " AND " . $filtre; |
|
5019 | + $sql .= " AND ".$filtre; |
|
5020 | 5020 | } |
5021 | 5021 | $sql .= " ORDER BY name"; |
5022 | 5022 | |
5023 | - dol_syslog(get_class($this) . "::select_establishment", LOG_DEBUG); |
|
5023 | + dol_syslog(get_class($this)."::select_establishment", LOG_DEBUG); |
|
5024 | 5024 | $result = $this->db->query($sql); |
5025 | 5025 | if ($result) { |
5026 | 5026 | $num = $this->db->num_rows($result); |
5027 | 5027 | $i = 0; |
5028 | 5028 | if ($num) { |
5029 | - print '<select id="select' . $htmlname . '" class="flat selectestablishment" name="' . $htmlname . '"' . ($moreattrib ? ' ' . $moreattrib : '') . '>'; |
|
5029 | + print '<select id="select'.$htmlname.'" class="flat selectestablishment" name="'.$htmlname.'"'.($moreattrib ? ' '.$moreattrib : '').'>'; |
|
5030 | 5030 | if ($useempty == 1 || ($useempty == 2 && $num > 1)) { |
5031 | 5031 | print '<option value="-1"> </option>'; |
5032 | 5032 | } |
@@ -5034,13 +5034,13 @@ discard block |
||
5034 | 5034 | while ($i < $num) { |
5035 | 5035 | $obj = $this->db->fetch_object($result); |
5036 | 5036 | if ($selected == $obj->rowid) { |
5037 | - print '<option value="' . $obj->rowid . '" selected>'; |
|
5037 | + print '<option value="'.$obj->rowid.'" selected>'; |
|
5038 | 5038 | } else { |
5039 | - print '<option value="' . $obj->rowid . '">'; |
|
5039 | + print '<option value="'.$obj->rowid.'">'; |
|
5040 | 5040 | } |
5041 | 5041 | print trim($obj->name); |
5042 | 5042 | if ($status == 2 && $obj->status == 1) { |
5043 | - print ' (' . $langs->trans("Closed") . ')'; |
|
5043 | + print ' ('.$langs->trans("Closed").')'; |
|
5044 | 5044 | } |
5045 | 5045 | print '</option>'; |
5046 | 5046 | $i++; |
@@ -5048,9 +5048,9 @@ discard block |
||
5048 | 5048 | print "</select>"; |
5049 | 5049 | } else { |
5050 | 5050 | if ($status == 0) { |
5051 | - print '<span class="opacitymedium">' . $langs->trans("NoActiveEstablishmentDefined") . '</span>'; |
|
5051 | + print '<span class="opacitymedium">'.$langs->trans("NoActiveEstablishmentDefined").'</span>'; |
|
5052 | 5052 | } else { |
5053 | - print '<span class="opacitymedium">' . $langs->trans("NoEstablishmentFound") . '</span>'; |
|
5053 | + print '<span class="opacitymedium">'.$langs->trans("NoEstablishmentFound").'</span>'; |
|
5054 | 5054 | } |
5055 | 5055 | } |
5056 | 5056 | |
@@ -5074,20 +5074,20 @@ discard block |
||
5074 | 5074 | { |
5075 | 5075 | global $langs; |
5076 | 5076 | if ($htmlname != "none") { |
5077 | - print '<form method="POST" action="' . $page . '">'; |
|
5077 | + print '<form method="POST" action="'.$page.'">'; |
|
5078 | 5078 | print '<input type="hidden" name="action" value="setbankaccount">'; |
5079 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
5079 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
5080 | 5080 | print img_picto('', 'bank_account', 'class="pictofixedwidth"'); |
5081 | 5081 | $nbaccountfound = $this->select_comptes($selected, $htmlname, 0, '', $addempty); |
5082 | 5082 | if ($nbaccountfound > 0) { |
5083 | - print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
5083 | + print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">'; |
|
5084 | 5084 | } |
5085 | 5085 | print '</form>'; |
5086 | 5086 | } else { |
5087 | 5087 | $langs->load('banks'); |
5088 | 5088 | |
5089 | 5089 | if ($selected) { |
5090 | - require_once DOL_DOCUMENT_ROOT . '/compta/bank/class/account.class.php'; |
|
5090 | + require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; |
|
5091 | 5091 | $bankstatic = new Account($this->db); |
5092 | 5092 | $result = $bankstatic->fetch($selected); |
5093 | 5093 | if ($result) { |
@@ -5125,19 +5125,19 @@ discard block |
||
5125 | 5125 | global $conf, $langs; |
5126 | 5126 | $langs->load("categories"); |
5127 | 5127 | |
5128 | - include_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; |
|
5128 | + include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; |
|
5129 | 5129 | |
5130 | 5130 | // For backward compatibility |
5131 | 5131 | if (is_numeric($type)) { |
5132 | - dol_syslog(__METHOD__ . ': using numeric value for parameter type is deprecated. Use string code instead.', LOG_WARNING); |
|
5132 | + dol_syslog(__METHOD__.': using numeric value for parameter type is deprecated. Use string code instead.', LOG_WARNING); |
|
5133 | 5133 | } |
5134 | 5134 | |
5135 | 5135 | if ($type === Categorie::TYPE_BANK_LINE) { |
5136 | 5136 | // TODO Move this into common category feature |
5137 | 5137 | $cate_arbo = array(); |
5138 | 5138 | $sql = "SELECT c.label, c.rowid"; |
5139 | - $sql .= " FROM " . $this->db->prefix() . "bank_categ as c"; |
|
5140 | - $sql .= " WHERE entity = " . $conf->entity; |
|
5139 | + $sql .= " FROM ".$this->db->prefix()."bank_categ as c"; |
|
5140 | + $sql .= " WHERE entity = ".$conf->entity; |
|
5141 | 5141 | $sql .= " ORDER BY c.label"; |
5142 | 5142 | $result = $this->db->query($sql); |
5143 | 5143 | if ($result) { |
@@ -5162,10 +5162,10 @@ discard block |
||
5162 | 5162 | $outarray = array(); |
5163 | 5163 | $outarrayrichhtml = array(); |
5164 | 5164 | |
5165 | - $output = '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">'; |
|
5165 | + $output = '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">'; |
|
5166 | 5166 | if (is_array($cate_arbo)) { |
5167 | 5167 | if (!count($cate_arbo)) { |
5168 | - $output .= '<option value="-1" disabled>' . $langs->trans("NoCategoriesDefined") . '</option>'; |
|
5168 | + $output .= '<option value="-1" disabled>'.$langs->trans("NoCategoriesDefined").'</option>'; |
|
5169 | 5169 | } else { |
5170 | 5170 | $output .= '<option value="-1"> </option>'; |
5171 | 5171 | foreach ($cate_arbo as $key => $value) { |
@@ -5175,15 +5175,15 @@ discard block |
||
5175 | 5175 | $add = ''; |
5176 | 5176 | } |
5177 | 5177 | |
5178 | - $labeltoshow = img_picto('', 'category', 'class="pictofixedwidth" style="color: #' . $cate_arbo[$key]['color'] . '"'); |
|
5178 | + $labeltoshow = img_picto('', 'category', 'class="pictofixedwidth" style="color: #'.$cate_arbo[$key]['color'].'"'); |
|
5179 | 5179 | $labeltoshow .= dol_trunc($cate_arbo[$key]['fulllabel'], $maxlength, 'middle'); |
5180 | 5180 | |
5181 | 5181 | $outarray[$cate_arbo[$key]['id']] = $cate_arbo[$key]['fulllabel']; |
5182 | 5182 | |
5183 | 5183 | $outarrayrichhtml[$cate_arbo[$key]['id']] = $labeltoshow; |
5184 | 5184 | |
5185 | - $output .= '<option ' . $add . 'value="' . $cate_arbo[$key]['id'] . '"'; |
|
5186 | - $output .= ' data-html="' . dol_escape_htmltag($labeltoshow) . '"'; |
|
5185 | + $output .= '<option '.$add.'value="'.$cate_arbo[$key]['id'].'"'; |
|
5186 | + $output .= ' data-html="'.dol_escape_htmltag($labeltoshow).'"'; |
|
5187 | 5187 | $output .= '>'; |
5188 | 5188 | $output .= dol_trunc($cate_arbo[$key]['fulllabel'], $maxlength, 'middle'); |
5189 | 5189 | $output .= '</option>'; |
@@ -5224,7 +5224,7 @@ discard block |
||
5224 | 5224 | public function form_confirm($page, $title, $question, $action, $formquestion = '', $selectedchoice = "", $useajax = 0, $height = 170, $width = 500) |
5225 | 5225 | { |
5226 | 5226 | // phpcs:enable |
5227 | - dol_syslog(__METHOD__ . ': using form_confirm is deprecated. Use formconfim instead.', LOG_WARNING); |
|
5227 | + dol_syslog(__METHOD__.': using form_confirm is deprecated. Use formconfim instead.', LOG_WARNING); |
|
5228 | 5228 | print $this->formconfirm($page, $title, $question, $action, $formquestion, $selectedchoice, $useajax, $height, $width); |
5229 | 5229 | } |
5230 | 5230 | |
@@ -5259,7 +5259,7 @@ discard block |
||
5259 | 5259 | { |
5260 | 5260 | global $langs, $conf; |
5261 | 5261 | |
5262 | - $more = '<!-- formconfirm - before call, page=' . dol_escape_htmltag($page) . ' -->'; |
|
5262 | + $more = '<!-- formconfirm - before call, page='.dol_escape_htmltag($page).' -->'; |
|
5263 | 5263 | $formconfirm = ''; |
5264 | 5264 | $inputok = array(); |
5265 | 5265 | $inputko = array(); |
@@ -5283,27 +5283,27 @@ discard block |
||
5283 | 5283 | foreach ($formquestion as $key => $input) { |
5284 | 5284 | if (is_array($input) && !empty($input)) { |
5285 | 5285 | if ($input['type'] == 'hidden') { |
5286 | - $moreattr = (!empty($input['moreattr']) ? ' ' . $input['moreattr'] : ''); |
|
5287 | - $morecss = (!empty($input['morecss']) ? ' ' . $input['morecss'] : ''); |
|
5286 | + $moreattr = (!empty($input['moreattr']) ? ' '.$input['moreattr'] : ''); |
|
5287 | + $morecss = (!empty($input['morecss']) ? ' '.$input['morecss'] : ''); |
|
5288 | 5288 | |
5289 | - $more .= '<input type="hidden" id="' . dol_escape_htmltag($input['name']) . '" name="' . dol_escape_htmltag($input['name']) . '" value="' . dol_escape_htmltag($input['value']) . '" class="' . $morecss . '"' . $moreattr . '>' . "\n"; |
|
5289 | + $more .= '<input type="hidden" id="'.dol_escape_htmltag($input['name']).'" name="'.dol_escape_htmltag($input['name']).'" value="'.dol_escape_htmltag($input['value']).'" class="'.$morecss.'"'.$moreattr.'>'."\n"; |
|
5290 | 5290 | } |
5291 | 5291 | } |
5292 | 5292 | } |
5293 | 5293 | |
5294 | 5294 | // Now add questions |
5295 | 5295 | $moreonecolumn = ''; |
5296 | - $more .= '<div class="tagtable paddingtopbottomonly centpercent noborderspacing">' . "\n"; |
|
5296 | + $more .= '<div class="tagtable paddingtopbottomonly centpercent noborderspacing">'."\n"; |
|
5297 | 5297 | foreach ($formquestion as $key => $input) { |
5298 | 5298 | if (is_array($input) && !empty($input)) { |
5299 | - $size = (!empty($input['size']) ? ' size="' . $input['size'] . '"' : ''); // deprecated. Use morecss instead. |
|
5300 | - $moreattr = (!empty($input['moreattr']) ? ' ' . $input['moreattr'] : ''); |
|
5301 | - $morecss = (!empty($input['morecss']) ? ' ' . $input['morecss'] : ''); |
|
5299 | + $size = (!empty($input['size']) ? ' size="'.$input['size'].'"' : ''); // deprecated. Use morecss instead. |
|
5300 | + $moreattr = (!empty($input['moreattr']) ? ' '.$input['moreattr'] : ''); |
|
5301 | + $morecss = (!empty($input['morecss']) ? ' '.$input['morecss'] : ''); |
|
5302 | 5302 | |
5303 | 5303 | if ($input['type'] == 'text') { |
5304 | - $more .= '<div class="tagtr"><div class="tagtd' . (empty($input['tdclass']) ? '' : (' ' . $input['tdclass'])) . '">' . $input['label'] . '</div><div class="tagtd"><input type="text" class="flat' . $morecss . '" id="' . dol_escape_htmltag($input['name']) . '" name="' . dol_escape_htmltag($input['name']) . '"' . $size . ' value="' . (empty($input['value']) ? '' : $input['value']) . '"' . $moreattr . ' /></div></div>' . "\n"; |
|
5304 | + $more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].'</div><div class="tagtd"><input type="text" class="flat'.$morecss.'" id="'.dol_escape_htmltag($input['name']).'" name="'.dol_escape_htmltag($input['name']).'"'.$size.' value="'.(empty($input['value']) ? '' : $input['value']).'"'.$moreattr.' /></div></div>'."\n"; |
|
5305 | 5305 | } elseif ($input['type'] == 'password') { |
5306 | - $more .= '<div class="tagtr"><div class="tagtd' . (empty($input['tdclass']) ? '' : (' ' . $input['tdclass'])) . '">' . $input['label'] . '</div><div class="tagtd"><input type="password" class="flat' . $morecss . '" id="' . dol_escape_htmltag($input['name']) . '" name="' . dol_escape_htmltag($input['name']) . '"' . $size . ' value="' . (empty($input['value']) ? '' : $input['value']) . '"' . $moreattr . ' /></div></div>' . "\n"; |
|
5306 | + $more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].'</div><div class="tagtd"><input type="password" class="flat'.$morecss.'" id="'.dol_escape_htmltag($input['name']).'" name="'.dol_escape_htmltag($input['name']).'"'.$size.' value="'.(empty($input['value']) ? '' : $input['value']).'"'.$moreattr.' /></div></div>'."\n"; |
|
5307 | 5307 | } elseif ($input['type'] == 'textarea') { |
5308 | 5308 | /*$more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].'</div><div class="tagtd">'; |
5309 | 5309 | $more .= '<textarea name="'.$input['name'].'" class="'.$morecss.'"'.$moreattr.'>'; |
@@ -5311,8 +5311,8 @@ discard block |
||
5311 | 5311 | $more .= '</textarea>'; |
5312 | 5312 | $more .= '</div></div>'."\n";*/ |
5313 | 5313 | $moreonecolumn .= '<div class="margintoponly">'; |
5314 | - $moreonecolumn .= $input['label'] . '<br>'; |
|
5315 | - $moreonecolumn .= '<textarea name="' . dol_escape_htmltag($input['name']) . '" id="' . dol_escape_htmltag($input['name']) . '" class="' . $morecss . '"' . $moreattr . '>'; |
|
5314 | + $moreonecolumn .= $input['label'].'<br>'; |
|
5315 | + $moreonecolumn .= '<textarea name="'.dol_escape_htmltag($input['name']).'" id="'.dol_escape_htmltag($input['name']).'" class="'.$morecss.'"'.$moreattr.'>'; |
|
5316 | 5316 | $moreonecolumn .= $input['value']; |
5317 | 5317 | $moreonecolumn .= '</textarea>'; |
5318 | 5318 | $moreonecolumn .= '</div>'; |
@@ -5329,20 +5329,20 @@ discard block |
||
5329 | 5329 | $disabled = isset($input['select_disabled']) ? $input['select_disabled'] : 0; |
5330 | 5330 | $sort = isset($input['select_sort']) ? $input['select_sort'] : ''; |
5331 | 5331 | |
5332 | - $more .= '<div class="tagtr"><div class="tagtd' . (empty($input['tdclass']) ? '' : (' ' . $input['tdclass'])) . '">'; |
|
5332 | + $more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'; |
|
5333 | 5333 | if (!empty($input['label'])) { |
5334 | - $more .= $input['label'] . '</div><div class="tagtd left">'; |
|
5334 | + $more .= $input['label'].'</div><div class="tagtd left">'; |
|
5335 | 5335 | } |
5336 | 5336 | if ($input['type'] == 'select') { |
5337 | 5337 | $more .= $this->selectarray($input['name'], $input['values'], isset($input['default']) ? $input['default'] : '-1', $show_empty, $key_in_label, $value_as_key, $moreattr, $translate, $maxlen, $disabled, $sort, $morecss); |
5338 | 5338 | } else { |
5339 | 5339 | $more .= $this->multiselectarray($input['name'], $input['values'], is_array($input['default']) ? $input['default'] : [$input['default']], $key_in_label, $value_as_key, $morecss, $translate, $maxlen, $moreattr); |
5340 | 5340 | } |
5341 | - $more .= '</div></div>' . "\n"; |
|
5341 | + $more .= '</div></div>'."\n"; |
|
5342 | 5342 | } elseif ($input['type'] == 'checkbox') { |
5343 | 5343 | $more .= '<div class="tagtr">'; |
5344 | - $more .= '<div class="tagtd' . (empty($input['tdclass']) ? '' : (' ' . $input['tdclass'])) . '"><label for="' . dol_escape_htmltag($input['name']) . '">' . $input['label'] . '</label></div><div class="tagtd">'; |
|
5345 | - $more .= '<input type="checkbox" class="flat' . ($morecss ? ' ' . $morecss : '') . '" id="' . dol_escape_htmltag($input['name']) . '" name="' . dol_escape_htmltag($input['name']) . '"' . $moreattr; |
|
5344 | + $more .= '<div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'"><label for="'.dol_escape_htmltag($input['name']).'">'.$input['label'].'</label></div><div class="tagtd">'; |
|
5345 | + $more .= '<input type="checkbox" class="flat'.($morecss ? ' '.$morecss : '').'" id="'.dol_escape_htmltag($input['name']).'" name="'.dol_escape_htmltag($input['name']).'"'.$moreattr; |
|
5346 | 5346 | if (!is_bool($input['value']) && $input['value'] != 'false' && $input['value'] != '0' && $input['value'] != '') { |
5347 | 5347 | $more .= ' checked'; |
5348 | 5348 | } |
@@ -5353,19 +5353,19 @@ discard block |
||
5353 | 5353 | $more .= ' disabled'; |
5354 | 5354 | } |
5355 | 5355 | $more .= ' /></div>'; |
5356 | - $more .= '</div>' . "\n"; |
|
5356 | + $more .= '</div>'."\n"; |
|
5357 | 5357 | } elseif ($input['type'] == 'radio') { |
5358 | 5358 | $i = 0; |
5359 | 5359 | foreach ($input['values'] as $selkey => $selval) { |
5360 | 5360 | $more .= '<div class="tagtr">'; |
5361 | 5361 | if (isset($input['label'])) { |
5362 | 5362 | if ($i == 0) { |
5363 | - $more .= '<div class="tagtd' . (empty($input['tdclass']) ? ' tdtop' : (' tdtop ' . $input['tdclass'])) . '">' . $input['label'] . '</div>'; |
|
5363 | + $more .= '<div class="tagtd'.(empty($input['tdclass']) ? ' tdtop' : (' tdtop '.$input['tdclass'])).'">'.$input['label'].'</div>'; |
|
5364 | 5364 | } else { |
5365 | - $more .= '<div clas="tagtd' . (empty($input['tdclass']) ? '' : (' "' . $input['tdclass'])) . '"> </div>'; |
|
5365 | + $more .= '<div clas="tagtd'.(empty($input['tdclass']) ? '' : (' "'.$input['tdclass'])).'"> </div>'; |
|
5366 | 5366 | } |
5367 | 5367 | } |
5368 | - $more .= '<div class="tagtd' . ($i == 0 ? ' tdtop' : '') . '"><input type="radio" class="flat' . $morecss . '" id="' . dol_escape_htmltag($input['name'] . $selkey) . '" name="' . dol_escape_htmltag($input['name']) . '" value="' . $selkey . '"' . $moreattr; |
|
5368 | + $more .= '<div class="tagtd'.($i == 0 ? ' tdtop' : '').'"><input type="radio" class="flat'.$morecss.'" id="'.dol_escape_htmltag($input['name'].$selkey).'" name="'.dol_escape_htmltag($input['name']).'" value="'.$selkey.'"'.$moreattr; |
|
5369 | 5369 | if (!empty($input['disabled'])) { |
5370 | 5370 | $more .= ' disabled'; |
5371 | 5371 | } |
@@ -5373,12 +5373,12 @@ discard block |
||
5373 | 5373 | $more .= ' checked="checked"'; |
5374 | 5374 | } |
5375 | 5375 | $more .= ' /> '; |
5376 | - $more .= '<label for="' . dol_escape_htmltag($input['name'] . $selkey) . '" class="valignmiddle">' . $selval . '</label>'; |
|
5377 | - $more .= '</div></div>' . "\n"; |
|
5376 | + $more .= '<label for="'.dol_escape_htmltag($input['name'].$selkey).'" class="valignmiddle">'.$selval.'</label>'; |
|
5377 | + $more .= '</div></div>'."\n"; |
|
5378 | 5378 | $i++; |
5379 | 5379 | } |
5380 | 5380 | } elseif ($input['type'] == 'date' || $input['type'] == 'datetime') { |
5381 | - $more .= '<div class="tagtr"><div class="tagtd' . (empty($input['tdclass']) ? '' : (' ' . $input['tdclass'])) . '">' . $input['label'] . '</div>'; |
|
5381 | + $more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].'</div>'; |
|
5382 | 5382 | $more .= '<div class="tagtd">'; |
5383 | 5383 | $addnowlink = (empty($input['datenow']) ? 0 : 1); |
5384 | 5384 | $h = $m = 0; |
@@ -5396,24 +5396,24 @@ discard block |
||
5396 | 5396 | } elseif ($input['type'] == 'other') { // can be 1 column or 2 depending if label is set or not |
5397 | 5397 | $more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'; |
5398 | 5398 | if (!empty($input['label'])) { |
5399 | - $more .= $input['label'] . '</div><div class="tagtd">'; |
|
5399 | + $more .= $input['label'].'</div><div class="tagtd">'; |
|
5400 | 5400 | } |
5401 | 5401 | $more .= $input['value']; |
5402 | - $more .= '</div></div>' . "\n"; |
|
5402 | + $more .= '</div></div>'."\n"; |
|
5403 | 5403 | } elseif ($input['type'] == 'onecolumn') { |
5404 | 5404 | $moreonecolumn .= '<div class="margintoponly">'; |
5405 | 5405 | $moreonecolumn .= $input['value']; |
5406 | - $moreonecolumn .= '</div>' . "\n"; |
|
5406 | + $moreonecolumn .= '</div>'."\n"; |
|
5407 | 5407 | } elseif ($input['type'] == 'hidden') { |
5408 | 5408 | // Do nothing more, already added by a previous loop |
5409 | 5409 | } elseif ($input['type'] == 'separator') { |
5410 | 5410 | $more .= '<br>'; |
5411 | 5411 | } else { |
5412 | - $more .= 'Error type ' . $input['type'] . ' for the confirm box is not a supported type'; |
|
5412 | + $more .= 'Error type '.$input['type'].' for the confirm box is not a supported type'; |
|
5413 | 5413 | } |
5414 | 5414 | } |
5415 | 5415 | } |
5416 | - $more .= '</div>' . "\n"; |
|
5416 | + $more .= '</div>'."\n"; |
|
5417 | 5417 | $more .= $moreonecolumn; |
5418 | 5418 | } |
5419 | 5419 | |
@@ -5435,10 +5435,10 @@ discard block |
||
5435 | 5435 | $button = $useajax; |
5436 | 5436 | $useajax = 1; |
5437 | 5437 | $autoOpen = false; |
5438 | - $dialogconfirm .= '-' . $button; |
|
5438 | + $dialogconfirm .= '-'.$button; |
|
5439 | 5439 | } |
5440 | - $pageyes = $page . (preg_match('/\?/', $page) ? '&' : '?') . 'action=' . urlencode($action) . '&confirm=yes'; |
|
5441 | - $pageno = ($useajax == 2 ? $page . (preg_match('/\?/', $page) ? '&' : '?') . 'action=' . urlencode($action) . '&confirm=no' : ''); |
|
5440 | + $pageyes = $page.(preg_match('/\?/', $page) ? '&' : '?').'action='.urlencode($action).'&confirm=yes'; |
|
5441 | + $pageno = ($useajax == 2 ? $page.(preg_match('/\?/', $page) ? '&' : '?').'action='.urlencode($action).'&confirm=no' : ''); |
|
5442 | 5442 | |
5443 | 5443 | // Add input fields into list of fields to read during submit (inputok and inputko) |
5444 | 5444 | if (is_array($formquestion)) { |
@@ -5460,24 +5460,24 @@ discard block |
||
5460 | 5460 | } |
5461 | 5461 | |
5462 | 5462 | // Show JQuery confirm box. |
5463 | - $formconfirm .= '<div id="' . $dialogconfirm . '" title="' . dol_escape_htmltag($title) . '" style="display: none;">'; |
|
5463 | + $formconfirm .= '<div id="'.$dialogconfirm.'" title="'.dol_escape_htmltag($title).'" style="display: none;">'; |
|
5464 | 5464 | if (is_array($formquestion) && !empty($formquestion['text'])) { |
5465 | - $formconfirm .= '<div class="confirmtext">' . $formquestion['text'] . '</div>' . "\n"; |
|
5465 | + $formconfirm .= '<div class="confirmtext">'.$formquestion['text'].'</div>'."\n"; |
|
5466 | 5466 | } |
5467 | 5467 | if (!empty($more)) { |
5468 | - $formconfirm .= '<div class="confirmquestions">' . $more . '</div>' . "\n"; |
|
5468 | + $formconfirm .= '<div class="confirmquestions">'.$more.'</div>'."\n"; |
|
5469 | 5469 | } |
5470 | - $formconfirm .= ($question ? '<div class="confirmmessage">' . img_help('', '') . ' ' . $question . '</div>' : ''); |
|
5471 | - $formconfirm .= '</div>' . "\n"; |
|
5470 | + $formconfirm .= ($question ? '<div class="confirmmessage">'.img_help('', '').' '.$question.'</div>' : ''); |
|
5471 | + $formconfirm .= '</div>'."\n"; |
|
5472 | 5472 | |
5473 | - $formconfirm .= "\n<!-- begin code of popup for formconfirm page=" . $page . " -->\n"; |
|
5474 | - $formconfirm .= '<script nonce="' . getNonce() . '" type="text/javascript">' . "\n"; |
|
5473 | + $formconfirm .= "\n<!-- begin code of popup for formconfirm page=".$page." -->\n"; |
|
5474 | + $formconfirm .= '<script nonce="'.getNonce().'" type="text/javascript">'."\n"; |
|
5475 | 5475 | $formconfirm .= "/* Code for the jQuery('#dialogforpopup').dialog() */\n"; |
5476 | 5476 | $formconfirm .= 'jQuery(document).ready(function() { |
5477 | 5477 | $(function() { |
5478 | - $( "#' . $dialogconfirm . '" ).dialog( |
|
5478 | + $( "#' . $dialogconfirm.'" ).dialog( |
|
5479 | 5479 | { |
5480 | - autoOpen: ' . ($autoOpen ? "true" : "false") . ','; |
|
5480 | + autoOpen: ' . ($autoOpen ? "true" : "false").','; |
|
5481 | 5481 | if ($newselectedchoice == 'no') { |
5482 | 5482 | $formconfirm .= ' |
5483 | 5483 | open: function() { |
@@ -5487,24 +5487,24 @@ discard block |
||
5487 | 5487 | |
5488 | 5488 | $jsforcursor = ''; |
5489 | 5489 | if ($useajax == 1) { |
5490 | - $jsforcursor = '// The call to urljump can be slow, so we set the wait cursor' . "\n"; |
|
5491 | - $jsforcursor .= 'jQuery("html,body,#id-container").addClass("cursorwait");' . "\n"; |
|
5490 | + $jsforcursor = '// The call to urljump can be slow, so we set the wait cursor'."\n"; |
|
5491 | + $jsforcursor .= 'jQuery("html,body,#id-container").addClass("cursorwait");'."\n"; |
|
5492 | 5492 | } |
5493 | 5493 | |
5494 | 5494 | $postconfirmas = 'GET'; |
5495 | 5495 | |
5496 | 5496 | $formconfirm .= ' |
5497 | 5497 | resizable: false, |
5498 | - height: "' . $height . '", |
|
5499 | - width: "' . $width . '", |
|
5498 | + height: "' . $height.'", |
|
5499 | + width: "' . $width.'", |
|
5500 | 5500 | modal: true, |
5501 | 5501 | closeOnEscape: false, |
5502 | 5502 | buttons: { |
5503 | - "' . dol_escape_js($langs->transnoentities($labelbuttonyes)) . '": function() { |
|
5504 | - var options = "token=' . urlencode(newToken()) . '"; |
|
5505 | - var inputok = ' . json_encode($inputok) . '; /* List of fields into form */ |
|
5506 | - var page = "' . dol_escape_js(!empty($page) ? $page : '') . '"; |
|
5507 | - var pageyes = "' . dol_escape_js(!empty($pageyes) ? $pageyes : '') . '"; |
|
5503 | + "' . dol_escape_js($langs->transnoentities($labelbuttonyes)).'": function() { |
|
5504 | + var options = "token=' . urlencode(newToken()).'"; |
|
5505 | + var inputok = ' . json_encode($inputok).'; /* List of fields into form */ |
|
5506 | + var page = "' . dol_escape_js(!empty($page) ? $page : '').'"; |
|
5507 | + var pageyes = "' . dol_escape_js(!empty($pageyes) ? $pageyes : '').'"; |
|
5508 | 5508 | |
5509 | 5509 | if (inputok.length > 0) { |
5510 | 5510 | $.each(inputok, function(i, inputname) { |
@@ -5538,11 +5538,11 @@ discard block |
||
5538 | 5538 | } |
5539 | 5539 | $(this).dialog("close"); |
5540 | 5540 | }, |
5541 | - "' . dol_escape_js($langs->transnoentities($labelbuttonno)) . '": function() { |
|
5542 | - var options = "token=' . urlencode(newToken()) . '"; |
|
5543 | - var inputko = ' . json_encode($inputko) . '; /* List of fields into form */ |
|
5544 | - var page = "' . dol_escape_js(!empty($page) ? $page : '') . '"; |
|
5545 | - var pageno="' . dol_escape_js(!empty($pageno) ? $pageno : '') . '"; |
|
5541 | + "' . dol_escape_js($langs->transnoentities($labelbuttonno)).'": function() { |
|
5542 | + var options = "token=' . urlencode(newToken()).'"; |
|
5543 | + var inputko = ' . json_encode($inputko).'; /* List of fields into form */ |
|
5544 | + var page = "' . dol_escape_js(!empty($page) ? $page : '').'"; |
|
5545 | + var pageno="' . dol_escape_js(!empty($pageno) ? $pageno : '').'"; |
|
5546 | 5546 | if (inputko.length > 0) { |
5547 | 5547 | $.each(inputko, function(i, inputname) { |
5548 | 5548 | var more = ""; |
@@ -5574,10 +5574,10 @@ discard block |
||
5574 | 5574 | } |
5575 | 5575 | ); |
5576 | 5576 | |
5577 | - var button = "' . $button . '"; |
|
5577 | + var button = "' . $button.'"; |
|
5578 | 5578 | if (button.length > 0) { |
5579 | 5579 | $( "#" + button ).click(function() { |
5580 | - $("#' . $dialogconfirm . '").dialog("open"); |
|
5580 | + $("#' . $dialogconfirm.'").dialog("open"); |
|
5581 | 5581 | }); |
5582 | 5582 | } |
5583 | 5583 | }); |
@@ -5585,44 +5585,44 @@ discard block |
||
5585 | 5585 | </script>'; |
5586 | 5586 | $formconfirm .= "<!-- end ajax formconfirm -->\n"; |
5587 | 5587 | } else { |
5588 | - $formconfirm .= "\n<!-- begin formconfirm page=" . dol_escape_htmltag($page) . " -->\n"; |
|
5588 | + $formconfirm .= "\n<!-- begin formconfirm page=".dol_escape_htmltag($page)." -->\n"; |
|
5589 | 5589 | |
5590 | 5590 | if (empty($disableformtag)) { |
5591 | - $formconfirm .= '<form method="POST" action="' . $page . '" class="notoptoleftroright">' . "\n"; |
|
5591 | + $formconfirm .= '<form method="POST" action="'.$page.'" class="notoptoleftroright">'."\n"; |
|
5592 | 5592 | } |
5593 | 5593 | |
5594 | - $formconfirm .= '<input type="hidden" name="action" value="' . $action . '">' . "\n"; |
|
5595 | - $formconfirm .= '<input type="hidden" name="token" value="' . newToken() . '">' . "\n"; |
|
5594 | + $formconfirm .= '<input type="hidden" name="action" value="'.$action.'">'."\n"; |
|
5595 | + $formconfirm .= '<input type="hidden" name="token" value="'.newToken().'">'."\n"; |
|
5596 | 5596 | |
5597 | - $formconfirm .= '<table class="valid centpercent">' . "\n"; |
|
5597 | + $formconfirm .= '<table class="valid centpercent">'."\n"; |
|
5598 | 5598 | |
5599 | 5599 | // Line title |
5600 | 5600 | $formconfirm .= '<tr class="validtitre"><td class="validtitre" colspan="2">'; |
5601 | - $formconfirm .= img_picto('', 'pictoconfirm') . ' ' . $title; |
|
5602 | - $formconfirm .= '</td></tr>' . "\n"; |
|
5601 | + $formconfirm .= img_picto('', 'pictoconfirm').' '.$title; |
|
5602 | + $formconfirm .= '</td></tr>'."\n"; |
|
5603 | 5603 | |
5604 | 5604 | // Line text |
5605 | 5605 | if (is_array($formquestion) && !empty($formquestion['text'])) { |
5606 | - $formconfirm .= '<tr class="valid"><td class="valid" colspan="2">' . $formquestion['text'] . '</td></tr>' . "\n"; |
|
5606 | + $formconfirm .= '<tr class="valid"><td class="valid" colspan="2">'.$formquestion['text'].'</td></tr>'."\n"; |
|
5607 | 5607 | } |
5608 | 5608 | |
5609 | 5609 | // Line form fields |
5610 | 5610 | if ($more) { |
5611 | - $formconfirm .= '<tr class="valid"><td class="valid" colspan="2">' . "\n"; |
|
5611 | + $formconfirm .= '<tr class="valid"><td class="valid" colspan="2">'."\n"; |
|
5612 | 5612 | $formconfirm .= $more; |
5613 | - $formconfirm .= '</td></tr>' . "\n"; |
|
5613 | + $formconfirm .= '</td></tr>'."\n"; |
|
5614 | 5614 | } |
5615 | 5615 | |
5616 | 5616 | // Line with question |
5617 | 5617 | $formconfirm .= '<tr class="valid">'; |
5618 | - $formconfirm .= '<td class="valid">' . $question . '</td>'; |
|
5618 | + $formconfirm .= '<td class="valid">'.$question.'</td>'; |
|
5619 | 5619 | $formconfirm .= '<td class="valid center">'; |
5620 | 5620 | $formconfirm .= $this->selectyesno("confirm", $newselectedchoice, 0, false, 0, 0, 'marginleftonly marginrightonly', $labelbuttonyes, $labelbuttonno); |
5621 | - $formconfirm .= '<input class="button valignmiddle confirmvalidatebutton small" type="submit" value="' . $langs->trans("Validate") . '">'; |
|
5621 | + $formconfirm .= '<input class="button valignmiddle confirmvalidatebutton small" type="submit" value="'.$langs->trans("Validate").'">'; |
|
5622 | 5622 | $formconfirm .= '</td>'; |
5623 | - $formconfirm .= '</tr>' . "\n"; |
|
5623 | + $formconfirm .= '</tr>'."\n"; |
|
5624 | 5624 | |
5625 | - $formconfirm .= '</table>' . "\n"; |
|
5625 | + $formconfirm .= '</table>'."\n"; |
|
5626 | 5626 | |
5627 | 5627 | if (empty($disableformtag)) { |
5628 | 5628 | $formconfirm .= "</form>\n"; |
@@ -5631,7 +5631,7 @@ discard block |
||
5631 | 5631 | |
5632 | 5632 | if (!empty($conf->use_javascript_ajax)) { |
5633 | 5633 | $formconfirm .= '<!-- code to disable button to avoid double clic -->'; |
5634 | - $formconfirm .= '<script nonce="' . getNonce() . '" type="text/javascript">' . "\n"; |
|
5634 | + $formconfirm .= '<script nonce="'.getNonce().'" type="text/javascript">'."\n"; |
|
5635 | 5635 | $formconfirm .= ' |
5636 | 5636 | $(document).ready(function () { |
5637 | 5637 | $(".confirmvalidatebutton").on("click", function() { |
@@ -5643,7 +5643,7 @@ discard block |
||
5643 | 5643 | }); |
5644 | 5644 | }); |
5645 | 5645 | '; |
5646 | - $formconfirm .= '</script>' . "\n"; |
|
5646 | + $formconfirm .= '</script>'."\n"; |
|
5647 | 5647 | } |
5648 | 5648 | |
5649 | 5649 | $formconfirm .= "<!-- end formconfirm -->\n"; |
@@ -5675,8 +5675,8 @@ discard block |
||
5675 | 5675 | // phpcs:enable |
5676 | 5676 | global $langs; |
5677 | 5677 | |
5678 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/project.lib.php'; |
|
5679 | - require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php'; |
|
5678 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; |
|
5679 | + require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; |
|
5680 | 5680 | |
5681 | 5681 | $out = ''; |
5682 | 5682 | |
@@ -5684,11 +5684,11 @@ discard block |
||
5684 | 5684 | |
5685 | 5685 | $langs->load("project"); |
5686 | 5686 | if ($htmlname != "none") { |
5687 | - $out .= '<form method="post" action="' . $page . '">'; |
|
5687 | + $out .= '<form method="post" action="'.$page.'">'; |
|
5688 | 5688 | $out .= '<input type="hidden" name="action" value="classin">'; |
5689 | - $out .= '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
5689 | + $out .= '<input type="hidden" name="token" value="'.newToken().'">'; |
|
5690 | 5690 | $out .= $formproject->select_projects($socid, $selected, $htmlname, $maxlength, 0, 1, $discard_closed, $forcefocus, 0, 0, '', 1, 0, $morecss); |
5691 | - $out .= '<input type="submit" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '">'; |
|
5691 | + $out .= '<input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'">'; |
|
5692 | 5692 | $out .= '</form>'; |
5693 | 5693 | } else { |
5694 | 5694 | $out .= '<span class="project_head_block">'; |
@@ -5697,7 +5697,7 @@ discard block |
||
5697 | 5697 | $projet->fetch($selected); |
5698 | 5698 | $out .= $projet->getNomUrl(0, '', 1); |
5699 | 5699 | } else { |
5700 | - $out .= '<span class="opacitymedium">' . $textifnoproject . '</span>'; |
|
5700 | + $out .= '<span class="opacitymedium">'.$textifnoproject.'</span>'; |
|
5701 | 5701 | } |
5702 | 5702 | $out .= '</span>'; |
5703 | 5703 | } |
@@ -5734,14 +5734,14 @@ discard block |
||
5734 | 5734 | $out = ''; |
5735 | 5735 | |
5736 | 5736 | if ($htmlname != "none") { |
5737 | - $out .= '<form method="POST" action="' . $page . '">'; |
|
5737 | + $out .= '<form method="POST" action="'.$page.'">'; |
|
5738 | 5738 | $out .= '<input type="hidden" name="action" value="setconditions">'; |
5739 | - $out .= '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
5739 | + $out .= '<input type="hidden" name="token" value="'.newToken().'">'; |
|
5740 | 5740 | if ($type) { |
5741 | - $out .= '<input type="hidden" name="type" value="' . dol_escape_htmltag($type) . '">'; |
|
5741 | + $out .= '<input type="hidden" name="type" value="'.dol_escape_htmltag($type).'">'; |
|
5742 | 5742 | } |
5743 | 5743 | $out .= $this->getSelectConditionsPaiements($selected, $htmlname, $filtertype, $addempty, 0, '', $deposit_percent); |
5744 | - $out .= '<input type="submit" class="button valignmiddle smallpaddingimp" value="' . $langs->trans("Modify") . '">'; |
|
5744 | + $out .= '<input type="submit" class="button valignmiddle smallpaddingimp" value="'.$langs->trans("Modify").'">'; |
|
5745 | 5745 | $out .= '</form>'; |
5746 | 5746 | } else { |
5747 | 5747 | if ($selected) { |
@@ -5786,12 +5786,12 @@ discard block |
||
5786 | 5786 | // phpcs:enable |
5787 | 5787 | global $langs; |
5788 | 5788 | if ($htmlname != "none") { |
5789 | - print '<form method="post" action="' . $page . '">'; |
|
5789 | + print '<form method="post" action="'.$page.'">'; |
|
5790 | 5790 | print '<input type="hidden" name="action" value="setavailability">'; |
5791 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
5791 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
5792 | 5792 | $this->selectAvailabilityDelay($selected, $htmlname, -1, $addempty); |
5793 | - print '<input type="submit" name="modify" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '">'; |
|
5794 | - print '<input type="submit" name="cancel" class="button smallpaddingimp" value="' . $langs->trans("Cancel") . '">'; |
|
5793 | + print '<input type="submit" name="modify" class="button smallpaddingimp" value="'.$langs->trans("Modify").'">'; |
|
5794 | + print '<input type="submit" name="cancel" class="button smallpaddingimp" value="'.$langs->trans("Cancel").'">'; |
|
5795 | 5795 | print '</form>'; |
5796 | 5796 | } else { |
5797 | 5797 | if ($selected) { |
@@ -5817,11 +5817,11 @@ discard block |
||
5817 | 5817 | { |
5818 | 5818 | global $langs; |
5819 | 5819 | if ($htmlname != "none") { |
5820 | - print '<form method="post" action="' . $page . '">'; |
|
5820 | + print '<form method="post" action="'.$page.'">'; |
|
5821 | 5821 | print '<input type="hidden" name="action" value="setdemandreason">'; |
5822 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
5822 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
5823 | 5823 | $this->selectInputReason($selected, $htmlname, -1, $addempty); |
5824 | - print '<input type="submit" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '">'; |
|
5824 | + print '<input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'">'; |
|
5825 | 5825 | print '</form>'; |
5826 | 5826 | } else { |
5827 | 5827 | if ($selected) { |
@@ -5861,17 +5861,17 @@ discard block |
||
5861 | 5861 | $ret = ''; |
5862 | 5862 | |
5863 | 5863 | if ($htmlname != "none") { |
5864 | - $ret .= '<form method="POST" action="' . $page . '" name="form' . $htmlname . '">'; |
|
5865 | - $ret .= '<input type="hidden" name="action" value="set' . $htmlname . '">'; |
|
5866 | - $ret .= '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
5864 | + $ret .= '<form method="POST" action="'.$page.'" name="form'.$htmlname.'">'; |
|
5865 | + $ret .= '<input type="hidden" name="action" value="set'.$htmlname.'">'; |
|
5866 | + $ret .= '<input type="hidden" name="token" value="'.newToken().'">'; |
|
5867 | 5867 | if ($type) { |
5868 | - $ret .= '<input type="hidden" name="type" value="' . dol_escape_htmltag($type) . '">'; |
|
5868 | + $ret .= '<input type="hidden" name="type" value="'.dol_escape_htmltag($type).'">'; |
|
5869 | 5869 | } |
5870 | 5870 | $ret .= '<table class="nobordernopadding">'; |
5871 | 5871 | $ret .= '<tr><td>'; |
5872 | - $ret .= $this->selectDate($selected, $htmlname, $displayhour, $displaymin, 1, 'form' . $htmlname, 1, 0); |
|
5872 | + $ret .= $this->selectDate($selected, $htmlname, $displayhour, $displaymin, 1, 'form'.$htmlname, 1, 0); |
|
5873 | 5873 | $ret .= '</td>'; |
5874 | - $ret .= '<td class="left"><input type="submit" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '"></td>'; |
|
5874 | + $ret .= '<td class="left"><input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'"></td>'; |
|
5875 | 5875 | $ret .= '</tr></table></form>'; |
5876 | 5876 | } else { |
5877 | 5877 | if ($displayhour) { |
@@ -5906,15 +5906,15 @@ discard block |
||
5906 | 5906 | global $langs; |
5907 | 5907 | |
5908 | 5908 | if ($htmlname != "none") { |
5909 | - print '<form method="POST" action="' . $page . '" name="form' . $htmlname . '">'; |
|
5910 | - print '<input type="hidden" name="action" value="set' . $htmlname . '">'; |
|
5911 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
5909 | + print '<form method="POST" action="'.$page.'" name="form'.$htmlname.'">'; |
|
5910 | + print '<input type="hidden" name="action" value="set'.$htmlname.'">'; |
|
5911 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
5912 | 5912 | print $this->select_dolusers($selected, $htmlname, 1, $exclude, 0, $include); |
5913 | - print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
5913 | + print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">'; |
|
5914 | 5914 | print '</form>'; |
5915 | 5915 | } else { |
5916 | 5916 | if ($selected) { |
5917 | - require_once DOL_DOCUMENT_ROOT . '/user/class/user.class.php'; |
|
5917 | + require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; |
|
5918 | 5918 | $theuser = new User($this->db); |
5919 | 5919 | $theuser->fetch($selected); |
5920 | 5920 | print $theuser->getNomUrl(1); |
@@ -5947,14 +5947,14 @@ discard block |
||
5947 | 5947 | |
5948 | 5948 | $out = ''; |
5949 | 5949 | if ($htmlname != "none") { |
5950 | - $out .= '<form method="POST" action="' . $page . '">'; |
|
5950 | + $out .= '<form method="POST" action="'.$page.'">'; |
|
5951 | 5951 | $out .= '<input type="hidden" name="action" value="setmode">'; |
5952 | - $out .= '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
5952 | + $out .= '<input type="hidden" name="token" value="'.newToken().'">'; |
|
5953 | 5953 | if ($type) { |
5954 | - $out .= '<input type="hidden" name="type" value="' . dol_escape_htmltag($type) . '">'; |
|
5954 | + $out .= '<input type="hidden" name="type" value="'.dol_escape_htmltag($type).'">'; |
|
5955 | 5955 | } |
5956 | 5956 | $out .= $this->select_types_paiements($selected, $htmlname, $filtertype, 0, $addempty, 0, 0, $active, '', 1); |
5957 | - $out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
5957 | + $out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">'; |
|
5958 | 5958 | $out .= '</form>'; |
5959 | 5959 | } else { |
5960 | 5960 | if ($selected) { |
@@ -5987,11 +5987,11 @@ discard block |
||
5987 | 5987 | { |
5988 | 5988 | global $langs; |
5989 | 5989 | if ($htmlname != "none") { |
5990 | - print '<form method="POST" action="' . $page . '">'; |
|
5990 | + print '<form method="POST" action="'.$page.'">'; |
|
5991 | 5991 | print '<input type="hidden" name="action" value="settransportmode">'; |
5992 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
5992 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
5993 | 5993 | $this->selectTransportMode($selected, $htmlname, 0, $addempty, 0, 0, $active); |
5994 | - print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
5994 | + print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">'; |
|
5995 | 5995 | print '</form>'; |
5996 | 5996 | } else { |
5997 | 5997 | if ($selected) { |
@@ -6018,11 +6018,11 @@ discard block |
||
6018 | 6018 | // phpcs:enable |
6019 | 6019 | global $langs; |
6020 | 6020 | if ($htmlname != "none") { |
6021 | - print '<form method="POST" action="' . $page . '">'; |
|
6021 | + print '<form method="POST" action="'.$page.'">'; |
|
6022 | 6022 | print '<input type="hidden" name="action" value="setmulticurrencycode">'; |
6023 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
6023 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
6024 | 6024 | print $this->selectMultiCurrency($selected, $htmlname, 0); |
6025 | - print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
6025 | + print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">'; |
|
6026 | 6026 | print '</form>'; |
6027 | 6027 | } else { |
6028 | 6028 | dol_include_once('/core/lib/company.lib.php'); |
@@ -6047,21 +6047,21 @@ discard block |
||
6047 | 6047 | global $langs, $mysoc, $conf; |
6048 | 6048 | |
6049 | 6049 | if ($htmlname != "none") { |
6050 | - print '<form method="POST" action="' . $page . '">'; |
|
6050 | + print '<form method="POST" action="'.$page.'">'; |
|
6051 | 6051 | print '<input type="hidden" name="action" value="setmulticurrencyrate">'; |
6052 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
6053 | - print '<input type="text" class="maxwidth100" name="' . $htmlname . '" value="' . (!empty($rate) ? price(price2num($rate, 'CU')) : 1) . '" /> '; |
|
6052 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
6053 | + print '<input type="text" class="maxwidth100" name="'.$htmlname.'" value="'.(!empty($rate) ? price(price2num($rate, 'CU')) : 1).'" /> '; |
|
6054 | 6054 | print '<select name="calculation_mode">'; |
6055 | - print '<option value="1">Change ' . $langs->trans("PriceUHT") . ' of lines</option>'; |
|
6056 | - print '<option value="2">Change ' . $langs->trans("PriceUHTCurrency") . ' of lines</option>'; |
|
6055 | + print '<option value="1">Change '.$langs->trans("PriceUHT").' of lines</option>'; |
|
6056 | + print '<option value="2">Change '.$langs->trans("PriceUHTCurrency").' of lines</option>'; |
|
6057 | 6057 | print '</select> '; |
6058 | - print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
6058 | + print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">'; |
|
6059 | 6059 | print '</form>'; |
6060 | 6060 | } else { |
6061 | 6061 | if (!empty($rate)) { |
6062 | 6062 | print price($rate, 1, $langs, 1, 0); |
6063 | 6063 | if ($currency && $rate != 1) { |
6064 | - print ' (' . price($rate, 1, $langs, 1, 0) . ' ' . $currency . ' = 1 ' . $conf->currency . ')'; |
|
6064 | + print ' ('.price($rate, 1, $langs, 1, 0).' '.$currency.' = 1 '.$conf->currency.')'; |
|
6065 | 6065 | } |
6066 | 6066 | } else { |
6067 | 6067 | print 1; |
@@ -6092,9 +6092,9 @@ discard block |
||
6092 | 6092 | // phpcs:enable |
6093 | 6093 | global $conf, $langs; |
6094 | 6094 | if ($htmlname != "none") { |
6095 | - print '<form method="post" action="' . $page . '">'; |
|
6095 | + print '<form method="post" action="'.$page.'">'; |
|
6096 | 6096 | print '<input type="hidden" name="action" value="setabsolutediscount">'; |
6097 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
6097 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
6098 | 6098 | print '<div class="inline-block">'; |
6099 | 6099 | if (!empty($discount_type)) { |
6100 | 6100 | if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { |
@@ -6132,24 +6132,24 @@ discard block |
||
6132 | 6132 | print '</div>'; |
6133 | 6133 | if (empty($hidelist)) { |
6134 | 6134 | print '<div class="inline-block" style="padding-right: 10px">'; |
6135 | - $newfilter = 'discount_type=' . intval($discount_type); |
|
6135 | + $newfilter = 'discount_type='.intval($discount_type); |
|
6136 | 6136 | if (!empty($discount_type)) { |
6137 | 6137 | $newfilter .= ' AND fk_invoice_supplier IS NULL AND fk_invoice_supplier_line IS NULL'; // Supplier discounts available |
6138 | 6138 | } else { |
6139 | 6139 | $newfilter .= ' AND fk_facture IS NULL AND fk_facture_line IS NULL'; // Customer discounts available |
6140 | 6140 | } |
6141 | 6141 | if ($filter) { |
6142 | - $newfilter .= ' AND (' . $filter . ')'; |
|
6142 | + $newfilter .= ' AND ('.$filter.')'; |
|
6143 | 6143 | } |
6144 | 6144 | // output the combo of discounts |
6145 | 6145 | $nbqualifiedlines = $this->select_remises($selected, $htmlname, $newfilter, $socid, $maxvalue); |
6146 | 6146 | if ($nbqualifiedlines > 0) { |
6147 | - print ' <input type="submit" class="button smallpaddingimp" value="' . dol_escape_htmltag($langs->trans("UseLine")) . '"'; |
|
6147 | + print ' <input type="submit" class="button smallpaddingimp" value="'.dol_escape_htmltag($langs->trans("UseLine")).'"'; |
|
6148 | 6148 | if (!empty($discount_type) && $filter && $filter != "fk_invoice_supplier_source IS NULL OR (description LIKE '(DEPOSIT)%' AND description NOT LIKE '(EXCESS PAID)%')") { |
6149 | - print ' title="' . $langs->trans("UseCreditNoteInInvoicePayment") . '"'; |
|
6149 | + print ' title="'.$langs->trans("UseCreditNoteInInvoicePayment").'"'; |
|
6150 | 6150 | } |
6151 | 6151 | if (empty($discount_type) && $filter && $filter != "fk_facture_source IS NULL OR (description LIKE '(DEPOSIT)%' AND description NOT LIKE '(EXCESS RECEIVED)%')") { |
6152 | - print ' title="' . $langs->trans("UseCreditNoteInInvoicePayment") . '"'; |
|
6152 | + print ' title="'.$langs->trans("UseCreditNoteInInvoicePayment").'"'; |
|
6153 | 6153 | } |
6154 | 6154 | |
6155 | 6155 | print '>'; |
@@ -6189,23 +6189,23 @@ discard block |
||
6189 | 6189 | global $langs, $conf; |
6190 | 6190 | |
6191 | 6191 | if ($htmlname != "none") { |
6192 | - print '<form method="post" action="' . $page . '">'; |
|
6192 | + print '<form method="post" action="'.$page.'">'; |
|
6193 | 6193 | print '<input type="hidden" name="action" value="set_contact">'; |
6194 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
6194 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
6195 | 6195 | print '<table class="nobordernopadding">'; |
6196 | 6196 | print '<tr><td>'; |
6197 | 6197 | print $this->selectcontacts($societe->id, $selected, $htmlname); |
6198 | 6198 | $num = $this->num; |
6199 | 6199 | if ($num == 0) { |
6200 | 6200 | $addcontact = (!empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("AddContact") : $langs->trans("AddContactAddress")); |
6201 | - print '<a href="' . DOL_URL_ROOT . '/contact/card.php?socid=' . $societe->id . '&action=create&backtoreferer=1">' . $addcontact . '</a>'; |
|
6201 | + print '<a href="'.DOL_URL_ROOT.'/contact/card.php?socid='.$societe->id.'&action=create&backtoreferer=1">'.$addcontact.'</a>'; |
|
6202 | 6202 | } |
6203 | 6203 | print '</td>'; |
6204 | - print '<td class="left"><input type="submit" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '"></td>'; |
|
6204 | + print '<td class="left"><input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'"></td>'; |
|
6205 | 6205 | print '</tr></table></form>'; |
6206 | 6206 | } else { |
6207 | 6207 | if ($selected) { |
6208 | - require_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php'; |
|
6208 | + require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; |
|
6209 | 6209 | $contact = new Contact($this->db); |
6210 | 6210 | $contact->fetch($selected); |
6211 | 6211 | print $contact->getFullName($langs); |
@@ -6240,20 +6240,20 @@ discard block |
||
6240 | 6240 | |
6241 | 6241 | $out = ''; |
6242 | 6242 | if ($htmlname != "none") { |
6243 | - $out .= '<form method="post" action="' . $page . '">'; |
|
6243 | + $out .= '<form method="post" action="'.$page.'">'; |
|
6244 | 6244 | $out .= '<input type="hidden" name="action" value="set_thirdparty">'; |
6245 | - $out .= '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
6245 | + $out .= '<input type="hidden" name="token" value="'.newToken().'">'; |
|
6246 | 6246 | $out .= $this->select_company($selected, $htmlname, $filter, $showempty, $showtype, $forcecombo, $events, 0, 'minwidth100', '', '', 1, array(), false, $excludeids); |
6247 | - $out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
6247 | + $out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">'; |
|
6248 | 6248 | $out .= '</form>'; |
6249 | 6249 | } else { |
6250 | 6250 | if ($selected) { |
6251 | - require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php'; |
|
6251 | + require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; |
|
6252 | 6252 | $soc = new Societe($this->db); |
6253 | 6253 | $soc->fetch($selected); |
6254 | 6254 | $out .= $soc->getNomUrl(0, ''); |
6255 | 6255 | } else { |
6256 | - $out .= '<span class="opacitymedium">' . $textifnothirdparty . '</span>'; |
|
6256 | + $out .= '<span class="opacitymedium">'.$textifnothirdparty.'</span>'; |
|
6257 | 6257 | } |
6258 | 6258 | } |
6259 | 6259 | |
@@ -6303,22 +6303,22 @@ discard block |
||
6303 | 6303 | $selected = 'EUR'; // Pour compatibilite |
6304 | 6304 | } |
6305 | 6305 | |
6306 | - $out .= '<select class="flat maxwidth200onsmartphone minwidth300" name="' . $htmlname . '" id="' . $htmlname . '">'; |
|
6306 | + $out .= '<select class="flat maxwidth200onsmartphone minwidth300" name="'.$htmlname.'" id="'.$htmlname.'">'; |
|
6307 | 6307 | if ($useempty) { |
6308 | 6308 | $out .= '<option value="-1" selected></option>'; |
6309 | 6309 | } |
6310 | 6310 | foreach ($langs->cache_currencies as $code_iso => $currency) { |
6311 | 6311 | $labeltoshow = $currency['label']; |
6312 | 6312 | if ($mode == 1) { |
6313 | - $labeltoshow .= ' <span class="opacitymedium">(' . $code_iso . ')</span>'; |
|
6313 | + $labeltoshow .= ' <span class="opacitymedium">('.$code_iso.')</span>'; |
|
6314 | 6314 | } else { |
6315 | - $labeltoshow .= ' <span class="opacitymedium">(' . $langs->getCurrencySymbol($code_iso) . ')</span>'; |
|
6315 | + $labeltoshow .= ' <span class="opacitymedium">('.$langs->getCurrencySymbol($code_iso).')</span>'; |
|
6316 | 6316 | } |
6317 | 6317 | |
6318 | 6318 | if ($selected && $selected == $code_iso) { |
6319 | - $out .= '<option value="' . $code_iso . '" selected data-html="' . dol_escape_htmltag($labeltoshow) . '">'; |
|
6319 | + $out .= '<option value="'.$code_iso.'" selected data-html="'.dol_escape_htmltag($labeltoshow).'">'; |
|
6320 | 6320 | } else { |
6321 | - $out .= '<option value="' . $code_iso . '" data-html="' . dol_escape_htmltag($labeltoshow) . '">'; |
|
6321 | + $out .= '<option value="'.$code_iso.'" data-html="'.dol_escape_htmltag($labeltoshow).'">'; |
|
6322 | 6322 | } |
6323 | 6323 | $out .= $labeltoshow; |
6324 | 6324 | $out .= '</option>'; |
@@ -6329,7 +6329,7 @@ discard block |
||
6329 | 6329 | } |
6330 | 6330 | |
6331 | 6331 | // Make select dynamic |
6332 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
6332 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
6333 | 6333 | $out .= ajax_combobox($htmlname); |
6334 | 6334 | |
6335 | 6335 | return $out; |
@@ -6355,10 +6355,10 @@ discard block |
||
6355 | 6355 | |
6356 | 6356 | $TCurrency = array(); |
6357 | 6357 | |
6358 | - $sql = "SELECT code FROM " . $this->db->prefix() . "multicurrency"; |
|
6359 | - $sql .= " WHERE entity IN ('" . getEntity('mutlicurrency') . "')"; |
|
6358 | + $sql = "SELECT code FROM ".$this->db->prefix()."multicurrency"; |
|
6359 | + $sql .= " WHERE entity IN ('".getEntity('mutlicurrency')."')"; |
|
6360 | 6360 | if ($filter) { |
6361 | - $sql .= " AND " . $filter; |
|
6361 | + $sql .= " AND ".$filter; |
|
6362 | 6362 | } |
6363 | 6363 | $resql = $this->db->query($sql); |
6364 | 6364 | if ($resql) { |
@@ -6368,7 +6368,7 @@ discard block |
||
6368 | 6368 | } |
6369 | 6369 | |
6370 | 6370 | $out = ''; |
6371 | - $out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">'; |
|
6371 | + $out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">'; |
|
6372 | 6372 | if ($useempty) { |
6373 | 6373 | $out .= '<option value=""> </option>'; |
6374 | 6374 | } |
@@ -6380,13 +6380,13 @@ discard block |
||
6380 | 6380 | foreach ($langs->cache_currencies as $code_iso => $currency) { |
6381 | 6381 | if (isset($TCurrency[$code_iso])) { |
6382 | 6382 | if (!empty($selected) && $selected == $code_iso) { |
6383 | - $out .= '<option value="' . $code_iso . '" selected="selected">'; |
|
6383 | + $out .= '<option value="'.$code_iso.'" selected="selected">'; |
|
6384 | 6384 | } else { |
6385 | - $out .= '<option value="' . $code_iso . '">'; |
|
6385 | + $out .= '<option value="'.$code_iso.'">'; |
|
6386 | 6386 | } |
6387 | 6387 | |
6388 | 6388 | $out .= $currency['label']; |
6389 | - $out .= ' (' . $langs->getCurrencySymbol($code_iso) . ')'; |
|
6389 | + $out .= ' ('.$langs->getCurrencySymbol($code_iso).')'; |
|
6390 | 6390 | $out .= '</option>'; |
6391 | 6391 | } |
6392 | 6392 | } |
@@ -6395,7 +6395,7 @@ discard block |
||
6395 | 6395 | $out .= '</select>'; |
6396 | 6396 | |
6397 | 6397 | // Make select dynamic |
6398 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
6398 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
6399 | 6399 | $out .= ajax_combobox($htmlname); |
6400 | 6400 | |
6401 | 6401 | return $out; |
@@ -6422,11 +6422,11 @@ discard block |
||
6422 | 6422 | dol_syslog(__METHOD__, LOG_DEBUG); |
6423 | 6423 | |
6424 | 6424 | $sql = "SELECT DISTINCT t.rowid, t.code, t.taux, t.localtax1, t.localtax1_type, t.localtax2, t.localtax2_type, t.recuperableonly"; |
6425 | - $sql .= " FROM " . $this->db->prefix() . "c_tva as t, " . $this->db->prefix() . "c_country as c"; |
|
6425 | + $sql .= " FROM ".$this->db->prefix()."c_tva as t, ".$this->db->prefix()."c_country as c"; |
|
6426 | 6426 | $sql .= " WHERE t.fk_pays = c.rowid"; |
6427 | 6427 | $sql .= " AND t.active > 0"; |
6428 | 6428 | $sql .= " AND t.entity IN (".getEntity('c_tva').")"; |
6429 | - $sql .= " AND c.code IN (" . $this->db->sanitize($country_code, 1) . ")"; |
|
6429 | + $sql .= " AND c.code IN (".$this->db->sanitize($country_code, 1).")"; |
|
6430 | 6430 | $sql .= " ORDER BY t.code ASC, t.taux ASC, t.recuperableonly ASC"; |
6431 | 6431 | |
6432 | 6432 | $resql = $this->db->query($sql); |
@@ -6444,22 +6444,22 @@ discard block |
||
6444 | 6444 | $this->cache_vatrates[$i]['localtax2'] = $obj->localtax2; |
6445 | 6445 | $this->cache_vatrates[$i]['localtax2_type'] = $obj->localtax1_type; |
6446 | 6446 | |
6447 | - $this->cache_vatrates[$i]['label'] = $obj->taux . '%' . ($obj->code ? ' (' . $obj->code . ')' : ''); // Label must contains only 0-9 , . % or * |
|
6448 | - $this->cache_vatrates[$i]['labelallrates'] = $obj->taux . '/' . ($obj->localtax1 ? $obj->localtax1 : '0') . '/' . ($obj->localtax2 ? $obj->localtax2 : '0') . ($obj->code ? ' (' . $obj->code . ')' : ''); // Must never be used as key, only label |
|
6447 | + $this->cache_vatrates[$i]['label'] = $obj->taux.'%'.($obj->code ? ' ('.$obj->code.')' : ''); // Label must contains only 0-9 , . % or * |
|
6448 | + $this->cache_vatrates[$i]['labelallrates'] = $obj->taux.'/'.($obj->localtax1 ? $obj->localtax1 : '0').'/'.($obj->localtax2 ? $obj->localtax2 : '0').($obj->code ? ' ('.$obj->code.')' : ''); // Must never be used as key, only label |
|
6449 | 6449 | $positiverates = ''; |
6450 | 6450 | if ($obj->taux) { |
6451 | - $positiverates .= ($positiverates ? '/' : '') . $obj->taux; |
|
6451 | + $positiverates .= ($positiverates ? '/' : '').$obj->taux; |
|
6452 | 6452 | } |
6453 | 6453 | if ($obj->localtax1) { |
6454 | - $positiverates .= ($positiverates ? '/' : '') . $obj->localtax1; |
|
6454 | + $positiverates .= ($positiverates ? '/' : '').$obj->localtax1; |
|
6455 | 6455 | } |
6456 | 6456 | if ($obj->localtax2) { |
6457 | - $positiverates .= ($positiverates ? '/' : '') . $obj->localtax2; |
|
6457 | + $positiverates .= ($positiverates ? '/' : '').$obj->localtax2; |
|
6458 | 6458 | } |
6459 | 6459 | if (empty($positiverates)) { |
6460 | 6460 | $positiverates = '0'; |
6461 | 6461 | } |
6462 | - $this->cache_vatrates[$i]['labelpositiverates'] = $positiverates . ($obj->code ? ' (' . $obj->code . ')' : ''); // Must never be used as key, only label |
|
6462 | + $this->cache_vatrates[$i]['labelpositiverates'] = $positiverates.($obj->code ? ' ('.$obj->code.')' : ''); // Must never be used as key, only label |
|
6463 | 6463 | } |
6464 | 6464 | |
6465 | 6465 | return $num; |
@@ -6477,7 +6477,7 @@ discard block |
||
6477 | 6477 | return -1; |
6478 | 6478 | } |
6479 | 6479 | } else { |
6480 | - $this->error = '<span class="error">' . $this->db->error() . '</span>'; |
|
6480 | + $this->error = '<span class="error">'.$this->db->error().'</span>'; |
|
6481 | 6481 | return -2; |
6482 | 6482 | } |
6483 | 6483 | } |
@@ -6529,9 +6529,9 @@ discard block |
||
6529 | 6529 | // Check parameters |
6530 | 6530 | if (is_object($societe_vendeuse) && !$societe_vendeuse->country_code) { |
6531 | 6531 | if ($societe_vendeuse->id == $mysoc->id) { |
6532 | - $return .= '<span class="error">' . $langs->trans("ErrorYourCountryIsNotDefined") . '</span>'; |
|
6532 | + $return .= '<span class="error">'.$langs->trans("ErrorYourCountryIsNotDefined").'</span>'; |
|
6533 | 6533 | } else { |
6534 | - $return .= '<span class="error">' . $langs->trans("ErrorSupplierCountryIsNotDefined") . '</span>'; |
|
6534 | + $return .= '<span class="error">'.$langs->trans("ErrorSupplierCountryIsNotDefined").'</span>'; |
|
6535 | 6535 | } |
6536 | 6536 | return $return; |
6537 | 6537 | } |
@@ -6543,25 +6543,25 @@ discard block |
||
6543 | 6543 | // Define list of countries to use to search VAT rates to show |
6544 | 6544 | // First we defined code_country to use to find list |
6545 | 6545 | if (is_object($societe_vendeuse)) { |
6546 | - $code_country = "'" . $societe_vendeuse->country_code . "'"; |
|
6546 | + $code_country = "'".$societe_vendeuse->country_code."'"; |
|
6547 | 6547 | } else { |
6548 | - $code_country = "'" . $mysoc->country_code . "'"; // Pour compatibilite ascendente |
|
6548 | + $code_country = "'".$mysoc->country_code."'"; // Pour compatibilite ascendente |
|
6549 | 6549 | } |
6550 | 6550 | if (!empty($conf->global->SERVICE_ARE_ECOMMERCE_200238EC)) { // If option to have vat for end customer for services is on |
6551 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php'; |
|
6551 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; |
|
6552 | 6552 | if (!isInEEC($societe_vendeuse) && (!is_object($societe_acheteuse) || (isInEEC($societe_acheteuse) && !$societe_acheteuse->isACompany()))) { |
6553 | 6553 | // We also add the buyer country code |
6554 | 6554 | if (is_numeric($type)) { |
6555 | 6555 | if ($type == 1) { // We know product is a service |
6556 | - $code_country .= ",'" . $societe_acheteuse->country_code . "'"; |
|
6556 | + $code_country .= ",'".$societe_acheteuse->country_code."'"; |
|
6557 | 6557 | } |
6558 | 6558 | } elseif (!$idprod) { // We don't know type of product |
6559 | - $code_country .= ",'" . $societe_acheteuse->country_code . "'"; |
|
6559 | + $code_country .= ",'".$societe_acheteuse->country_code."'"; |
|
6560 | 6560 | } else { |
6561 | 6561 | $prodstatic = new Product($this->db); |
6562 | 6562 | $prodstatic->fetch($idprod); |
6563 | 6563 | if ($prodstatic->type == Product::TYPE_SERVICE) { // We know product is a service |
6564 | - $code_country .= ",'" . $societe_acheteuse->country_code . "'"; |
|
6564 | + $code_country .= ",'".$societe_acheteuse->country_code."'"; |
|
6565 | 6565 | } |
6566 | 6566 | } |
6567 | 6567 | } |
@@ -6613,13 +6613,13 @@ discard block |
||
6613 | 6613 | // Override/enable VAT for expense report regardless of global setting - needed if expense report used for business expenses instead |
6614 | 6614 | // of using supplier invoices (this is a very bad idea !) |
6615 | 6615 | if (empty($conf->global->EXPENSEREPORT_OVERRIDE_VAT)) { |
6616 | - $title = ' title="' . dol_escape_htmltag($langs->trans('VATIsNotUsed')) . '"'; |
|
6616 | + $title = ' title="'.dol_escape_htmltag($langs->trans('VATIsNotUsed')).'"'; |
|
6617 | 6617 | $disabled = true; |
6618 | 6618 | } |
6619 | 6619 | } |
6620 | 6620 | |
6621 | 6621 | if (!$options_only) { |
6622 | - $return .= '<select class="flat minwidth50imp maxwidth100" id="' . $htmlname . '" name="' . $htmlname . '"' . ($disabled ? ' disabled' : '') . $title . '>'; |
|
6622 | + $return .= '<select class="flat minwidth50imp maxwidth100" id="'.$htmlname.'" name="'.$htmlname.'"'.($disabled ? ' disabled' : '').$title.'>'; |
|
6623 | 6623 | } |
6624 | 6624 | |
6625 | 6625 | $selectedfound = false; |
@@ -6633,13 +6633,13 @@ discard block |
||
6633 | 6633 | $key = $rate['txtva']; |
6634 | 6634 | $key .= $rate['nprtva'] ? '*' : ''; |
6635 | 6635 | if ($mode > 0 && $rate['code']) { |
6636 | - $key .= ' (' . $rate['code'] . ')'; |
|
6636 | + $key .= ' ('.$rate['code'].')'; |
|
6637 | 6637 | } |
6638 | 6638 | if ($mode < 0) { |
6639 | 6639 | $key = $rate['rowid']; |
6640 | 6640 | } |
6641 | 6641 | |
6642 | - $return .= '<option value="' . $key . '"'; |
|
6642 | + $return .= '<option value="'.$key.'"'; |
|
6643 | 6643 | if (!$selectedfound) { |
6644 | 6644 | if ($defaultcode) { // If defaultcode is defined, we used it in priority to select combo option instead of using rate+npr flag |
6645 | 6645 | if ($defaultcode == $rate['code']) { |
@@ -6710,7 +6710,7 @@ discard block |
||
6710 | 6710 | public function select_date($set_time = '', $prefix = 're', $h = 0, $m = 0, $empty = 0, $form_name = "", $d = 1, $addnowlink = 0, $nooutput = 0, $disabled = 0, $fullday = '', $addplusone = '', $adddateof = '') |
6711 | 6711 | { |
6712 | 6712 | // phpcs:enable |
6713 | - dol_syslog(__METHOD__ . ': using select_date is deprecated. Use selectDate instead.', LOG_WARNING); |
|
6713 | + dol_syslog(__METHOD__.': using select_date is deprecated. Use selectDate instead.', LOG_WARNING); |
|
6714 | 6714 | $retstring = $this->selectDate($set_time, $prefix, $h, $m, $empty, $form_name, $d, $addnowlink, $disabled, $fullday, $addplusone, $adddateof); |
6715 | 6715 | if (!empty($nooutput)) { |
6716 | 6716 | return $retstring; |
@@ -6739,11 +6739,11 @@ discard block |
||
6739 | 6739 | { |
6740 | 6740 | global $langs; |
6741 | 6741 | |
6742 | - $ret = $this->selectDate($set_time, $prefix . '_start', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("from"), 'tzuserrel'); |
|
6742 | + $ret = $this->selectDate($set_time, $prefix.'_start', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("from"), 'tzuserrel'); |
|
6743 | 6743 | if ($forcenewline) { |
6744 | 6744 | $ret .= '<br>'; |
6745 | 6745 | } |
6746 | - $ret .= $this->selectDate($set_time_end, $prefix . '_end', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"), 'tzuserrel'); |
|
6746 | + $ret .= $this->selectDate($set_time_end, $prefix.'_end', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"), 'tzuserrel'); |
|
6747 | 6747 | return $ret; |
6748 | 6748 | } |
6749 | 6749 | |
@@ -6809,7 +6809,7 @@ discard block |
||
6809 | 6809 | $orig_set_time = $set_time; |
6810 | 6810 | |
6811 | 6811 | if ($set_time === '' && $emptydate == 0) { |
6812 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; |
|
6812 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; |
|
6813 | 6813 | if ($gm == 'tzuser' || $gm == 'tzuserrel') { |
6814 | 6814 | $set_time = dol_now($gm); |
6815 | 6815 | } else { |
@@ -6877,38 +6877,38 @@ discard block |
||
6877 | 6877 | // Calendrier popup version eldy |
6878 | 6878 | if ($usecalendar == "eldy") { |
6879 | 6879 | // Input area to enter date manually |
6880 | - $retstring .= '<input id="' . $prefix . '" name="' . $prefix . '" type="text" class="maxwidthdate" maxlength="11" value="' . $formated_date . '"'; |
|
6880 | + $retstring .= '<input id="'.$prefix.'" name="'.$prefix.'" type="text" class="maxwidthdate" maxlength="11" value="'.$formated_date.'"'; |
|
6881 | 6881 | $retstring .= ($disabled ? ' disabled' : ''); |
6882 | - $retstring .= ' onChange="dpChangeDay(\'' . $prefix . '\',\'' . $langs->trans("FormatDateShortJavaInput") . '\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript |
|
6882 | + $retstring .= ' onChange="dpChangeDay(\''.$prefix.'\',\''.$langs->trans("FormatDateShortJavaInput").'\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript |
|
6883 | 6883 | $retstring .= '>'; |
6884 | 6884 | |
6885 | 6885 | // Icon calendar |
6886 | 6886 | $retstringbuttom = ''; |
6887 | 6887 | if (!$disabled) { |
6888 | - $retstringbuttom = '<button id="' . $prefix . 'Button" type="button" class="dpInvisibleButtons"'; |
|
6889 | - $base = DOL_URL_ROOT . '/core/'; |
|
6890 | - $retstringbuttom .= ' onClick="showDP(\'' . $base . '\',\'' . $prefix . '\',\'' . $langs->trans("FormatDateShortJavaInput") . '\',\'' . $langs->defaultlang . '\');"'; |
|
6891 | - $retstringbuttom .= '>' . img_object($langs->trans("SelectDate"), 'calendarday', 'class="datecallink"') . '</button>'; |
|
6888 | + $retstringbuttom = '<button id="'.$prefix.'Button" type="button" class="dpInvisibleButtons"'; |
|
6889 | + $base = DOL_URL_ROOT.'/core/'; |
|
6890 | + $retstringbuttom .= ' onClick="showDP(\''.$base.'\',\''.$prefix.'\',\''.$langs->trans("FormatDateShortJavaInput").'\',\''.$langs->defaultlang.'\');"'; |
|
6891 | + $retstringbuttom .= '>'.img_object($langs->trans("SelectDate"), 'calendarday', 'class="datecallink"').'</button>'; |
|
6892 | 6892 | } else { |
6893 | - $retstringbuttom = '<button id="' . $prefix . 'Button" type="button" class="dpInvisibleButtons">' . img_object($langs->trans("Disabled"), 'calendarday', 'class="datecallink"') . '</button>'; |
|
6893 | + $retstringbuttom = '<button id="'.$prefix.'Button" type="button" class="dpInvisibleButtons">'.img_object($langs->trans("Disabled"), 'calendarday', 'class="datecallink"').'</button>'; |
|
6894 | 6894 | } |
6895 | - $retstring = $retstringbuttom . $retstring; |
|
6895 | + $retstring = $retstringbuttom.$retstring; |
|
6896 | 6896 | |
6897 | - $retstring .= '<input type="hidden" id="' . $prefix . 'day" name="' . $prefix . 'day" value="' . $sday . '">' . "\n"; |
|
6898 | - $retstring .= '<input type="hidden" id="' . $prefix . 'month" name="' . $prefix . 'month" value="' . $smonth . '">' . "\n"; |
|
6899 | - $retstring .= '<input type="hidden" id="' . $prefix . 'year" name="' . $prefix . 'year" value="' . $syear . '">' . "\n"; |
|
6897 | + $retstring .= '<input type="hidden" id="'.$prefix.'day" name="'.$prefix.'day" value="'.$sday.'">'."\n"; |
|
6898 | + $retstring .= '<input type="hidden" id="'.$prefix.'month" name="'.$prefix.'month" value="'.$smonth.'">'."\n"; |
|
6899 | + $retstring .= '<input type="hidden" id="'.$prefix.'year" name="'.$prefix.'year" value="'.$syear.'">'."\n"; |
|
6900 | 6900 | } elseif ($usecalendar == 'jquery') { |
6901 | 6901 | if (!$disabled) { |
6902 | 6902 | // Output javascript for datepicker |
6903 | 6903 | $minYear = getDolGlobalInt('MIN_YEAR_SELECT_DATE', (date('Y') - 100)); |
6904 | 6904 | $maxYear = getDolGlobalInt('MAX_YEAR_SELECT_DATE', (date('Y') + 100)); |
6905 | 6905 | |
6906 | - $retstring .= '<script nonce="' . getNonce() . '" type="text/javascript">'; |
|
6907 | - $retstring .= "$(function(){ $('#" . $prefix . "').datepicker({ |
|
6908 | - dateFormat: '" . $langs->trans("FormatDateShortJQueryInput") . "', |
|
6906 | + $retstring .= '<script nonce="'.getNonce().'" type="text/javascript">'; |
|
6907 | + $retstring .= "$(function(){ $('#".$prefix."').datepicker({ |
|
6908 | + dateFormat: '" . $langs->trans("FormatDateShortJQueryInput")."', |
|
6909 | 6909 | autoclose: true, |
6910 | 6910 | todayHighlight: true, |
6911 | - yearRange: '" . $minYear . ":" . $maxYear . "',"; |
|
6911 | + yearRange: '" . $minYear.":".$maxYear."',"; |
|
6912 | 6912 | if (!empty($conf->dol_use_jmobile)) { |
6913 | 6913 | $retstring .= " |
6914 | 6914 | beforeShow: function (input, datePicker) { |
@@ -6923,7 +6923,7 @@ discard block |
||
6923 | 6923 | if (empty($conf->global->MAIN_POPUP_CALENDAR_ON_FOCUS)) { |
6924 | 6924 | $retstring .= " |
6925 | 6925 | showOn: 'button', /* both has problem with autocompletion */ |
6926 | - buttonImage: '" . DOL_URL_ROOT . "/theme/" . dol_escape_js($conf->theme) . "/img/object_calendarday.png', |
|
6926 | + buttonImage: '" . DOL_URL_ROOT."/theme/".dol_escape_js($conf->theme)."/img/object_calendarday.png', |
|
6927 | 6927 | buttonImageOnly: true"; |
6928 | 6928 | } |
6929 | 6929 | $retstring .= " |
@@ -6935,8 +6935,8 @@ discard block |
||
6935 | 6935 | $retstring .= '<div class="nowraponall inline-block divfordateinput">'; |
6936 | 6936 | $retstring .= '<input id="'.$prefix.'" name="'.$prefix.'" type="text" class="maxwidthdate" maxlength="11" value="'.$formated_date.'"'; |
6937 | 6937 | $retstring .= ($disabled ? ' disabled' : ''); |
6938 | - $retstring .= ($placeholder ? ' placeholder="' . dol_escape_htmltag($placeholder) . '"' : ''); |
|
6939 | - $retstring .= ' onChange="dpChangeDay(\'' . dol_escape_js($prefix) . '\',\'' . dol_escape_js($langs->trans("FormatDateShortJavaInput")) . '\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript |
|
6938 | + $retstring .= ($placeholder ? ' placeholder="'.dol_escape_htmltag($placeholder).'"' : ''); |
|
6939 | + $retstring .= ' onChange="dpChangeDay(\''.dol_escape_js($prefix).'\',\''.dol_escape_js($langs->trans("FormatDateShortJavaInput")).'\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript |
|
6940 | 6940 | $retstring .= '>'; |
6941 | 6941 | |
6942 | 6942 | // Icone calendrier |
@@ -6951,40 +6951,40 @@ discard block |
||
6951 | 6951 | $retstring.='});'; |
6952 | 6952 | $retstring.="</script>";*/ |
6953 | 6953 | } else { |
6954 | - $retstringbutton = '<button id="' . $prefix . 'Button" type="button" class="dpInvisibleButtons">' . img_object($langs->trans("Disabled"), 'calendarday', 'class="datecallink"') . '</button>'; |
|
6955 | - $retsring = $retstringbutton . $retstring; |
|
6954 | + $retstringbutton = '<button id="'.$prefix.'Button" type="button" class="dpInvisibleButtons">'.img_object($langs->trans("Disabled"), 'calendarday', 'class="datecallink"').'</button>'; |
|
6955 | + $retsring = $retstringbutton.$retstring; |
|
6956 | 6956 | } |
6957 | 6957 | |
6958 | 6958 | $retstring .= '</div>'; |
6959 | - $retstring .= '<input type="hidden" id="' . $prefix . 'day" name="' . $prefix . 'day" value="' . $sday . '">' . "\n"; |
|
6960 | - $retstring .= '<input type="hidden" id="' . $prefix . 'month" name="' . $prefix . 'month" value="' . $smonth . '">' . "\n"; |
|
6961 | - $retstring .= '<input type="hidden" id="' . $prefix . 'year" name="' . $prefix . 'year" value="' . $syear . '">' . "\n"; |
|
6959 | + $retstring .= '<input type="hidden" id="'.$prefix.'day" name="'.$prefix.'day" value="'.$sday.'">'."\n"; |
|
6960 | + $retstring .= '<input type="hidden" id="'.$prefix.'month" name="'.$prefix.'month" value="'.$smonth.'">'."\n"; |
|
6961 | + $retstring .= '<input type="hidden" id="'.$prefix.'year" name="'.$prefix.'year" value="'.$syear.'">'."\n"; |
|
6962 | 6962 | } else { |
6963 | 6963 | $retstring .= "Bad value of MAIN_POPUP_CALENDAR"; |
6964 | 6964 | } |
6965 | 6965 | } else { |
6966 | 6966 | // Show date with combo selects |
6967 | 6967 | // Day |
6968 | - $retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth50imp" id="' . $prefix . 'day" name="' . $prefix . 'day">'; |
|
6968 | + $retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth50imp" id="'.$prefix.'day" name="'.$prefix.'day">'; |
|
6969 | 6969 | |
6970 | 6970 | if ($emptydate || $set_time == -1) { |
6971 | 6971 | $retstring .= '<option value="0" selected> </option>'; |
6972 | 6972 | } |
6973 | 6973 | |
6974 | 6974 | for ($day = 1; $day <= 31; $day++) { |
6975 | - $retstring .= '<option value="' . $day . '"' . ($day == $sday ? ' selected' : '') . '>' . $day . '</option>'; |
|
6975 | + $retstring .= '<option value="'.$day.'"'.($day == $sday ? ' selected' : '').'>'.$day.'</option>'; |
|
6976 | 6976 | } |
6977 | 6977 | |
6978 | 6978 | $retstring .= "</select>"; |
6979 | 6979 | |
6980 | - $retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth75imp" id="' . $prefix . 'month" name="' . $prefix . 'month">'; |
|
6980 | + $retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth75imp" id="'.$prefix.'month" name="'.$prefix.'month">'; |
|
6981 | 6981 | if ($emptydate || $set_time == -1) { |
6982 | 6982 | $retstring .= '<option value="0" selected> </option>'; |
6983 | 6983 | } |
6984 | 6984 | |
6985 | 6985 | // Month |
6986 | 6986 | for ($month = 1; $month <= 12; $month++) { |
6987 | - $retstring .= '<option value="' . $month . '"' . ($month == $smonth ? ' selected' : '') . '>'; |
|
6987 | + $retstring .= '<option value="'.$month.'"'.($month == $smonth ? ' selected' : '').'>'; |
|
6988 | 6988 | $retstring .= dol_print_date(mktime(12, 0, 0, $month, 1, 2000), "%b"); |
6989 | 6989 | $retstring .= "</option>"; |
6990 | 6990 | } |
@@ -6992,12 +6992,12 @@ discard block |
||
6992 | 6992 | |
6993 | 6993 | // Year |
6994 | 6994 | if ($emptydate || $set_time == -1) { |
6995 | - $retstring .= '<input' . ($disabled ? ' disabled' : '') . ' placeholder="' . dol_escape_htmltag($langs->trans("Year")) . '" class="flat maxwidth50imp valignmiddle" type="number" min="0" max="3000" maxlength="4" id="' . $prefix . 'year" name="' . $prefix . 'year" value="' . $syear . '">'; |
|
6995 | + $retstring .= '<input'.($disabled ? ' disabled' : '').' placeholder="'.dol_escape_htmltag($langs->trans("Year")).'" class="flat maxwidth50imp valignmiddle" type="number" min="0" max="3000" maxlength="4" id="'.$prefix.'year" name="'.$prefix.'year" value="'.$syear.'">'; |
|
6996 | 6996 | } else { |
6997 | - $retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth75imp" id="' . $prefix . 'year" name="' . $prefix . 'year">'; |
|
6997 | + $retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth75imp" id="'.$prefix.'year" name="'.$prefix.'year">'; |
|
6998 | 6998 | |
6999 | 6999 | for ($year = $syear - 10; $year < $syear + 10; $year++) { |
7000 | - $retstring .= '<option value="' . $year . '"' . ($year == $syear ? ' selected' : '') . '>' . $year . '</option>'; |
|
7000 | + $retstring .= '<option value="'.$year.'"'.($year == $syear ? ' selected' : '').'>'.$year.'</option>'; |
|
7001 | 7001 | } |
7002 | 7002 | $retstring .= "</select>\n"; |
7003 | 7003 | } |
@@ -7021,15 +7021,15 @@ discard block |
||
7021 | 7021 | } |
7022 | 7022 | } |
7023 | 7023 | // Show hour |
7024 | - $retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth50 ' . ($fullday ? $fullday . 'hour' : '') . '" id="' . $prefix . 'hour" name="' . $prefix . 'hour">'; |
|
7024 | + $retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth50 '.($fullday ? $fullday.'hour' : '').'" id="'.$prefix.'hour" name="'.$prefix.'hour">'; |
|
7025 | 7025 | if ($emptyhours) { |
7026 | 7026 | $retstring .= '<option value="-1"> </option>'; |
7027 | 7027 | } |
7028 | 7028 | for ($hour = $hourstart; $hour < $hourend; $hour++) { |
7029 | 7029 | if (strlen($hour) < 2) { |
7030 | - $hour = "0" . $hour; |
|
7030 | + $hour = "0".$hour; |
|
7031 | 7031 | } |
7032 | - $retstring .= '<option value="' . $hour . '"' . (($hour == $shour) ? ' selected' : '') . '>' . $hour; |
|
7032 | + $retstring .= '<option value="'.$hour.'"'.(($hour == $shour) ? ' selected' : '').'>'.$hour; |
|
7033 | 7033 | //$retstring .= (empty($conf->dol_optimize_smallscreen) ? '' : 'H'); |
7034 | 7034 | $retstring .= '</option>'; |
7035 | 7035 | } |
@@ -7042,19 +7042,19 @@ discard block |
||
7042 | 7042 | |
7043 | 7043 | if ($m) { |
7044 | 7044 | // Show minutes |
7045 | - $retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth50 ' . ($fullday ? $fullday . 'min' : '') . '" id="' . $prefix . 'min" name="' . $prefix . 'min">'; |
|
7045 | + $retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth50 '.($fullday ? $fullday.'min' : '').'" id="'.$prefix.'min" name="'.$prefix.'min">'; |
|
7046 | 7046 | if ($emptyhours) { |
7047 | 7047 | $retstring .= '<option value="-1"> </option>'; |
7048 | 7048 | } |
7049 | 7049 | for ($min = 0; $min < 60; $min += $stepminutes) { |
7050 | 7050 | if (strlen($min) < 2) { |
7051 | - $min = "0" . $min; |
|
7051 | + $min = "0".$min; |
|
7052 | 7052 | } |
7053 | - $retstring .= '<option value="' . $min . '"' . (($min == $smin) ? ' selected' : '') . '>' . $min . (empty($conf->dol_optimize_smallscreen) ? '' : '') . '</option>'; |
|
7053 | + $retstring .= '<option value="'.$min.'"'.(($min == $smin) ? ' selected' : '').'>'.$min.(empty($conf->dol_optimize_smallscreen) ? '' : '').'</option>'; |
|
7054 | 7054 | } |
7055 | 7055 | $retstring .= '</select>'; |
7056 | 7056 | |
7057 | - $retstring .= '<input type="hidden" name="' . $prefix . 'sec" value="' . $ssec . '">'; |
|
7057 | + $retstring .= '<input type="hidden" name="'.$prefix.'sec" value="'.$ssec.'">'; |
|
7058 | 7058 | } |
7059 | 7059 | |
7060 | 7060 | if ($d && $h) { |
@@ -7077,10 +7077,10 @@ discard block |
||
7077 | 7077 | |
7078 | 7078 | // Generate the date part, depending on the use or not of the javascript calendar |
7079 | 7079 | if ($addnowlink == 1) { // server time expressed in user time setup |
7080 | - $reset_scripts .= 'jQuery(\'#' . $prefix . '\').val(\'' . dol_print_date($nowgmt, 'day', 'tzuserrel') . '\');'; |
|
7081 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'day\').val(\'' . dol_print_date($nowgmt, '%d', 'tzuserrel') . '\');'; |
|
7082 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'month\').val(\'' . dol_print_date($nowgmt, '%m', 'tzuserrel') . '\');'; |
|
7083 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'year\').val(\'' . dol_print_date($nowgmt, '%Y', 'tzuserrel') . '\');'; |
|
7080 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'\').val(\''.dol_print_date($nowgmt, 'day', 'tzuserrel').'\');'; |
|
7081 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'day\').val(\''.dol_print_date($nowgmt, '%d', 'tzuserrel').'\');'; |
|
7082 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(\''.dol_print_date($nowgmt, '%m', 'tzuserrel').'\');'; |
|
7083 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(\''.dol_print_date($nowgmt, '%Y', 'tzuserrel').'\');'; |
|
7084 | 7084 | } elseif ($addnowlink == 2) { |
7085 | 7085 | /* Disabled because the output does not use the string format defined by FormatDateShort key to forge the value into #prefix. |
7086 | 7086 | * This break application for foreign languages. |
@@ -7089,10 +7089,10 @@ discard block |
||
7089 | 7089 | $reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(parseInt(d.getMonth().pad()) + 1);'; |
7090 | 7090 | $reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(d.getFullYear());'; |
7091 | 7091 | */ |
7092 | - $reset_scripts .= 'jQuery(\'#' . $prefix . '\').val(\'' . dol_print_date($nowgmt, 'day', 'tzuserrel') . '\');'; |
|
7093 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'day\').val(\'' . dol_print_date($nowgmt, '%d', 'tzuserrel') . '\');'; |
|
7094 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'month\').val(\'' . dol_print_date($nowgmt, '%m', 'tzuserrel') . '\');'; |
|
7095 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'year\').val(\'' . dol_print_date($nowgmt, '%Y', 'tzuserrel') . '\');'; |
|
7092 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'\').val(\''.dol_print_date($nowgmt, 'day', 'tzuserrel').'\');'; |
|
7093 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'day\').val(\''.dol_print_date($nowgmt, '%d', 'tzuserrel').'\');'; |
|
7094 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(\''.dol_print_date($nowgmt, '%m', 'tzuserrel').'\');'; |
|
7095 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(\''.dol_print_date($nowgmt, '%Y', 'tzuserrel').'\');'; |
|
7096 | 7096 | } |
7097 | 7097 | /*if ($usecalendar == "eldy") |
7098 | 7098 | { |
@@ -7112,11 +7112,11 @@ discard block |
||
7112 | 7112 | } |
7113 | 7113 | //$reset_scripts .= 'this.form.elements[\''.$prefix.'hour\'].value=formatDate(new Date(), \'HH\'); '; |
7114 | 7114 | if ($addnowlink == 1) { |
7115 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').val(\'' . dol_print_date($nowgmt, '%H', 'tzuserrel') . '\');'; |
|
7116 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').change();'; |
|
7115 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').val(\''.dol_print_date($nowgmt, '%H', 'tzuserrel').'\');'; |
|
7116 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').change();'; |
|
7117 | 7117 | } elseif ($addnowlink == 2) { |
7118 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').val(d.getHours().pad());'; |
|
7119 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').change();'; |
|
7118 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').val(d.getHours().pad());'; |
|
7119 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').change();'; |
|
7120 | 7120 | } |
7121 | 7121 | |
7122 | 7122 | if ($fullday) { |
@@ -7130,11 +7130,11 @@ discard block |
||
7130 | 7130 | } |
7131 | 7131 | //$reset_scripts .= 'this.form.elements[\''.$prefix.'min\'].value=formatDate(new Date(), \'mm\'); '; |
7132 | 7132 | if ($addnowlink == 1) { |
7133 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').val(\'' . dol_print_date($nowgmt, '%M', 'tzuserrel') . '\');'; |
|
7134 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').change();'; |
|
7133 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'min\').val(\''.dol_print_date($nowgmt, '%M', 'tzuserrel').'\');'; |
|
7134 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'min\').change();'; |
|
7135 | 7135 | } elseif ($addnowlink == 2) { |
7136 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').val(d.getMinutes().pad());'; |
|
7137 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').change();'; |
|
7136 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'min\').val(d.getMinutes().pad());'; |
|
7137 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'min\').change();'; |
|
7138 | 7138 | } |
7139 | 7139 | if ($fullday) { |
7140 | 7140 | $reset_scripts .= ' } '; |
@@ -7142,7 +7142,7 @@ discard block |
||
7142 | 7142 | } |
7143 | 7143 | // If reset_scripts is not empty, print the link with the reset_scripts in the onClick |
7144 | 7144 | if ($reset_scripts && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { |
7145 | - $retstring .= ' <button class="dpInvisibleButtons datenowlink" id="' . $prefix . 'ButtonNow" type="button" name="_useless" value="now" onClick="' . $reset_scripts . '">'; |
|
7145 | + $retstring .= ' <button class="dpInvisibleButtons datenowlink" id="'.$prefix.'ButtonNow" type="button" name="_useless" value="now" onClick="'.$reset_scripts.'">'; |
|
7146 | 7146 | $retstring .= $langs->trans("Now"); |
7147 | 7147 | $retstring .= '</button> '; |
7148 | 7148 | } |
@@ -7154,16 +7154,16 @@ discard block |
||
7154 | 7154 | $reset_scripts = ""; |
7155 | 7155 | |
7156 | 7156 | // Generate the date part, depending on the use or not of the javascript calendar |
7157 | - $reset_scripts .= 'jQuery(\'#' . $prefix . '\').val(\'' . dol_print_date($nowgmt, 'dayinputnoreduce', 'tzuserrel') . '\');'; |
|
7158 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'day\').val(\'' . dol_print_date($nowgmt, '%d', 'tzuserrel') . '\');'; |
|
7159 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'month\').val(\'' . dol_print_date($nowgmt, '%m', 'tzuserrel') . '\');'; |
|
7160 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'year\').val(\'' . dol_print_date($nowgmt, '%Y', 'tzuserrel') . '\');'; |
|
7157 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'\').val(\''.dol_print_date($nowgmt, 'dayinputnoreduce', 'tzuserrel').'\');'; |
|
7158 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'day\').val(\''.dol_print_date($nowgmt, '%d', 'tzuserrel').'\');'; |
|
7159 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(\''.dol_print_date($nowgmt, '%m', 'tzuserrel').'\');'; |
|
7160 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(\''.dol_print_date($nowgmt, '%Y', 'tzuserrel').'\');'; |
|
7161 | 7161 | // Update the hour part |
7162 | 7162 | if ($h) { |
7163 | 7163 | if ($fullday) { |
7164 | 7164 | $reset_scripts .= " if (jQuery('#fullday:checked').val() == null) {"; |
7165 | 7165 | } |
7166 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').val(\'' . dol_print_date($nowgmt, '%H', 'tzuserrel') . '\');'; |
|
7166 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').val(\''.dol_print_date($nowgmt, '%H', 'tzuserrel').'\');'; |
|
7167 | 7167 | if ($fullday) { |
7168 | 7168 | $reset_scripts .= ' } '; |
7169 | 7169 | } |
@@ -7173,14 +7173,14 @@ discard block |
||
7173 | 7173 | if ($fullday) { |
7174 | 7174 | $reset_scripts .= " if (jQuery('#fullday:checked').val() == null) {"; |
7175 | 7175 | } |
7176 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').val(\'' . dol_print_date($nowgmt, '%M', 'tzuserrel') . '\');'; |
|
7176 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'min\').val(\''.dol_print_date($nowgmt, '%M', 'tzuserrel').'\');'; |
|
7177 | 7177 | if ($fullday) { |
7178 | 7178 | $reset_scripts .= ' } '; |
7179 | 7179 | } |
7180 | 7180 | } |
7181 | 7181 | // If reset_scripts is not empty, print the link with the reset_scripts in the onClick |
7182 | 7182 | if ($reset_scripts && empty($conf->dol_optimize_smallscreen)) { |
7183 | - $retstring .= ' <button class="dpInvisibleButtons datenowlink" id="' . $prefix . 'ButtonPlusOne" type="button" name="_useless2" value="plusone" onClick="' . $reset_scripts . '">'; |
|
7183 | + $retstring .= ' <button class="dpInvisibleButtons datenowlink" id="'.$prefix.'ButtonPlusOne" type="button" name="_useless2" value="plusone" onClick="'.$reset_scripts.'">'; |
|
7184 | 7184 | $retstring .= $langs->trans("DateStartPlusOne"); |
7185 | 7185 | $retstring .= '</button> '; |
7186 | 7186 | } |
@@ -7238,17 +7238,17 @@ discard block |
||
7238 | 7238 | unset($TDurationTypes[$value]); |
7239 | 7239 | } |
7240 | 7240 | |
7241 | - $retstring = '<select class="flat minwidth75 maxwidth100" id="select_' . $prefix . 'type_duration" name="' . $prefix . 'type_duration">'; |
|
7241 | + $retstring = '<select class="flat minwidth75 maxwidth100" id="select_'.$prefix.'type_duration" name="'.$prefix.'type_duration">'; |
|
7242 | 7242 | foreach ($TDurationTypes as $key => $typeduration) { |
7243 | - $retstring .= '<option value="' . $key . '"'; |
|
7243 | + $retstring .= '<option value="'.$key.'"'; |
|
7244 | 7244 | if ($key == $selected) { |
7245 | 7245 | $retstring .= " selected"; |
7246 | 7246 | } |
7247 | - $retstring .= ">" . $typeduration . "</option>"; |
|
7247 | + $retstring .= ">".$typeduration."</option>"; |
|
7248 | 7248 | } |
7249 | 7249 | $retstring .= "</select>"; |
7250 | 7250 | |
7251 | - $retstring .= ajax_combobox('select_' . $prefix . 'type_duration'); |
|
7251 | + $retstring .= ajax_combobox('select_'.$prefix.'type_duration'); |
|
7252 | 7252 | |
7253 | 7253 | return $retstring; |
7254 | 7254 | } |
@@ -7280,30 +7280,30 @@ discard block |
||
7280 | 7280 | |
7281 | 7281 | // Hours |
7282 | 7282 | if ($iSecond != '') { |
7283 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; |
|
7283 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; |
|
7284 | 7284 | |
7285 | 7285 | $hourSelected = convertSecondToTime($iSecond, 'allhour'); |
7286 | 7286 | $minSelected = convertSecondToTime($iSecond, 'min'); |
7287 | 7287 | } |
7288 | 7288 | |
7289 | 7289 | if ($typehour == 'select') { |
7290 | - $retstring .= '<select class="flat" id="select_' . $prefix . 'hour" name="' . $prefix . 'hour"' . ($disabled ? ' disabled' : '') . '>'; |
|
7290 | + $retstring .= '<select class="flat" id="select_'.$prefix.'hour" name="'.$prefix.'hour"'.($disabled ? ' disabled' : '').'>'; |
|
7291 | 7291 | for ($hour = 0; $hour < 25; $hour++) { // For a duration, we allow 24 hours |
7292 | - $retstring .= '<option value="' . $hour . '"'; |
|
7292 | + $retstring .= '<option value="'.$hour.'"'; |
|
7293 | 7293 | if (is_numeric($hourSelected) && $hourSelected == $hour) { |
7294 | 7294 | $retstring .= " selected"; |
7295 | 7295 | } |
7296 | - $retstring .= ">" . $hour . "</option>"; |
|
7296 | + $retstring .= ">".$hour."</option>"; |
|
7297 | 7297 | } |
7298 | 7298 | $retstring .= "</select>"; |
7299 | 7299 | } elseif ($typehour == 'text' || $typehour == 'textselect') { |
7300 | - $retstring .= '<input placeholder="' . $langs->trans('HourShort') . '" type="number" min="0" name="' . $prefix . 'hour"' . ($disabled ? ' disabled' : '') . ' class="flat maxwidth50 inputhour right" value="' . (($hourSelected != '') ? ((int) $hourSelected) : '') . '">'; |
|
7300 | + $retstring .= '<input placeholder="'.$langs->trans('HourShort').'" type="number" min="0" name="'.$prefix.'hour"'.($disabled ? ' disabled' : '').' class="flat maxwidth50 inputhour right" value="'.(($hourSelected != '') ? ((int) $hourSelected) : '').'">'; |
|
7301 | 7301 | } else { |
7302 | 7302 | return 'BadValueForParameterTypeHour'; |
7303 | 7303 | } |
7304 | 7304 | |
7305 | 7305 | if ($typehour != 'text') { |
7306 | - $retstring .= ' ' . $langs->trans('HourShort'); |
|
7306 | + $retstring .= ' '.$langs->trans('HourShort'); |
|
7307 | 7307 | } else { |
7308 | 7308 | $retstring .= '<span class="">:</span>'; |
7309 | 7309 | } |
@@ -7318,21 +7318,21 @@ discard block |
||
7318 | 7318 | } |
7319 | 7319 | |
7320 | 7320 | if ($typehour == 'select' || $typehour == 'textselect') { |
7321 | - $retstring .= '<select class="flat" id="select_' . $prefix . 'min" name="' . $prefix . 'min"' . ($disabled ? ' disabled' : '') . '>'; |
|
7321 | + $retstring .= '<select class="flat" id="select_'.$prefix.'min" name="'.$prefix.'min"'.($disabled ? ' disabled' : '').'>'; |
|
7322 | 7322 | for ($min = 0; $min <= 55; $min = $min + 5) { |
7323 | - $retstring .= '<option value="' . $min . '"'; |
|
7323 | + $retstring .= '<option value="'.$min.'"'; |
|
7324 | 7324 | if (is_numeric($minSelected) && $minSelected == $min) { |
7325 | 7325 | $retstring .= ' selected'; |
7326 | 7326 | } |
7327 | - $retstring .= '>' . $min . '</option>'; |
|
7327 | + $retstring .= '>'.$min.'</option>'; |
|
7328 | 7328 | } |
7329 | 7329 | $retstring .= "</select>"; |
7330 | 7330 | } elseif ($typehour == 'text') { |
7331 | - $retstring .= '<input placeholder="' . $langs->trans('MinuteShort') . '" type="number" min="0" name="' . $prefix . 'min"' . ($disabled ? ' disabled' : '') . ' class="flat maxwidth50 inputminute right" value="' . (($minSelected != '') ? ((int) $minSelected) : '') . '">'; |
|
7331 | + $retstring .= '<input placeholder="'.$langs->trans('MinuteShort').'" type="number" min="0" name="'.$prefix.'min"'.($disabled ? ' disabled' : '').' class="flat maxwidth50 inputminute right" value="'.(($minSelected != '') ? ((int) $minSelected) : '').'">'; |
|
7332 | 7332 | } |
7333 | 7333 | |
7334 | 7334 | if ($typehour != 'text') { |
7335 | - $retstring .= ' ' . $langs->trans('MinuteShort'); |
|
7335 | + $retstring .= ' '.$langs->trans('MinuteShort'); |
|
7336 | 7336 | } |
7337 | 7337 | |
7338 | 7338 | $retstring .= "</span>"; |
@@ -7378,7 +7378,7 @@ discard block |
||
7378 | 7378 | $placeholder = ''; |
7379 | 7379 | |
7380 | 7380 | if ($selected && empty($selected_input_value)) { |
7381 | - require_once DOL_DOCUMENT_ROOT . '/ticket/class/ticket.class.php'; |
|
7381 | + require_once DOL_DOCUMENT_ROOT.'/ticket/class/ticket.class.php'; |
|
7382 | 7382 | $tickettmpselect = new Ticket($this->db); |
7383 | 7383 | $tickettmpselect->fetch($selected); |
7384 | 7384 | $selected_input_value = $tickettmpselect->ref; |
@@ -7386,16 +7386,16 @@ discard block |
||
7386 | 7386 | } |
7387 | 7387 | |
7388 | 7388 | $urloption = ''; |
7389 | - $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/ticket/ajax/tickets.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions); |
|
7389 | + $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/ticket/ajax/tickets.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions); |
|
7390 | 7390 | |
7391 | - if (empty($hidelabel)) $out .= $langs->trans("RefOrLabel") . ' : '; |
|
7391 | + if (empty($hidelabel)) $out .= $langs->trans("RefOrLabel").' : '; |
|
7392 | 7392 | elseif ($hidelabel > 1) { |
7393 | - $placeholder = ' placeholder="' . $langs->trans("RefOrLabel") . '"'; |
|
7393 | + $placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"'; |
|
7394 | 7394 | if ($hidelabel == 2) { |
7395 | 7395 | $out .= img_picto($langs->trans("Search"), 'search'); |
7396 | 7396 | } |
7397 | 7397 | } |
7398 | - $out .= '<input type="text" class="minwidth100" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (!empty($conf->global->PRODUCT_SEARCH_AUTOFOCUS) ? 'autofocus' : '') . ' />'; |
|
7398 | + $out .= '<input type="text" class="minwidth100" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(!empty($conf->global->PRODUCT_SEARCH_AUTOFOCUS) ? 'autofocus' : '').' />'; |
|
7399 | 7399 | if ($hidelabel == 3) { |
7400 | 7400 | $out .= img_picto($langs->trans("Search"), 'search'); |
7401 | 7401 | } |
@@ -7439,8 +7439,8 @@ discard block |
||
7439 | 7439 | |
7440 | 7440 | $sql = "SELECT "; |
7441 | 7441 | $sql .= $selectFields; |
7442 | - $sql .= " FROM " . $this->db->prefix() . "ticket as p"; |
|
7443 | - $sql .= ' WHERE p.entity IN (' . getEntity('ticket') . ')'; |
|
7442 | + $sql .= " FROM ".$this->db->prefix()."ticket as p"; |
|
7443 | + $sql .= ' WHERE p.entity IN ('.getEntity('ticket').')'; |
|
7444 | 7444 | |
7445 | 7445 | // Add criteria on ref/label |
7446 | 7446 | if ($filterkey != '') { |
@@ -7452,7 +7452,7 @@ discard block |
||
7452 | 7452 | if (count($scrit) > 1) $sql .= "("; |
7453 | 7453 | foreach ($scrit as $crit) { |
7454 | 7454 | if ($i > 0) $sql .= " AND "; |
7455 | - $sql .= "(p.ref LIKE '" . $this->db->escape($prefix . $crit) . "%' OR p.subject LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
7455 | + $sql .= "(p.ref LIKE '".$this->db->escape($prefix.$crit)."%' OR p.subject LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
7456 | 7456 | $sql .= ")"; |
7457 | 7457 | $i++; |
7458 | 7458 | } |
@@ -7463,22 +7463,22 @@ discard block |
||
7463 | 7463 | $sql .= $this->db->plimit($limit, 0); |
7464 | 7464 | |
7465 | 7465 | // Build output string |
7466 | - dol_syslog(get_class($this) . "::selectTicketsList search tickets", LOG_DEBUG); |
|
7466 | + dol_syslog(get_class($this)."::selectTicketsList search tickets", LOG_DEBUG); |
|
7467 | 7467 | $result = $this->db->query($sql); |
7468 | 7468 | if ($result) { |
7469 | - require_once DOL_DOCUMENT_ROOT . '/ticket/class/ticket.class.php'; |
|
7470 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/ticket.lib.php'; |
|
7469 | + require_once DOL_DOCUMENT_ROOT.'/ticket/class/ticket.class.php'; |
|
7470 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/ticket.lib.php'; |
|
7471 | 7471 | |
7472 | 7472 | $num = $this->db->num_rows($result); |
7473 | 7473 | |
7474 | 7474 | $events = null; |
7475 | 7475 | |
7476 | 7476 | if (!$forcecombo) { |
7477 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
7477 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
7478 | 7478 | $out .= ajax_combobox($htmlname, $events, $conf->global->TICKET_USE_SEARCH_TO_SELECT); |
7479 | 7479 | } |
7480 | 7480 | |
7481 | - $out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">'; |
|
7481 | + $out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">'; |
|
7482 | 7482 | |
7483 | 7483 | $textifempty = ''; |
7484 | 7484 | // Do not use textifempty = ' ' or ' ' here, or search on key will search on ' key'. |
@@ -7489,7 +7489,7 @@ discard block |
||
7489 | 7489 | } else { |
7490 | 7490 | if ($showempty && !is_numeric($showempty)) $textifempty = $langs->trans($showempty); |
7491 | 7491 | } |
7492 | - if ($showempty) $out .= '<option value="0" selected>' . $textifempty . '</option>'; |
|
7492 | + if ($showempty) $out .= '<option value="0" selected>'.$textifempty.'</option>'; |
|
7493 | 7493 | |
7494 | 7494 | $i = 0; |
7495 | 7495 | while ($num && $i < $num) { |
@@ -7543,12 +7543,12 @@ discard block |
||
7543 | 7543 | $outref = $objp->ref; |
7544 | 7544 | $outtype = $objp->fk_product_type; |
7545 | 7545 | |
7546 | - $opt = '<option value="' . $objp->rowid . '"'; |
|
7546 | + $opt = '<option value="'.$objp->rowid.'"'; |
|
7547 | 7547 | $opt .= ($objp->rowid == $selected) ? ' selected' : ''; |
7548 | 7548 | $opt .= '>'; |
7549 | 7549 | $opt .= $objp->ref; |
7550 | 7550 | $objRef = $objp->ref; |
7551 | - if (!empty($filterkey) && $filterkey != '') $objRef = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRef, 1); |
|
7551 | + if (!empty($filterkey) && $filterkey != '') $objRef = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRef, 1); |
|
7552 | 7552 | |
7553 | 7553 | $opt .= "</option>\n"; |
7554 | 7554 | $optJson = array('key' => $outkey, 'value' => $outref, 'type' => $outtype); |
@@ -7586,7 +7586,7 @@ discard block |
||
7586 | 7586 | $placeholder = ''; |
7587 | 7587 | |
7588 | 7588 | if ($selected && empty($selected_input_value)) { |
7589 | - require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; |
|
7589 | + require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; |
|
7590 | 7590 | $projecttmpselect = new Project($this->db); |
7591 | 7591 | $projecttmpselect->fetch($selected); |
7592 | 7592 | $selected_input_value = $projecttmpselect->ref; |
@@ -7594,16 +7594,16 @@ discard block |
||
7594 | 7594 | } |
7595 | 7595 | |
7596 | 7596 | $urloption = ''; |
7597 | - $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/projet/ajax/projects.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions); |
|
7597 | + $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/projet/ajax/projects.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions); |
|
7598 | 7598 | |
7599 | - if (empty($hidelabel)) $out .= $langs->trans("RefOrLabel") . ' : '; |
|
7599 | + if (empty($hidelabel)) $out .= $langs->trans("RefOrLabel").' : '; |
|
7600 | 7600 | elseif ($hidelabel > 1) { |
7601 | - $placeholder = ' placeholder="' . $langs->trans("RefOrLabel") . '"'; |
|
7601 | + $placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"'; |
|
7602 | 7602 | if ($hidelabel == 2) { |
7603 | 7603 | $out .= img_picto($langs->trans("Search"), 'search'); |
7604 | 7604 | } |
7605 | 7605 | } |
7606 | - $out .= '<input type="text" class="minwidth100" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (!empty($conf->global->PRODUCT_SEARCH_AUTOFOCUS) ? 'autofocus' : '') . ' />'; |
|
7606 | + $out .= '<input type="text" class="minwidth100" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(!empty($conf->global->PRODUCT_SEARCH_AUTOFOCUS) ? 'autofocus' : '').' />'; |
|
7607 | 7607 | if ($hidelabel == 3) { |
7608 | 7608 | $out .= img_picto($langs->trans("Search"), 'search'); |
7609 | 7609 | } |
@@ -7646,8 +7646,8 @@ discard block |
||
7646 | 7646 | |
7647 | 7647 | $sql = "SELECT "; |
7648 | 7648 | $sql .= $selectFields; |
7649 | - $sql .= " FROM " . $this->db->prefix() . "projet as p"; |
|
7650 | - $sql .= ' WHERE p.entity IN (' . getEntity('project') . ')'; |
|
7649 | + $sql .= " FROM ".$this->db->prefix()."projet as p"; |
|
7650 | + $sql .= ' WHERE p.entity IN ('.getEntity('project').')'; |
|
7651 | 7651 | |
7652 | 7652 | // Add criteria on ref/label |
7653 | 7653 | if ($filterkey != '') { |
@@ -7659,7 +7659,7 @@ discard block |
||
7659 | 7659 | if (count($scrit) > 1) $sql .= "("; |
7660 | 7660 | foreach ($scrit as $crit) { |
7661 | 7661 | if ($i > 0) $sql .= " AND "; |
7662 | - $sql .= "p.ref LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
7662 | + $sql .= "p.ref LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
7663 | 7663 | $sql .= ""; |
7664 | 7664 | $i++; |
7665 | 7665 | } |
@@ -7670,22 +7670,22 @@ discard block |
||
7670 | 7670 | $sql .= $this->db->plimit($limit, 0); |
7671 | 7671 | |
7672 | 7672 | // Build output string |
7673 | - dol_syslog(get_class($this) . "::selectProjectsList search projects", LOG_DEBUG); |
|
7673 | + dol_syslog(get_class($this)."::selectProjectsList search projects", LOG_DEBUG); |
|
7674 | 7674 | $result = $this->db->query($sql); |
7675 | 7675 | if ($result) { |
7676 | - require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; |
|
7677 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/project.lib.php'; |
|
7676 | + require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; |
|
7677 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; |
|
7678 | 7678 | |
7679 | 7679 | $num = $this->db->num_rows($result); |
7680 | 7680 | |
7681 | 7681 | $events = null; |
7682 | 7682 | |
7683 | 7683 | if (!$forcecombo) { |
7684 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
7684 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
7685 | 7685 | $out .= ajax_combobox($htmlname, $events, $conf->global->PROJECT_USE_SEARCH_TO_SELECT); |
7686 | 7686 | } |
7687 | 7687 | |
7688 | - $out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">'; |
|
7688 | + $out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">'; |
|
7689 | 7689 | |
7690 | 7690 | $textifempty = ''; |
7691 | 7691 | // Do not use textifempty = ' ' or ' ' here, or search on key will search on ' key'. |
@@ -7696,7 +7696,7 @@ discard block |
||
7696 | 7696 | } else { |
7697 | 7697 | if ($showempty && !is_numeric($showempty)) $textifempty = $langs->trans($showempty); |
7698 | 7698 | } |
7699 | - if ($showempty) $out .= '<option value="0" selected>' . $textifempty . '</option>'; |
|
7699 | + if ($showempty) $out .= '<option value="0" selected>'.$textifempty.'</option>'; |
|
7700 | 7700 | |
7701 | 7701 | $i = 0; |
7702 | 7702 | while ($num && $i < $num) { |
@@ -7753,12 +7753,12 @@ discard block |
||
7753 | 7753 | $outlabel = $objp->label; |
7754 | 7754 | $outtype = $objp->fk_product_type; |
7755 | 7755 | |
7756 | - $opt = '<option value="' . $objp->rowid . '"'; |
|
7756 | + $opt = '<option value="'.$objp->rowid.'"'; |
|
7757 | 7757 | $opt .= ($objp->rowid == $selected) ? ' selected' : ''; |
7758 | 7758 | $opt .= '>'; |
7759 | 7759 | $opt .= $objp->ref; |
7760 | 7760 | $objRef = $objp->ref; |
7761 | - if (!empty($filterkey) && $filterkey != '') $objRef = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRef, 1); |
|
7761 | + if (!empty($filterkey) && $filterkey != '') $objRef = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRef, 1); |
|
7762 | 7762 | |
7763 | 7763 | $opt .= "</option>\n"; |
7764 | 7764 | $optJson = array('key' => $outkey, 'value' => $outref, 'type' => $outtype); |
@@ -7798,7 +7798,7 @@ discard block |
||
7798 | 7798 | $urloption = ''; |
7799 | 7799 | |
7800 | 7800 | if ($selected && empty($selected_input_value)) { |
7801 | - require_once DOL_DOCUMENT_ROOT . '/adherents/class/adherent.class.php'; |
|
7801 | + require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; |
|
7802 | 7802 | $adherenttmpselect = new Adherent($this->db); |
7803 | 7803 | $adherenttmpselect->fetch($selected); |
7804 | 7804 | $selected_input_value = $adherenttmpselect->ref; |
@@ -7807,16 +7807,16 @@ discard block |
||
7807 | 7807 | |
7808 | 7808 | $urloption = ''; |
7809 | 7809 | |
7810 | - $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/adherents/ajax/adherents.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions); |
|
7810 | + $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/adherents/ajax/adherents.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions); |
|
7811 | 7811 | |
7812 | - if (empty($hidelabel)) $out .= $langs->trans("RefOrLabel") . ' : '; |
|
7812 | + if (empty($hidelabel)) $out .= $langs->trans("RefOrLabel").' : '; |
|
7813 | 7813 | elseif ($hidelabel > 1) { |
7814 | - $placeholder = ' placeholder="' . $langs->trans("RefOrLabel") . '"'; |
|
7814 | + $placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"'; |
|
7815 | 7815 | if ($hidelabel == 2) { |
7816 | 7816 | $out .= img_picto($langs->trans("Search"), 'search'); |
7817 | 7817 | } |
7818 | 7818 | } |
7819 | - $out .= '<input type="text" class="minwidth100" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (!empty($conf->global->PRODUCT_SEARCH_AUTOFOCUS) ? 'autofocus' : '') . ' />'; |
|
7819 | + $out .= '<input type="text" class="minwidth100" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(!empty($conf->global->PRODUCT_SEARCH_AUTOFOCUS) ? 'autofocus' : '').' />'; |
|
7820 | 7820 | if ($hidelabel == 3) { |
7821 | 7821 | $out .= img_picto($langs->trans("Search"), 'search'); |
7822 | 7822 | } |
@@ -7861,8 +7861,8 @@ discard block |
||
7861 | 7861 | |
7862 | 7862 | $sql = "SELECT "; |
7863 | 7863 | $sql .= $selectFields; |
7864 | - $sql .= " FROM " . $this->db->prefix() . "adherent as p"; |
|
7865 | - $sql .= ' WHERE p.entity IN (' . getEntity('adherent') . ')'; |
|
7864 | + $sql .= " FROM ".$this->db->prefix()."adherent as p"; |
|
7865 | + $sql .= ' WHERE p.entity IN ('.getEntity('adherent').')'; |
|
7866 | 7866 | |
7867 | 7867 | // Add criteria on ref/label |
7868 | 7868 | if ($filterkey != '') { |
@@ -7874,35 +7874,35 @@ discard block |
||
7874 | 7874 | if (count($scrit) > 1) $sql .= "("; |
7875 | 7875 | foreach ($scrit as $crit) { |
7876 | 7876 | if ($i > 0) $sql .= " AND "; |
7877 | - $sql .= "(p.firstname LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
7878 | - $sql .= " OR p.lastname LIKE '" . $this->db->escape($prefix . $crit) . "%')"; |
|
7877 | + $sql .= "(p.firstname LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
7878 | + $sql .= " OR p.lastname LIKE '".$this->db->escape($prefix.$crit)."%')"; |
|
7879 | 7879 | $i++; |
7880 | 7880 | } |
7881 | 7881 | if (count($scrit) > 1) $sql .= ")"; |
7882 | 7882 | $sql .= ')'; |
7883 | 7883 | } |
7884 | 7884 | if ($status != -1) { |
7885 | - $sql .= ' AND statut = ' . ((int) $status); |
|
7885 | + $sql .= ' AND statut = '.((int) $status); |
|
7886 | 7886 | } |
7887 | 7887 | $sql .= $this->db->plimit($limit, 0); |
7888 | 7888 | |
7889 | 7889 | // Build output string |
7890 | - dol_syslog(get_class($this) . "::selectMembersList search adherents", LOG_DEBUG); |
|
7890 | + dol_syslog(get_class($this)."::selectMembersList search adherents", LOG_DEBUG); |
|
7891 | 7891 | $result = $this->db->query($sql); |
7892 | 7892 | if ($result) { |
7893 | - require_once DOL_DOCUMENT_ROOT . '/adherents/class/adherent.class.php'; |
|
7894 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/member.lib.php'; |
|
7893 | + require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; |
|
7894 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php'; |
|
7895 | 7895 | |
7896 | 7896 | $num = $this->db->num_rows($result); |
7897 | 7897 | |
7898 | 7898 | $events = null; |
7899 | 7899 | |
7900 | 7900 | if (!$forcecombo) { |
7901 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
7901 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
7902 | 7902 | $out .= ajax_combobox($htmlname, $events, !empty($conf->global->PROJECT_USE_SEARCH_TO_SELECT) ? $conf->global->PROJECT_USE_SEARCH_TO_SELECT : ''); |
7903 | 7903 | } |
7904 | 7904 | |
7905 | - $out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">'; |
|
7905 | + $out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">'; |
|
7906 | 7906 | |
7907 | 7907 | $textifempty = ''; |
7908 | 7908 | // Do not use textifempty = ' ' or ' ' here, or search on key will search on ' key'. |
@@ -7914,7 +7914,7 @@ discard block |
||
7914 | 7914 | if ($showempty && !is_numeric($showempty)) $textifempty = $langs->trans($showempty); |
7915 | 7915 | } |
7916 | 7916 | if ($showempty) { |
7917 | - $out .= '<option value="-1" selected>' . $textifempty . '</option>'; |
|
7917 | + $out .= '<option value="-1" selected>'.$textifempty.'</option>'; |
|
7918 | 7918 | } |
7919 | 7919 | |
7920 | 7920 | $i = 0; |
@@ -7970,11 +7970,11 @@ discard block |
||
7970 | 7970 | $outlabel = dolGetFirstLastname($objp->firstname, $objp->lastname); |
7971 | 7971 | $outtype = $objp->fk_adherent_type; |
7972 | 7972 | |
7973 | - $opt = '<option value="' . $objp->rowid . '"'; |
|
7973 | + $opt = '<option value="'.$objp->rowid.'"'; |
|
7974 | 7974 | $opt .= ($objp->rowid == $selected) ? ' selected' : ''; |
7975 | 7975 | $opt .= '>'; |
7976 | 7976 | if (!empty($filterkey) && $filterkey != '') { |
7977 | - $outlabel = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $outlabel, 1); |
|
7977 | + $outlabel = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $outlabel, 1); |
|
7978 | 7978 | } |
7979 | 7979 | $opt .= $outlabel; |
7980 | 7980 | $opt .= "</option>\n"; |
@@ -8015,9 +8015,9 @@ discard block |
||
8015 | 8015 | $vartmp = (empty($InfoFieldList[3]) ? '' : $InfoFieldList[3]); |
8016 | 8016 | $reg = array(); |
8017 | 8017 | if (preg_match('/^.*:(\w*)$/', $vartmp, $reg)) { |
8018 | - $InfoFieldList[4] = $reg[1]; // take the sort field |
|
8018 | + $InfoFieldList[4] = $reg[1]; // take the sort field |
|
8019 | 8019 | } |
8020 | - $InfoFieldList[3] = preg_replace('/:\w*$/', '', $vartmp); // take the filter field |
|
8020 | + $InfoFieldList[3] = preg_replace('/:\w*$/', '', $vartmp); // take the filter field |
|
8021 | 8021 | |
8022 | 8022 | $classname = $InfoFieldList[0]; |
8023 | 8023 | $classpath = $InfoFieldList[1]; |
@@ -8041,8 +8041,8 @@ discard block |
||
8041 | 8041 | } |
8042 | 8042 | } |
8043 | 8043 | if (!is_object($objecttmp)) { |
8044 | - dol_syslog('Error bad setup of type for field ' . join(',', $InfoFieldList), LOG_WARNING); |
|
8045 | - return 'Error bad setup of type for field ' . join(',', $InfoFieldList); |
|
8044 | + dol_syslog('Error bad setup of type for field '.join(',', $InfoFieldList), LOG_WARNING); |
|
8045 | + return 'Error bad setup of type for field '.join(',', $InfoFieldList); |
|
8046 | 8046 | } |
8047 | 8047 | |
8048 | 8048 | //var_dump($filter); |
@@ -8053,9 +8053,9 @@ discard block |
||
8053 | 8053 | if ($prefixforautocompletemode == 'product') { |
8054 | 8054 | $prefixforautocompletemode = 'produit'; |
8055 | 8055 | } |
8056 | - $confkeyforautocompletemode = strtoupper($prefixforautocompletemode) . '_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT |
|
8056 | + $confkeyforautocompletemode = strtoupper($prefixforautocompletemode).'_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT |
|
8057 | 8057 | |
8058 | - dol_syslog(get_class($this) . "::selectForForms filter=" . $filter, LOG_DEBUG); |
|
8058 | + dol_syslog(get_class($this)."::selectForForms filter=".$filter, LOG_DEBUG); |
|
8059 | 8059 | $out = ''; |
8060 | 8060 | if (!empty($conf->use_javascript_ajax) && getDolGlobalString($confkeyforautocompletemode) && !$forcecombo) { |
8061 | 8061 | // No immediate load of all database |
@@ -8066,15 +8066,15 @@ discard block |
||
8066 | 8066 | //unset($objecttmp); |
8067 | 8067 | } |
8068 | 8068 | |
8069 | - $objectdesc = $classname . ':' . $classpath . ':' . $addcreatebuttonornot . ':' . $filter; |
|
8070 | - $urlforajaxcall = DOL_URL_ROOT . '/core/ajax/selectobject.php'; |
|
8069 | + $objectdesc = $classname.':'.$classpath.':'.$addcreatebuttonornot.':'.$filter; |
|
8070 | + $urlforajaxcall = DOL_URL_ROOT.'/core/ajax/selectobject.php'; |
|
8071 | 8071 | |
8072 | 8072 | // No immediate load of all database |
8073 | - $urloption = 'htmlname=' . urlencode($htmlname) . '&outjson=1&objectdesc=' . urlencode($objectdesc) . '&filter=' . urlencode($filter) . ($sortfield ? '&sortfield=' . urlencode($sortfield) : ''); |
|
8073 | + $urloption = 'htmlname='.urlencode($htmlname).'&outjson=1&objectdesc='.urlencode($objectdesc).'&filter='.urlencode($filter).($sortfield ? '&sortfield='.urlencode($sortfield) : ''); |
|
8074 | 8074 | // Activate the auto complete using ajax call. |
8075 | 8075 | $out .= ajax_autocompleter($preselectedvalue, $htmlname, $urlforajaxcall, $urloption, $conf->global->$confkeyforautocompletemode, 0, array()); |
8076 | 8076 | $out .= '<!-- force css to be higher than dialog popup --><style type="text/css">.ui-autocomplete { z-index: 1010; }</style>'; |
8077 | - $out .= '<input type="text" class="' . $morecss . '"' . ($disabled ? ' disabled="disabled"' : '') . ' name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . ($placeholder ? ' placeholder="' . dol_escape_htmltag($placeholder) . '"' : '') . ' />'; |
|
8077 | + $out .= '<input type="text" class="'.$morecss.'"'.($disabled ? ' disabled="disabled"' : '').' name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.($placeholder ? ' placeholder="'.dol_escape_htmltag($placeholder).'"' : '').' />'; |
|
8078 | 8078 | } else { |
8079 | 8079 | // Immediate load of table record. |
8080 | 8080 | $out .= $this->selectForFormsList($objecttmp, $htmlname, $preselectedvalue, $showempty, $searchkey, $placeholder, $morecss, $moreparams, $forcecombo, 0, $disabled, $sortfield, $filter); |
@@ -8114,7 +8114,7 @@ discard block |
||
8114 | 8114 | if ($prefixforautocompletemode == 'societe') { |
8115 | 8115 | $prefixforautocompletemode = 'company'; |
8116 | 8116 | } |
8117 | - $confkeyforautocompletemode = strtoupper($prefixforautocompletemode) . '_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT |
|
8117 | + $confkeyforautocompletemode = strtoupper($prefixforautocompletemode).'_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT |
|
8118 | 8118 | |
8119 | 8119 | if (!empty($objecttmp->fields)) { // For object that declare it, it is better to use declared fields (like societe, contact, ...) |
8120 | 8120 | $tmpfieldstoshow = ''; |
@@ -8123,7 +8123,7 @@ discard block |
||
8123 | 8123 | continue; |
8124 | 8124 | } |
8125 | 8125 | if (!empty($val['showoncombobox'])) { |
8126 | - $tmpfieldstoshow .= ($tmpfieldstoshow ? ',' : '') . 't.' . $key; |
|
8126 | + $tmpfieldstoshow .= ($tmpfieldstoshow ? ',' : '').'t.'.$key; |
|
8127 | 8127 | } |
8128 | 8128 | } |
8129 | 8129 | if ($tmpfieldstoshow) { |
@@ -8151,18 +8151,18 @@ discard block |
||
8151 | 8151 | $num = 0; |
8152 | 8152 | |
8153 | 8153 | // Search data |
8154 | - $sql = "SELECT t.rowid, " . $fieldstoshow . " FROM " . $this->db->prefix() . $objecttmp->table_element . " as t"; |
|
8154 | + $sql = "SELECT t.rowid, ".$fieldstoshow." FROM ".$this->db->prefix().$objecttmp->table_element." as t"; |
|
8155 | 8155 | if (!empty($objecttmp->isextrafieldmanaged)) { |
8156 | - $sql .= " LEFT JOIN " . $this->db->prefix() . $objecttmp->table_element . "_extrafields as e ON t.rowid=e.fk_object"; |
|
8156 | + $sql .= " LEFT JOIN ".$this->db->prefix().$objecttmp->table_element."_extrafields as e ON t.rowid=e.fk_object"; |
|
8157 | 8157 | } |
8158 | 8158 | if (isset($objecttmp->ismultientitymanaged)) { |
8159 | 8159 | if (!is_numeric($objecttmp->ismultientitymanaged)) { |
8160 | 8160 | $tmparray = explode('@', $objecttmp->ismultientitymanaged); |
8161 | - $sql .= " INNER JOIN " . $this->db->prefix() . $tmparray[1] . " as parenttable ON parenttable.rowid = t." . $tmparray[0]; |
|
8161 | + $sql .= " INNER JOIN ".$this->db->prefix().$tmparray[1]." as parenttable ON parenttable.rowid = t.".$tmparray[0]; |
|
8162 | 8162 | } |
8163 | 8163 | if ($objecttmp->ismultientitymanaged === 'fk_soc@societe') { |
8164 | 8164 | if (!$user->hasRight('societe', 'client', 'voir') && !$user->socid) { |
8165 | - $sql .= ", " . $this->db->prefix() . "societe_commerciaux as sc"; |
|
8165 | + $sql .= ", ".$this->db->prefix()."societe_commerciaux as sc"; |
|
8166 | 8166 | } |
8167 | 8167 | } |
8168 | 8168 | } |
@@ -8182,21 +8182,21 @@ discard block |
||
8182 | 8182 | $sql .= " WHERE 1=1"; |
8183 | 8183 | if (isset($objecttmp->ismultientitymanaged)) { |
8184 | 8184 | if ($objecttmp->ismultientitymanaged == 1) { |
8185 | - $sql .= " AND t.entity IN (" . getEntity($objecttmp->table_element) . ")"; |
|
8185 | + $sql .= " AND t.entity IN (".getEntity($objecttmp->table_element).")"; |
|
8186 | 8186 | } |
8187 | 8187 | if (!is_numeric($objecttmp->ismultientitymanaged)) { |
8188 | - $sql .= " AND parenttable.entity = t." . $tmparray[0]; |
|
8188 | + $sql .= " AND parenttable.entity = t.".$tmparray[0]; |
|
8189 | 8189 | } |
8190 | 8190 | if ($objecttmp->ismultientitymanaged == 1 && !empty($user->socid)) { |
8191 | 8191 | if ($objecttmp->element == 'societe') { |
8192 | - $sql .= " AND t.rowid = " . ((int) $user->socid); |
|
8192 | + $sql .= " AND t.rowid = ".((int) $user->socid); |
|
8193 | 8193 | } else { |
8194 | - $sql .= " AND t.fk_soc = " . ((int) $user->socid); |
|
8194 | + $sql .= " AND t.fk_soc = ".((int) $user->socid); |
|
8195 | 8195 | } |
8196 | 8196 | } |
8197 | 8197 | if ($objecttmp->ismultientitymanaged === 'fk_soc@societe') { |
8198 | 8198 | if (!$user->hasRight('societe', 'client', 'voir') && !$user->socid) { |
8199 | - $sql .= " AND t.rowid = sc.fk_soc AND sc.fk_user = " . ((int) $user->id); |
|
8199 | + $sql .= " AND t.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); |
|
8200 | 8200 | } |
8201 | 8201 | } |
8202 | 8202 | } |
@@ -8208,7 +8208,7 @@ discard block |
||
8208 | 8208 | $errormessage = ''; |
8209 | 8209 | $sql .= forgeSQLFromUniversalSearchCriteria($filter, $errormessage); |
8210 | 8210 | if ($errormessage) { |
8211 | - return 'Error forging a SQL request from an universal criteria: ' . $errormessage; |
|
8211 | + return 'Error forging a SQL request from an universal criteria: '.$errormessage; |
|
8212 | 8212 | } |
8213 | 8213 | } |
8214 | 8214 | } |
@@ -8220,7 +8220,7 @@ discard block |
||
8220 | 8220 | $resql = $this->db->query($sql); |
8221 | 8221 | if ($resql) { |
8222 | 8222 | // Construct $out and $outarray |
8223 | - $out .= '<select id="' . $htmlname . '" class="flat' . ($morecss ? ' ' . $morecss : '') . '"' . ($disabled ? ' disabled="disabled"' : '') . ($moreparams ? ' ' . $moreparams : '') . ' name="' . $htmlname . '">' . "\n"; |
|
8223 | + $out .= '<select id="'.$htmlname.'" class="flat'.($morecss ? ' '.$morecss : '').'"'.($disabled ? ' disabled="disabled"' : '').($moreparams ? ' '.$moreparams : '').' name="'.$htmlname.'">'."\n"; |
|
8224 | 8224 | |
8225 | 8225 | // Warning: Do not use textifempty = ' ' or ' ' here, or search on key will search on ' key'. Seems it is no more true with selec2 v4 |
8226 | 8226 | $textifempty = ' '; |
@@ -8234,7 +8234,7 @@ discard block |
||
8234 | 8234 | } |
8235 | 8235 | } |
8236 | 8236 | if ($showempty) { |
8237 | - $out .= '<option value="-1">' . $textifempty . '</option>' . "\n"; |
|
8237 | + $out .= '<option value="-1">'.$textifempty.'</option>'."\n"; |
|
8238 | 8238 | } |
8239 | 8239 | |
8240 | 8240 | $num = $this->db->num_rows($resql); |
@@ -8257,9 +8257,9 @@ discard block |
||
8257 | 8257 | } |
8258 | 8258 | if (empty($outputmode)) { |
8259 | 8259 | if ($preselectedvalue > 0 && $preselectedvalue == $obj->rowid) { |
8260 | - $out .= '<option value="' . $obj->rowid . '" selected data-html="' . dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1) . '">' . dol_escape_htmltag($label, 0, 0, '', 0, 1) . '</option>'; |
|
8260 | + $out .= '<option value="'.$obj->rowid.'" selected data-html="'.dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1).'">'.dol_escape_htmltag($label, 0, 0, '', 0, 1).'</option>'; |
|
8261 | 8261 | } else { |
8262 | - $out .= '<option value="' . $obj->rowid . '" data-html="' . dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1) . '">' . dol_escape_htmltag($label, 0, 0, '', 0, 1) . '</option>'; |
|
8262 | + $out .= '<option value="'.$obj->rowid.'" data-html="'.dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1).'">'.dol_escape_htmltag($label, 0, 0, '', 0, 1).'</option>'; |
|
8263 | 8263 | } |
8264 | 8264 | } else { |
8265 | 8265 | array_push($outarray, array('key' => $obj->rowid, 'value' => $label, 'label' => $label)); |
@@ -8272,10 +8272,10 @@ discard block |
||
8272 | 8272 | } |
8273 | 8273 | } |
8274 | 8274 | |
8275 | - $out .= '</select>' . "\n"; |
|
8275 | + $out .= '</select>'."\n"; |
|
8276 | 8276 | |
8277 | 8277 | if (!$forcecombo) { |
8278 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
8278 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
8279 | 8279 | $out .= ajax_combobox($htmlname, null, (!empty($conf->global->$confkeyforautocompletemode) ? $conf->global->$confkeyforautocompletemode : 0)); |
8280 | 8280 | } |
8281 | 8281 | } else { |
@@ -8337,8 +8337,8 @@ discard block |
||
8337 | 8337 | } |
8338 | 8338 | } |
8339 | 8339 | $idname = str_replace(array('[', ']'), array('', ''), $htmlname); |
8340 | - $out .= '<select id="' . preg_replace('/^\./', '', $idname) . '" ' . ($disabled ? 'disabled="disabled" ' : '') . 'class="flat ' . (preg_replace('/^\./', '', $htmlname)) . ($morecss ? ' ' . $morecss : '') . ' selectformat"'; |
|
8341 | - $out .= ' name="' . preg_replace('/^\./', '', $htmlname) . '" ' . ($moreparam ? $moreparam : ''); |
|
8340 | + $out .= '<select id="'.preg_replace('/^\./', '', $idname).'" '.($disabled ? 'disabled="disabled" ' : '').'class="flat '.(preg_replace('/^\./', '', $htmlname)).($morecss ? ' '.$morecss : '').' selectformat"'; |
|
8341 | + $out .= ' name="'.preg_replace('/^\./', '', $htmlname).'" '.($moreparam ? $moreparam : ''); |
|
8342 | 8342 | $out .= '>'."\n"; |
8343 | 8343 | |
8344 | 8344 | if ($show_empty) { |
@@ -8349,7 +8349,7 @@ discard block |
||
8349 | 8349 | if (!is_numeric($show_empty)) { |
8350 | 8350 | $textforempty = $show_empty; |
8351 | 8351 | } |
8352 | - $out .= '<option class="optiongrey" ' . ($moreparamonempty ? $moreparamonempty . ' ' : '') . 'value="' . (((int) $show_empty) < 0 ? $show_empty : -1) . '"' . ($id == $show_empty ? ' selected' : '') . '>' . $textforempty . '</option>' . "\n"; |
|
8352 | + $out .= '<option class="optiongrey" '.($moreparamonempty ? $moreparamonempty.' ' : '').'value="'.(((int) $show_empty) < 0 ? $show_empty : -1).'"'.($id == $show_empty ? ' selected' : '').'>'.$textforempty.'</option>'."\n"; |
|
8353 | 8353 | } |
8354 | 8354 | if (is_array($array)) { |
8355 | 8355 | // Translate |
@@ -8372,7 +8372,7 @@ discard block |
||
8372 | 8372 | if (is_array($tmpvalue)) { |
8373 | 8373 | $value = $tmpvalue['label']; |
8374 | 8374 | $disabled = empty($tmpvalue['disabled']) ? '' : ' disabled'; |
8375 | - $style = empty($tmpvalue['css']) ? '' : ' class="' . $tmpvalue['css'] . '"'; |
|
8375 | + $style = empty($tmpvalue['css']) ? '' : ' class="'.$tmpvalue['css'].'"'; |
|
8376 | 8376 | } else { |
8377 | 8377 | $value = $tmpvalue; |
8378 | 8378 | $disabled = ''; |
@@ -8387,9 +8387,9 @@ discard block |
||
8387 | 8387 | } |
8388 | 8388 | if ($key_in_label) { |
8389 | 8389 | if (empty($nohtmlescape)) { |
8390 | - $selectOptionValue = dol_escape_htmltag($key . ' - ' . ($maxlen ? dol_trunc($value, $maxlen) : $value)); |
|
8390 | + $selectOptionValue = dol_escape_htmltag($key.' - '.($maxlen ? dol_trunc($value, $maxlen) : $value)); |
|
8391 | 8391 | } else { |
8392 | - $selectOptionValue = $key . ' - ' . ($maxlen ? dol_trunc($value, $maxlen) : $value); |
|
8392 | + $selectOptionValue = $key.' - '.($maxlen ? dol_trunc($value, $maxlen) : $value); |
|
8393 | 8393 | } |
8394 | 8394 | } else { |
8395 | 8395 | if (empty($nohtmlescape)) { |
@@ -8401,8 +8401,8 @@ discard block |
||
8401 | 8401 | $selectOptionValue = ' '; |
8402 | 8402 | } |
8403 | 8403 | } |
8404 | - $out .= '<option value="' . $key . '"'; |
|
8405 | - $out .= $style . $disabled; |
|
8404 | + $out .= '<option value="'.$key.'"'; |
|
8405 | + $out .= $style.$disabled; |
|
8406 | 8406 | if (is_array($id)) { |
8407 | 8407 | if (in_array($key, $id) && !$disabled) { |
8408 | 8408 | $out .= ' selected'; // To preselect a value |
@@ -8414,7 +8414,7 @@ discard block |
||
8414 | 8414 | } |
8415 | 8415 | } |
8416 | 8416 | if ($nohtmlescape) { |
8417 | - $out .= ' data-html="' . dol_escape_htmltag($selectOptionValue) . '"'; |
|
8417 | + $out .= ' data-html="'.dol_escape_htmltag($selectOptionValue).'"'; |
|
8418 | 8418 | } |
8419 | 8419 | if (is_array($tmpvalue)) { |
8420 | 8420 | foreach ($tmpvalue as $keyforvalue => $valueforvalue) { |
@@ -8432,7 +8432,7 @@ discard block |
||
8432 | 8432 | // Add code for jquery to use multiselect |
8433 | 8433 | if ($addjscombo && $jsbeautify) { |
8434 | 8434 | // Enhance with select2 |
8435 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
8435 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
8436 | 8436 | $out .= ajax_combobox($idname, array(), 0, 0, 'resolve', (((int) $show_empty) < 0 ? (string) $show_empty : '-1'), $morecss); |
8437 | 8437 | } |
8438 | 8438 | |
@@ -8464,28 +8464,28 @@ discard block |
||
8464 | 8464 | public static function selectArrayAjax($htmlname, $url, $id = '', $moreparam = '', $moreparamtourl = '', $disabled = 0, $minimumInputLength = 1, $morecss = '', $callurlonselect = 0, $placeholder = '', $acceptdelayedhtml = 0) |
8465 | 8465 | { |
8466 | 8466 | global $conf, $langs; |
8467 | - global $delayedhtmlcontent; // Will be used later outside of this function |
|
8467 | + global $delayedhtmlcontent; // Will be used later outside of this function |
|
8468 | 8468 | |
8469 | 8469 | // TODO Use an internal dolibarr component instead of select2 |
8470 | 8470 | if (empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) && !defined('REQUIRE_JQUERY_MULTISELECT')) { |
8471 | 8471 | return ''; |
8472 | 8472 | } |
8473 | 8473 | |
8474 | - $out = '<select type="text" class="' . $htmlname . ($morecss ? ' ' . $morecss : '') . '" ' . ($moreparam ? $moreparam . ' ' : '') . 'name="' . $htmlname . '"></select>'; |
|
8474 | + $out = '<select type="text" class="'.$htmlname.($morecss ? ' '.$morecss : '').'" '.($moreparam ? $moreparam.' ' : '').'name="'.$htmlname.'"></select>'; |
|
8475 | 8475 | |
8476 | 8476 | $outdelayed = ''; |
8477 | 8477 | if (!empty($conf->use_javascript_ajax)) { |
8478 | 8478 | $tmpplugin = 'select2'; |
8479 | - $outdelayed = "\n" . '<!-- JS CODE TO ENABLE ' . $tmpplugin . ' for id ' . $htmlname . ' --> |
|
8480 | - <script nonce="' . getNonce() . '"> |
|
8479 | + $outdelayed = "\n".'<!-- JS CODE TO ENABLE '.$tmpplugin.' for id '.$htmlname.' --> |
|
8480 | + <script nonce="' . getNonce().'"> |
|
8481 | 8481 | $(document).ready(function () { |
8482 | 8482 | |
8483 | - ' . ($callurlonselect ? 'var saveRemoteData = [];' : '') . ' |
|
8483 | + ' . ($callurlonselect ? 'var saveRemoteData = [];' : '').' |
|
8484 | 8484 | |
8485 | - $(".' . $htmlname . '").select2({ |
|
8485 | + $(".' . $htmlname.'").select2({ |
|
8486 | 8486 | ajax: { |
8487 | 8487 | dir: "ltr", |
8488 | - url: "' . $url . '", |
|
8488 | + url: "' . $url.'", |
|
8489 | 8489 | dataType: \'json\', |
8490 | 8490 | delay: 250, |
8491 | 8491 | data: function (params) { |
@@ -8512,9 +8512,9 @@ discard block |
||
8512 | 8512 | }, |
8513 | 8513 | language: select2arrayoflanguage, |
8514 | 8514 | containerCssClass: \':all:\', /* Line to add class of origin SELECT propagated to the new <span class="select2-selection...> tag */ |
8515 | - placeholder: "' . dol_escape_js($placeholder) . '", |
|
8515 | + placeholder: "' . dol_escape_js($placeholder).'", |
|
8516 | 8516 | escapeMarkup: function (markup) { return markup; }, // let our custom formatter work |
8517 | - minimumInputLength: ' . ((int) $minimumInputLength) . ', |
|
8517 | + minimumInputLength: ' . ((int) $minimumInputLength).', |
|
8518 | 8518 | formatResult: function (result, container, query, escapeMarkup) { |
8519 | 8519 | return escapeMarkup(result.text); |
8520 | 8520 | }, |
@@ -8522,10 +8522,10 @@ discard block |
||
8522 | 8522 | |
8523 | 8523 | ' . ($callurlonselect ? ' |
8524 | 8524 | /* Code to execute a GET when we select a value */ |
8525 | - $(".' . $htmlname . '").change(function() { |
|
8526 | - var selected = $(".' . $htmlname . '").val(); |
|
8525 | + $(".' . $htmlname.'").change(function() { |
|
8526 | + var selected = $(".' . $htmlname.'").val(); |
|
8527 | 8527 | console.log("We select in selectArrayAjax the entry "+selected) |
8528 | - $(".' . $htmlname . '").val(""); /* reset visible combo value */ |
|
8528 | + $(".' . $htmlname.'").val(""); /* reset visible combo value */ |
|
8529 | 8529 | $.each( saveRemoteData, function( key, value ) { |
8530 | 8530 | if (key == selected) |
8531 | 8531 | { |
@@ -8533,7 +8533,7 @@ discard block |
||
8533 | 8533 | location.assign(value.url); |
8534 | 8534 | } |
8535 | 8535 | }); |
8536 | - });' : '') . ' |
|
8536 | + });' : '').' |
|
8537 | 8537 | |
8538 | 8538 | }); |
8539 | 8539 | </script>'; |
@@ -8569,14 +8569,14 @@ discard block |
||
8569 | 8569 | public static function selectArrayFilter($htmlname, $array, $id = '', $moreparam = '', $disableFiltering = 0, $disabled = 0, $minimumInputLength = 1, $morecss = '', $callurlonselect = 0, $placeholder = '', $acceptdelayedhtml = 0, $textfortitle = '') |
8570 | 8570 | { |
8571 | 8571 | global $conf, $langs; |
8572 | - global $delayedhtmlcontent; // Will be used later outside of this function |
|
8572 | + global $delayedhtmlcontent; // Will be used later outside of this function |
|
8573 | 8573 | |
8574 | 8574 | // TODO Use an internal dolibarr component instead of select2 |
8575 | 8575 | if (empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) && !defined('REQUIRE_JQUERY_MULTISELECT')) { |
8576 | 8576 | return ''; |
8577 | 8577 | } |
8578 | 8578 | |
8579 | - $out = '<select type="text"'.($textfortitle? ' title="'.dol_escape_htmltag($textfortitle).'"' : '').' id="'.$htmlname.'" class="'.$htmlname.($morecss ? ' ' . $morecss : '').'"'.($moreparam ? ' '.$moreparam : '').' name="'.$htmlname.'"><option></option></select>'; |
|
8579 | + $out = '<select type="text"'.($textfortitle ? ' title="'.dol_escape_htmltag($textfortitle).'"' : '').' id="'.$htmlname.'" class="'.$htmlname.($morecss ? ' '.$morecss : '').'"'.($moreparam ? ' '.$moreparam : '').' name="'.$htmlname.'"><option></option></select>'; |
|
8580 | 8580 | |
8581 | 8581 | $formattedarrayresult = array(); |
8582 | 8582 | |
@@ -8591,20 +8591,20 @@ discard block |
||
8591 | 8591 | $outdelayed = ''; |
8592 | 8592 | if (!empty($conf->use_javascript_ajax)) { |
8593 | 8593 | $tmpplugin = 'select2'; |
8594 | - $outdelayed = "\n" . '<!-- JS CODE TO ENABLE ' . $tmpplugin . ' for id ' . $htmlname . ' --> |
|
8595 | - <script nonce="' . getNonce() . '"> |
|
8594 | + $outdelayed = "\n".'<!-- JS CODE TO ENABLE '.$tmpplugin.' for id '.$htmlname.' --> |
|
8595 | + <script nonce="' . getNonce().'"> |
|
8596 | 8596 | $(document).ready(function () { |
8597 | - var data = ' . json_encode($formattedarrayresult) . '; |
|
8597 | + var data = ' . json_encode($formattedarrayresult).'; |
|
8598 | 8598 | |
8599 | - ' . ($callurlonselect ? 'var saveRemoteData = ' . json_encode($array) . ';' : '') . ' |
|
8599 | + ' . ($callurlonselect ? 'var saveRemoteData = '.json_encode($array).';' : '').' |
|
8600 | 8600 | |
8601 | - $(".' . $htmlname . '").select2({ |
|
8601 | + $(".' . $htmlname.'").select2({ |
|
8602 | 8602 | data: data, |
8603 | 8603 | language: select2arrayoflanguage, |
8604 | 8604 | containerCssClass: \':all:\', /* Line to add class of origin SELECT propagated to the new <span class="select2-selection...> tag */ |
8605 | - placeholder: "' . dol_escape_js($placeholder) . '", |
|
8605 | + placeholder: "' . dol_escape_js($placeholder).'", |
|
8606 | 8606 | escapeMarkup: function (markup) { return markup; }, // let our custom formatter work |
8607 | - minimumInputLength: ' . $minimumInputLength . ', |
|
8607 | + minimumInputLength: ' . $minimumInputLength.', |
|
8608 | 8608 | formatResult: function (result, container, query, escapeMarkup) { |
8609 | 8609 | return escapeMarkup(result.text); |
8610 | 8610 | }, |
@@ -8643,11 +8643,11 @@ discard block |
||
8643 | 8643 | |
8644 | 8644 | ' . ($callurlonselect ? ' |
8645 | 8645 | /* Code to execute a GET when we select a value */ |
8646 | - $(".' . $htmlname . '").change(function() { |
|
8647 | - var selected = $(".' . $htmlname . '").val(); |
|
8646 | + $(".' . $htmlname.'").change(function() { |
|
8647 | + var selected = $(".' . $htmlname.'").val(); |
|
8648 | 8648 | console.log("We select "+selected) |
8649 | 8649 | |
8650 | - $(".' . $htmlname . '").val(""); /* reset visible combo value */ |
|
8650 | + $(".' . $htmlname.'").val(""); /* reset visible combo value */ |
|
8651 | 8651 | $.each( saveRemoteData, function( key, value ) { |
8652 | 8652 | if (key == selected) |
8653 | 8653 | { |
@@ -8655,7 +8655,7 @@ discard block |
||
8655 | 8655 | location.assign(value.url); |
8656 | 8656 | } |
8657 | 8657 | }); |
8658 | - });' : '') . ' |
|
8658 | + });' : '').' |
|
8659 | 8659 | |
8660 | 8660 | }); |
8661 | 8661 | </script>'; |
@@ -8707,7 +8707,7 @@ discard block |
||
8707 | 8707 | } |
8708 | 8708 | |
8709 | 8709 | // Output select component |
8710 | - $out .= '<select id="' . $htmlname . '" class="multiselect' . ($useenhancedmultiselect ? ' multiselectononeline' : '') . ($morecss ? ' ' . $morecss : '') . '" multiple name="' . $htmlname . '[]"' . ($moreattrib ? ' ' . $moreattrib : '') . ($width ? ' style="width: ' . (preg_match('/%/', $width) ? $width : $width . 'px') . '"' : '') . '>' . "\n"; |
|
8710 | + $out .= '<select id="'.$htmlname.'" class="multiselect'.($useenhancedmultiselect ? ' multiselectononeline' : '').($morecss ? ' '.$morecss : '').'" multiple name="'.$htmlname.'[]"'.($moreattrib ? ' '.$moreattrib : '').($width ? ' style="width: '.(preg_match('/%/', $width) ? $width : $width.'px').'"' : '').'>'."\n"; |
|
8711 | 8711 | if (is_array($array) && !empty($array)) { |
8712 | 8712 | if ($value_as_key) { |
8713 | 8713 | $array = array_combine($array, $array); |
@@ -8728,57 +8728,57 @@ discard block |
||
8728 | 8728 | $tmplabelhtml = !empty($value['labelhtml']) ? $value['labelhtml'] : ''; |
8729 | 8729 | } |
8730 | 8730 | $newval = ($translate ? $langs->trans($tmpvalue) : $tmpvalue); |
8731 | - $newval = ($key_in_label ? $tmpkey . ' - ' . $newval : $newval); |
|
8731 | + $newval = ($key_in_label ? $tmpkey.' - '.$newval : $newval); |
|
8732 | 8732 | |
8733 | - $out .= '<option value="' . $tmpkey . '"'; |
|
8733 | + $out .= '<option value="'.$tmpkey.'"'; |
|
8734 | 8734 | if (is_array($selected) && !empty($selected) && in_array((string) $tmpkey, $selected) && ((string) $tmpkey != '')) { |
8735 | 8735 | $out .= ' selected'; |
8736 | 8736 | } |
8737 | 8737 | if (!empty($tmplabelhtml)) { |
8738 | - $out .= ' data-html="' . dol_escape_htmltag($tmplabelhtml, 0, 0, '', 0, 1) . '"'; |
|
8738 | + $out .= ' data-html="'.dol_escape_htmltag($tmplabelhtml, 0, 0, '', 0, 1).'"'; |
|
8739 | 8739 | } else { |
8740 | - $tmplabelhtml = ($tmppicto ? img_picto('', $tmppicto, 'class="pictofixedwidth" style="color: #' . $tmpcolor . '"') : '') . $newval; |
|
8741 | - $out .= ' data-html="' . dol_escape_htmltag($tmplabelhtml, 0, 0, '', 0, 1) . '"'; |
|
8740 | + $tmplabelhtml = ($tmppicto ? img_picto('', $tmppicto, 'class="pictofixedwidth" style="color: #'.$tmpcolor.'"') : '').$newval; |
|
8741 | + $out .= ' data-html="'.dol_escape_htmltag($tmplabelhtml, 0, 0, '', 0, 1).'"'; |
|
8742 | 8742 | } |
8743 | 8743 | $out .= '>'; |
8744 | 8744 | $out .= dol_htmlentitiesbr($newval); |
8745 | - $out .= '</option>' . "\n"; |
|
8745 | + $out .= '</option>'."\n"; |
|
8746 | 8746 | } |
8747 | 8747 | } |
8748 | 8748 | } |
8749 | - $out .= '</select>' . "\n"; |
|
8749 | + $out .= '</select>'."\n"; |
|
8750 | 8750 | |
8751 | 8751 | // Add code for jquery to use multiselect |
8752 | 8752 | if (!empty($conf->use_javascript_ajax) && !empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) || defined('REQUIRE_JQUERY_MULTISELECT')) { |
8753 | - $out .= "\n" . '<!-- JS CODE TO ENABLE select for id ' . $htmlname . ', addjscombo=' . $addjscombo . ' -->'; |
|
8754 | - $out .= "\n" . '<script nonce="' . getNonce() . '">' . "\n"; |
|
8753 | + $out .= "\n".'<!-- JS CODE TO ENABLE select for id '.$htmlname.', addjscombo='.$addjscombo.' -->'; |
|
8754 | + $out .= "\n".'<script nonce="'.getNonce().'">'."\n"; |
|
8755 | 8755 | if ($addjscombo == 1) { |
8756 | 8756 | $tmpplugin = empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) ? constant('REQUIRE_JQUERY_MULTISELECT') : $conf->global->MAIN_USE_JQUERY_MULTISELECT; |
8757 | - $out .= 'function formatResult(record, container) {' . "\n"; |
|
8757 | + $out .= 'function formatResult(record, container) {'."\n"; |
|
8758 | 8758 | // If property html set, we decode html entities and use this. |
8759 | 8759 | // Note that HTML content must have been sanitized from js with dol_escape_htmltag(xxx, 0, 0, '', 0, 1) when building the select option. |
8760 | 8760 | $out .= ' if ($(record.element).attr("data-html") != undefined) { return htmlEntityDecodeJs($(record.element).attr("data-html")); }'."\n"; |
8761 | 8761 | $out .= ' return record.text;'; |
8762 | - $out .= '}' . "\n"; |
|
8763 | - $out .= 'function formatSelection(record) {' . "\n"; |
|
8762 | + $out .= '}'."\n"; |
|
8763 | + $out .= 'function formatSelection(record) {'."\n"; |
|
8764 | 8764 | if ($elemtype == 'category') { |
8765 | - $out .= 'return \'<span><img src="' . DOL_URL_ROOT . '/theme/eldy/img/object_category.png"> \'+record.text+\'</span>\';'; |
|
8765 | + $out .= 'return \'<span><img src="'.DOL_URL_ROOT.'/theme/eldy/img/object_category.png"> \'+record.text+\'</span>\';'; |
|
8766 | 8766 | } else { |
8767 | 8767 | $out .= 'return record.text;'; |
8768 | 8768 | } |
8769 | - $out .= '}' . "\n"; |
|
8769 | + $out .= '}'."\n"; |
|
8770 | 8770 | $out .= '$(document).ready(function () { |
8771 | - $(\'#' . $htmlname . '\').' . $tmpplugin . '({'; |
|
8771 | + $(\'#' . $htmlname.'\').'.$tmpplugin.'({'; |
|
8772 | 8772 | if ($placeholder) { |
8773 | 8773 | $out .= ' |
8774 | 8774 | placeholder: { |
8775 | 8775 | id: \'-1\', |
8776 | - text: \'' . dol_escape_js($placeholder) . '\' |
|
8776 | + text: \'' . dol_escape_js($placeholder).'\' |
|
8777 | 8777 | },'; |
8778 | 8778 | } |
8779 | 8779 | $out .= ' dir: \'ltr\', |
8780 | 8780 | containerCssClass: \':all:\', /* Line to add class of origin SELECT propagated to the new <span class="select2-selection...> tag (ko with multiselect) */ |
8781 | - dropdownCssClass: \'' . $morecss . '\', /* Line to add class on the new <span class="select2-selection...> tag (ok with multiselect) */ |
|
8781 | + dropdownCssClass: \'' . $morecss.'\', /* Line to add class on the new <span class="select2-selection...> tag (ok with multiselect) */ |
|
8782 | 8782 | // Specify format function for dropdown item |
8783 | 8783 | formatResult: formatResult, |
8784 | 8784 | templateResult: formatResult, /* For 4.0 */ |
@@ -8790,21 +8790,21 @@ discard block |
||
8790 | 8790 | |
8791 | 8791 | /* Add also morecss to the css .select2 that is after the #htmlname, for component that are show dynamically after load, because select2 set |
8792 | 8792 | the size only if component is not hidden by default on load */ |
8793 | - $(\'#' . $htmlname . ' + .select2\').addClass(\'' . $morecss . '\'); |
|
8793 | + $(\'#' . $htmlname.' + .select2\').addClass(\''.$morecss.'\'); |
|
8794 | 8794 | });' . "\n"; |
8795 | 8795 | } elseif ($addjscombo == 2 && !defined('DISABLE_MULTISELECT')) { |
8796 | 8796 | // Add other js lib |
8797 | 8797 | // TODO external lib multiselect/jquery.multi-select.js must have been loaded to use this multiselect plugin |
8798 | 8798 | // ... |
8799 | - $out .= 'console.log(\'addjscombo=2 for htmlname=' . $htmlname . '\');'; |
|
8799 | + $out .= 'console.log(\'addjscombo=2 for htmlname='.$htmlname.'\');'; |
|
8800 | 8800 | $out .= '$(document).ready(function () { |
8801 | - $(\'#' . $htmlname . '\').multiSelect({ |
|
8801 | + $(\'#' . $htmlname.'\').multiSelect({ |
|
8802 | 8802 | containerHTML: \'<div class="multi-select-container">\', |
8803 | 8803 | menuHTML: \'<div class="multi-select-menu">\', |
8804 | - buttonHTML: \'<span class="multi-select-button ' . $morecss . '">\', |
|
8804 | + buttonHTML: \'<span class="multi-select-button ' . $morecss.'">\', |
|
8805 | 8805 | menuItemHTML: \'<label class="multi-select-menuitem">\', |
8806 | 8806 | activeClass: \'multi-select-container--open\', |
8807 | - noneText: \'' . $placeholder . '\' |
|
8807 | + noneText: \'' . $placeholder.'\' |
|
8808 | 8808 | }); |
8809 | 8809 | })'; |
8810 | 8810 | } |
@@ -8836,7 +8836,7 @@ discard block |
||
8836 | 8836 | return ''; |
8837 | 8837 | } |
8838 | 8838 | |
8839 | - $tmpvar = "MAIN_SELECTEDFIELDS_" . $varpage; // To get list of saved selected fields to show |
|
8839 | + $tmpvar = "MAIN_SELECTEDFIELDS_".$varpage; // To get list of saved selected fields to show |
|
8840 | 8840 | |
8841 | 8841 | if (!empty($user->conf->$tmpvar)) { // A list of fields was already customized for user |
8842 | 8842 | $tmparray = explode(',', $user->conf->$tmpvar); |
@@ -8879,19 +8879,19 @@ discard block |
||
8879 | 8879 | } |
8880 | 8880 | |
8881 | 8881 | // Note: $val['checked'] <> 0 means we must show the field into the combo list |
8882 | - $listoffieldsforselection .= '<li><input type="checkbox" id="checkbox' . $key . '" value="' . $key . '"' . ((empty($val['checked']) || $val['checked'] == '-1') ? '' : ' checked="checked"') . '/><label for="checkbox' . $key . '">' . dol_escape_htmltag($langs->trans($val['label'])) . '</label></li>'; |
|
8883 | - $listcheckedstring .= (empty($val['checked']) ? '' : $key . ','); |
|
8882 | + $listoffieldsforselection .= '<li><input type="checkbox" id="checkbox'.$key.'" value="'.$key.'"'.((empty($val['checked']) || $val['checked'] == '-1') ? '' : ' checked="checked"').'/><label for="checkbox'.$key.'">'.dol_escape_htmltag($langs->trans($val['label'])).'</label></li>'; |
|
8883 | + $listcheckedstring .= (empty($val['checked']) ? '' : $key.','); |
|
8884 | 8884 | } |
8885 | 8885 | } |
8886 | 8886 | |
8887 | - $out = '<!-- Component multiSelectArrayWithCheckbox ' . $htmlname . ' --> |
|
8887 | + $out = '<!-- Component multiSelectArrayWithCheckbox '.$htmlname.' --> |
|
8888 | 8888 | |
8889 | 8889 | <dl class="dropdown"> |
8890 | 8890 | <dt> |
8891 | - <a href="#' . $htmlname . '"> |
|
8892 | - ' . img_picto('', 'list') . ' |
|
8891 | + <a href="#' . $htmlname.'"> |
|
8892 | + ' . img_picto('', 'list').' |
|
8893 | 8893 | </a> |
8894 | - <input type="hidden" class="' . $htmlname . '" name="' . $htmlname . '" value="' . $listcheckedstring . '"> |
|
8894 | + <input type="hidden" class="' . $htmlname.'" name="'.$htmlname.'" value="'.$listcheckedstring.'"> |
|
8895 | 8895 | </dt> |
8896 | 8896 | <dd class="dropdowndd"> |
8897 | 8897 | <div class="multiselectcheckbox'.$htmlname.'"> |
@@ -8903,19 +8903,19 @@ discard block |
||
8903 | 8903 | </dd> |
8904 | 8904 | </dl> |
8905 | 8905 | |
8906 | - <script nonce="' . getNonce() . '" type="text/javascript"> |
|
8906 | + <script nonce="' . getNonce().'" type="text/javascript"> |
|
8907 | 8907 | jQuery(document).ready(function () { |
8908 | - $(\'.multiselectcheckbox' . $htmlname . ' input[type="checkbox"]\').on(\'click\', function () { |
|
8908 | + $(\'.multiselectcheckbox' . $htmlname.' input[type="checkbox"]\').on(\'click\', function () { |
|
8909 | 8909 | console.log("A new field was added/removed, we edit field input[name=formfilteraction]"); |
8910 | 8910 | |
8911 | 8911 | $("input:hidden[name=formfilteraction]").val(\'listafterchangingselectedfields\'); // Update field so we know we changed something on selected fields after POST |
8912 | 8912 | |
8913 | 8913 | var title = $(this).val() + ","; |
8914 | 8914 | if ($(this).is(\':checked\')) { |
8915 | - $(\'.' . $htmlname . '\').val(title + $(\'.' . $htmlname . '\').val()); |
|
8915 | + $(\'.' . $htmlname.'\').val(title + $(\'.'.$htmlname.'\').val()); |
|
8916 | 8916 | } |
8917 | 8917 | else { |
8918 | - $(\'.' . $htmlname . '\').val( $(\'.' . $htmlname . '\').val().replace(title, \'\') ) |
|
8918 | + $(\'.' . $htmlname.'\').val( $(\'.'.$htmlname.'\').val().replace(title, \'\') ) |
|
8919 | 8919 | } |
8920 | 8920 | // Now, we submit page |
8921 | 8921 | //$(this).parents(\'form:first\').submit(); |
@@ -8946,7 +8946,7 @@ discard block |
||
8946 | 8946 | */ |
8947 | 8947 | public function showCategories($id, $type, $rendermode = 0, $nolink = 0) |
8948 | 8948 | { |
8949 | - include_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; |
|
8949 | + include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; |
|
8950 | 8950 | |
8951 | 8951 | $cat = new Categorie($this->db); |
8952 | 8952 | $categories = $cat->containing($id, $type); |
@@ -8956,10 +8956,10 @@ discard block |
||
8956 | 8956 | foreach ($categories as $c) { |
8957 | 8957 | $ways = $c->print_all_ways(' >> ', ($nolink ? 'none' : ''), 0, 1); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formated text |
8958 | 8958 | foreach ($ways as $way) { |
8959 | - $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #bbb"') . '>' . $way . '</li>'; |
|
8959 | + $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ? ' style="background: #'.$c->color.';"' : ' style="background: #bbb"').'>'.$way.'</li>'; |
|
8960 | 8960 | } |
8961 | 8961 | } |
8962 | - return '<div class="select2-container-multi-dolibarr"><ul class="select2-choices-dolibarr">' . implode(' ', $toprint) . '</ul></div>'; |
|
8962 | + return '<div class="select2-container-multi-dolibarr"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>'; |
|
8963 | 8963 | } |
8964 | 8964 | |
8965 | 8965 | if ($rendermode == 0) { |
@@ -9007,15 +9007,15 @@ discard block |
||
9007 | 9007 | |
9008 | 9008 | |
9009 | 9009 | print '<div class="div-table-responsive-no-min">'; |
9010 | - print '<table class="noborder allwidth" data-block="showLinkedObject" data-element="' . $object->element . '" data-elementid="' . $object->id . '" >'; |
|
9010 | + print '<table class="noborder allwidth" data-block="showLinkedObject" data-element="'.$object->element.'" data-elementid="'.$object->id.'" >'; |
|
9011 | 9011 | |
9012 | 9012 | print '<tr class="liste_titre">'; |
9013 | - print '<td>' . $langs->trans("Type") . '</td>'; |
|
9014 | - print '<td>' . $langs->trans("Ref") . '</td>'; |
|
9013 | + print '<td>'.$langs->trans("Type").'</td>'; |
|
9014 | + print '<td>'.$langs->trans("Ref").'</td>'; |
|
9015 | 9015 | print '<td class="center"></td>'; |
9016 | - print '<td class="center">' . $langs->trans("Date") . '</td>'; |
|
9017 | - print '<td class="right">' . $langs->trans("AmountHTShort") . '</td>'; |
|
9018 | - print '<td class="right">' . $langs->trans("Status") . '</td>'; |
|
9016 | + print '<td class="center">'.$langs->trans("Date").'</td>'; |
|
9017 | + print '<td class="right">'.$langs->trans("AmountHTShort").'</td>'; |
|
9018 | + print '<td class="right">'.$langs->trans("Status").'</td>'; |
|
9019 | 9019 | print '<td></td>'; |
9020 | 9020 | print '</tr>'; |
9021 | 9021 | |
@@ -9034,13 +9034,13 @@ discard block |
||
9034 | 9034 | if ($objecttype != 'supplier_proposal' && preg_match('/^([^_]+)_([^_]+)/i', $objecttype, $regs)) { |
9035 | 9035 | $element = $regs[1]; |
9036 | 9036 | $subelement = $regs[2]; |
9037 | - $tplpath = $element . '/' . $subelement; |
|
9037 | + $tplpath = $element.'/'.$subelement; |
|
9038 | 9038 | } |
9039 | 9039 | $tplname = 'linkedobjectblock'; |
9040 | 9040 | |
9041 | 9041 | // To work with non standard path |
9042 | 9042 | if ($objecttype == 'facture') { |
9043 | - $tplpath = 'compta/' . $element; |
|
9043 | + $tplpath = 'compta/'.$element; |
|
9044 | 9044 | if (!isModEnabled('facture')) { |
9045 | 9045 | continue; // Do not show if module disabled |
9046 | 9046 | } |
@@ -9051,7 +9051,7 @@ discard block |
||
9051 | 9051 | continue; // Do not show if module disabled |
9052 | 9052 | } |
9053 | 9053 | } elseif ($objecttype == 'propal') { |
9054 | - $tplpath = 'comm/' . $element; |
|
9054 | + $tplpath = 'comm/'.$element; |
|
9055 | 9055 | if (!isModEnabled('propal')) { |
9056 | 9056 | continue; // Do not show if module disabled |
9057 | 9057 | } |
@@ -9102,14 +9102,14 @@ discard block |
||
9102 | 9102 | $linkedObjectBlock = $objects; |
9103 | 9103 | |
9104 | 9104 | // Output template part (modules that overwrite templates must declare this into descriptor) |
9105 | - $dirtpls = array_merge($conf->modules_parts['tpl'], array('/' . $tplpath . '/tpl')); |
|
9105 | + $dirtpls = array_merge($conf->modules_parts['tpl'], array('/'.$tplpath.'/tpl')); |
|
9106 | 9106 | foreach ($dirtpls as $reldir) { |
9107 | 9107 | if ($nboftypesoutput == ($nbofdifferenttypes - 1)) { // No more type to show after |
9108 | 9108 | global $noMoreLinkedObjectBlockAfter; |
9109 | 9109 | $noMoreLinkedObjectBlockAfter = 1; |
9110 | 9110 | } |
9111 | 9111 | |
9112 | - $res = @include dol_buildpath($reldir . '/' . $tplname . '.tpl.php'); |
|
9112 | + $res = @include dol_buildpath($reldir.'/'.$tplname.'.tpl.php'); |
|
9113 | 9113 | if ($res) { |
9114 | 9114 | $nboftypesoutput++; |
9115 | 9115 | break; |
@@ -9118,7 +9118,7 @@ discard block |
||
9118 | 9118 | } |
9119 | 9119 | |
9120 | 9120 | if (!$nboftypesoutput) { |
9121 | - print '<tr><td class="impair" colspan="7"><span class="opacitymedium">' . $langs->trans("None") . '</span></td></tr>'; |
|
9121 | + print '<tr><td class="impair" colspan="7"><span class="opacitymedium">'.$langs->trans("None").'</span></td></tr>'; |
|
9122 | 9122 | } |
9123 | 9123 | |
9124 | 9124 | print '</table>'; |
@@ -9158,14 +9158,14 @@ discard block |
||
9158 | 9158 | if (is_object($object->thirdparty) && !empty($object->thirdparty->id) && $object->thirdparty->id > 0) { |
9159 | 9159 | $listofidcompanytoscan = $object->thirdparty->id; |
9160 | 9160 | if (($object->thirdparty->parent > 0) && !empty($conf->global->THIRDPARTY_INCLUDE_PARENT_IN_LINKTO)) { |
9161 | - $listofidcompanytoscan .= ',' . $object->thirdparty->parent; |
|
9161 | + $listofidcompanytoscan .= ','.$object->thirdparty->parent; |
|
9162 | 9162 | } |
9163 | 9163 | if (($object->fk_project > 0) && !empty($conf->global->THIRDPARTY_INCLUDE_PROJECT_THIRDPARY_IN_LINKTO)) { |
9164 | - include_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; |
|
9164 | + include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; |
|
9165 | 9165 | $tmpproject = new Project($this->db); |
9166 | 9166 | $tmpproject->fetch($object->fk_project); |
9167 | 9167 | if ($tmpproject->socid > 0 && ($tmpproject->socid != $object->thirdparty->id)) { |
9168 | - $listofidcompanytoscan .= ',' . $tmpproject->socid; |
|
9168 | + $listofidcompanytoscan .= ','.$tmpproject->socid; |
|
9169 | 9169 | } |
9170 | 9170 | unset($tmpproject); |
9171 | 9171 | } |
@@ -9175,63 +9175,63 @@ discard block |
||
9175 | 9175 | 'enabled' => isModEnabled('propal'), |
9176 | 9176 | 'perms' => 1, |
9177 | 9177 | 'label' => 'LinkToProposal', |
9178 | - 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "propal as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('propal') . ')'), |
|
9178 | + 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."propal as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('propal').')'), |
|
9179 | 9179 | 'shipping' => array( |
9180 | 9180 | 'enabled' => isModEnabled('expedition'), |
9181 | 9181 | 'perms' => 1, |
9182 | 9182 | 'label' => 'LinkToExpedition', |
9183 | - 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "expedition as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('shipping') . ')'), |
|
9183 | + 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."expedition as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('shipping').')'), |
|
9184 | 9184 | 'order' => array( |
9185 | 9185 | 'enabled' => isModEnabled('commande'), |
9186 | 9186 | 'perms' => 1, |
9187 | 9187 | 'label' => 'LinkToOrder', |
9188 | - 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "commande as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('commande') . ')'), |
|
9188 | + 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."commande as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('commande').')'), |
|
9189 | 9189 | 'invoice' => array( |
9190 | 9190 | 'enabled' => isModEnabled('facture'), |
9191 | 9191 | 'perms' => 1, |
9192 | 9192 | 'label' => 'LinkToInvoice', |
9193 | - 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "facture as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('invoice') . ')'), |
|
9193 | + 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."facture as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('invoice').')'), |
|
9194 | 9194 | 'invoice_template' => array( |
9195 | 9195 | 'enabled' => isModEnabled('facture'), |
9196 | 9196 | 'perms' => 1, |
9197 | 9197 | 'label' => 'LinkToTemplateInvoice', |
9198 | - 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.titre as ref, t.total_ht FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "facture_rec as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('invoice') . ')'), |
|
9198 | + 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.titre as ref, t.total_ht FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."facture_rec as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('invoice').')'), |
|
9199 | 9199 | 'contrat' => array( |
9200 | 9200 | 'enabled' => isModEnabled('contrat'), |
9201 | 9201 | 'perms' => 1, |
9202 | 9202 | 'label' => 'LinkToContract', |
9203 | 9203 | 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_customer as ref_client, t.ref_supplier, SUM(td.total_ht) as total_ht |
9204 | - FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "contrat as t, " . $this->db->prefix() . "contratdet as td WHERE t.fk_soc = s.rowid AND td.fk_contrat = t.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('contract') . ') GROUP BY s.rowid, s.nom, s.client, t.rowid, t.ref, t.ref_customer, t.ref_supplier' |
|
9204 | + FROM " . $this->db->prefix()."societe as s, ".$this->db->prefix()."contrat as t, ".$this->db->prefix()."contratdet as td WHERE t.fk_soc = s.rowid AND td.fk_contrat = t.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('contract').') GROUP BY s.rowid, s.nom, s.client, t.rowid, t.ref, t.ref_customer, t.ref_supplier' |
|
9205 | 9205 | ), |
9206 | 9206 | 'fichinter' => array( |
9207 | 9207 | 'enabled' => isModEnabled('ficheinter'), |
9208 | 9208 | 'perms' => 1, |
9209 | 9209 | 'label' => 'LinkToIntervention', |
9210 | - 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "fichinter as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('intervention') . ')'), |
|
9210 | + 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."fichinter as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('intervention').')'), |
|
9211 | 9211 | 'supplier_proposal' => array( |
9212 | 9212 | 'enabled' => (isModEnabled('supplier_proposal') ? $conf->supplier_proposal->enabled : 0), |
9213 | 9213 | 'perms' => 1, |
9214 | 9214 | 'label' => 'LinkToSupplierProposal', |
9215 | - 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, '' as ref_supplier, t.total_ht FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "supplier_proposal as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('supplier_proposal') . ')'), |
|
9215 | + 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, '' as ref_supplier, t.total_ht FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."supplier_proposal as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('supplier_proposal').')'), |
|
9216 | 9216 | 'order_supplier' => array( |
9217 | 9217 | 'enabled' => (isModEnabled("supplier_order") ? $conf->supplier_order->enabled : 0), |
9218 | 9218 | 'perms' => 1, |
9219 | 9219 | 'label' => 'LinkToSupplierOrder', |
9220 | - 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_supplier, t.total_ht FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "commande_fournisseur as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('commande_fournisseur') . ')'), |
|
9220 | + 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_supplier, t.total_ht FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."commande_fournisseur as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('commande_fournisseur').')'), |
|
9221 | 9221 | 'invoice_supplier' => array( |
9222 | 9222 | 'enabled' => (isModEnabled("supplier_invoice") ? $conf->supplier_invoice->enabled : 0), |
9223 | 9223 | 'perms' => 1, 'label' => 'LinkToSupplierInvoice', |
9224 | - 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_supplier, t.total_ht FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "facture_fourn as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('facture_fourn') . ')'), |
|
9224 | + 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_supplier, t.total_ht FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."facture_fourn as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('facture_fourn').')'), |
|
9225 | 9225 | 'ticket' => array( |
9226 | 9226 | 'enabled' => isModEnabled('ticket'), |
9227 | 9227 | 'perms' => 1, |
9228 | 9228 | 'label' => 'LinkToTicket', |
9229 | - 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.track_id, '0' as total_ht FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "ticket as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('ticket') . ')'), |
|
9229 | + 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.track_id, '0' as total_ht FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."ticket as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('ticket').')'), |
|
9230 | 9230 | 'mo' => array( |
9231 | 9231 | 'enabled' => isModEnabled('mrp'), |
9232 | 9232 | 'perms' => 1, |
9233 | 9233 | 'label' => 'LinkToMo', |
9234 | - 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.rowid, '0' as total_ht FROM " . $this->db->prefix() . "societe as s INNER JOIN " . $this->db->prefix() . "mrp_mo as t ON t.fk_soc = s.rowid WHERE t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('mo') . ')') |
|
9234 | + 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.rowid, '0' as total_ht FROM ".$this->db->prefix()."societe as s INNER JOIN ".$this->db->prefix()."mrp_mo as t ON t.fk_soc = s.rowid WHERE t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('mo').')') |
|
9235 | 9235 | ); |
9236 | 9236 | } |
9237 | 9237 | |
@@ -9266,22 +9266,22 @@ discard block |
||
9266 | 9266 | } |
9267 | 9267 | |
9268 | 9268 | if (!empty($possiblelink['perms']) && (empty($restrictlinksto) || in_array($key, $restrictlinksto)) && (empty($excludelinksto) || !in_array($key, $excludelinksto))) { |
9269 | - print '<div id="' . $key . 'list"' . (empty($conf->use_javascript_ajax) ? '' : ' style="display:none"') . '>'; |
|
9269 | + print '<div id="'.$key.'list"'.(empty($conf->use_javascript_ajax) ? '' : ' style="display:none"').'>'; |
|
9270 | 9270 | |
9271 | 9271 | if (!empty($conf->global->MAIN_LINK_BY_REF_IN_LINKTO)) { |
9272 | 9272 | print '<br>'."\n"; |
9273 | 9273 | print '<!-- form to add a link from anywhere -->'."\n"; |
9274 | - print '<form action="' . $_SERVER["PHP_SELF"] . '" method="POST" name="formlinkedbyref' . $key . '">'; |
|
9275 | - print '<input type="hidden" name="id" value="' . $object->id . '">'; |
|
9274 | + print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST" name="formlinkedbyref'.$key.'">'; |
|
9275 | + print '<input type="hidden" name="id" value="'.$object->id.'">'; |
|
9276 | 9276 | print '<input type="hidden" name="action" value="addlinkbyref">'; |
9277 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
9278 | - print '<input type="hidden" name="addlink" value="' . $key . '">'; |
|
9277 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
9278 | + print '<input type="hidden" name="addlink" value="'.$key.'">'; |
|
9279 | 9279 | print '<table class="noborder">'; |
9280 | 9280 | print '<tr>'; |
9281 | 9281 | //print '<td>' . $langs->trans("Ref") . '</td>'; |
9282 | - print '<td class="center"><input type="text" placeholder="'.dol_escape_htmltag($langs->trans("Ref")).'" name="reftolinkto" value="' . dol_escape_htmltag(GETPOST('reftolinkto', 'alpha')) . '"> '; |
|
9283 | - print '<input type="submit" class="button small valignmiddle" value="' . $langs->trans('ToLink') . '"> '; |
|
9284 | - print '<input type="submit" class="button small" name="cancel" value="' . $langs->trans('Cancel') . '"></td>'; |
|
9282 | + print '<td class="center"><input type="text" placeholder="'.dol_escape_htmltag($langs->trans("Ref")).'" name="reftolinkto" value="'.dol_escape_htmltag(GETPOST('reftolinkto', 'alpha')).'"> '; |
|
9283 | + print '<input type="submit" class="button small valignmiddle" value="'.$langs->trans('ToLink').'"> '; |
|
9284 | + print '<input type="submit" class="button small" name="cancel" value="'.$langs->trans('Cancel').'"></td>'; |
|
9285 | 9285 | print '</tr>'; |
9286 | 9286 | print '</table>'; |
9287 | 9287 | print '</form>'; |
@@ -9296,48 +9296,48 @@ discard block |
||
9296 | 9296 | |
9297 | 9297 | print '<br>'; |
9298 | 9298 | print '<!-- form to add a link from object to same thirdparty -->'."\n"; |
9299 | - print '<form action="' . $_SERVER["PHP_SELF"] . '" method="POST" name="formlinked' . $key . '">'; |
|
9299 | + print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST" name="formlinked'.$key.'">'; |
|
9300 | 9300 | print '<input type="hidden" name="action" value="addlink">'; |
9301 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
9302 | - print '<input type="hidden" name="id" value="' . $object->id . '">'; |
|
9303 | - print '<input type="hidden" name="addlink" value="' . $key . '">'; |
|
9301 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
9302 | + print '<input type="hidden" name="id" value="'.$object->id.'">'; |
|
9303 | + print '<input type="hidden" name="addlink" value="'.$key.'">'; |
|
9304 | 9304 | print '<table class="noborder">'; |
9305 | 9305 | print '<tr class="liste_titre">'; |
9306 | 9306 | print '<td class="nowrap"></td>'; |
9307 | - print '<td class="center">' . $langs->trans("Ref") . '</td>'; |
|
9308 | - print '<td class="left">' . $langs->trans("RefCustomer") . '</td>'; |
|
9309 | - print '<td class="right">' . $langs->trans("AmountHTShort") . '</td>'; |
|
9310 | - print '<td class="left">' . $langs->trans("Company") . '</td>'; |
|
9307 | + print '<td class="center">'.$langs->trans("Ref").'</td>'; |
|
9308 | + print '<td class="left">'.$langs->trans("RefCustomer").'</td>'; |
|
9309 | + print '<td class="right">'.$langs->trans("AmountHTShort").'</td>'; |
|
9310 | + print '<td class="left">'.$langs->trans("Company").'</td>'; |
|
9311 | 9311 | print '</tr>'; |
9312 | 9312 | while ($i < $num) { |
9313 | 9313 | $objp = $this->db->fetch_object($resqllist); |
9314 | 9314 | |
9315 | 9315 | print '<tr class="oddeven">'; |
9316 | 9316 | print '<td class="left">'; |
9317 | - print '<input type="radio" name="idtolinkto" id="' . $key . '_' . $objp->rowid . '" value="' . $objp->rowid . '">'; |
|
9317 | + print '<input type="radio" name="idtolinkto" id="'.$key.'_'.$objp->rowid.'" value="'.$objp->rowid.'">'; |
|
9318 | 9318 | print '</td>'; |
9319 | - print '<td class="center"><label for="' . $key . '_' . $objp->rowid . '">' . $objp->ref . '</label></td>'; |
|
9320 | - print '<td>' . (!empty($objp->ref_client) ? $objp->ref_client : (!empty($objp->ref_supplier) ? $objp->ref_supplier : '')) . '</td>'; |
|
9319 | + print '<td class="center"><label for="'.$key.'_'.$objp->rowid.'">'.$objp->ref.'</label></td>'; |
|
9320 | + print '<td>'.(!empty($objp->ref_client) ? $objp->ref_client : (!empty($objp->ref_supplier) ? $objp->ref_supplier : '')).'</td>'; |
|
9321 | 9321 | print '<td class="right">'; |
9322 | 9322 | if ($possiblelink['label'] == 'LinkToContract') { |
9323 | 9323 | $form = new Form($this->db); |
9324 | - print $form->textwithpicto('', $langs->trans("InformationOnLinkToContract")) . ' '; |
|
9324 | + print $form->textwithpicto('', $langs->trans("InformationOnLinkToContract")).' '; |
|
9325 | 9325 | } |
9326 | - print '<span class="amount">' . (isset($objp->total_ht) ? price($objp->total_ht) : '') . '</span>'; |
|
9326 | + print '<span class="amount">'.(isset($objp->total_ht) ? price($objp->total_ht) : '').'</span>'; |
|
9327 | 9327 | print '</td>'; |
9328 | - print '<td>' . $objp->name . '</td>'; |
|
9328 | + print '<td>'.$objp->name.'</td>'; |
|
9329 | 9329 | print '</tr>'; |
9330 | 9330 | $i++; |
9331 | 9331 | } |
9332 | 9332 | print '</table>'; |
9333 | 9333 | print '<div class="center">'; |
9334 | 9334 | if ($num) { |
9335 | - print '<input type="submit" class="button valignmiddle marginleftonly marginrightonly small" value="' . $langs->trans('ToLink') . '">'; |
|
9335 | + print '<input type="submit" class="button valignmiddle marginleftonly marginrightonly small" value="'.$langs->trans('ToLink').'">'; |
|
9336 | 9336 | } |
9337 | 9337 | if (empty($conf->use_javascript_ajax)) { |
9338 | - print '<input type="submit" class="button button-cancel marginleftonly marginrightonly small" name="cancel" value="' . $langs->trans("Cancel") . '"></div>'; |
|
9338 | + print '<input type="submit" class="button button-cancel marginleftonly marginrightonly small" name="cancel" value="'.$langs->trans("Cancel").'"></div>'; |
|
9339 | 9339 | } else { |
9340 | - print '<input type="submit" onclick="jQuery(\'#' . $key . 'list\').toggle(); return false;" class="button button-cancel marginleftonly marginrightonly small" name="cancel" value="' . $langs->trans("Cancel") . '"></div>'; |
|
9340 | + print '<input type="submit" onclick="jQuery(\'#'.$key.'list\').toggle(); return false;" class="button button-cancel marginleftonly marginrightonly small" name="cancel" value="'.$langs->trans("Cancel").'"></div>'; |
|
9341 | 9341 | } |
9342 | 9342 | print '</form>'; |
9343 | 9343 | $this->db->free($resqllist); |
@@ -9348,10 +9348,10 @@ discard block |
||
9348 | 9348 | |
9349 | 9349 | //$linktoelem.=($linktoelem?' ':''); |
9350 | 9350 | if ($num > 0 || !empty($conf->global->MAIN_LINK_BY_REF_IN_LINKTO)) { |
9351 | - $linktoelemlist .= '<li><a href="#linkto' . $key . '" class="linkto dropdowncloseonclick" rel="' . $key . '">' . $langs->trans($possiblelink['label']) . ' (' . $num . ')</a></li>'; |
|
9351 | + $linktoelemlist .= '<li><a href="#linkto'.$key.'" class="linkto dropdowncloseonclick" rel="'.$key.'">'.$langs->trans($possiblelink['label']).' ('.$num.')</a></li>'; |
|
9352 | 9352 | // } else $linktoelem.=$langs->trans($possiblelink['label']); |
9353 | 9353 | } else { |
9354 | - $linktoelemlist .= '<li><span class="linktodisabled">' . $langs->trans($possiblelink['label']) . ' (0)</span></li>'; |
|
9354 | + $linktoelemlist .= '<li><span class="linktodisabled">'.$langs->trans($possiblelink['label']).' (0)</span></li>'; |
|
9355 | 9355 | } |
9356 | 9356 | } |
9357 | 9357 | } |
@@ -9361,11 +9361,11 @@ discard block |
||
9361 | 9361 | <dl class="dropdown" id="linktoobjectname"> |
9362 | 9362 | '; |
9363 | 9363 | if (!empty($conf->use_javascript_ajax)) { |
9364 | - $linktoelem .= '<dt><a href="#linktoobjectname"><span class="fas fa-link paddingrightonly"></span>' . $langs->trans("LinkTo") . '...</a></dt>'; |
|
9364 | + $linktoelem .= '<dt><a href="#linktoobjectname"><span class="fas fa-link paddingrightonly"></span>'.$langs->trans("LinkTo").'...</a></dt>'; |
|
9365 | 9365 | } |
9366 | 9366 | $linktoelem .= '<dd> |
9367 | 9367 | <div class="multiselectlinkto"> |
9368 | - <ul class="ulselectedfields">' . $linktoelemlist . ' |
|
9368 | + <ul class="ulselectedfields">' . $linktoelemlist.' |
|
9369 | 9369 | </ul> |
9370 | 9370 | </div> |
9371 | 9371 | </dd> |
@@ -9376,7 +9376,7 @@ discard block |
||
9376 | 9376 | |
9377 | 9377 | if (!empty($conf->use_javascript_ajax)) { |
9378 | 9378 | print '<!-- Add js to show linkto box --> |
9379 | - <script nonce="' . getNonce() . '"> |
|
9379 | + <script nonce="' . getNonce().'"> |
|
9380 | 9380 | jQuery(document).ready(function() { |
9381 | 9381 | jQuery(".linkto").click(function() { |
9382 | 9382 | console.log("We choose to show/hide links for rel="+jQuery(this).attr(\'rel\')+" so #"+jQuery(this).attr(\'rel\')+"list"); |
@@ -9417,19 +9417,19 @@ discard block |
||
9417 | 9417 | |
9418 | 9418 | $disabled = ($disabled ? ' disabled' : ''); |
9419 | 9419 | |
9420 | - $resultyesno = '<select class="flat width75' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlname . '" name="' . $htmlname . '"' . $disabled . '>' . "\n"; |
|
9420 | + $resultyesno = '<select class="flat width75'.($morecss ? ' '.$morecss : '').'" id="'.$htmlname.'" name="'.$htmlname.'"'.$disabled.'>'."\n"; |
|
9421 | 9421 | if ($useempty) { |
9422 | - $resultyesno .= '<option value="-1"' . (($value < 0) ? ' selected' : '') . '> </option>' . "\n"; |
|
9422 | + $resultyesno .= '<option value="-1"'.(($value < 0) ? ' selected' : '').'> </option>'."\n"; |
|
9423 | 9423 | } |
9424 | 9424 | if (("$value" == 'yes') || ($value == 1)) { |
9425 | - $resultyesno .= '<option value="' . $yes . '" selected>' . $langs->trans($labelyes) . '</option>' . "\n"; |
|
9426 | - $resultyesno .= '<option value="' . $no . '">' . $langs->trans($labelno) . '</option>' . "\n"; |
|
9425 | + $resultyesno .= '<option value="'.$yes.'" selected>'.$langs->trans($labelyes).'</option>'."\n"; |
|
9426 | + $resultyesno .= '<option value="'.$no.'">'.$langs->trans($labelno).'</option>'."\n"; |
|
9427 | 9427 | } else { |
9428 | 9428 | $selected = (($useempty && $value != '0' && $value != 'no') ? '' : ' selected'); |
9429 | - $resultyesno .= '<option value="' . $yes . '">' . $langs->trans($labelyes) . '</option>' . "\n"; |
|
9430 | - $resultyesno .= '<option value="' . $no . '"' . $selected . '>' . $langs->trans($labelno) . '</option>' . "\n"; |
|
9429 | + $resultyesno .= '<option value="'.$yes.'">'.$langs->trans($labelyes).'</option>'."\n"; |
|
9430 | + $resultyesno .= '<option value="'.$no.'"'.$selected.'>'.$langs->trans($labelno).'</option>'."\n"; |
|
9431 | 9431 | } |
9432 | - $resultyesno .= '</select>' . "\n"; |
|
9432 | + $resultyesno .= '</select>'."\n"; |
|
9433 | 9433 | |
9434 | 9434 | if ($addjscombo) { |
9435 | 9435 | $resultyesno .= ajax_combobox($htmlname, array(), 0, 0, 'resolve', ($useempty < 0 ? (string) $useempty : '-1'), $morecss); |
@@ -9453,12 +9453,12 @@ discard block |
||
9453 | 9453 | { |
9454 | 9454 | // phpcs:enable |
9455 | 9455 | $sql = "SELECT rowid, label"; |
9456 | - $sql .= " FROM " . $this->db->prefix() . "export_model"; |
|
9457 | - $sql .= " WHERE type = '" . $this->db->escape($type) . "'"; |
|
9456 | + $sql .= " FROM ".$this->db->prefix()."export_model"; |
|
9457 | + $sql .= " WHERE type = '".$this->db->escape($type)."'"; |
|
9458 | 9458 | $sql .= " ORDER BY rowid"; |
9459 | 9459 | $result = $this->db->query($sql); |
9460 | 9460 | if ($result) { |
9461 | - print '<select class="flat" id="select_' . $htmlname . '" name="' . $htmlname . '">'; |
|
9461 | + print '<select class="flat" id="select_'.$htmlname.'" name="'.$htmlname.'">'; |
|
9462 | 9462 | if ($useempty) { |
9463 | 9463 | print '<option value="-1"> </option>'; |
9464 | 9464 | } |
@@ -9468,9 +9468,9 @@ discard block |
||
9468 | 9468 | while ($i < $num) { |
9469 | 9469 | $obj = $this->db->fetch_object($result); |
9470 | 9470 | if ($selected == $obj->rowid) { |
9471 | - print '<option value="' . $obj->rowid . '" selected>'; |
|
9471 | + print '<option value="'.$obj->rowid.'" selected>'; |
|
9472 | 9472 | } else { |
9473 | - print '<option value="' . $obj->rowid . '">'; |
|
9473 | + print '<option value="'.$obj->rowid.'">'; |
|
9474 | 9474 | } |
9475 | 9475 | print $obj->label; |
9476 | 9476 | print '</option>'; |
@@ -9560,8 +9560,8 @@ discard block |
||
9560 | 9560 | $stringforfirstkey .= ' CTL +'; |
9561 | 9561 | } |
9562 | 9562 | |
9563 | - $previous_ref = $object->ref_previous ? '<a accesskey="p" title="' . $stringforfirstkey . ' p" class="classfortooltip" href="' . $navurl . '?' . $paramid . '=' . urlencode($object->ref_previous) . $moreparam . '"><i class="fa fa-chevron-left"></i></a>' : '<span class="inactive"><i class="fa fa-chevron-left opacitymedium"></i></span>'; |
|
9564 | - $next_ref = $object->ref_next ? '<a accesskey="n" title="' . $stringforfirstkey . ' n" class="classfortooltip" href="' . $navurl . '?' . $paramid . '=' . urlencode($object->ref_next) . $moreparam . '"><i class="fa fa-chevron-right"></i></a>' : '<span class="inactive"><i class="fa fa-chevron-right opacitymedium"></i></span>'; |
|
9563 | + $previous_ref = $object->ref_previous ? '<a accesskey="p" title="'.$stringforfirstkey.' p" class="classfortooltip" href="'.$navurl.'?'.$paramid.'='.urlencode($object->ref_previous).$moreparam.'"><i class="fa fa-chevron-left"></i></a>' : '<span class="inactive"><i class="fa fa-chevron-left opacitymedium"></i></span>'; |
|
9564 | + $next_ref = $object->ref_next ? '<a accesskey="n" title="'.$stringforfirstkey.' n" class="classfortooltip" href="'.$navurl.'?'.$paramid.'='.urlencode($object->ref_next).$moreparam.'"><i class="fa fa-chevron-right"></i></a>' : '<span class="inactive"><i class="fa fa-chevron-right opacitymedium"></i></span>'; |
|
9565 | 9565 | } |
9566 | 9566 | |
9567 | 9567 | //print "xx".$previous_ref."x".$next_ref; |
@@ -9569,18 +9569,18 @@ discard block |
||
9569 | 9569 | |
9570 | 9570 | // Right part of banner |
9571 | 9571 | if ($morehtmlright) { |
9572 | - $ret .= '<div class="inline-block floatleft">' . $morehtmlright . '</div>'; |
|
9572 | + $ret .= '<div class="inline-block floatleft">'.$morehtmlright.'</div>'; |
|
9573 | 9573 | } |
9574 | 9574 | |
9575 | 9575 | if ($previous_ref || $next_ref || $morehtml) { |
9576 | 9576 | $ret .= '<div class="pagination paginationref"><ul class="right">'; |
9577 | 9577 | } |
9578 | 9578 | if ($morehtml) { |
9579 | - $ret .= '<li class="noborder litext' . (($shownav && $previous_ref && $next_ref) ? ' clearbothonsmartphone' : '') . '">' . $morehtml . '</li>'; |
|
9579 | + $ret .= '<li class="noborder litext'.(($shownav && $previous_ref && $next_ref) ? ' clearbothonsmartphone' : '').'">'.$morehtml.'</li>'; |
|
9580 | 9580 | } |
9581 | 9581 | if ($shownav && ($previous_ref || $next_ref)) { |
9582 | - $ret .= '<li class="pagination">' . $previous_ref . '</li>'; |
|
9583 | - $ret .= '<li class="pagination">' . $next_ref . '</li>'; |
|
9582 | + $ret .= '<li class="pagination">'.$previous_ref.'</li>'; |
|
9583 | + $ret .= '<li class="pagination">'.$next_ref.'</li>'; |
|
9584 | 9584 | } |
9585 | 9585 | if ($previous_ref || $next_ref || $morehtml) { |
9586 | 9586 | $ret .= '</ul></div>'; |
@@ -9595,7 +9595,7 @@ discard block |
||
9595 | 9595 | $morehtmlstatus = $hookmanager->resPrint; |
9596 | 9596 | } |
9597 | 9597 | if ($morehtmlstatus) { |
9598 | - $ret .= '<div class="statusref">' . $morehtmlstatus . '</div>'; |
|
9598 | + $ret .= '<div class="statusref">'.$morehtmlstatus.'</div>'; |
|
9599 | 9599 | } |
9600 | 9600 | |
9601 | 9601 | $parameters = array(); |
@@ -9609,14 +9609,14 @@ discard block |
||
9609 | 9609 | // Left part of banner |
9610 | 9610 | if ($morehtmlleft) { |
9611 | 9611 | if ($conf->browser->layout == 'phone') { |
9612 | - $ret .= '<!-- morehtmlleft --><div class="floatleft">' . $morehtmlleft . '</div>'; |
|
9612 | + $ret .= '<!-- morehtmlleft --><div class="floatleft">'.$morehtmlleft.'</div>'; |
|
9613 | 9613 | } else { |
9614 | - $ret .= '<!-- morehtmlleft --><div class="inline-block floatleft">' . $morehtmlleft . '</div>'; |
|
9614 | + $ret .= '<!-- morehtmlleft --><div class="inline-block floatleft">'.$morehtmlleft.'</div>'; |
|
9615 | 9615 | } |
9616 | 9616 | } |
9617 | 9617 | |
9618 | 9618 | //if ($conf->browser->layout == 'phone') $ret.='<div class="clearboth"></div>'; |
9619 | - $ret .= '<div class="inline-block floatleft valignmiddle maxwidth750 marginbottomonly refid' . (($shownav && ($previous_ref || $next_ref)) ? ' refidpadding' : '') . '">'; |
|
9619 | + $ret .= '<div class="inline-block floatleft valignmiddle maxwidth750 marginbottomonly refid'.(($shownav && ($previous_ref || $next_ref)) ? ' refidpadding' : '').'">'; |
|
9620 | 9620 | |
9621 | 9621 | // For thirdparty, contact, user, member, the ref is the id, so we show something else |
9622 | 9622 | if ($object->element == 'societe') { |
@@ -9630,7 +9630,7 @@ discard block |
||
9630 | 9630 | |
9631 | 9631 | if (is_array($arrayoflangcode) && count($arrayoflangcode)) { |
9632 | 9632 | if (!is_object($extralanguages)) { |
9633 | - include_once DOL_DOCUMENT_ROOT . '/core/class/extralanguages.class.php'; |
|
9633 | + include_once DOL_DOCUMENT_ROOT.'/core/class/extralanguages.class.php'; |
|
9634 | 9634 | $extralanguages = new ExtraLanguages($this->db); |
9635 | 9635 | } |
9636 | 9636 | $extralanguages->fetch_name_extralanguages('societe'); |
@@ -9645,27 +9645,27 @@ discard block |
||
9645 | 9645 | if ($object->array_languages['name'][$extralangcode]) { |
9646 | 9646 | $htmltext .= $object->array_languages['name'][$extralangcode]; |
9647 | 9647 | } else { |
9648 | - $htmltext .= '<span class="opacitymedium">' . $langs->trans("SwitchInEditModeToAddTranslation") . '</span>'; |
|
9648 | + $htmltext .= '<span class="opacitymedium">'.$langs->trans("SwitchInEditModeToAddTranslation").'</span>'; |
|
9649 | 9649 | } |
9650 | 9650 | } |
9651 | - $ret .= '<!-- Show translations of name -->' . "\n"; |
|
9651 | + $ret .= '<!-- Show translations of name -->'."\n"; |
|
9652 | 9652 | $ret .= $this->textwithpicto('', $htmltext, -1, 'language', 'opacitymedium paddingleft'); |
9653 | 9653 | } |
9654 | 9654 | } |
9655 | 9655 | } elseif ($object->element == 'member') { |
9656 | - $ret .= $object->ref . '<br>'; |
|
9656 | + $ret .= $object->ref.'<br>'; |
|
9657 | 9657 | $fullname = $object->getFullName($langs); |
9658 | 9658 | if ($object->morphy == 'mor' && $object->societe) { |
9659 | - $ret .= dol_htmlentities($object->societe) . ((!empty($fullname) && $object->societe != $fullname) ? ' (' . dol_htmlentities($fullname) . $addgendertxt . ')' : ''); |
|
9659 | + $ret .= dol_htmlentities($object->societe).((!empty($fullname) && $object->societe != $fullname) ? ' ('.dol_htmlentities($fullname).$addgendertxt.')' : ''); |
|
9660 | 9660 | } else { |
9661 | - $ret .= dol_htmlentities($fullname) . $addgendertxt . ((!empty($object->societe) && $object->societe != $fullname) ? ' (' . dol_htmlentities($object->societe) . ')' : ''); |
|
9661 | + $ret .= dol_htmlentities($fullname).$addgendertxt.((!empty($object->societe) && $object->societe != $fullname) ? ' ('.dol_htmlentities($object->societe).')' : ''); |
|
9662 | 9662 | } |
9663 | 9663 | } elseif (in_array($object->element, array('contact', 'user'))) { |
9664 | - $ret .= dol_htmlentities($object->getFullName($langs)) . $addgendertxt; |
|
9664 | + $ret .= dol_htmlentities($object->getFullName($langs)).$addgendertxt; |
|
9665 | 9665 | } elseif ($object->element == 'usergroup') { |
9666 | 9666 | $ret .= dol_htmlentities($object->name); |
9667 | 9667 | } elseif (in_array($object->element, array('action', 'agenda'))) { |
9668 | - $ret .= $object->ref . '<br>' . $object->label; |
|
9668 | + $ret .= $object->ref.'<br>'.$object->label; |
|
9669 | 9669 | } elseif (in_array($object->element, array('adherent_type'))) { |
9670 | 9670 | $ret .= $object->label; |
9671 | 9671 | } elseif ($object->element == 'ecm_directories') { |
@@ -9717,9 +9717,9 @@ discard block |
||
9717 | 9717 | } |
9718 | 9718 | |
9719 | 9719 | // Barcode image |
9720 | - $url = DOL_URL_ROOT . '/viewimage.php?modulepart=barcode&generator=' . urlencode($object->barcode_type_coder) . '&code=' . urlencode($object->barcode) . '&encoding=' . urlencode($object->barcode_type_code); |
|
9721 | - $out = '<!-- url barcode = ' . $url . ' -->'; |
|
9722 | - $out .= '<img src="' . $url . '"' . ($morecss ? ' class="' . $morecss . '"' : '') . '>'; |
|
9720 | + $url = DOL_URL_ROOT.'/viewimage.php?modulepart=barcode&generator='.urlencode($object->barcode_type_coder).'&code='.urlencode($object->barcode).'&encoding='.urlencode($object->barcode_type_code); |
|
9721 | + $out = '<!-- url barcode = '.$url.' -->'; |
|
9722 | + $out .= '<img src="'.$url.'"'.($morecss ? ' class="'.$morecss.'"' : '').'>'; |
|
9723 | 9723 | |
9724 | 9724 | return $out; |
9725 | 9725 | } |
@@ -9759,28 +9759,28 @@ discard block |
||
9759 | 9759 | if (!empty($object->logo)) { |
9760 | 9760 | if (dolIsAllowedForPreview($object->logo)) { |
9761 | 9761 | if ((string) $imagesize == 'mini') { |
9762 | - $file = get_exdir(0, 0, 0, 0, $object, 'thirdparty') . 'logos/' . getImageFileNameForSize($object->logo, '_mini'); // getImageFileNameForSize include the thumbs |
|
9762 | + $file = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.getImageFileNameForSize($object->logo, '_mini'); // getImageFileNameForSize include the thumbs |
|
9763 | 9763 | } elseif ((string) $imagesize == 'small') { |
9764 | - $file = get_exdir(0, 0, 0, 0, $object, 'thirdparty') . 'logos/' . getImageFileNameForSize($object->logo, '_small'); |
|
9764 | + $file = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.getImageFileNameForSize($object->logo, '_small'); |
|
9765 | 9765 | } else { |
9766 | - $file = get_exdir(0, 0, 0, 0, $object, 'thirdparty') . 'logos/' . $object->logo; |
|
9766 | + $file = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.$object->logo; |
|
9767 | 9767 | } |
9768 | - $originalfile = get_exdir(0, 0, 0, 0, $object, 'thirdparty') . 'logos/' . $object->logo; |
|
9768 | + $originalfile = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.$object->logo; |
|
9769 | 9769 | } |
9770 | 9770 | } |
9771 | 9771 | $email = $object->email; |
9772 | 9772 | } elseif ($modulepart == 'contact') { |
9773 | - $dir = $conf->societe->multidir_output[$entity] . '/contact'; |
|
9773 | + $dir = $conf->societe->multidir_output[$entity].'/contact'; |
|
9774 | 9774 | if (!empty($object->photo)) { |
9775 | 9775 | if (dolIsAllowedForPreview($object->photo)) { |
9776 | 9776 | if ((string) $imagesize == 'mini') { |
9777 | - $file = get_exdir(0, 0, 0, 0, $object, 'contact') . 'photos/' . getImageFileNameForSize($object->photo, '_mini'); |
|
9777 | + $file = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.getImageFileNameForSize($object->photo, '_mini'); |
|
9778 | 9778 | } elseif ((string) $imagesize == 'small') { |
9779 | - $file = get_exdir(0, 0, 0, 0, $object, 'contact') . 'photos/' . getImageFileNameForSize($object->photo, '_small'); |
|
9779 | + $file = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.getImageFileNameForSize($object->photo, '_small'); |
|
9780 | 9780 | } else { |
9781 | - $file = get_exdir(0, 0, 0, 0, $object, 'contact') . 'photos/' . $object->photo; |
|
9781 | + $file = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.$object->photo; |
|
9782 | 9782 | } |
9783 | - $originalfile = get_exdir(0, 0, 0, 0, $object, 'contact') . 'photos/' . $object->photo; |
|
9783 | + $originalfile = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.$object->photo; |
|
9784 | 9784 | } |
9785 | 9785 | } |
9786 | 9786 | $email = $object->email; |
@@ -9790,17 +9790,17 @@ discard block |
||
9790 | 9790 | if (!empty($object->photo)) { |
9791 | 9791 | if (dolIsAllowedForPreview($object->photo)) { |
9792 | 9792 | if ((string) $imagesize == 'mini') { |
9793 | - $file = get_exdir(0, 0, 0, 0, $object, 'user') . 'photos/' . getImageFileNameForSize($object->photo, '_mini'); |
|
9793 | + $file = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.getImageFileNameForSize($object->photo, '_mini'); |
|
9794 | 9794 | } elseif ((string) $imagesize == 'small') { |
9795 | - $file = get_exdir(0, 0, 0, 0, $object, 'user') . 'photos/' . getImageFileNameForSize($object->photo, '_small'); |
|
9795 | + $file = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.getImageFileNameForSize($object->photo, '_small'); |
|
9796 | 9796 | } else { |
9797 | - $file = get_exdir(0, 0, 0, 0, $object, 'user') . 'photos/' . $object->photo; |
|
9797 | + $file = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.$object->photo; |
|
9798 | 9798 | } |
9799 | - $originalfile = get_exdir(0, 0, 0, 0, $object, 'user') . 'photos/' . $object->photo; |
|
9799 | + $originalfile = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.$object->photo; |
|
9800 | 9800 | } |
9801 | 9801 | } |
9802 | 9802 | if (!empty($conf->global->MAIN_OLD_IMAGE_LINKS)) { |
9803 | - $altfile = $object->id . ".jpg"; // For backward compatibility |
|
9803 | + $altfile = $object->id.".jpg"; // For backward compatibility |
|
9804 | 9804 | } |
9805 | 9805 | $email = $object->email; |
9806 | 9806 | $capture = 'user'; |
@@ -9809,17 +9809,17 @@ discard block |
||
9809 | 9809 | if (!empty($object->photo)) { |
9810 | 9810 | if (dolIsAllowedForPreview($object->photo)) { |
9811 | 9811 | if ((string) $imagesize == 'mini') { |
9812 | - $file = get_exdir(0, 0, 0, 0, $object, 'member') . 'photos/' . getImageFileNameForSize($object->photo, '_mini'); |
|
9812 | + $file = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.getImageFileNameForSize($object->photo, '_mini'); |
|
9813 | 9813 | } elseif ((string) $imagesize == 'small') { |
9814 | - $file = get_exdir(0, 0, 0, 0, $object, 'member') . 'photos/' . getImageFileNameForSize($object->photo, '_small'); |
|
9814 | + $file = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.getImageFileNameForSize($object->photo, '_small'); |
|
9815 | 9815 | } else { |
9816 | - $file = get_exdir(0, 0, 0, 0, $object, 'member') . 'photos/' . $object->photo; |
|
9816 | + $file = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.$object->photo; |
|
9817 | 9817 | } |
9818 | - $originalfile = get_exdir(0, 0, 0, 0, $object, 'member') . 'photos/' . $object->photo; |
|
9818 | + $originalfile = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.$object->photo; |
|
9819 | 9819 | } |
9820 | 9820 | } |
9821 | 9821 | if (!empty($conf->global->MAIN_OLD_IMAGE_LINKS)) { |
9822 | - $altfile = $object->id . ".jpg"; // For backward compatibility |
|
9822 | + $altfile = $object->id.".jpg"; // For backward compatibility |
|
9823 | 9823 | } |
9824 | 9824 | $email = $object->email; |
9825 | 9825 | $capture = 'user'; |
@@ -9829,17 +9829,17 @@ discard block |
||
9829 | 9829 | if (!empty($object->photo)) { |
9830 | 9830 | if (dolIsAllowedForPreview($object->photo)) { |
9831 | 9831 | if ((string) $imagesize == 'mini') { |
9832 | - $file = get_exdir($id, 2, 0, 0, $object, $modulepart) . 'photos/' . getImageFileNameForSize($object->photo, '_mini'); |
|
9832 | + $file = get_exdir($id, 2, 0, 0, $object, $modulepart).'photos/'.getImageFileNameForSize($object->photo, '_mini'); |
|
9833 | 9833 | } elseif ((string) $imagesize == 'small') { |
9834 | - $file = get_exdir($id, 2, 0, 0, $object, $modulepart) . 'photos/' . getImageFileNameForSize($object->photo, '_small'); |
|
9834 | + $file = get_exdir($id, 2, 0, 0, $object, $modulepart).'photos/'.getImageFileNameForSize($object->photo, '_small'); |
|
9835 | 9835 | } else { |
9836 | - $file = get_exdir($id, 2, 0, 0, $object, $modulepart) . 'photos/' . $object->photo; |
|
9836 | + $file = get_exdir($id, 2, 0, 0, $object, $modulepart).'photos/'.$object->photo; |
|
9837 | 9837 | } |
9838 | - $originalfile = get_exdir($id, 2, 0, 0, $object, $modulepart) . 'photos/' . $object->photo; |
|
9838 | + $originalfile = get_exdir($id, 2, 0, 0, $object, $modulepart).'photos/'.$object->photo; |
|
9839 | 9839 | } |
9840 | 9840 | } |
9841 | 9841 | if (!empty($conf->global->MAIN_OLD_IMAGE_LINKS)) { |
9842 | - $altfile = $object->id . ".jpg"; // For backward compatibility |
|
9842 | + $altfile = $object->id.".jpg"; // For backward compatibility |
|
9843 | 9843 | } |
9844 | 9844 | $email = $object->email; |
9845 | 9845 | } |
@@ -9849,35 +9849,35 @@ discard block |
||
9849 | 9849 | } |
9850 | 9850 | |
9851 | 9851 | if ($dir) { |
9852 | - if ($file && file_exists($dir . "/" . $file)) { |
|
9852 | + if ($file && file_exists($dir."/".$file)) { |
|
9853 | 9853 | if ($addlinktofullsize) { |
9854 | - $urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity=' . $entity); |
|
9854 | + $urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity='.$entity); |
|
9855 | 9855 | if ($urladvanced) { |
9856 | - $ret .= '<a href="' . $urladvanced . '">'; |
|
9856 | + $ret .= '<a href="'.$urladvanced.'">'; |
|
9857 | 9857 | } else { |
9858 | - $ret .= '<a href="' . DOL_URL_ROOT . '/viewimage.php?modulepart=' . $modulepart . '&entity=' . $entity . '&file=' . urlencode($originalfile) . '&cache=' . $cache . '">'; |
|
9858 | + $ret .= '<a href="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($originalfile).'&cache='.$cache.'">'; |
|
9859 | 9859 | } |
9860 | 9860 | } |
9861 | - $ret .= '<img alt="Photo" class="photo' . $modulepart . ($cssclass ? ' ' . $cssclass : '') . ' photologo' . (preg_replace('/[^a-z]/i', '_', $file)) . '" ' . ($width ? ' width="' . $width . '"' : '') . ($height ? ' height="' . $height . '"' : '') . ' src="' . DOL_URL_ROOT . '/viewimage.php?modulepart=' . $modulepart . '&entity=' . $entity . '&file=' . urlencode($file) . '&cache=' . $cache . '">'; |
|
9861 | + $ret .= '<img alt="Photo" class="photo'.$modulepart.($cssclass ? ' '.$cssclass : '').' photologo'.(preg_replace('/[^a-z]/i', '_', $file)).'" '.($width ? ' width="'.$width.'"' : '').($height ? ' height="'.$height.'"' : '').' src="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($file).'&cache='.$cache.'">'; |
|
9862 | 9862 | if ($addlinktofullsize) { |
9863 | 9863 | $ret .= '</a>'; |
9864 | 9864 | } |
9865 | - } elseif ($altfile && file_exists($dir . "/" . $altfile)) { |
|
9865 | + } elseif ($altfile && file_exists($dir."/".$altfile)) { |
|
9866 | 9866 | if ($addlinktofullsize) { |
9867 | - $urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity=' . $entity); |
|
9867 | + $urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity='.$entity); |
|
9868 | 9868 | if ($urladvanced) { |
9869 | - $ret .= '<a href="' . $urladvanced . '">'; |
|
9869 | + $ret .= '<a href="'.$urladvanced.'">'; |
|
9870 | 9870 | } else { |
9871 | - $ret .= '<a href="' . DOL_URL_ROOT . '/viewimage.php?modulepart=' . $modulepart . '&entity=' . $entity . '&file=' . urlencode($originalfile) . '&cache=' . $cache . '">'; |
|
9871 | + $ret .= '<a href="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($originalfile).'&cache='.$cache.'">'; |
|
9872 | 9872 | } |
9873 | 9873 | } |
9874 | - $ret .= '<img class="photo' . $modulepart . ($cssclass ? ' ' . $cssclass : '') . '" alt="Photo alt" id="photologo' . (preg_replace('/[^a-z]/i', '_', $file)) . '" class="' . $cssclass . '" ' . ($width ? ' width="' . $width . '"' : '') . ($height ? ' height="' . $height . '"' : '') . ' src="' . DOL_URL_ROOT . '/viewimage.php?modulepart=' . $modulepart . '&entity=' . $entity . '&file=' . urlencode($altfile) . '&cache=' . $cache . '">'; |
|
9874 | + $ret .= '<img class="photo'.$modulepart.($cssclass ? ' '.$cssclass : '').'" alt="Photo alt" id="photologo'.(preg_replace('/[^a-z]/i', '_', $file)).'" class="'.$cssclass.'" '.($width ? ' width="'.$width.'"' : '').($height ? ' height="'.$height.'"' : '').' src="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($altfile).'&cache='.$cache.'">'; |
|
9875 | 9875 | if ($addlinktofullsize) { |
9876 | 9876 | $ret .= '</a>'; |
9877 | 9877 | } |
9878 | 9878 | } else { |
9879 | 9879 | $nophoto = '/public/theme/common/nophoto.png'; |
9880 | - $defaultimg = 'identicon'; // For gravatar |
|
9880 | + $defaultimg = 'identicon'; // For gravatar |
|
9881 | 9881 | if (in_array($modulepart, array('societe', 'userphoto', 'contact', 'memberphoto'))) { // For modules that need a special image when photo not found |
9882 | 9882 | if ($modulepart == 'societe' || ($modulepart == 'memberphoto' && !empty($object->morphy) && strpos($object->morphy, 'mor')) !== false) { |
9883 | 9883 | $nophoto = 'company'; |
@@ -9895,13 +9895,13 @@ discard block |
||
9895 | 9895 | if (isModEnabled('gravatar') && $email && empty($noexternsourceoverwrite)) { |
9896 | 9896 | // see https://gravatar.com/site/implement/images/php/ |
9897 | 9897 | $ret .= '<!-- Put link to gravatar -->'; |
9898 | - $ret .= '<img class="photo' . $modulepart . ($cssclass ? ' ' . $cssclass : '') . '" alt="" title="' . $email . ' Gravatar avatar" ' . ($width ? ' width="' . $width . '"' : '') . ($height ? ' height="' . $height . '"' : '') . ' src="https://www.gravatar.com/avatar/' . md5(strtolower(trim($email))) . '?s=' . $width . '&d=' . $defaultimg . '">'; // gravatar need md5 hash |
|
9898 | + $ret .= '<img class="photo'.$modulepart.($cssclass ? ' '.$cssclass : '').'" alt="" title="'.$email.' Gravatar avatar" '.($width ? ' width="'.$width.'"' : '').($height ? ' height="'.$height.'"' : '').' src="https://www.gravatar.com/avatar/'.md5(strtolower(trim($email))).'?s='.$width.'&d='.$defaultimg.'">'; // gravatar need md5 hash |
|
9899 | 9899 | } else { |
9900 | 9900 | if ($nophoto == 'company') { |
9901 | - $ret .= '<div class="divforspanimg photo' . $modulepart . ($cssclass ? ' ' . $cssclass : '') . '" alt="" ' . ($width ? ' width="' . $width . '"' : '') . ($height ? ' height="' . $height . '"' : '') . '>' . img_picto('', 'company') . '</div>'; |
|
9901 | + $ret .= '<div class="divforspanimg photo'.$modulepart.($cssclass ? ' '.$cssclass : '').'" alt="" '.($width ? ' width="'.$width.'"' : '').($height ? ' height="'.$height.'"' : '').'>'.img_picto('', 'company').'</div>'; |
|
9902 | 9902 | $ret .= '<div class="difforspanimgright"></div>'; |
9903 | 9903 | } else { |
9904 | - $ret .= '<img class="photo' . $modulepart . ($cssclass ? ' ' . $cssclass : '') . '" alt="" ' . ($width ? ' width="' . $width . '"' : '') . ($height ? ' height="' . $height . '"' : '') . ' src="' . DOL_URL_ROOT . $nophoto . '">'; |
|
9904 | + $ret .= '<img class="photo'.$modulepart.($cssclass ? ' '.$cssclass : '').'" alt="" '.($width ? ' width="'.$width.'"' : '').($height ? ' height="'.$height.'"' : '').' src="'.DOL_URL_ROOT.$nophoto.'">'; |
|
9905 | 9905 | } |
9906 | 9906 | } |
9907 | 9907 | } |
@@ -9912,15 +9912,15 @@ discard block |
||
9912 | 9912 | } |
9913 | 9913 | $ret .= '<table class="nobordernopadding centpercent">'; |
9914 | 9914 | if ($object->photo) { |
9915 | - $ret .= '<tr><td><input type="checkbox" class="flat photodelete" name="deletephoto" id="photodelete"> <label for="photodelete">' . $langs->trans("Delete") . '</label><br><br></td></tr>'; |
|
9915 | + $ret .= '<tr><td><input type="checkbox" class="flat photodelete" name="deletephoto" id="photodelete"> <label for="photodelete">'.$langs->trans("Delete").'</label><br><br></td></tr>'; |
|
9916 | 9916 | } |
9917 | 9917 | $ret .= '<tr><td class="tdoverflow">'; |
9918 | 9918 | $maxfilesizearray = getMaxFileSizeArray(); |
9919 | 9919 | $maxmin = $maxfilesizearray['maxmin']; |
9920 | 9920 | if ($maxmin > 0) { |
9921 | - $ret .= '<input type="hidden" name="MAX_FILE_SIZE" value="' . ($maxmin * 1024) . '">'; // MAX_FILE_SIZE must precede the field type=file |
|
9921 | + $ret .= '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file |
|
9922 | 9922 | } |
9923 | - $ret .= '<input type="file" class="flat maxwidth200onsmartphone" name="photo" id="photoinput" accept="image/*"' . ($capture ? ' capture="' . $capture . '"' : '') . '>'; |
|
9923 | + $ret .= '<input type="file" class="flat maxwidth200onsmartphone" name="photo" id="photoinput" accept="image/*"'.($capture ? ' capture="'.$capture.'"' : '').'>'; |
|
9924 | 9924 | $ret .= '</td></tr>'; |
9925 | 9925 | $ret .= '</table>'; |
9926 | 9926 | } |
@@ -9974,38 +9974,38 @@ discard block |
||
9974 | 9974 | if (isModEnabled('multicompany') && $conf->entity == 1 && $user->admin && !$user->entity) { |
9975 | 9975 | $sql .= ", e.label"; |
9976 | 9976 | } |
9977 | - $sql .= " FROM " . $this->db->prefix() . "usergroup as ug "; |
|
9977 | + $sql .= " FROM ".$this->db->prefix()."usergroup as ug "; |
|
9978 | 9978 | if (isModEnabled('multicompany') && $conf->entity == 1 && $user->admin && !$user->entity) { |
9979 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "entity as e ON e.rowid=ug.entity"; |
|
9979 | + $sql .= " LEFT JOIN ".$this->db->prefix()."entity as e ON e.rowid=ug.entity"; |
|
9980 | 9980 | if ($force_entity) { |
9981 | - $sql .= " WHERE ug.entity IN (0, " . $force_entity . ")"; |
|
9981 | + $sql .= " WHERE ug.entity IN (0, ".$force_entity.")"; |
|
9982 | 9982 | } else { |
9983 | 9983 | $sql .= " WHERE ug.entity IS NOT NULL"; |
9984 | 9984 | } |
9985 | 9985 | } else { |
9986 | - $sql .= " WHERE ug.entity IN (0, " . $conf->entity . ")"; |
|
9986 | + $sql .= " WHERE ug.entity IN (0, ".$conf->entity.")"; |
|
9987 | 9987 | } |
9988 | 9988 | if (is_array($exclude) && $excludeGroups) { |
9989 | - $sql .= " AND ug.rowid NOT IN (" . $this->db->sanitize($excludeGroups) . ")"; |
|
9989 | + $sql .= " AND ug.rowid NOT IN (".$this->db->sanitize($excludeGroups).")"; |
|
9990 | 9990 | } |
9991 | 9991 | if (is_array($include) && $includeGroups) { |
9992 | - $sql .= " AND ug.rowid IN (" . $this->db->sanitize($includeGroups) . ")"; |
|
9992 | + $sql .= " AND ug.rowid IN (".$this->db->sanitize($includeGroups).")"; |
|
9993 | 9993 | } |
9994 | 9994 | $sql .= " ORDER BY ug.nom ASC"; |
9995 | 9995 | |
9996 | - dol_syslog(get_class($this) . "::select_dolgroups", LOG_DEBUG); |
|
9996 | + dol_syslog(get_class($this)."::select_dolgroups", LOG_DEBUG); |
|
9997 | 9997 | $resql = $this->db->query($sql); |
9998 | 9998 | if ($resql) { |
9999 | 9999 | // Enhance with select2 |
10000 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
10000 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
10001 | 10001 | |
10002 | - $out .= '<select class="flat minwidth200' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlname . '" name="' . $htmlname . ($multiple ? '[]' : '') . '" ' . ($multiple ? 'multiple' : '') . ' ' . ($disabled ? ' disabled' : '') . '>'; |
|
10002 | + $out .= '<select class="flat minwidth200'.($morecss ? ' '.$morecss : '').'" id="'.$htmlname.'" name="'.$htmlname.($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').' '.($disabled ? ' disabled' : '').'>'; |
|
10003 | 10003 | |
10004 | 10004 | $num = $this->db->num_rows($resql); |
10005 | 10005 | $i = 0; |
10006 | 10006 | if ($num) { |
10007 | 10007 | if ($show_empty && !$multiple) { |
10008 | - $out .= '<option value="-1"' . (in_array(-1, $selected) ? ' selected' : '') . '> </option>' . "\n"; |
|
10008 | + $out .= '<option value="-1"'.(in_array(-1, $selected) ? ' selected' : '').'> </option>'."\n"; |
|
10009 | 10009 | } |
10010 | 10010 | |
10011 | 10011 | while ($i < $num) { |
@@ -10015,7 +10015,7 @@ discard block |
||
10015 | 10015 | $disableline = 1; |
10016 | 10016 | } |
10017 | 10017 | |
10018 | - $out .= '<option value="' . $obj->rowid . '"'; |
|
10018 | + $out .= '<option value="'.$obj->rowid.'"'; |
|
10019 | 10019 | if ($disableline) { |
10020 | 10020 | $out .= ' disabled'; |
10021 | 10021 | } |
@@ -10026,7 +10026,7 @@ discard block |
||
10026 | 10026 | |
10027 | 10027 | $out .= $obj->name; |
10028 | 10028 | if (isModEnabled('multicompany') && !getDolGlobalInt('MULTICOMPANY_TRANSVERSE_MODE') && $conf->entity == 1) { |
10029 | - $out .= " (" . $obj->label . ")"; |
|
10029 | + $out .= " (".$obj->label.")"; |
|
10030 | 10030 | } |
10031 | 10031 | |
10032 | 10032 | $out .= '</option>'; |
@@ -10034,9 +10034,9 @@ discard block |
||
10034 | 10034 | } |
10035 | 10035 | } else { |
10036 | 10036 | if ($show_empty) { |
10037 | - $out .= '<option value="-1"' . (in_array(-1, $selected) ? ' selected' : '') . '></option>' . "\n"; |
|
10037 | + $out .= '<option value="-1"'.(in_array(-1, $selected) ? ' selected' : '').'></option>'."\n"; |
|
10038 | 10038 | } |
10039 | - $out .= '<option value="" disabled>' . $langs->trans("NoUserGroupDefined") . '</option>'; |
|
10039 | + $out .= '<option value="" disabled>'.$langs->trans("NoUserGroupDefined").'</option>'; |
|
10040 | 10040 | } |
10041 | 10041 | $out .= '</select>'; |
10042 | 10042 | |
@@ -10085,25 +10085,25 @@ discard block |
||
10085 | 10085 | $out = ''; |
10086 | 10086 | |
10087 | 10087 | if (!empty($conf->use_javascript_ajax)) { |
10088 | - $out .= '<div class="inline-block checkallactions"><input type="checkbox" id="' . $cssclass . 's" name="' . $cssclass . 's" class="checkallactions"></div>'; |
|
10088 | + $out .= '<div class="inline-block checkallactions"><input type="checkbox" id="'.$cssclass.'s" name="'.$cssclass.'s" class="checkallactions"></div>'; |
|
10089 | 10089 | } |
10090 | - $out .= '<script nonce="' . getNonce() . '"> |
|
10090 | + $out .= '<script nonce="'.getNonce().'"> |
|
10091 | 10091 | $(document).ready(function() { |
10092 | - $("#' . $cssclass . 's").click(function() { |
|
10092 | + $("#' . $cssclass.'s").click(function() { |
|
10093 | 10093 | if($(this).is(\':checked\')){ |
10094 | - console.log("We check all ' . $cssclass . ' and trigger the change method"); |
|
10095 | - $(".' . $cssclass . '").prop(\'checked\', true).trigger(\'change\'); |
|
10094 | + console.log("We check all ' . $cssclass.' and trigger the change method"); |
|
10095 | + $(".' . $cssclass.'").prop(\'checked\', true).trigger(\'change\'); |
|
10096 | 10096 | } |
10097 | 10097 | else |
10098 | 10098 | { |
10099 | 10099 | console.log("We uncheck all"); |
10100 | - $(".' . $cssclass . '").prop(\'checked\', false).trigger(\'change\'); |
|
10100 | + $(".' . $cssclass.'").prop(\'checked\', false).trigger(\'change\'); |
|
10101 | 10101 | }' . "\n"; |
10102 | 10102 | if ($calljsfunction) { |
10103 | - $out .= 'if (typeof initCheckForSelect == \'function\') { initCheckForSelect(0, "' . $massactionname . '", "' . $cssclass . '"); } else { console.log("No function initCheckForSelect found. Call won\'t be done."); }'; |
|
10103 | + $out .= 'if (typeof initCheckForSelect == \'function\') { initCheckForSelect(0, "'.$massactionname.'", "'.$cssclass.'"); } else { console.log("No function initCheckForSelect found. Call won\'t be done."); }'; |
|
10104 | 10104 | } |
10105 | 10105 | $out .= ' }); |
10106 | - $(".' . $cssclass . '").change(function() { |
|
10106 | + $(".' . $cssclass.'").change(function() { |
|
10107 | 10107 | $(this).closest("tr").toggleClass("highlight", this.checked); |
10108 | 10108 | }); |
10109 | 10109 | }); |
@@ -10148,67 +10148,67 @@ discard block |
||
10148 | 10148 | global $langs, $user; |
10149 | 10149 | |
10150 | 10150 | $out = ''; |
10151 | - $sql = "SELECT rowid, label FROM " . $this->db->prefix() . "c_exp_tax_cat WHERE active = 1"; |
|
10152 | - $sql .= " AND entity IN (0," . getEntity('exp_tax_cat') . ")"; |
|
10151 | + $sql = "SELECT rowid, label FROM ".$this->db->prefix()."c_exp_tax_cat WHERE active = 1"; |
|
10152 | + $sql .= " AND entity IN (0,".getEntity('exp_tax_cat').")"; |
|
10153 | 10153 | if (!empty($excludeid)) { |
10154 | - $sql .= " AND rowid NOT IN (" . $this->db->sanitize(implode(',', $excludeid)) . ")"; |
|
10154 | + $sql .= " AND rowid NOT IN (".$this->db->sanitize(implode(',', $excludeid)).")"; |
|
10155 | 10155 | } |
10156 | 10156 | $sql .= " ORDER BY label"; |
10157 | 10157 | |
10158 | 10158 | $resql = $this->db->query($sql); |
10159 | 10159 | if ($resql) { |
10160 | - $out = '<select id="select_' . $htmlname . '" name="' . $htmlname . '" class="' . $htmlname . ' flat minwidth75imp maxwidth200">'; |
|
10160 | + $out = '<select id="select_'.$htmlname.'" name="'.$htmlname.'" class="'.$htmlname.' flat minwidth75imp maxwidth200">'; |
|
10161 | 10161 | if ($useempty) { |
10162 | 10162 | $out .= '<option value="0"> </option>'; |
10163 | 10163 | } |
10164 | 10164 | |
10165 | 10165 | while ($obj = $this->db->fetch_object($resql)) { |
10166 | - $out .= '<option ' . ($selected == $obj->rowid ? 'selected="selected"' : '') . ' value="' . $obj->rowid . '">' . $langs->trans($obj->label) . '</option>'; |
|
10166 | + $out .= '<option '.($selected == $obj->rowid ? 'selected="selected"' : '').' value="'.$obj->rowid.'">'.$langs->trans($obj->label).'</option>'; |
|
10167 | 10167 | } |
10168 | 10168 | $out .= '</select>'; |
10169 | - $out .= ajax_combobox('select_' . $htmlname); |
|
10169 | + $out .= ajax_combobox('select_'.$htmlname); |
|
10170 | 10170 | |
10171 | 10171 | if (!empty($htmlname) && $user->admin && $info_admin) { |
10172 | - $out .= ' ' . info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); |
|
10172 | + $out .= ' '.info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); |
|
10173 | 10173 | } |
10174 | 10174 | |
10175 | 10175 | if (!empty($target)) { |
10176 | - $sql = "SELECT c.id FROM " . $this->db->prefix() . "c_type_fees as c WHERE c.code = 'EX_KME' AND c.active = 1"; |
|
10176 | + $sql = "SELECT c.id FROM ".$this->db->prefix()."c_type_fees as c WHERE c.code = 'EX_KME' AND c.active = 1"; |
|
10177 | 10177 | $resql = $this->db->query($sql); |
10178 | 10178 | if ($resql) { |
10179 | 10179 | if ($this->db->num_rows($resql) > 0) { |
10180 | 10180 | $obj = $this->db->fetch_object($resql); |
10181 | - $out .= '<script nonce="' . getNonce() . '"> |
|
10181 | + $out .= '<script nonce="'.getNonce().'"> |
|
10182 | 10182 | $(function() { |
10183 | - $("select[name=' . $target . ']").on("change", function() { |
|
10183 | + $("select[name=' . $target.']").on("change", function() { |
|
10184 | 10184 | var current_val = $(this).val(); |
10185 | - if (current_val == ' . $obj->id . ') {'; |
|
10185 | + if (current_val == ' . $obj->id.') {'; |
|
10186 | 10186 | if (!empty($default_selected) || !empty($selected)) { |
10187 | - $out .= '$("select[name=' . $htmlname . ']").val("' . ($default_selected > 0 ? $default_selected : $selected) . '");'; |
|
10187 | + $out .= '$("select[name='.$htmlname.']").val("'.($default_selected > 0 ? $default_selected : $selected).'");'; |
|
10188 | 10188 | } |
10189 | 10189 | |
10190 | 10190 | $out .= ' |
10191 | - $("select[name=' . $htmlname . ']").change(); |
|
10191 | + $("select[name=' . $htmlname.']").change(); |
|
10192 | 10192 | } |
10193 | 10193 | }); |
10194 | 10194 | |
10195 | - $("select[name=' . $htmlname . ']").change(function() { |
|
10195 | + $("select[name=' . $htmlname.']").change(function() { |
|
10196 | 10196 | |
10197 | - if ($("select[name=' . $target . ']").val() == ' . $obj->id . ') { |
|
10197 | + if ($("select[name=' . $target.']").val() == '.$obj->id.') { |
|
10198 | 10198 | // get price of kilometer to fill the unit price |
10199 | 10199 | $.ajax({ |
10200 | 10200 | method: "POST", |
10201 | 10201 | dataType: "json", |
10202 | - data: { fk_c_exp_tax_cat: $(this).val(), token: \'' . currentToken() . '\' }, |
|
10203 | - url: "' . (DOL_URL_ROOT . '/expensereport/ajax/ajaxik.php?' . join('&', $params)) . '", |
|
10202 | + data: { fk_c_exp_tax_cat: $(this).val(), token: \'' . currentToken().'\' }, |
|
10203 | + url: "' . (DOL_URL_ROOT.'/expensereport/ajax/ajaxik.php?'.join('&', $params)).'", |
|
10204 | 10204 | }).done(function( data, textStatus, jqXHR ) { |
10205 | 10205 | console.log(data); |
10206 | 10206 | if (typeof data.up != "undefined") { |
10207 | 10207 | $("input[name=value_unit]").val(data.up); |
10208 | - $("select[name=' . $htmlname . ']").attr("title", data.title); |
|
10208 | + $("select[name=' . $htmlname.']").attr("title", data.title); |
|
10209 | 10209 | } else { |
10210 | 10210 | $("input[name=value_unit]").val(""); |
10211 | - $("select[name=' . $htmlname . ']").attr("title", ""); |
|
10211 | + $("select[name=' . $htmlname.']").attr("title", ""); |
|
10212 | 10212 | } |
10213 | 10213 | }); |
10214 | 10214 | } |
@@ -10238,18 +10238,18 @@ discard block |
||
10238 | 10238 | global $conf, $langs; |
10239 | 10239 | |
10240 | 10240 | $out = ''; |
10241 | - $sql = "SELECT rowid, range_ik FROM " . $this->db->prefix() . "c_exp_tax_range"; |
|
10242 | - $sql .= " WHERE entity = " . $conf->entity . " AND active = 1"; |
|
10241 | + $sql = "SELECT rowid, range_ik FROM ".$this->db->prefix()."c_exp_tax_range"; |
|
10242 | + $sql .= " WHERE entity = ".$conf->entity." AND active = 1"; |
|
10243 | 10243 | |
10244 | 10244 | $resql = $this->db->query($sql); |
10245 | 10245 | if ($resql) { |
10246 | - $out = '<select id="select_' . $htmlname . '" name="' . $htmlname . '" class="' . $htmlname . ' flat minwidth75imp">'; |
|
10246 | + $out = '<select id="select_'.$htmlname.'" name="'.$htmlname.'" class="'.$htmlname.' flat minwidth75imp">'; |
|
10247 | 10247 | if ($useempty) { |
10248 | 10248 | $out .= '<option value="0"></option>'; |
10249 | 10249 | } |
10250 | 10250 | |
10251 | 10251 | while ($obj = $this->db->fetch_object($resql)) { |
10252 | - $out .= '<option ' . ($selected == $obj->rowid ? 'selected="selected"' : '') . ' value="' . $obj->rowid . '">' . price($obj->range_ik, 0, $langs, 1, 0) . '</option>'; |
|
10252 | + $out .= '<option '.($selected == $obj->rowid ? 'selected="selected"' : '').' value="'.$obj->rowid.'">'.price($obj->range_ik, 0, $langs, 1, 0).'</option>'; |
|
10253 | 10253 | } |
10254 | 10254 | $out .= '</select>'; |
10255 | 10255 | } else { |
@@ -10274,17 +10274,17 @@ discard block |
||
10274 | 10274 | global $langs; |
10275 | 10275 | |
10276 | 10276 | $out = ''; |
10277 | - $sql = "SELECT id, code, label FROM " . $this->db->prefix() . "c_type_fees"; |
|
10277 | + $sql = "SELECT id, code, label FROM ".$this->db->prefix()."c_type_fees"; |
|
10278 | 10278 | $sql .= " WHERE active = 1"; |
10279 | 10279 | |
10280 | 10280 | $resql = $this->db->query($sql); |
10281 | 10281 | if ($resql) { |
10282 | - $out = '<select id="select_' . $htmlname . '" name="' . $htmlname . '" class="' . $htmlname . ' flat minwidth75imp">'; |
|
10282 | + $out = '<select id="select_'.$htmlname.'" name="'.$htmlname.'" class="'.$htmlname.' flat minwidth75imp">'; |
|
10283 | 10283 | if ($useempty) { |
10284 | 10284 | $out .= '<option value="0"></option>'; |
10285 | 10285 | } |
10286 | 10286 | if ($allchoice) { |
10287 | - $out .= '<option value="-1">' . $langs->trans('AllExpenseReport') . '</option>'; |
|
10287 | + $out .= '<option value="-1">'.$langs->trans('AllExpenseReport').'</option>'; |
|
10288 | 10288 | } |
10289 | 10289 | |
10290 | 10290 | $field = 'code'; |
@@ -10294,7 +10294,7 @@ discard block |
||
10294 | 10294 | |
10295 | 10295 | while ($obj = $this->db->fetch_object($resql)) { |
10296 | 10296 | $key = $langs->trans($obj->code); |
10297 | - $out .= '<option ' . ($selected == $obj->{$field} ? 'selected="selected"' : '') . ' value="' . $obj->{$field} . '">' . ($key != $obj->code ? $key : $obj->label) . '</option>'; |
|
10297 | + $out .= '<option '.($selected == $obj->{$field} ? 'selected="selected"' : '').' value="'.$obj->{$field}.'">'.($key != $obj->code ? $key : $obj->label).'</option>'; |
|
10298 | 10298 | } |
10299 | 10299 | $out .= '</select>'; |
10300 | 10300 | } else { |
@@ -10326,7 +10326,7 @@ discard block |
||
10326 | 10326 | { |
10327 | 10327 | global $user, $conf, $langs; |
10328 | 10328 | |
10329 | - require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; |
|
10329 | + require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; |
|
10330 | 10330 | |
10331 | 10331 | if (is_null($usertofilter)) { |
10332 | 10332 | $usertofilter = $user; |
@@ -10350,10 +10350,10 @@ discard block |
||
10350 | 10350 | $sql = "SELECT f.rowid, f.ref as fref, 'nolabel' as flabel, p.rowid as pid, f.ref, |
10351 | 10351 | p.title, p.fk_soc, p.fk_statut, p.public,"; |
10352 | 10352 | $sql .= ' s.nom as name'; |
10353 | - $sql .= ' FROM ' . $this->db->prefix() . 'projet as p'; |
|
10354 | - $sql .= ' LEFT JOIN ' . $this->db->prefix() . 'societe as s ON s.rowid = p.fk_soc,'; |
|
10355 | - $sql .= ' ' . $this->db->prefix() . 'facture as f'; |
|
10356 | - $sql .= " WHERE p.entity IN (" . getEntity('project') . ")"; |
|
10353 | + $sql .= ' FROM '.$this->db->prefix().'projet as p'; |
|
10354 | + $sql .= ' LEFT JOIN '.$this->db->prefix().'societe as s ON s.rowid = p.fk_soc,'; |
|
10355 | + $sql .= ' '.$this->db->prefix().'facture as f'; |
|
10356 | + $sql .= " WHERE p.entity IN (".getEntity('project').")"; |
|
10357 | 10357 | $sql .= " AND f.fk_projet = p.rowid AND f.fk_statut=0"; //Brouillons seulement |
10358 | 10358 | //if ($projectsListId) $sql.= " AND p.rowid IN (".$this->db->sanitize($projectsListId).")"; |
10359 | 10359 | //if ($socid == 0) $sql.= " AND (p.fk_soc=0 OR p.fk_soc IS NULL)"; |
@@ -10364,14 +10364,14 @@ discard block |
||
10364 | 10364 | if ($resql) { |
10365 | 10365 | // Use select2 selector |
10366 | 10366 | if (!empty($conf->use_javascript_ajax)) { |
10367 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
10367 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
10368 | 10368 | $comboenhancement = ajax_combobox($htmlname, '', 0, $forcefocus); |
10369 | 10369 | $out .= $comboenhancement; |
10370 | 10370 | $morecss = 'minwidth200imp maxwidth500'; |
10371 | 10371 | } |
10372 | 10372 | |
10373 | 10373 | if (empty($option_only)) { |
10374 | - $out .= '<select class="valignmiddle flat' . ($morecss ? ' ' . $morecss : '') . '"' . ($disabled ? ' disabled="disabled"' : '') . ' id="' . $htmlname . '" name="' . $htmlname . '">'; |
|
10374 | + $out .= '<select class="valignmiddle flat'.($morecss ? ' '.$morecss : '').'"'.($disabled ? ' disabled="disabled"' : '').' id="'.$htmlname.'" name="'.$htmlname.'">'; |
|
10375 | 10375 | } |
10376 | 10376 | if (!empty($show_empty)) { |
10377 | 10377 | $out .= '<option value="0" class="optiongrey">'; |
@@ -10401,33 +10401,33 @@ discard block |
||
10401 | 10401 | if ($showproject == 'all') { |
10402 | 10402 | $labeltoshow .= dol_trunc($obj->ref, 18); // Invoice ref |
10403 | 10403 | if ($obj->name) { |
10404 | - $labeltoshow .= ' - ' . $obj->name; // Soc name |
|
10404 | + $labeltoshow .= ' - '.$obj->name; // Soc name |
|
10405 | 10405 | } |
10406 | 10406 | |
10407 | 10407 | $disabled = 0; |
10408 | 10408 | if ($obj->fk_statut == Project::STATUS_DRAFT) { |
10409 | 10409 | $disabled = 1; |
10410 | - $labeltoshow .= ' - ' . $langs->trans("Draft"); |
|
10410 | + $labeltoshow .= ' - '.$langs->trans("Draft"); |
|
10411 | 10411 | } elseif ($obj->fk_statut == Project::STATUS_CLOSED) { |
10412 | 10412 | if ($discard_closed == 2) { |
10413 | 10413 | $disabled = 1; |
10414 | 10414 | } |
10415 | - $labeltoshow .= ' - ' . $langs->trans("Closed"); |
|
10415 | + $labeltoshow .= ' - '.$langs->trans("Closed"); |
|
10416 | 10416 | } elseif ($socid > 0 && (!empty($obj->fk_soc) && $obj->fk_soc != $socid)) { |
10417 | 10417 | $disabled = 1; |
10418 | - $labeltoshow .= ' - ' . $langs->trans("LinkedToAnotherCompany"); |
|
10418 | + $labeltoshow .= ' - '.$langs->trans("LinkedToAnotherCompany"); |
|
10419 | 10419 | } |
10420 | 10420 | } |
10421 | 10421 | |
10422 | 10422 | if (!empty($selected) && $selected == $obj->rowid) { |
10423 | - $out .= '<option value="' . $obj->rowid . '" selected'; |
|
10423 | + $out .= '<option value="'.$obj->rowid.'" selected'; |
|
10424 | 10424 | //if ($disabled) $out.=' disabled'; // with select2, field can't be preselected if disabled |
10425 | - $out .= '>' . $labeltoshow . '</option>'; |
|
10425 | + $out .= '>'.$labeltoshow.'</option>'; |
|
10426 | 10426 | } else { |
10427 | 10427 | if ($hideunselectables && $disabled && ($selected != $obj->rowid)) { |
10428 | 10428 | $resultat = ''; |
10429 | 10429 | } else { |
10430 | - $resultat = '<option value="' . $obj->rowid . '"'; |
|
10430 | + $resultat = '<option value="'.$obj->rowid.'"'; |
|
10431 | 10431 | if ($disabled) { |
10432 | 10432 | $resultat .= ' disabled'; |
10433 | 10433 | } |
@@ -10479,22 +10479,22 @@ discard block |
||
10479 | 10479 | |
10480 | 10480 | $sql = 'SELECT f.rowid, f.entity, f.titre as title, f.suspended, f.fk_soc'; |
10481 | 10481 | //$sql.= ', el.fk_source'; |
10482 | - $sql .= ' FROM ' . MAIN_DB_PREFIX . 'facture_rec as f'; |
|
10483 | - $sql .= " WHERE f.entity IN (" . getEntity('invoice') . ")"; |
|
10482 | + $sql .= ' FROM '.MAIN_DB_PREFIX.'facture_rec as f'; |
|
10483 | + $sql .= " WHERE f.entity IN (".getEntity('invoice').")"; |
|
10484 | 10484 | $sql .= " ORDER BY f.titre ASC"; |
10485 | 10485 | |
10486 | 10486 | $resql = $this->db->query($sql); |
10487 | 10487 | if ($resql) { |
10488 | 10488 | // Use select2 selector |
10489 | 10489 | if (!empty($conf->use_javascript_ajax)) { |
10490 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
10490 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
10491 | 10491 | $comboenhancement = ajax_combobox($htmlname, '', 0, $forcefocus); |
10492 | 10492 | $out .= $comboenhancement; |
10493 | 10493 | $morecss = 'minwidth200imp maxwidth500'; |
10494 | 10494 | } |
10495 | 10495 | |
10496 | 10496 | if (empty($option_only)) { |
10497 | - $out .= '<select class="valignmiddle flat' . ($morecss ? ' ' . $morecss : '') . '"' . ($disabled ? ' disabled="disabled"' : '') . ' id="' . $htmlname . '" name="' . $htmlname . '">'; |
|
10497 | + $out .= '<select class="valignmiddle flat'.($morecss ? ' '.$morecss : '').'"'.($disabled ? ' disabled="disabled"' : '').' id="'.$htmlname.'" name="'.$htmlname.'">'; |
|
10498 | 10498 | } |
10499 | 10499 | if (!empty($show_empty)) { |
10500 | 10500 | $out .= '<option value="0" class="optiongrey">'; |
@@ -10513,19 +10513,19 @@ discard block |
||
10513 | 10513 | $disabled = 0; |
10514 | 10514 | if (!empty($obj->suspended)) { |
10515 | 10515 | $disabled = 1; |
10516 | - $labeltoshow .= ' - ' . $langs->trans("Closed"); |
|
10516 | + $labeltoshow .= ' - '.$langs->trans("Closed"); |
|
10517 | 10517 | } |
10518 | 10518 | |
10519 | 10519 | |
10520 | 10520 | if (!empty($selected) && $selected == $obj->rowid) { |
10521 | - $out .= '<option value="' . $obj->rowid . '" selected'; |
|
10521 | + $out .= '<option value="'.$obj->rowid.'" selected'; |
|
10522 | 10522 | //if ($disabled) $out.=' disabled'; // with select2, field can't be preselected if disabled |
10523 | - $out .= '>' . $labeltoshow . '</option>'; |
|
10523 | + $out .= '>'.$labeltoshow.'</option>'; |
|
10524 | 10524 | } else { |
10525 | 10525 | if ($disabled && ($selected != $obj->rowid)) { |
10526 | 10526 | $resultat = ''; |
10527 | 10527 | } else { |
10528 | - $resultat = '<option value="' . $obj->rowid . '"'; |
|
10528 | + $resultat = '<option value="'.$obj->rowid.'"'; |
|
10529 | 10529 | if ($disabled) { |
10530 | 10530 | $resultat .= ' disabled'; |
10531 | 10531 | } |
@@ -10565,14 +10565,14 @@ discard block |
||
10565 | 10565 | global $langs; |
10566 | 10566 | |
10567 | 10567 | if ($search_component_params_hidden != '' && !preg_match('/^\(.*\)$/', $search_component_params_hidden)) { // If $search_component_params_hidden does not start and end with () |
10568 | - $search_component_params_hidden = '(' . $search_component_params_hidden . ')'; |
|
10568 | + $search_component_params_hidden = '('.$search_component_params_hidden.')'; |
|
10569 | 10569 | } |
10570 | 10570 | |
10571 | 10571 | $ret = ''; |
10572 | 10572 | |
10573 | 10573 | $ret .= '<div class="divadvancedsearchfieldcomp inline-block">'; |
10574 | 10574 | $ret .= '<a href="#" class="dropdownsearch-toggle unsetcolor">'; |
10575 | - $ret .= '<span class="fas fa-filter linkobject boxfilter paddingright pictofixedwidth" title="' . dol_escape_htmltag($langs->trans("Filters")) . '" id="idsubimgproductdistribution"></span>'; |
|
10575 | + $ret .= '<span class="fas fa-filter linkobject boxfilter paddingright pictofixedwidth" title="'.dol_escape_htmltag($langs->trans("Filters")).'" id="idsubimgproductdistribution"></span>'; |
|
10576 | 10576 | $ret .= '</a>'; |
10577 | 10577 | |
10578 | 10578 | $ret .= '<div class="divadvancedsearchfieldcompinput inline-block minwidth500 maxwidth300onsmartphone">'; |
@@ -10598,13 +10598,13 @@ discard block |
||
10598 | 10598 | } |
10599 | 10599 | |
10600 | 10600 | if ($countparenthesis == 0) { |
10601 | - $char2 = dol_substr($search_component_params_hidden, $i+1, 1); |
|
10602 | - $char3 = dol_substr($search_component_params_hidden, $i+2, 1); |
|
10601 | + $char2 = dol_substr($search_component_params_hidden, $i + 1, 1); |
|
10602 | + $char3 = dol_substr($search_component_params_hidden, $i + 2, 1); |
|
10603 | 10603 | if ($char == 'A' && $char2 == 'N' && $char3 == 'D') { |
10604 | 10604 | // We found a AND |
10605 | 10605 | $arrayofandtags[] = trim($s); |
10606 | 10606 | $s = ''; |
10607 | - $i+=2; |
|
10607 | + $i += 2; |
|
10608 | 10608 | } else { |
10609 | 10609 | $s .= $char; |
10610 | 10610 | } |
@@ -10628,8 +10628,8 @@ discard block |
||
10628 | 10628 | include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; |
10629 | 10629 | $searchtags = removeGlobalParenthesis($searchtags); |
10630 | 10630 | |
10631 | - $ret .= '<span class="marginleftonlyshort valignmiddle tagsearch" data-ufilterid="'.($tmpkey+1).'" data-ufilter="'.dol_escape_htmltag($tmpval).'">'; |
|
10632 | - $ret .= '<span class="tagsearchdelete select2-selection__choice__remove" data-ufilterid="'.($tmpkey+1).'">x</span> '; |
|
10631 | + $ret .= '<span class="marginleftonlyshort valignmiddle tagsearch" data-ufilterid="'.($tmpkey + 1).'" data-ufilter="'.dol_escape_htmltag($tmpval).'">'; |
|
10632 | + $ret .= '<span class="tagsearchdelete select2-selection__choice__remove" data-ufilterid="'.($tmpkey + 1).'">x</span> '; |
|
10633 | 10633 | $ret .= dol_escape_htmltag($searchtags); |
10634 | 10634 | $ret .= '</span>'; |
10635 | 10635 | } |
@@ -10646,29 +10646,29 @@ discard block |
||
10646 | 10646 | $ret .= '<input type="hidden" name="show_search_component_params_hidden" value="1">'; |
10647 | 10647 | } |
10648 | 10648 | $ret .= "<!-- We store the full Universal Search String into this field. For example: (t.ref:like:'SO-%') AND ((t.ref:like:'CO-%') OR (t.ref:like:'AA%')) -->"; |
10649 | - $ret .= '<input type="hidden" name="search_component_params_hidden" value="' . dol_escape_htmltag($search_component_params_hidden) . '">'; |
|
10649 | + $ret .= '<input type="hidden" name="search_component_params_hidden" value="'.dol_escape_htmltag($search_component_params_hidden).'">'; |
|
10650 | 10650 | // $ret .= "<!-- sql= ".forgeSQLFromUniversalSearchCriteria($search_component_params_hidden, $errormessage)." -->"; |
10651 | 10651 | |
10652 | 10652 | // For compatibility with forms that show themself the search criteria in addition of this component, we output these fields |
10653 | 10653 | foreach ($arrayofcriterias as $criterias) { |
10654 | 10654 | foreach ($criterias as $criteriafamilykey => $criteriafamilyval) { |
10655 | - if (in_array('search_' . $criteriafamilykey, $arrayofinputfieldsalreadyoutput)) { |
|
10655 | + if (in_array('search_'.$criteriafamilykey, $arrayofinputfieldsalreadyoutput)) { |
|
10656 | 10656 | continue; |
10657 | 10657 | } |
10658 | 10658 | if (in_array($criteriafamilykey, array('rowid', 'ref_ext', 'entity', 'extraparams'))) { |
10659 | 10659 | continue; |
10660 | 10660 | } |
10661 | 10661 | if (in_array($criteriafamilyval['type'], array('date', 'datetime', 'timestamp'))) { |
10662 | - $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_start">'; |
|
10663 | - $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_startyear">'; |
|
10664 | - $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_startmonth">'; |
|
10665 | - $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_startday">'; |
|
10666 | - $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_end">'; |
|
10667 | - $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_endyear">'; |
|
10668 | - $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_endmonth">'; |
|
10669 | - $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_endday">'; |
|
10662 | + $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_start">'; |
|
10663 | + $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_startyear">'; |
|
10664 | + $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_startmonth">'; |
|
10665 | + $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_startday">'; |
|
10666 | + $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_end">'; |
|
10667 | + $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_endyear">'; |
|
10668 | + $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_endmonth">'; |
|
10669 | + $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_endday">'; |
|
10670 | 10670 | } else { |
10671 | - $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '">'; |
|
10671 | + $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'">'; |
|
10672 | 10672 | } |
10673 | 10673 | } |
10674 | 10674 | } |
@@ -10676,7 +10676,7 @@ discard block |
||
10676 | 10676 | $ret .= '</div>'; |
10677 | 10677 | |
10678 | 10678 | $ret .= "<!-- Field to enter a generic filter string: t.ref:like:'SO-%', t.date_creation:<:'20160101', t.date_creation:<:'2016-01-01 12:30:00', t.nature:is:NULL, t.field2:isnot:NULL -->\n"; |
10679 | - $ret .= '<input type="text" placeholder="' . $langs->trans("Search") . '" name="search_component_params_input" class="noborderbottom search_component_input" value="">'; |
|
10679 | + $ret .= '<input type="text" placeholder="'.$langs->trans("Search").'" name="search_component_params_input" class="noborderbottom search_component_input" value="">'; |
|
10680 | 10680 | |
10681 | 10681 | $ret .= '</div>'; |
10682 | 10682 | $ret .= '</div>'; |
@@ -10712,7 +10712,7 @@ discard block |
||
10712 | 10712 | |
10713 | 10713 | $TModels = array(); |
10714 | 10714 | |
10715 | - include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php'; |
|
10715 | + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; |
|
10716 | 10716 | $formmail = new FormMail($this->db); |
10717 | 10717 | $result = $formmail->fetchAllEMailTemplate($modelType, $user, $langs); |
10718 | 10718 | |
@@ -10725,17 +10725,17 @@ discard block |
||
10725 | 10725 | } |
10726 | 10726 | } |
10727 | 10727 | |
10728 | - $retstring .= '<select class="flat" id="select_' . $prefix . 'model_mail" name="' . $prefix . 'model_mail">'; |
|
10728 | + $retstring .= '<select class="flat" id="select_'.$prefix.'model_mail" name="'.$prefix.'model_mail">'; |
|
10729 | 10729 | |
10730 | 10730 | foreach ($TModels as $id_model => $label_model) { |
10731 | - $retstring .= '<option value="' . $id_model . '"'; |
|
10732 | - $retstring .= ">" . $label_model . "</option>"; |
|
10731 | + $retstring .= '<option value="'.$id_model.'"'; |
|
10732 | + $retstring .= ">".$label_model."</option>"; |
|
10733 | 10733 | } |
10734 | 10734 | |
10735 | 10735 | $retstring .= "</select>"; |
10736 | 10736 | |
10737 | 10737 | if ($addjscombo) { |
10738 | - $retstring .= ajax_combobox('select_' . $prefix . 'model_mail'); |
|
10738 | + $retstring .= ajax_combobox('select_'.$prefix.'model_mail'); |
|
10739 | 10739 | } |
10740 | 10740 | |
10741 | 10741 | return $retstring; |
@@ -10786,16 +10786,16 @@ discard block |
||
10786 | 10786 | |
10787 | 10787 | foreach ($buttons as $button) { |
10788 | 10788 | $addclass = empty($button['addclass']) ? '' : $button['addclass']; |
10789 | - $retstring .= '<input type="submit" class="button button-' . $button['name'] . ($morecss ? ' ' . $morecss : '') . ' ' . $addclass . '" name="' . $button['name'] . '" value="' . dol_escape_htmltag($langs->trans($button['label_key'])) . '">'; |
|
10789 | + $retstring .= '<input type="submit" class="button button-'.$button['name'].($morecss ? ' '.$morecss : '').' '.$addclass.'" name="'.$button['name'].'" value="'.dol_escape_htmltag($langs->trans($button['label_key'])).'">'; |
|
10790 | 10790 | } |
10791 | 10791 | $retstring .= $withoutdiv ? '' : '</div>'; |
10792 | 10792 | |
10793 | 10793 | if ($dol_openinpopup) { |
10794 | - $retstring .= '<!-- buttons are shown into a $dol_openinpopup=' . $dol_openinpopup . ' context, so we enable the close of dialog on cancel -->' . "\n"; |
|
10795 | - $retstring .= '<script nonce="' . getNonce() . '">'; |
|
10794 | + $retstring .= '<!-- buttons are shown into a $dol_openinpopup='.$dol_openinpopup.' context, so we enable the close of dialog on cancel -->'."\n"; |
|
10795 | + $retstring .= '<script nonce="'.getNonce().'">'; |
|
10796 | 10796 | $retstring .= 'jQuery(".button-cancel").click(function(e) { |
10797 | - e.preventDefault(); console.log(\'We click on cancel in iframe popup ' . $dol_openinpopup . '\'); |
|
10798 | - window.parent.jQuery(\'#idfordialog' . $dol_openinpopup . '\').dialog(\'close\'); |
|
10797 | + e.preventDefault(); console.log(\'We click on cancel in iframe popup ' . $dol_openinpopup.'\'); |
|
10798 | + window.parent.jQuery(\'#idfordialog' . $dol_openinpopup.'\').dialog(\'close\'); |
|
10799 | 10799 | });'; |
10800 | 10800 | $retstring .= '</script>'; |
10801 | 10801 | } |
@@ -10824,7 +10824,7 @@ discard block |
||
10824 | 10824 | dol_syslog(__METHOD__, LOG_DEBUG); |
10825 | 10825 | |
10826 | 10826 | $sql = "SELECT rowid, code, label as label"; |
10827 | - $sql .= " FROM " . MAIN_DB_PREFIX . 'c_invoice_subtype'; |
|
10827 | + $sql .= " FROM ".MAIN_DB_PREFIX.'c_invoice_subtype'; |
|
10828 | 10828 | $sql .= " WHERE active = 1"; |
10829 | 10829 | |
10830 | 10830 | $resql = $this->db->query($sql); |
@@ -10835,7 +10835,7 @@ discard block |
||
10835 | 10835 | $obj = $this->db->fetch_object($resql); |
10836 | 10836 | |
10837 | 10837 | // If translation exists, we use it, otherwise we take the default wording |
10838 | - $label = ($langs->trans("InvoiceSubtype" . $obj->rowid) != ("InvoiceSubtype" . $obj->rowid)) ? $langs->trans("InvoiceSubtype" . $obj->rowid) : (($obj->label != '-') ? $obj->label : ''); |
|
10838 | + $label = ($langs->trans("InvoiceSubtype".$obj->rowid) != ("InvoiceSubtype".$obj->rowid)) ? $langs->trans("InvoiceSubtype".$obj->rowid) : (($obj->label != '-') ? $obj->label : ''); |
|
10839 | 10839 | $this->cache_invoice_subtype[$obj->rowid]['rowid'] = $obj->rowid; |
10840 | 10840 | $this->cache_invoice_subtype[$obj->rowid]['code'] = $obj->code; |
10841 | 10841 | $this->cache_invoice_subtype[$obj->rowid]['label'] = $label; |
@@ -10867,18 +10867,18 @@ discard block |
||
10867 | 10867 | global $langs, $user; |
10868 | 10868 | |
10869 | 10869 | $out = ''; |
10870 | - dol_syslog(__METHOD__ . " selected=" . $selected . ", htmlname=" . $htmlname, LOG_DEBUG); |
|
10870 | + dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG); |
|
10871 | 10871 | |
10872 | 10872 | $this->load_cache_invoice_subtype(); |
10873 | 10873 | |
10874 | - $out .= '<select id="' . $htmlname . '" class="flat selectsubtype' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">'; |
|
10874 | + $out .= '<select id="'.$htmlname.'" class="flat selectsubtype'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">'; |
|
10875 | 10875 | if ($addempty) { |
10876 | 10876 | $out .= '<option value="0"> </option>'; |
10877 | 10877 | } |
10878 | 10878 | |
10879 | 10879 | foreach ($this->cache_invoice_subtype as $rowid => $subtype) { |
10880 | 10880 | $label = $subtype['label']; |
10881 | - $out .= '<option value="' . $subtype['rowid'] . '"'; |
|
10881 | + $out .= '<option value="'.$subtype['rowid'].'"'; |
|
10882 | 10882 | if ($selected == $subtype['rowid']) { |
10883 | 10883 | $out .= ' selected="selected"'; |
10884 | 10884 | } |