From 740b2c92285aaf60c69fe3849306a6798fc01b74 Mon Sep 17 00:00:00 2001 From: "DEMAREST Maxime (Indelog)" Date: Tue, 28 Apr 2020 08:59:27 +0200 Subject: [PATCH 001/205] NEW possibilty to group payments by mode and show their subtotal This add two params (PAYMENTS_REPORT_GROUP_BY_MOD and PAYMENTS_FOURN_REPORT_GROUP_BY_MOD) for payments and supplier payments to group them by mode and get subtotals for each mode. Add the corresponding configuration options on admin page fore each payments and supplier payments. --- htdocs/admin/payment.php | 14 +++- htdocs/admin/supplier_payment.php | 56 ++++++++++++++ htdocs/compta/paiement/rapport.php | 5 +- .../modules/rapport/pdf_paiement.class.php | 74 +++++++++++++++++-- htdocs/fourn/facture/rapport.php | 5 +- htdocs/langs/en_US/bills.lang | 1 + htdocs/langs/fr_FR/bills.lang | 1 + 7 files changed, 145 insertions(+), 11 deletions(-) diff --git a/htdocs/admin/payment.php b/htdocs/admin/payment.php index e740150e1d5..a5b494b62e2 100644 --- a/htdocs/admin/payment.php +++ b/htdocs/admin/payment.php @@ -1,5 +1,6 @@ + * Copyright (C) 2020 Maxime DEMAREST * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -70,11 +71,12 @@ if ($action == 'setmod') if ($action == 'setparams') { $freetext = GETPOST('FACTURE_PAYMENTS_ON_DIFFERENT_THIRDPARTIES_BILLS', 'none'); // No alpha here, we want exact string - $res = dolibarr_set_const($db, "FACTURE_PAYMENTS_ON_DIFFERENT_THIRDPARTIES_BILLS", $freetext, 'chaine', 0, '', $conf->entity); - if (!$res > 0) $error++; + $res = dolibarr_set_const($db, "PAYMENTS_REPORT_GROUP_BY_MOD", GETPOST('PAYMENTS_REPORT_GROUP_BY_MOD', 'int'), 'chaine', 0, '', $conf->entity); + if (!$res > 0) $error++; + if ($error) { setEventMessages($langs->trans("Error"), null, 'errors'); @@ -253,6 +255,14 @@ print $form->selectyesno("FACTURE_PAYMENTS_ON_DIFFERENT_THIRDPARTIES_BILLS", $co print ''; print "\n"; +// Allow to group payments by mod in rapports +print ''; +print $langs->trans("GroupPaymentsByModOnReports"); +print ''; +print $form->selectyesno("PAYMENTS_REPORT_GROUP_BY_MOD", $conf->global->PAYMENTS_REPORT_GROUP_BY_MOD, 1); +print ''; +print "\n"; + print ''; print ''; diff --git a/htdocs/admin/supplier_payment.php b/htdocs/admin/supplier_payment.php index d533ba0d8eb..e2fc6dce4a7 100644 --- a/htdocs/admin/supplier_payment.php +++ b/htdocs/admin/supplier_payment.php @@ -1,6 +1,7 @@ * Copyright (C) 2016 Laurent Destailleur + * Copyright (C) 2020 Maxime DEMAREST * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -144,6 +145,23 @@ elseif ($action == 'specimen') } } + + +elseif ($action == 'setparams') +{ + $res = dolibarr_set_const($db, "PAYMENTS_FOURN_REPORT_GROUP_BY_MOD", GETPOST('PAYMENTS_FOURN_REPORT_GROUP_BY_MOD', 'int'), 'chaine', 0, '', $conf->entity); + if (!$res > 0) $error++; + + if ($error) + { + setEventMessages($langs->trans("Error"), null, 'errors'); + } + if (!$error) + { + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); + } +} + /* * View */ @@ -428,8 +446,46 @@ foreach ($dirmodels as $reldir) print ''; +/* + * Other Options + */ + +print "
"; + +print load_fiche_titre($langs->trans("OtherOptions"), '', ''); + +print '
'; +print ''; +print ''; + +print '
'; +print ''; +print ''; +print ''; +print ''; +print ''; +print "\n"; + +// Allow to group payments by mod in rapports +print '\n"; + +print '
'.$langs->trans("Parameter").''.$langs->trans("Value").' 
'; +print $langs->trans("GroupPaymentsByModOnReports"); +print ''; +print $form->selectyesno("PAYMENTS_FOURN_REPORT_GROUP_BY_MOD", $conf->global->PAYMENTS_FOURN_REPORT_GROUP_BY_MOD, 1); +print ''; +print "
'; + dol_fiche_end(); +print '
'; +print '
'; +print ''; +print '
'; +print '
'; + +print ''; + // End of page llxFooter(); $db->close(); diff --git a/htdocs/compta/paiement/rapport.php b/htdocs/compta/paiement/rapport.php index 80013d3d865..76a1ce72d76 100644 --- a/htdocs/compta/paiement/rapport.php +++ b/htdocs/compta/paiement/rapport.php @@ -2,6 +2,7 @@ /* Copyright (C) 2003-2006 Rodolphe Quiedeville * Copyright (C) 2004-2014 Laurent Destailleur * Copyright (C) 2015 Jean-François Ferry + * Copyright (C) 2020 Maxime DEMAREST * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -26,6 +27,7 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/modules/rapport/pdf_paiement.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; // Security check @@ -84,6 +86,7 @@ if ($action == 'builddoc') */ $formother = new FormOther($db); +$formfile = new FormFile($db); llxHeader(); @@ -155,7 +158,7 @@ if ($year) $tfile = $dir.'/'.$year.'/'.$file; $relativepath = $year.'/'.$file; print ''; - print ''.img_pdf().' '.$file.''; + print ''.img_pdf().' '.$file.''.$formfile->showPreview($file, 'facture_paiement', $relativepath, 0).''; print ''.dol_print_size(dol_filesize($tfile)).''; print ''.dol_print_date(dol_filemtime($tfile), "dayhour").''; print ''; diff --git a/htdocs/core/modules/rapport/pdf_paiement.class.php b/htdocs/core/modules/rapport/pdf_paiement.class.php index 2377e537606..58b5de4d7d8 100644 --- a/htdocs/core/modules/rapport/pdf_paiement.class.php +++ b/htdocs/core/modules/rapport/pdf_paiement.class.php @@ -2,6 +2,7 @@ /* Copyright (C) 2003-2006 Rodolphe Quiedeville * Copyright (C) 2006-2014 Laurent Destailleur * Copyright (C) 2015-2018 Charlene BENKE + * Copyright (C) 2020 Maxime DEMAREST * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -207,7 +208,11 @@ class pdf_paiement $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id; } if (!empty($socid)) $sql .= " AND s.rowid = ".$socid; - $sql .= " ORDER BY p.datep ASC, pf.fk_paiement ASC"; + // If global param PAYMENTS_REPORT_GROUP_BY_MOD is set, payement are ordered by paiement_code + if (!empty($conf->global->PAYMENTS_REPORT_GROUP_BY_MOD)) + $sql .= " ORDER BY paiement_code ASC, p.datep ASC, pf.fk_paiement ASC"; + else + $sql .= " ORDER BY p.datep ASC, pf.fk_paiement ASC"; break; case "fourn": $sql = "SELECT p.datep as dp, f.ref as ref"; @@ -237,7 +242,11 @@ class pdf_paiement $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id; } if (!empty($socid)) $sql .= " AND s.rowid = ".$socid; - $sql .= " ORDER BY p.datep ASC, pf.fk_paiementfourn ASC"; + // If global param PAYMENTS_FOURN_REPORT_GROUP_BY_MOD is set, payement fourn are ordered by paiement_code + if (!empty($conf->global->PAYMENTS_FOURN_REPORT_GROUP_BY_MOD)) + $sql .= " ORDER BY paiement_code ASC, p.datep ASC, pf.fk_paiementfourn ASC"; + else + $sql .= " ORDER BY p.datep ASC, pf.fk_paiementfourn ASC"; break; } @@ -425,7 +434,7 @@ class pdf_paiement public function Body(&$pdf, $page, $lines, $outputlangs) { // phpcs:enable - global $langs; + global $langs, $conf; $default_font_size = pdf_getPDFFontSize($outputlangs); $pdf->SetFont('', '', $default_font_size - 1); @@ -435,6 +444,11 @@ class pdf_paiement $pdf->SetFillColor(220, 220, 220); $yp = 0; $numlines = count($lines); + if (($this->doc_type == 'client' && !empty($conf->global->PAYMENTS_REPORT_GROUP_BY_MOD)) || ($this->doc_type == 'fourn' && !empty($conf->global->PAYMENTS_FOURN_REPORT_GROUP_BY_MOD))) + { + $mod = $lines[0][2]; + $total_mod = 0; + } for ($j = 0; $j < $numlines; $j++) { $i = $j; @@ -450,8 +464,17 @@ class pdf_paiement { if ($yp > $this->tab_height - 15) { - $pdf->SetXY($this->posxpaymentamount, $this->tab_top + 10 + $yp); - $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxpaymentamount, $this->line_height, $langs->transnoentities('SubTotal')." : ".price($total_page), 0, 'R', 0); + $pdf->SetFillColor(255, 255, 255); + $pdf->Rect($this->marge_gauche +1, $this->tab_top + 10 + $yp, $this->posxpaymentamount - $this->marge_droite -3, $this->line_height, 'F', array(), array()); + $pdf->line($this->marge_gauche, $this->tab_top + 10 + $yp, $this->page_largeur - $this->marge_droite, $this->tab_top + 10 + $yp, array('dash'=>1)); + $pdf->line($this->marge_gauche, $this->tab_top + 15 + $yp, $this->page_largeur - $this->marge_droite, $this->tab_top + 15 + $yp); + $pdf->SetFont('', 'B', $default_font_size - 1); + $pdf->SetXY($this->posxdate -1, $this->tab_top + 10 + $yp); + $pdf->MultiCell($this->posxpaymentamount - 2 - $this->marge_droite, $this->line_height, $langs->transnoentities('SubTotal')." : ", 0, 'R', 1); + $pdf->SetXY($this->posxpaymentamount -1, $this->tab_top + 10 + $yp); + $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxpaymentamount +1, $this->line_height, price($total_page), 0, 'R', 1); + $pdf->SetFont('', '', $default_font_size - 1); + $pdf->SetFillColor(220, 220, 220); $page++; $pdf->AddPage(); $this->_pagehead($pdf, $page, 0, $outputlangs); @@ -474,6 +497,7 @@ class pdf_paiement $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxpaymentamount, $this->line_height, $lines[$j][4], 0, 'R', 1); $yp = $yp + 5; $total_page += $lines[$j][9]; + if (($this->doc_type == 'client' && !empty($conf->global->PAYMENTS_REPORT_GROUP_BY_MOD)) || ($this->doc_type == 'fourn' && !empty($conf->global->PAYMENTS_FOURN_REPORT_GROUP_BY_MOD))) $total_mod += $lines[$j][9]; } // Invoice number @@ -497,9 +521,45 @@ class pdf_paiement { $oldprowid = $lines[$j][7]; } + + // Add line to add total by payment mode if mode reglement for nex line change + if ((($this->doc_type == 'client' && !empty($conf->global->PAYMENTS_REPORT_GROUP_BY_MOD)) || ($this->doc_type == 'fourn' && !empty($conf->global->PAYMENTS_FOURN_REPORT_GROUP_BY_MOD))) && ($mod != $lines[$j+1][2])) + { + $pdf->SetFillColor(245, 245, 245); + $pdf->Rect($this->marge_gauche +1, $this->tab_top + 10 + $yp, $this->posxpaymentamount - $this->marge_droite -3, $this->line_height, 'F', array(), array()); + $pdf->line($this->marge_gauche, $this->tab_top + 10 + $yp, $this->page_largeur - $this->marge_droite, $this->tab_top + 10 + $yp, array('dash'=>1)); + $pdf->line($this->marge_gauche, $this->tab_top + 15 + $yp, $this->page_largeur - $this->marge_droite, $this->tab_top + 15 + $yp); + $pdf->SetXY($this->posxdate -1, $this->tab_top + 10 + $yp); + $pdf->SetFont('', 'I', $default_font_size - 1); + $pdf->MultiCell($this->posxpaymentamount - 2 - $this->marge_droite, $this->line_height, $langs->transnoentities('Total').' '.$mod." : ", 0, 'R', 1); + $pdf->SetXY($this->posxpaymentamount -1, $this->tab_top + 10 + $yp); + $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxpaymentamount +1, $this->line_height, price($total_mod), 0, 'R', 1); + $pdf->SetFont('', '', $default_font_size - 1); + $mod = $lines[$j+1][2]; + $total_mod = 0; + $yp = $yp + 5; + if ($yp > $this->tab_height - 5) + { + $page++; + $pdf->AddPage(); + $this->_pagehead($pdf, $page, 0, $outputlangs); + $pdf->SetFont('', '', $default_font_size - 1); + $yp = 0; + } + $pdf->SetFillColor(220, 220, 220); + } + } $total += $total_page; - $pdf->SetXY($this->posxpaymentamount, $this->tab_top + 10 + $yp); - $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxpaymentamount, $this->line_height, $langs->transnoentities('Total')." : ".price($total), 0, 'R', 0); + $pdf->SetFillColor(255, 255, 255); + $pdf->Rect($this->marge_gauche +1, $this->tab_top + 10 + $yp, $this->posxpaymentamount - $this->marge_droite -3, $this->line_height, 'F', array(), array()); + $pdf->line($this->marge_gauche, $this->tab_top + 10 + $yp, $this->page_largeur - $this->marge_droite, $this->tab_top + 10 + $yp, array('dash'=>1)); + $pdf->line($this->marge_gauche, $this->tab_top + 15 + $yp, $this->page_largeur - $this->marge_droite, $this->tab_top + 15 + $yp); + $pdf->SetXY($this->posxdate -1, $this->tab_top + 10 + $yp); + $pdf->SetFont('', 'B'); + $pdf->MultiCell($this->posxpaymentamount - 2 - $this->marge_droite, $this->line_height, $langs->transnoentities('Total')." : ", 0, 'R', 1); + $pdf->SetXY($this->posxpaymentamount -1, $this->tab_top + 10 + $yp); + $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxpaymentamount +1, $this->line_height, price($total), 0, 'R', 1); + $pdf->SetFillColor(220, 220, 220); } } diff --git a/htdocs/fourn/facture/rapport.php b/htdocs/fourn/facture/rapport.php index f0bf2d85dd1..9f38c4c4f9e 100644 --- a/htdocs/fourn/facture/rapport.php +++ b/htdocs/fourn/facture/rapport.php @@ -1,5 +1,6 @@ + * Copyright (C) 2020 Maxime DEMAREST * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -24,6 +25,7 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/modules/rapport/pdf_paiement_fourn.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; $langs->loadLangs(array('bills')); @@ -86,6 +88,7 @@ if ($action == 'builddoc') */ $formother = new FormOther($db); +$formfile = new FormFile($db); $titre = ($year ? $langs->trans("PaymentsReportsForYear", $year) : $langs->trans("PaymentsReports")); @@ -157,7 +160,7 @@ if ($year) { $tfile = $dir.'/'.$year.'/'.$file; $relativepath = $year.'/'.$file; - print ''.img_pdf().' '.$file.''; + print ''.img_pdf().' '.$file.''.$formfile->showPreview($file, 'facture_fournisseur', 'payments/'.$relativepath, 0).''; print ''.dol_print_size(dol_filesize($tfile)).''; print ''.dol_print_date(dol_filemtime($tfile), "dayhour").''; } diff --git a/htdocs/langs/en_US/bills.lang b/htdocs/langs/en_US/bills.lang index 55de1591689..9f11d8ecf87 100644 --- a/htdocs/langs/en_US/bills.lang +++ b/htdocs/langs/en_US/bills.lang @@ -385,6 +385,7 @@ GeneratedFromTemplate=Generated from template invoice %s WarningInvoiceDateInFuture=Warning, the invoice date is higher than current date WarningInvoiceDateTooFarInFuture=Warning, the invoice date is too far from current date ViewAvailableGlobalDiscounts=View available discounts +GroupPaymentsByModOnReports=Group payments by mode on reports # PaymentConditions Statut=Status PaymentConditionShortRECEP=Due Upon Receipt diff --git a/htdocs/langs/fr_FR/bills.lang b/htdocs/langs/fr_FR/bills.lang index 6ad3faba02d..92a0da802d1 100644 --- a/htdocs/langs/fr_FR/bills.lang +++ b/htdocs/langs/fr_FR/bills.lang @@ -393,6 +393,7 @@ GeneratedFromTemplate=Généré à partir du modèle de facture %s WarningInvoiceDateInFuture=Attention, la date de facturation est antérieur à la date actuelle WarningInvoiceDateTooFarInFuture=Attention, la date de facturation est trop éloignée de la date actuelle ViewAvailableGlobalDiscounts=Voir les remises disponibles +GroupPaymentsByModOnReports=Grouper les paiements par mode sur les rapports # PaymentConditions Statut=État PaymentConditionShortRECEP=A réception From 2cf5f12a62a949f602ac601ac6965977c991af80 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Tue, 28 Apr 2020 07:18:45 +0000 Subject: [PATCH 002/205] Fixing style errors. --- htdocs/admin/supplier_payment.php | 12 ++++++------ htdocs/core/modules/rapport/pdf_paiement.class.php | 1 - 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/htdocs/admin/supplier_payment.php b/htdocs/admin/supplier_payment.php index e2fc6dce4a7..5d7a0d0b8d5 100644 --- a/htdocs/admin/supplier_payment.php +++ b/htdocs/admin/supplier_payment.php @@ -152,14 +152,14 @@ elseif ($action == 'setparams') $res = dolibarr_set_const($db, "PAYMENTS_FOURN_REPORT_GROUP_BY_MOD", GETPOST('PAYMENTS_FOURN_REPORT_GROUP_BY_MOD', 'int'), 'chaine', 0, '', $conf->entity); if (!$res > 0) $error++; - if ($error) + if ($error) { - setEventMessages($langs->trans("Error"), null, 'errors'); - } - if (!$error) + setEventMessages($langs->trans("Error"), null, 'errors'); + } + if (!$error) { - setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); + } } /* diff --git a/htdocs/core/modules/rapport/pdf_paiement.class.php b/htdocs/core/modules/rapport/pdf_paiement.class.php index 58b5de4d7d8..024310abb09 100644 --- a/htdocs/core/modules/rapport/pdf_paiement.class.php +++ b/htdocs/core/modules/rapport/pdf_paiement.class.php @@ -548,7 +548,6 @@ class pdf_paiement } $pdf->SetFillColor(220, 220, 220); } - } $total += $total_page; $pdf->SetFillColor(255, 255, 255); From 79647b35cd2239c4d378c3988e72c9abc789bd31 Mon Sep 17 00:00:00 2001 From: Marc Guenneugues Date: Sat, 2 May 2020 06:42:12 +0200 Subject: [PATCH 003/205] Enable multiple mass actions on a single page - dev branch --- htdocs/core/class/html.form.class.php | 60 ++++++++++++++------------- 1 file changed, 32 insertions(+), 28 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 5eaa7d5ede8..00efbc00dfd 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -665,16 +665,18 @@ class Form * @param string $selected Value auto selected when at least one record is selected. Not a preselected value. Use '0' by default. * @param array $arrayofaction array('code'=>'label', ...). The code is the key stored into the GETPOST('massaction') when submitting action. * @param int $alwaysvisible 1=select button always visible + * @param string $name Name for massaction + * @param string $cssclass CSS class used to check for select * @return string|void Select list */ - public function selectMassAction($selected, $arrayofaction, $alwaysvisible = 0) + public function selectMassAction($selected, $arrayofaction, $alwaysvisible = 0, $name = 'massaction', $cssclass = 'checkforselect') { global $conf, $langs, $hookmanager; $disabled = 0; $ret = '
'; - $ret .= ''; // 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. $parameters = array(); @@ -693,46 +695,46 @@ class Form $ret .= ''; - if (empty($conf->dol_optimize_smallscreen)) $ret .= ajax_combobox('.massactionselect'); + if (empty($conf->dol_optimize_smallscreen)) $ret .= ajax_combobox('.' . $name . 'select'); // 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 $ret .= ''; // Hidden button BEFORE so it is the one used when we submit with ENTER. - $ret .= ''; + $ret .= ''; $ret .= '
'; if (!empty($conf->use_javascript_ajax)) { $ret .= ' -global->TAKEPOS_NUM_TERMINALS != "1" && $_SESSION["takeposterminal"] == "") print '
'.$langs->trans('TerminalSelect').'
'; -?> + global->TAKEPOS_NUM_TERMINALS != "1" && $_SESSION["takeposterminal"] == "") print '
'.$langs->trans('TerminalSelect').'
'; + ?>
global->TAKEPOS_NUM_TERMINALS != "1" && $_SESSION["takeposterminal"]
- Date: Fri, 8 May 2020 18:04:38 +0200 Subject: [PATCH 062/205] Fix URLs --- htdocs/takepos/phone.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/htdocs/takepos/phone.php b/htdocs/takepos/phone.php index 7e454a734a3..8714173e45f 100644 --- a/htdocs/takepos/phone.php +++ b/htdocs/takepos/phone.php @@ -31,7 +31,7 @@ if (!defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); if (!defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); if (!defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); -if (!defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE') && isset($_GET['key'])) require '../main.inc.php'; +if (!defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; @@ -71,14 +71,13 @@ $head = ' '; top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss); -?> - -'; + if ($action=="productinfo"){ $prod = new Product($db); $prod->fetch($idproduct); print "".$prod->label."
"; - print ''; + print ''; print "
".$prod->description; print "
".price($prod->price_ttc, 1, $langs, 1, -1, -1, $conf->currency).""; print '
'; From b89b6d7679546811e13826e74262fa67cd10be75 Mon Sep 17 00:00:00 2001 From: andreubisquerra Date: Fri, 8 May 2020 18:51:49 +0200 Subject: [PATCH 063/205] Name fix --- htdocs/takepos/genimg/qr.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/takepos/genimg/qr.php b/htdocs/takepos/genimg/qr.php index 553f5165a0d..99f7fced1d0 100644 --- a/htdocs/takepos/genimg/qr.php +++ b/htdocs/takepos/genimg/qr.php @@ -32,5 +32,5 @@ $key = GETPOST('key'); $urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root)); $urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file -$module = new modtcpdfbarcode($db); +$module = new modTcpdfbarcode($db); $result = $module->buildBarCode($urlwithroot."/takepos/auto_order.php?key=".dol_encode($key), 'QRCODE', 'Y'); From bba8ab657eea7ae7f28e5369ea59b06b1f3f5937 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 8 May 2020 18:57:15 +0200 Subject: [PATCH 064/205] Fix add missing migration --- htdocs/install/mysql/migration/10.0.0-11.0.0.sql | 11 +++++++++++ htdocs/install/mysql/migration/11.0.0-12.0.0.sql | 9 +++++++++ 2 files changed, 20 insertions(+) diff --git a/htdocs/install/mysql/migration/10.0.0-11.0.0.sql b/htdocs/install/mysql/migration/10.0.0-11.0.0.sql index bc4b562711b..2a7a8963e9f 100644 --- a/htdocs/install/mysql/migration/10.0.0-11.0.0.sql +++ b/htdocs/install/mysql/migration/10.0.0-11.0.0.sql @@ -582,3 +582,14 @@ create table llx_commande_fournisseur_dispatch_extrafields ALTER TABLE llx_commande_fournisseur_dispatch_extrafields ADD INDEX idx_commande_fournisseur_dispatch_extrafields (fk_object); + +create table llx_facturedet_rec_extrafields +( + rowid integer AUTO_INCREMENT PRIMARY KEY, + tms timestamp, + fk_object integer NOT NULL, -- object id + import_key varchar(14) -- import key +)ENGINE=innodb; + +ALTER TABLE llx_facturedet_rec_extrafields ADD INDEX idx_facturedet_rec_extrafields (fk_object); + diff --git a/htdocs/install/mysql/migration/11.0.0-12.0.0.sql b/htdocs/install/mysql/migration/11.0.0-12.0.0.sql index 470d48bbf26..8a68e763160 100644 --- a/htdocs/install/mysql/migration/11.0.0-12.0.0.sql +++ b/htdocs/install/mysql/migration/11.0.0-12.0.0.sql @@ -54,6 +54,15 @@ create table llx_c_shipment_package_type entity integer DEFAULT 1 NOT NULL -- Multi company id )ENGINE=innodb; +create table llx_facturedet_rec_extrafields +( + rowid integer AUTO_INCREMENT PRIMARY KEY, + tms timestamp, + fk_object integer NOT NULL, -- object id + import_key varchar(14) -- import key +)ENGINE=innodb; + +ALTER TABLE llx_facturedet_rec_extrafields ADD INDEX idx_facturedet_rec_extrafields (fk_object); -- For v12 From 3644a718d8b7fd21deec36617724c9a30e119c15 Mon Sep 17 00:00:00 2001 From: Anthony Berton Date: Sat, 9 May 2020 01:02:51 +0200 Subject: [PATCH 065/205] 1 --- htdocs/admin/user.php | 24 ++++++++++++++++++++++++ htdocs/langs/en_US/admin.lang | 1 + htdocs/langs/fr_FR/admin.lang | 1 + 3 files changed, 26 insertions(+) diff --git a/htdocs/admin/user.php b/htdocs/admin/user.php index fb15a57a87e..60cbadcdd3a 100644 --- a/htdocs/admin/user.php +++ b/htdocs/admin/user.php @@ -177,6 +177,30 @@ else } print ''; +// user hide inactive + +print ''; +print ''.$langs->trans("UserHideInactive").''; +print ' '; + +print ''; +if ($conf->use_javascript_ajax) +{ + print ajax_constantonoff('USER_HIDE_INACTIVE_IN_COMBOBOX'); +} +else +{ + if (empty($conf->global->USER_HIDE_INACTIVE_IN_COMBOBOX)) + { + print ''.img_picto($langs->trans("Disabled"), 'off').''; + } + else + { + print ''.img_picto($langs->trans("Enabled"), 'on').''; + } +} +print ''; + print ''; print '
'; diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 3cf6e6044db..e97ed8dbc54 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1272,6 +1272,7 @@ RuleForGeneratedPasswords=Rules to generate and validate passwords DisableForgetPasswordLinkOnLogonPage=Do not show the "Password Forgotten" link on the Login page UsersSetup=Users module setup UserMailRequired=Email required to create a new user +UserHideInactive=Hide inactive users UsersDocModules=Document templates for documents generated from user record GroupsDocModules=Document templates for documents generated from a group record ##### HRM setup ##### diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index 6545b71ede3..172153852e3 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -1272,6 +1272,7 @@ RuleForGeneratedPasswords=Règle pour la génération des mots de passe proposé DisableForgetPasswordLinkOnLogonPage=Cacher le lien "Mot de passe oublié" sur la page de connexion UsersSetup=Configuration du module utilisateurs UserMailRequired=Email requis pour créer un nouvel utilisateur +UserHideInactive=Cacher les utilisateurs inactifs UsersDocModules=Modèles de documents pour les documents générés à partir de la fiche utilisateur GroupsDocModules=Modèles de documents pour les documents générés à partir de la fiche d'un groupe ##### HRM setup ##### From 53eb891a88d9727591ada4601c1f03fed7c22370 Mon Sep 17 00:00:00 2001 From: Anthony Berton Date: Sat, 9 May 2020 18:48:01 +0200 Subject: [PATCH 066/205] Update list.php --- htdocs/product/stock/list.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/htdocs/product/stock/list.php b/htdocs/product/stock/list.php index 15b92c83acc..c13243fc9cb 100644 --- a/htdocs/product/stock/list.php +++ b/htdocs/product/stock/list.php @@ -549,6 +549,11 @@ if ($num) { print ''; if ($key == 'statut') print $warehouse->getLibStatut(5); + if ($key == 'phone') + { + print dol_print_phone($obj->phone, '', 0, $obj->rowid, 'AC_TEL'); + } + elseif ($key == 'fax') print dol_print_phone($obj->fax, '', 0, $obj->rowid, 'AC_FAX'); else print $warehouse->showOutputField($val, $key, $warehouse->$key, ''); print ''; if (!$i) $totalarray['nbfield']++; From fe241ea321982b4b7ee30cf6ea03e7e5c7a7b3e7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 9 May 2020 21:49:12 +0200 Subject: [PATCH 067/205] Fix removed not reliabled info in PHP info --- htdocs/admin/system/phpinfo.php | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/htdocs/admin/system/phpinfo.php b/htdocs/admin/system/phpinfo.php index ce21c1f3ad8..04439d11710 100644 --- a/htdocs/admin/system/phpinfo.php +++ b/htdocs/admin/system/phpinfo.php @@ -143,7 +143,7 @@ $loadedExtensions = array_map('strtolower', get_loaded_extensions(false)); print ''; print ''; print ''; -print ''; +//print ''; print ''; print ''; print ''; @@ -154,7 +154,7 @@ $name = "GD"; print ""; print ""; -print getTableColumn($name, $activatedExtensions); +//print getTableColumn($name, $activatedExtensions); print getTableColumn($name, $loadedExtensions); print getTableColumnFunction($functions); print getResultColumn($name, $activatedExtensions, $loadedExtensions, $functions); @@ -165,7 +165,7 @@ $name = "Curl"; print ""; print ""; -print getTableColumn($name, $activatedExtensions); +//print getTableColumn($name, $activatedExtensions); print getTableColumn($name, $loadedExtensions); print getTableColumnFunction($functions); print getResultColumn($name, $activatedExtensions, $loadedExtensions, $functions); @@ -178,7 +178,7 @@ if (empty($_SERVER["SERVER_ADMIN"]) || $_SERVER["SERVER_ADMIN"] != 'doliwamp@loc print ""; print ""; - print getTableColumn($name, $activatedExtensions); + //print getTableColumn($name, $activatedExtensions); print getTableColumn($name, $loadedExtensions); print getTableColumnFunction($functions); print getResultColumn($name, $activatedExtensions, $loadedExtensions, $functions); @@ -191,7 +191,7 @@ $name = "xDebug"; print ""; print ""; -print getTableColumn($name, $activatedExtensions); +//print getTableColumn($name, $activatedExtensions); print getTableColumn($name, $loadedExtensions); print getTableColumnFunction($functions); print getResultColumn($name, $activatedExtensions, $loadedExtensions, $functions); @@ -208,7 +208,6 @@ foreach ($phparray as $key => $value) print '
'; print '
'.$langs->trans("Extension").''.$langs->trans("EnabledInSetup").''.$langs->trans("EnabledInSetup").''.$langs->trans("Loaded").''.$langs->trans("FunctionTest").''.$langs->trans("Result").'
".$name."
".$name."
".$name."
".$name."
'; print ''; - //print ''; print ''; print ''; print "\n"; @@ -408,7 +407,7 @@ function getResultColumn($name, array $activated, array $loaded, array $function global $langs; $result = true; - $result = $result && in_array(strtolower($name), $activated); + //$result = $result && in_array(strtolower($name), $activated); $result = $result && in_array(strtolower($name), $loaded); foreach ($functions as $function) From 310c5f9eb665ac0331f3b727c81bf65b668da569 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 9 May 2020 21:56:51 +0200 Subject: [PATCH 068/205] Fix size of field --- htdocs/install/mysql/migration/8.0.0-9.0.0.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/mysql/migration/8.0.0-9.0.0.sql b/htdocs/install/mysql/migration/8.0.0-9.0.0.sql index 61f4dc544ba..b7fe131c3f9 100644 --- a/htdocs/install/mysql/migration/8.0.0-9.0.0.sql +++ b/htdocs/install/mysql/migration/8.0.0-9.0.0.sql @@ -200,7 +200,7 @@ CREATE TABLE llx_emailcollector_emailcollectorfilter( rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, fk_emailcollector INTEGER NOT NULL, type varchar(128) NOT NULL, - rulevalue varchar(255) NULL, + rulevalue varchar(128) NULL, date_creation datetime NOT NULL, tms timestamp NOT NULL, fk_user_creat integer NOT NULL, From f40e978475751664c2b4cb1245f5c185b890613c Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sun, 10 May 2020 06:28:50 +0200 Subject: [PATCH 069/205] Fix delbookkeepingyear - add hook printFieldPreListTitle - Look & Feel v12 --- .../accountancy/bookkeeping/listbyaccount.php | 282 +++++++++++++----- htdocs/langs/en_US/accountancy.lang | 1 + 2 files changed, 213 insertions(+), 70 deletions(-) diff --git a/htdocs/accountancy/bookkeeping/listbyaccount.php b/htdocs/accountancy/bookkeeping/listbyaccount.php index ff742c356c4..49dbb81e77d 100644 --- a/htdocs/accountancy/bookkeeping/listbyaccount.php +++ b/htdocs/accountancy/bookkeeping/listbyaccount.php @@ -57,6 +57,12 @@ $search_direction = GETPOST('search_direction', 'alpha'); $search_ledger_code = GETPOST('search_ledger_code', 'alpha'); $search_debit = GETPOST('search_debit', 'alpha'); $search_credit = GETPOST('search_credit', 'alpha'); +$search_lettering_code = GETPOST('search_lettering_code', 'alpha'); +$search_not_reconciled = GETPOST('search_reconciled_option', 'alpha'); + +if (GETPOST("button_delmvt_x") || GETPOST("button_delmvt.x") || GETPOST("button_delmvt")) { + $action = 'delbookkeepingyear'; +} // Load variable for pagination $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : (empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION) ? $conf->liste_limit : $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION); @@ -105,6 +111,7 @@ if (empty($search_date_start) && empty($search_date_end) && GETPOSTISSET('search $arrayfields = array( // 't.subledger_account'=>array('label'=>$langs->trans("SubledgerAccount"), 'checked'=>1), + 't.code_journal'=>array('label'=>$langs->trans("Codejournal"), 'checked'=>1), 't.piece_num'=>array('label'=>$langs->trans("TransactionNumShort"), 'checked'=>1), 't.doc_date'=>array('label'=>$langs->trans("Docdate"), 'checked'=>1), 't.doc_ref'=>array('label'=>$langs->trans("Piece"), 'checked'=>1), @@ -112,10 +119,6 @@ $arrayfields = array( 't.debit'=>array('label'=>$langs->trans("Debit"), 'checked'=>1), 't.credit'=>array('label'=>$langs->trans("Credit"), 'checked'=>1), 't.lettering_code'=>array('label'=>$langs->trans("LetteringCode"), 'checked'=>1), - 't.code_journal'=>array('label'=>$langs->trans("Codejournal"), 'checked'=>1), - // 't.date_creation'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0), - // 't.tms'=>array('label'=>$langs->trans("DateModification"), 'checked'=>0), - // 't.date_export'=>array('label'=>$langs->trans("DateExport"), 'checked'=>1), ); if (empty($conf->global->ACCOUNTING_ENABLE_LETTERING)) unset($arrayfields['t.lettering_code']); @@ -155,6 +158,8 @@ if (empty($reshook)) $search_date_endday = ''; $search_debit = ''; $search_credit = ''; + $search_lettering_code = ''; + $search_not_reconciled = ''; } // Must be after the remove filter action, before the export. @@ -209,9 +214,62 @@ if (empty($reshook)) $filter['t.credit'] = $search_credit; $param .= '&search_credit=' . urlencode($search_credit); } + if (!empty($search_lettering_code)) { + $filter['t.lettering_code'] = $search_lettering_code; + $param .= '&search_lettering_code='.urlencode($search_lettering_code); + } + if (!empty($search_not_reconciled)) { + $filter['t.reconciled_option'] = $search_not_reconciled; + $param .= '&search_not_reconciled='.urlencode($search_not_reconciled); + } } -if ($action == 'delmouvconfirm') { +if ($action == 'delbookkeeping' && $user->rights->accounting->mouvements->supprimer) { + $import_key = GETPOST('importkey', 'alpha'); + + if (!empty($import_key)) { + $result = $object->deleteByImportkey($import_key); + if ($result < 0) { + setEventMessages($object->error, $object->errors, 'errors'); + } + + // Make a redirect to avoid to launch the delete later after a back button + header("Location: listbyaccount.php".($param ? '?'.$param : '')); + exit; + } +} +if ($action == 'delbookkeepingyearconfirm' && $user->rights->accounting->mouvements->supprimer_tous) { + $delmonth = GETPOST('delmonth', 'int'); + $delyear = GETPOST('delyear', 'int'); + if ($delyear == -1) { + $delyear = 0; + } + $deljournal = GETPOST('deljournal', 'alpha'); + if ($deljournal == -1) { + $deljournal = 0; + } + + if (!empty($delmonth) || !empty($delyear) || !empty($deljournal)) + { + $result = $object->deleteByYearAndJournal($delyear, $deljournal, '', ($delmonth > 0 ? $delmonth : 0)); + if ($result < 0) { + setEventMessages($object->error, $object->errors, 'errors'); + } + else + { + setEventMessages("RecordDeleted", null, 'mesgs'); + } + + // Make a redirect to avoid to launch the delete later after a back button + header("Location: listbyaccount.php".($param ? '?'.$param : '')); + exit; + } + else + { + setEventMessages("NoRecordDeleted", null, 'warnings'); + } +} +if ($action == 'delmouvconfirm' && $user->rights->accounting->mouvements->supprimer) { $mvt_num = GETPOST('mvt_num', 'int'); if (!empty($mvt_num)) { @@ -219,8 +277,13 @@ if ($action == 'delmouvconfirm') { if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); } - Header("Location: listbyaccount.php"); - exit(); + else + { + setEventMessages($langs->trans("RecordDeleted"), null, 'mesgs'); + } + + header("Location: listbyaccount.php?noreset=1".($param ? '&'.$param : '')); + exit; } } @@ -262,22 +325,42 @@ if ($action == 'delmouv') { } if ($action == 'delbookkeepingyear') { $form_question = array(); - $delyear = GETPOST('delyear'); + $delyear = GETPOST('delyear', 'int'); + $deljournal = GETPOST('deljournal', 'alpha'); if (empty($delyear)) { $delyear = dol_print_date(dol_now(), '%Y'); } + $month_array = array(); + for ($i = 1; $i <= 12; $i++) { + $month_array[$i] = $langs->trans("Month".sprintf("%02d", $i)); + } $year_array = $formaccounting->selectyear_accountancy_bookkepping($delyear, 'delyear', 0, 'array'); + $journal_array = $formaccounting->select_journal($deljournal, 'deljournal', '', 1, 1, 1, '', 0, 1); + $form_question['delmonth'] = array( + 'name' => 'delmonth', + 'type' => 'select', + 'label' => $langs->trans('DelMonth'), + 'values' => $month_array, + 'default' => '' + ); $form_question['delyear'] = array( - 'name' => 'delyear', - 'type' => 'select', - 'label' => $langs->trans('DelYear'), - 'values' => $year_array, - 'default' => $delyear + 'name' => 'delyear', + 'type' => 'select', + 'label' => $langs->trans('DelYear'), + 'values' => $year_array, + 'default' => $delyear + ); + $form_question['deljournal'] = array( + 'name' => 'deljournal', + 'type' => 'other', // We don't use select here, the journal_array is already a select html component + 'label' => $langs->trans('DelJournal'), + 'value' => $journal_array, + 'default' => $deljournal ); - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans('DeleteMvt'), $langs->trans('ConfirmDeleteMvt'), 'delbookkeepingyearconfirm', $form_question, 0, 1, 250); + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?'.$param, $langs->trans('DeleteMvt'), $langs->trans('ConfirmDeleteMvt'), 'delbookkeepingyearconfirm', $form_question, '', 1, 300); print $formconfirm; } @@ -304,35 +387,41 @@ $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; $selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields if ($massactionbutton) $selectedfields .= $form->showCheckAddButtons('checkforselect', 1); +// Reverse sort order +if (preg_match('/^asc/i', $sortorder)) $sortorder = "asc"; +else $sortorder = "desc"; + +$moreforfilter = ''; + +// Accountancy account +$moreforfilter .= '
'; +$moreforfilter .= $langs->trans('AccountAccounting').': '; +$moreforfilter .= '
'; +$moreforfilter .= $langs->trans('From').' '; +$moreforfilter .= $formaccounting->select_account($search_accountancy_code_start, 'search_accountancy_code_start', 1, array(), 1, 1, 'maxwidth200'); +$moreforfilter .= $langs->trans('to').' '; +$moreforfilter .= $formaccounting->select_account($search_accountancy_code_end, 'search_accountancy_code_end', 1, array(), 1, 1, 'maxwidth200'); +$moreforfilter .= '
'; +$moreforfilter .= '
'; + $parameters = array(); $reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters); // Note that $action and $object may have been modified by hook if (empty($reshook)) $moreforfilter .= $hookmanager->resPrint; else $moreforfilter = $hookmanager->resPrint; -// Reverse sort order -if (preg_match('/^asc/i', $sortorder)) $sortorder = "asc"; -else $sortorder = "desc"; +print '
'; +print $moreforfilter; +print '
'; print '
'; print '
'.$langs->trans("Parameter").''.$key.''.$langs->trans("Value").'
'; // Filters lines print ''; -// Accountancy account -print ''; -// Movement number -if (!empty($arrayfields['t.piece_num']['checked'])) -{ - print ''; + +// Code journal +if (!empty($arrayfields['t.code_journal']['checked'])) { + print ''; } // Date document if (!empty($arrayfields['t.doc_date']['checked'])) { @@ -347,6 +436,11 @@ if (!empty($arrayfields['t.doc_date']['checked'])) { print ''; print ''; } +// Movement number +if (!empty($arrayfields['t.piece_num']['checked'])) +{ + print ''; +} // Ref document if (!empty($arrayfields['t.doc_ref']['checked'])) { print ''; @@ -363,9 +457,13 @@ if (!empty($arrayfields['t.debit']['checked'])) { if (!empty($arrayfields['t.credit']['checked'])) { print ''; } -// Code journal -if (!empty($arrayfields['t.code_journal']['checked'])) { - print ''; +// Lettering code +if (!empty($arrayfields['t.lettering_code']['checked'])) +{ + print ''; } // Fields from hook @@ -381,14 +479,14 @@ print ''; print "\n"; print ''; -print_liste_field_titre("AccountAccountingShort", $_SERVER['PHP_SELF']); -if (!empty($arrayfields['t.piece_num']['checked'])) print_liste_field_titre($arrayfields['t.piece_num']['label'], $_SERVER['PHP_SELF'], "t.piece_num", "", $param, '', $sortfield, $sortorder); +if (!empty($arrayfields['t.code_journal']['checked'])) print_liste_field_titre($arrayfields['t.code_journal']['label'], $_SERVER['PHP_SELF'], "t.code_journal", "", $param, '', $sortfield, $sortorder, 'center '); if (!empty($arrayfields['t.doc_date']['checked'])) print_liste_field_titre($arrayfields['t.doc_date']['label'], $_SERVER['PHP_SELF'], "t.doc_date", "", $param, '', $sortfield, $sortorder, 'center '); +if (!empty($arrayfields['t.piece_num']['checked'])) print_liste_field_titre($arrayfields['t.piece_num']['label'], $_SERVER['PHP_SELF'], "t.piece_num", "", $param, '', $sortfield, $sortorder); if (!empty($arrayfields['t.doc_ref']['checked'])) print_liste_field_titre($arrayfields['t.doc_ref']['label'], $_SERVER['PHP_SELF'], "t.doc_ref", "", $param, "", $sortfield, $sortorder); if (!empty($arrayfields['t.label_operation']['checked'])) print_liste_field_titre($arrayfields['t.label_operation']['label'], $_SERVER['PHP_SELF'], "t.label_operation", "", $param, "", $sortfield, $sortorder); if (!empty($arrayfields['t.debit']['checked'])) print_liste_field_titre($arrayfields['t.debit']['label'], $_SERVER['PHP_SELF'], "t.debit", "", $param, '', $sortfield, $sortorder, 'right '); if (!empty($arrayfields['t.credit']['checked'])) print_liste_field_titre($arrayfields['t.credit']['label'], $_SERVER['PHP_SELF'], "t.credit", "", $param, '', $sortfield, $sortorder, 'right '); -if (!empty($arrayfields['t.code_journal']['checked'])) print_liste_field_titre($arrayfields['t.code_journal']['label'], $_SERVER['PHP_SELF'], "t.code_journal", "", $param, '', $sortfield, $sortorder, 'center '); +if (!empty($arrayfields['t.lettering_code']['checked'])) print_liste_field_titre($arrayfields['t.lettering_code']['label'], $_SERVER['PHP_SELF'], "t.lettering_code", "", $param, '', $sortfield, $sortorder, 'center '); // Hook fields $parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder); $reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters); // Note that $action and $object may have been modified by hook @@ -419,18 +517,42 @@ while ($i < min($num, $limit)) // Is it a break ? if ($accountg != $displayed_account_number || !isset($displayed_account_number)) { - // Affiche un Sous-Total par compte comptable + + $colspan = $totalarray['nbfield'] - 3; + $colspanend = $totalarray['nbfield'] - 7; + // Show a subtotal by accounting account if (isset($displayed_account_number)) { - print ''; - print "\n"; - print "\n"; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + // Show balance of last shown account + $balance = $sous_total_debit - $sous_total_credit; + print ''; + print ''; + if ($balance > 0 ) + { + print ''; + print ''; + } + else + { + print ''; + print ''; + } + print ''; print ''; } // Show the break account - $colspan = 9; print ""; - print ''; @@ -440,11 +562,28 @@ while ($i < min($num, $limit)) //if (empty($displayed_account_number)) $displayed_account_number='-'; $sous_total_debit = 0; $sous_total_credit = 0; + + $colspan = 0; } print ''; - print ''; - if (!$i) $totalarray['nbfield']++; + + // Journal code + if (!empty($arrayfields['t.code_journal']['checked'])) + { + $accountingjournal = new AccountingJournal($db); + $result = $accountingjournal->fetch('', $line->code_journal); + $journaltoshow = (($result > 0) ? $accountingjournal->getNomUrl(0, 0, 0, '', 0) : $line->code_journal); + print ''; + if (!$i) $totalarray['nbfield']++; + } + + // Document date + if (!empty($arrayfields['t.doc_date']['checked'])) + { + print ''; + if (!$i) $totalarray['nbfield']++; + } // Piece number if (!empty($arrayfields['t.piece_num']['checked'])) @@ -457,13 +596,6 @@ while ($i < min($num, $limit)) if (!$i) $totalarray['nbfield']++; } - // Document date - if (!empty($arrayfields['t.doc_date']['checked'])) - { - print ''; - if (!$i) $totalarray['nbfield']++; - } - // Document ref if (!empty($arrayfields['t.doc_ref']['checked'])) { @@ -565,16 +697,6 @@ while ($i < min($num, $limit)) if (!$i) $totalarray['nbfield']++; } - // Journal code - if (!empty($arrayfields['t.code_journal']['checked'])) - { - $accountingjournal = new AccountingJournal($db); - $result = $accountingjournal->fetch('', $line->code_journal); - $journaltoshow = (($result > 0) ? $accountingjournal->getNomUrl(0, 0, 0, '', 0) : $line->code_journal); - print ''; - if (!$i) $totalarray['nbfield']++; - } - // Fields from hook $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj); $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook @@ -591,25 +713,45 @@ while ($i < min($num, $limit)) } } print ''; + if (!$i) $totalarray['nbfield']++; // Comptabilise le sous-total $sous_total_debit += $line->debit; $sous_total_credit += $line->credit; - if (!$i) $totalarray['nbfield']++; - print "\n"; $i++; } // Show sub-total of last shown account +$colspan = $totalarray['nbfield'] - 3; +$colspanend = $totalarray['nbfield'] - 8; print ''; -print ''; -print ''; -print ''; +print ''; +print ''; +print ''; +print ''; +print ''; +// Show balance of last shown account +$balance = $sous_total_debit - $sous_total_credit; +print ''; +print ''; +if ($balance > 0 ) +{ + print ''; + print ''; +} +else +{ + print ''; + print ''; +} +print ''; print ''; // Show total line diff --git a/htdocs/langs/en_US/accountancy.lang b/htdocs/langs/en_US/accountancy.lang index eb3229efaee..adf2309ad07 100644 --- a/htdocs/langs/en_US/accountancy.lang +++ b/htdocs/langs/en_US/accountancy.lang @@ -121,6 +121,7 @@ InvoiceLinesDone=Bound lines of invoices ExpenseReportLines=Lines of expense reports to bind ExpenseReportLinesDone=Bound lines of expense reports IntoAccount=Bind line with the accounting account +TotalForAccount=Total for accounting account Ventilate=Bind From ff578198d63c4e8f4b852c96c4380f264e38b74c Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Sun, 10 May 2020 04:35:52 +0000 Subject: [PATCH 070/205] Fixing style errors. --- htdocs/accountancy/bookkeeping/listbyaccount.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/accountancy/bookkeeping/listbyaccount.php b/htdocs/accountancy/bookkeeping/listbyaccount.php index 49dbb81e77d..25f664d955e 100644 --- a/htdocs/accountancy/bookkeeping/listbyaccount.php +++ b/htdocs/accountancy/bookkeeping/listbyaccount.php @@ -517,7 +517,6 @@ while ($i < min($num, $limit)) // Is it a break ? if ($accountg != $displayed_account_number || !isset($displayed_account_number)) { - $colspan = $totalarray['nbfield'] - 3; $colspanend = $totalarray['nbfield'] - 7; // Show a subtotal by accounting account From 04480847df1ca79066567d41c58e613ed03a4189 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sun, 10 May 2020 08:28:03 +0200 Subject: [PATCH 071/205] NEW Accountancy balance - Add a button ShowSubtotalByGroup --- htdocs/accountancy/bookkeeping/balance.php | 61 ++++++++++++++-------- htdocs/langs/en_US/accountancy.lang | 1 + 2 files changed, 39 insertions(+), 23 deletions(-) diff --git a/htdocs/accountancy/bookkeeping/balance.php b/htdocs/accountancy/bookkeeping/balance.php index b2a25b00ce2..7b99057f73a 100644 --- a/htdocs/accountancy/bookkeeping/balance.php +++ b/htdocs/accountancy/bookkeeping/balance.php @@ -55,7 +55,7 @@ $pagenext = $page + 1; //if (! $sortfield) $sortfield="p.date_fin"; //if (! $sortorder) $sortorder="DESC"; - +$show_subgroup = GETPOST('show_subgroup', 'alpha'); $search_date_start = dol_mktime(0, 0, 0, GETPOST('date_startmonth', 'int'), GETPOST('date_startday', 'int'), GETPOST('date_startyear', 'int')); $search_date_end = dol_mktime(23, 59, 59, GETPOST('date_endmonth', 'int'), GETPOST('date_endday', 'int'), GETPOST('date_endyear', 'int')); @@ -130,10 +130,11 @@ if (!empty($search_accountancy_code_end)) { if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) // All tests are required to be compatible with all browsers { - $search_accountancy_code_start = ''; - $search_accountancy_code_end = ''; + $show_subgroup = ''; $search_date_start = ''; $search_date_end = ''; + $search_accountancy_code_start = ''; + $search_accountancy_code_end = ''; $filter = array(); } @@ -223,6 +224,12 @@ if ($action != 'export_csv') $moreforfilter .= $form->selectDate($search_date_start ? $search_date_start : -1, 'date_start', 0, 0, 1, '', 1, 0); $moreforfilter .= $langs->trans('DateEnd').': '; $moreforfilter .= $form->selectDate($search_date_end ? $search_date_end : -1, 'date_end', 0, 0, 1, '', 1, 0); + + $moreforfilter .= ' - '; + $moreforfilter .= $langs->trans('ShowSubtotalByGroup').': '; + $moreforfilter .= ''; + + $moreforfilter .= ''; if (!empty($moreforfilter)) { @@ -289,26 +296,31 @@ if ($action != 'export_csv') } print ''; - // Permet d'afficher le compte comptable - if (empty($displayed_account) || $root_account_description != $displayed_account) + if(!empty($show_subgroup)) { - // Affiche un Sous-Total par compte comptable - if ($displayed_account != "") { - print ''; - print "\n"; + // Permet d'afficher le compte comptable + if (empty($displayed_account) || $root_account_description != $displayed_account) { + // Affiche un Sous-Total par compte comptable + if ($displayed_account != "") { + print ''; + print ''; + print ''; + print ''; + print "\n"; + print "\n"; + print ''; + } + + // Show first line of a break + print ''; + print ''; print ''; + + $displayed_account = $root_account_description; + $sous_total_debit = 0; + $sous_total_credit = 0; } - - // Show first line of a break - print ''; - print ''; - print ''; - - $displayed_account = $root_account_description; - $sous_total_debit = 0; - $sous_total_credit = 0; } - // $object->get_compte_racine($line->numero_compte); print ''; @@ -326,12 +338,15 @@ if ($action != 'export_csv') $sous_total_credit += $line->credit; } - print ''; - print "\n"; - print ''; + if(!empty($show_subgroup)) + { + print ''; + print "\n"; + print ''; + } print ''; - print "\n"; + print "\n"; print ''; print "
'; -print '
'; -print $langs->trans('From').' '; -print $formaccounting->select_account($search_accountancy_code_start, 'search_accountancy_code_start', 1, array(), 1, 1, 'maxwidth200'); -print '
'; -print '
'; -print $langs->trans('to').' '; -print $formaccounting->select_account($search_accountancy_code_end, 'search_accountancy_code_end', 1, array(), 1, 1, 'maxwidth200'); -print '
'; -print '
'; + print ''; + print '
'.$langs->trans("NotReconciled").''; + print '
'.$langs->trans("SubTotal").':'.price($sous_total_debit).''.price($sous_total_credit).'  
'.$langs->trans("TotalForAccount").' '.length_accountg($displayed_account_number).':'.price($sous_total_debit).''.price($sous_total_credit).'
'.$langs->trans("Balance").':'; + print price($sous_total_debit - $sous_total_credit); + print ''; + print price($sous_total_credit - $sous_total_debit); + print '
'; + print ''; if ($line->numero_compte != "" && $line->numero_compte != '-1') print length_accountg($line->numero_compte).' : '.$object->get_compte_desc($line->numero_compte); else print ''.$langs->trans("Unknown").''; print '
 '.$journaltoshow.''.dol_print_date($line->doc_date, 'day').''.dol_print_date($line->doc_date, 'day').''.$journaltoshow.'
'.$langs->trans("SubTotal").':'.price($sous_total_debit).''.price($sous_total_credit).''; -print price($sous_total_debit - $sous_total_credit); -print ''.$langs->trans("TotalForAccount").' '.$accountg.':'.price($sous_total_debit).''.price($sous_total_credit).'
'.$langs->trans("Balance").':'; + print price($sous_total_debit - $sous_total_credit); + print ''; + print price($sous_total_credit - $sous_total_debit); + print '
'.$langs->trans("SubTotal").':'.price($sous_total_debit).''.price($sous_total_credit).''.price(price2num($sous_total_credit - $sous_total_debit)).' 
' . $langs->trans("SubTotal") . ':' . price($sous_total_debit) . '' . price($sous_total_credit) . '' . price(price2num($sous_total_credit - $sous_total_debit)) . '
' . $line->numero_compte . ($root_account_description ? ' - ' . $root_account_description : '') . '
'.$line->numero_compte.($root_account_description ? ' - '.$root_account_description : '').'
'.length_accountg($line->numero_compte).'
'.$langs->trans("SubTotal").':'.price($sous_total_debit).''.price($sous_total_credit).''.price(price2num($sous_total_debit - $sous_total_credit)).' 
' . $langs->trans("SubTotal") . ':' . price($sous_total_debit) . '' . price($sous_total_credit) . '' . price(price2num($sous_total_debit - $sous_total_credit)) . '
'.$langs->trans("AccountBalance").':'.price($total_debit).''.price($total_credit).''.price(price2num($total_debit - $total_credit)).' 
"; diff --git a/htdocs/langs/en_US/accountancy.lang b/htdocs/langs/en_US/accountancy.lang index eb3229efaee..a3d4437b043 100644 --- a/htdocs/langs/en_US/accountancy.lang +++ b/htdocs/langs/en_US/accountancy.lang @@ -235,6 +235,7 @@ UnknownAccountForThirdpartyAndWaitingAccountNotDefinedBlocking=Unknown third-par PaymentsNotLinkedToProduct=Payment not linked to any product / service ShowOpeningBalance=Show opening balance HideOpeningBalance=Hide opening balance +ShowSubtotalByGroup=Show subtotal by group Pcgtype=Group of account PcgtypeDesc=Group of account are used as predefined 'filter' and 'grouping' criteria for some accounting reports. For example, 'INCOME' or 'EXPENSE' are used as groups for accounting accounts of products to build the expense/income report. From 796f97c6715e16b162c9d23952c63a34d728ee8f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 10 May 2020 15:08:01 +0200 Subject: [PATCH 072/205] Support tag $capture in input of files --- htdocs/core/class/html.formfile.class.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 98d781a51c1..26abcf2e721 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -78,9 +78,10 @@ class FormFile * @param string $accept Specifies the types of files accepted (This is not a security check but an user interface facility. eg '.pdf,image/*' or '.png,.jpg' or 'video/*') * @param string $sectiondir If upload must be done inside a particular directory (if sectiondir defined, sectionid must not be) * @param int $usewithoutform 0=Default, 1=Disable
and style to use in existing area + * @param int $capture 1=Add tag capture="capture" to force use of micro or video recording to generate file. When setting this to 1, you must also provide a value for $accept. * @return int <0 if KO, >0 if OK */ - public function form_attach_new_file($url, $title = '', $addcancel = 0, $sectionid = 0, $perm = 1, $size = 50, $object = '', $options = '', $useajax = 1, $savingdocmask = '', $linkfiles = 1, $htmlname = 'formuserfile', $accept = '', $sectiondir = '', $usewithoutform = 0) + public function form_attach_new_file($url, $title = '', $addcancel = 0, $sectionid = 0, $perm = 1, $size = 50, $object = '', $options = '', $useajax = 1, $savingdocmask = '', $linkfiles = 1, $htmlname = 'formuserfile', $accept = '', $sectiondir = '', $usewithoutform = 0, $capture = 0) { // phpcs:enable global $conf, $langs, $hookmanager; @@ -170,6 +171,7 @@ class FormFile $out .= ((!empty($conf->global->MAIN_DISABLE_MULTIPLE_FILEUPLOAD) || $conf->browser->layout != 'classic') ? ' name="userfile"' : ' name="userfile[]" multiple'); $out .= (empty($conf->global->MAIN_UPLOAD_DOC) || empty($perm) ? ' disabled' : ''); $out .= (!empty($accept) ? ' accept="'.$accept.'"' : ' accept=""'); + $out .= (!empty($capture) ? ' capture="capture"' : ''); $out .= '>'; $out .= ' '; if ($sectionid) { // Show overwrite if exists for ECM module only From 501f1ba2c403f12c90c8a76810bec39540581e64 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 10 May 2020 15:45:07 +0200 Subject: [PATCH 073/205] Fix look and feel v12 --- htdocs/contrat/document.php | 1 - htdocs/core/ajax/selectsearchbox.php | 2 +- htdocs/core/lib/functions.lib.php | 9 +++++---- htdocs/main.inc.php | 8 ++++---- htdocs/theme/eldy/global.inc.php | 6 +++++- htdocs/theme/md/style.css.php | 2 ++ 6 files changed, 17 insertions(+), 11 deletions(-) diff --git a/htdocs/contrat/document.php b/htdocs/contrat/document.php index 7d47b5102ac..fd3b3f66e4a 100644 --- a/htdocs/contrat/document.php +++ b/htdocs/contrat/document.php @@ -179,7 +179,6 @@ if ($object->id) print '
'; print '
'; - print ''; print ''; print ''; diff --git a/htdocs/core/ajax/selectsearchbox.php b/htdocs/core/ajax/selectsearchbox.php index 2f8ad4ab5f7..31a95d1e02c 100644 --- a/htdocs/core/ajax/selectsearchbox.php +++ b/htdocs/core/ajax/selectsearchbox.php @@ -99,7 +99,7 @@ if (!empty($conf->commande->enabled) && empty($conf->global->MAIN_SEARCHFORM_CUS } if (!empty($conf->expedition->enabled) && empty($conf->global->MAIN_SEARCHFORM_CUSTOMER_SHIPMENT_DISABLED) && $user->rights->expedition->lire) { - $arrayresult['searchintoshipment'] = array('position'=>80, 'img'=>'object_sending', 'label'=>$langs->trans("SearchIntoCustomerShipments", $search_boxvalue), 'text'=>img_picto('', 'object_sending').' '.$langs->trans("SearchIntoCustomerShipments", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/expedition/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : '')); + $arrayresult['searchintoshipment'] = array('position'=>80, 'img'=>'object_shipment', 'label'=>$langs->trans("SearchIntoCustomerShipments", $search_boxvalue), 'text'=>img_picto('', 'object_shipment').' '.$langs->trans("SearchIntoCustomerShipments", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/expedition/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : '')); } if (!empty($conf->facture->enabled) && empty($conf->global->MAIN_SEARCHFORM_CUSTOMER_INVOICE_DISABLED) && $user->rights->facture->lire) { diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index bcf47a58eef..89e76156448 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3162,7 +3162,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'object_margin', 'object_money-bill-alt', 'object_multicurrency', 'object_order', 'object_payment', 'object_lot', 'object_mrp', 'object_payment', 'object_product', 'object_propal', 'object_other', 'object_paragraph', 'object_poll', 'object_printer', 'object_project', 'object_projectpub', 'object_propal', 'object_resource', 'object_rss', 'object_projecttask', - 'object_supplier_invoice', 'object_supplier_order', 'object_supplier_proposal', 'object_service', 'object_stock', + 'object_shipment', 'object_supplier_invoice', 'object_supplier_order', 'object_supplier_proposal', 'object_service', 'object_stock', 'object_technic', 'object_ticket', 'object_trip', 'object_user', 'object_group', 'object_member', 'object_phoning', 'object_phoning_mobile', 'object_phoning_fax', 'object_email', 'off', 'on', 'order', @@ -3209,7 +3209,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'resize'=>'crop', 'supplier_order'=>'dol-order_supplier', 'supplier_proposal'=>'file-signature', 'payment'=>'money-check-alt', 'phoning'=>'phone', 'phoning_mobile'=>'mobile-alt', 'phoning_fax'=>'fax', 'printer'=>'print', 'product'=>'cube', 'service'=>'concierge-bell', 'resource'=>'laptop-house', - 'stock'=>'box-open', 'stats' => 'chart-bar', 'split'=>'code-branch', 'supplier_invoice'=>'file-invoice-dollar', 'technic'=>'cogs', 'ticket'=>'ticket-alt', + 'shipment'=>'dolly', 'stock'=>'box-open', 'stats' => 'chart-bar', 'split'=>'code-branch', 'supplier_invoice'=>'file-invoice-dollar', 'technic'=>'cogs', 'ticket'=>'ticket-alt', 'title_setup'=>'tools', 'title_accountancy'=>'money-check-alt', 'title_bank'=>'university', 'title_hrm'=>'umbrella-beach', 'title_agenda'=>'calendar-alt', 'uparrow'=>'mail-forward', @@ -3273,7 +3273,8 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'error'=>'pictoerror', 'warning'=>'pictowarning', 'switch_on'=>'font-status4', 'holiday'=>'bg-infobox-holiday', 'invoice'=>'bg-infobox-commande', 'payment'=>'bg-infobox-bank_account', 'poll'=>'bg-infobox-adherent', 'project'=>'bg-infobox-project', 'projecttask'=>'bg-infobox-project', 'propal'=>'bg-infobox-propal', - 'resource'=>'bg-infobox-action', 'supplier_invoice'=>'bg-infobox-order_supplier', 'supplier_order'=>'bg-infobox-order_supplier', 'supplier_proposal'=>'bg-infobox-supplier_proposal', + 'resource'=>'bg-infobox-action', + 'supplier_invoice'=>'bg-infobox-order_supplier', 'supplier_order'=>'bg-infobox-order_supplier', 'supplier_proposal'=>'bg-infobox-supplier_proposal', 'ticket'=>'bg-infobox-contrat', 'title_accountancy'=>'bg-infobox-bank_account', 'title_hrm'=>'bg-infobox-holiday', 'trip'=>'bg-infobox-expensereport', 'title_agenda'=>'bg-infobox-action', //'title_setup'=>'bg-infobox-action', 'tools'=>'bg-infobox-action', 'list-alt'=>'imgforviewmode', 'calendar'=>'imgforviewmode', 'calendarweek'=>'imgforviewmode', 'calendarmonth'=>'imgforviewmode', 'calendarday'=>'imgforviewmode', 'calendarperuser'=>'imgforviewmode' @@ -3291,7 +3292,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'map-marker-alt'=>'#aaa', 'mrp'=>'#a69944', 'product'=>'#a69944', 'service'=>'#a69944', 'stock'=>'#a69944', 'other'=>'#ddd', 'playdisabled'=>'#ccc', 'printer'=>'#444', 'projectpub'=>'#986c6a', 'resize'=>'#444', 'rss'=>'#cba', - 'stats'=>'#444', 'switch_off'=>'#999', 'uparrow'=>'#555', 'globe-americas'=>'#aaa' + 'shipment'=>'#a69944', 'stats'=>'#444', 'switch_off'=>'#999', 'uparrow'=>'#555', 'globe-americas'=>'#aaa' ); if (isset($arrayconvpictotocolor[$pictowithouttext])) { $facolor = $arrayconvpictotocolor[$pictowithouttext]; diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 6533b4bfe54..8ebd68631cb 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -2180,7 +2180,7 @@ function left_menu($menu_array_before, $helppagename = '', $notused = '', $menu_ } else { if (is_array($arrayresult)) { foreach ($arrayresult as $key => $val) { - $searchform .= printSearchForm($val['url'], $val['url'], $val['label'], 'maxwidth125', 'sall', $val['shortcut'], 'searchleft'.$key, img_picto('', $val['img'], '', false, 1, 1)); + $searchform .= printSearchForm($val['url'], $val['url'], $val['label'], 'maxwidth125', 'sall', $val['shortcut'], 'searchleft'.$key, $val['img']); } } } @@ -2453,14 +2453,14 @@ function printSearchForm($urlaction, $urlobject, $title, $htmlmorecss, $htmlinpu $ret .= ''; if ($showtitlebefore) $ret .= '
'.$title.'
'; $ret .= '
'; + $ret .= img_picto('', $img, '', false, 0, 0, '', 'paddingright width20'); $ret .= ''; - //$ret.=''; - $ret .= ''; $ret .= '
'; diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 9e099c6953d..4ec62c217a5 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -1027,6 +1027,7 @@ table[summary="list_of_modules"] .fa-cog { /* rule for not too small screen only */ @media only screen and (min-width: global->THEME_ELDY_WITDHOFFSET_FOR_REDUC3) ? round($nbtopmenuentries * 47, 0) + 130 : $conf->global->THEME_ELDY_WITDHOFFSET_FOR_REDUC3; ?>px) { + .width20 { width: 20px; } .width25 { width: 25px; } .width50 { width: 50px; } .width75 { width: 75px; } @@ -1048,6 +1049,7 @@ table[summary="list_of_modules"] .fa-cog { .minwidth500imp { min-width: 500px !important; } } .widthauto { width: auto; } +.width20 { width: 20px; } .width25 { width: 25px; } .width50 { width: 50px; } .width75 { width: 75px; } @@ -6309,7 +6311,9 @@ div.tabsElem a.tab { div.login_block_user, div.login_block_other { clear: both; } .atoplogin, .atoplogin:hover { - color: #000 !important; + color:unset !important; + padding-left: 4px; + padding-right: 4px; } .login_block_elem { padding: 0 !important; diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index c995426edd9..71fbb6f50da 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -1122,6 +1122,7 @@ table[summary="list_of_modules"] .fa-cog { /* rule for not too small screen only */ @media only screen and (min-width: px) { + .width20 { width: 20px; } .width25 { width: 25px; } .width50 { width: 50px; } .width75 { width: 75px; } @@ -1143,6 +1144,7 @@ table[summary="list_of_modules"] .fa-cog { .minwidth500imp { min-width: 500px !important; } } .widthauto { width: auto; } +.width20 { width: 20px; } .width25 { width: 25px; } .width50 { width: 50px; } .width75 { width: 75px; } From fbbb898d528e526b9ff9b8a7e47d4a027718d96b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 10 May 2020 18:31:55 +0200 Subject: [PATCH 074/205] Better log --- scripts/cron/cron_run_jobs.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/cron/cron_run_jobs.php b/scripts/cron/cron_run_jobs.php index 24e92c79d0b..79d52c49445 100755 --- a/scripts/cron/cron_run_jobs.php +++ b/scripts/cron/cron_run_jobs.php @@ -227,11 +227,13 @@ if (is_array($qualifiedjobs) && (count($qualifiedjobs) > 0)) { echo "You can also enable module Log if not yet enabled, run again and take a look into dolibarr.log file\n"; dol_syslog("cron_run_jobs.php::run_jobs Error ".$cronjob->error, LOG_ERR); $nbofjobslaunchedko++; + $resultstring = 'KO'; } else { $nbofjobslaunchedok++; + $resultstring = 'OK'; } - echo " - result of run_jobs = ".$result; + echo " - run_jobs ".$resultstring." result = ".$result; // We re-program the next execution and stores the last execution time for this job $result = $cronjob->reprogram_jobs($userlogin, $now); From c511af69fe31ec911679f93de77aeffbc541a952 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 10 May 2020 21:07:49 +0200 Subject: [PATCH 075/205] Debug look and feel v12 --- htdocs/core/class/html.form.class.php | 5 ++- htdocs/core/class/html.formactions.class.php | 5 ++- htdocs/core/lib/agenda.lib.php | 44 ++++++++++--------- htdocs/core/modules/DolibarrModules.class.php | 2 +- .../class/html.formresource.class.php | 5 ++- htdocs/theme/eldy/global.inc.php | 31 +++++++++---- 6 files changed, 55 insertions(+), 37 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index ee24af9f307..5fe411c6260 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -7676,10 +7676,11 @@ class Form * @param int $enableonly Array list of groups id to be enabled. All other must be disabled * @param string $force_entity '0' or Ids of environment to force * @param bool $multiple add [] in the name of element and add 'multiple' attribut (not working with ajax_autocompleter) + * @param string $morecss More css to add to html component * @return string * @see select_dolusers() */ - public function select_dolgroups($selected = '', $htmlname = 'groupid', $show_empty = 0, $exclude = '', $disabled = 0, $include = '', $enableonly = '', $force_entity = '0', $multiple = false) + public function select_dolgroups($selected = '', $htmlname = 'groupid', $show_empty = 0, $exclude = '', $disabled = 0, $include = '', $enableonly = '', $force_entity = '0', $multiple = false, $morecss = '') { // phpcs:enable global $conf, $user, $langs; @@ -7722,7 +7723,7 @@ class Form include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; $out .= ajax_combobox($htmlname); - $out .= ''; $num = $this->db->num_rows($resql); $i = 0; diff --git a/htdocs/core/class/html.formactions.class.php b/htdocs/core/class/html.formactions.class.php index 352fcebb06b..8aa51a66ab7 100644 --- a/htdocs/core/class/html.formactions.class.php +++ b/htdocs/core/class/html.formactions.class.php @@ -339,9 +339,10 @@ class FormActions * @param int $hideinfohelp 1=Do not show info help, 0=Show, -1=Show+Add info to tell how to set default value * @param int $multiselect 1=Allow multiselect of action type * @param int $nooutput 1=No output + * @param string $morecss More css to add to SELECT component. * @return string */ - public function select_type_actions($selected = '', $htmlname = 'actioncode', $excludetype = '', $onlyautoornot = 0, $hideinfohelp = 0, $multiselect = 0, $nooutput = 0) + public function select_type_actions($selected = '', $htmlname = 'actioncode', $excludetype = '', $onlyautoornot = 0, $hideinfohelp = 0, $multiselect = 0, $nooutput = 0, $morecss = '') { // phpcs:enable global $langs, $user, $form, $conf; @@ -371,7 +372,7 @@ class FormActions } else { - $out .= $form->selectarray($htmlname, $arraylist, $selected, 0, 0, 0, '', 0, 0, 0, '', 'minwidth200', 1); + $out .= $form->selectarray($htmlname, $arraylist, $selected, 0, 0, 0, '', 0, 0, 0, '', 'minwidth200'.($morecss ? ' '.$morecss : ''), 1); } if ($user->admin && empty($onlyautoornot) && $hideinfohelp <= 0) diff --git a/htdocs/core/lib/agenda.lib.php b/htdocs/core/lib/agenda.lib.php index 474a4f03696..532ef091698 100644 --- a/htdocs/core/lib/agenda.lib.php +++ b/htdocs/core/lib/agenda.lib.php @@ -77,27 +77,29 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh { // Type print ''; - print ''; // Assigned to print ''; - print ''; if ($conf->resource->enabled) @@ -109,9 +111,9 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh print ''; print ''; } } @@ -119,11 +121,11 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh if (!empty($conf->societe->enabled) && $user->rights->societe->lire) { print ''; - print ''; } @@ -133,10 +135,10 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh $formproject = new FormProjets($db); print ''; - print ''; } @@ -145,9 +147,9 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh { // Status print ''; - print ''; } diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php index c592cb69959..9543cf74442 100644 --- a/htdocs/core/modules/DolibarrModules.class.php +++ b/htdocs/core/modules/DolibarrModules.class.php @@ -2314,7 +2314,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it print '
'.$this->getName().' - '.nl2br($this->getDesc()).''; + '.nl2br($this->getDesc()).''; /*print 'getVersion(1).'">'; print $this->getVersion(1); diff --git a/htdocs/resource/class/html.formresource.class.php b/htdocs/resource/class/html.formresource.class.php index 3c0bb36116e..36d3fc854cc 100644 --- a/htdocs/resource/class/html.formresource.class.php +++ b/htdocs/resource/class/html.formresource.class.php @@ -74,9 +74,10 @@ class FormResource * @param string $filterkey Filter on key value * @param int $outputmode 0=HTML select string, 1=Array, 2=without form tag * @param int $limit Limit number of answers + * @param string $morecss More css * @return string HTML string with */ - public function select_resource_list($selected = '', $htmlname = 'fk_resource', $filter = '', $showempty = 0, $showtype = 0, $forcecombo = 0, $event = array(), $filterkey = '', $outputmode = 0, $limit = 20) + public function select_resource_list($selected = '', $htmlname = 'fk_resource', $filter = '', $showempty = 0, $showtype = 0, $forcecombo = 0, $event = array(), $filterkey = '', $outputmode = 0, $limit = 20, $morecss = '') { // phpcs:enable global $conf, $user, $langs; @@ -103,7 +104,7 @@ class FormResource } // Construct $out and $outarray - $out .= ''."\n"; if ($showempty) $out .= ''."\n"; $num = 0; diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 4ec62c217a5..dc0c77ed67d 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -670,7 +670,9 @@ body[class*="colorblind-"] .text-success{ .editfielda span.fa-pencil-alt:hover, .editfielda span.fa-trash:hover, .editfieldlang:hover { color: var(--colortexttitle) !important; } - +.fawidth30 { + width: 20px; +} .floatnone { float: none !important; } @@ -1137,6 +1139,19 @@ table[summary="list_of_modules"] .fa-cog { .hideonsmartphone { display: none; } .hideonsmartphoneimp { display: none !important; } + + span.pictotitle { + margin-: 0 !important; + } + div.fiche>table.table-fiche-title { + margin-top: 7px !important; + margin-bottom: 15px !important; + } + + select.minwidth100imp, select.minwidth100, select.minwidth200, .widthcentpercentminusx { + width: calc(100% - 30px) !important; + display: inline-block; + } } /* Force values for small screen 570 */ @@ -1145,6 +1160,10 @@ table[summary="list_of_modules"] .fa-cog { body { font-size: ; } + + .box-flex-item { + margin: 3px 2px 3px 2px !important; + } div.refidno { font-size: !important; } @@ -1472,10 +1491,10 @@ body.onlinepaymentbody div.fiche { /* For online payment page */ margin: 20px !important; } div.fiche>table:first-child { - margin-bottom: 15px !important; + margin-bottom: 15px; } div.fiche>table.table-fiche-title { - margin-bottom: 7px !important; + margin-bottom: 7px; } div.fichecenter { width: 100%; @@ -1607,12 +1626,6 @@ td.nobordernopadding.widthpictotitle.col-picto { margin-: 8px; /* margin-bottom: 4px; */ } -@media only screen and (max-width: 767px) -{ - span.pictotitle { - margin-: 0 !important; - } -} .pictoobjectwidth { width: 14px; } From a83af075aa7867a404f5fb125515c120a042756f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 11 May 2020 00:35:05 +0200 Subject: [PATCH 076/205] Fix responsive --- htdocs/admin/index.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/admin/index.php b/htdocs/admin/index.php index 1a55fbc04ee..1a27d61e55d 100644 --- a/htdocs/admin/index.php +++ b/htdocs/admin/index.php @@ -67,12 +67,12 @@ if (!empty($conf->global->MAIN_MOTD_SETUPPAGE)) } } -print ''; -print $langs->trans("SetupDescription1"); +print ''; +print $langs->trans("SetupDescription1").' '; print $langs->trans("AreaForAdminOnly").' '; print $langs->trans("SetupDescription2", $langs->transnoentities("MenuCompanySetup"), $langs->transnoentities("Modules")); -print ''; print "

"; +print '
'; print '
'; From 7300b45bcd9af35dc206830d71708853615eed60 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 11 May 2020 01:19:33 +0200 Subject: [PATCH 077/205] Responsive --- htdocs/adherents/index.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/adherents/index.php b/htdocs/adherents/index.php index 44fcb397ddc..6d069386592 100644 --- a/htdocs/adherents/index.php +++ b/htdocs/adherents/index.php @@ -1,9 +1,9 @@ * Copyright (C) 2003 Jean-Louis Bergamo - * Copyright (C) 2004-2017 Laurent Destailleur + * Copyright (C) 2004-2020 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2019 Nicolas ZABOURI + * Copyright (C) 2019 Nicolas ZABOURI * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -22,7 +22,7 @@ /** * \file htdocs/adherents/index.php * \ingroup member - * \brief Page accueil module adherents + * \brief Home page of membership module */ require '../main.inc.php'; @@ -339,7 +339,7 @@ if ($resql) $staticmember->ref = $staticmember->getFullName($langs); $statictype->id = $obj->typeid; $statictype->label = $obj->label; - print '
'; + print ''; print ''; print ''; print ''; @@ -399,12 +399,12 @@ if ($resql) $staticmember->name = $obj->company; } $staticmember->ref = $staticmember->getFullName($langs); - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; print ''; //print ''; - print ''; + print ''; print ''; $i++; } From 02ec28281296c16044ecd714230ad935625eb3f0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 11 May 2020 03:34:30 +0200 Subject: [PATCH 078/205] Typo --- htdocs/langs/en_US/admin.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 3cf6e6044db..9ad7d2cf55a 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1015,7 +1015,7 @@ LocalTax2IsUsedDescES=The IRPF rate by default when creating prospects, invoices LocalTax2IsNotUsedDescES=By default the proposed IRPF is 0. End of rule. LocalTax2IsUsedExampleES=In Spain, freelancers and independent professionals who provide services and companies who have chosen the tax system of modules. LocalTax2IsNotUsedExampleES=In Spain they are businesses not subject to tax system of modules. -RevenueStampDesc=The "tax stamp" or "revenue stamp" is a fixed tax you per invoice (It does not depend on amount of invoice). It can also be a percent tax but using the second or third type of tax is better for percent taxes as tax stamps des not provide any reporting. Only few countries uses this type of tax. +RevenueStampDesc=The "tax stamp" or "revenue stamp" is a fixed tax you per invoice (It does not depend on amount of invoice). It can also be a percent tax but using the second or third type of tax is better for percent taxes as tax stamps does not provide any reporting. Only few countries uses this type of tax. UseRevenueStamp=Use a tax stamp UseRevenueStampExample=The value of tax stamp is defined by default into the setup of dictionaries (%s - %s - %s) CalcLocaltax=Reports on local taxes From a8dcd2d09b2a933f1e5525340e4db31786aece88 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 11 May 2020 11:53:13 +0200 Subject: [PATCH 079/205] Clean code --- htdocs/core/class/conf.class.php | 2 -- htdocs/core/lib/functions.lib.php | 26 +++++++------------------- 2 files changed, 7 insertions(+), 21 deletions(-) diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index 0a52301e608..dee4edc3298 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -690,8 +690,6 @@ class Conf $this->global->AGENDA_DEFAULT_FILTER_TYPE = '0'; // 'AC_NON_AUTO' does not exists when AGENDA_DEFAULT_FILTER_TYPE is not on. } - if (!isset($this->global->MAIN_USE_OLD_TITLE_BUTTON)) $this->global->MAIN_USE_OLD_TITLE_BUTTON = 0; - if (!isset($this->global->MAIN_JS_GRAPH)) $this->global->MAIN_JS_GRAPH = 'chart'; // Use chart.js library if (empty($this->global->MAIN_MODULE_DOLISTORE_API_SRV)) $this->global->MAIN_MODULE_DOLISTORE_API_SRV = 'https://www.dolistore.com'; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 89e76156448..5f31b07214c 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -4523,15 +4523,17 @@ function print_fleche_navigation($page, $file, $options = '', $nextpage = 0, $be } if ($page > 0) { - print ''; + print ''; } if ($betweenarrows) { + print ''; print $betweenarrows; + print ''; } if ($nextpage > 0) { - print ''; + print ''; } if ($afterarrows) { @@ -8623,11 +8625,8 @@ function dolGetButtonTitle($label, $helpText = '', $iconClass = 'fa fa-file', $u } $class = 'btnTitle'; + if ($iconClass == 'fa fa-plus-circle') $class .= ' btnTitlePlus'; - // hidden conf keep during button transition TODO: remove this block - if (!empty($conf->global->MAIN_USE_OLD_TITLE_BUTTON)) { - $class = 'butActionNew'; - } if (!empty($params['morecss'])) $class .= ' '.$params['morecss']; $attr = array( @@ -8642,11 +8641,6 @@ function dolGetButtonTitle($label, $helpText = '', $iconClass = 'fa fa-file', $u if ($status <= 0) { $attr['class'] .= ' refused'; - // hidden conf keep during button transition TODO: remove this block - if (!empty($conf->global->MAIN_USE_OLD_TITLE_BUTTON)) { - $attr['class'] = 'butActionNewRefused'; - } - $attr['href'] = ''; if ($status == -1) { // disable @@ -8698,18 +8692,12 @@ function dolGetButtonTitle($label, $helpText = '', $iconClass = 'fa fa-file', $u $tag = (empty($attr['href']) ? 'span' : 'a'); - $button = '<'.$tag.' '.$compiledAttributes.' >'; + $button = ''; + $button .= '<'.$tag.' '.$compiledAttributes.' >'; $button .= ''; $button .= ''.$label.''; $button .= ''; - // hidden conf keep during button transition TODO: remove this block - if (!empty($conf->global->MAIN_USE_OLD_TITLE_BUTTON)) { - $button = '<'.$tag.' '.$compiledAttributes.' >'.$label.''; - $button .= ''; - $button .= ''; - } - return $button; } From a2bc46f1c012346c5c0ee5f006c5bd59ccd988ea Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 11 May 2020 12:50:24 +0200 Subject: [PATCH 080/205] CSS --- htdocs/core/ajax/ajaxdirtree.php | 4 ++-- htdocs/core/lib/agenda.lib.php | 6 +++--- htdocs/resource/class/html.formresource.class.php | 5 +++-- htdocs/theme/eldy/global.inc.php | 12 +++++++++--- htdocs/theme/eldy/info-box.inc.php | 11 +++++------ 5 files changed, 22 insertions(+), 16 deletions(-) diff --git a/htdocs/core/ajax/ajaxdirtree.php b/htdocs/core/ajax/ajaxdirtree.php index 04687b77829..3e54532668a 100644 --- a/htdocs/core/ajax/ajaxdirtree.php +++ b/htdocs/core/ajax/ajaxdirtree.php @@ -428,11 +428,11 @@ function treeOutputForAbsoluteDir($sqltree, $selecteddir, $fullpathselecteddir, print (isset($val['cachenbofdoc']) && $val['cachenbofdoc'] >= 0) ? $val['cachenbofdoc'] : ' '; print ''; print ''; // Edit link - print ''; diff --git a/htdocs/core/lib/agenda.lib.php b/htdocs/core/lib/agenda.lib.php index 532ef091698..5d450aa4b04 100644 --- a/htdocs/core/lib/agenda.lib.php +++ b/htdocs/core/lib/agenda.lib.php @@ -109,9 +109,9 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh // Resource print ''; - print ''; @@ -158,7 +158,7 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh { // Filter on hours print ''; - print ''; + print ''; print "'; } diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 8f2e0973ab3..44fb0865682 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -5387,11 +5387,11 @@ class Product extends CommonObject $label_type = 'short_label'; } - $sql = 'select '.$label_type.' from '.MAIN_DB_PREFIX.'c_units where rowid='.$this->fk_unit; + $sql = 'select '.$label_type.', code from '.MAIN_DB_PREFIX.'c_units where rowid='.$this->fk_unit; $resql = $this->db->query($sql); if ($resql && $this->db->num_rows($resql) > 0) { $res = $this->db->fetch_array($resql); - $label = $res[$label_type]; + $label = $label_type == 'short' ? $res[$label_type] : $langs->trans('unit' . $res['code']); $this->db->free($resql); return $label; } From 64d2f906bc7cdf2c4bbcb733ca4668ce7eae868e Mon Sep 17 00:00:00 2001 From: atm-greg Date: Mon, 11 May 2020 16:35:58 +0200 Subject: [PATCH 082/205] fix visibility of extrafields in public interface --- htdocs/public/ticket/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/public/ticket/list.php b/htdocs/public/ticket/list.php index 1a18954994f..a7f9b49fd58 100644 --- a/htdocs/public/ticket/list.php +++ b/htdocs/public/ticket/list.php @@ -235,7 +235,7 @@ if ($action == "view_ticketlist") if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { if ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate') { - $arrayfields["ef.".$key] = array('label' => $extrafields->attributes[$object->table_element]['label'][$key], 'checked' => $extrafields->attributes[$object->table_element]['list'][$key], 'position' => $extrafields->attributes[$object->table_element]['pos'][$key], 'enabled' => $extrafields->attributes[$object->table_element]['perms'][$key]); + $arrayfields["ef.".$key] = array('label' => $extrafields->attributes[$object->table_element]['label'][$key], 'checked' => ($extrafields->attributes[$object->table_element]['list'][$key] < 0) ? 0 : 1, 'position' => $extrafields->attributes[$object->table_element]['pos'][$key], 'enabled' =>(abs($extrafields->attributes[$object->table_element]['list'][$key]) != 3) && $extrafields->attributes[$object->table_element]['perms'][$key]); } } } From 097de7b3cd934e67a00cb0a9c82bc02e6c47d838 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 11 May 2020 18:34:54 +0200 Subject: [PATCH 083/205] Only add empty select if no multiselect --- htdocs/core/class/html.formactions.class.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/htdocs/core/class/html.formactions.class.php b/htdocs/core/class/html.formactions.class.php index 8aa51a66ab7..398e2b8a235 100644 --- a/htdocs/core/class/html.formactions.class.php +++ b/htdocs/core/class/html.formactions.class.php @@ -353,10 +353,13 @@ class FormActions require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php'; $caction = new CActionComm($this->db); - // Suggest a list with manual events or all auto events - $arraylist = $caction->liste_array(1, 'code', $excludetype, $onlyautoornot); - array_unshift($arraylist, ' '); // Add empty line at start - //asort($arraylist); + // Suggest a list with manual events or all auto events + $arraylist = $caction->liste_array(1, 'code', $excludetype, $onlyautoornot); + if (empty($multiselect)) { + // Add empty line at start only if no multiselect + array_unshift($arraylist, ' '); + } + //asort($arraylist); if ($selected == 'manual') $selected = 'AC_OTH'; if ($selected == 'auto') $selected = 'AC_OTH_AUTO'; From 3a46d5a3dddaf7b581f11867cbbd4ee1cd74d9b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 11 May 2020 18:46:54 +0200 Subject: [PATCH 084/205] Update agenda_other.php --- htdocs/admin/agenda_other.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/htdocs/admin/agenda_other.php b/htdocs/admin/agenda_other.php index 10bfa13d1ce..c5b196146d5 100644 --- a/htdocs/admin/agenda_other.php +++ b/htdocs/admin/agenda_other.php @@ -81,8 +81,10 @@ if (preg_match('/del_([a-z0-9_\-]+)/i', $action, $reg)) } if ($action == 'set') { + $getDefaultFilter = GETPOST('AGENDA_DEFAULT_FILTER_TYPE'); + $defaultfilter = (is_array($getDefaultFilter)) ? implode(',', $getDefaultFilter) : $getDefaultFilter; dolibarr_set_const($db, 'AGENDA_USE_EVENT_TYPE_DEFAULT', GETPOST('AGENDA_USE_EVENT_TYPE_DEFAULT'), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, 'AGENDA_DEFAULT_FILTER_TYPE', GETPOST('AGENDA_DEFAULT_FILTER_TYPE'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, 'AGENDA_DEFAULT_FILTER_TYPE', $defaultfilter, 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, 'AGENDA_DEFAULT_FILTER_STATUS', GETPOST('AGENDA_DEFAULT_FILTER_STATUS'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, 'AGENDA_DEFAULT_VIEW', GETPOST('AGENDA_DEFAULT_VIEW'), 'chaine', 0, '', $conf->entity); } @@ -377,7 +379,12 @@ print ''."\n"; print ''."\n"; print ''."\n"; print ''."\n"; // AGENDA_DEFAULT_FILTER_STATUS From 44d36815bd88eff1960f560de635a37f1cfcbfc7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 11 May 2020 19:00:27 +0200 Subject: [PATCH 085/205] Look and feel v12 --- htdocs/comm/mailing/card.php | 2 +- htdocs/comm/mailing/list.php | 2 +- htdocs/core/lib/functions.lib.php | 10 ++++++---- htdocs/core/modules/modCollab.class.php | 2 +- htdocs/core/modules/modWebsite.class.php | 2 +- 5 files changed, 10 insertions(+), 8 deletions(-) diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php index 68a6b8db331..e3cb5a9ad97 100644 --- a/htdocs/comm/mailing/card.php +++ b/htdocs/comm/mailing/card.php @@ -742,7 +742,7 @@ if ($action == 'create') // Print mail form - print load_fiche_titre($langs->trans("NewMailing"), $availablelink, 'generic'); + print load_fiche_titre($langs->trans("NewMailing"), $availablelink, 'object_email'); dol_fiche_head(); diff --git a/htdocs/comm/mailing/list.php b/htdocs/comm/mailing/list.php index 8feaa5a4d93..8119224bbfa 100644 --- a/htdocs/comm/mailing/list.php +++ b/htdocs/comm/mailing/list.php @@ -188,7 +188,7 @@ if ($resql) print ''; print ''; - print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'generic', 0, $newcardbutton, '', $limit, 0, 0, 1); + print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'object_email', 0, $newcardbutton, '', $limit, 0, 0, 1); $moreforfilter = ''; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 5f31b07214c..20094da216c 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3158,13 +3158,13 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'object_category', 'object_conversation', 'object_bookmark', 'object_bug', 'object_dolly', 'object_dollyrevert', 'object_generic', 'object_folder', 'object_list-alt', 'object_calendar', 'object_calendarweek', 'object_calendarmonth', 'object_calendarday', 'object_calendarperuser', 'object_cash-register', 'object_company', 'object_contact', 'object_contract', 'object_donation', 'object_dynamicprice', - 'object_holiday', 'object_hrm', 'object_invoice', 'object_intervention', 'object_label', + 'object_globe', 'object_holiday', 'object_hrm', 'object_invoice', 'object_intervention', 'object_label', 'object_margin', 'object_money-bill-alt', 'object_multicurrency', 'object_order', 'object_payment', 'object_lot', 'object_mrp', 'object_payment', 'object_product', 'object_propal', 'object_other', 'object_paragraph', 'object_poll', 'object_printer', 'object_project', 'object_projectpub', 'object_propal', 'object_resource', 'object_rss', 'object_projecttask', 'object_shipment', 'object_supplier_invoice', 'object_supplier_order', 'object_supplier_proposal', 'object_service', 'object_stock', 'object_technic', 'object_ticket', 'object_trip', 'object_user', 'object_group', 'object_member', - 'object_phoning', 'object_phoning_mobile', 'object_phoning_fax', 'object_email', + 'object_phoning', 'object_phoning_mobile', 'object_phoning_fax', 'object_email', 'object_website', 'off', 'on', 'order', 'paiment', 'play', 'playdisabled', 'poll', 'printer', 'product', 'propal', 'projecttask', 'stock', 'resize', 'service', 'stats', 'trip', 'setup', 'sign-out', 'split', 'switch_off', 'switch_on', 'tools', 'unlink', 'uparrow', 'user', 'wrench', @@ -3213,7 +3213,8 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'title_setup'=>'tools', 'title_accountancy'=>'money-check-alt', 'title_bank'=>'university', 'title_hrm'=>'umbrella-beach', 'title_agenda'=>'calendar-alt', 'uparrow'=>'mail-forward', - 'jabber'=>'comment-o' + 'jabber'=>'comment-o', + 'website'=>'globe-americas' ); if ($pictowithouttext == 'off') { $fakey = 'fa-square'; @@ -3292,7 +3293,8 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'map-marker-alt'=>'#aaa', 'mrp'=>'#a69944', 'product'=>'#a69944', 'service'=>'#a69944', 'stock'=>'#a69944', 'other'=>'#ddd', 'playdisabled'=>'#ccc', 'printer'=>'#444', 'projectpub'=>'#986c6a', 'resize'=>'#444', 'rss'=>'#cba', - 'shipment'=>'#a69944', 'stats'=>'#444', 'switch_off'=>'#999', 'uparrow'=>'#555', 'globe-americas'=>'#aaa' + 'shipment'=>'#a69944', 'stats'=>'#444', 'switch_off'=>'#999', 'uparrow'=>'#555', 'globe-americas'=>'#aaa', + 'website'=>'#304' ); if (isset($arrayconvpictotocolor[$pictowithouttext])) { $facolor = $arrayconvpictotocolor[$pictowithouttext]; diff --git a/htdocs/core/modules/modCollab.class.php b/htdocs/core/modules/modCollab.class.php index 5190c8c4d72..345a292cb92 100644 --- a/htdocs/core/modules/modCollab.class.php +++ b/htdocs/core/modules/modCollab.class.php @@ -55,7 +55,7 @@ class modCollab extends DolibarrModules // Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase) $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); // Name of image file used for this module. - $this->picto = 'globe'; + $this->picto = 'website'; // Data directories to create when module is enabled $this->dirs = array("/collab/temp"); diff --git a/htdocs/core/modules/modWebsite.class.php b/htdocs/core/modules/modWebsite.class.php index 3e3b4bae374..60cc93b5d39 100644 --- a/htdocs/core/modules/modWebsite.class.php +++ b/htdocs/core/modules/modWebsite.class.php @@ -55,7 +55,7 @@ class modWebsite extends DolibarrModules // Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase) $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); // Name of image file used for this module. - $this->picto = 'globe'; + $this->picto = 'website'; // Data directories to create when module is enabled $this->dirs = array("/website/temp"); From c4a7923b51a449a86f1fedc50cef32c9feb745ae Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 11 May 2020 19:02:52 +0200 Subject: [PATCH 086/205] CSS --- htdocs/theme/eldy/global.inc.php | 2 +- htdocs/theme/md/style.css.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 8a21844ca7c..b6884b164a1 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -880,7 +880,7 @@ select.flat.selectlimit { max-width: 0; overflow: auto; } -.divintdwithtwolinesmax { +.divintowithtwolinesmax { width: 75px; display: -webkit-box; -webkit-box-orient: vertical; diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 71fbb6f50da..40e8c5e27b4 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -983,7 +983,7 @@ select.flat.selectlimit { max-width: 0; overflow: auto; } -.divintdwithtwolinesmax { +.divintodwithtwolinesmax { width: 75px; display: -webkit-box; -webkit-box-orient: vertical; From 4d50ba5e370a57c7168e6f4cd2dd4f336fe3d361 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 11 May 2020 20:42:47 +0200 Subject: [PATCH 087/205] Fix dolistore search with csrf active --- htdocs/admin/dolistore/ajax/image.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/htdocs/admin/dolistore/ajax/image.php b/htdocs/admin/dolistore/ajax/image.php index c1bb4e997dc..6349c7461b5 100644 --- a/htdocs/admin/dolistore/ajax/image.php +++ b/htdocs/admin/dolistore/ajax/image.php @@ -1,6 +1,7 @@ . * Copyright (C) 2008-2011 Laurent Destailleur + * Copyright (C) 2020 Frédéric France * * This program is free software; you can redistribute it and/or modifyion 2.0 (the "License"); * it under the terms of the GNU General Public License as published bypliance with the License. @@ -17,6 +18,9 @@ */ if (!defined('REQUIRE_JQUERY_BLOCKUI')) define('REQUIRE_JQUERY_BLOCKUI', 1); +if (!defined('NOTOKENRENEWAL')) { + define('NOTOKENRENEWAL', 1); +} /** From 75cd7d7e723103fa0edadcb8860a77e908f7e6bb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 12 May 2020 03:04:48 +0200 Subject: [PATCH 088/205] Code comment --- htdocs/core/class/commonobjectline.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/commonobjectline.class.php b/htdocs/core/class/commonobjectline.class.php index 5a09dbfed29..f04e2da11ee 100644 --- a/htdocs/core/class/commonobjectline.class.php +++ b/htdocs/core/class/commonobjectline.class.php @@ -54,8 +54,8 @@ abstract class CommonObjectLine extends CommonObject * Returns the translation key from units dictionary. * A langs->trans() must be called on result to get translated value. * - * @param string $type Label type (long or short) - * @return string|int <0 if ko, label if ok + * @param string $type Label type (long or short). This can be a translation key. + * @return string|int <0 if ko, label if ok */ public function getLabelOfUnit($type = 'long') { From d459f9902c7bbc601cf4eda76a4803d65bc3f194 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 12 May 2020 03:06:30 +0200 Subject: [PATCH 089/205] Update card.php --- htdocs/product/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/card.php b/htdocs/product/card.php index d58e5f8f742..87e86e8e0bc 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -2099,7 +2099,7 @@ else print ''; } From a0998583852dd9ff3a946703210be6aaed326399 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 12 May 2020 03:07:23 +0200 Subject: [PATCH 090/205] Update product.class.php --- htdocs/product/class/product.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 44fb0865682..2a56131bdd5 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -5391,7 +5391,7 @@ class Product extends CommonObject $resql = $this->db->query($sql); if ($resql && $this->db->num_rows($resql) > 0) { $res = $this->db->fetch_array($resql); - $label = $label_type == 'short' ? $res[$label_type] : $langs->trans('unit' . $res['code']); + $label = ($label_type == 'short' ? $res[$label_type] : 'unit'.$res['code']); $this->db->free($resql); return $label; } From 92d137cde90c6e2ad9c0ac42f46157badf624708 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 12 May 2020 03:09:04 +0200 Subject: [PATCH 091/205] Update list.php --- htdocs/product/stock/list.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/htdocs/product/stock/list.php b/htdocs/product/stock/list.php index c13243fc9cb..74c2c21cadf 100644 --- a/htdocs/product/stock/list.php +++ b/htdocs/product/stock/list.php @@ -549,12 +549,15 @@ if ($num) { print ''; if ($key == 'statut') print $warehouse->getLibStatut(5); - if ($key == 'phone') - { + if ($key == 'phone') { print dol_print_phone($obj->phone, '', 0, $obj->rowid, 'AC_TEL'); } - elseif ($key == 'fax') print dol_print_phone($obj->fax, '', 0, $obj->rowid, 'AC_FAX'); - else print $warehouse->showOutputField($val, $key, $warehouse->$key, ''); + elseif ($key == 'fax') { + print dol_print_phone($obj->fax, '', 0, $obj->rowid, 'AC_FAX'); + } + else { + print $warehouse->showOutputField($val, $key, $warehouse->$key, ''); + } print ''; if (!$i) $totalarray['nbfield']++; if (!empty($val['isameasure'])) From 6706d28eb7f166754cedbb64c106a1fd3c62cff3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 12 May 2020 03:15:19 +0200 Subject: [PATCH 092/205] Update admin.lang --- htdocs/langs/en_US/admin.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index e97ed8dbc54..7669378aff4 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1272,7 +1272,7 @@ RuleForGeneratedPasswords=Rules to generate and validate passwords DisableForgetPasswordLinkOnLogonPage=Do not show the "Password Forgotten" link on the Login page UsersSetup=Users module setup UserMailRequired=Email required to create a new user -UserHideInactive=Hide inactive users +UserHideInactive=Hide inactive users from all combo lists of users (this may means you won't be able to filter on old users) UsersDocModules=Document templates for documents generated from user record GroupsDocModules=Document templates for documents generated from a group record ##### HRM setup ##### From 3c8452aa3131eb6391ea21edf1a4315370f02d85 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 12 May 2020 03:17:55 +0200 Subject: [PATCH 093/205] Update admin.lang --- htdocs/langs/en_US/admin.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 7669378aff4..c9be1ca2f41 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1272,7 +1272,7 @@ RuleForGeneratedPasswords=Rules to generate and validate passwords DisableForgetPasswordLinkOnLogonPage=Do not show the "Password Forgotten" link on the Login page UsersSetup=Users module setup UserMailRequired=Email required to create a new user -UserHideInactive=Hide inactive users from all combo lists of users (this may means you won't be able to filter on old users) +UserHideInactive=Hide inactive users from all combo lists of users (Not recommended: this may means you won't be able to filter or search on old users on some pages) UsersDocModules=Document templates for documents generated from user record GroupsDocModules=Document templates for documents generated from a group record ##### HRM setup ##### From e4611f29502f5e311e45e6f2eefc23aeab796b45 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 12 May 2020 03:36:33 +0200 Subject: [PATCH 094/205] Fix filter on categories --- htdocs/compta/facture/stats/index.php | 38 +++++++++++++-------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/htdocs/compta/facture/stats/index.php b/htdocs/compta/facture/stats/index.php index 8606e619740..284186b73ce 100644 --- a/htdocs/compta/facture/stats/index.php +++ b/htdocs/compta/facture/stats/index.php @@ -262,33 +262,33 @@ if ($mode == 'customer') $filter = 's.client in (1,2,3)'; if ($mode == 'supplier') $filter = 's.fournisseur = 1'; print $form->selectarray('socid', $companies, $socid, 1, 0, 0, 'style="width: 95%"', 0, 0, 0, '', '', 1); print ''; -if(! empty($conf->category->enabled) && $mode == 'customer') { - // Customer Category - print ''; -} + // ThirdParty Type print ''; + // Category -if ($mode == 'customer') -{ - $cat_type = Categorie::TYPE_CUSTOMER; - $cat_label = $langs->trans("Category").' '.lcfirst($langs->trans("Customer")); +if (! empty($conf->category->enabled)) { + if ($mode == 'customer') + { + $cat_type = Categorie::TYPE_CUSTOMER; + $cat_label = $langs->trans("Category").' '.lcfirst($langs->trans("Customer")); + } + if ($mode == 'supplier') + { + $cat_type = Categorie::TYPE_SUPPLIER; + $cat_label = $langs->trans("Category").' '.lcfirst($langs->trans("Supplier")); + } + print ''; } -if ($mode == 'supplier') -{ - $cat_type = Categorie::TYPE_SUPPLIER; - $cat_label = $langs->trans("Category").' '.lcfirst($langs->trans("Supplier")); -} -print ''; + // User print ''; + print ''; print ''; print ''; print ''; print "\n"; - print "\n"; print ''; } From d9e26b8569404f2a47329c9a8ff26d5c0cd4af27 Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Tue, 12 May 2020 08:38:03 +0200 Subject: [PATCH 096/205] fix template email on prpal list --- htdocs/comm/propal/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index eaeea9e3d43..522e8f5eaa3 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -468,7 +468,7 @@ if ($resql) print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'commercial', 0, $newcardbutton, '', $limit); $topicmail = "SendPropalRef"; - $modelmail = "proposal_send"; + $modelmail = "propal_send"; $objecttmp = new Propal($db); $trackid = 'pro'.$object->id; include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php'; From 66beb7c14f9b88bb2aa1388f3f3a1356f80e460a Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Tue, 12 May 2020 10:17:47 +0200 Subject: [PATCH 097/205] FIX: Do not show stats panel if the user does not have permissions --- htdocs/comm/card.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index fcd3823b0c2..82e331eb623 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -5,7 +5,7 @@ * Copyright (C) 2006 Andre Cianfarani * Copyright (C) 2005-2017 Regis Houssin * Copyright (C) 2008 Raphael Bertrand (Resultic) - * Copyright (C) 2010-2014 Juanjo Menent + * Copyright (C) 2010-2020 Juanjo Menent * Copyright (C) 2013 Alexandre Spangaro * Copyright (C) 2015-2019 Frédéric France * Copyright (C) 2015 Marcos García @@ -581,7 +581,7 @@ if ($object->id > 0) $boxstat .= '
'.$langs->trans("NbOfAttachedFiles").''.count($filearray).'
'.$langs->trans("TotalSizeOfAttachedFiles").''.dol_print_size($totalsize, 1, 1).'
'; + print ''; print $langs->trans("Type"); - print ''; + print ''; $multiselect = 0; if (!empty($conf->global->MAIN_ENABLE_MULTISELECT_TYPE)) // We use an option here because it adds bugs when used on agenda page "peruser" and "list" { $multiselect = (!empty($conf->global->AGENDA_USE_EVENT_TYPE)); } - print ''; - print $formactions->select_type_actions($actioncode, "search_actioncode", $excludetype, (empty($conf->global->AGENDA_USE_EVENT_TYPE) ? 1 : -1), 0, $multiselect); + print ''; + print $formactions->select_type_actions($actioncode, "search_actioncode", $excludetype, (empty($conf->global->AGENDA_USE_EVENT_TYPE) ? 1 : -1), 0, $multiselect, 0, 'maxwidth500'); print '
'; + print ''; print $langs->trans("ActionsToDoBy").'   '; - print ''; - print img_picto('', 'user'); - print $form->select_dolusers($filtert, 'search_filtert', 1, '', !$canedit, '', '', 0, 0, 0, '', 0, '', 'maxwidth300'); + print ''; + print img_picto('', 'user', 'class="fawidth30 inline-block"'); + print $form->select_dolusers($filtert, 'search_filtert', 1, '', !$canedit, '', '', 0, 0, 0, '', 0, '', 'maxwidth500'); if (empty($conf->dol_optimize_smallscreen)) print '   '.$langs->trans("or").' '.$langs->trans("ToUserOfGroup").'   '; - print $form->select_dolgroups($usergroupid, 'usergroup', 1, '', !$canedit); + else print '
'; + print img_picto('', 'object_group', 'class="fawidth30 inline-block"'); + print $form->select_dolgroups($usergroupid, 'usergroup', 1, '', !$canedit, '', '', '0', false, 'maxwidth500'); print '
'; print $langs->trans("Resource"); - print ''; - print img_picto('', 'object_resource'); - print $formresource->select_resource_list($resourceid, "search_resourceid", '', 1, 0, 0, null, '', 2); + print ''; + print img_picto('', 'object_resource', 'class="fawidth30 inline-block"'); + print $formresource->select_resource_list($resourceid, "search_resourceid", '', 1, 0, 0, null, '', 2, 0, 'maxwidth500'); print '
'; + print ''; print $langs->trans("ThirdParty").'   '; - print ''; - print img_picto('', 'company'); - print $form->select_company($socid, 'search_socid', '', ' ', 0, 0, null, 0); + print ''; + print img_picto('', 'company', 'class="fawidth30 inline-block"'); + print $form->select_company($socid, 'search_socid', '', ' ', 0, 0, null, 0, 'minwidth100 maxwidth500'); print '
'; + print ''; print $langs->trans("Project").'   '; - print ''; - print img_picto('', 'project'); + print ''; + print img_picto('', 'project', 'class="fawidth30 inline-block"'); print $formproject->select_projects($socid ? $socid : -1, $pid, 'search_projectid', 0, 0, 1, 0, 0, 0, 0, '', 1, 0, 'maxwidth500'); print '
'; + print ''; print $langs->trans("Status"); - print '  '; + print '  '; $formactions->form_select_status_action('formaction', $status, 1, 'search_status', 1, 2, 'minwidth100'); print '
'.$staticmember->getNomUrl(1, 32).''.$staticmember->getNomUrl(1, 32).''.$statictype->getNomUrl(1, 32).''.dol_print_date($db->jdate($obj->datem), 'dayhour').''.$staticmember->LibStatut($obj->statut, ($obj->subscription == 'yes' ? 1 : 0), $db->jdate($obj->date_end_subscription), 3).''.$subscriptionstatic->getNomUrl(1).''.$staticmember->getNomUrl(1, 32, 'subscription').''.get_date_range($db->jdate($obj->date_start), $db->jdate($obj->date_end)).''.$subscriptionstatic->getNomUrl(1).''.$staticmember->getNomUrl(1, 32, 'subscription').''.get_date_range($db->jdate($obj->date_start), $db->jdate($obj->date_end)).''.price($obj->subscription).''.$staticmember->LibStatut($obj->statut,($obj->subscription=='yes'?1:0),$db->jdate($obj->date_end_subscription),5).''.dol_print_date($db->jdate($obj->datem ? $obj->datem : $obj->datec), 'dayhour').''.dol_print_date($db->jdate($obj->datem ? $obj->datem : $obj->datec), 'dayhour').'
'; - if ($nbofsubdir > 0 && $nboffilesinsubdir > 0) print '+'.$nboffilesinsubdir.' '; + if ($nbofsubdir > 0 && $nboffilesinsubdir > 0) print '+'.$nboffilesinsubdir.' '; print ''.img_edit($langs->trans("Edit").' - '.$langs->trans("View"), 0, 'class="valignmiddle opacitymedium"').'
'; + print ''; print $langs->trans("Resource"); - print ''; + print ''; print img_picto('', 'object_resource', 'class="fawidth30 inline-block"'); print $formresource->select_resource_list($resourceid, "search_resourceid", '', 1, 0, 0, null, '', 2, 0, 'maxwidth500'); print '
'.$langs->trans("VisibleTimeRange").''.$langs->trans("VisibleTimeRange").'"; print '
'; print ''; diff --git a/htdocs/resource/class/html.formresource.class.php b/htdocs/resource/class/html.formresource.class.php index 36d3fc854cc..4836ed1a0f1 100644 --- a/htdocs/resource/class/html.formresource.class.php +++ b/htdocs/resource/class/html.formresource.class.php @@ -101,10 +101,12 @@ class FormResource { //$minLength = (is_numeric($conf->global->RESOURCE_USE_SEARCH_TO_SELECT)?$conf->global->RESOURCE_USE_SEARCH_TO_SELECT:2); $out .= ajax_combobox($htmlname, $event, $conf->global->RESOURCE_USE_SEARCH_TO_SELECT); + } else { + $out .= ajax_combobox($htmlname); } // Construct $out and $outarray - $out .= ''."\n"; if ($showempty) $out .= ''."\n"; $num = 0; @@ -137,7 +139,6 @@ class FormResource } } $out .= ''."\n"; - $out .= ajax_combobox($htmlname); if ($outputmode != 2) { diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index dc0c77ed67d..8a21844ca7c 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -1899,8 +1899,8 @@ div.tmenuleft } div.tmenucenter { - padding-left: 0px; - padding-right: 3px; + padding-left: 2px; + padding-right: 2px; padding-top: 8px; height: 26px; @@ -3600,6 +3600,12 @@ ul.noborder li:nth-child(even):not(.liste_titre) { @media only screen and (max-width: 767px) { + a.tmenu:link, a.tmenu:visited, a.tmenu:hover, a.tmenu:active { + padding: 0px 0px 0px 0px; + } + a.tmenusel:link, a.tmenusel:visited, a.tmenusel:hover, a.tmenusel:active { + padding: 0px 0px 0px 0px; + } .boxstats, .boxstats130 { margin: 3px; } @@ -4882,7 +4888,7 @@ ul.ecmjqft li { ul.ecmjqft a { line-height: 24px; vertical-align: middle; - color: #333; + color: unset; padding: 0px 0px; font-weight:normal; display: inline-block !important; diff --git a/htdocs/theme/eldy/info-box.inc.php b/htdocs/theme/eldy/info-box.inc.php index 7f62fe39689..3138cd8bfd9 100644 --- a/htdocs/theme/eldy/info-box.inc.php +++ b/htdocs/theme/eldy/info-box.inc.php @@ -15,10 +15,11 @@ if (!defined('ISLOADEDBYSTEELSHEET')) die('Must be call by steelsheet'); ?> display: block; position: relative; min-height: 90px; - background: #fff; + /* background: #fff; */ width: 100%; - box-shadow: 1px 1px 4px rgba(0, 0, 0, 0.2), 0px 0px 2px rgba(0, 0, 0, 0.1); - border-radius: 2px; + box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1); + border-radius: 2px; + border: 1px solid #eee; margin-bottom: 15px; } .info-box.info-box-sm{ @@ -67,7 +68,7 @@ if (!defined('ISLOADEDBYSTEELSHEET')) die('Must be call by steelsheet'); ?> text-align: center; font-size: 45px; line-height: 90px; - background: rgba(0, 0, 0, 0.2); + background: rgba(0, 0, 0, 0.08) !important } .info-box-sm .info-box-icon { height: 80px; @@ -203,8 +204,6 @@ if (GETPOSTISSET('THEME_AGRESSIVENESS_RATIO')) $conf->global->THEME_AGRESSIVENES .info-box-icon { color: #fff !important; - - background-color: #eee !important; opacity: 0.95; } From 65011c28771601aab882785dd0b1621a6c1f994d Mon Sep 17 00:00:00 2001 From: Tim Otte Date: Mon, 11 May 2020 15:11:23 +0200 Subject: [PATCH 081/205] Fixed the product unit translation --- htdocs/product/card.php | 2 +- htdocs/product/class/product.class.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 87e86e8e0bc..d58e5f8f742 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -2099,7 +2099,7 @@ else print '
'.$langs->trans('DefaultUnitToShow').''; if ($unit !== '') { - print $langs->trans($unit); + print $unit; } print '
'.$langs->trans("AGENDA_DEFAULT_FILTER_TYPE").' '."\n"; -$formactions->select_type_actions($conf->global->AGENDA_DEFAULT_FILTER_TYPE, "AGENDA_DEFAULT_FILTER_TYPE", '', (empty($conf->global->AGENDA_USE_EVENT_TYPE) ? 1 : -1), 1); +$multiselect = 0; +if (!empty($conf->global->MAIN_ENABLE_MULTISELECT_TYPE)) { + // We use an option here because it adds bugs when used on agenda page "peruser" and "list" + $multiselect = (!empty($conf->global->AGENDA_USE_EVENT_TYPE)); +} +$formactions->select_type_actions($conf->global->AGENDA_DEFAULT_FILTER_TYPE, "AGENDA_DEFAULT_FILTER_TYPE", '', (empty($conf->global->AGENDA_USE_EVENT_TYPE) ? 1 : -1), 1, $multiselect); print '
'.$langs->trans('DefaultUnitToShow').''; if ($unit !== '') { - print $unit; + print $langs->trans($unit); } print '
'.$langs->trans("CustomersProspectsCategoriesShort").''; - $cate_arbo = $form->select_all_categories(Categorie::TYPE_CUSTOMER, null, 'parent', null, null, 1); - print $form->multiselectarray('custcats', $cate_arbo, GETPOST('custcats', 'array'), null, null, null, null, "90%"); - print '
'.$langs->trans("ThirdPartyType").''; $sortparam_typent = (empty($conf->global->SOCIETE_SORT_ON_TYPEENT) ? 'ASC' : $conf->global->SOCIETE_SORT_ON_TYPEENT); // NONE means we keep sort of original array, so we sort on position. ASC, means next function will sort on label. print $form->selectarray("typent_id", $formcompany->typent_array(0), $typent_id, 0, 0, 0, '', 0, 0, 0, $sortparam_typent); if ($user->admin) print ' '.info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); print '
'.$cat_label.''; + $cate_arbo = $form->select_all_categories(Categorie::TYPE_CUSTOMER, null, 'parent', null, null, 1); + print $form->multiselectarray('custcats', $cate_arbo, GETPOST('custcats', 'array'), null, null, null, null, "90%"); + //print $formother->select_categories($cat_type, $categ_id, 'categ_id', true); + print '
'.$cat_label.''; -print $formother->select_categories($cat_type, $categ_id, 'categ_id', true); -print '
'.$langs->trans("CreatedBy").''; print $form->select_dolusers($userid, 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300'); From 0dccc9cbeb734ebdba69ed29354ec42fc7d3677f Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Tue, 12 May 2020 07:27:20 +0200 Subject: [PATCH 095/205] Debug colspan --- htdocs/accountancy/bookkeeping/balance.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/accountancy/bookkeeping/balance.php b/htdocs/accountancy/bookkeeping/balance.php index 7b99057f73a..85562ebc268 100644 --- a/htdocs/accountancy/bookkeeping/balance.php +++ b/htdocs/accountancy/bookkeeping/balance.php @@ -302,12 +302,11 @@ if ($action != 'export_csv') if (empty($displayed_account) || $root_account_description != $displayed_account) { // Affiche un Sous-Total par compte comptable if ($displayed_account != "") { - print '
' . $langs->trans("SubTotal") . ':
' . $langs->trans("SubTotal") . ':' . price($sous_total_debit) . '' . price($sous_total_credit) . '' . price(price2num($sous_total_credit - $sous_total_debit)) . '
'; $boxstat .= ' + $html .= ' - - - - '; + '.dol_print_date(dol_stringtotime($product->date_upd), 'dayhour').' - '.$langs->trans('Ref').': '.$product->reference.' - '.$langs->trans('Id').': '.$product->id.'

'.$product->description_short->language[$this->lang - 1].''; + // do not load if display none + //$html .= ''; + $html .= ''; + $html .= ''; + $html .= ''; } return $html; } From 410694100d911de889d06f59f43756e6df849b4e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 12 May 2020 23:42:01 +0200 Subject: [PATCH 105/205] CSS --- htdocs/theme/eldy/global.inc.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 68e16afecd0..ef39d38a568 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -1707,6 +1707,7 @@ div.statusref { margin-top: 8px; margin-bottom: 10px; clear: both; + text-align: right; } div.statusref img { padding-left: 8px; From 63d6b3c47d5629082628cfd08d1a15ad13309149 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 12 May 2020 23:44:50 +0200 Subject: [PATCH 106/205] Look and feel v12 --- htdocs/contrat/card.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index 25857767e80..9f825cdf009 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -1452,7 +1452,7 @@ else print '
'; - if (!empty($conf->propal->enabled)) + if (!empty($conf->propal->enabled) && $user->rights->propal->lire) { // Box proposals $tmp = $object->getOutstandingProposals(); @@ -599,7 +599,7 @@ if ($object->id > 0) if ($link) $boxstat .= ''; } - if (!empty($conf->commande->enabled)) + if (!empty($conf->commande->enabled) && $user->rights->commande->lire) { // Box commandes $tmp = $object->getOutstandingOrders(); @@ -617,7 +617,7 @@ if ($object->id > 0) if ($link) $boxstat .= ''; } - if (!empty($conf->facture->enabled)) + if (!empty($conf->facture->enabled) && $user->rights->facture->lire) { // Box factures $tmp = $object->getOutstandingBills(); From e1db0ef855173bffda16735f7c4a836c8de68a50 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Tue, 12 May 2020 10:57:51 +0200 Subject: [PATCH 098/205] Update index.php --- htdocs/comm/mailing/index.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/comm/mailing/index.php b/htdocs/comm/mailing/index.php index 61187f2e647..6b765d9451f 100644 --- a/htdocs/comm/mailing/index.php +++ b/htdocs/comm/mailing/index.php @@ -157,6 +157,7 @@ print '
'; $limit = 10; $sql = "SELECT m.rowid, m.titre, m.nbemail, m.statut, m.date_creat"; $sql .= " FROM ".MAIN_DB_PREFIX."mailing as m"; +$sql .= " WHERE m.entity = ".$conf->entity; $sql .= " ORDER BY m.date_creat DESC"; $sql .= " LIMIT ".$limit; $result = $db->query($sql); From c89e8efec354070f055504c64c11e49fe1827320 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 12 May 2020 14:08:28 +0200 Subject: [PATCH 099/205] responsive --- htdocs/takepos/css/pos.css.php | 3 +++ htdocs/takepos/index.php | 9 +++++++-- htdocs/takepos/invoice.php | 2 +- htdocs/theme/eldy/global.inc.php | 1 + htdocs/theme/md/style.css.php | 1 + 5 files changed, 13 insertions(+), 3 deletions(-) diff --git a/htdocs/takepos/css/pos.css.php b/htdocs/takepos/css/pos.css.php index 5f0006d24fe..6871fcbd68b 100644 --- a/htdocs/takepos/css/pos.css.php +++ b/htdocs/takepos/css/pos.css.php @@ -591,6 +591,9 @@ div#moreinfo, div#infowarehouse { height: calc(45% - 100px); } + div#moreinfo, div#infowarehouse { + padding: 0 5px 0 5px; + } div.div1 { padding-bottom: 0; diff --git a/htdocs/takepos/index.php b/htdocs/takepos/index.php index 0688d4a8584..8da96df54d0 100644 --- a/htdocs/takepos/index.php +++ b/htdocs/takepos/index.php @@ -756,8 +756,13 @@ if (empty($conf->global->TAKEPOS_HIDE_HEAD_BAR)) {
-
- trans("Terminal")." "; +
+ + + + trans("Terminal"); ?> + + - '.dol_print_date(dol_now(), "day").''; diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index b1641072829..9f0e6649cf6 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -747,7 +747,7 @@ $( document ).ready(function() { $("#customerandsales").html(''); - $("#customerandsales").append(''); + $("#customerandsales").append(''); global->THEME_ELDY_WITDHOFFSET_FOR_REDUC3) ? round($nbtopmenuentries * 47, 0) + 130 : $conf->global->THEME_ELDY_WITDHOFFSET_FOR_REDUC3; ?>px) { diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 40e8c5e27b4..c7ce5709efd 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -1119,6 +1119,7 @@ table[summary="list_of_modules"] .fa-cog { .clearboth { clear:both; } .hideobject { display: none; } .minwidth50 { min-width: 50px; } +.minwidth75 { min-width: 75px; } /* rule for not too small screen only */ @media only screen and (min-width: px) { From e9c405182d07497ed177b60377f44c5f225ff30a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 12 May 2020 14:18:31 +0200 Subject: [PATCH 100/205] css --- htdocs/theme/eldy/main_menu_fa_icons.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/theme/eldy/main_menu_fa_icons.inc.php b/htdocs/theme/eldy/main_menu_fa_icons.inc.php index 5b9395fbc04..c344838458d 100644 --- a/htdocs/theme/eldy/main_menu_fa_icons.inc.php +++ b/htdocs/theme/eldy/main_menu_fa_icons.inc.php @@ -8,7 +8,7 @@ font-style: normal; font-variant: normal; text-rendering: auto; - line-height: 26px; + line-height: 23px; font-size: ; -webkit-font-smoothing: antialiased; text-align:center; From a6708009d790003f14320cfbcdadc972661d494e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 12 May 2020 14:53:03 +0200 Subject: [PATCH 101/205] Add option PROJECT_OPEN_ALWAYS_ON_TAB --- htdocs/projet/class/project.class.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index 1ee17511304..554bc84766a 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -1044,6 +1044,9 @@ class Project extends CommonObject if (!empty($conf->dol_no_mouse_hover)) $notooltip = 1; // Force disable tooltips $result = ''; + if (! empty($conf->global->PROJECT_OPEN_ALWAYS_ON_TAB)) { + $option = $conf->global->PROJECT_OPEN_ALWAYS_ON_TAB; + } $label = ''; if ($option != 'nolink') $label = ''.$langs->trans("Project").''; @@ -1073,6 +1076,10 @@ class Project extends CommonObject { $url = DOL_URL_ROOT.'/projet/tasks.php?id='.$this->id; } + elseif ($option == 'preview') + { + $url = DOL_URL_ROOT.'/projet/element.php?id='.$this->id; + } else { $url = DOL_URL_ROOT.'/projet/card.php?id='.$this->id; From 8bd1179b8207671f4d33d8f6d156c453b7bf8239 Mon Sep 17 00:00:00 2001 From: andreubisquerra Date: Tue, 12 May 2020 17:03:24 +0200 Subject: [PATCH 102/205] Update qr.php --- htdocs/takepos/genimg/qr.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/takepos/genimg/qr.php b/htdocs/takepos/genimg/qr.php index 99f7fced1d0..3f27464f5ca 100644 --- a/htdocs/takepos/genimg/qr.php +++ b/htdocs/takepos/genimg/qr.php @@ -33,4 +33,4 @@ $urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', t $urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file $module = new modTcpdfbarcode($db); -$result = $module->buildBarCode($urlwithroot."/takepos/auto_order.php?key=".dol_encode($key), 'QRCODE', 'Y'); +$result = $module->buildBarCode($urlwithroot."/takepos/public/auto_order.php?key=".dol_encode($key), 'QRCODE', 'Y'); From fc2f2c6da71b6c4f7f0b16216f0fba320b52ba1d Mon Sep 17 00:00:00 2001 From: gauthier Date: Tue, 12 May 2020 17:41:21 +0200 Subject: [PATCH 103/205] FIX : wrong url param --- htdocs/compta/facture/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 9fa696c69b3..cb3aa9cd099 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -4837,7 +4837,7 @@ elseif ($id > 0 || ! empty($ref)) { if (! $objectidnext) { - print ''; + print ''; } } From 366ae2f116cfaaed73e07a4b06d0a596ded92582 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 12 May 2020 18:44:26 +0200 Subject: [PATCH 104/205] Update dolistore.class.php --- .../admin/dolistore/class/dolistore.class.php | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/htdocs/admin/dolistore/class/dolistore.class.php b/htdocs/admin/dolistore/class/dolistore.class.php index 230c588f7e4..a229f3c985d 100644 --- a/htdocs/admin/dolistore/class/dolistore.class.php +++ b/htdocs/admin/dolistore/class/dolistore.class.php @@ -248,11 +248,8 @@ class Dolistore // phpcs:enable global $langs, $conf; $html = ""; - $parity = "pair"; $last_month = time() - (30 * 24 * 60 * 60); foreach ($this->products as $product) { - $parity = ($parity == "impair") ? 'pair' : 'impair'; - // check new product ? $newapp = ''; if ($last_month < strtotime($product->date_add)) { @@ -267,7 +264,7 @@ class Dolistore // add image or default ? if ($product->id_default_image != '') { $image_url = DOL_URL_ROOT.'/admin/dolistore/ajax/image.php?id_product='.$product->id.'&id_image='.$product->id_default_image; - $images = ''; + $images = ''; $images .= ''; } else { $images = ''; @@ -306,16 +303,16 @@ class Dolistore //.'
'.$langs->trans("SeeInMarkerPlace").' //output template - $html .= '
'.$newapp.$images.'

'.$product->name->language[$this->lang - 1] .'
'.$version.'

- '.dol_print_date(dol_stringtotime($product->date_upd), 'dayhour').' - '.$langs->trans('Ref').': '.$product->reference.' - '.$langs->trans('Id').': '.$product->id.'

'.$product->description_short->language[$this->lang - 1].'
'.$price.' - '.$download_link.'
'.$price.''.$download_link.'
'; - // Ligne info remises tiers + // Line info of thirdparty discounts print ''; } print ''; print ''; From b5f3be4599f9f56c30c63297643c88da8d75e956 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 13 May 2020 00:29:46 +0200 Subject: [PATCH 107/205] Clean phpcs rule file --- dev/setup/codesniffer/ruleset.xml | 77 +++++++++---------- htdocs/compta/bank/class/account.class.php | 3 +- htdocs/product/stats/commande_fournisseur.php | 4 +- htdocs/webservices/server_actioncomm.php | 6 +- 4 files changed, 43 insertions(+), 47 deletions(-) diff --git a/dev/setup/codesniffer/ruleset.xml b/dev/setup/codesniffer/ruleset.xml index ad26c7f0bdc..41526340daf 100644 --- a/dev/setup/codesniffer/ruleset.xml +++ b/dev/setup/codesniffer/ruleset.xml @@ -272,12 +272,7 @@ - - - - - - + 0 @@ -310,20 +305,21 @@ - - + 0 - + 0 + - 0 + 0 - + + 0 @@ -332,27 +328,25 @@ - + 0 - + + 0 - - 0 - + + + - 0 + 0 - - 0 - - - 0 - + + + @@ -361,26 +355,26 @@ 0 + - 0 + 0 - + 0 + - - 0 - + 0 0 - + 0 @@ -391,16 +385,16 @@ + + 0 + - - - - + 0 @@ -411,7 +405,6 @@ 0 - 0 @@ -421,15 +414,21 @@ - - - - - + + + + + + + + + + + diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index 58115537b1f..3fcbffba3b2 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -1672,8 +1672,7 @@ class Account extends CommonObject //Replace the old AccountNumber key with the new BankAccountNumber key $fieldlists = explode( ' ', - preg_replace('/ ?[^Bank]AccountNumber ?/', 'BankAccountNumber', - $conf->global->BANK_SHOW_ORDER_OPTION) + preg_replace('/ ?[^Bank]AccountNumber ?/', 'BankAccountNumber', $conf->global->BANK_SHOW_ORDER_OPTION) ); } } diff --git a/htdocs/product/stats/commande_fournisseur.php b/htdocs/product/stats/commande_fournisseur.php index 61024cdd7ff..c111e075972 100644 --- a/htdocs/product/stats/commande_fournisseur.php +++ b/htdocs/product/stats/commande_fournisseur.php @@ -44,9 +44,7 @@ if (!empty($user->socid)) $result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype); // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context -$hookmanager->initHooks(array( - 'productstatssupplyorder' -)); +$hookmanager->initHooks(array('productstatssupplyorder')); $mesg = ''; diff --git a/htdocs/webservices/server_actioncomm.php b/htdocs/webservices/server_actioncomm.php index bc3d4a78c6a..39ed3b3cdf5 100644 --- a/htdocs/webservices/server_actioncomm.php +++ b/htdocs/webservices/server_actioncomm.php @@ -153,8 +153,8 @@ $server->wsdl->addComplexType( 'sequence', '', array( - 'code' => array('name'=>'code', 'type'=>'xsd:string'), - 'libelle' => array('name'=>'libelle', 'type'=>'xsd:string') + 'code' => array('name'=>'code', 'type'=>'xsd:string'), + 'libelle' => array('name'=>'libelle', 'type'=>'xsd:string') ) ); @@ -164,7 +164,7 @@ $server->wsdl->addComplexType( 'array', 'sequence', '', - array( + array( 'actioncommtype' => array( 'name' => 'actioncommtype', 'type' => 'tns:actioncommtype', From 22301d63d8fedaa2607167232b4ac4df76cd9593 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 13 May 2020 00:35:10 +0200 Subject: [PATCH 108/205] Replace a ZEND phpcs rule with a PSR2 rule --- dev/setup/codesniffer/ruleset.xml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/dev/setup/codesniffer/ruleset.xml b/dev/setup/codesniffer/ruleset.xml index 41526340daf..e726df6db7c 100644 --- a/dev/setup/codesniffer/ruleset.xml +++ b/dev/setup/codesniffer/ruleset.xml @@ -424,11 +424,7 @@ - - - - - + From f0d14662b996b082c701db2318157f9f86d7c957 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 13 May 2020 00:38:12 +0200 Subject: [PATCH 109/205] Fix scrutinizer --- htdocs/takepos/genimg/qr.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/takepos/genimg/qr.php b/htdocs/takepos/genimg/qr.php index c73e874a465..c4d60a52c1b 100644 --- a/htdocs/takepos/genimg/qr.php +++ b/htdocs/takepos/genimg/qr.php @@ -29,5 +29,5 @@ require '../../core/modules/barcode/doc/tcpdfbarcode.modules.php'; $key = GETPOST('key'); -$module = new modTcpdfbarcode($db); +$module = new modTcpdfbarcode(); $result = $module->buildBarCode("http://www.takepos.com", 'QRCODE', 'Y'); From ebbd4413f5985def5e726d974c761e193473d442 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 13 May 2020 00:47:27 +0200 Subject: [PATCH 110/205] Fix scrutinizer error --- htdocs/accountancy/admin/account.php | 2 +- .../class/accountingaccount.class.php | 17 ++++++----------- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/htdocs/accountancy/admin/account.php b/htdocs/accountancy/admin/account.php index 86981e5b5de..cf00519e9d7 100644 --- a/htdocs/accountancy/admin/account.php +++ b/htdocs/accountancy/admin/account.php @@ -161,7 +161,7 @@ if (empty($reshook)) if ($action == 'disable') { if ($accounting->fetch($id)) { $mode = GETPOST('mode', 'int'); - $result = $accounting->account_desactivate($id, $mode); + $result = $accounting->accountDeactivate($id, $mode); } $action = 'update'; diff --git a/htdocs/accountancy/class/accountingaccount.class.php b/htdocs/accountancy/class/accountingaccount.class.php index a32918cc5bf..bcd17793db1 100644 --- a/htdocs/accountancy/class/accountingaccount.class.php +++ b/htdocs/accountancy/class/accountingaccount.class.php @@ -553,24 +553,19 @@ class AccountingAccount extends CommonObject } } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** - * Account deactivated + * Deactivate an account (for status active or status reconcilable) * * @param int $id Id - * @param int $mode 0=field active, 1=field active_customer_list, 2=field_active_supplier_list + * @param int $mode 0=field active, 1=field reconcilable * @return int <0 if KO, >0 if OK */ - public function account_desactivate($id, $mode = 0) + public function accountDeactivate($id, $mode = 0) { - // phpcs:enable $result = $this->checkUsage(); - if ($mode == 0) - { - $fieldtouse = 'active'; - } - elseif ($mode == 1) + $fieldtouse = 'active'; + if ($mode == 1) { $fieldtouse = 'reconcilable'; } @@ -582,7 +577,7 @@ class AccountingAccount extends CommonObject $sql .= "SET ".$fieldtouse." = '0'"; $sql .= " WHERE rowid = ".$this->db->escape($id); - dol_syslog(get_class($this)."::account_desactivate ".$fieldtouse." sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::accountDeactivate ".$fieldtouse." sql=".$sql, LOG_DEBUG); $result = $this->db->query($sql); if ($result) { From 0850570e951e98b1b50de544844f9a19e669a97a Mon Sep 17 00:00:00 2001 From: "DEMAREST Maxime (Indelog)" Date: Tue, 12 May 2020 13:15:49 +0200 Subject: [PATCH 111/205] Fix and imporve some points for compta/accounting-flles.php * Fix zip generation for accouning-files if line has no document. The zip file generated if $filesarray contain a line with empty 'files' was unsustainable because it try to add empty files. * Add clickable link to jump on card for other line than Invoice and Supplier Invoice * Add various payment * Use label as ref for paiements of salaries line to display more explicit line --- htdocs/compta/accounting-files.php | 64 +++++++++++++++++++++++++----- 1 file changed, 54 insertions(+), 10 deletions(-) diff --git a/htdocs/compta/accounting-files.php b/htdocs/compta/accounting-files.php index 471637461f6..9c26cc0999c 100644 --- a/htdocs/compta/accounting-files.php +++ b/htdocs/compta/accounting-files.php @@ -37,8 +37,10 @@ require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php' require_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php'; require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; +require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; +require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/paymentvarious.class.php'; -$langs->loadLangs(array("accountancy", "bills", "companies", "salaries", "compta", "trips")); +$langs->loadLangs(array("accountancy", "bills", "companies", "salaries", "compta", "trips", "banks")); $date_start = GETPOST('date_start', 'alpha'); $date_startDay = GETPOST('date_startday', 'int'); @@ -176,7 +178,7 @@ if (($action == 'searchfiles' || $action == 'dl')) { // Paiements of salaries if (GETPOST('selectpaymentsofsalaries')) { if (!empty($sql)) $sql .= " UNION ALL"; - $sql .= " SELECT t.rowid as id, t.entity, t.ref as ref, 1 as paid, amount as total_ht, amount as total_ttc, 0 as total_vat, t.fk_user as fk_soc, t.datep as date, t.dateep as date_due, 'SalaryPayment' as item, CONCAT(CONCAT(u.lastname, ' '), u.firstname) as thirdparty_name, '' as thirdparty_code, c.code as country_code, '' as vatnum"; + $sql .= " SELECT t.rowid as id, t.entity, t.label as ref, 1 as paid, amount as total_ht, amount as total_ttc, 0 as total_vat, t.fk_user as fk_soc, t.datep as date, t.dateep as date_due, 'SalaryPayment' as item, CONCAT(CONCAT(u.lastname, ' '), u.firstname) as thirdparty_name, '' as thirdparty_code, c.code as country_code, '' as vatnum"; $sql .= " FROM ".MAIN_DB_PREFIX."payment_salary as t LEFT JOIN ".MAIN_DB_PREFIX."user as u ON u.rowid = t.fk_user LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON c.rowid = u.fk_country"; $sql .= " WHERE datep between ".$wheretail; $sql .= " AND t.entity IN (".($entity == 1 ? '0,1' : $entity).')'; @@ -191,6 +193,14 @@ if (($action == 'searchfiles' || $action == 'dl')) { $sql .= " AND t.entity IN (".($entity == 1 ? '0,1' : $entity).')'; //$sql.=" AND fk_statut <> ".ChargeSociales::STATUS_DRAFT; } + // Various payments + if (GETPOST('selectvariouspayment')) { + if (!empty($sql)) $sql .= " UNION ALL"; + $sql .= " SELECT t.rowid as id, t.entity, t.label as ref, 1 as paid, t.amount as total_ht, t.amount as total_ttc, 0 as total_tva, 0 as fk_soc, t.datec as date, t.datep as date_due, 'VariousPayment' as item, '' as thirdparty_name, '' as thirdparty_code, '' as country_code, '' as vatnum"; + $sql .= " FROM ".MAIN_DB_PREFIX."payment_various as t"; + $sql .= " WHERE datec between ".$wheretail; + $sql .= " AND t.entity IN (".($entity == 1 ? '0,1' : $entity).')'; + } if ($sql) { $sql .= $db->order($sortfield, $sortorder); @@ -254,6 +264,12 @@ if (($action == 'searchfiles' || $action == 'dl')) { $upload_dir = $conf->tax->dir_output.'/'.$subdir; $link = "document.php?modulepart=tax&file=".str_replace('/', '%2F', $subdir).'%2F'; break; + case "VariousPayment": + $subdir = ''; + $subdir .= ($subdir ? '/' : '').dol_sanitizeFileName($objd->id); + $upload_dir = $conf->bank->dir_output.'/'.$subdir; + $link = "document.php?modulepart=banque&file=".str_replace('/', '%2F', $subdir).'%2F'; + break; default: $subdir = ''; $upload_dir = ''; @@ -394,11 +410,13 @@ if ($result && $action == "dl" && !$error) { foreach ($filesarray as $key => $file) { - foreach ($file['files'] as $filecursor) { - if (file_exists($filecursor["fullname"])) { - $zip->addFile($filecursor["fullname"], $filecursor["relpathnamelang"]); - } - } + if (!empty($file['files'])) { + foreach ($file['files'] as $filecursor) { + if (file_exists($filecursor["fullname"])) { + $zip->addFile($filecursor["fullname"], $filecursor["relpathnamelang"]); + } + } + } $log .= '"'.$langs->trans($file['item']).'"'; if (!empty($conf->multicompany->enabled) && is_object($mc)) @@ -448,6 +466,11 @@ $form = new Form($db); $userstatic = new User($db); $invoice = new Facture($db); $supplier_invoice = new FactureFournisseur($db); +$expensereport = new ExpenseReport($db); +$don = new Don($db); +$salary_payment = new PaymentSalary($db); +$charge_sociales = new ChargeSociales($db); +$various_payment = new PaymentVarious($db); $title = $langs->trans("ComptaFiles").' - '.$langs->trans("List"); $help_url = ''; @@ -492,7 +515,8 @@ $listofchoices = array( 'selectexpensereports'=>array('label'=>'ExpenseReports', 'lang'=>'trips'), 'selectdonations'=>array('label'=>'Donations', 'lang'=>'donation'), 'selectpaymentsofsalaries'=>array('label'=>'SalariesPayments', 'lang'=>'salaries'), - 'selectsocialcontributions'=>array('label'=>'SocialContributions') + 'selectsocialcontributions'=>array('label'=>'SocialContributions'), + 'selectvariouspayment'=>array('label'=>'VariousPayment') ); foreach ($listofchoices as $choice => $val) { $checked = (((!GETPOSTISSET('search') && $action != 'searchfiles') || GETPOST($choice)) ? ' checked="checked"' : ''); @@ -592,14 +616,34 @@ if (!empty($date_start) && !empty($date_stop)) // Ref print ''; // File link From 48183b396ad674fb22e1c9415978d8414b0fd9e8 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Wed, 13 May 2020 08:54:42 +0200 Subject: [PATCH 113/205] Fix top menu search method must be GET --- htdocs/main.inc.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 8e05aa34ab8..2beb4f74787 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -2002,7 +2002,7 @@ function top_menu_search() $defaultAction = ''; $buttonList = ''; + print ''; + $extrafields_collapse_num_old = $extrafields_collapse_num; print '
'.$langs->trans('Discount').''; if ($object->thirdparty->remise_percent) print $langs->trans("CompanyHasRelativeDiscount", $object->thirdparty->remise_percent); else print $langs->trans("CompanyHasNoRelativeDiscount"); @@ -1502,8 +1502,6 @@ else } - $colorb = '666666'; - $arrayothercontracts = $object->getListOfContracts('others'); /* @@ -1775,8 +1773,8 @@ else print ''; - print ''; - print '
'; + print ''; + print '
'; print '
'; - if ($data['item'] == 'Invoice') { - $invoice->id = $data['id']; + if ($data['item'] == 'Invoice') { + $invoice->id = $data['id']; $invoice->ref = $data['ref']; print $invoice->getNomUrl(1, '', 0, 0, '', 0, 0, 0); } elseif ($data['item'] == 'SupplierInvoice') { $supplier_invoice->id = $data['id']; $supplier_invoice->ref = $data['ref']; print $supplier_invoice->getNomUrl(1, '', 0, 0, '', 0, 0, 0); + } elseif ($data['item'] == 'ExpenseReport') { + $expensereport->id = $data['id']; + $expensereport->ref = $data['ref']; + print $expensereport->getNomUrl(1, '', 0, 0, '', 0, 0, 0); + } elseif ($data['item'] == 'SalaryPayment') { + $salary_payment->id = $data['id']; + $salary_payment->ref = $data['ref']; + print $salary_payment->getNomUrl(1, '', 0, 0, '', 0, 0, 0); + } elseif ($data['item'] == 'Donation') { + $don->id = $data['id']; + $don->ref = $data['ref']; + print $don->getNomUrl(1, '', 0, 0, '', 0, 0, 0); + } elseif ($data['item'] == 'SocialContributions') { + $charge_sociales->id = $data['id']; + $charge_sociales->ref = $data['ref']; + print $charge_sociales->getNomUrl(1, '', 0, 0, '', 0, 0, 0); + } elseif ($data['item'] == 'VariousPayment') { + $various_payment->id = $data['id']; + $various_payment->ref = $data['ref']; + print $various_payment->getNomUrl(1, '', 0, 0, '', 0, 0, 0); } else { print $data['ref']; } From b7ae5ffa1d085661bed4906ad4540562e6134219 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Wed, 13 May 2020 06:12:45 +0000 Subject: [PATCH 112/205] Fixing style errors. --- htdocs/compta/accounting-files.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/htdocs/compta/accounting-files.php b/htdocs/compta/accounting-files.php index 9c26cc0999c..66d36df25b2 100644 --- a/htdocs/compta/accounting-files.php +++ b/htdocs/compta/accounting-files.php @@ -616,37 +616,37 @@ if (!empty($date_start) && !empty($date_stop)) // Ref print ''; - if ($data['item'] == 'Invoice') { - $invoice->id = $data['id']; + if ($data['item'] == 'Invoice') { + $invoice->id = $data['id']; $invoice->ref = $data['ref']; print $invoice->getNomUrl(1, '', 0, 0, '', 0, 0, 0); - } elseif ($data['item'] == 'SupplierInvoice') { + } elseif ($data['item'] == 'SupplierInvoice') { $supplier_invoice->id = $data['id']; $supplier_invoice->ref = $data['ref']; print $supplier_invoice->getNomUrl(1, '', 0, 0, '', 0, 0, 0); - } elseif ($data['item'] == 'ExpenseReport') { + } elseif ($data['item'] == 'ExpenseReport') { $expensereport->id = $data['id']; $expensereport->ref = $data['ref']; print $expensereport->getNomUrl(1, '', 0, 0, '', 0, 0, 0); - } elseif ($data['item'] == 'SalaryPayment') { + } elseif ($data['item'] == 'SalaryPayment') { $salary_payment->id = $data['id']; $salary_payment->ref = $data['ref']; print $salary_payment->getNomUrl(1, '', 0, 0, '', 0, 0, 0); - } elseif ($data['item'] == 'Donation') { + } elseif ($data['item'] == 'Donation') { $don->id = $data['id']; $don->ref = $data['ref']; print $don->getNomUrl(1, '', 0, 0, '', 0, 0, 0); - } elseif ($data['item'] == 'SocialContributions') { + } elseif ($data['item'] == 'SocialContributions') { $charge_sociales->id = $data['id']; $charge_sociales->ref = $data['ref']; print $charge_sociales->getNomUrl(1, '', 0, 0, '', 0, 0, 0); - } elseif ($data['item'] == 'VariousPayment') { + } elseif ($data['item'] == 'VariousPayment') { $various_payment->id = $data['id']; $various_payment->ref = $data['ref']; print $various_payment->getNomUrl(1, '', 0, 0, '', 0, 0, 0); - } else { + } else { print $data['ref']; - } + } print '
'; print ''; print ''; - print '\n"; From 872518a91fa2f30318f298c5bb630af616ee32e4 Mon Sep 17 00:00:00 2001 From: "DEMAREST Maxime (Indelog)" Date: Wed, 13 May 2020 16:54:53 +0200 Subject: [PATCH 120/205] Add total by credit/debit for accounting-file.php --- htdocs/compta/accounting-files.php | 104 ++++++++++++++++------------- 1 file changed, 56 insertions(+), 48 deletions(-) diff --git a/htdocs/compta/accounting-files.php b/htdocs/compta/accounting-files.php index 98d8c9b9983..64332671b5d 100644 --- a/htdocs/compta/accounting-files.php +++ b/htdocs/compta/accounting-files.php @@ -42,6 +42,10 @@ require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/paymentvarious.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; +// Constant to define payment sens +const PAY_DEBIT = 0; +const PAY_CREDIT = 1; + $langs->loadLangs(array("accountancy", "bills", "companies", "salaries", "compta", "trips", "banks")); $date_start = GETPOST('date_start', 'alpha'); @@ -144,7 +148,7 @@ if (($action == 'searchfiles' || $action == 'dl')) { // Customer invoices if (GETPOST('selectinvoices')) { if (!empty($sql)) $sql .= " UNION ALL"; - $sql .= "SELECT t.rowid as id, t.entity, t.ref, t.paye as paid, t.total as total_ht, t.total_ttc, t.tva as total_vat, t.fk_soc, t.datef as date, t.date_lim_reglement as date_due, 'Invoice' as item, s.nom as thirdparty_name, s.code_client as thirdparty_code, c.code as country_code, s.tva_intra as vatnum"; + $sql .= "SELECT t.rowid as id, t.entity, t.ref, t.paye as paid, t.total as total_ht, t.total_ttc, t.tva as total_vat, t.fk_soc, t.datef as date, t.date_lim_reglement as date_due, 'Invoice' as item, s.nom as thirdparty_name, s.code_client as thirdparty_code, c.code as country_code, s.tva_intra as vatnum, ".PAY_CREDIT." as sens"; $sql .= " FROM ".MAIN_DB_PREFIX."facture as t LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = t.fk_soc LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON c.rowid = s.fk_pays"; $sql .= " WHERE datef between ".$wheretail; $sql .= " AND t.entity IN (".($entity == 1 ? '0,1' : $entity).')'; @@ -153,7 +157,7 @@ if (($action == 'searchfiles' || $action == 'dl')) { // Vendor invoices if (GETPOST('selectsupplierinvoices')) { if (!empty($sql)) $sql .= " UNION ALL"; - $sql .= " SELECT t.rowid as id, t.entity, t.ref, t.paye as paid, t.total_ht, t.total_ttc, t.total_tva as total_vat, t.fk_soc, t.datef as date, t.date_lim_reglement as date_due, 'SupplierInvoice' as item, s.nom as thirdparty_name, s.code_fournisseur as thirdparty_code, c.code as country_code, s.tva_intra as vatnum"; + $sql .= " SELECT t.rowid as id, t.entity, t.ref, t.paye as paid, t.total_ht, t.total_ttc, t.total_tva as total_vat, t.fk_soc, t.datef as date, t.date_lim_reglement as date_due, 'SupplierInvoice' as item, s.nom as thirdparty_name, s.code_fournisseur as thirdparty_code, c.code as country_code, s.tva_intra as vatnum, ".PAY_DEBIT." as sens"; $sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as t LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = t.fk_soc LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON c.rowid = s.fk_pays"; $sql .= " WHERE datef between ".$wheretail; $sql .= " AND t.entity IN (".($entity == 1 ? '0,1' : $entity).')'; @@ -162,7 +166,7 @@ if (($action == 'searchfiles' || $action == 'dl')) { // Expense reports if (GETPOST('selectexpensereports')) { if (!empty($sql)) $sql .= " UNION ALL"; - $sql .= " SELECT t.rowid as id, t.entity, t.ref, t.paid, t.total_ht, t.total_ttc, t.total_tva as total_vat, t.fk_user_author as fk_soc, t.date_fin as date, t.date_fin as date_due, 'ExpenseReport' as item, CONCAT(CONCAT(u.lastname, ' '), u.firstname) as thirdparty_name, '' as thirdparty_code, c.code as country_code, '' as vatnum"; + $sql .= " SELECT t.rowid as id, t.entity, t.ref, t.paid, t.total_ht, t.total_ttc, t.total_tva as total_vat, t.fk_user_author as fk_soc, t.date_fin as date, t.date_fin as date_due, 'ExpenseReport' as item, CONCAT(CONCAT(u.lastname, ' '), u.firstname) as thirdparty_name, '' as thirdparty_code, c.code as country_code, '' as vatnum, ".PAY_DEBIT." as sens"; $sql .= " FROM ".MAIN_DB_PREFIX."expensereport as t LEFT JOIN ".MAIN_DB_PREFIX."user as u ON u.rowid = t.fk_user_author LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON c.rowid = u.fk_country"; $sql .= " WHERE date_fin between ".$wheretail; $sql .= " AND t.entity IN (".($entity == 1 ? '0,1' : $entity).')'; @@ -171,7 +175,7 @@ if (($action == 'searchfiles' || $action == 'dl')) { // Donations if (GETPOST('selectdonations')) { if (!empty($sql)) $sql .= " UNION ALL"; - $sql .= " SELECT t.rowid as id, t.entity, t.ref, paid, amount as total_ht, amount as total_ttc, 0 as total_vat, 0 as fk_soc, t.datedon as date, t.datedon as date_due, 'Donation' as item, t.societe as thirdparty_name, '' as thirdparty_code, c.code as country_code, '' as vatnum"; + $sql .= " SELECT t.rowid as id, t.entity, t.ref, paid, amount as total_ht, amount as total_ttc, 0 as total_vat, 0 as fk_soc, t.datedon as date, t.datedon as date_due, 'Donation' as item, t.societe as thirdparty_name, '' as thirdparty_code, c.code as country_code, '' as vatnum, ".PAY_CREDIT." as sens"; $sql .= " FROM ".MAIN_DB_PREFIX."don as t LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON c.rowid = t.fk_country"; $sql .= " WHERE datedon between ".$wheretail; $sql .= " AND t.entity IN (".($entity == 1 ? '0,1' : $entity).')'; @@ -180,7 +184,7 @@ if (($action == 'searchfiles' || $action == 'dl')) { // Paiements of salaries if (GETPOST('selectpaymentsofsalaries')) { if (!empty($sql)) $sql .= " UNION ALL"; - $sql .= " SELECT t.rowid as id, t.entity, t.label as ref, 1 as paid, amount as total_ht, amount as total_ttc, 0 as total_vat, t.fk_user as fk_soc, t.datep as date, t.dateep as date_due, 'SalaryPayment' as item, CONCAT(CONCAT(u.lastname, ' '), u.firstname) as thirdparty_name, '' as thirdparty_code, c.code as country_code, '' as vatnum"; + $sql .= " SELECT t.rowid as id, t.entity, t.label as ref, 1 as paid, amount as total_ht, amount as total_ttc, 0 as total_vat, t.fk_user as fk_soc, t.datep as date, t.dateep as date_due, 'SalaryPayment' as item, CONCAT(CONCAT(u.lastname, ' '), u.firstname) as thirdparty_name, '' as thirdparty_code, c.code as country_code, '' as vatnum, ".PAY_DEBIT." as sens"; $sql .= " FROM ".MAIN_DB_PREFIX."payment_salary as t LEFT JOIN ".MAIN_DB_PREFIX."user as u ON u.rowid = t.fk_user LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON c.rowid = u.fk_country"; $sql .= " WHERE datep between ".$wheretail; $sql .= " AND t.entity IN (".($entity == 1 ? '0,1' : $entity).')'; @@ -189,7 +193,7 @@ if (($action == 'searchfiles' || $action == 'dl')) { // Social contributions if (GETPOST('selectsocialcontributions')) { if (!empty($sql)) $sql .= " UNION ALL"; - $sql .= " SELECT t.rowid as id, t.entity, t.libelle as ref, t.paye as paid, t.amount as total_ht, t.amount as total_ttc, 0 as total_tva, 0 as fk_soc, t.date_creation as date, t.date_ech as date_due, 'SocialContributions' as item, '' as thirdparty_name, '' as thirdparty_code, '' as country_code, '' as vatnum"; + $sql .= " SELECT t.rowid as id, t.entity, t.libelle as ref, t.paye as paid, t.amount as total_ht, t.amount as total_ttc, 0 as total_tva, 0 as fk_soc, t.date_creation as date, t.date_ech as date_due, 'SocialContributions' as item, '' as thirdparty_name, '' as thirdparty_code, '' as country_code, '' as vatnum, ".PAY_DEBIT." as sens"; $sql .= " FROM ".MAIN_DB_PREFIX."chargesociales as t"; $sql .= " WHERE date_creation between ".$wheretail; $sql .= " AND t.entity IN (".($entity == 1 ? '0,1' : $entity).')'; @@ -198,7 +202,7 @@ if (($action == 'searchfiles' || $action == 'dl')) { // Various payments if (GETPOST('selectvariouspayment')) { if (!empty($sql)) $sql .= " UNION ALL"; - $sql .= " SELECT t.rowid as id, t.entity, t.label as ref, 1 as paid, t.amount as total_ht, t.amount as total_ttc, 0 as total_tva, 0 as fk_soc, t.datep as date, t.datep as date_due, 'VariousPayment' as item, '' as thirdparty_name, '' as thirdparty_code, '' as country_code, '' as vatnum"; + $sql .= " SELECT t.rowid as id, t.entity, t.label as ref, 1 as paid, t.amount as total_ht, t.amount as total_ttc, 0 as total_tva, 0 as fk_soc, t.datep as date, t.datep as date_due, 'VariousPayment' as item, '' as thirdparty_name, '' as thirdparty_code, '' as country_code, '' as vatnum, sens"; $sql .= " FROM ".MAIN_DB_PREFIX."payment_various as t"; $sql .= " WHERE datep between ".$wheretail; $sql .= " AND t.entity IN (".($entity == 1 ? '0,1' : $entity).')'; @@ -311,6 +315,7 @@ if (($action == 'searchfiles' || $action == 'dl')) { $nofile['thirdparty_code'] = $objd->thirdparty_code; $nofile['country_code'] = $objd->country_code; $nofile['vatnum'] = $objd->vatnum; + $nofile['sens'] = $objd->sens; $filesarray[$nofile['item'].'_'.$nofile['id']] = $nofile; } @@ -329,11 +334,11 @@ if (($action == 'searchfiles' || $action == 'dl')) { $file['ref'] = ($objd->ref ? $objd->ref : $objd->id); $file['fk'] = $objd->fk_soc; $file['item'] = $objd->item; - $file['thirdparty_name'] = $objd->thirdparty_name; $file['thirdparty_code'] = $objd->thirdparty_code; $file['country_code'] = $objd->country_code; $file['vatnum'] = $objd->vatnum; + $file['sens'] = $objd->sens; // Save record into array (only the first time it is found) if (empty($filesarray[$file['item'].'_'.$file['id']])) { @@ -417,7 +422,8 @@ if ($result && $action == "dl" && !$error) $log .= ','.$langs->transnoentitiesnoconv("ThirdParty"); $log .= ','.$langs->transnoentitiesnoconv("Code"); $log .= ','.$langs->transnoentitiesnoconv("Country"); - $log .= ','.$langs->transnoentitiesnoconv("VATIntra")."\n"; + $log .= ','.$langs->transnoentitiesnoconv("VATIntra"); + $log .= ','.$langs->transnoentitiesnoconv("Sens")."\n"; $zipname = $dirfortmpfile.'/'.dol_print_date($date_start, 'dayrfc')."-".dol_print_date($date_stop, 'dayrfc').'_export.zip'; dol_delete_file($zipname); @@ -454,6 +460,7 @@ if ($result && $action == "dl" && !$error) $log .= ',"'.$file['thirdparty_code'].'"'; $log .= ',"'.$file['country_code'].'"'; $log .= ',"'.$file['vatnum'].'"'; + $log .= ',"'.$file['sens'].'"'; $log .= "\n"; } $zip->addFromString('transactions.csv', $log); @@ -605,11 +612,12 @@ if (!empty($date_start) && !empty($date_stop)) { // Sort array by date ASC to calculate balance - $totalET = 0; - $totalIT = 0; - $totalVAT = 0; - $totalDebit = 0; - $totalCredit = 0; + $totalET_debit = 0; + $totalIT_debit = 0; + $totalVAT_debit = 0; + $totalET_credit = 0; + $totalIT_credit = 0; + $totalVAT_credit = 0; // Display array foreach ($TData as $data) @@ -682,11 +690,11 @@ if (!empty($date_start) && !empty($date_stop)) print ''; // Total ET - print '\n"; + print '\n"; // Total IT - print '\n"; + print '\n"; // Total VAT - print '\n"; + print '\n"; print '\n"; @@ -696,42 +704,42 @@ if (!empty($date_start) && !empty($date_stop)) print '\n"; - // Debit - //print '\n"; - // Credit - //print '\n"; - - $totalET += $data['amount_ht']; - $totalIT += $data['amount_ttc']; - $totalVAT += $data['amount_vat']; - - $totalDebit += ($data['amount_ttc'] > 0) ? abs($data['amount_ttc']) : 0; - $totalCredit += ($data['amount_ttc'] > 0) ? 0 : abs($data['amount_ttc']); - - // Balance - //print '\n"; + if ($data['sens']) { + $totalET_credit += $data['amount_ht']; + $totalIT_credit += $data['amount_ttc']; + $totalVAT_credit += $data['amount_vat']; + } else { + $totalET_debit -= $data['amount_ht']; + $totalIT_debit -= $data['amount_ttc']; + $totalVAT_debit -= $data['amount_vat']; + } print "\n"; } + // Total credits print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - /*print ''; - print ''; - print ''; - */ + print ''; + print ''; + print ''; + print ''; + print ''; + print "\n"; + // Total debits + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print "\n"; + // Balance + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; print "\n"; } } From ee6e717f4632716ce1e4d6a12301882b17850524 Mon Sep 17 00:00:00 2001 From: "DEMAREST Maxime (Indelog)" Date: Wed, 13 May 2020 17:47:30 +0200 Subject: [PATCH 121/205] Add payment loan in accounting-files.php --- htdocs/compta/accounting-files.php | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/accounting-files.php b/htdocs/compta/accounting-files.php index 64332671b5d..a97a0a815b7 100644 --- a/htdocs/compta/accounting-files.php +++ b/htdocs/compta/accounting-files.php @@ -41,12 +41,13 @@ require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/paymentvarious.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; +require_once DOL_DOCUMENT_ROOT.'/loan/class/paymentloan.class.php'; // Constant to define payment sens const PAY_DEBIT = 0; const PAY_CREDIT = 1; -$langs->loadLangs(array("accountancy", "bills", "companies", "salaries", "compta", "trips", "banks")); +$langs->loadLangs(array("accountancy", "bills", "companies", "salaries", "compta", "trips", "banks", "loan")); $date_start = GETPOST('date_start', 'alpha'); $date_startDay = GETPOST('date_startday', 'int'); @@ -207,6 +208,14 @@ if (($action == 'searchfiles' || $action == 'dl')) { $sql .= " WHERE datep between ".$wheretail; $sql .= " AND t.entity IN (".($entity == 1 ? '0,1' : $entity).')'; } + // Loan payments + if (GETPOST('selectloanspayment')) { + if (!empty($sql)) $sql .= " UNION ALL"; + $sql .= " SELECT t.rowid as id, l.entity, l.label as ref, 1 as paid, (t.amount_capital+t.amount_insurance+t.amount_interest) as total_ht, (t.amount_capital+t.amount_insurance+t.amount_interest) as total_ttc, 0 as total_tva, 0 as fk_soc, t.datep as date, t.datep as date_due, 'LoanPayment' as item, '' as thirdparty_name, '' as thirdparty_code, '' as country_code, '' as vatnum, ".PAY_DEBIT." as sens"; + $sql .= " FROM ".MAIN_DB_PREFIX."payment_loan as t LEFT JOIN ".MAIN_DB_PREFIX."loan as l ON l.rowid = t.fk_loan"; + $sql .= " WHERE datep between ".$wheretail; + $sql .= " AND l.entity IN (".($entity == 1 ? '0,1' : $entity).')'; + } if ($sql) { $sql .= $db->order($sortfield, $sortorder); @@ -283,6 +292,13 @@ if (($action == 'searchfiles' || $action == 'dl')) { $link = "document.php?modulepart=banque&file=".str_replace('/', '%2F', $subdir).'%2F'; $modulepart = "banque"; break; + case "LoanPayment": + // Loan payment has no linked file + $subdir = ''; + $upload_dir = $conf->loan->dir_output.'/'.$subdir; + $link = ""; + $modulepart = ""; + break; default: $subdir = ''; $upload_dir = ''; @@ -497,6 +513,7 @@ $don = new Don($db); $salary_payment = new PaymentSalary($db); $charge_sociales = new ChargeSociales($db); $various_payment = new PaymentVarious($db); +$payment_loan = new PaymentLoan($db); $title = $langs->trans("ComptaFiles").' - '.$langs->trans("List"); $help_url = ''; @@ -542,7 +559,8 @@ $listofchoices = array( 'selectdonations'=>array('label'=>'Donations', 'lang'=>'donation'), 'selectpaymentsofsalaries'=>array('label'=>'SalariesPayments', 'lang'=>'salaries'), 'selectsocialcontributions'=>array('label'=>'SocialContributions'), - 'selectvariouspayment'=>array('label'=>'VariousPayment') + 'selectvariouspayment'=>array('label'=>'VariousPayment'), + 'selectloanspayment'=>array('label'=>'PaymentLoan'), ); foreach ($listofchoices as $choice => $val) { $checked = (((!GETPOSTISSET('search') && $action != 'searchfiles') || GETPOST($choice)) ? ' checked="checked"' : ''); @@ -671,6 +689,10 @@ if (!empty($date_start) && !empty($date_stop)) $various_payment->id = $data['id']; $various_payment->ref = $data['ref']; print $various_payment->getNomUrl(1, '', 0, 0, '', 0, 0, 0); + } elseif ($data['item'] == 'LoanPayment') { + $payment_loan->id = $data['id']; + $payment_loan->ref = $data['ref']; + print $payment_loan->getNomUrl(1, '', 0, 0, '', 0, 0, 0); } else { print $data['ref']; } From ac0b735131af206c67d34420ed38a3fff43a8482 Mon Sep 17 00:00:00 2001 From: "DEMAREST Maxime (Indelog)" Date: Wed, 13 May 2020 18:01:00 +0200 Subject: [PATCH 122/205] Fix use date_ech for social contributions in accounting-file.php --- htdocs/compta/accounting-files.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/accounting-files.php b/htdocs/compta/accounting-files.php index a97a0a815b7..f9bc453d999 100644 --- a/htdocs/compta/accounting-files.php +++ b/htdocs/compta/accounting-files.php @@ -194,9 +194,9 @@ if (($action == 'searchfiles' || $action == 'dl')) { // Social contributions if (GETPOST('selectsocialcontributions')) { if (!empty($sql)) $sql .= " UNION ALL"; - $sql .= " SELECT t.rowid as id, t.entity, t.libelle as ref, t.paye as paid, t.amount as total_ht, t.amount as total_ttc, 0 as total_tva, 0 as fk_soc, t.date_creation as date, t.date_ech as date_due, 'SocialContributions' as item, '' as thirdparty_name, '' as thirdparty_code, '' as country_code, '' as vatnum, ".PAY_DEBIT." as sens"; + $sql .= " SELECT t.rowid as id, t.entity, t.libelle as ref, t.paye as paid, t.amount as total_ht, t.amount as total_ttc, 0 as total_tva, 0 as fk_soc, t.date_ech as date, t.periode as date_due, 'SocialContributions' as item, '' as thirdparty_name, '' as thirdparty_code, '' as country_code, '' as vatnum, ".PAY_DEBIT." as sens"; $sql .= " FROM ".MAIN_DB_PREFIX."chargesociales as t"; - $sql .= " WHERE date_creation between ".$wheretail; + $sql .= " WHERE t.date_ech between ".$wheretail; $sql .= " AND t.entity IN (".($entity == 1 ? '0,1' : $entity).')'; //$sql.=" AND fk_statut <> ".ChargeSociales::STATUS_DRAFT; } From 9f6a5d4cc95097e92eeb94d6524add35ae3a5c3d Mon Sep 17 00:00:00 2001 From: ATM john Date: Thu, 14 May 2020 10:50:20 +0200 Subject: [PATCH 123/205] Fix multicompany supplier product price filter --- htdocs/core/class/html.form.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 93061d200d8..078cfb2b5f2 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -2759,7 +2759,7 @@ class Form } if (!empty($conf->barcode->enabled)) $sql .= ", pfp.barcode"; $sql .= " FROM ".MAIN_DB_PREFIX."product as p"; - $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_fournisseur_price as pfp ON p.rowid = pfp.fk_product"; + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_fournisseur_price as pfp ON ( p.rowid = pfp.fk_product AND pfp.entity IN (".getEntity('product').") )"; if ($socid) $sql .= " AND pfp.fk_soc = ".$socid; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON pfp.fk_soc = s.rowid"; // Units From 1bd00b0e8c635db1a8348c97d3933699b92d88db Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 14 May 2020 12:28:17 +0200 Subject: [PATCH 124/205] Fix to solve feedbacks of https://www.dolibarr.fr/forum/t/email-collector-avec-office-365-bug-et-contournement/32726 --- .../class/emailcollector.class.php | 20 +++++++++++++++---- .../install/mysql/migration/11.0.0-12.0.0.sql | 2 ++ .../llx_emailcollector_emailcollector.sql | 3 ++- htdocs/langs/en_US/admin.lang | 1 + 4 files changed, 21 insertions(+), 5 deletions(-) diff --git a/htdocs/emailcollector/class/emailcollector.class.php b/htdocs/emailcollector/class/emailcollector.class.php index 11cf2477720..969b83cac5a 100644 --- a/htdocs/emailcollector/class/emailcollector.class.php +++ b/htdocs/emailcollector/class/emailcollector.class.php @@ -100,8 +100,9 @@ class EmailCollector extends CommonObject 'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>10, 'searchall'=>1, 'help'=>'Example: MyCollector1'), 'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'visible'=>1, 'enabled'=>1, 'position'=>30, 'notnull'=>-1, 'searchall'=>1, 'help'=>'Example: My Email collector'), 'description' => array('type'=>'text', 'label'=>'Description', 'visible'=>-1, 'enabled'=>1, 'position'=>60, 'notnull'=>-1), - 'host' => array('type'=>'varchar(255)', 'label'=>'EMailHost', 'visible'=>1, 'enabled'=>1, 'position'=>100, 'notnull'=>1, 'searchall'=>1, 'comment'=>"IMAP server", 'help'=>'Example: imap.gmail.com'), - 'login' => array('type'=>'varchar(128)', 'label'=>'Login', 'visible'=>1, 'enabled'=>1, 'position'=>101, 'notnull'=>-1, 'index'=>1, 'comment'=>"IMAP login", 'help'=>'Example: myaccount@gmail.com'), + 'host' => array('type'=>'varchar(255)', 'label'=>'EMailHost', 'visible'=>1, 'enabled'=>1, 'position'=>90, 'notnull'=>1, 'searchall'=>1, 'comment'=>"IMAP server", 'help'=>'Example: imap.gmail.com'), + 'hostcharset' => array('type'=>'varchar(16)', 'label'=>'HostCharset', 'visible'=>-1, 'enabled'=>1, 'position'=>91, 'notnull'=>0, 'searchall'=>0, 'comment'=>"IMAP server charset", 'help'=>'Example: "UTF-8" (May be "US-ASCII" with some Office365)'), + 'login' => array('type'=>'varchar(128)', 'label'=>'Login', 'visible'=>1, 'enabled'=>1, 'position'=>101, 'notnull'=>-1, 'index'=>1, 'comment'=>"IMAP login", 'help'=>'Example: myaccount@gmail.com'), 'password' => array('type'=>'password', 'label'=>'Password', 'visible'=>-1, 'enabled'=>1, 'position'=>102, 'notnull'=>-1, 'comment'=>"IMAP password", 'help'=>'WithGMailYouCanCreateADedicatedPassword'), 'source_directory' => array('type'=>'varchar(255)', 'label'=>'MailboxSourceDirectory', 'visible'=>-1, 'enabled'=>1, 'position'=>103, 'notnull'=>1, 'default' => 'Inbox', 'help'=>'Example: INBOX'), //'filter' => array('type'=>'text', 'label'=>'Filter', 'visible'=>1, 'enabled'=>1, 'position'=>105), @@ -173,6 +174,7 @@ class EmailCollector extends CommonObject public $host; + public $hostcharset; public $login; public $password; public $source_directory; @@ -985,9 +987,10 @@ class EmailCollector extends CommonObject $nbemailprocessed = 0; $nbemailok = 0; $nbactiondone = 0; + $charset = ($this->hostcharset ? $this->hostcharset : "UTF-8"); // Scan IMAP inbox - $arrayofemail = imap_search($connection, $search, null, "UTF-8"); + $arrayofemail = imap_search($connection, $search, null, $charset); if ($arrayofemail === false) { // Nothing found or search string not understood @@ -1086,6 +1089,7 @@ class EmailCollector extends CommonObject } $header = imap_fetchheader($connection, $imapemail, 0); + $header = preg_replace('/\r\n\s+/m', ' ', $header); // When a header line is on several lines, merge lines $matches = array(); preg_match_all('/([^: ]+): (.+?(?:\r\n\s(?:.+?))*)\r\n/m', $header, $matches); $headers = array_combine($matches[1], $matches[2]); @@ -1132,7 +1136,10 @@ class EmailCollector extends CommonObject // Can use also imap_mime_header_decode($str) // Can use also mb_decode_mimeheader($str) // Can use also iconv_mime_decode($str, ICONV_MIME_DECODE_CONTINUE_ON_ERROR, 'UTF-8') - if (function_exists('imap_mime_header_decode')) { + if (function_exists('iconv_mime_decode')) { + $overview[0]->subject = iconv_mime_decode($overview[0]->subject, ICONV_MIME_DECODE_CONTINUE_ON_ERROR, 'UTF-8'); + } + elseif (function_exists('imap_mime_header_decode')) { $elements = imap_mime_header_decode($overview[0]->subject); $newstring = ''; if (!empty($elements)) { @@ -1146,6 +1153,8 @@ class EmailCollector extends CommonObject elseif (function_exists('mb_decode_mimeheader')) { $overview[0]->subject = mb_decode_mimeheader($overview[0]->subject); } + // Removed emojis + $overview[0]->subject = preg_replace('/[\x{10000}-\x{10FFFF}]/u', "\xEF\xBF\xBD", $overview[0]->subject); // Parse IMAP email structure global $htmlmsg, $plainmsg, $charset, $attachments; @@ -1153,6 +1162,9 @@ class EmailCollector extends CommonObject //$htmlmsg,$plainmsg,$charset,$attachments $messagetext = $plainmsg ? $plainmsg : dol_string_nohtmltag($htmlmsg, 0); + // Removed emojis + $messagetext = preg_replace('/[\x{10000}-\x{10FFFF}]/u', "\xEF\xBF\xBD", $messagetext); + /*var_dump($plainmsg); var_dump($htmlmsg); var_dump($messagetext);*/ diff --git a/htdocs/install/mysql/migration/11.0.0-12.0.0.sql b/htdocs/install/mysql/migration/11.0.0-12.0.0.sql index 8a68e763160..7daf41a05d3 100644 --- a/htdocs/install/mysql/migration/11.0.0-12.0.0.sql +++ b/htdocs/install/mysql/migration/11.0.0-12.0.0.sql @@ -285,3 +285,5 @@ ALTER TABLE llx_prelevement_facture ADD COLUMN fk_facture_fourn INTEGER NULL; ALTER TABLE llx_menu MODIFY COLUMN module varchar(255); UPDATE llx_actioncomm SET fk_action = 50 where fk_action = 40 AND code = 'TICKET_MSG'; + +ALTER TABLE llx_emailcollector_emailcollector ADD COLUMN hostcharset varchar(16) DEFAULT 'UTF-8'; diff --git a/htdocs/install/mysql/tables/llx_emailcollector_emailcollector.sql b/htdocs/install/mysql/tables/llx_emailcollector_emailcollector.sql index 10f3e4f8b9b..87581f418e8 100644 --- a/htdocs/install/mysql/tables/llx_emailcollector_emailcollector.sql +++ b/htdocs/install/mysql/tables/llx_emailcollector_emailcollector.sql @@ -21,7 +21,8 @@ CREATE TABLE llx_emailcollector_emailcollector( ref varchar(128) NOT NULL, label varchar(255), description text, - host varchar(255), + host varchar(255), + hostcharset varchar(16) DEFAULT 'UTF-8', login varchar(128), password varchar(128), source_directory varchar(255) NOT NULL, diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 1bd7f3d0297..5ce79a12231 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -40,6 +40,7 @@ WebUserGroup=Web server user/group NoSessionFound=Your PHP configuration seems to not allow listing of active sessions. The directory used to save sessions (%s) may be protected (for example by OS permissions or by PHP directive open_basedir). DBStoringCharset=Database charset to store data DBSortingCharset=Database charset to sort data +HostCharset=Host charset ClientCharset=Client charset ClientSortingCharset=Client collation WarningModuleNotActive=Module %s must be enabled From bcaa83eeeca16486d5d3d511ea7290b25146aba5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 14 May 2020 14:10:04 +0200 Subject: [PATCH 125/205] FIX dol_concatdesc to escape < Better help --- htdocs/admin/emailcollector_card.php | 4 ++-- htdocs/core/class/translate.class.php | 2 +- htdocs/core/lib/functions.lib.php | 9 +++++---- htdocs/emailcollector/class/emailcollector.class.php | 9 +++++++-- htdocs/langs/en_US/admin.lang | 2 +- 5 files changed, 16 insertions(+), 10 deletions(-) diff --git a/htdocs/admin/emailcollector_card.php b/htdocs/admin/emailcollector_card.php index 74592ff777a..80161eaadc6 100644 --- a/htdocs/admin/emailcollector_card.php +++ b/htdocs/admin/emailcollector_card.php @@ -592,7 +592,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print ''; $htmltext = $langs->transnoentitiesnoconv("OperationParamDesc"); //var_dump($htmltext); - print $form->textwithpicto('', $htmltext); + print $form->textwithpicto('', $htmltext, 1, 'help', '', 0, 2, 'operationparamtt'); print ''; print ''; print ''; @@ -643,7 +643,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print ''; // Delete print ''; print ''; diff --git a/htdocs/core/class/translate.class.php b/htdocs/core/class/translate.class.php index 4f3930a4588..3fc3151030a 100644 --- a/htdocs/core/class/translate.class.php +++ b/htdocs/core/class/translate.class.php @@ -308,7 +308,7 @@ class Translate continue; } else { - // Convert some strings: Parse and render carriage returns. Also, change '\\s' int '\s' because transifex sync pull the string '\s' into string '\\s' + // Convert some strings: Parse and render carriage returns. Also, change '\\s' into '\s' because transifex sync pull the string '\s' into string '\\s' $this->tab_translate[$key] = str_replace(array('\\n', '\\\\s'), array("\n", '\s'), $value); if ($usecachekey) { $tabtranslatedomain[$key] = $value; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 20094da216c..31716dc3f3c 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -5794,7 +5794,8 @@ function dolGetFirstLineOfText($text, $nboflines = 1, $charset = 'UTF-8') /** - * Replace CRLF in string with a HTML BR tag + * Replace CRLF in string with a HTML BR tag. + * WARNING: The content after operation contains some HTML tags (the
) so be sure to also have encode the special chars of stringtoencode into HTML before. * * @param string $stringtoencode String to encode * @param int $nl2brmode 0=Adding br before \n, 1=Replacing \n by br @@ -6048,7 +6049,7 @@ function dol_textishtml($msg, $option = 0) * * @param string $text1 Text 1 * @param string $text2 Text 2 - * @param bool $forxml false=Use
instead of \n if html content detected, true=Use
instead of \n if html content detected + * @param bool $forxml true=Use
instead of
if we have to add a br tag * @param bool $invert invert order of description lines (we often use config MAIN_CHANGE_ORDER_CONCAT_DESCRIPTION in this parameter) * @return string Text 1 + new line + Text2 * @see dol_textishtml() @@ -6063,9 +6064,9 @@ function dol_concatdesc($text1, $text2, $forxml = false, $invert = false) } $ret = ''; - $ret .= (!dol_textishtml($text1) && dol_textishtml($text2)) ?dol_nl2br($text1, 0, $forxml) : $text1; + $ret .= (!dol_textishtml($text1) && dol_textishtml($text2)) ? dol_nl2br(dol_escape_htmltag($text1, 0, 1, '', 1), 0, $forxml) : $text1; $ret .= (!empty($text1) && !empty($text2)) ? ((dol_textishtml($text1) || dol_textishtml($text2)) ? ($forxml ? "
\n" : "
\n") : "\n") : ""; - $ret .= (dol_textishtml($text1) && !dol_textishtml($text2)) ?dol_nl2br($text2, 0, $forxml) : $text2; + $ret .= (dol_textishtml($text1) && !dol_textishtml($text2)) ? dol_nl2br(dol_escape_htmltag($text2, 0, 1, '', 1), 0, $forxml) : $text2; return $ret; } diff --git a/htdocs/emailcollector/class/emailcollector.class.php b/htdocs/emailcollector/class/emailcollector.class.php index 969b83cac5a..2bc6d6db962 100644 --- a/htdocs/emailcollector/class/emailcollector.class.php +++ b/htdocs/emailcollector/class/emailcollector.class.php @@ -937,8 +937,8 @@ class EmailCollector extends CommonObject } imap_errors(); // Clear stack of errors. - // $conf->global->MAIL_PREFIX_FOR_EMAIL_ID must be defined $host = dol_getprefix('email'); + //$host = '123456'; // Define the IMAP search string // See https://tools.ietf.org/html/rfc3501#section-6.4.4 for IMAPv4 (PHP not yet compatible) @@ -1081,6 +1081,7 @@ class EmailCollector extends CommonObject dol_syslog("Start of loop on email", LOG_INFO, 1); + $i = 0; foreach ($arrayofemail as $imapemail) { if ($nbemailprocessed > 1000) @@ -1088,6 +1089,8 @@ class EmailCollector extends CommonObject break; // Do not process more than 1000 email per launch (this is a different protection than maxnbcollectedpercollect } + $i++; + $header = imap_fetchheader($connection, $imapemail, 0); $header = preg_replace('/\r\n\s+/m', ' ', $header); // When a header line is on several lines, merge lines $matches = array(); @@ -1095,6 +1098,8 @@ class EmailCollector extends CommonObject $headers = array_combine($matches[1], $matches[2]); //var_dump($headers); + dol_syslog("** Process email ".$i." References: ".$headers['References']); + // If there is a filter on trackid if ($searchfilterdoltrackid > 0) { @@ -1130,7 +1135,7 @@ class EmailCollector extends CommonObject // GET Email meta datas $overview = imap_fetch_overview($connection, $imapemail, 0); - dol_syslog("** Process email - msgid=".$overview[0]->message_id." date=".dol_print_date($overview[0]->udate, 'dayrfc', 'gmt')." subject=".$overview[0]->subject); + dol_syslog("msgid=".$overview[0]->message_id." date=".dol_print_date($overview[0]->udate, 'dayrfc', 'gmt')." subject=".$overview[0]->subject); // Decode $overview[0]->subject according to RFC2047 // Can use also imap_mime_header_decode($str) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 5ce79a12231..6c139a0f10c 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1939,7 +1939,7 @@ WithoutDolTrackingID=Dolibarr Reference not found in Message ID FormatZip=Zip MainMenuCode=Menu entry code (mainmenu) ECMAutoTree=Show automatic ECM tree -OperationParamDesc=Define values to use for action, or how to extract values. For example:
objproperty1=SET:abc
objproperty1=SET:a value with replacement of __objproperty1__
objproperty3=SETIFEMPTY:abc
objproperty4=EXTRACT:HEADER:X-Myheaderkey.*[^\s]+(.*)
options_myextrafield=EXTRACT:SUBJECT:([^\s]*)
object.objproperty5=EXTRACT:BODY:My company name is\s([^\s]*)

Use a ; char as separator to extract or set several properties. +OperationParamDesc=Define the values to use for the object of the action, or how to extract values. For example:
objproperty1=SET:the value to set
objproperty2=SET:a value with replacement of __objproperty1__
objproperty3=SETIFEMPTY:value used if objproperty3 is not already defined
objproperty4=EXTRACT:HEADER:X-Myheaderkey:\s*([^\s]*)
options_myextrafield1=EXTRACT:SUBJECT:([^\n]*)
object.objproperty5=EXTRACT:BODY:My company name is\s([^\s]*)

Use a ; char as separator to extract or set several properties. OpeningHours=Opening hours OpeningHoursDesc=Enter here the regular opening hours of your company. ResourceSetup=Configuration of Resource module From 4a65b629ee3c93266226208d24806aee8243e168 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 14 May 2020 14:29:14 +0200 Subject: [PATCH 126/205] Position of fields --- htdocs/index.php | 4 ++-- htdocs/theme/eldy/global.inc.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/index.php b/htdocs/index.php index 36aae1f25b8..7f6e462839b 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -142,11 +142,11 @@ if (empty($user->socid) && empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTATS)) 'orders', 'invoices', 'donations', - 'contracts', - 'interventions', 'supplier_proposals', 'supplier_orders', 'supplier_invoices', + 'contracts', + 'interventions', 'ticket' ); diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 2f5e10c1459..afb154408c5 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -3643,7 +3643,7 @@ ul.noborder li:nth-child(even):not(.liste_titre) { box-shadow: 0px 0px 8px 0px rgba(0,0,0,0.20); } span.boxstatstext { - opacity: 0.7; + opacity: 0.5; line-height: 18px; color: var(--colortext); } From 72c6aa81bb146813ab52f6a95f321ba9918c687c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 13 May 2020 12:30:59 +0200 Subject: [PATCH 127/205] Trans --- htdocs/langs/en_US/modulebuilder.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/modulebuilder.lang b/htdocs/langs/en_US/modulebuilder.lang index b815cf997cc..135ac1ae9ec 100644 --- a/htdocs/langs/en_US/modulebuilder.lang +++ b/htdocs/langs/en_US/modulebuilder.lang @@ -83,7 +83,7 @@ ListOfDictionariesEntries=List of dictionaries entries ListOfPermissionsDefined=List of defined permissions SeeExamples=See examples here EnabledDesc=Condition to have this field active (Examples: 1 or $conf->global->MYMODULE_MYOPTION) -VisibleDesc=Is the field visible ? (Examples: 0=Never visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create), 5=Visible on list end view form only (not create, not update). Using a negative value means field is not shown by default on list but can be selected for viewing). It can be an expression, for example:
preg_match('/public/', $_SERVER['PHP_SELF'])?0:1
($user->rights->holiday->define_holiday ? 1 : 0) +VisibleDesc=Is the field visible ? (Examples: 0=Never visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create), 5=Visible on list end view form only (not create, not update).

Using a negative value means field is not shown by default on list but can be selected for viewing).

It can be an expression, for example:
preg_match('/public/', $_SERVER['PHP_SELF'])?0:1
($user->rights->holiday->define_holiday ? 1 : 0) DisplayOnPdfDesc=Display this field on compatible PDF documents, you can manage position with "Position" field.
Currently, known compatibles PDF models are : eratosthene (order), espadon (ship), sponge (invoices), cyan (propal/quotation), cornas (supplier order)

For document :
0 = not displayed
1 = display
2 = display only if not empty

For document lines :
0 = not displayed
1 = displayed in a column
3 = display in line description column after the description
4 = display in description column after the description only if not empty DisplayOnPdf=Display on PDF IsAMeasureDesc=Can the value of field be cumulated to get a total into list? (Examples: 1 or 0) From 4a04cecbaae3c6deea391462718f08323965805d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 13 May 2020 12:49:53 +0200 Subject: [PATCH 128/205] CSS --- htdocs/theme/eldy/global.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index ef39d38a568..60c7ee43bb0 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -1611,7 +1611,7 @@ div.nopadding { } td.nobordernopadding.widthpictotitle.col-picto { - color: var(--colortexttitlenotab); + color: #bbb; opacity: 0.85; } .table-list-of-attached-files .col-picto, .table-list-of-links .col-picto { From 0b3e917155c8e4f9f4a6fe676268fd357f6e8df0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 13 May 2020 13:29:50 +0200 Subject: [PATCH 129/205] CSS --- htdocs/core/tpl/extrafields_view.tpl.php | 21 ++++++++++++++++++--- htdocs/theme/eldy/global.inc.php | 2 +- htdocs/theme/md/style.css.php | 2 +- 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/htdocs/core/tpl/extrafields_view.tpl.php b/htdocs/core/tpl/extrafields_view.tpl.php index e6cbad245d9..198a3910747 100644 --- a/htdocs/core/tpl/extrafields_view.tpl.php +++ b/htdocs/core/tpl/extrafields_view.tpl.php @@ -52,8 +52,12 @@ if (empty($reshook) && is_array($extrafields->attributes[$object->table_element] { $lastseparatorkeyfound = ''; $extrafields_collapse_num = ''; + $extrafields_collapse_num_old = ''; + $i = 0; foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $label) { + $i++; + // Discard if extrafield is a hidden field on form $enabled = 1; @@ -65,6 +69,7 @@ if (empty($reshook) && is_array($extrafields->attributes[$object->table_element] { $enabled = dol_eval($extrafields->attributes[$object->table_element]['list'][$key], 1); } + $perms = 1; if ($perms && isset($extrafields->attributes[$object->table_element]['perms'][$key])) { @@ -87,6 +92,8 @@ if (empty($reshook) && is_array($extrafields->attributes[$object->table_element] $value = $object->array_options["options_".$key]; //var_dump($key.' - '.$value); } + + // Print line tr of extra field if ($extrafields->attributes[$object->table_element]['type'][$key] == 'separate') { $extrafields_collapse_num = ''; @@ -109,13 +116,20 @@ if (empty($reshook) && is_array($extrafields->attributes[$object->table_element] } else { - print '
'; + print ''; + $extrafields_collapse_num_old = $extrafields_collapse_num; print ''; - if(!empty($show_subgroup)) + if (!empty($show_subgroup)) { // Permet d'afficher le compte comptable if (empty($displayed_account) || $root_account_description != $displayed_account) { // Affiche un Sous-Total par compte comptable if ($displayed_account != "") { - print ''; - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; + print ''; print "\n"; print ''; } // Show first line of a break print ''; - print ''; + print ''; print ''; $displayed_account = $root_account_description; @@ -337,9 +337,9 @@ if ($action != 'export_csv') $sous_total_credit += $line->credit; } - if(!empty($show_subgroup)) + if (!empty($show_subgroup)) { - print ''; + print ''; print "\n"; print ''; } diff --git a/htdocs/compta/accounting-files.php b/htdocs/compta/accounting-files.php index f9bc453d999..6b9be4d285c 100644 --- a/htdocs/compta/accounting-files.php +++ b/htdocs/compta/accounting-files.php @@ -712,11 +712,11 @@ if (!empty($date_start) && !empty($date_stop)) print ''; // Total ET - print '\n"; + print '\n"; // Total IT - print '\n"; + print '\n"; // Total VAT - print '\n"; + print '\n"; print '\n"; @@ -758,9 +758,9 @@ if (!empty($date_start) && !empty($date_stop)) // Balance print ''; print ''; - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; print ''; print "\n"; } diff --git a/htdocs/core/class/interfaces.class.php b/htdocs/core/class/interfaces.class.php index 9302ed09afb..7c010ea742c 100644 --- a/htdocs/core/class/interfaces.class.php +++ b/htdocs/core/class/interfaces.class.php @@ -379,7 +379,7 @@ class Interfaces print 'Error: Trigger '.$modName.' does not extends DolibarrTriggers
'; } } - catch(Exception $e) { + catch (Exception $e) { print $e->getMessage(); } diff --git a/htdocs/core/lib/date.lib.php b/htdocs/core/lib/date.lib.php index a751f584564..b44d7260e97 100644 --- a/htdocs/core/lib/date.lib.php +++ b/htdocs/core/lib/date.lib.php @@ -910,7 +910,7 @@ function num_open_day($timestampStart, $timestampEnd, $inhour = 0, $lastday = 0, if ($numholidays == 1) return 0; } - $nbOpenDay=$lastday; + $nbOpenDay = $lastday; if ($inhour == 1) $nbOpenDay = ($nbOpenDay * 24); return $nbOpenDay - (($inhour == 1 ? 12 : 0.5) * abs($halfday)); diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php index 384c4fc3a7e..24811ad854d 100644 --- a/htdocs/core/modules/DolibarrModules.class.php +++ b/htdocs/core/modules/DolibarrModules.class.php @@ -2302,7 +2302,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it if (preg_match('/experimental/i', $version)) $versiontrans .= 'warning'; if (preg_match('/deprecated/i', $version)) $versiontrans .= 'warning'; if ($this->isCoreOrExternalModule() == 'external' || preg_match('/development|experimental|deprecated/i', $version)) { - print 'getVersion(1).'">'; + print 'getVersion(1).'">'; print $this->getVersion(1); print ''; } diff --git a/htdocs/core/modules/rapport/pdf_paiement.class.php b/htdocs/core/modules/rapport/pdf_paiement.class.php index 024310abb09..103d0fdffba 100644 --- a/htdocs/core/modules/rapport/pdf_paiement.class.php +++ b/htdocs/core/modules/rapport/pdf_paiement.class.php @@ -465,14 +465,14 @@ class pdf_paiement if ($yp > $this->tab_height - 15) { $pdf->SetFillColor(255, 255, 255); - $pdf->Rect($this->marge_gauche +1, $this->tab_top + 10 + $yp, $this->posxpaymentamount - $this->marge_droite -3, $this->line_height, 'F', array(), array()); + $pdf->Rect($this->marge_gauche + 1, $this->tab_top + 10 + $yp, $this->posxpaymentamount - $this->marge_droite - 3, $this->line_height, 'F', array(), array()); $pdf->line($this->marge_gauche, $this->tab_top + 10 + $yp, $this->page_largeur - $this->marge_droite, $this->tab_top + 10 + $yp, array('dash'=>1)); $pdf->line($this->marge_gauche, $this->tab_top + 15 + $yp, $this->page_largeur - $this->marge_droite, $this->tab_top + 15 + $yp); $pdf->SetFont('', 'B', $default_font_size - 1); - $pdf->SetXY($this->posxdate -1, $this->tab_top + 10 + $yp); + $pdf->SetXY($this->posxdate - 1, $this->tab_top + 10 + $yp); $pdf->MultiCell($this->posxpaymentamount - 2 - $this->marge_droite, $this->line_height, $langs->transnoentities('SubTotal')." : ", 0, 'R', 1); - $pdf->SetXY($this->posxpaymentamount -1, $this->tab_top + 10 + $yp); - $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxpaymentamount +1, $this->line_height, price($total_page), 0, 'R', 1); + $pdf->SetXY($this->posxpaymentamount - 1, $this->tab_top + 10 + $yp); + $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxpaymentamount + 1, $this->line_height, price($total_page), 0, 'R', 1); $pdf->SetFont('', '', $default_font_size - 1); $pdf->SetFillColor(220, 220, 220); $page++; @@ -523,19 +523,19 @@ class pdf_paiement } // Add line to add total by payment mode if mode reglement for nex line change - if ((($this->doc_type == 'client' && !empty($conf->global->PAYMENTS_REPORT_GROUP_BY_MOD)) || ($this->doc_type == 'fourn' && !empty($conf->global->PAYMENTS_FOURN_REPORT_GROUP_BY_MOD))) && ($mod != $lines[$j+1][2])) + if ((($this->doc_type == 'client' && !empty($conf->global->PAYMENTS_REPORT_GROUP_BY_MOD)) || ($this->doc_type == 'fourn' && !empty($conf->global->PAYMENTS_FOURN_REPORT_GROUP_BY_MOD))) && ($mod != $lines[$j + 1][2])) { $pdf->SetFillColor(245, 245, 245); - $pdf->Rect($this->marge_gauche +1, $this->tab_top + 10 + $yp, $this->posxpaymentamount - $this->marge_droite -3, $this->line_height, 'F', array(), array()); + $pdf->Rect($this->marge_gauche + 1, $this->tab_top + 10 + $yp, $this->posxpaymentamount - $this->marge_droite - 3, $this->line_height, 'F', array(), array()); $pdf->line($this->marge_gauche, $this->tab_top + 10 + $yp, $this->page_largeur - $this->marge_droite, $this->tab_top + 10 + $yp, array('dash'=>1)); $pdf->line($this->marge_gauche, $this->tab_top + 15 + $yp, $this->page_largeur - $this->marge_droite, $this->tab_top + 15 + $yp); - $pdf->SetXY($this->posxdate -1, $this->tab_top + 10 + $yp); + $pdf->SetXY($this->posxdate - 1, $this->tab_top + 10 + $yp); $pdf->SetFont('', 'I', $default_font_size - 1); $pdf->MultiCell($this->posxpaymentamount - 2 - $this->marge_droite, $this->line_height, $langs->transnoentities('Total').' '.$mod." : ", 0, 'R', 1); - $pdf->SetXY($this->posxpaymentamount -1, $this->tab_top + 10 + $yp); - $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxpaymentamount +1, $this->line_height, price($total_mod), 0, 'R', 1); + $pdf->SetXY($this->posxpaymentamount - 1, $this->tab_top + 10 + $yp); + $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxpaymentamount + 1, $this->line_height, price($total_mod), 0, 'R', 1); $pdf->SetFont('', '', $default_font_size - 1); - $mod = $lines[$j+1][2]; + $mod = $lines[$j + 1][2]; $total_mod = 0; $yp = $yp + 5; if ($yp > $this->tab_height - 5) @@ -551,14 +551,14 @@ class pdf_paiement } $total += $total_page; $pdf->SetFillColor(255, 255, 255); - $pdf->Rect($this->marge_gauche +1, $this->tab_top + 10 + $yp, $this->posxpaymentamount - $this->marge_droite -3, $this->line_height, 'F', array(), array()); + $pdf->Rect($this->marge_gauche + 1, $this->tab_top + 10 + $yp, $this->posxpaymentamount - $this->marge_droite - 3, $this->line_height, 'F', array(), array()); $pdf->line($this->marge_gauche, $this->tab_top + 10 + $yp, $this->page_largeur - $this->marge_droite, $this->tab_top + 10 + $yp, array('dash'=>1)); $pdf->line($this->marge_gauche, $this->tab_top + 15 + $yp, $this->page_largeur - $this->marge_droite, $this->tab_top + 15 + $yp); - $pdf->SetXY($this->posxdate -1, $this->tab_top + 10 + $yp); + $pdf->SetXY($this->posxdate - 1, $this->tab_top + 10 + $yp); $pdf->SetFont('', 'B'); $pdf->MultiCell($this->posxpaymentamount - 2 - $this->marge_droite, $this->line_height, $langs->transnoentities('Total')." : ", 0, 'R', 1); - $pdf->SetXY($this->posxpaymentamount -1, $this->tab_top + 10 + $yp); - $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxpaymentamount +1, $this->line_height, price($total), 0, 'R', 1); + $pdf->SetXY($this->posxpaymentamount - 1, $this->tab_top + 10 + $yp); + $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxpaymentamount + 1, $this->line_height, price($total), 0, 'R', 1); $pdf->SetFillColor(220, 220, 220); } } diff --git a/htdocs/emailcollector/class/emailcollector.class.php b/htdocs/emailcollector/class/emailcollector.class.php index 2bc6d6db962..bf1a4e26de7 100644 --- a/htdocs/emailcollector/class/emailcollector.class.php +++ b/htdocs/emailcollector/class/emailcollector.class.php @@ -1092,7 +1092,7 @@ class EmailCollector extends CommonObject $i++; $header = imap_fetchheader($connection, $imapemail, 0); - $header = preg_replace('/\r\n\s+/m', ' ', $header); // When a header line is on several lines, merge lines + $header = preg_replace('/\r\n\s+/m', ' ', $header); // When a header line is on several lines, merge lines $matches = array(); preg_match_all('/([^: ]+): (.+?(?:\r\n\s(?:.+?))*)\r\n/m', $header, $matches); $headers = array_combine($matches[1], $matches[2]); diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index 3d6cec96319..16012022dc9 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -625,7 +625,7 @@ $(document).ready(function() { else selectedline=this.id; selectedtext=$('#'+selectedline).find("td:first").html(); '; -if ($action=="productinfo"){ +if ($action == "productinfo") { $prod = new Product($db); $prod->fetch($idproduct); print "".$prod->label."
"; @@ -83,7 +83,7 @@ if ($action=="productinfo"){ print '
'; print ''; } -elseif ($action=="editline"){ +elseif ($action == "editline") { $placeid = GETPOST('placeid', 'int'); $selectedline = GETPOST('selectedline', 'int'); $invoice = new Facture($db); @@ -99,8 +99,8 @@ elseif ($action=="editline"){ print "
".$prod->description; print "
".price($prod->price_ttc, 1, $langs, 1, -1, -1, $conf->currency).""; print '
'; - print ''; - print ''; + print ''; + print ''; print ''; } } @@ -168,11 +168,11 @@ $( document ).ready(function() { function LoadPlace(placeid){ place=placeid; @@ -197,11 +197,11 @@ function AddProduct(placeid, productid){ function AddProductConfirm(placeid, productid){ place=placeid;
'.strtoupper(substr($langs->trans('Floors'), 0, 3)).''; print ''; print ''; print ''; } - else{ + else { print ''; print ''; print ''; From 672ea60ffd471b2156bf45c28c60c3dc57223906 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 15 May 2020 13:58:34 +0200 Subject: [PATCH 161/205] FIX #13896 --- htdocs/modulebuilder/template/class/myobject.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/modulebuilder/template/class/myobject.class.php b/htdocs/modulebuilder/template/class/myobject.class.php index fad19564fdc..2070bedf568 100644 --- a/htdocs/modulebuilder/template/class/myobject.class.php +++ b/htdocs/modulebuilder/template/class/myobject.class.php @@ -440,7 +440,7 @@ class MyObject extends CommonObject if ($resql) { $num = $this->db->num_rows($resql); $i = 0; - while ($i < min($limit, $num)) + while ($i < ($limit ? min($limit, $num) : $num)) { $obj = $this->db->fetch_object($resql); From dc6ae70aa6ddc311b8967dd9bf8d445e70c815a1 Mon Sep 17 00:00:00 2001 From: Langlais115 Date: Fri, 15 May 2020 10:25:56 +0200 Subject: [PATCH 162/205] Fix #13805 Add proper type check to "seuil_stock_alerte" parameter. --- htdocs/product/class/product.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index bb2a1652d8f..7b6892552d1 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -1015,7 +1015,7 @@ class Product extends CommonObject $sql .= ", volume = ".($this->volume != '' ? "'".$this->db->escape($this->volume)."'" : 'null'); $sql .= ", volume_units = ".($this->volume_units != '' ? "'".$this->db->escape($this->volume_units)."'" : 'null'); $sql .= ", fk_default_warehouse = ".($this->fk_default_warehouse > 0 ? $this->db->escape($this->fk_default_warehouse) : 'null'); - $sql .= ", seuil_stock_alerte = ".((isset($this->seuil_stock_alerte) && $this->seuil_stock_alerte != '') ? "'".$this->db->escape($this->seuil_stock_alerte)."'" : "null"); + $sql .= ", seuil_stock_alerte = ".((isset($this->seuil_stock_alerte) && is_numeric($this->seuil_stock_alerte)) ? (int) $this->seuil_stock_alerte : 'null'); $sql .= ", description = '".$this->db->escape($this->description)."'"; $sql .= ", url = ".($this->url ? "'".$this->db->escape($this->url)."'" : 'null'); $sql .= ", customcode = '".$this->db->escape($this->customcode)."'"; From 3295b0d669541c24849f51f772d4487b708ddf3b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 15 May 2020 14:14:05 +0200 Subject: [PATCH 163/205] Update viewimage.php --- htdocs/viewimage.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/viewimage.php b/htdocs/viewimage.php index 39795b62fd8..c72a4e0424e 100644 --- a/htdocs/viewimage.php +++ b/htdocs/viewimage.php @@ -203,7 +203,7 @@ if (!empty($hashp)) $accessallowed = 1; // When using hashp, link is public so we force $accessallowed $sqlprotectagainstexternals = ''; } -elseif ($conf->global->TAKEPOS_AUTO_ORDER && isset($_GET["publictakepos"])) +elseif (! empty($conf->global->TAKEPOS_AUTO_ORDER) && isset($_GET["publictakepos"])) { $accessallowed = 1; // Only if TakePOS Public Auto Order is enabled and received publictakepos variable } From f35a618699830aadfaedbf5fbcf9bc8dc7b307db Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 15 May 2020 14:29:04 +0200 Subject: [PATCH 164/205] Update index.php --- htdocs/takepos/genimg/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/takepos/genimg/index.php b/htdocs/takepos/genimg/index.php index c2bb62b9322..e668b01aacb 100644 --- a/htdocs/takepos/genimg/index.php +++ b/htdocs/takepos/genimg/index.php @@ -77,7 +77,7 @@ elseif ($query == "pro") preg_match('@src="([^"]+)"@', $image, $match); $file = array_pop($match); if ($file == "") header('Location: ../../public/theme/common/nophoto.png'); - else header('Location: '.$file.'&cache=1&publictakepos=1'); + else header('Location: '.$file.'&cache=1&publictakepos=1&modulepart=product'); } else { From b8d7a4373c2deeba697b592eb6eb23fa19812e85 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 15 May 2020 14:34:24 +0200 Subject: [PATCH 165/205] Update viewimage.php --- htdocs/viewimage.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/htdocs/viewimage.php b/htdocs/viewimage.php index c72a4e0424e..b2534ee92dd 100644 --- a/htdocs/viewimage.php +++ b/htdocs/viewimage.php @@ -52,7 +52,7 @@ if (isset($_GET["hashp"]) && !defined("NOLOGIN")) if (!defined("NOIPCHECK")) define("NOIPCHECK", 1); // Do not check IP defined into conf $dolibarr_main_restrict_ip } // Some value of modulepart can be used to get resources that are public so no login are required. -if ((isset($_GET["modulepart"]) && $_GET["modulepart"] == 'medias')) +if (isset($_GET["modulepart"]) && $_GET["modulepart"] == 'medias') { if (!defined("NOLOGIN")) define("NOLOGIN", 1); if (!defined("NOCSRFCHECK")) define("NOCSRFCHECK", 1); // We accept to go on this page from external web site. @@ -60,7 +60,7 @@ if ((isset($_GET["modulepart"]) && $_GET["modulepart"] == 'medias')) } // Used by TakePOS Auto Order -if (isset($_GET["publictakepos"])) +if (isset($_GET["modulepart"]) && $_GET["modulepart"] == 'product' && isset($_GET["publictakepos"])) { if (!defined("NOLOGIN")) define("NOLOGIN", 1); if (!defined("NOCSRFCHECK")) define("NOCSRFCHECK", 1); // We accept to go on this page from external web site. @@ -203,9 +203,11 @@ if (!empty($hashp)) $accessallowed = 1; // When using hashp, link is public so we force $accessallowed $sqlprotectagainstexternals = ''; } -elseif (! empty($conf->global->TAKEPOS_AUTO_ORDER) && isset($_GET["publictakepos"])) +elseif (isset($_GET["publictakepos"])) { - $accessallowed = 1; // Only if TakePOS Public Auto Order is enabled and received publictakepos variable + if (! empty($conf->global->TAKEPOS_AUTO_ORDER)) { + $accessallowed = 1; // Only if TakePOS Public Auto Order is enabled and received publictakepos variable + } } else { From 895833effc017ad4c2817e16d0a9e947b49b497a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 15 May 2020 15:00:58 +0200 Subject: [PATCH 166/205] FIX #13864 --- htdocs/projet/card.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index e41c3da3e88..ae91ac0cfac 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -639,20 +639,20 @@ if ($action == 'create' && $user->rights->projet->creer) // Opportunity probability print '
'; - print ''; print ''; // Opportunity amount print ''; - print ''; + print ''; print ''; } // Budget print ''; - print ''; + print ''; print ''; // Description @@ -897,14 +897,14 @@ elseif ($object->id > 0) // Opportunity probability print ''; - print ''; print ''; // Opportunity amount print ''; - print ''; + print ''; print ''; } @@ -923,7 +923,7 @@ elseif ($object->id > 0) // Budget print ''; - print ''; + print ''; print ''; // Description From 99db3a2991b4b74a38f1c99379f6c06a0c097ca8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 15 May 2020 15:15:07 +0200 Subject: [PATCH 167/205] Fix field for opportunities must be visible only if we use opportinities --- htdocs/projet/card.php | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index ae91ac0cfac..6918e6fd57c 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -833,9 +833,22 @@ elseif ($object->id > 0) print ''; + print ''; print ''; // Opportunity probability - print ''; + print ''; print ''; print ''; // Opportunity amount - print ''; + print ''; print ''; print ''; } From 38059ab86190b32c9a5834062b10864ce91fc010 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 15 May 2020 15:17:37 +0200 Subject: [PATCH 168/205] Fix trans --- htdocs/langs/en_US/projects.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/projects.lang b/htdocs/langs/en_US/projects.lang index cdc0e6b3c95..bb42bff3c87 100644 --- a/htdocs/langs/en_US/projects.lang +++ b/htdocs/langs/en_US/projects.lang @@ -255,7 +255,7 @@ ServiceToUseOnLines=Service to use on lines InvoiceGeneratedFromTimeSpent=Invoice %s has been generated from time spent on project ProjectBillTimeDescription=Check if you enter timesheet on tasks of project AND you plan to generate invoice(s) from the timesheet to bill the customer of the project (do not check if you plan to create invoice that is not based on entered timesheets). Note: To generate invoice, go on tab 'Time spent' of the project and select lines to include. ProjectFollowOpportunity=Follow opportunity -ProjectFollowTasks=Follow tasks +ProjectFollowTasks=Follow tasks or time spent Usage=Usage UsageOpportunity=Usage: Opportunity UsageTasks=Usage: Tasks From 86ff60f16152235e51709c4d91effdff8026822f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 15 May 2020 15:50:50 +0200 Subject: [PATCH 169/205] Fix break line and set of opportunity fields --- htdocs/accountancy/bookkeeping/balance.php | 2 +- htdocs/core/class/html.formprojet.class.php | 6 ++++-- htdocs/langs/en_US/accountancy.lang | 1 + htdocs/projet/card.php | 19 ++++++++++++++++--- htdocs/theme/eldy/global.inc.php | 3 ++- htdocs/theme/eldy/theme_vars.inc.php | 2 +- htdocs/theme/md/style.css.php | 20 +++++++++++--------- htdocs/theme/md/theme_vars.inc.php | 2 +- 8 files changed, 37 insertions(+), 18 deletions(-) diff --git a/htdocs/accountancy/bookkeeping/balance.php b/htdocs/accountancy/bookkeeping/balance.php index b2a25b00ce2..456da29d954 100644 --- a/htdocs/accountancy/bookkeeping/balance.php +++ b/htdocs/accountancy/bookkeeping/balance.php @@ -294,7 +294,7 @@ if ($action != 'export_csv') { // Affiche un Sous-Total par compte comptable if ($displayed_account != "") { - print ''; + print ''; print "\n"; print ''; } diff --git a/htdocs/core/class/html.formprojet.class.php b/htdocs/core/class/html.formprojet.class.php index b6c7017e408..bf3db0cc65c 100644 --- a/htdocs/core/class/html.formprojet.class.php +++ b/htdocs/core/class/html.formprojet.class.php @@ -620,11 +620,12 @@ class FormProjets * @param int $showallnone Add choice "All" and "None" * @param int $showpercent Show default probability for status * @param string $morecss Add more css + * @param int $noadmininfo 0=Add admin info, 1=Disable admin info * @return int|string The HTML select list of element or '' if nothing or -1 if KO */ - public function selectOpportunityStatus($htmlname, $preselected = '-1', $showempty = 1, $useshortlabel = 0, $showallnone = 0, $showpercent = 0, $morecss = '') + public function selectOpportunityStatus($htmlname, $preselected = '-1', $showempty = 1, $useshortlabel = 0, $showallnone = 0, $showpercent = 0, $morecss = '', $noadmininfo = 0) { - global $conf, $langs; + global $conf, $langs, $user; $sql = "SELECT rowid, code, label, percent"; $sql .= " FROM ".MAIN_DB_PREFIX.'c_lead_status'; @@ -670,6 +671,7 @@ class FormProjets $i++; } $sellist .= ''; + if ($user->admin && !$noadmininfo) $sellist .= info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); } /*else { diff --git a/htdocs/langs/en_US/accountancy.lang b/htdocs/langs/en_US/accountancy.lang index adf2309ad07..92cc0f0c79e 100644 --- a/htdocs/langs/en_US/accountancy.lang +++ b/htdocs/langs/en_US/accountancy.lang @@ -234,6 +234,7 @@ ThirdpartyAccountNotDefinedOrThirdPartyUnknownSubledgerIgnored=Third-party unkno ThirdpartyAccountNotDefinedOrThirdPartyUnknownBlocking=Third-party account not defined or third party unknown. Blocking error. UnknownAccountForThirdpartyAndWaitingAccountNotDefinedBlocking=Unknown third-party account and waiting account not defined. Blocking error PaymentsNotLinkedToProduct=Payment not linked to any product / service +OpeningBalance=Opening balance ShowOpeningBalance=Show opening balance HideOpeningBalance=Hide opening balance diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index 6918e6fd57c..15d1d6d9563 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -558,6 +558,19 @@ if ($action == 'create' && $user->rights->projet->creer) print ' '; $htmltext = $langs->trans("ProjectFollowOpportunity"); print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext); + print ''; print '
'; } if (empty($conf->global->PROJECT_HIDE_TASKS)) @@ -632,20 +645,20 @@ if ($action == 'create' && $user->rights->projet->creer) if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { // Opportunity status - print ''; + print ''; print ''; // Opportunity probability - print ''; + print ''; print ''; print ''; // Opportunity amount - print ''; + print ''; print ''; print ''; } diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index afb154408c5..3e213c3d8e2 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -17,6 +17,7 @@ --colorbacklinepair2: rgb(); --colorbacklinepairhover: rgb(); --colorbacklinepairchecked: rgb(); + --colorbacklinebreak: rgb(); --colorbackbody: rgb(); --colortexttitlenotab: rgb(); --colortexttitle: rgb(); @@ -3289,7 +3290,7 @@ td.evenodd, tr.nohoverpair td, #trlinefordates td { .trforbreak td { font-weight: 500; border-bottom: 1pt solid black !important; - /* background-color: # !important; */ + background-color: var(--colorbacklinebreak) !important; !important; } .trforbreak.nobold td a, .trforbreak.nobold span.secondary { font-weight: normal !important; diff --git a/htdocs/theme/eldy/theme_vars.inc.php b/htdocs/theme/eldy/theme_vars.inc.php index 823b8168b4c..d2a11725ecf 100644 --- a/htdocs/theme/eldy/theme_vars.inc.php +++ b/htdocs/theme/eldy/theme_vars.inc.php @@ -65,7 +65,7 @@ $colorbacklinepair1 = '251,251,251'; // line pair $colorbacklinepair2 = '251,251,251'; // line pair $colorbacklinepairhover = '230,237,244'; // line hover $colorbacklinepairchecked = '230,237,244'; // line checked -$colorbacklinebreak = '233,228,230'; // line break +$colorbacklinebreak = '253,251,250'; // line break $colorbackbody = '255,255,255'; $colortexttitlenotab = '0,113,120'; // 150,90,121 140,80,10 or 10,140,80 #875a7b green=0,113,120, violet: 0,50,120 $colortexttitle = '0,0,0'; diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index da2df5eb788..36fb265c42a 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -242,6 +242,7 @@ print '*/'."\n"; --colorbacklinepair2: rgb(); --colorbacklinepairhover: rgb(); --colorbacklinepairchecked: rgb(); + --colorbacklinebreak: rgb(); --colorbackbody: rgb(); --colortexttitlenotab: rgb(); --colortexttitle: rgb(); @@ -3284,10 +3285,10 @@ ul.noborder li:nth-child(odd):not(.liste_titre) { } .impair, .nohover .impair:hover, tr.impair td.nohover { - background: #; + background: var(--colorbacklineimpair1); } #GanttChartDIV { - background-color: #; + background-color: var(--colorbacklineimpair1); } .oddeven, .evenodd, .pair, .nohover .pair:hover, tr.pair td.nohover, .tagtr.oddeven { @@ -3296,25 +3297,26 @@ ul.noborder li:nth-child(odd):not(.liste_titre) { color: #202020; } .pair, .nohover .pair:hover, tr.pair td.nohover { - background-color: #; + background-color: var(--colorbacklinepair1); } + table.dataTable tr.oddeven { - background-color: # !important; + background-color: var(--colorbacklinepair1) !important; } /* For no hover style */ td.oddeven, table.nohover tr.impair, table.nohover tr.pair, table.nohover tr.impair td, table.nohover tr.pair td, tr.nohover td, form.nohover, form.nohover:hover { - background-color: # !important; - background: # !important; + background-color: var(--colorbacklineimpair1) !important; !important; + background: var(--colorbacklineimpair1) !important; !important; } td.evenodd, tr.nohoverpair td, #trlinefordates td { - background-color: # !important; - background: # !important; + background-color: var(--colorbacklinepair1) !important; !important; + background: var(--colorbacklinepair1) !important; !important; } .trforbreak td { font-weight: bold; border-bottom: 1pt solid black !important; - /* background-color: # !important; */ + background-color: var(--colorbacklinebreak) !important; } table.dataTable td { diff --git a/htdocs/theme/md/theme_vars.inc.php b/htdocs/theme/md/theme_vars.inc.php index 6cdd37fe913..ffad2cc66b5 100644 --- a/htdocs/theme/md/theme_vars.inc.php +++ b/htdocs/theme/md/theme_vars.inc.php @@ -61,7 +61,7 @@ $colorbacklinepair1 = '248,248,248'; // line pair $colorbacklinepair2 = '246,246,246'; // line pair $colorbacklinepairhover = '230,237,244'; // line hover $colorbacklinepairchecked = '230,237,244'; // line checked -$colorbacklinebreak = '214,218,220'; +$colorbacklinebreak = '250,246,251'; $colorbackbody = '248,248,248'; $colortexttitlenotab = '80,71,5'; $colortexttitle = '20,20,20'; From 5fe9c45fb25a952c9b38d2f815354ec19c7df1e7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 15 May 2020 16:07:39 +0200 Subject: [PATCH 170/205] Fix look and feel v12 --- htdocs/core/lib/functions.lib.php | 2 +- htdocs/projet/card.php | 4 +-- htdocs/societe/card.php | 51 +++++-------------------------- 3 files changed, 11 insertions(+), 46 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 31716dc3f3c..878b85993b5 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3149,7 +3149,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ if (empty($srconly) && in_array($pictowithouttext, array( '1downarrow', '1uparrow', '1leftarrow', '1rightarrow', '1uparrow_selected', '1downarrow_selected', '1leftarrow_selected', '1rightarrow_selected', 'accountancy', 'address', 'bank_account', 'barcode', 'bank', 'bill', 'bookmark', 'bom', 'building', - 'cash-register', 'check', 'close_title', 'company', 'contact', 'contract', 'cubes', + 'cash-register', 'category', 'check', 'close_title', 'company', 'contact', 'contract', 'cubes', 'delete', 'dolly', 'dollyrevert', 'edit', 'ellipsis-h', 'external-link-alt', 'external-link-square-alt', 'filter', 'file-code', 'file-export', 'file-import', 'file-upload', 'folder', 'folder-open', 'globe', 'globe-americas', 'grip', 'grip_title', 'help', 'intervention', 'label', 'language', 'list', 'listlight', 'lot', diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index 15d1d6d9563..e79d5bafa59 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -604,7 +604,7 @@ if ($action == 'create' && $user->rights->projet->creer) print '"; } diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 195d4df88bb..6abb7aa9647 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -1331,7 +1331,7 @@ else // Country print ''; @@ -1354,16 +1354,16 @@ else // Phone / Fax print ''; - print 'browser->layout == 'phone' ? ' colspan="3"': '').'>'.img_picto('', 'object_phoning').' '; + print 'browser->layout == 'phone' ? ' colspan="3"': '').'>'.img_picto('', 'object_phoning').' '; if ($conf->browser->layout == 'phone') print ''; print ''; - print 'browser->layout == 'phone' ? ' colspan="3"': '').'>'.img_picto('', 'object_phoning_fax').' '; + print 'browser->layout == 'phone' ? ' colspan="3"': '').'>'.img_picto('', 'object_phoning_fax').' '; // Email / Web print ''; - print ''; + print ''; print ''; - print ''; + print ''; if (!empty($conf->socialnetworks->enabled)) { foreach ($socialnetworks as $key => $value) { @@ -1380,42 +1380,6 @@ else } } - // if (! empty($conf->socialnetworks->enabled)) - // { - // // Skype - // if (! empty($conf->global->SOCIALNETWORKS_SKYPE)) - // { - // print ''; - // print ''; - // } - // // Twitter - // if (! empty($conf->global->SOCIALNETWORKS_TWITTER)) - // { - // print ''; - // print ''; - // } - // // Facebook - // if (! empty($conf->global->SOCIALNETWORKS_FACEBOOK)) - // { - // print ''; - // print ''; - // } - // // LinkedIn - // if (! empty($conf->global->SOCIALNETWORKS_LINKEDIN)) - // { - // print ''; - // print ''; - // } - // } - // Prof ids $i = 1; $j = 0; $NBCOLS = ($conf->browser->layout == 'phone' ? 1 : 2); while ($i <= 6) @@ -1481,9 +1445,10 @@ else //TODO: Place into a function to control showing by country or study better option if ($mysoc->localtax1_assuj == "1" && $mysoc->localtax2_assuj == "1") { - print ''; + print ''; } From c43813ccbb7f5671b0d79291066ded0e35abef30 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 15 May 2020 16:23:24 +0200 Subject: [PATCH 171/205] Fix responsive of edition of thirdparties --- htdocs/societe/card.php | 62 +++++++++++++++-------------------------- 1 file changed, 22 insertions(+), 40 deletions(-) diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 6abb7aa9647..96a9dd7deed 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -1396,7 +1396,7 @@ else print $formcompany->get_input_id_prof($i, $key, $object->$key, $object->country_code); print ''; - if (($j % 2) == 1) print ''; + if (($j % $NBCOLS) == ($NBCOLS - 1)) print ''; $j++; } $i++; @@ -1448,6 +1448,7 @@ else print ''; + if ($conf->browser->layout == 'phone') print ''; print ''; @@ -1848,6 +1849,7 @@ else print ''; + if ($conf->browser->layout == 'phone') print ''; print '
attributes[$object->table_element]['required'][$key])) print ' fieldrequired'; print '">'; if (!empty($extrafields->attributes[$object->table_element]['help'][$key])) print $form->textwithpicto($langs->trans($label), $langs->trans($extrafields->attributes[$object->table_element]['help'][$key])); @@ -161,6 +175,7 @@ if (empty($reshook) && is_array($extrafields->attributes[$object->table_element] //print 'x'.$object->array_options['options_' . $key].'-'.$datenotinstring.' - '.dol_print_date($datenotinstring, 'dayhour'); $value = isset($_POST["options_".$key]) ? dol_mktime($_POST["options_".$key."hour"], $_POST["options_".$key."min"], 0, $_POST["options_".$key."month"], $_POST["options_".$key."day"], $_POST["options_".$key."year"]) : $datenotinstring; } + //TODO Improve element and rights detection if ($action == 'edit_extras' && $permok && GETPOST('attribute', 'none') == $key) { diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 60c7ee43bb0..2f5e10c1459 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -1751,7 +1751,7 @@ img.photorefnoborder { border-bottom: px solid rgb(); /* border-bottom: 2px solid var(--colorbackhmenu1); */ } -.trextrafieldseparator td { +.trextrafieldseparator td, .trextrafields_collapse_last td { /* border-bottom: 2px solid var(--colorbackhmenu1) !important; */ border-bottom: 2px solid rgb() !important; } diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index c7ce5709efd..da2df5eb788 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -1799,7 +1799,7 @@ img.photorefnoborder { border-bottom: px solid rgb(); } -.trextrafieldseparator td { +.trextrafieldseparator td, .trextrafields_collapse_last td { border-bottom: 1px solid rgb() !important; } .tdhrthin { From 5f400d27b4a7909efcad5f2914cdefddb4d64983 Mon Sep 17 00:00:00 2001 From: "DEMAREST Maxime (Indelog)" Date: Wed, 13 May 2020 15:01:32 +0200 Subject: [PATCH 119/205] Add preview file in compta/accounting-files.php --- htdocs/compta/accounting-files.php | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/htdocs/compta/accounting-files.php b/htdocs/compta/accounting-files.php index c567c5e99ee..98d8c9b9983 100644 --- a/htdocs/compta/accounting-files.php +++ b/htdocs/compta/accounting-files.php @@ -40,6 +40,7 @@ require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/paymentvarious.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; $langs->loadLangs(array("accountancy", "bills", "companies", "salaries", "compta", "trips", "banks")); @@ -232,6 +233,7 @@ if (($action == 'searchfiles' || $action == 'dl')) { $subdir .= ($subdir ? '/' : '').dol_sanitizeFileName($objd->ref); $upload_dir = $conf->facture->dir_output.'/'.$subdir; $link = "document.php?modulepart=facture&file=".str_replace('/', '%2F', $subdir).'%2F'; + $modulepart = "facture"; break; case "SupplierInvoice": $tmpinvoicesupplier->fetch($objd->id); @@ -239,18 +241,21 @@ if (($action == 'searchfiles' || $action == 'dl')) { $subdir .= ($subdir ? '/' : '').dol_sanitizeFileName($objd->ref); $upload_dir = $conf->fournisseur->facture->dir_output.'/'.$subdir; $link = "document.php?modulepart=facture_fournisseur&file=".str_replace('/', '%2F', $subdir).'%2F'; + $modulepart = "facture_fournisseur"; break; case "ExpenseReport": $subdir = ''; $subdir .= ($subdir ? '/' : '').dol_sanitizeFileName($objd->ref); $upload_dir = $conf->expensereport->dir_output.'/'.$subdir; $link = "document.php?modulepart=expensereport&file=".str_replace('/', '%2F', $subdir).'%2F'; + $modulepart = "expensereport"; break; case "SalaryPayment": $subdir = ''; $subdir .= ($subdir ? '/' : '').dol_sanitizeFileName($objd->id); $upload_dir = $conf->salaries->dir_output.'/'.$subdir; $link = "document.php?modulepart=salaries&file=".str_replace('/', '%2F', $subdir).'%2F'; + $modulepart = "salaries"; break; case "Donation": $tmpdonation->fetch($objp->id); @@ -258,18 +263,21 @@ if (($action == 'searchfiles' || $action == 'dl')) { $subdir .= ($subdir ? '/' : '').dol_sanitizeFileName($objd->id); $upload_dir = $conf->don->dir_output.'/'.$subdir; $link = "document.php?modulepart=don&file=".str_replace('/', '%2F', $subdir).'%2F'; + $modulepart = "don"; break; case "SocialContributions": $subdir = ''; $subdir .= ($subdir ? '/' : '').dol_sanitizeFileName($objd->id); $upload_dir = $conf->tax->dir_output.'/'.$subdir; $link = "document.php?modulepart=tax&file=".str_replace('/', '%2F', $subdir).'%2F'; + $modulepart = "tax"; break; case "VariousPayment": $subdir = ''; $subdir .= ($subdir ? '/' : '').dol_sanitizeFileName($objd->id); $upload_dir = $conf->bank->dir_output.'/'.$subdir; $link = "document.php?modulepart=banque&file=".str_replace('/', '%2F', $subdir).'%2F'; + $modulepart = "banque"; break; default: $subdir = ''; @@ -336,7 +344,16 @@ if (($action == 'searchfiles' || $action == 'dl')) { if (empty($filesarray[$file['item'].'_'.$file['id']]['files'])) { $filesarray[$file['item'].'_'.$file['id']]['files'] = array(); } - $filesarray[$file['item'].'_'.$file['id']]['files'][] = array('link' => $link.$file['name'], 'name'=>$file['name'], 'ref'=>$file['ref'], 'fullname' => $file['fullname'], 'relpathnamelang' => $langs->trans($file['item']).'/'.$file['name']); + $filesarray[$file['item'].'_'.$file['id']]['files'][] = array( + 'link' => $link.urlencode($file['name']), + 'name'=>$file['name'], + 'ref'=>$file['ref'], + 'fullname' => $file['fullname'], + 'relpath' => '/'.$file['name'], + 'relpathnamelang' => $langs->trans($file['item']).'/'.$file['name'], + 'modulepart' => $modulepart, + 'subdir' => $subdir, + ); //var_dump($file['item'].'_'.$file['id']); //var_dump($filesarray[$file['item'].'_'.$file['id']]['files']); } @@ -463,7 +480,8 @@ if ($result && $action == "dl" && !$error) * View */ -$form = new Form($db); +$form = new form($db); +$formfile = new FormFile($db); $userstatic = new User($db); $invoice = new Facture($db); $supplier_invoice = new FactureFournisseur($db); @@ -654,8 +672,8 @@ if (!empty($date_start) && !empty($date_stop)) print ''; if (!empty($data['files'])) { - foreach ($data['files'] as $filecursor) { - print ''.($filecursor['name'] ? $filecursor['name'] : $filecursor['ref']).'
'; + foreach ($data['files'] as $id=>$filecursor) { + print ''.($filecursor['name'] ? $filecursor['name'] : $filecursor['ref']).' '.$formfile->showPreview($filecursor, $filecursor['modulepart'], $filecursor['subdir'].'/'.$filecursor['name']).'
'; } } print "
'.$data['paid'].''.price($data['amount_ht'])."'.price($data['sens']?$data['amount_ht']:-$data['amount_ht'])."'.price($data['amount_ttc'])."'.price($data['sens']?$data['amount_ttc']:-$data['amount_ttc'])."'.price($data['amount_vat'])."'.price($data['sens']?$data['amount_vat']:-$data['amount_vat'])."'.$data['thirdparty_name']."'.$data['vatnum']."'.(($data['amount_ttc'] > 0) ? price(abs($data['amount_ttc'])) : '')."'.(($data['amount_ttc'] > 0) ? '' : price(abs($data['amount_ttc'])))."'.price($data['balance'])."
'.price(price2num($totalET, 'MT')).''.price(price2num($totalIT, 'MT')).''.price(price2num($totalVAT, 'MT')).''.price($totalDebit).''.price($totalCredit).''.price(price2num($totalDebit - $totalCredit, 'MT')).''.$langs->trans('Total').' '.$langs->trans('Income').''.price(price2num($totalET_credit, 'MT')).''.price(price2num($totalIT_credit, 'MT')).''.price(price2num($totalVAT_credit, 'MT')).'
'.$langs->trans('Total').' '.$langs->trans('Outcome').''.price(price2num($totalET_debit, 'MT')).''.price(price2num($totalIT_debit, 'MT')).''.price(price2num($totalVAT_debit, 'MT')).'
'.$langs->trans('Total').''.price(price2num($totalET_credit+$totalET_debit, 'MT')).''.price(price2num($totalIT_credit+$totalIT_debit, 'MT')).''.price(price2num($totalVAT_credit+$totalVAT_debit, 'MT')).'
'; - print ''.img_edit().''; + print ''.img_edit().''; print ' '.img_delete().''; print '
'; print ''; print ''; - print ''; print ''; print ''; @@ -643,7 +643,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print ''; // Delete print ''; print ''; diff --git a/htdocs/core/class/translate.class.php b/htdocs/core/class/translate.class.php index 4f3930a4588..3fc3151030a 100644 --- a/htdocs/core/class/translate.class.php +++ b/htdocs/core/class/translate.class.php @@ -308,7 +308,7 @@ class Translate continue; } else { - // Convert some strings: Parse and render carriage returns. Also, change '\\s' int '\s' because transifex sync pull the string '\s' into string '\\s' + // Convert some strings: Parse and render carriage returns. Also, change '\\s' into '\s' because transifex sync pull the string '\s' into string '\\s' $this->tab_translate[$key] = str_replace(array('\\n', '\\\\s'), array("\n", '\s'), $value); if ($usecachekey) { $tabtranslatedomain[$key] = $value; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 20094da216c..31716dc3f3c 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -5794,7 +5794,8 @@ function dolGetFirstLineOfText($text, $nboflines = 1, $charset = 'UTF-8') /** - * Replace CRLF in string with a HTML BR tag + * Replace CRLF in string with a HTML BR tag. + * WARNING: The content after operation contains some HTML tags (the
) so be sure to also have encode the special chars of stringtoencode into HTML before. * * @param string $stringtoencode String to encode * @param int $nl2brmode 0=Adding br before \n, 1=Replacing \n by br @@ -6048,7 +6049,7 @@ function dol_textishtml($msg, $option = 0) * * @param string $text1 Text 1 * @param string $text2 Text 2 - * @param bool $forxml false=Use
instead of \n if html content detected, true=Use
instead of \n if html content detected + * @param bool $forxml true=Use
instead of
if we have to add a br tag * @param bool $invert invert order of description lines (we often use config MAIN_CHANGE_ORDER_CONCAT_DESCRIPTION in this parameter) * @return string Text 1 + new line + Text2 * @see dol_textishtml() @@ -6063,9 +6064,9 @@ function dol_concatdesc($text1, $text2, $forxml = false, $invert = false) } $ret = ''; - $ret .= (!dol_textishtml($text1) && dol_textishtml($text2)) ?dol_nl2br($text1, 0, $forxml) : $text1; + $ret .= (!dol_textishtml($text1) && dol_textishtml($text2)) ? dol_nl2br(dol_escape_htmltag($text1, 0, 1, '', 1), 0, $forxml) : $text1; $ret .= (!empty($text1) && !empty($text2)) ? ((dol_textishtml($text1) || dol_textishtml($text2)) ? ($forxml ? "
\n" : "
\n") : "\n") : ""; - $ret .= (dol_textishtml($text1) && !dol_textishtml($text2)) ?dol_nl2br($text2, 0, $forxml) : $text2; + $ret .= (dol_textishtml($text1) && !dol_textishtml($text2)) ? dol_nl2br(dol_escape_htmltag($text2, 0, 1, '', 1), 0, $forxml) : $text2; return $ret; } diff --git a/htdocs/emailcollector/class/emailcollector.class.php b/htdocs/emailcollector/class/emailcollector.class.php index 969b83cac5a..2bc6d6db962 100644 --- a/htdocs/emailcollector/class/emailcollector.class.php +++ b/htdocs/emailcollector/class/emailcollector.class.php @@ -937,8 +937,8 @@ class EmailCollector extends CommonObject } imap_errors(); // Clear stack of errors. - // $conf->global->MAIL_PREFIX_FOR_EMAIL_ID must be defined $host = dol_getprefix('email'); + //$host = '123456'; // Define the IMAP search string // See https://tools.ietf.org/html/rfc3501#section-6.4.4 for IMAPv4 (PHP not yet compatible) @@ -1081,6 +1081,7 @@ class EmailCollector extends CommonObject dol_syslog("Start of loop on email", LOG_INFO, 1); + $i = 0; foreach ($arrayofemail as $imapemail) { if ($nbemailprocessed > 1000) @@ -1088,6 +1089,8 @@ class EmailCollector extends CommonObject break; // Do not process more than 1000 email per launch (this is a different protection than maxnbcollectedpercollect } + $i++; + $header = imap_fetchheader($connection, $imapemail, 0); $header = preg_replace('/\r\n\s+/m', ' ', $header); // When a header line is on several lines, merge lines $matches = array(); @@ -1095,6 +1098,8 @@ class EmailCollector extends CommonObject $headers = array_combine($matches[1], $matches[2]); //var_dump($headers); + dol_syslog("** Process email ".$i." References: ".$headers['References']); + // If there is a filter on trackid if ($searchfilterdoltrackid > 0) { @@ -1130,7 +1135,7 @@ class EmailCollector extends CommonObject // GET Email meta datas $overview = imap_fetch_overview($connection, $imapemail, 0); - dol_syslog("** Process email - msgid=".$overview[0]->message_id." date=".dol_print_date($overview[0]->udate, 'dayrfc', 'gmt')." subject=".$overview[0]->subject); + dol_syslog("msgid=".$overview[0]->message_id." date=".dol_print_date($overview[0]->udate, 'dayrfc', 'gmt')." subject=".$overview[0]->subject); // Decode $overview[0]->subject according to RFC2047 // Can use also imap_mime_header_decode($str) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 5ce79a12231..6c139a0f10c 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1939,7 +1939,7 @@ WithoutDolTrackingID=Dolibarr Reference not found in Message ID FormatZip=Zip MainMenuCode=Menu entry code (mainmenu) ECMAutoTree=Show automatic ECM tree -OperationParamDesc=Define values to use for action, or how to extract values. For example:
objproperty1=SET:abc
objproperty1=SET:a value with replacement of __objproperty1__
objproperty3=SETIFEMPTY:abc
objproperty4=EXTRACT:HEADER:X-Myheaderkey.*[^\s]+(.*)
options_myextrafield=EXTRACT:SUBJECT:([^\s]*)
object.objproperty5=EXTRACT:BODY:My company name is\s([^\s]*)

Use a ; char as separator to extract or set several properties. +OperationParamDesc=Define the values to use for the object of the action, or how to extract values. For example:
objproperty1=SET:the value to set
objproperty2=SET:a value with replacement of __objproperty1__
objproperty3=SETIFEMPTY:value used if objproperty3 is not already defined
objproperty4=EXTRACT:HEADER:X-Myheaderkey:\s*([^\s]*)
options_myextrafield1=EXTRACT:SUBJECT:([^\n]*)
object.objproperty5=EXTRACT:BODY:My company name is\s([^\s]*)

Use a ; char as separator to extract or set several properties. OpeningHours=Opening hours OpeningHoursDesc=Enter here the regular opening hours of your company. ResourceSetup=Configuration of Resource module From 9a8e9bdc99ccec244b6b8ae43c5869f0192789a1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 14 May 2020 14:29:14 +0200 Subject: [PATCH 132/205] Position of fields --- htdocs/index.php | 4 ++-- htdocs/theme/eldy/global.inc.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/index.php b/htdocs/index.php index 36aae1f25b8..7f6e462839b 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -142,11 +142,11 @@ if (empty($user->socid) && empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTATS)) 'orders', 'invoices', 'donations', - 'contracts', - 'interventions', 'supplier_proposals', 'supplier_orders', 'supplier_invoices', + 'contracts', + 'interventions', 'ticket' ); diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 2f5e10c1459..afb154408c5 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -3643,7 +3643,7 @@ ul.noborder li:nth-child(even):not(.liste_titre) { box-shadow: 0px 0px 8px 0px rgba(0,0,0,0.20); } span.boxstatstext { - opacity: 0.7; + opacity: 0.5; line-height: 18px; color: var(--colortext); } From 68512e0281da45963a89c6ce890c080062fc61e2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 14 May 2020 14:56:15 +0200 Subject: [PATCH 133/205] Look and feel v12 --- .../core/boxes/box_accountancy_last_manual_entries.php | 5 ++++- htdocs/core/boxes/box_boms.php | 5 ++++- htdocs/core/boxes/box_clients.php | 5 ++++- htdocs/core/boxes/box_commandes.php | 5 ++++- htdocs/core/boxes/box_factures_imp.php | 5 ++++- htdocs/core/boxes/box_ficheinter.php | 9 ++++++--- htdocs/core/boxes/box_fournisseurs.php | 2 +- htdocs/core/boxes/box_goodcustomers.php | 5 ++++- htdocs/core/boxes/box_mos.php | 5 ++++- htdocs/core/boxes/box_prospect.php | 4 ++-- htdocs/core/boxes/box_services_contracts.php | 5 ++++- htdocs/core/boxes/box_shipments.php | 5 ++++- htdocs/core/tools.php | 2 +- htdocs/install/default.css | 2 +- htdocs/install/step5.php | 10 +++++----- 15 files changed, 52 insertions(+), 22 deletions(-) diff --git a/htdocs/core/boxes/box_accountancy_last_manual_entries.php b/htdocs/core/boxes/box_accountancy_last_manual_entries.php index f1ee00c6c59..6198c90e663 100644 --- a/htdocs/core/boxes/box_accountancy_last_manual_entries.php +++ b/htdocs/core/boxes/box_accountancy_last_manual_entries.php @@ -140,7 +140,10 @@ class box_accountancy_last_manual_entries extends ModeleBoxes $line++; } - if ($num == 0) $this->info_box_contents[$line][0] = array('td' => 'class="center"', 'text'=>$langs->trans("NoRecordedManualEntries")); + if ($num == 0) $this->info_box_contents[$line][0] = array( + 'td' => 'class="center opacitymedium"', + 'text'=>$langs->trans("NoRecordedManualEntries") + ); $this->db->free($result); } else { diff --git a/htdocs/core/boxes/box_boms.php b/htdocs/core/boxes/box_boms.php index 57c5ce2e2e2..c75c4c24e8f 100644 --- a/htdocs/core/boxes/box_boms.php +++ b/htdocs/core/boxes/box_boms.php @@ -153,7 +153,10 @@ class box_boms extends ModeleBoxes $line++; } - if ($num == 0) $this->info_box_contents[$line][0] = array('td' => 'class="center"', 'text'=>$langs->trans("NoRecordedOrders")); + if ($num == 0) $this->info_box_contents[$line][0] = array( + 'td' => 'class="center opacitymedium"', + 'text'=>$langs->trans("NoRecordedOrders") + ); $this->db->free($result); } else { diff --git a/htdocs/core/boxes/box_clients.php b/htdocs/core/boxes/box_clients.php index d82a4aee71e..70718db55b5 100644 --- a/htdocs/core/boxes/box_clients.php +++ b/htdocs/core/boxes/box_clients.php @@ -148,7 +148,10 @@ class box_clients extends ModeleBoxes $line++; } - if ($num == 0) $this->info_box_contents[$line][0] = array('td' => 'class="center"', 'text'=>$langs->trans("NoRecordedCustomers")); + if ($num == 0) $this->info_box_contents[$line][0] = array( + 'td' => 'class="center opacitymedium"', + 'text'=>$langs->trans("NoRecordedCustomers") + ); $this->db->free($result); } diff --git a/htdocs/core/boxes/box_commandes.php b/htdocs/core/boxes/box_commandes.php index 37a25c8084d..7ec5071b6e3 100644 --- a/htdocs/core/boxes/box_commandes.php +++ b/htdocs/core/boxes/box_commandes.php @@ -174,7 +174,10 @@ class box_commandes extends ModeleBoxes $line++; } - if ($num == 0) $this->info_box_contents[$line][0] = array('td' => 'class="center"', 'text'=>$langs->trans("NoRecordedOrders")); + if ($num == 0) $this->info_box_contents[$line][0] = array( + 'td' => 'class="center opacitymedium"', + 'text'=>$langs->trans("NoRecordedOrders") + ); $this->db->free($result); } else { diff --git a/htdocs/core/boxes/box_factures_imp.php b/htdocs/core/boxes/box_factures_imp.php index 0a44105a853..a374094ea89 100644 --- a/htdocs/core/boxes/box_factures_imp.php +++ b/htdocs/core/boxes/box_factures_imp.php @@ -180,7 +180,10 @@ class box_factures_imp extends ModeleBoxes $line++; } - if ($num == 0) $this->info_box_contents[$line][0] = array('td' => 'class="center"', 'text'=>$langs->trans("NoUnpaidCustomerBills")); + if ($num == 0) $this->info_box_contents[$line][0] = array( + 'td' => 'class="center opacitymedium"', + 'text'=>$langs->trans("NoUnpaidCustomerBills") + ); $this->db->free($result); } diff --git a/htdocs/core/boxes/box_ficheinter.php b/htdocs/core/boxes/box_ficheinter.php index e289c83d541..4125ce92eaa 100644 --- a/htdocs/core/boxes/box_ficheinter.php +++ b/htdocs/core/boxes/box_ficheinter.php @@ -145,13 +145,16 @@ class box_ficheinter extends ModeleBoxes $i++; } - if ($num == 0) $this->info_box_contents[$i][] = array('td' => 'class="center"', 'text'=>$langs->trans("NoRecordedInterventions")); + if ($num == 0) $this->info_box_contents[$i][0] = array( + 'td' => 'class="center opacitymedium"', + 'text'=>$langs->trans("NoRecordedInterventions") + ); $this->db->free($resql); } else { - $this->info_box_contents[0][] = array( + $this->info_box_contents[0][0] = array( 'td' => '', 'maxlength'=>500, 'text' => ($this->db->error().' sql='.$sql), @@ -160,7 +163,7 @@ class box_ficheinter extends ModeleBoxes } else { - $this->info_box_contents[0][] = array( + $this->info_box_contents[0][0] = array( 'td' => 'class="nohover opacitymedium left"', 'text' => $langs->trans("ReadPermissionNotAllowed") ); diff --git a/htdocs/core/boxes/box_fournisseurs.php b/htdocs/core/boxes/box_fournisseurs.php index 2f55a379362..44dd891bfb8 100644 --- a/htdocs/core/boxes/box_fournisseurs.php +++ b/htdocs/core/boxes/box_fournisseurs.php @@ -136,7 +136,7 @@ class box_fournisseurs extends ModeleBoxes } if ($num == 0) $this->info_box_contents[$line][0] = array( - 'td' => 'class="center"', + 'td' => 'class="center opacitymedium"', 'text'=>$langs->trans("NoRecordedSuppliers"), ); diff --git a/htdocs/core/boxes/box_goodcustomers.php b/htdocs/core/boxes/box_goodcustomers.php index 79eb6f9ab8e..46dfdff6d23 100644 --- a/htdocs/core/boxes/box_goodcustomers.php +++ b/htdocs/core/boxes/box_goodcustomers.php @@ -142,7 +142,10 @@ class box_goodcustomers extends ModeleBoxes $line++; } - if ($num == 0) $this->info_box_contents[$line][0] = array('td' => 'class="center"', 'text'=>$langs->trans("NoRecordedCustomers")); + if ($num == 0) $this->info_box_contents[$line][0] = array( + 'td' => 'class="center opacitymedium"', + 'text'=>$langs->trans("NoRecordedCustomers") + ); $this->db->free($result); } diff --git a/htdocs/core/boxes/box_mos.php b/htdocs/core/boxes/box_mos.php index 9b863aa2d5a..ec21d5d00cf 100644 --- a/htdocs/core/boxes/box_mos.php +++ b/htdocs/core/boxes/box_mos.php @@ -149,7 +149,10 @@ class box_mos extends ModeleBoxes $line++; } - if ($num == 0) $this->info_box_contents[$line][0] = array('td' => 'class="center"', 'text'=>$langs->trans("NoRecordedOrders")); + if ($num == 0) $this->info_box_contents[$line][0] = array( + 'td' => 'class="center opacitymedium"', + 'text'=>$langs->trans("NoRecordedOrders") + ); $this->db->free($result); } else { diff --git a/htdocs/core/boxes/box_prospect.php b/htdocs/core/boxes/box_prospect.php index 54ed1c76051..1024ef1d4ec 100644 --- a/htdocs/core/boxes/box_prospect.php +++ b/htdocs/core/boxes/box_prospect.php @@ -149,8 +149,8 @@ class box_prospect extends ModeleBoxes if ($num == 0) { $this->info_box_contents[$line][0] = array( - 'td' => 'class="center"', - 'text'=>$langs->trans("NoRecordedProspects"), + 'td' => 'class="center opacitymedium"', + 'text'=> $langs->trans("NoRecordedProspects"), ); } diff --git a/htdocs/core/boxes/box_services_contracts.php b/htdocs/core/boxes/box_services_contracts.php index f8e6dd22452..7167097672b 100644 --- a/htdocs/core/boxes/box_services_contracts.php +++ b/htdocs/core/boxes/box_services_contracts.php @@ -223,7 +223,10 @@ class box_services_contracts extends ModeleBoxes $i++; } - if ($num == 0) $this->info_box_contents[$i][0] = array('td' => 'class="center"', 'text'=>$langs->trans("NoContractedProducts")); + if ($num == 0) $this->info_box_contents[$i][0] = array( + 'td' => 'class="center opacitymedium"', + 'text'=>$langs->trans("NoContractedProducts") + ); $this->db->free($result); } diff --git a/htdocs/core/boxes/box_shipments.php b/htdocs/core/boxes/box_shipments.php index 26f45bc08db..278ad974cf5 100644 --- a/htdocs/core/boxes/box_shipments.php +++ b/htdocs/core/boxes/box_shipments.php @@ -158,7 +158,10 @@ class box_shipments extends ModeleBoxes $line++; } - if ($num == 0) $this->info_box_contents[$line][0] = array('td' => 'class="center"', 'text'=>$langs->trans("NoRecordedShipments")); + if ($num == 0) $this->info_box_contents[$line][0] = array( + 'td' => 'class="center opacitymedium"', + 'text'=>$langs->trans("NoRecordedShipments") + ); $this->db->free($result); } else { diff --git a/htdocs/core/tools.php b/htdocs/core/tools.php index 348417dd345..accb8eeed00 100644 --- a/htdocs/core/tools.php +++ b/htdocs/core/tools.php @@ -46,7 +46,7 @@ $text = $langs->trans("Tools"); print load_fiche_titre($text, '', 'wrench'); // Show description of content -print '
'.$langs->trans("ToolsDesc").'


'; +print '
'.$langs->trans("ToolsDesc").'


'; // Show logo diff --git a/htdocs/install/default.css b/htdocs/install/default.css index f0e51caecab..f363789c129 100644 --- a/htdocs/install/default.css +++ b/htdocs/install/default.css @@ -53,7 +53,7 @@ div.titre { } span.titre { - font-weight: bold; + /* font-weight: bold; */ background: #FFFFFF; color: rgb(0,113,121); border: 1px solid #bbb; diff --git a/htdocs/install/step5.php b/htdocs/install/step5.php index 1609035e415..b74594ce8da 100644 --- a/htdocs/install/step5.php +++ b/htdocs/install/step5.php @@ -384,10 +384,10 @@ if ($action == "set" && $success) print "
"; - print $langs->trans("YouNeedToPersonalizeSetup")."

"; + print $langs->trans("YouNeedToPersonalizeSetup")."


"; print ''; } else @@ -399,7 +399,7 @@ if ($action == "set" && $success) print "
"; print ''; } } @@ -435,7 +435,7 @@ elseif (empty($action) || preg_match('/upgrade/i', $action)) print "

"; print '
'; } else @@ -447,7 +447,7 @@ elseif (empty($action) || preg_match('/upgrade/i', $action)) print "
"; print ''; } } From 6ec5dd02b61a21154b55812660f09b57b87994dd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 14 May 2020 15:27:10 +0200 Subject: [PATCH 134/205] Fix Fatal error with bad triggers --- htdocs/core/class/interfaces.class.php | 89 +++++++++++-------- htdocs/core/modules/DolibarrModules.class.php | 10 ++- .../interface_80_modStripe_Stripe.class.php | 2 +- htdocs/theme/eldy/info-box.inc.php | 4 +- 4 files changed, 59 insertions(+), 46 deletions(-) diff --git a/htdocs/core/class/interfaces.class.php b/htdocs/core/class/interfaces.class.php index f1daafeb9e7..9302ed09afb 100644 --- a/htdocs/core/class/interfaces.class.php +++ b/htdocs/core/class/interfaces.class.php @@ -328,48 +328,59 @@ class Interfaces continue; } - $objMod = new $modName($db); + try { + $objMod = new $modName($db); - // Define disabledbyname and disabledbymodule - $disabledbyname = 0; - $disabledbymodule = 1; - $module = ''; + if (is_subclass_of($objMod, 'DolibarrTriggers')) + { + // Define disabledbyname and disabledbymodule + $disabledbyname = 0; + $disabledbymodule = 1; + $module = ''; - // Check if trigger file is disabled by name - if (preg_match('/NORUN$/i', $files[$key])) $disabledbyname = 1; - // Check if trigger file is for a particular module - if (preg_match('/^interface_([0-9]+)_([^_]+)_(.+)\.class\.php/i', $files[$key], $reg)) - { - $module = preg_replace('/^mod/i', '', $reg[2]); - $constparam = 'MAIN_MODULE_'.strtoupper($module); - if (strtolower($module) == 'all') $disabledbymodule = 0; - elseif (empty($conf->global->$constparam)) $disabledbymodule = 2; - $triggers[$j]['module'] = strtolower($module); + // Check if trigger file is disabled by name + if (preg_match('/NORUN$/i', $files[$key])) $disabledbyname = 1; + // Check if trigger file is for a particular module + if (preg_match('/^interface_([0-9]+)_([^_]+)_(.+)\.class\.php/i', $files[$key], $reg)) + { + $module = preg_replace('/^mod/i', '', $reg[2]); + $constparam = 'MAIN_MODULE_'.strtoupper($module); + if (strtolower($module) == 'all') $disabledbymodule = 0; + elseif (empty($conf->global->$constparam)) $disabledbymodule = 2; + $triggers[$j]['module'] = strtolower($module); + } + + // We set info of modules + $triggers[$j]['picto'] = $objMod->picto ?img_object('', $objMod->picto, 'class="valignmiddle pictomodule "') : img_object('', 'generic', 'class="valignmiddle pictomodule "'); + $triggers[$j]['file'] = $files[$key]; + $triggers[$j]['fullpath'] = $fullpath[$key]; + $triggers[$j]['relpath'] = $relpath[$key]; + $triggers[$j]['iscoreorexternal'] = $iscoreorexternal[$key]; + $triggers[$j]['version'] = $objMod->getVersion(); + $triggers[$j]['status'] = img_picto($langs->trans("Active"), 'tick'); + if ($disabledbyname > 0 || $disabledbymodule > 1) $triggers[$j]['status'] = ''; + + $text = ''.$langs->trans("Description").':
'; + $text .= $objMod->getDesc().'
'; + $text .= '
'.$langs->trans("Status").':
'; + if ($disabledbyname == 1) + { + $text .= $langs->trans("TriggerDisabledByName").'
'; + if ($disabledbymodule == 2) $text .= $langs->trans("TriggerDisabledAsModuleDisabled", $module).'
'; + } + else + { + if ($disabledbymodule == 0) $text .= $langs->trans("TriggerAlwaysActive").'
'; + if ($disabledbymodule == 1) $text .= $langs->trans("TriggerActiveAsModuleActive", $module).'
'; + if ($disabledbymodule == 2) $text .= $langs->trans("TriggerDisabledAsModuleDisabled", $module).'
'; + } + } + else { + print 'Error: Trigger '.$modName.' does not extends DolibarrTriggers
'; + } } - - // We set info of modules - $triggers[$j]['picto'] = $objMod->picto ?img_object('', $objMod->picto, 'class="valignmiddle pictomodule "') : img_object('', 'generic', 'class="valignmiddle pictomodule "'); - $triggers[$j]['file'] = $files[$key]; - $triggers[$j]['fullpath'] = $fullpath[$key]; - $triggers[$j]['relpath'] = $relpath[$key]; - $triggers[$j]['iscoreorexternal'] = $iscoreorexternal[$key]; - $triggers[$j]['version'] = $objMod->getVersion(); - $triggers[$j]['status'] = img_picto($langs->trans("Active"), 'tick'); - if ($disabledbyname > 0 || $disabledbymodule > 1) $triggers[$j]['status'] = ''; - - $text = ''.$langs->trans("Description").':
'; - $text .= $objMod->getDesc().'
'; - $text .= '
'.$langs->trans("Status").':
'; - if ($disabledbyname == 1) - { - $text .= $langs->trans("TriggerDisabledByName").'
'; - if ($disabledbymodule == 2) $text .= $langs->trans("TriggerDisabledAsModuleDisabled", $module).'
'; - } - else - { - if ($disabledbymodule == 0) $text .= $langs->trans("TriggerAlwaysActive").'
'; - if ($disabledbymodule == 1) $text .= $langs->trans("TriggerActiveAsModuleActive", $module).'
'; - if ($disabledbymodule == 2) $text .= $langs->trans("TriggerDisabledAsModuleDisabled", $module).'
'; + catch(Exception $e) { + print $e->getMessage(); } $triggers[$j]['info'] = $text; diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php index 9543cf74442..f9d27fedfa4 100644 --- a/htdocs/core/modules/DolibarrModules.class.php +++ b/htdocs/core/modules/DolibarrModules.class.php @@ -2295,9 +2295,11 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it { print img_object($alttext, 'generic', 'class="inline-block valignmiddle"'); } - print 'getVersion(1).'">'; - print $this->getVersion(1); - print ''; + if ($this->isCoreOrExternalModule() == 'external') { + print 'getVersion(1).'">'; + print $this->getVersion(1); + print ''; + } /*print ''; print '
'; @@ -2313,7 +2315,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it print '
- '.$this->getName().' + '.$this->getName().' '.nl2br($this->getDesc()).''; /*print 'getVersion(1).'">'; diff --git a/htdocs/core/triggers/interface_80_modStripe_Stripe.class.php b/htdocs/core/triggers/interface_80_modStripe_Stripe.class.php index 27138e6099f..e6c2df36ee1 100644 --- a/htdocs/core/triggers/interface_80_modStripe_Stripe.class.php +++ b/htdocs/core/triggers/interface_80_modStripe_Stripe.class.php @@ -33,7 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/triggers/dolibarrtriggers.class.php'; /** * Class of triggers for stripe module */ -class InterfaceStripe +class InterfaceStripe extends DolibarrTriggers { /** * @var DoliDB Database handler. diff --git a/htdocs/theme/eldy/info-box.inc.php b/htdocs/theme/eldy/info-box.inc.php index 3138cd8bfd9..3d9c392f32b 100644 --- a/htdocs/theme/eldy/info-box.inc.php +++ b/htdocs/theme/eldy/info-box.inc.php @@ -8,7 +8,7 @@ if (!defined('ISLOADEDBYSTEELSHEET')) die('Must be call by steelsheet'); ?> */ .info-box-module-external span.info-box-icon-version { - background: #999; + background: #bbb; } .info-box { @@ -74,7 +74,7 @@ if (!defined('ISLOADEDBYSTEELSHEET')) die('Must be call by steelsheet'); ?> height: 80px; width: 80px; font-size: 25px; - line-height: 80px; + line-height: 100px; } .info-box-module .info-box-icon { height: 106px; From 7c01b54d73237b39e8ee45ca0e5784ba8c666adc Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 14 May 2020 15:42:37 +0200 Subject: [PATCH 135/205] Fix version on module list --- htdocs/admin/modules.php | 4 +++- htdocs/core/modules/DolibarrModules.class.php | 10 ++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index 6a0ff450346..c0f1991835b 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -680,7 +680,9 @@ if ($mode == 'common' || $mode == 'commonkanban') if (preg_match('/development/i', $version)) $versiontrans .= img_warning($langs->trans("Development"), 'style="float: left"'); if (preg_match('/experimental/i', $version)) $versiontrans .= img_warning($langs->trans("Experimental"), 'style="float: left"'); if (preg_match('/deprecated/i', $version)) $versiontrans .= img_warning($langs->trans("Deprecated"), 'style="float: left"'); - $versiontrans .= $objMod->getVersion(1); + if ($objMod->isCoreOrExternalModule() == 'external' || preg_match('/development|experimental|deprecated/i', $version)) { + $versiontrans .= $objMod->getVersion(1); + } // Define imginfo $imginfo = "info"; diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php index f9d27fedfa4..384c4fc3a7e 100644 --- a/htdocs/core/modules/DolibarrModules.class.php +++ b/htdocs/core/modules/DolibarrModules.class.php @@ -2295,8 +2295,14 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it { print img_object($alttext, 'generic', 'class="inline-block valignmiddle"'); } - if ($this->isCoreOrExternalModule() == 'external') { - print 'getVersion(1).'">'; + + $version = $this->getVersion(0); + $versiontrans = ''; + if (preg_match('/development/i', $version)) $versiontrans .= 'warning'; + if (preg_match('/experimental/i', $version)) $versiontrans .= 'warning'; + if (preg_match('/deprecated/i', $version)) $versiontrans .= 'warning'; + if ($this->isCoreOrExternalModule() == 'external' || preg_match('/development|experimental|deprecated/i', $version)) { + print 'getVersion(1).'">'; print $this->getVersion(1); print ''; } From 3d26351c6b4de6444a4f7230cbfa0d93d165e7e5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 14 May 2020 16:03:31 +0200 Subject: [PATCH 136/205] Fix function if hours. --- htdocs/core/lib/date.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/date.lib.php b/htdocs/core/lib/date.lib.php index ae138bcceec..a751f584564 100644 --- a/htdocs/core/lib/date.lib.php +++ b/htdocs/core/lib/date.lib.php @@ -912,7 +912,7 @@ function num_open_day($timestampStart, $timestampEnd, $inhour = 0, $lastday = 0, $nbOpenDay=$lastday; - if ($inhour == 1) $nbOpenDay = $nbOpenDay*24 . $langs->trans("HourShort"); + if ($inhour == 1) $nbOpenDay = ($nbOpenDay * 24); return $nbOpenDay - (($inhour == 1 ? 12 : 0.5) * abs($halfday)); } else From b26c1757e6ab26142aa57ab27e53cb847db47b93 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 14 May 2020 16:07:23 +0200 Subject: [PATCH 137/205] Prepare v13 --- .../install/mysql/migration/12.0.0-13.0.0.sql | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 htdocs/install/mysql/migration/12.0.0-13.0.0.sql diff --git a/htdocs/install/mysql/migration/12.0.0-13.0.0.sql b/htdocs/install/mysql/migration/12.0.0-13.0.0.sql new file mode 100644 index 00000000000..210fe31d1ef --- /dev/null +++ b/htdocs/install/mysql/migration/12.0.0-13.0.0.sql @@ -0,0 +1,36 @@ +-- +-- Be carefull to requests order. +-- This file must be loaded by calling /install/index.php page +-- when current version is 13.0.0 or higher. +-- +-- To restrict request to Mysql version x.y minimum use -- VMYSQLx.y +-- To restrict request to Pgsql version x.y minimum use -- VPGSQLx.y +-- To rename a table: ALTER TABLE llx_table RENAME TO llx_table_new; +-- To add a column: ALTER TABLE llx_table ADD COLUMN newcol varchar(60) NOT NULL DEFAULT '0' AFTER existingcol; +-- To rename a column: ALTER TABLE llx_table CHANGE COLUMN oldname newname varchar(60); +-- To drop a column: ALTER TABLE llx_table DROP COLUMN oldname; +-- To change type of field: ALTER TABLE llx_table MODIFY COLUMN name varchar(60); +-- To drop a foreign key: ALTER TABLE llx_table DROP FOREIGN KEY fk_name; +-- To create a unique index ALTER TABLE llx_table ADD UNIQUE INDEX uk_table_field (field); +-- To drop an index: -- VMYSQL4.1 DROP INDEX nomindex on llx_table +-- To drop an index: -- VPGSQL8.2 DROP INDEX nomindex +-- To make pk to be auto increment (mysql): -- VMYSQL4.3 ALTER TABLE llx_table CHANGE COLUMN rowid rowid INTEGER NOT NULL AUTO_INCREMENT; +-- To make pk to be auto increment (postgres): +-- -- VPGSQL8.2 CREATE SEQUENCE llx_table_rowid_seq OWNED BY llx_table.rowid; +-- -- VPGSQL8.2 ALTER TABLE llx_table ADD PRIMARY KEY (rowid); +-- -- VPGSQL8.2 ALTER TABLE llx_table ALTER COLUMN rowid SET DEFAULT nextval('llx_table_rowid_seq'); +-- -- VPGSQL8.2 SELECT setval('llx_table_rowid_seq', MAX(rowid)) FROM llx_table; +-- To set a field as NULL: -- VMYSQL4.3 ALTER TABLE llx_table MODIFY COLUMN name varchar(60) NULL; +-- To set a field as NULL: -- VPGSQL8.2 ALTER TABLE llx_table ALTER COLUMN name DROP NOT NULL; +-- To set a field as NOT NULL: -- VMYSQL4.3 ALTER TABLE llx_table MODIFY COLUMN name varchar(60) NOT NULL; +-- To set a field as NOT NULL: -- VPGSQL8.2 ALTER TABLE llx_table ALTER COLUMN name SET NOT NULL; +-- To set a field as default NULL: -- VPGSQL8.2 ALTER TABLE llx_table ALTER COLUMN name SET DEFAULT NULL; +-- Note: fields with type BLOB/TEXT can't have default value. + + +-- Missing in v12 + + +-- For v13 + + From 9becb24073c6fc90230289ee0b33170ff517d6a1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 14 May 2020 16:40:40 +0200 Subject: [PATCH 138/205] Prepare v13 --- htdocs/filefunc.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index 0780154118e..b70419de5f4 100644 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -31,7 +31,7 @@ */ if (!defined('DOL_APPLICATION_TITLE')) define('DOL_APPLICATION_TITLE', 'Dolibarr'); -if (!defined('DOL_VERSION')) define('DOL_VERSION', '12.0.0-alpha'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c +if (!defined('DOL_VERSION')) define('DOL_VERSION', '13.0.0-alpha'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c if (!defined('EURO')) define('EURO', chr(128)); From 215cf9e6f804cba007c44cc7c08a68e3b2b38a9a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 14 May 2020 16:45:32 +0200 Subject: [PATCH 139/205] Prepare v13 --- htdocs/install/check.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/install/check.php b/htdocs/install/check.php index 95e3082cb56..408f4b2a1a8 100644 --- a/htdocs/install/check.php +++ b/htdocs/install/check.php @@ -479,7 +479,8 @@ else array('from'=>'8.0.0', 'to'=>'9.0.0'), array('from'=>'9.0.0', 'to'=>'10.0.0'), array('from'=>'10.0.0', 'to'=>'11.0.0'), - array('from'=>'11.0.0', 'to'=>'12.0.0') + array('from'=>'11.0.0', 'to'=>'12.0.0'), + array('from'=>'12.0.0', 'to'=>'13.0.0') ); $count = 0; From 499c2ea30a63c4b5b575576ce02f37f7e554e9b4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 14 May 2020 16:52:21 +0200 Subject: [PATCH 140/205] FIX #13855 --- htdocs/core/lib/ajax.lib.php | 2 +- htdocs/main.inc.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/ajax.lib.php b/htdocs/core/lib/ajax.lib.php index 64f442633de..1d3e80b90be 100644 --- a/htdocs/core/lib/ajax.lib.php +++ b/htdocs/core/lib/ajax.lib.php @@ -20,7 +20,7 @@ /** * \file htdocs/core/lib/ajax.lib.php - * \brief Page called by Ajax request for produts + * \brief Page called to enhance interface with Javascript and Ajax features. */ diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index d4d1f84a344..49c48e34ec1 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -317,7 +317,7 @@ if (!defined('NOLOGIN') && !defined('NOIPCHECK') && !empty($dolibarr_main_restri // Loading of additional presentation includes if (!defined('NOREQUIREHTML')) require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php'; // Need 660ko memory (800ko in 2.2) -if (!defined('NOREQUIREAJAX') && $conf->use_javascript_ajax) require_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; // Need 22ko memory +require_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; // Need 22ko memory // If install or upgrade process not done or not completely finished, we call the install page. if (!empty($conf->global->MAIN_NOT_INSTALLED) || !empty($conf->global->MAIN_NOT_UPGRADED)) From 949e0f2326a6f3268b511110903aec472315b5b4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 14 May 2020 17:27:12 +0200 Subject: [PATCH 141/205] Fix filter on language --- htdocs/website/class/websitepage.class.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/website/class/websitepage.class.php b/htdocs/website/class/websitepage.class.php index 84eaf0efb27..c63823f51a1 100644 --- a/htdocs/website/class/websitepage.class.php +++ b/htdocs/website/class/websitepage.class.php @@ -332,7 +332,11 @@ class WebsitePage extends CommonObject if ($key == 't.rowid' || $key == 't.fk_website') { $sqlwhere[] = $key.'='.$value; } elseif ($key == 'lang' || $key == 't.lang') { - $sqlwhere[] = $key." = '".$this->db->escape(substr($value, 0, 2))."'"; + $listoflang = array(); + foreach(explode(',', $value) as $tmpvalue) { + $listoflang[] = "'".$this->db->escape(substr(str_replace("'", '', $tmpvalue), 0, 2))."'"; + } + $sqlwhere[] = $key." IN (".join(',', $listoflang).")"; } else { $sqlwhere[] = $key.' LIKE \'%'.$this->db->escape($value).'%\''; } From 991996697dd5e1f529d9e1a36eff465e4256ebf3 Mon Sep 17 00:00:00 2001 From: "jove@bisquerra.com" Date: Thu, 14 May 2020 18:03:22 +0200 Subject: [PATCH 142/205] Public photos for customers with TakePOS --- htdocs/takepos/genimg/index.php | 6 +++--- htdocs/takepos/phone.php | 4 ++-- htdocs/takepos/public/auto_order.php | 1 + htdocs/viewimage.php | 12 ++++++++++++ 4 files changed, 18 insertions(+), 5 deletions(-) diff --git a/htdocs/takepos/genimg/index.php b/htdocs/takepos/genimg/index.php index a5686054193..c2bb62b9322 100644 --- a/htdocs/takepos/genimg/index.php +++ b/htdocs/takepos/genimg/index.php @@ -25,7 +25,7 @@ if (!defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); if (!defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); if (!defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); -require '../../main.inc.php'; // Load $user and permissions +if (!defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) require '../../main.inc.php'; // Load $user and permissions $id = GETPOST('id', 'int'); $w = GETPOST('w', 'int'); @@ -72,12 +72,12 @@ elseif ($query == "pro") $objProd = new Product($db); $objProd->fetch($id); - $image = $objProd->show_photos('product', $conf->product->multidir_output[$entity], 'small', 1); + $image = $objProd->show_photos('product', $conf->product->multidir_output[$objProd->entity], 'small', 1); preg_match('@src="([^"]+)"@', $image, $match); $file = array_pop($match); if ($file == "") header('Location: ../../public/theme/common/nophoto.png'); - else header('Location: '.$file.'&cache=1'); + else header('Location: '.$file.'&cache=1&publictakepos=1'); } else { diff --git a/htdocs/takepos/phone.php b/htdocs/takepos/phone.php index 8714173e45f..d506c64d2fc 100644 --- a/htdocs/takepos/phone.php +++ b/htdocs/takepos/phone.php @@ -77,7 +77,7 @@ if ($action=="productinfo"){ $prod = new Product($db); $prod->fetch($idproduct); print "".$prod->label."
"; - print ''; + print ''; print "
".$prod->description; print "
".price($prod->price_ttc, 1, $langs, 1, -1, -1, $conf->currency).""; print '
'; @@ -95,7 +95,7 @@ elseif ($action=="editline"){ $prod = new Product($db); $prod->fetch($line->fk_product); print "".$prod->label."
"; - print ''; + print ''; print "
".$prod->description; print "
".price($prod->price_ttc, 1, $langs, 1, -1, -1, $conf->currency).""; print '
'; diff --git a/htdocs/takepos/public/auto_order.php b/htdocs/takepos/public/auto_order.php index c7612711df0..910c00327b4 100644 --- a/htdocs/takepos/public/auto_order.php +++ b/htdocs/takepos/public/auto_order.php @@ -33,4 +33,5 @@ $_SESSION["takeposterminal"] = 1; define('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE', 1); if (GETPOSTISSET("mobilepage")) require '../invoice.php'; +elseif (GETPOSTISSET("genimg")) require DOL_DOCUMENT_ROOT.'/takepos/genimg/index.php'; else require '../phone.php'; diff --git a/htdocs/viewimage.php b/htdocs/viewimage.php index 3cb23b36fbc..39795b62fd8 100644 --- a/htdocs/viewimage.php +++ b/htdocs/viewimage.php @@ -59,6 +59,14 @@ if ((isset($_GET["modulepart"]) && $_GET["modulepart"] == 'medias')) if (!defined("NOIPCHECK")) define("NOIPCHECK", 1); // Do not check IP defined into conf $dolibarr_main_restrict_ip } +// Used by TakePOS Auto Order +if (isset($_GET["publictakepos"])) +{ + if (!defined("NOLOGIN")) define("NOLOGIN", 1); + if (!defined("NOCSRFCHECK")) define("NOCSRFCHECK", 1); // We accept to go on this page from external web site. + if (!defined("NOIPCHECK")) define("NOIPCHECK", 1); // Do not check IP defined into conf $dolibarr_main_restrict_ip +} + // For multicompany $entity = (!empty($_GET['entity']) ? (int) $_GET['entity'] : (!empty($_POST['entity']) ? (int) $_POST['entity'] : 1)); if (is_numeric($entity)) define("DOLENTITY", $entity); @@ -195,6 +203,10 @@ if (!empty($hashp)) $accessallowed = 1; // When using hashp, link is public so we force $accessallowed $sqlprotectagainstexternals = ''; } +elseif ($conf->global->TAKEPOS_AUTO_ORDER && isset($_GET["publictakepos"])) +{ + $accessallowed = 1; // Only if TakePOS Public Auto Order is enabled and received publictakepos variable +} else { // Basic protection (against external users only) From 1bf677f53735d66bbb4e0a7e9c9a8896ec99e95d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 14 May 2020 18:14:55 +0200 Subject: [PATCH 143/205] Can set status of a websitepage --- htdocs/core/ajax/objectonoff.php | 11 ++++++++--- htdocs/core/class/commonobject.class.php | 5 ++++- htdocs/core/lib/security.lib.php | 1 + htdocs/website/index.php | 14 +++++++++++++- 4 files changed, 26 insertions(+), 5 deletions(-) diff --git a/htdocs/core/ajax/objectonoff.php b/htdocs/core/ajax/objectonoff.php index dd39bce6d4e..6466df89a07 100644 --- a/htdocs/core/ajax/objectonoff.php +++ b/htdocs/core/ajax/objectonoff.php @@ -43,9 +43,9 @@ if (!empty($user->socid)) { $socid = $user->socid; } -if (empty($conf->global->MAIN_DIRECT_STATUS_UPDATE)) { +/*if (empty($conf->global->MAIN_DIRECT_STATUS_UPDATE)) { accessforbidden('Calling this file is allowed only when MAIN_DIRECT_STATUS_UPDATE is set'); -} +}*/ /* @@ -75,5 +75,10 @@ if (($action == 'set') && !empty($id)) { $triggerkey = 'COMPANY_UPDATE'; } - $object->setValueFrom($field, $value, $element, $id, $user, $triggerkey); + $tablename = $element; + if ($tablename == 'websitepage') $tablename = 'website_page'; + + $format = 'int'; + + $object->setValueFrom($field, $value, $tablename, $id, $format, '', $user, $triggerkey); } diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index f3f1b9eaee3..6148b55a5cf 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -8070,7 +8070,10 @@ abstract class CommonObject { if (empty($id) && empty($ref) && empty($morewhere)) return -1; - $sql = 'SELECT '.$this->getFieldList(); + $fieldlist = $this->getFieldList(); + if (empty($fieldlist)) return 0; + + $sql = 'SELECT '.$fieldlist; $sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element; if (!empty($id)) $sql .= ' WHERE rowid = '.$id; diff --git a/htdocs/core/lib/security.lib.php b/htdocs/core/lib/security.lib.php index 6749f32ffbe..03f1525eb91 100644 --- a/htdocs/core/lib/security.lib.php +++ b/htdocs/core/lib/security.lib.php @@ -192,6 +192,7 @@ function restrictedArea($user, $features, $objectid = 0, $tableandshare = '', $f if ($features == 'mo') $features = 'mrp'; if ($features == 'member') $features = 'adherent'; if ($features == 'subscription') { $features = 'adherent'; $feature2 = 'cotisation'; }; + if ($features == 'websitepage') $features = 'website'; // Get more permissions checks from hooks $parameters = array('features'=>$features, 'objectid'=>$objectid, 'idtype'=>$dbt_select); diff --git a/htdocs/website/index.php b/htdocs/website/index.php index 690dc0efe3b..ac26f2ee7bb 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -3170,6 +3170,7 @@ if ($action == 'editmeta' || $action == 'createcontainer') $pageauthorid = $objectpage->fk_user_creat; $pageusermodifid = $objectpage->fk_user_modif; $pageauthoralias = $objectpage->author_alias; + $pagestatus = $objectpage->status; } else { @@ -3178,6 +3179,7 @@ if ($action == 'editmeta' || $action == 'createcontainer') $pageauthorid = $user->id; $pageusermodifid = 0; $pageauthoralias = ''; + $pagestatus = 1; } if (GETPOST('WEBSITE_TITLE', 'alpha')) $pagetitle = GETPOST('WEBSITE_TITLE', 'alpha'); if (GETPOST('WEBSITE_PAGENAME', 'alpha')) $pageurl = GETPOST('WEBSITE_PAGENAME', 'alpha'); @@ -3186,7 +3188,7 @@ if ($action == 'editmeta' || $action == 'createcontainer') if (GETPOST('WEBSITE_IMAGE', 'alpha')) $pageimage = GETPOST('WEBSITE_IMAGE', 'alpha'); if (GETPOST('WEBSITE_KEYWORDS', 'alpha')) $pagekeywords = GETPOST('WEBSITE_KEYWORDS', 'alpha'); if (GETPOST('WEBSITE_LANG', 'aZ09')) $pagelang = GETPOST('WEBSITE_LANG', 'aZ09'); - if (GETPOST('htmlheader', 'none')) $pagehtmlheader = GETPOST('htmlheader', 'none'); + if (GETPOST('htmlheader', 'none')) $pagehtmlheader = GETPOST('htmlheader', 'none'); // Title print '
'; + if ($action != 'createcontainer') + { + print ''; + } + print '
attributes[$object->table_element]['required'][$key])) print ' fieldrequired'; print '">'; if (!empty($extrafields->attributes[$object->table_element]['help'][$key])) print $form->textwithpicto($langs->trans($label), $langs->trans($extrafields->attributes[$object->table_element]['help'][$key])); @@ -161,6 +175,7 @@ if (empty($reshook) && is_array($extrafields->attributes[$object->table_element] //print 'x'.$object->array_options['options_' . $key].'-'.$datenotinstring.' - '.dol_print_date($datenotinstring, 'dayhour'); $value = isset($_POST["options_".$key]) ? dol_mktime($_POST["options_".$key."hour"], $_POST["options_".$key."min"], 0, $_POST["options_".$key."month"], $_POST["options_".$key."day"], $_POST["options_".$key."year"]) : $datenotinstring; } + //TODO Improve element and rights detection if ($action == 'edit_extras' && $permok && GETPOST('attribute', 'none') == $key) { diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 60c7ee43bb0..2f5e10c1459 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -1751,7 +1751,7 @@ img.photorefnoborder { border-bottom: px solid rgb(); /* border-bottom: 2px solid var(--colorbackhmenu1); */ } -.trextrafieldseparator td { +.trextrafieldseparator td, .trextrafields_collapse_last td { /* border-bottom: 2px solid var(--colorbackhmenu1) !important; */ border-bottom: 2px solid rgb() !important; } diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index c7ce5709efd..da2df5eb788 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -1799,7 +1799,7 @@ img.photorefnoborder { border-bottom: px solid rgb(); } -.trextrafieldseparator td { +.trextrafieldseparator td, .trextrafields_collapse_last td { border-bottom: 1px solid rgb() !important; } .tdhrthin { From a796122f7b0e1050df2fe5ac635107e4aa3750be Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 14 May 2020 12:28:17 +0200 Subject: [PATCH 130/205] Fix to solve feedbacks of https://www.dolibarr.fr/forum/t/email-collector-avec-office-365-bug-et-contournement/32726 --- .../class/emailcollector.class.php | 20 +++++++++++++++---- .../install/mysql/migration/11.0.0-12.0.0.sql | 2 ++ .../llx_emailcollector_emailcollector.sql | 3 ++- htdocs/langs/en_US/admin.lang | 1 + 4 files changed, 21 insertions(+), 5 deletions(-) diff --git a/htdocs/emailcollector/class/emailcollector.class.php b/htdocs/emailcollector/class/emailcollector.class.php index 11cf2477720..969b83cac5a 100644 --- a/htdocs/emailcollector/class/emailcollector.class.php +++ b/htdocs/emailcollector/class/emailcollector.class.php @@ -100,8 +100,9 @@ class EmailCollector extends CommonObject 'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>10, 'searchall'=>1, 'help'=>'Example: MyCollector1'), 'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'visible'=>1, 'enabled'=>1, 'position'=>30, 'notnull'=>-1, 'searchall'=>1, 'help'=>'Example: My Email collector'), 'description' => array('type'=>'text', 'label'=>'Description', 'visible'=>-1, 'enabled'=>1, 'position'=>60, 'notnull'=>-1), - 'host' => array('type'=>'varchar(255)', 'label'=>'EMailHost', 'visible'=>1, 'enabled'=>1, 'position'=>100, 'notnull'=>1, 'searchall'=>1, 'comment'=>"IMAP server", 'help'=>'Example: imap.gmail.com'), - 'login' => array('type'=>'varchar(128)', 'label'=>'Login', 'visible'=>1, 'enabled'=>1, 'position'=>101, 'notnull'=>-1, 'index'=>1, 'comment'=>"IMAP login", 'help'=>'Example: myaccount@gmail.com'), + 'host' => array('type'=>'varchar(255)', 'label'=>'EMailHost', 'visible'=>1, 'enabled'=>1, 'position'=>90, 'notnull'=>1, 'searchall'=>1, 'comment'=>"IMAP server", 'help'=>'Example: imap.gmail.com'), + 'hostcharset' => array('type'=>'varchar(16)', 'label'=>'HostCharset', 'visible'=>-1, 'enabled'=>1, 'position'=>91, 'notnull'=>0, 'searchall'=>0, 'comment'=>"IMAP server charset", 'help'=>'Example: "UTF-8" (May be "US-ASCII" with some Office365)'), + 'login' => array('type'=>'varchar(128)', 'label'=>'Login', 'visible'=>1, 'enabled'=>1, 'position'=>101, 'notnull'=>-1, 'index'=>1, 'comment'=>"IMAP login", 'help'=>'Example: myaccount@gmail.com'), 'password' => array('type'=>'password', 'label'=>'Password', 'visible'=>-1, 'enabled'=>1, 'position'=>102, 'notnull'=>-1, 'comment'=>"IMAP password", 'help'=>'WithGMailYouCanCreateADedicatedPassword'), 'source_directory' => array('type'=>'varchar(255)', 'label'=>'MailboxSourceDirectory', 'visible'=>-1, 'enabled'=>1, 'position'=>103, 'notnull'=>1, 'default' => 'Inbox', 'help'=>'Example: INBOX'), //'filter' => array('type'=>'text', 'label'=>'Filter', 'visible'=>1, 'enabled'=>1, 'position'=>105), @@ -173,6 +174,7 @@ class EmailCollector extends CommonObject public $host; + public $hostcharset; public $login; public $password; public $source_directory; @@ -985,9 +987,10 @@ class EmailCollector extends CommonObject $nbemailprocessed = 0; $nbemailok = 0; $nbactiondone = 0; + $charset = ($this->hostcharset ? $this->hostcharset : "UTF-8"); // Scan IMAP inbox - $arrayofemail = imap_search($connection, $search, null, "UTF-8"); + $arrayofemail = imap_search($connection, $search, null, $charset); if ($arrayofemail === false) { // Nothing found or search string not understood @@ -1086,6 +1089,7 @@ class EmailCollector extends CommonObject } $header = imap_fetchheader($connection, $imapemail, 0); + $header = preg_replace('/\r\n\s+/m', ' ', $header); // When a header line is on several lines, merge lines $matches = array(); preg_match_all('/([^: ]+): (.+?(?:\r\n\s(?:.+?))*)\r\n/m', $header, $matches); $headers = array_combine($matches[1], $matches[2]); @@ -1132,7 +1136,10 @@ class EmailCollector extends CommonObject // Can use also imap_mime_header_decode($str) // Can use also mb_decode_mimeheader($str) // Can use also iconv_mime_decode($str, ICONV_MIME_DECODE_CONTINUE_ON_ERROR, 'UTF-8') - if (function_exists('imap_mime_header_decode')) { + if (function_exists('iconv_mime_decode')) { + $overview[0]->subject = iconv_mime_decode($overview[0]->subject, ICONV_MIME_DECODE_CONTINUE_ON_ERROR, 'UTF-8'); + } + elseif (function_exists('imap_mime_header_decode')) { $elements = imap_mime_header_decode($overview[0]->subject); $newstring = ''; if (!empty($elements)) { @@ -1146,6 +1153,8 @@ class EmailCollector extends CommonObject elseif (function_exists('mb_decode_mimeheader')) { $overview[0]->subject = mb_decode_mimeheader($overview[0]->subject); } + // Removed emojis + $overview[0]->subject = preg_replace('/[\x{10000}-\x{10FFFF}]/u', "\xEF\xBF\xBD", $overview[0]->subject); // Parse IMAP email structure global $htmlmsg, $plainmsg, $charset, $attachments; @@ -1153,6 +1162,9 @@ class EmailCollector extends CommonObject //$htmlmsg,$plainmsg,$charset,$attachments $messagetext = $plainmsg ? $plainmsg : dol_string_nohtmltag($htmlmsg, 0); + // Removed emojis + $messagetext = preg_replace('/[\x{10000}-\x{10FFFF}]/u', "\xEF\xBF\xBD", $messagetext); + /*var_dump($plainmsg); var_dump($htmlmsg); var_dump($messagetext);*/ diff --git a/htdocs/install/mysql/migration/11.0.0-12.0.0.sql b/htdocs/install/mysql/migration/11.0.0-12.0.0.sql index 8a68e763160..7daf41a05d3 100644 --- a/htdocs/install/mysql/migration/11.0.0-12.0.0.sql +++ b/htdocs/install/mysql/migration/11.0.0-12.0.0.sql @@ -285,3 +285,5 @@ ALTER TABLE llx_prelevement_facture ADD COLUMN fk_facture_fourn INTEGER NULL; ALTER TABLE llx_menu MODIFY COLUMN module varchar(255); UPDATE llx_actioncomm SET fk_action = 50 where fk_action = 40 AND code = 'TICKET_MSG'; + +ALTER TABLE llx_emailcollector_emailcollector ADD COLUMN hostcharset varchar(16) DEFAULT 'UTF-8'; diff --git a/htdocs/install/mysql/tables/llx_emailcollector_emailcollector.sql b/htdocs/install/mysql/tables/llx_emailcollector_emailcollector.sql index 10f3e4f8b9b..87581f418e8 100644 --- a/htdocs/install/mysql/tables/llx_emailcollector_emailcollector.sql +++ b/htdocs/install/mysql/tables/llx_emailcollector_emailcollector.sql @@ -21,7 +21,8 @@ CREATE TABLE llx_emailcollector_emailcollector( ref varchar(128) NOT NULL, label varchar(255), description text, - host varchar(255), + host varchar(255), + hostcharset varchar(16) DEFAULT 'UTF-8', login varchar(128), password varchar(128), source_directory varchar(255) NOT NULL, diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 1bd7f3d0297..5ce79a12231 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -40,6 +40,7 @@ WebUserGroup=Web server user/group NoSessionFound=Your PHP configuration seems to not allow listing of active sessions. The directory used to save sessions (%s) may be protected (for example by OS permissions or by PHP directive open_basedir). DBStoringCharset=Database charset to store data DBSortingCharset=Database charset to sort data +HostCharset=Host charset ClientCharset=Client charset ClientSortingCharset=Client collation WarningModuleNotActive=Module %s must be enabled From ae0e6e4dc8e449be6c0354d1849bc71f80c35355 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 14 May 2020 14:10:04 +0200 Subject: [PATCH 131/205] FIX dol_concatdesc to escape < Better help --- htdocs/admin/emailcollector_card.php | 4 ++-- htdocs/core/class/translate.class.php | 2 +- htdocs/core/lib/functions.lib.php | 9 +++++---- htdocs/emailcollector/class/emailcollector.class.php | 9 +++++++-- htdocs/langs/en_US/admin.lang | 2 +- 5 files changed, 16 insertions(+), 10 deletions(-) diff --git a/htdocs/admin/emailcollector_card.php b/htdocs/admin/emailcollector_card.php index 74592ff777a..80161eaadc6 100644 --- a/htdocs/admin/emailcollector_card.php +++ b/htdocs/admin/emailcollector_card.php @@ -592,7 +592,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print ''; $htmltext = $langs->transnoentitiesnoconv("OperationParamDesc"); //var_dump($htmltext); - print $form->textwithpicto('', $htmltext); + print $form->textwithpicto('', $htmltext, 1, 'help', '', 0, 2, 'operationparamtt'); print ''; - print ''.img_edit().''; + print ''.img_edit().''; print ' '.img_delete().''; print '
'; @@ -3381,6 +3383,16 @@ if ($action == 'editmeta' || $action == 'createcontainer') print $doleditor->Create(1, '', true, 'HTML Header', 'html'); print '
'; + print $langs->trans('Status'); + print ''; + print ajax_object_onoff($objectpage, 'status', 'status', 'Enabled', 'Disabled'); + //print dol_print_date($pagedatecreation, 'dayhour'); + print '
'; if ($action == 'createcontainer') { From 7daef0d146d1e5145ab44f6a46c52b15a5b525a8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 14 May 2020 18:17:08 +0200 Subject: [PATCH 144/205] Fix bad parameters of function --- htdocs/core/ajax/objectonoff.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/htdocs/core/ajax/objectonoff.php b/htdocs/core/ajax/objectonoff.php index dd39bce6d4e..f7bf1d6299c 100644 --- a/htdocs/core/ajax/objectonoff.php +++ b/htdocs/core/ajax/objectonoff.php @@ -75,5 +75,10 @@ if (($action == 'set') && !empty($id)) { $triggerkey = 'COMPANY_UPDATE'; } - $object->setValueFrom($field, $value, $element, $id, $user, $triggerkey); + $tablename = $element; + if ($tablename == 'websitepage') $tablename = 'website_page'; + + $format = 'int'; + + $object->setValueFrom($field, $value, $tablename, $id, $format, '', $user, $triggerkey); } From d8ee049b4c57491112ecfbbb42e9d3949e0d4468 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 14 May 2020 18:41:31 +0200 Subject: [PATCH 145/205] Can select not defined language --- htdocs/website/class/websitepage.class.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/htdocs/website/class/websitepage.class.php b/htdocs/website/class/websitepage.class.php index c63823f51a1..edf1eed51a7 100644 --- a/htdocs/website/class/websitepage.class.php +++ b/htdocs/website/class/websitepage.class.php @@ -333,10 +333,17 @@ class WebsitePage extends CommonObject $sqlwhere[] = $key.'='.$value; } elseif ($key == 'lang' || $key == 't.lang') { $listoflang = array(); + $foundnull = 0; foreach(explode(',', $value) as $tmpvalue) { + if ($tmpvalue == 'null') { + $foundnull++; + continue; + } $listoflang[] = "'".$this->db->escape(substr(str_replace("'", '', $tmpvalue), 0, 2))."'"; } - $sqlwhere[] = $key." IN (".join(',', $listoflang).")"; + $stringtouse = $key." IN (".join(',', $listoflang).")"; + if ($foundnull) $stringtouse = '('.$stringtouse.' OR '.$key.' IS NULL)'; + $sqlwhere[] = $stringtouse; } else { $sqlwhere[] = $key.' LIKE \'%'.$this->db->escape($value).'%\''; } From 4cf7f68b6cbc3d3b7d2d9c9d0655468690f9214b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 14 May 2020 18:44:05 +0200 Subject: [PATCH 146/205] Fix search on pages --- htdocs/website/class/websitepage.class.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/htdocs/website/class/websitepage.class.php b/htdocs/website/class/websitepage.class.php index c63823f51a1..3e518d4d633 100644 --- a/htdocs/website/class/websitepage.class.php +++ b/htdocs/website/class/websitepage.class.php @@ -329,14 +329,23 @@ class WebsitePage extends CommonObject $sqlwhere = array(); if (count($filter) > 0) { foreach ($filter as $key => $value) { - if ($key == 't.rowid' || $key == 't.fk_website') { + if ($key == 't.rowid' || $key == 't.fk_website' || $key == 'status') { $sqlwhere[] = $key.'='.$value; + } elseif ($key == 'type_container') { + $sqlwhere[] = $key."='".$value."'"; } elseif ($key == 'lang' || $key == 't.lang') { $listoflang = array(); + $foundnull = 0; foreach(explode(',', $value) as $tmpvalue) { + if ($tmpvalue == 'null') { + $foundnull++; + continue; + } $listoflang[] = "'".$this->db->escape(substr(str_replace("'", '', $tmpvalue), 0, 2))."'"; } - $sqlwhere[] = $key." IN (".join(',', $listoflang).")"; + $stringtouse = $key." IN (".join(',', $listoflang).")"; + if ($foundnull) $stringtouse = '('.$stringtouse.' OR '.$key.' IS NULL)'; + $sqlwhere[] = $stringtouse; } else { $sqlwhere[] = $key.' LIKE \'%'.$this->db->escape($value).'%\''; } From 40fa0933ebfe2e128e8282999e126c136f0c2511 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 14 May 2020 18:44:21 +0200 Subject: [PATCH 147/205] Fix on sarch pages --- htdocs/website/class/websitepage.class.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/website/class/websitepage.class.php b/htdocs/website/class/websitepage.class.php index edf1eed51a7..3e518d4d633 100644 --- a/htdocs/website/class/websitepage.class.php +++ b/htdocs/website/class/websitepage.class.php @@ -329,8 +329,10 @@ class WebsitePage extends CommonObject $sqlwhere = array(); if (count($filter) > 0) { foreach ($filter as $key => $value) { - if ($key == 't.rowid' || $key == 't.fk_website') { + if ($key == 't.rowid' || $key == 't.fk_website' || $key == 'status') { $sqlwhere[] = $key.'='.$value; + } elseif ($key == 'type_container') { + $sqlwhere[] = $key."='".$value."'"; } elseif ($key == 'lang' || $key == 't.lang') { $listoflang = array(); $foundnull = 0; From a660fd61c9495f4faa3ca10eda2333d86bd1ca7c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 14 May 2020 18:55:20 +0200 Subject: [PATCH 148/205] Fix lang must be set to null and not 0 when not defined --- htdocs/website/class/websitepage.class.php | 25 +++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/htdocs/website/class/websitepage.class.php b/htdocs/website/class/websitepage.class.php index 3e518d4d633..2a72a222265 100644 --- a/htdocs/website/class/websitepage.class.php +++ b/htdocs/website/class/websitepage.class.php @@ -108,6 +108,29 @@ class WebsitePage extends CommonObject const STATUS_VALIDATED = 1; + /** + * 'type' if the field format ('integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter]]', 'varchar(x)', 'double(24,8)', 'real', 'price', 'text', 'html', 'date', 'datetime', 'timestamp', 'duration', 'mail', 'phone', 'url', 'password') + * Note: Filter can be a string like "(t.ref:like:'SO-%') or (t.date_creation:<:'20160101') or (t.nature:is:NULL)" + * 'label' the translation key. + * 'enabled' is a condition when the field must be managed (Example: 1 or '$conf->global->MY_SETUP_PARAM) + * 'position' is the sort order of field. + * 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0). + * 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create). 5=Visible on list and view only (not create/not update). Using a negative value means field is not shown by default on list but can be selected for viewing) + * 'noteditable' says if field is not editable (1 or 0) + * 'default' is a default value for creation (can still be overwrote by the Setup of Default Values if field is editable in creation form). Note: If default is set to '(PROV)' and field is 'ref', the default value will be set to '(PROVid)' where id is rowid when a new record is created. + * 'index' if we want an index in database. + * 'foreignkey'=>'tablename.field' if the field is a foreign key (it is recommanded to name the field fk_...). + * 'searchall' is 1 if we want to search in this field when making a search from the quick search button. + * 'isameasure' must be set to 1 if you want to have a total on list for this field. Field type must be summable like integer or double(24,8). + * 'css' is the CSS style to use on field. For example: 'maxwidth200' + * 'help' is a string visible as a tooltip on field + * 'showoncombobox' if value of the field must be visible into the label of the combobox that list record + * 'disabled' is 1 if we want to have the field locked by a 'disabled' attribute. In most cases, this is never set into the definition of $fields into class, but is set dynamically by some part of code. + * 'arraykeyval' to set list of value if type is a list of predefined values. For example: array("0"=>"Draft","1"=>"Active","-1"=>"Cancel") + * 'comment' is not used. You can store here any text of your choice. It is not used by application. + * + * Note: To have value dynamic, you can set value to 0 in definition and edit the value on the fly into the constructor. + */ // BEGIN MODULEBUILDER PROPERTIES /** @@ -122,7 +145,7 @@ class WebsitePage extends CommonObject 'description' =>array('type'=>'varchar(255)', 'label'=>'Description', 'enabled'=>1, 'visible'=>1, 'position'=>30, 'searchall'=>1), 'image' =>array('type'=>'varchar(255)', 'label'=>'Image', 'enabled'=>1, 'visible'=>1, 'position'=>32, 'searchall'=>0, 'help'=>'Relative path of media. Used if Type is "blogpost"'), 'keywords' =>array('type'=>'varchar(255)', 'label'=>'Keywords', 'enabled'=>1, 'visible'=>1, 'position'=>45, 'searchall'=>0), - 'lang' =>array('type'=>'varchar(6)', 'label'=>'Lang', 'enabled'=>1, 'visible'=>1, 'position'=>45, 'searchall'=>0), + 'lang' =>array('type'=>'varchar(6)', 'label'=>'Lang', 'enabled'=>1, 'notnull'=>-1, 'visible'=>1, 'position'=>45, 'searchall'=>0), //'status' =>array('type'=>'integer', 'label'=>'Status', 'enabled'=>1, 'visible'=>1, 'index'=>true, 'position'=>1000), 'fk_website' =>array('type'=>'integer', 'label'=>'WebsiteId', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'position'=>40, 'searchall'=>0, 'foreignkey'=>'websitepage.rowid'), 'fk_page' =>array('type'=>'integer', 'label'=>'ParentPageId', 'enabled'=>1, 'visible'=>1, 'notnull'=>-1, 'position'=>45, 'searchall'=>0, 'foreignkey'=>'website.rowid'), From 0842259012f041d7f0ed33dbcf9be5d0fc97ddd3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 14 May 2020 18:55:20 +0200 Subject: [PATCH 149/205] Fix lang must be set to null and not 0 when not defined --- htdocs/website/class/websitepage.class.php | 25 +++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/htdocs/website/class/websitepage.class.php b/htdocs/website/class/websitepage.class.php index 3e518d4d633..2a72a222265 100644 --- a/htdocs/website/class/websitepage.class.php +++ b/htdocs/website/class/websitepage.class.php @@ -108,6 +108,29 @@ class WebsitePage extends CommonObject const STATUS_VALIDATED = 1; + /** + * 'type' if the field format ('integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter]]', 'varchar(x)', 'double(24,8)', 'real', 'price', 'text', 'html', 'date', 'datetime', 'timestamp', 'duration', 'mail', 'phone', 'url', 'password') + * Note: Filter can be a string like "(t.ref:like:'SO-%') or (t.date_creation:<:'20160101') or (t.nature:is:NULL)" + * 'label' the translation key. + * 'enabled' is a condition when the field must be managed (Example: 1 or '$conf->global->MY_SETUP_PARAM) + * 'position' is the sort order of field. + * 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0). + * 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create). 5=Visible on list and view only (not create/not update). Using a negative value means field is not shown by default on list but can be selected for viewing) + * 'noteditable' says if field is not editable (1 or 0) + * 'default' is a default value for creation (can still be overwrote by the Setup of Default Values if field is editable in creation form). Note: If default is set to '(PROV)' and field is 'ref', the default value will be set to '(PROVid)' where id is rowid when a new record is created. + * 'index' if we want an index in database. + * 'foreignkey'=>'tablename.field' if the field is a foreign key (it is recommanded to name the field fk_...). + * 'searchall' is 1 if we want to search in this field when making a search from the quick search button. + * 'isameasure' must be set to 1 if you want to have a total on list for this field. Field type must be summable like integer or double(24,8). + * 'css' is the CSS style to use on field. For example: 'maxwidth200' + * 'help' is a string visible as a tooltip on field + * 'showoncombobox' if value of the field must be visible into the label of the combobox that list record + * 'disabled' is 1 if we want to have the field locked by a 'disabled' attribute. In most cases, this is never set into the definition of $fields into class, but is set dynamically by some part of code. + * 'arraykeyval' to set list of value if type is a list of predefined values. For example: array("0"=>"Draft","1"=>"Active","-1"=>"Cancel") + * 'comment' is not used. You can store here any text of your choice. It is not used by application. + * + * Note: To have value dynamic, you can set value to 0 in definition and edit the value on the fly into the constructor. + */ // BEGIN MODULEBUILDER PROPERTIES /** @@ -122,7 +145,7 @@ class WebsitePage extends CommonObject 'description' =>array('type'=>'varchar(255)', 'label'=>'Description', 'enabled'=>1, 'visible'=>1, 'position'=>30, 'searchall'=>1), 'image' =>array('type'=>'varchar(255)', 'label'=>'Image', 'enabled'=>1, 'visible'=>1, 'position'=>32, 'searchall'=>0, 'help'=>'Relative path of media. Used if Type is "blogpost"'), 'keywords' =>array('type'=>'varchar(255)', 'label'=>'Keywords', 'enabled'=>1, 'visible'=>1, 'position'=>45, 'searchall'=>0), - 'lang' =>array('type'=>'varchar(6)', 'label'=>'Lang', 'enabled'=>1, 'visible'=>1, 'position'=>45, 'searchall'=>0), + 'lang' =>array('type'=>'varchar(6)', 'label'=>'Lang', 'enabled'=>1, 'notnull'=>-1, 'visible'=>1, 'position'=>45, 'searchall'=>0), //'status' =>array('type'=>'integer', 'label'=>'Status', 'enabled'=>1, 'visible'=>1, 'index'=>true, 'position'=>1000), 'fk_website' =>array('type'=>'integer', 'label'=>'WebsiteId', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'position'=>40, 'searchall'=>0, 'foreignkey'=>'websitepage.rowid'), 'fk_page' =>array('type'=>'integer', 'label'=>'ParentPageId', 'enabled'=>1, 'visible'=>1, 'notnull'=>-1, 'position'=>45, 'searchall'=>0, 'foreignkey'=>'website.rowid'), From 3811586cd0654ef0d99c6369177d7b96cf35b50d Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Thu, 14 May 2020 20:34:48 +0200 Subject: [PATCH 150/205] FIX Site ec.europa.eu has moved to https:// --- htdocs/societe/checkvat/checkVatPopup.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/societe/checkvat/checkVatPopup.php b/htdocs/societe/checkvat/checkVatPopup.php index 689df14f3d7..e1f940cfab8 100644 --- a/htdocs/societe/checkvat/checkVatPopup.php +++ b/htdocs/societe/checkvat/checkVatPopup.php @@ -28,9 +28,9 @@ require_once NUSOAP_PATH.'/nusoap.php'; $langs->load("companies"); //http://ec.europa.eu/taxation_customs/vies/checkVatService.wsdl -$WS_DOL_URL='http://ec.europa.eu/taxation_customs/vies/services/checkVatService'; +$WS_DOL_URL='https://ec.europa.eu/taxation_customs/vies/services/checkVatService'; //$WS_DOL_URL_WSDL=$WS_DOL_URL.'?wsdl'; -$WS_DOL_URL_WSDL='http://ec.europa.eu/taxation_customs/vies/checkVatService.wsdl'; +$WS_DOL_URL_WSDL='https://ec.europa.eu/taxation_customs/vies/checkVatService.wsdl'; $WS_METHOD ='checkVat'; From cb98ec4d232b0be9d776e5b50a0745f307f5b016 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Fri, 15 May 2020 01:18:53 +0200 Subject: [PATCH 151/205] Fix datapolicycron --- htdocs/datapolicy/class/datapolicycron.class.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/datapolicy/class/datapolicycron.class.php b/htdocs/datapolicy/class/datapolicycron.class.php index 0d241f75334..81e9d009a56 100644 --- a/htdocs/datapolicy/class/datapolicycron.class.php +++ b/htdocs/datapolicy/class/datapolicycron.class.php @@ -461,7 +461,7 @@ class DataPolicyCron ) ), ); - + $this->db->begin(); foreach ($arrayofparameters as $key => $params) @@ -470,15 +470,15 @@ class DataPolicyCron { $sql = sprintf($params['sql'], (int) $conf->entity, (int) $conf->global->$key, (int) $conf->global->$key); - $resql = $db->query($sql); + $resql = $this->db->query($sql); - if ($resql && $db->num_rows($resql) > 0) + if ($resql && $this->db->num_rows($resql) > 0) { - $num = $db->num_rows($resql); + $num = $this->db->num_rows($resql); $i = 0; require_once $params['file']; - $object = new $params['class']($db); + $object = new $params['class']($this->db); while ($i < $num && ! $error) { From e691045c3d6ef5ad11fd9539fc702ed706229165 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Thu, 14 May 2020 23:20:39 +0000 Subject: [PATCH 152/205] Fixing style errors. --- htdocs/datapolicy/class/datapolicycron.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/datapolicy/class/datapolicycron.class.php b/htdocs/datapolicy/class/datapolicycron.class.php index 81e9d009a56..ac364c78f30 100644 --- a/htdocs/datapolicy/class/datapolicycron.class.php +++ b/htdocs/datapolicy/class/datapolicycron.class.php @@ -461,7 +461,7 @@ class DataPolicyCron ) ), ); - + $this->db->begin(); foreach ($arrayofparameters as $key => $params) From 100bfb921f0cdb97ed919ce858e8804ecc3bd68d Mon Sep 17 00:00:00 2001 From: Langlais115 Date: Fri, 15 May 2020 10:25:56 +0200 Subject: [PATCH 153/205] Fix #13805 Add proper type check to "seuil_stock_alerte" parameter. --- htdocs/product/class/product.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index bb2a1652d8f..7b6892552d1 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -1015,7 +1015,7 @@ class Product extends CommonObject $sql .= ", volume = ".($this->volume != '' ? "'".$this->db->escape($this->volume)."'" : 'null'); $sql .= ", volume_units = ".($this->volume_units != '' ? "'".$this->db->escape($this->volume_units)."'" : 'null'); $sql .= ", fk_default_warehouse = ".($this->fk_default_warehouse > 0 ? $this->db->escape($this->fk_default_warehouse) : 'null'); - $sql .= ", seuil_stock_alerte = ".((isset($this->seuil_stock_alerte) && $this->seuil_stock_alerte != '') ? "'".$this->db->escape($this->seuil_stock_alerte)."'" : "null"); + $sql .= ", seuil_stock_alerte = ".((isset($this->seuil_stock_alerte) && is_numeric($this->seuil_stock_alerte)) ? (int) $this->seuil_stock_alerte : 'null'); $sql .= ", description = '".$this->db->escape($this->description)."'"; $sql .= ", url = ".($this->url ? "'".$this->db->escape($this->url)."'" : 'null'); $sql .= ", customcode = '".$this->db->escape($this->customcode)."'"; From bfca151d8553e7e8fe4487d7cf5d73c8459e520f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 15 May 2020 11:58:50 +0200 Subject: [PATCH 154/205] Responsive --- htdocs/public/demo/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/public/demo/index.php b/htdocs/public/demo/index.php index c470055dbce..cbed76af71f 100644 --- a/htdocs/public/demo/index.php +++ b/htdocs/public/demo/index.php @@ -280,7 +280,7 @@ print ''; print '
'; print '
'; -print '
'.$langs->trans("DemoDesc").'

'; +print '
'.$langs->trans("DemoDesc").'

'; print '
'.$langs->trans("ChooseYourDemoProfil").'
'; print '
'; print '
'; From ad906fc508d3a712ddcd2133299bf0827d16a0b2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 15 May 2020 12:43:48 +0200 Subject: [PATCH 155/205] Fix use SVG logo instead of PNG --- htdocs/cache.manifest | 2 +- htdocs/core/lib/ticket.lib.php | 6 +++--- htdocs/opensurvey/fonctions.php | 2 +- htdocs/public/demo/index.php | 2 +- htdocs/public/members/new.php | 6 +++--- htdocs/public/onlinesign/newonlinesign.php | 2 +- htdocs/public/payment/newpayment.php | 2 +- htdocs/public/payment/paymentko.php | 2 +- htdocs/public/payment/paymentok.php | 2 +- htdocs/theme/dolibarr_logo.png | Bin 9663 -> 14082 bytes htdocs/user/passwordforgotten.php | 8 ++++---- 11 files changed, 17 insertions(+), 17 deletions(-) diff --git a/htdocs/cache.manifest b/htdocs/cache.manifest index ebbf1aab4eb..5e514a32a47 100644 --- a/htdocs/cache.manifest +++ b/htdocs/cache.manifest @@ -8,7 +8,7 @@ CACHE MANIFEST # Files listed under CACHE will be ALWAYS cached after they are loaded. # And they will be always used from Cache after (even after refresh). CACHE: -theme/dolibarr_logo.png +theme/dolibarr_logo.svg support/ support/index.php diff --git a/htdocs/core/lib/ticket.lib.php b/htdocs/core/lib/ticket.lib.php index 0a50eb7407f..1b2a5c1245f 100644 --- a/htdocs/core/lib/ticket.lib.php +++ b/htdocs/core/lib/ticket.lib.php @@ -230,8 +230,8 @@ function llxHeaderTicket($title, $head = "", $disablejs = 0, $disablehead = 0, $ } elseif (!empty($mysoc->logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$mysoc->logo)) { $urllogo = DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/'.$mysoc->logo); $width = 150; - } elseif (is_readable(DOL_DOCUMENT_ROOT.'/theme/dolibarr_logo.png')) { - $urllogo = DOL_URL_ROOT.'/theme/dolibarr_logo.png'; + } elseif (is_readable(DOL_DOCUMENT_ROOT.'/theme/dolibarr_logo.svg')) { + $urllogo = DOL_URL_ROOT.'/theme/dolibarr_logo.svg'; } } } @@ -254,7 +254,7 @@ function llxHeaderTicket($title, $head = "", $disablejs = 0, $disablehead = 0, $ } print ''; if (empty($conf->global->MAIN_HIDE_POWERED_BY)) { - print ''; + print ''; } print ''; } diff --git a/htdocs/opensurvey/fonctions.php b/htdocs/opensurvey/fonctions.php index 30529b49f56..31ec69f3a42 100644 --- a/htdocs/opensurvey/fonctions.php +++ b/htdocs/opensurvey/fonctions.php @@ -121,7 +121,7 @@ function llxHeaderSurvey($title, $head = "", $disablejs = 0, $disablehead = 0, $ print '>'; print ''; if (empty($conf->global->MAIN_HIDE_POWERED_BY)) { - print ''; + print ''; } print ''; } diff --git a/htdocs/public/demo/index.php b/htdocs/public/demo/index.php index cbed76af71f..f0caf948770 100644 --- a/htdocs/public/demo/index.php +++ b/htdocs/public/demo/index.php @@ -274,7 +274,7 @@ print "\n"; print '
'; print '
'; -print ''; +print ''; print '
'; print '
'; diff --git a/htdocs/public/members/new.php b/htdocs/public/members/new.php index 5b456893bf9..7f788a84671 100644 --- a/htdocs/public/members/new.php +++ b/htdocs/public/members/new.php @@ -113,9 +113,9 @@ function llxHeaderVierge($title, $head = "", $disablejs = 0, $disablehead = 0, $ $urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/'.$mysoc->logo); $width = 150; } - elseif (is_readable(DOL_DOCUMENT_ROOT.'/theme/dolibarr_logo.png')) + elseif (is_readable(DOL_DOCUMENT_ROOT.'/theme/dolibarr_logo.svg')) { - $urllogo = DOL_URL_ROOT.'/theme/dolibarr_logo.png'; + $urllogo = DOL_URL_ROOT.'/theme/dolibarr_logo.svg'; $width = 150; } @@ -130,7 +130,7 @@ function llxHeaderVierge($title, $head = "", $disablejs = 0, $disablehead = 0, $ print '>'; print ''; if (empty($conf->global->MAIN_HIDE_POWERED_BY)) { - print ''; + print ''; } print ''; } diff --git a/htdocs/public/onlinesign/newonlinesign.php b/htdocs/public/onlinesign/newonlinesign.php index 83e757b78f8..2378728a8d3 100644 --- a/htdocs/public/onlinesign/newonlinesign.php +++ b/htdocs/public/onlinesign/newonlinesign.php @@ -191,7 +191,7 @@ if ($urllogo) print '>'; print ''; if (empty($conf->global->MAIN_HIDE_POWERED_BY)) { - print ''; + print ''; } print ''; } diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index ddd1943329e..ea7fd71c9e6 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -793,7 +793,7 @@ if ($urllogo) print '>'; print ''; if (empty($conf->global->MAIN_HIDE_POWERED_BY)) { - print ''; + print ''; } print ''; } diff --git a/htdocs/public/payment/paymentko.php b/htdocs/public/payment/paymentko.php index 2610219d69d..a3f6d733fcb 100644 --- a/htdocs/public/payment/paymentko.php +++ b/htdocs/public/payment/paymentko.php @@ -245,7 +245,7 @@ if ($urllogo) print '>'; print ''; if (empty($conf->global->MAIN_HIDE_POWERED_BY)) { - print ''; + print ''; } print ''; } diff --git a/htdocs/public/payment/paymentok.php b/htdocs/public/payment/paymentok.php index 6b7805cf473..b1d6c149a51 100644 --- a/htdocs/public/payment/paymentok.php +++ b/htdocs/public/payment/paymentok.php @@ -181,7 +181,7 @@ if ($urllogo) print '>'; print ''; if (empty($conf->global->MAIN_HIDE_POWERED_BY)) { - print ''; + print ''; } print ''; } diff --git a/htdocs/theme/dolibarr_logo.png b/htdocs/theme/dolibarr_logo.png index 77c2146191034eb2b02c61b2f67c26fcf5d6aa19..c15f03c821baf1e72192ebaee9c73477f5668810 100644 GIT binary patch literal 14082 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 literal 9663 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 BfOh}@ diff --git a/htdocs/user/passwordforgotten.php b/htdocs/user/passwordforgotten.php index b0f3a5aab6c..83289521538 100644 --- a/htdocs/user/passwordforgotten.php +++ b/htdocs/user/passwordforgotten.php @@ -192,13 +192,13 @@ elseif (!empty($mysoc->logo_small) && is_readable($conf->mycompany->dir_output.' $urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/'.$mysoc->logo); $width = 128; } -elseif (is_readable(DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/img/dolibarr_logo.png')) +elseif (is_readable(DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/img/dolibarr_logo.svg')) { - $urllogo = DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/dolibarr_logo.png'; + $urllogo = DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/dolibarr_logo.svg'; } -elseif (is_readable(DOL_DOCUMENT_ROOT.'/theme/dolibarr_logo.png')) +elseif (is_readable(DOL_DOCUMENT_ROOT.'/theme/dolibarr_logo.svg')) { - $urllogo = DOL_URL_ROOT.'/theme/dolibarr_logo.png'; + $urllogo = DOL_URL_ROOT.'/theme/dolibarr_logo.svg'; } // Security graphical code From 8a2741650a6096bdad3f165ce12aa98d54aa051b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 15 May 2020 12:46:55 +0200 Subject: [PATCH 156/205] Fix css --- htdocs/theme/eldy/global.inc.php | 3 +++ htdocs/theme/md/style.css.php | 3 +++ 2 files changed, 6 insertions(+) diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index afb154408c5..a6e9258ea39 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -1362,6 +1362,9 @@ td.showDragHandle { transition: left 0.5s ease; } +.demologo { + width: 200px; +} div.blockvmenulogo { border-bottom: 0 !important; diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index da2df5eb788..38a9ec38fe5 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -2471,6 +2471,9 @@ font.vsmenudisabledmargin { margin: 1px 1px 1px 8px; } a.help:link, a.help:visited, a.help:hover, a.help:active, span.help { text-align: ; font-weight: normal; color: #999; text-decoration: none; } +.demologo { + width: 200px; +} div.blockvmenulogo { border-bottom: 0 !important; From 949ef8d7d89f413cd8b3c72eb5c5f85a9c409e20 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 15 May 2020 12:49:22 +0200 Subject: [PATCH 157/205] Fix css --- htdocs/public/demo/demo.css | 5 ++++- htdocs/theme/eldy/global.inc.php | 3 --- htdocs/theme/md/style.css.php | 3 --- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/htdocs/public/demo/demo.css b/htdocs/public/demo/demo.css index 9328a8ecd1b..b185f8c933f 100644 --- a/htdocs/public/demo/demo.css +++ b/htdocs/public/demo/demo.css @@ -105,8 +105,11 @@ img.demothumb { object-fit: contain; height: 140px; background-position-y: bottom; + background-position-x: right; +} +.demologo { + width: 200px; } - @media only screen and (max-width: 767px) { diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index a6e9258ea39..afb154408c5 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -1362,9 +1362,6 @@ td.showDragHandle { transition: left 0.5s ease; } -.demologo { - width: 200px; -} div.blockvmenulogo { border-bottom: 0 !important; diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 38a9ec38fe5..da2df5eb788 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -2471,9 +2471,6 @@ font.vsmenudisabledmargin { margin: 1px 1px 1px 8px; } a.help:link, a.help:visited, a.help:hover, a.help:active, span.help { text-align: ; font-weight: normal; color: #999; text-decoration: none; } -.demologo { - width: 200px; -} div.blockvmenulogo { border-bottom: 0 !important; From 91f87d6834ad67d11caf7edc7b932993a0999029 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 15 May 2020 13:52:35 +0200 Subject: [PATCH 158/205] Fix bad param of getNomUrl --- htdocs/compta/accounting-files.php | 12 +++---- htdocs/don/class/don.class.php | 22 +++++++++---- htdocs/loan/class/paymentloan.class.php | 42 ++++++++++++++++--------- 3 files changed, 50 insertions(+), 26 deletions(-) diff --git a/htdocs/compta/accounting-files.php b/htdocs/compta/accounting-files.php index f9bc453d999..7d8b819b75c 100644 --- a/htdocs/compta/accounting-files.php +++ b/htdocs/compta/accounting-files.php @@ -672,27 +672,27 @@ if (!empty($date_start) && !empty($date_stop)) } elseif ($data['item'] == 'ExpenseReport') { $expensereport->id = $data['id']; $expensereport->ref = $data['ref']; - print $expensereport->getNomUrl(1, '', 0, 0, '', 0, 0, 0); + print $expensereport->getNomUrl(1, 0, 0, '', 0, 0); } elseif ($data['item'] == 'SalaryPayment') { $salary_payment->id = $data['id']; $salary_payment->ref = $data['ref']; - print $salary_payment->getNomUrl(1, '', 0, 0, '', 0, 0, 0); + print $salary_payment->getNomUrl(1, '', 0, '', 0); } elseif ($data['item'] == 'Donation') { $don->id = $data['id']; $don->ref = $data['ref']; - print $don->getNomUrl(1, '', 0, 0, '', 0, 0, 0); + print $don->getNomUrl(1, 0, '', 0); } elseif ($data['item'] == 'SocialContributions') { $charge_sociales->id = $data['id']; $charge_sociales->ref = $data['ref']; - print $charge_sociales->getNomUrl(1, '', 0, 0, '', 0, 0, 0); + print $charge_sociales->getNomUrl(1, 0, 0, 0, 0); } elseif ($data['item'] == 'VariousPayment') { $various_payment->id = $data['id']; $various_payment->ref = $data['ref']; - print $various_payment->getNomUrl(1, '', 0, 0, '', 0, 0, 0); + print $various_payment->getNomUrl(1, '', 0, 0); } elseif ($data['item'] == 'LoanPayment') { $payment_loan->id = $data['id']; $payment_loan->ref = $data['ref']; - print $payment_loan->getNomUrl(1, '', 0, 0, '', 0, 0, 0); + print $payment_loan->getNomUrl(1, 0, 0, '', 0); } else { print $data['ref']; } diff --git a/htdocs/don/class/don.class.php b/htdocs/don/class/don.class.php index 77dbd177cbd..59c293e6386 100644 --- a/htdocs/don/class/don.class.php +++ b/htdocs/don/class/don.class.php @@ -916,11 +916,13 @@ class Don extends CommonObject /** * Return clicable name (with picto eventually) * - * @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto - * @param int $notooltip 1=Disable tooltip - * @return string Chaine avec URL + * @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto + * @param int $notooltip 1=Disable tooltip + * @param string $moretitle Add more text to title tooltip + * @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking + * @return string Chaine avec URL */ - public function getNomUrl($withpicto = 0, $notooltip = 0) + public function getNomUrl($withpicto = 0, $notooltip = 0, $moretitle = '', $save_lastsearch_value = -1) { global $conf, $langs; @@ -928,10 +930,18 @@ class Don extends CommonObject $result = ''; $label = ''.$langs->trans("Donation").''; - if (!empty($this->id)) + if (!empty($this->id)) { $label .= '
'.$langs->trans('Ref').': '.$this->id; + } + if ($moretitle) $label .= ' - '.$moretitle; - $linkstart = ''; + $url = DOL_URL_ROOT.'/don/card.php?id='.$this->id; + + $add_save_lastsearch_values = ($save_lastsearch_value == 1 ? 1 : 0); + if ($save_lastsearch_value == -1 && preg_match('/list\.php/', $_SERVER["PHP_SELF"])) $add_save_lastsearch_values = 1; + if ($add_save_lastsearch_values) $url .= '&save_lastsearch_values=1'; + + $linkstart = ''; $linkend = ''; $result .= $linkstart; diff --git a/htdocs/loan/class/paymentloan.class.php b/htdocs/loan/class/paymentloan.class.php index 485d48dc443..ce152317710 100644 --- a/htdocs/loan/class/paymentloan.class.php +++ b/htdocs/loan/class/paymentloan.class.php @@ -507,25 +507,39 @@ class PaymentLoan extends CommonObject /** * Return clicable name (with eventually a picto) * - * @param int $withpicto 0=No picto, 1=Include picto into link, 2=No picto - * @param int $maxlen Max length label - * @return string Chaine with URL + * @param int $withpicto 0=No picto, 1=Include picto into link, 2=No picto + * @param int $maxlen Max length label + * @param int $notooltip 1=Disable tooltip + * @param string $moretitle Add more text to title tooltip + * @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking + * @return string String with URL */ - public function getNomUrl($withpicto = 0, $maxlen = 0) + public function getNomUrl($withpicto = 0, $maxlen = 0, $notooltip = 0, $moretitle = '', $save_lastsearch_value = -1) { - global $langs; + global $langs, $conf; + + if (!empty($conf->dol_no_mouse_hover)) $notooltip = 1; // Force disable tooltips $result = ''; - - if (!empty($this->id)) - { - $link = ''; - $linkend = ''; - - if ($withpicto) $result .= ($link.img_object($langs->trans("ShowPayment").': '.$this->ref, 'payment').$linkend.' '); - if ($withpicto && $withpicto != 2) $result .= ' '; - if ($withpicto != 2) $result .= $link.($maxlen ?dol_trunc($this->ref, $maxlen) : $this->ref).$linkend; + $label = ''.$langs->trans("Loan").''; + if (!empty($this->id)) { + $label .= '
'.$langs->trans('Ref').': '.$this->id; } + if ($moretitle) $label .= ' - '.$moretitle; + + $url = DOL_URL_ROOT.'/loan/payment/card.php?id='.$this->id; + + $add_save_lastsearch_values = ($save_lastsearch_value == 1 ? 1 : 0); + if ($save_lastsearch_value == -1 && preg_match('/list\.php/', $_SERVER["PHP_SELF"])) $add_save_lastsearch_values = 1; + if ($add_save_lastsearch_values) $url .= '&save_lastsearch_values=1'; + + $linkstart = ''; + $linkend = ''; + + $result .= $linkstart; + if ($withpicto) $result .= img_object(($notooltip ? '' : $label), $this->picto, ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip ? 0 : 1); + if ($withpicto != 2) $result .= $this->ref; + $result .= $linkend; return $result; } From 02b40ae8f60cfd76c70453d631af0c21618655ab Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 15 May 2020 13:54:05 +0200 Subject: [PATCH 159/205] Fix scrutinizer --- htdocs/core/class/interfaces.class.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/core/class/interfaces.class.php b/htdocs/core/class/interfaces.class.php index 9302ed09afb..4199e51cb68 100644 --- a/htdocs/core/class/interfaces.class.php +++ b/htdocs/core/class/interfaces.class.php @@ -328,6 +328,8 @@ class Interfaces continue; } + $text = ''; + try { $objMod = new $modName($db); From 9699ee7263ec8b591b569251c78d5932dd630da2 Mon Sep 17 00:00:00 2001 From: Scrutinizer Auto-Fixer Date: Fri, 15 May 2020 11:55:31 +0000 Subject: [PATCH 160/205] Scrutinizer Auto-Fixes This commit consists of patches automatically generated for this project on https://scrutinizer-ci.com --- htdocs/accountancy/bookkeeping/balance.php | 16 ++++---- htdocs/compta/accounting-files.php | 12 +++--- htdocs/core/class/interfaces.class.php | 2 +- htdocs/core/lib/date.lib.php | 2 +- htdocs/core/modules/DolibarrModules.class.php | 2 +- .../modules/rapport/pdf_paiement.class.php | 28 +++++++------- .../class/emailcollector.class.php | 2 +- htdocs/takepos/invoice.php | 2 +- htdocs/takepos/phone.php | 38 +++++++++---------- 9 files changed, 52 insertions(+), 52 deletions(-) diff --git a/htdocs/accountancy/bookkeeping/balance.php b/htdocs/accountancy/bookkeeping/balance.php index 85562ebc268..f443fded501 100644 --- a/htdocs/accountancy/bookkeeping/balance.php +++ b/htdocs/accountancy/bookkeeping/balance.php @@ -296,23 +296,23 @@ if ($action != 'export_csv') } print '
' . $langs->trans("SubTotal") . ':' . price($sous_total_debit) . '' . price($sous_total_credit) . '' . price(price2num($sous_total_credit - $sous_total_debit)) . '
'.$langs->trans("SubTotal").':'.price($sous_total_debit).''.price($sous_total_credit).''.price(price2num($sous_total_credit - $sous_total_debit)).'
' . $line->numero_compte . ($root_account_description ? ' - ' . $root_account_description : '') . ''.$line->numero_compte.($root_account_description ? ' - '.$root_account_description : '').'
' . $langs->trans("SubTotal") . ':' . price($sous_total_debit) . '' . price($sous_total_credit) . '' . price(price2num($sous_total_debit - $sous_total_credit)) . '
'.$langs->trans("SubTotal").':'.price($sous_total_debit).''.price($sous_total_credit).''.price(price2num($sous_total_debit - $sous_total_credit)).'
'.$data['paid'].''.price($data['sens']?$data['amount_ht']:-$data['amount_ht'])."'.price($data['sens'] ? $data['amount_ht'] : -$data['amount_ht'])."'.price($data['sens']?$data['amount_ttc']:-$data['amount_ttc'])."'.price($data['sens'] ? $data['amount_ttc'] : -$data['amount_ttc'])."'.price($data['sens']?$data['amount_vat']:-$data['amount_vat'])."'.price($data['sens'] ? $data['amount_vat'] : -$data['amount_vat'])."'.$data['thirdparty_name']."
'.$langs->trans('Total').''.price(price2num($totalET_credit+$totalET_debit, 'MT')).''.price(price2num($totalIT_credit+$totalIT_debit, 'MT')).''.price(price2num($totalVAT_credit+$totalVAT_debit, 'MT')).''.price(price2num($totalET_credit + $totalET_debit, 'MT')).''.price(price2num($totalIT_credit + $totalIT_debit, 'MT')).''.price(price2num($totalVAT_credit + $totalVAT_debit, 'MT')).'
'.$langs->trans("OpportunityProbability").' %'; - print ''; + print ' %'; + print ''; print '
'.$langs->trans("OpportunityAmount").'
'.$langs->trans("Budget").'
'.$langs->trans("OpportunityProbability").' %'; + print ' %'; print ''; print '
'.$langs->trans("OpportunityAmount").'
'.$langs->trans("Budget").'
'; if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { - print 'usage_opportunity ? ' checked="checked"' : '')).'"> '; + print 'usage_opportunity ? ' checked="checked"' : '')).'"> '; $htmltext = $langs->trans("ProjectFollowOpportunity"); print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext); + print ''; print '
'; } if (empty($conf->global->PROJECT_HIDE_TASKS)) @@ -884,8 +897,9 @@ elseif ($object->id > 0) if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { + $classfortr = ($object->usage_opportunity ? '' : ' hideobject'); // Opportunity status - print '
'.$langs->trans("OpportunityStatus").'
'.$langs->trans("OpportunityStatus").''; print $formproject->selectOpportunityStatus('opp_status', $object->opp_status, 1, 0, 0, 0, 'inline-block valignmiddle'); print '
'.$langs->trans("OpportunityProbability").'
'.$langs->trans("OpportunityProbability").' %'; print ''; print '
'.$langs->trans("OpportunityAmount").'
'.$langs->trans("OpportunityAmount").'
'.$langs->trans("SubTotal").':'.price($sous_total_debit).''.price($sous_total_credit).''.price(price2num($sous_total_credit - $sous_total_debit)).'
'.$langs->trans("SubTotal").':'.price($sous_total_debit).''.price($sous_total_credit).''.price(price2num($sous_total_credit - $sous_total_debit)).' 
'.$langs->trans("OpportunityStatus").'
'.$langs->trans("OpportunityStatus").''; print $formproject->selectOpportunityStatus('opp_status', GETPOST('opp_status') ?GETPOST('opp_status') : $object->opp_status); print '
'.$langs->trans("OpportunityProbability").'
'.$langs->trans("OpportunityProbability").' %'; print ''; print '
'.$langs->trans("OpportunityAmount").'
'.$langs->trans("OpportunityAmount").'
'; $filteronlist = ''; if (!empty($conf->global->PROJECT_FILTER_FOR_THIRDPARTY_LIST)) $filteronlist = $conf->global->PROJECT_FILTER_FOR_THIRDPARTY_LIST; - $text = $form->select_company(GETPOST('socid', 'int'), 'socid', $filteronlist, 'SelectThirdParty', 1, 0, array(), 0, 'minwidth300'); + $text = img_picto('', 'company').$form->select_company(GETPOST('socid', 'int'), 'socid', $filteronlist, 'SelectThirdParty', 1, 0, array(), 0, 'minwidth300 widthcentpercentminusx'); if (empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS) && empty($conf->dol_use_jmobile)) { $texthelp = $langs->trans("IfNeedToUseOtherObjectKeepEmpty"); @@ -680,7 +680,7 @@ if ($action == 'create' && $user->rights->projet->creer) print '
'.$langs->trans("Categories").''; $cate_arbo = $form->select_all_categories(Categorie::TYPE_PROJECT, '', 'parent', 64, 0, 1); $arrayselected = GETPOST('categories', 'array'); - print $form->multiselectarray('categories', $cate_arbo, $arrayselected, '', 0, '', 0, '100%'); + print img_picto('', 'category').$form->multiselectarray('categories', $cate_arbo, $arrayselected, '', 0, 'widthcentpercentminusx', 0, 0); print "
'.$form->editfieldkey('Country', 'selectcountry_id', '', $object, 0).''; print img_picto('', 'globe-americas', 'class="paddingrightonly"'); - print $form->select_country((GETPOST('country_id') != '' ?GETPOST('country_id') : $object->country_id)); + print $form->select_country((GETPOST('country_id') != '' ? GETPOST('country_id') : $object->country_id), 'country_id', '', 0, 'minwidth300 widthcentpercentminusx'); if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); print '
'.$form->editfieldkey('Phone', 'phone', '', $object, 0).'
'.$form->editfieldkey('Fax', 'fax', '', $object, 0).'
'.$form->editfieldkey('EMail', 'email', '', $object, 0, 'string', '', $conf->global->SOCIETE_EMAIL_MANDATORY).''.img_picto('', 'object_email').'
'.img_picto('', 'object_email').'
'.$form->editfieldkey('Web', 'url', '', $object, 0).''.img_picto('', 'globe').'
'.img_picto('', 'globe').'
'.$form->editfieldkey('Skype', 'skype', '', $object, 0).''; - // print 'skype).'">'; - // print '
'.$form->editfieldkey('Twitter', 'twitter', '', $object, 0).''; - // print 'twitter).'">'; - // print '
'.$form->editfieldkey('Facebook', 'facebook', '', $object, 0).''; - // print 'facebook).'">'; - // print '
'.$form->editfieldkey('LinkedIn', 'linkedin', '', $object, 0).''; - // print 'linkedin).'">'; - // print '
'.$langs->transcountry("LocalTax1IsUsed", $mysoc->country_code).''; + print '
'.$langs->transcountry("LocalTax1IsUsed", $mysoc->country_code).''; print $form->selectyesno('localtax1assuj_value', (isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX1) ? $conf->global->THIRDPARTY_DEFAULT_USELOCALTAX1 : 0), 1); - print ''.$langs->transcountry("LocalTax2IsUsed", $mysoc->country_code).''; + print '
'.$langs->transcountry("LocalTax2IsUsed", $mysoc->country_code).''; print $form->selectyesno('localtax2assuj_value', (isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX2) ? $conf->global->THIRDPARTY_DEFAULT_USELOCALTAX2 : 0), 1); print '
'.$langs->transcountry("LocalTax1IsUsed", $mysoc->country_code).''; print $form->selectyesno('localtax1assuj_value', (isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX1) ? $conf->global->THIRDPARTY_DEFAULT_USELOCALTAX1 : 0), 1); print '
'.$langs->transcountry("LocalTax2IsUsed", $mysoc->country_code).''; print $form->selectyesno('localtax2assuj_value', (isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX2) ? $conf->global->THIRDPARTY_DEFAULT_USELOCALTAX2 : 0), 1); print '
'; print $formcompany->selectProspectCustomerType($object->client); print '
'.$form->editfieldkey('CustomerCode', 'customer_code', '', $object, 0).''; print ''; - print ''; + print ''; + if ($conf->browser->layout == 'phone') print ''; print ''; + print '
'; @@ -1879,15 +1881,18 @@ else || (!empty($conf->supplier_proposal->enabled) && !empty($user->rights->supplier_proposal->lire))) { print '
'.$form->editfieldkey('Supplier', 'fournisseur', '', $object, 0, 'string', '', 1).''; + print ''.$form->editfieldkey('Supplier', 'fournisseur', '', $object, 0, 'string', '', 1).''; print $form->selectyesno("fournisseur", $object->fournisseur, 1); print '
'; if (!empty($conf->fournisseur->enabled) && !empty($user->rights->fournisseur->lire)) { print $form->editfieldkey('SupplierCode', 'supplier_code', '', $object, 0); } - print ''; + print ''; print ''; + if ($conf->browser->layout == 'phone') print ''; + print ''; @@ -1944,7 +1951,7 @@ else // Country print ''; @@ -1966,15 +1973,16 @@ else // Phone / Fax print ''; - print ''; + print ''; + if ($conf->browser->layout == 'phone') print ''; print ''; - print ''; + print ''; // EMail / Web print ''; - print ''; + print ''; print ''; - print ''; + print ''; if (!empty($conf->socialnetworks->enabled)) { foreach ($socialnetworks as $key => $value) { @@ -1990,36 +1998,9 @@ else } } } - // if (! empty($conf->socialnetworks->enabled)) - // { - // // Skype - // if (! empty($conf->global->SOCIALNETWORKS_SKYPE)) - // { - // print ''; - // print ''; - // } - // // Twitter - // if (! empty($conf->global->SOCIALNETWORKS_TWITTER)) - // { - // print ''; - // print ''; - // } - // // Facebook - // if (! empty($conf->global->SOCIALNETWORKS_FACEBOOK)) - // { - // print ''; - // print ''; - // } - // // LinkedIn - // if (! empty($conf->global->SOCIALNETWORKS_LINKEDIN)) - // { - // print ''; - // print ''; - // } - // } // Prof ids - $i = 1; $j = 0; + $i = 1; $j = 0; $NBCOLS = ($conf->browser->layout == 'phone' ? 1 : 2); while ($i <= 6) { $idprof = $langs->transcountry('ProfId'.$i, $object->country_code); @@ -2027,13 +2008,13 @@ else { $key = 'idprof'.$i; - if (($j % 2) == 0) print ''; + if (($j % $NBCOLS) == 0) print ''; $idprof_mandatory = 'SOCIETE_IDPROF'.($i).'_MANDATORY'; print ''; - if (($j % 2) == 1) print ''; + if (($j % $NBCOLS) == ($NBCOLS - 1)) print ''; $j++; } $i++; @@ -2058,7 +2039,7 @@ else print ''; } print ''; - + if ($conf->browser->layout == 'phone') print ''; print ''; + if ($conf->browser->layout == 'phone') print ''; print '"; } @@ -963,14 +963,14 @@ elseif ($object->id > 0) // Tags-Categories if ($conf->categorie->enabled) { - print '"; } From 9fb1766266877f15742627356a680d8c7babb537 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 15 May 2020 17:14:28 +0200 Subject: [PATCH 173/205] CSS --- htdocs/core/lib/project.lib.php | 4 ++-- htdocs/projet/class/project.class.php | 8 +++++--- htdocs/projet/index.php | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index 940c22a59e0..f3690694b01 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -2226,10 +2226,10 @@ function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks print ''; print ''; - print ''; - print ''; + if ($NBCOLS > 1 && ($j % 2 == 1)) print ''; // Vat is used print ''; @@ -1445,11 +1445,11 @@ else //TODO: Place into a function to control showing by country or study better option if ($mysoc->localtax1_assuj == "1" && $mysoc->localtax2_assuj == "1") { - print ''; + print ''; if ($conf->browser->layout == 'phone') print ''; - print ''; } @@ -2019,7 +2019,7 @@ else } $i++; } - if ($j % 2 == 1) print ''; + if ($NBCOLS > 0 && $j % 2 == 1) print ''; // VAT is used print '
'; if ((!$object->code_fournisseur || $object->code_fournisseur == -1) && $modCodeFournisseur->code_auto) { @@ -1936,7 +1941,9 @@ else // Zip / Town print '
'.$form->editfieldkey('Zip', 'zipcode', '', $object, 0).''; print $formcompany->select_ziptown($object->zip, 'zipcode', array('town', 'selectcountry_id', 'state_id'), 0, 0, '', 'maxwidth50onsmartphone'); - print ''.$form->editfieldkey('Town', 'town', '', $object, 0).''; + print '
'.$form->editfieldkey('Town', 'town', '', $object, 0).''; print $formcompany->select_ziptown($object->town, 'town', array('zipcode', 'selectcountry_id', 'state_id')); print $form->widgetForTranslation("town", $object, $permissiontoadd, 'string', 'alphanohtml', 'maxwidth100 quatrevingtpercent'); print '
'.$form->editfieldkey('Country', 'selectcounty_id', '', $object, 0).''; print img_picto('', 'globe-americas', 'class="paddingrightonly"'); - print $form->select_country((GETPOSTISSET('country_id') ? GETPOST('country_id') : $object->country_id), 'country_id'); + print $form->select_country((GETPOSTISSET('country_id') ? GETPOST('country_id') : $object->country_id), 'country_id', '', 0, 'minwidth300 widthcentpercentminusx'); if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); print '
'.$form->editfieldkey('Phone', 'phone', GETPOST('phone', 'alpha'), $object, 0).''.img_picto('', 'object_phoning').' '.img_picto('', 'object_phoning').'
'.$form->editfieldkey('Fax', 'fax', GETPOST('fax', 'alpha'), $object, 0).''.img_picto('', 'object_phoning_fax').'
'.img_picto('', 'object_phoning_fax').'
'.$form->editfieldkey('EMail', 'email', GETPOST('email', 'alpha'), $object, 0, 'string', '', (!empty($conf->global->SOCIETE_EMAIL_MANDATORY))).''.img_picto('', 'object_email').'
'.img_picto('', 'object_email').'
'.$form->editfieldkey('Web', 'url', GETPOST('url', 'alpha'), $object, 0).''.img_picto('', 'globe').'
'.img_picto('', 'globe').'
'.$form->editfieldkey('Skype', 'skype', '', $object, 0).'
'.$form->editfieldkey('Twitter', 'twitter', '', $object, 0).'
'.$form->editfieldkey('Facebook', 'facebook', '', $object, 0).'
'.$form->editfieldkey('LinkedIn', 'linkedin', '', $object, 0).'
'.$form->editfieldkey($idprof, $key, '', $object, 0, 'string', '', !(empty($conf->global->$idprof_mandatory) || !$object->isACompany())).''; print $formcompany->get_input_id_prof($i, $key, $object->$key, $object->country_code); print '
'.$form->editfieldkey($langs->transcountry("LocalTax2IsUsed", $mysoc->country_code), 'localtax2assuj_value', '', $object, 0).''; print $form->selectyesno('localtax2assuj_value', $object->localtax2_assuj, 1); if (!isOnlyOneLocalTax(2)) @@ -2132,6 +2113,7 @@ else print $form->selectarray("typent_id", $formcompany->typent_array(0), $object->typent_id, 0, 0, 0, '', 0, 0, 0, (empty($conf->global->SOCIETE_SORT_ON_TYPEENT) ? 'ASC' : $conf->global->SOCIETE_SORT_ON_TYPEENT)); if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); print '
'.$form->editfieldkey('Staff', 'effectif_id', '', $object, 0).''; print $form->selectarray("effectif_id", $formcompany->effectif_array(0), $object->effectif_id); if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); From bfbe0037b6147c0611642ce10d00141e26e6f8cb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 15 May 2020 16:29:18 +0200 Subject: [PATCH 172/205] Fix responsive --- htdocs/projet/card.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index e79d5bafa59..c4a1eb9a71d 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -680,7 +680,7 @@ if ($action == 'create' && $user->rights->projet->creer) print '
'.$langs->trans("Categories").''; $cate_arbo = $form->select_all_categories(Categorie::TYPE_PROJECT, '', 'parent', 64, 0, 1); $arrayselected = GETPOST('categories', 'array'); - print img_picto('', 'category').$form->multiselectarray('categories', $cate_arbo, $arrayselected, '', 0, 'widthcentpercentminusx', 0, 0); + print img_picto('', 'category').$form->multiselectarray('categories', $cate_arbo, $arrayselected, '', 0, 'quatrevingtpercent widthcentpercentminusx', 0, 0); print "
'.$langs->trans("Categories").''; + print '
'.$langs->trans("Categories").''; $cate_arbo = $form->select_all_categories(Categorie::TYPE_PROJECT, '', 'parent', 64, 0, 1); $c = new Categorie($db); $cats = $c->containing($object->id, Categorie::TYPE_PROJECT); foreach ($cats as $cat) { $arrayselected[] = $cat->id; } - print $form->multiselectarray('categories', $cate_arbo, $arrayselected, '', 0, '', 0, '100%'); + print img_picto('', 'category').$form->multiselectarray('categories', $cate_arbo, $arrayselected, 0, 0, 'quatrevingtpercent widthcentpercentminusx', 0, '0'); print "
'; - print $projectstatic->getNomUrl(1); + print $projectstatic->getNomUrl(1, '', 0, '', '-', 0 , -1, 'nowraponall'); if (!in_array('projectlabel', $hiddenfields)) print '
'.dol_trunc($objp->title, 24).''; print '
'; + print ''; if ($objp->fk_soc > 0) { $thirdpartystatic->id = $objp->fk_soc; diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index 554bc84766a..417a825a77d 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -1026,18 +1026,19 @@ class Project extends CommonObject } /** - * Return clicable name (with picto eventually) + * Return clickable name (with picto eventually) * * @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto - * @param string $option Variant ('', 'nolink') + * @param string $option Variant where the link point to ('', 'nolink') * @param int $addlabel 0=Default, 1=Add label into string, >1=Add first chars into string * @param string $moreinpopup Text to add into popup * @param string $sep Separator between ref and label if option addlabel is set * @param int $notooltip 1=Disable tooltip * @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking + * @param string $morecss More css on a link * @return string String with URL */ - public function getNomUrl($withpicto = 0, $option = '', $addlabel = 0, $moreinpopup = '', $sep = ' - ', $notooltip = 0, $save_lastsearch_value = -1) + public function getNomUrl($withpicto = 0, $option = '', $addlabel = 0, $moreinpopup = '', $sep = ' - ', $notooltip = 0, $save_lastsearch_value = -1, $morecss = '') { global $conf, $langs, $user, $hookmanager; @@ -1115,6 +1116,7 @@ class Project extends CommonObject if (!$this->public) $picto = 'project'; $linkstart = ''; $linkend = ''; diff --git a/htdocs/projet/index.php b/htdocs/projet/index.php index 3d6903065ab..f9cab81f43c 100644 --- a/htdocs/projet/index.php +++ b/htdocs/projet/index.php @@ -318,7 +318,7 @@ if ($resql) } print '
'; + print ''; if ($obj->socid) { $companystatic->id = $obj->socid; From 4a9960797bc84dd65c74131382ec7eede79a342d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 15 May 2020 17:27:12 +0200 Subject: [PATCH 174/205] responsive --- htdocs/societe/card.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 96a9dd7deed..681d4a37fc9 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -1401,7 +1401,7 @@ else } $i++; } - if ($j % 2 == 1) print '
'.$form->editfieldkey('VATIsUsed', 'assujtva_value', '', $object, 0).'
'.$langs->transcountry("LocalTax1IsUsed", $mysoc->country_code).''; + print '
'.$langs->transcountry("LocalTax1IsUsed", $mysoc->country_code).''; print $form->selectyesno('localtax1assuj_value', (isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX1) ? $conf->global->THIRDPARTY_DEFAULT_USELOCALTAX1 : 0), 1); - print '
'.$langs->transcountry("LocalTax2IsUsed", $mysoc->country_code).''; + print ''.$langs->transcountry("LocalTax2IsUsed", $mysoc->country_code).''; print $form->selectyesno('localtax2assuj_value', (isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX2) ? $conf->global->THIRDPARTY_DEFAULT_USELOCALTAX2 : 0), 1); print '
'.$form->editfieldkey('VATIsUsed', 'assujtva_value', '', $object, 0).''; From 762ca96203f6bd92050ca547a9dbe48c3324f2a3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 15 May 2020 18:28:15 +0200 Subject: [PATCH 175/205] FIX #13841 --- htdocs/admin/dict.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 2ad521f79a2..b7f65ddf91f 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -644,6 +644,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) if ($value == 'localtax2' && empty($_POST['localtax2_type'])) continue; if ($value == 'color' && empty($_POST['color'])) continue; if ($value == 'formula' && empty($_POST['formula'])) continue; + if ($value == 'dayrule' && empty($_POST['dayrule'])) continue; if ($value == 'sortorder') continue; // For a column name 'sortorder', we use the field name 'position' if ((!isset($_POST[$value]) || $_POST[$value] == '') && (!in_array($listfield[$f], array('decalage', 'module', 'accountancy_code', 'accountancy_code_sell', 'accountancy_code_buy', 'tracking')) // Fields that are not mandatory From a73eccf70d937f15bd9ebb4040e766845f177c9f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 15 May 2020 18:41:46 +0200 Subject: [PATCH 176/205] FIX env of browser not loaded in website --- htdocs/core/website.inc.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/htdocs/core/website.inc.php b/htdocs/core/website.inc.php index b5053fcc814..a00de6a3b01 100644 --- a/htdocs/core/website.inc.php +++ b/htdocs/core/website.inc.php @@ -27,6 +27,18 @@ include_once DOL_DOCUMENT_ROOT.'/website/class/website.class.php'; include_once DOL_DOCUMENT_ROOT.'/website/class/websitepage.class.php'; +// Detection browser (copy of code from main.inc.php) +if (isset($_SERVER["HTTP_USER_AGENT"]) && is_object($conf) && empty($conf->browser->name)) +{ + $tmp = getBrowserInfo($_SERVER["HTTP_USER_AGENT"]); + $conf->browser->name = $tmp['browsername']; + $conf->browser->os = $tmp['browseros']; + $conf->browser->version = $tmp['browserversion']; + $conf->browser->layout = $tmp['layout']; // 'classic', 'phone', 'tablet' + //var_dump($conf->browser); + + if ($conf->browser->layout == 'phone') $conf->dol_no_mouse_hover = 1; +} // Define $website if (!is_object($website)) { From ff84fd8118ebe747a9eb07eda0d5dfca19db0cb0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 15 May 2020 19:01:12 +0200 Subject: [PATCH 177/205] Fix default language of user. Must separate weblangs and pagelangs. --- htdocs/core/website.inc.php | 7 ++++++- htdocs/langs/en_US/website.lang | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/htdocs/core/website.inc.php b/htdocs/core/website.inc.php index a00de6a3b01..6456fabf5b3 100644 --- a/htdocs/core/website.inc.php +++ b/htdocs/core/website.inc.php @@ -60,11 +60,16 @@ if (!is_object($weblangs)) { $weblangs = new Translate('', $conf); } +if (!is_object($pagelangs)) +{ + $pagelangs = new Translate('', $conf); +} if ($pageid > 0) { $websitepage->fetch($pageid); - $weblangs->setDefaultLang($websitepage->lang ? $websitepage->lang : 'auto'); + $weblangs->setDefaultLang(empty($_COOKIE['weblangs-shortcode']) ? 'auto' : $_COOKIE['weblangs-shortcode']); + $pagelangs->setDefaultLang($websitepage->lang ? $websitepage->lang : $weblangs->shortlang); if (!defined('USEDOLIBARREDITOR') && in_array($websitepage->type_container, array('menu', 'other'))) { diff --git a/htdocs/langs/en_US/website.lang b/htdocs/langs/en_US/website.lang index f4d88b0d606..2c555b40c20 100644 --- a/htdocs/langs/en_US/website.lang +++ b/htdocs/langs/en_US/website.lang @@ -57,7 +57,7 @@ NoPageYet=No pages yet YouCanCreatePageOrImportTemplate=You can create a new page or import a full website template SyntaxHelp=Help on specific syntax tips YouCanEditHtmlSourceckeditor=You can edit HTML source code using the "Source" button in editor. -YouCanEditHtmlSource=
You can include PHP code into this source using tags <?php ?>. The following global variables are available: $conf, $db, $mysoc, $user, $website, $websitepage, $weblangs.

You can also include content of another Page/Container with the following syntax:
<?php includeContainer('alias_of_container_to_include'); ?>

You can make a redirect to another Page/Container with the following syntax (Note: do not output any content before a redirect):
<?php redirectToContainer('alias_of_container_to_redirect_to'); ?>

To add a link to another page, use the syntax:
<a href="alias_of_page_to_link_to.php">mylink<a>

To include a link to download a file stored into the documents directory, use the document.php wrapper:
Example, for a file into documents/ecm (need to be logged), syntax is:
<a href="/document.php?modulepart=ecm&file=[relative_dir/]filename.ext">
For a file into documents/medias (open directory for public access), syntax is:
<a href="/document.php?modulepart=medias&file=[relative_dir/]filename.ext">
For a file shared with a share link (open access using the sharing hash key of file), syntax is:
<a href="/document.php?hashp=publicsharekeyoffile">

To include an image stored into the documents directory, use the viewimage.php wrapper:
Example, for an image into documents/medias (open directory for public access), syntax is:
<img src="/viewimage.php?modulepart=medias&file=[relative_dir/]filename.ext">

More examples of HTML or dynamic code available on the wiki documentation
. +YouCanEditHtmlSource=
You can include PHP code into this source using tags <?php ?>. The following global variables are available: $conf, $db, $mysoc, $user, $website, $websitepage, $weblangs, $pagelangs.

You can also include content of another Page/Container with the following syntax:
<?php includeContainer('alias_of_container_to_include'); ?>

You can make a redirect to another Page/Container with the following syntax (Note: do not output any content before a redirect):
<?php redirectToContainer('alias_of_container_to_redirect_to'); ?>

To add a link to another page, use the syntax:
<a href="alias_of_page_to_link_to.php">mylink<a>

To include a link to download a file stored into the documents directory, use the document.php wrapper:
Example, for a file into documents/ecm (need to be logged), syntax is:
<a href="/document.php?modulepart=ecm&file=[relative_dir/]filename.ext">
For a file into documents/medias (open directory for public access), syntax is:
<a href="/document.php?modulepart=medias&file=[relative_dir/]filename.ext">
For a file shared with a share link (open access using the sharing hash key of file), syntax is:
<a href="/document.php?hashp=publicsharekeyoffile">

To include an image stored into the documents directory, use the viewimage.php wrapper:
Example, for an image into documents/medias (open directory for public access), syntax is:
<img src="/viewimage.php?modulepart=medias&file=[relative_dir/]filename.ext">

More examples of HTML or dynamic code available on the wiki documentation
. ClonePage=Clone page/container CloneSite=Clone site SiteAdded=Website added From 8b79b7f074335f2cc3ea77a8b936121cd0b93fd6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 15 May 2020 20:00:59 +0200 Subject: [PATCH 178/205] Update changelog --- ChangeLog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index bcbfb1a959c..67cf9513a4a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -78,7 +78,7 @@ FIX: we must export company mail address on contact vcard only if contact email FIX: when we filter a list on a view status, we want this filter to be on bookmark that we create FIX: Wrong Sql on getListOfTowns api method FIX: wrong user right's name to top menu "commercial" -FIX: XSS Vulnerability +FIX: XSS Vulnerability reported by Mehmet Kelepçe / Gais Cyber Security ***** ChangeLog for 11.0.3 compared to 11.0.2 ***** FIX: unit price for selected supplier products not set. NaN was used. From 791c4b48b64feba1da952d1aef43d79a3d3fb199 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 15 May 2020 20:08:35 +0200 Subject: [PATCH 179/205] Fix --- htdocs/projet/card.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index c4a1eb9a71d..6af779a2295 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -580,7 +580,7 @@ if ($action == 'create' && $user->rights->projet->creer) print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext); print '
'; } - if (!empty($conf->global->PROJECT_BILL_TIME_SPENT)) + if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_BILL_TIME_SPENT)) { print ' '; $htmltext = $langs->trans("ProjectBillTimeDescription"); @@ -871,7 +871,7 @@ elseif ($object->id > 0) print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext); print '
'; } - if (!empty($conf->global->PROJECT_BILL_TIME_SPENT)) + if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_BILL_TIME_SPENT)) { print 'usage_bill_time ? ' checked="checked"' : '')).'"> '; $htmltext = $langs->trans("ProjectBillTimeDescription"); From 24f4a0be1fc420e0f09090b6e1485a895143228b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 16 May 2020 04:24:23 +0200 Subject: [PATCH 180/205] exclude other log files --- htdocs/admin/tools/export_files.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/tools/export_files.php b/htdocs/admin/tools/export_files.php index d9a010019a5..89abae78117 100644 --- a/htdocs/admin/tools/export_files.php +++ b/htdocs/admin/tools/export_files.php @@ -135,7 +135,7 @@ elseif (in_array($compression, array('gz', 'bz'))) $file .= '.tar'; // We also exclude '/temp/' dir and 'documents/admin/documents' - $cmd = "tar -cf ".$outputdir."/".$file." --exclude-vcs --exclude 'temp' --exclude 'dolibarr.log' --exclude='documents/admin/documents' -C ".dirname(DOL_DATA_ROOT)." ".basename(DOL_DATA_ROOT); + $cmd = "tar -cf ".$outputdir."/".$file." --exclude-vcs --exclude 'temp' --exclude 'dolibarr.log' --exclude 'dolibarr_*.log' --exclude='documents/admin/documents' -C ".dirname(DOL_DATA_ROOT)." ".basename(DOL_DATA_ROOT); $result = $utils->executeCLI($cmd, $outputfile); From 75ac3773523fc6cd4f2c6c5ef729a14259ede352 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 16 May 2020 04:26:43 +0200 Subject: [PATCH 181/205] Fix tar command --- htdocs/admin/tools/export_files.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/tools/export_files.php b/htdocs/admin/tools/export_files.php index 89abae78117..de10759c92d 100644 --- a/htdocs/admin/tools/export_files.php +++ b/htdocs/admin/tools/export_files.php @@ -135,7 +135,7 @@ elseif (in_array($compression, array('gz', 'bz'))) $file .= '.tar'; // We also exclude '/temp/' dir and 'documents/admin/documents' - $cmd = "tar -cf ".$outputdir."/".$file." --exclude-vcs --exclude 'temp' --exclude 'dolibarr.log' --exclude 'dolibarr_*.log' --exclude='documents/admin/documents' -C ".dirname(DOL_DATA_ROOT)." ".basename(DOL_DATA_ROOT); + $cmd = "tar -cf ".$outputdir."/".$file." --exclude-vcs --exclude 'temp' --exclude 'dolibarr.log' --exclude 'dolibarr_*.log' --exclude 'documents/admin/documents' -C ".dirname(DOL_DATA_ROOT)." ".basename(DOL_DATA_ROOT); $result = $utils->executeCLI($cmd, $outputfile); From 0781e9e227443a7b31a376335517b1c99921fee3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 16 May 2020 14:47:12 +0200 Subject: [PATCH 182/205] CSS --- htdocs/theme/eldy/info-box.inc.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/htdocs/theme/eldy/info-box.inc.php b/htdocs/theme/eldy/info-box.inc.php index 3d9c392f32b..ca849c58f4b 100644 --- a/htdocs/theme/eldy/info-box.inc.php +++ b/htdocs/theme/eldy/info-box.inc.php @@ -76,6 +76,9 @@ if (!defined('ISLOADEDBYSTEELSHEET')) die('Must be call by steelsheet'); ?> font-size: 25px; line-height: 100px; } +.opened-dash-board-wrap .info-box-sm .info-box-icon { + line-height: 80px; +} .info-box-module .info-box-icon { height: 106px; } @@ -200,6 +203,7 @@ if (!empty($conf->global->THEME_INFOBOX_COLOR_ON_BACKGROUND)) $prefix = 'backgro if (!isset($conf->global->THEME_AGRESSIVENESS_RATIO) && $prefix) $conf->global->THEME_AGRESSIVENESS_RATIO = -50; if (GETPOSTISSET('THEME_AGRESSIVENESS_RATIO')) $conf->global->THEME_AGRESSIVENESS_RATIO = GETPOST('THEME_AGRESSIVENESS_RATIO', 'int'); //var_dump($conf->global->THEME_AGRESSIVENESS_RATIO); + ?> .info-box-icon { From c85233e779099d637c18b3db4d9ba347360750ae Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 16 May 2020 15:12:28 +0200 Subject: [PATCH 183/205] Fix CSS --- htdocs/theme/eldy/info-box.inc.php | 3 +- htdocs/theme/md/info-box.inc.php | 109 +++++++++++++++++++++++++++-- 2 files changed, 104 insertions(+), 8 deletions(-) diff --git a/htdocs/theme/eldy/info-box.inc.php b/htdocs/theme/eldy/info-box.inc.php index ca849c58f4b..98130f1d03a 100644 --- a/htdocs/theme/eldy/info-box.inc.php +++ b/htdocs/theme/eldy/info-box.inc.php @@ -80,7 +80,7 @@ if (!defined('ISLOADEDBYSTEELSHEET')) die('Must be call by steelsheet'); ?> line-height: 80px; } .info-box-module .info-box-icon { - height: 106px; + height: 107px; } .info-box-icon > img { max-width: 100%; @@ -175,6 +175,7 @@ if (!defined('ISLOADEDBYSTEELSHEET')) die('Must be call by steelsheet'); ?> .info-box-title{ text-transform: uppercase; font-weight: bold; + padding-bottom: 4px; } .info-box-text{ font-size: 0.92em; diff --git a/htdocs/theme/md/info-box.inc.php b/htdocs/theme/md/info-box.inc.php index d866cab96a6..a382173bfde 100644 --- a/htdocs/theme/md/info-box.inc.php +++ b/htdocs/theme/md/info-box.inc.php @@ -8,21 +8,25 @@ if (!defined('ISLOADEDBYSTEELSHEET')) die('Must be call by steelsheet'); ?> */ .info-box-module-external span.info-box-icon-version { - background: #999; -} - -span.info-box-icon-text { /* hide box text number due to problems */ - display: none; + background: #bbb; } .info-box { display: block; + position: relative; min-height: 90px; background: #fff; width: 100%; + /* box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1); */ + border-radius: 2px; margin-bottom: 15px; border: 1px solid #ddd; } +.info-box.info-box-sm{ + min-height: 80px; + margin-bottom: 10px; +} + .info-box small { font-size: 14px; } @@ -53,14 +57,26 @@ span.info-box-icon-text { /* hide box text number due to problems */ } .info-box-icon { display: block; + overflow: hidden; float: left; - height: 90px; + /* height: 90px; */ width: 90px; text-align: center; font-size: 45px; line-height: 90px; background: #eee; } +.info-box-sm .info-box-icon { + width: 80px; + font-size: 25px; + line-height: 100px; +} +.opened-dash-board-wrap .info-box-sm .info-box-icon { + line-height: 80px; +} +.info-box-module .info-box-icon { + height: 108px; +} .info-box-icon > img { max-width: 100%; } @@ -71,6 +87,74 @@ span.info-box-icon-text { /* hide box text number due to problems */ padding: 5px 10px; margin-left: 90px; } + +.info-box-icon-text{ + box-sizing: border-box; + display: block; + position: absolute; + width: 90px; + bottom: 0px; + color: #ffffff; + background-color: rgba(0,0,0,0.1); + cursor: default; + + font-size: 10px; + line-height: 15px; + padding: 0px 3px; + text-align: center; + opacity: 0; + -webkit-transition: opacity 0.5s, visibility 0s 0.5s; + transition: opacity 0.5s, visibility 0s 0.5s; +} + +.info-box-icon-version { + box-sizing: border-box; + display: block; + position: absolute; + width: 90px; + bottom: 0px; + color: #ffffff; + background-color: rgba(0,0,0,0.1); + cursor: default; + + font-size: 10px; + line-height: 22px; + padding: 0px 3px; + text-align: center; + opacity: 1; + -webkit-transition: opacity 0.5s, visibility 0s 0.5s; + transition: opacity 0.5s, visibility 0s 0.5s; +} + +.box-flex-item.info-box-module.info-box-module-disabled { + /* opacity: 0.6; */ +} + +.info-box-actions { + position: absolute; + right: 0; + bottom: 0; +} + +global->MAIN_DISABLE_GLOBAL_BOXSTATS) && !empty($conf->global->MAIN_INCLUDE_GLOBAL_STATS_IN_OPENED_DASHBOARD)) { ?> +.info-box-icon-text{ + opacity: 1; +} + + +.info-box-sm .info-box-icon-text, .info-box-sm .info-box-icon-version{ + overflow: hidden; + width: 80px; +} +.info-box:hover .info-box-icon-text{ + opacity: 1; +} + +.info-box-content { + padding: 5px 10px; + margin-left: 90px; +} + .info-box-number { display: block; font-weight: bold; @@ -88,6 +172,7 @@ span.info-box-icon-text { /* hide box text number due to problems */ .info-box-title{ text-transform: uppercase; font-weight: bold; + padding-bottom: 5px; } .info-box-text{ font-size: 12px; @@ -152,7 +237,7 @@ if (GETPOSTISSET('THEME_AGRESSIVENESS_RATIO')) $conf->global->THEME_AGRESSIVENES } .fa-dol-propal:before, .fa-dol-supplier_proposal:before { - content: "\f2b5"; + content: "\f573"; } .fa-dol-facture:before, .fa-dol-invoice_supplier:before { @@ -168,6 +253,9 @@ if (GETPOSTISSET('THEME_AGRESSIVENESS_RATIO')) $conf->global->THEME_AGRESSIVENES .fa-dol-contrat:before { content: "\f1e6"; } +.fa-dol-ticket:before { + content: "\f3ff"; +} .fa-dol-bank_account:before { content: "\f19c"; } @@ -261,3 +349,10 @@ if (GETPOSTISSET('THEME_AGRESSIVENESS_RATIO')) $conf->global->THEME_AGRESSIVENES height: 0; } +.info-box-module { + min-width: 350px; + max-width: 350px; +} +.info-box-module .info-box-content { + height: 7em; +} From bd4251237b8f72de09541c7dd9abecf7e37c7596 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 16 May 2020 15:16:40 +0200 Subject: [PATCH 184/205] css --- htdocs/theme/eldy/global.inc.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 3e213c3d8e2..c4f223ebf1f 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -1624,6 +1624,13 @@ td.nobordernopadding.widthpictotitle.col-picto { width: unset; color: #999; } + +span.widthpictotitle.pictotitle { +/* background: var(--colortexttitlenotab); + color: #fff; + padding: 10px; + border-radius: 2px;*/ +} .pictotitle { margin-: 8px; /* margin-bottom: 4px; */ From ce0d00a0ae89dd014d9bd95cac70ec660e7a2a25 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 16 May 2020 15:50:46 +0200 Subject: [PATCH 185/205] CSS --- htdocs/theme/md/info-box.inc.php | 45 +++++++++++++++++++++++++++++--- htdocs/theme/md/style.css.php | 4 +-- 2 files changed, 43 insertions(+), 6 deletions(-) diff --git a/htdocs/theme/md/info-box.inc.php b/htdocs/theme/md/info-box.inc.php index a382173bfde..2dec0087a1b 100644 --- a/htdocs/theme/md/info-box.inc.php +++ b/htdocs/theme/md/info-box.inc.php @@ -2,10 +2,47 @@ if (!defined('ISLOADEDBYSTEELSHEET')) die('Must be call by steelsheet'); ?> /*