From 53fd8328bcc6520b75412c093689d421a3249274 Mon Sep 17 00:00:00 2001 From: BENKE Charlene <1179011+defrance@users.noreply.github.com> Date: Sat, 9 Nov 2019 15:20:36 +0100 Subject: [PATCH 01/99] add certificate if present on document folder --- .../core/modules/facture/doc/pdf_crabe.modules.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index 8ee898b5a4e..986b0de2b88 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -357,6 +357,20 @@ class pdf_crabe extends ModelePDFFactures $pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("PdfInvoiceTitle")." ".$outputlangs->convToOutputCharset($object->thirdparty->name)); if (! empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) $pdf->SetCompression(false); + $cert=file_get_contents(DOL_DATA_ROOT."/users/".$user->id."/certificates/signature.crt"); + // si l'utilisateur n'a pas de certificat, on prend le certificat + if (!$cert) + $cert=file_get_contents(DOL_DATA_ROOT."/mycompany/certificates/signature.crt"); + if ($cert) { + $info = array( + 'Name' => $this->emetteur->name, + 'Location' => getCountry($this->emetteur->country_code, 0), + 'Reason' => 'FACTURE', + 'ContactInfo' => $this->emetteur->email + ); + $pdf->setSignature($cert, $cert, $this->emetteur->name, '', 2, $info); + } + $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right // Set $this->atleastonediscount if you have at least one discount From 4ac978303b0ea16aab239305e824fef9b9fbd9c1 Mon Sep 17 00:00:00 2001 From: andreubisquerra Date: Fri, 10 Apr 2020 08:36:16 +0200 Subject: [PATCH 02/99] FIX TakePOS buying price --- htdocs/takepos/invoice.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index f684d18741d..402516d2eaf 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -281,7 +281,7 @@ if ($action == "addline") $localtax1_tx = get_localtax($tva_tx, 1, $customer, $mysoc, $tva_npr); $localtax2_tx = get_localtax($tva_tx, 2, $customer, $mysoc, $tva_npr); - $idoflineadded = $invoice->addline($prod->description, $price, 1, $tva_tx, $localtax1_tx, $localtax2_tx, $idproduct, $customer->remise_percent, '', 0, 0, 0, '', $price_base_type, $price_ttc, $prod->type, -1, 0, '', 0, 0, null, 0, '', 0, 100, '', null, 0); + $idoflineadded = $invoice->addline($prod->description, $price, 1, $tva_tx, $localtax1_tx, $localtax2_tx, $idproduct, $customer->remise_percent, '', 0, 0, 0, '', $price_base_type, $price_ttc, $prod->type, -1, 0, '', 0, 0, null, '', '', 0, 100, '', null, 0); $invoice->fetch($placeid); } @@ -295,7 +295,7 @@ if ($action == "freezone") { $localtax1_tx = get_localtax($tva_tx, 1, $customer, $mysoc, $tva_npr); $localtax2_tx = get_localtax($tva_tx, 2, $customer, $mysoc, $tva_npr); - $invoice->addline($desc, $number, 1, $tva_tx, $localtax1_tx, $localtax2_tx, 0, 0, '', 0, 0, 0, '', 'TTC', $number, 0, -1, 0, '', 0, 0, null, 0, '', 0, 100, '', null, 0); + $invoice->addline($desc, $number, 1, $tva_tx, $localtax1_tx, $localtax2_tx, 0, 0, '', 0, 0, 0, '', 'TTC', $number, 0, -1, 0, '', 0, 0, null, '', '', 0, 100, '', null, 0); $invoice->fetch($placeid); } From 28fa0e4e5d26f1c43ac0dd5aef8bbbb79a2c1942 Mon Sep 17 00:00:00 2001 From: atm-quentin Date: Fri, 10 Apr 2020 11:49:20 +0200 Subject: [PATCH 03/99] FIX missing selectedlines on supplier order but checkbox are displayed --- htdocs/fourn/commande/card.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 981279db9dc..00843a07118 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -1086,7 +1086,7 @@ if (empty($reshook)) if ($action == 'add' && $user->rights->fournisseur->commande->creer) { $error = 0; - + $selectedLines = GETPOST('toselect', 'array'); if ($socid < 1) { setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentities('Supplier')), null, 'errors'); @@ -1178,6 +1178,7 @@ if (empty($reshook)) for ($i = 0; $i < $num; $i++) { + if (!in_array($lines[$i]->id, $selectedLines)) continue; if (empty($lines[$i]->subprice) || $lines[$i]->qty <= 0) continue; @@ -1756,7 +1757,7 @@ if ($action == 'create') print ''; print ''; - print "\n"; + // Show origin lines if (!empty($origin) && !empty($originid) && is_object($objectsrc)) @@ -1766,10 +1767,11 @@ if ($action == 'create') print ''; - $objectsrc->printOriginLinesList(); + $objectsrc->printOriginLinesList('', $selectedLines); print '
'; } + print "\n"; } elseif (!empty($object->id)) { From 83f3c9ab6e61f25cf9922d7194993b6bcf061456 Mon Sep 17 00:00:00 2001 From: atm-quentin Date: Fri, 10 Apr 2020 12:09:18 +0200 Subject: [PATCH 04/99] use only 1 if --- htdocs/fourn/commande/card.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 00843a07118..43964b38431 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -1178,8 +1178,7 @@ if (empty($reshook)) for ($i = 0; $i < $num; $i++) { - if (!in_array($lines[$i]->id, $selectedLines)) continue; - if (empty($lines[$i]->subprice) || $lines[$i]->qty <= 0) + if (empty($lines[$i]->subprice) || $lines[$i]->qty <= 0 || !in_array($lines[$i]->id, $selectedLines)) continue; $label = (!empty($lines[$i]->label) ? $lines[$i]->label : ''); From 1f471d46eb6445d3a736773e019716523b14a9cc Mon Sep 17 00:00:00 2001 From: gauthier Date: Fri, 10 Apr 2020 15:51:51 +0200 Subject: [PATCH 05/99] FIX : some others modules (like subtotal) use other product_type than 0 or 1 AND must not be considered in this report --- htdocs/compta/stats/cabyprodserv.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/compta/stats/cabyprodserv.php b/htdocs/compta/stats/cabyprodserv.php index 786521c0511..f9057e1066c 100644 --- a/htdocs/compta/stats/cabyprodserv.php +++ b/htdocs/compta/stats/cabyprodserv.php @@ -243,6 +243,7 @@ if ($modecompta == 'CREANCES-DETTES') } $sql.= " WHERE l.fk_facture = f.rowid"; $sql.= " AND f.fk_statut in (1,2)"; + $sql.= " AND l.product_type in (0,1)"; if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { $sql.= " AND f.type IN (0,1,2,5)"; } else { From 63d41fa3564bd4f73f807dbe6cdc42903e54ec57 Mon Sep 17 00:00:00 2001 From: philazerty Date: Fri, 10 Apr 2020 16:48:18 +0200 Subject: [PATCH 06/99] Update list.php Bug #13519 --- 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 edb89257e3e..1a18954994f 100644 --- a/htdocs/public/ticket/list.php +++ b/htdocs/public/ticket/list.php @@ -215,7 +215,7 @@ if ($action == "view_ticketlist") 't.date_close' => array('label' => $langs->trans("TicketCloseOn"), 'checked' => 0), 't.ref' => array('label' => $langs->trans("Ref"), 'checked' => 1), //'t.track_id' => array('label' => $langs->trans("IDTracking"), 'checked' => 0), - 't.fk_statut' => array('label' => $langs->trans("Statut"), 'checked' => 1), + 't.fk_statut' => array('label' => $langs->trans("Status"), 'checked' => 1), 't.subject' => array('label' => $langs->trans("Subject"), 'checked' => 1), 'type.code' => array('label' => $langs->trans("Type"), 'checked' => 1), 'category.code' => array('label' => $langs->trans("Category"), 'checked' => 1), From 450b1761b125a641e2ed0fe7f367aa52403238dd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 11 Apr 2020 01:09:26 +0200 Subject: [PATCH 07/99] Fix label --- htdocs/langs/en_US/products.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/products.lang b/htdocs/langs/en_US/products.lang index 6f3994572c6..14fa17480d9 100644 --- a/htdocs/langs/en_US/products.lang +++ b/htdocs/langs/en_US/products.lang @@ -165,7 +165,7 @@ SuppliersPrices=Vendor prices SuppliersPricesOfProductsOrServices=Vendor prices (of products or services) CustomCode=Customs / Commodity / HS code CountryOrigin=Origin country -Nature=Nature of produt (material/finished) +Nature=Nature of product (material/finished) ShortLabel=Short label Unit=Unit p=u. From 9573f1289a17553f5a33f6164c3394d9da9edb0f Mon Sep 17 00:00:00 2001 From: simicar29 Date: Sat, 11 Apr 2020 13:42:37 +0200 Subject: [PATCH 08/99] FIX #7594 This is a temptative fix of the bad "multi page break" in expense report --- .../doc/pdf_standard.modules.php | 38 ++++++++++++++++--- 1 file changed, 33 insertions(+), 5 deletions(-) diff --git a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php index 631c9ab4251..7bef90f514e 100644 --- a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php @@ -6,6 +6,7 @@ * Copyright (C) 2018 Francis Appels * Copyright (C) 2019 Markus Welters * Copyright (C) 2019 Rafael Ingenleuf + * Copyright (C) 2020 Marc Guenneugues * * 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 @@ -350,13 +351,18 @@ class pdf_standard extends ModeleExpenseReport $initialY = $tab_top + 7; $nexY = $tab_top + 7; + $showpricebeforepagebreak = 1; + $pdf->setTopMargin($tab_top_newpage); // Loop on each lines - for ($i = 0 ; $i < $nblines ; $i++) { + $i = 0; + while ($i < $nblines) { $pdf->SetFont('', '', $default_font_size - 2); // Into loop to work with multipage $pdf->SetTextColor(0, 0, 0); - - $pdf->setTopMargin($tab_top_newpage); - $pdf->setPageOrientation('', 1, $heightforfooter+$heightforfreetext+$heightforinfotot); // The only function to edit the bottom margin of current page to set it. + if (empty($showpricebeforepagebreak)) { + $pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it. + } else { + $pdf->setPageOrientation('', 1, $heightforfooter + $heightforfreetext + $heightforinfotot); // The only function to edit the bottom margin of current page to set it. + } $pageposbefore = $pdf->getPage(); $curY = $nexY; $pdf->startTransaction(); @@ -367,7 +373,27 @@ class pdf_standard extends ModeleExpenseReport $pdf->rollbackTransaction(true); $pageposafter = $pageposbefore; //print $pageposafter.'-'.$pageposbefore;exit; - $pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it. + if (empty($showpricebeforepagebreak)) { + $pdf->AddPage('', '', true); + if (!empty($tplidx)) { + $pdf->useTemplate($tplidx); + } + if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) { + $this->_pagehead($pdf, $object, 0, $outputlangs); + } + $pdf->setPage($pageposafter + 1); + $showpricebeforepagebreak = 1; + $nexY = $tab_top_newpage; + $nexY += ($pdf->getFontSize() * 1.3); // Passe espace entre les lignes + $pdf->SetFont('', '', $default_font_size - 2); // Into loop to work with multipage + $pdf->SetTextColor(0, 0, 0); + + $pdf->setTopMargin($tab_top_newpage); + continue; + } else { + $pdf->setPageOrientation('', 1, $heightforfooter); + $showpricebeforepagebreak = 0; + } $this->printLine($pdf, $object, $i, $curY, $default_font_size, $outputlangs, $hidedetails); $pageposafter = $pdf->getPage(); $posyafter = $pdf->GetY(); @@ -397,6 +423,7 @@ class pdf_standard extends ModeleExpenseReport { $pdf->commitTransaction(); } + $i++; //nexY $nexY = $pdf->GetY(); $pageposafter = $pdf->getPage(); @@ -426,6 +453,7 @@ class pdf_standard extends ModeleExpenseReport while ($pagenb < $pageposafter) { $pdf->setPage($pagenb); + $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. if ($pagenb == 1) { $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1); From 9270e2c614d11d61c74961e351eae86eb1a54222 Mon Sep 17 00:00:00 2001 From: andreubisquerra Date: Sat, 11 Apr 2020 16:31:08 +0200 Subject: [PATCH 09/99] 4 rows of actions buttons in TakePOS --- htdocs/takepos/index.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/takepos/index.php b/htdocs/takepos/index.php index 4f5ef29bc70..04281bbd61b 100644 --- a/htdocs/takepos/index.php +++ b/htdocs/takepos/index.php @@ -648,14 +648,14 @@ function MoreActions(totalactions){ if (pageactions==0){ pageactions=1; for (i = 0; i <= totalactions; i++){ - if (i<9) $("#action"+i).hide(); + if (i<12) $("#action"+i).hide(); else $("#action"+i).show(); } } else if (pageactions==1){ pageactions=0; for (i = 0; i <= totalactions; i++){ - if (i<9) $("#action"+i).show(); + if (i<12) $("#action"+i).show(); else $("#action"+i).hide(); } } @@ -935,12 +935,12 @@ if (!empty($conf->global->TAKEPOS_HIDE_HEAD_BAR)) { foreach ($menus as $menu) { $i++; - if (count($menus) > 9 and $i == 9) + if (count($menus) > 12 and $i == 12) { echo ''; echo ''; } - elseif ($i > 9) echo ''; + elseif ($i > 12) echo ''; else echo ''; } From d842a436ae7f2a870cccbb4bae364db21449d284 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Sat, 11 Apr 2020 17:06:50 +0200 Subject: [PATCH 10/99] New display of user bank account : same way as on thirdparty --- htdocs/societe/paymentmodes.php | 2 +- htdocs/user/bank.php | 200 ++++++++++++++++---------------- 2 files changed, 98 insertions(+), 104 deletions(-) diff --git a/htdocs/societe/paymentmodes.php b/htdocs/societe/paymentmodes.php index c9fe7c41001..d440930bbf5 100644 --- a/htdocs/societe/paymentmodes.php +++ b/htdocs/societe/paymentmodes.php @@ -1385,7 +1385,7 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard' $morehtmlright = dolGetButtonTitle($langs->trans('Add'), '', 'fa fa-plus-circle', $_SERVER["PHP_SELF"].'?socid='.$object->id.'&action=create'); - print load_fiche_titre($langs->trans("BankAccounts"), $morehtmlright, ''); + print load_fiche_titre($langs->trans("BankAccounts"), $morehtmlright, 'bank'); $rib_list = $object->get_all_rib(); if (is_array($rib_list)) diff --git a/htdocs/user/bank.php b/htdocs/user/bank.php index af70ce966d2..c0ad414290b 100644 --- a/htdocs/user/bank.php +++ b/htdocs/user/bank.php @@ -67,6 +67,17 @@ if ($id > 0 || !empty($ref)) $object->getrights(); } +$account = new UserBankAccount($db); +if (!$bankid) +{ + $account->fetch(0, '', $id); +} +else +{ + $account->fetch($bankid); +} +if (empty($account->userid)) $account->userid = $object->id; + /* * Actions @@ -74,9 +85,6 @@ if ($id > 0 || !empty($ref)) if ($action == 'add' && !$cancel) { - // Modification - $account = new UserBankAccount($db); - $account->userid = $object->id; $account->bank = GETPOST('bank', 'alpha'); @@ -108,11 +116,6 @@ if ($action == 'add' && !$cancel) if ($action == 'update' && !$cancel) { - // Modification - $account = new UserBankAccount($db); - - $account->fetch($bankid); - $account->userid = $object->id; $account->bank = GETPOST('bank', 'alpha'); @@ -153,18 +156,6 @@ llxHeader(null, $langs->trans("BankAccounts")); $head = user_prepare_head($object); -$account = new UserBankAccount($db); -if (!$bankid) -{ - $account->fetch(0, '', $id); -} -else -{ - $account->fetch($bankid); -} -if (empty($account->userid)) $account->userid = $object->id; - - if ($id && $bankid && $action == 'edit' && $user->rights->user->user->creer) { print '
'; @@ -208,78 +199,6 @@ if ($action != 'edit' && $action != 'create') // If not bank account yet, $acco print ''; - print '
'; - - print load_fiche_titre($langs->trans("BAN")); - - print '
'; - print ''; - - print ''; - print ''; - - print ''; - print ''; - - // Show fields of bank account - foreach ($account->getFieldsToShow() as $val) { - if ($val == 'BankCode') { - $content = $account->code_banque; - } elseif ($val == 'DeskCode') { - $content = $account->code_guichet; - } elseif ($val == 'BankAccountNumber') { - $content = $account->number; - } elseif ($val == 'BankAccountNumberKey') { - $content = $account->cle_rib; - } - - print ''; - print ''; - print ''; - } - - print ''; - print ''; - - print ''; - print ''; - - print '\n"; - - print '\n"; - - print '\n"; - - print '
'.$langs->trans("LabelRIB").''.$account->label.'
'.$langs->trans("BankName").''.$account->bank.'
'.$langs->trans($val).''.$content.'
'.$langs->trans("IBAN").''.$account->iban.' '; - if (!empty($account->iban)) { - if (!checkIbanForAccount($account)) { - print img_picto($langs->trans("IbanNotValid"), 'warning'); - } else { - print img_picto($langs->trans("IbanValid"), 'info'); - } - } - print '
'.$langs->trans("BIC").''.$account->bic.' '; - if (!empty($account->bic)) { - if (!checkSwiftForAccount($account)) { - print img_picto($langs->trans("SwiftNotValid"), 'warning'); - } else { - print img_picto($langs->trans("SwiftValid"), 'info'); - } - } - print '
'.$langs->trans("BankAccountDomiciliation").''; - print $account->domiciliation; - print "
'.$langs->trans("BankAccountOwner").''; - print $account->proprio; - print "
'.$langs->trans("BankAccountOwnerAddress").''; - print $account->owner_address; - print "
'; - - // Check BBAN - if ($account->label && !checkBanForAccount($account)) - { - print '
'.$langs->trans("RIBControlError").'
'; - } - print '
'; // Nbre max d'elements des petites listes @@ -455,20 +374,95 @@ if ($action != 'edit' && $action != 'create') // If not bank account yet, $acco dol_fiche_end(); - /* - * Barre d'actions - */ - print '
'; + // List of bank accounts (Currently only one bank account possible for each employee) - if ($user->rights->user->user->creer) - { - if ($account->id > 0) - print ''.$langs->trans("Edit").''; - else - print ''.$langs->trans("Create").''; + $morehtmlright = ''; + if ($account->id == 0) { + $morehtmlright = dolGetButtonTitle($langs->trans('Add'), '', 'fa fa-plus-circle', $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=create'); } - print '
'; + print load_fiche_titre($langs->trans("BankAccounts"), $morehtmlright, 'bank'); + + print '
'; // You can use div-table-responsive-no-min if you dont need reserved height for your table + print ''; + + print ''; + print_liste_field_titre("LabelRIB"); + print_liste_field_titre("Bank"); + print_liste_field_titre("RIB"); + print_liste_field_titre("IBAN"); + print_liste_field_titre("BIC"); + print_liste_field_titre('', $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'maxwidthsearch '); + print "\n"; + + if($account->id > 0) { + print ''; + // Label + print ''; + // Bank name + print ''; + // Account number + print ''; + // IBAN + print ''; + // BIC + print ''; + + // Edit/Delete + print ''; + + print ''; + } + + + if ($account->id == 0) + { + $colspan = 6; + print ''; + } + +print '
' . $account->label . '' . $account->bank . ''; + $string = ''; + foreach ($account->getFieldsToShow() as $val) { + if ($val == 'BankCode') { + $string .= $account->code_banque . ' '; + } elseif ($val == 'BankAccountNumber') { + $string .= $account->number . ' '; + } elseif ($val == 'DeskCode') { + $string .= $account->code_guichet . ' '; + } elseif ($val == 'BankAccountNumberKey') { + $string .= $account->cle_rib . ' '; + } + } + if (!empty($account->label) && $account->number) { + if (!checkBanForAccount($account)) { + $string .= ' ' . img_picto($langs->trans("ValueIsNotValid"), 'warning'); + } else { + $string .= ' ' . img_picto($langs->trans("ValueIsValid"), 'info'); + } + } + + print $string; + print '' . $account->iban; + if (!empty($account->iban)) { + if (!checkIbanForAccount($account)) { + print ' ' . img_picto($langs->trans("IbanNotValid"), 'warning'); + } + } + print '' . $account->bic; + if (!empty($account->bic)) { + if (!checkSwiftForAccount($account)) { + print ' ' . img_picto($langs->trans("SwiftNotValid"), 'warning'); + } + } + print ''; + if ($user->rights->hrm->employee->write || $user->rights->user->creer) { + print ''; + print img_picto($langs->trans("Modify"), 'edit'); + print ''; + } + print '
'.$langs->trans("NoBANRecord").'
'; +print '
'; } // Edit From 9744efc3ec2d9a7d053bfc1481fb45b88f4f3d61 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Sat, 11 Apr 2020 15:12:11 +0000 Subject: [PATCH 11/99] Fixing style errors. --- htdocs/user/bank.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/user/bank.php b/htdocs/user/bank.php index c0ad414290b..186cc57d36e 100644 --- a/htdocs/user/bank.php +++ b/htdocs/user/bank.php @@ -461,8 +461,8 @@ if ($action != 'edit' && $action != 'create') // If not bank account yet, $acco print ''.$langs->trans("NoBANRecord").''; } -print ''; -print '
'; + print ''; + print '
'; } // Edit From 2ef787c7ffc0a86aa989acaf7602b056bd6c6243 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Sat, 11 Apr 2020 17:38:54 +0200 Subject: [PATCH 12/99] Remove expense report tab from user --- htdocs/core/modules/modExpenseReport.class.php | 2 +- htdocs/install/upgrade2.php | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/htdocs/core/modules/modExpenseReport.class.php b/htdocs/core/modules/modExpenseReport.class.php index a17b935d709..d7a57f25818 100644 --- a/htdocs/core/modules/modExpenseReport.class.php +++ b/htdocs/core/modules/modExpenseReport.class.php @@ -102,7 +102,7 @@ class modExpenseReport extends DolibarrModules $r++; // Array to add new pages in new tabs - $this->tabs[] = array('data'=>'user:+expensereport:ExpenseReport:expensereport:$user->rights->expensereport->lire:/expensereport/list.php?mainmenu=hrm&id=__ID__'); + $this->tabs[] = array(); // Boxes $this->boxes = array(); // List of boxes diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php index 6825265b529..70f4bb32d19 100644 --- a/htdocs/install/upgrade2.php +++ b/htdocs/install/upgrade2.php @@ -477,6 +477,7 @@ if (!GETPOST('action', 'aZ09') || preg_match('/upgrade/i', GETPOST('action', 'aZ 'MAIN_MODULE_DON'=>'newboxdefonly', 'MAIN_MODULE_ECM'=>'newboxdefonly', 'MAIN_MODULE_EXTERNALSITE'=>'newboxdefonly', + 'MAIN_MODULE_EXPENSEREPORT'=>'newboxdefonly', 'MAIN_MODULE_FACTURE'=>'newboxdefonly', 'MAIN_MODULE_FOURNISSEUR'=>'newboxdefonly', 'MAIN_MODULE_HOLIDAY'=>'newboxdefonly', @@ -4697,6 +4698,16 @@ function migrate_reload_modules($db, $langs, $conf, $listofmodule = array(), $fo $mod->init($reloadmode); } } + elseif ($moduletoreload == 'MAIN_MODULE_EXPENSEREPORT') + { + dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Expense Report module"); + $res = @include_once DOL_DOCUMENT_ROOT.'/core/modules/modExpenseReport.class.php'; + if ($res) { + $mod = new modExpenseReport($db); + //$mod->remove('noboxes'); + $mod->init($reloadmode); + } + } elseif ($moduletoreload == 'MAIN_MODULE_DON') // Permission has changed into 3.0 { dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Don module"); From fecfe2e3a18d7b5cdf2caf76d03ed3ea2f53329e Mon Sep 17 00:00:00 2001 From: TuxGasy Date: Sat, 11 Apr 2020 18:37:06 +0200 Subject: [PATCH 13/99] Keep compatibility with old object declaration --- htdocs/core/class/html.form.class.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 4be8c74ffac..9b89a1bfc09 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -6032,6 +6032,11 @@ class Form } if ($tmpfieldstoshow) $fieldstoshow = $tmpfieldstoshow; } + else + { + $fieldstoshow = 't.ref'; // Keep compatibility with old object not declare yet fields + } + if (empty($fieldstoshow)) { if (isset($objecttmp->fields['ref'])) { From e9aa27d7314a99f72601ac83100b783e35eb2420 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 11 Apr 2020 21:06:33 +0200 Subject: [PATCH 14/99] Update facture-rec.class.php --- htdocs/compta/facture/class/facture-rec.class.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index 5efaed247c3..6c82fd0a9f6 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -69,6 +69,11 @@ class FactureRec extends CommonInvoice */ public $entity; + /** + * {@inheritdoc} + */ + protected $table_ref_field = 'titre'; + public $number; public $date; public $remise; @@ -82,7 +87,14 @@ class FactureRec extends CommonInvoice public $nb_gen_done; public $nb_gen_max; + /** + * @var int Frequency + */ public $frequency; + + /** + * @var string Unit frequency + */ public $unit_frequency; public $rang; From b6ffcd0a6ba6a5fdc4c1f47e86d3abfe5586ae76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 11 Apr 2020 21:10:21 +0200 Subject: [PATCH 15/99] Update fichinterrec.class.php --- htdocs/fichinter/class/fichinterrec.class.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/htdocs/fichinter/class/fichinterrec.class.php b/htdocs/fichinter/class/fichinterrec.class.php index 787a0379cfa..679d231d6a8 100644 --- a/htdocs/fichinter/class/fichinterrec.class.php +++ b/htdocs/fichinter/class/fichinterrec.class.php @@ -43,6 +43,11 @@ class FichinterRec extends Fichinter public $table_element_line = 'fichinter_rec'; public $fk_element = 'fk_fichinter'; + /** + * {@inheritdoc} + */ + protected $table_ref_field = 'titre'; + /** * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png */ From 78b43ddb1f19ffa7ccd0cd4983fcdbf3774ae4f1 Mon Sep 17 00:00:00 2001 From: "jove@bisquerra.com" Date: Sat, 11 Apr 2020 22:19:36 +0200 Subject: [PATCH 16/99] TakePOS connector update --- htdocs/takepos/admin/receipt.php | 2 +- htdocs/takepos/css/colorful.css | 4 ++++ htdocs/takepos/index.php | 3 ++- htdocs/takepos/invoice.php | 17 ++++++++++++++++- 4 files changed, 23 insertions(+), 3 deletions(-) diff --git a/htdocs/takepos/admin/receipt.php b/htdocs/takepos/admin/receipt.php index 79d6277c761..83b31569a7b 100644 --- a/htdocs/takepos/admin/receipt.php +++ b/htdocs/takepos/admin/receipt.php @@ -155,7 +155,7 @@ print "\n"; if ($conf->global->TAKEPOS_PRINT_METHOD == "takeposconnector") { print ''; - print $langs->trans("IPAddress").' ('.$langs->trans("TakeposConnectorNecesary").')'; + print $langs->trans("URL")." / ".$langs->trans("IPAddress").' ('.$langs->trans("TakeposConnectorNecesary").')'; print ''; print ''; print ''; diff --git a/htdocs/takepos/css/colorful.css b/htdocs/takepos/css/colorful.css index 298a29ce4cf..4df43a70334 100644 --- a/htdocs/takepos/css/colorful.css +++ b/htdocs/takepos/css/colorful.css @@ -31,3 +31,7 @@ tr.selected, tr.selected td { .topnav{ background: rgb(0,0,0) !important; } + +.fa-trash { + color: #fff !important; +} diff --git a/htdocs/takepos/index.php b/htdocs/takepos/index.php index 4f5ef29bc70..39515e72d21 100644 --- a/htdocs/takepos/index.php +++ b/htdocs/takepos/index.php @@ -874,7 +874,8 @@ if ($conf->global->TAKEPOS_BAR_RESTAURANT) if ($conf->global->TAKEPOS_BAR_RESTAURANT) { if ($conf->global->TAKEPOS_PRINT_METHOD == "takeposconnector") { - $menus[$r++] = array('title'=>'
'.$langs->trans("Receipt").'
', 'action'=>'TakeposPrinting(placeid);'); + if (filter_var($conf->global->TAKEPOS_PRINT_SERVER, FILTER_VALIDATE_URL) == TRUE) $menus[$r++] = array('title'=>'
'.$langs->trans("Receipt").'
', 'action'=>'TakeposConnector(placeid);'); + else $menus[$r++] = array('title'=>'
'.$langs->trans("Receipt").'
', 'action'=>'TakeposPrinting(placeid);'); } elseif ($conf->global->TAKEPOS_PRINT_METHOD == "receiptprinter") { $menus[$r++] = array('title'=>'
'.$langs->trans("Receipt").'
', 'action'=>'DolibarrTakeposPrinting(placeid);'); } else { diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index 95766802b76..c6d59323e6c 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -590,7 +590,8 @@ if ($action == "valid" || $action == "history") } $sectionwithinvoicelink .= ''; if ($conf->global->TAKEPOS_PRINT_METHOD == "takeposconnector") { - $sectionwithinvoicelink .= ' '; + if (filter_var($conf->global->TAKEPOS_PRINT_SERVER, FILTER_VALIDATE_URL) == TRUE) $sectionwithinvoicelink .= ' '; + else $sectionwithinvoicelink .= ' '; } elseif ($conf->global->TAKEPOS_PRINT_METHOD == "receiptprinter") { $sectionwithinvoicelink .= ' '; } else { @@ -708,6 +709,20 @@ function TakeposPrinting(id){ }); }); } + +function TakeposConnector(id){ + var invoice=''; + $.ajax({ + type: "POST", + url: 'global->TAKEPOS_PRINT_SERVER; ?>/print.php', + data: 'invoice='+invoice + }); +} + function DolibarrTakeposPrinting(id) { console.log('Printing invoice ticket ' + id) $.ajax({ From 88f18ec3ced598869b2348161be15665aacdc201 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 11 Apr 2020 22:24:50 +0200 Subject: [PATCH 17/99] can't remove actioncomm if there is a category --- htdocs/comm/action/class/actioncomm.class.php | 25 ++++++++++++++----- 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 9325b38cfb3..f451ab2e3bd 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -5,7 +5,7 @@ * Copyright (C) 2011-2017 Juanjo Menent * Copyright (C) 2015 Marcos García * Copyright (C) 2018 Nicolas ZABOURI - * Copyright (C) 2018 Frédéric France + * Copyright (C) 2018-2020 Frédéric France * * 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 @@ -900,14 +900,27 @@ class ActionComm extends CommonObject $this->db->begin(); - $sql = "DELETE FROM ".MAIN_DB_PREFIX."actioncomm"; - $sql .= " WHERE id=".$this->id; + // remove categorie association + $sql = "DELETE FROM ".MAIN_DB_PREFIX."categorie_actioncomm"; + $sql .= " WHERE fk_actioncomm=".$this->id; - dol_syslog(get_class($this)."::delete", LOG_DEBUG); + dol_syslog(get_class($this)."::delete categorie", LOG_DEBUG); $res = $this->db->query($sql); if ($res < 0) { - $this->error = $this->db->lasterror(); - $error++; + $this->error = $this->db->lasterror(); + $error++; + } + // remove actioncomm + if (!$error) { + $sql = "DELETE FROM ".MAIN_DB_PREFIX."actioncomm"; + $sql .= " WHERE id=".$this->id; + + dol_syslog(get_class($this)."::delete", LOG_DEBUG); + $res = $this->db->query($sql); + if ($res < 0) { + $this->error = $this->db->lasterror(); + $error++; + } } if (!$error) { From 5dc3b8dfd5cc194387b0c7de751601628f7f0888 Mon Sep 17 00:00:00 2001 From: andreubisquerra Date: Sat, 11 Apr 2020 22:36:46 +0200 Subject: [PATCH 18/99] Travis fix --- htdocs/takepos/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/takepos/index.php b/htdocs/takepos/index.php index 39515e72d21..e19d9181d8e 100644 --- a/htdocs/takepos/index.php +++ b/htdocs/takepos/index.php @@ -874,7 +874,7 @@ if ($conf->global->TAKEPOS_BAR_RESTAURANT) if ($conf->global->TAKEPOS_BAR_RESTAURANT) { if ($conf->global->TAKEPOS_PRINT_METHOD == "takeposconnector") { - if (filter_var($conf->global->TAKEPOS_PRINT_SERVER, FILTER_VALIDATE_URL) == TRUE) $menus[$r++] = array('title'=>'
'.$langs->trans("Receipt").'
', 'action'=>'TakeposConnector(placeid);'); + if (filter_var($conf->global->TAKEPOS_PRINT_SERVER, FILTER_VALIDATE_URL) == true) $menus[$r++] = array('title'=>'
'.$langs->trans("Receipt").'
', 'action'=>'TakeposConnector(placeid);'); else $menus[$r++] = array('title'=>'
'.$langs->trans("Receipt").'
', 'action'=>'TakeposPrinting(placeid);'); } elseif ($conf->global->TAKEPOS_PRINT_METHOD == "receiptprinter") { $menus[$r++] = array('title'=>'
'.$langs->trans("Receipt").'
', 'action'=>'DolibarrTakeposPrinting(placeid);'); From e2660fd31c7c14bb5344a77ed14880ef598d85a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 11 Apr 2020 22:38:28 +0200 Subject: [PATCH 19/99] Update actioncomm.class.php --- htdocs/comm/action/class/actioncomm.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 392cd9255d9..98b910fdfca 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -774,7 +774,7 @@ class ActionComm extends CommonObject dol_syslog(get_class($this)."::delete", LOG_DEBUG); $res=$this->db->query($sql); - if ($res < 0) { + if (!$res) { $this->error=$this->db->lasterror(); $error++; } @@ -785,7 +785,7 @@ class ActionComm extends CommonObject dol_syslog(get_class($this)."::delete", LOG_DEBUG); $res=$this->db->query($sql); - if ($res < 0) { + if (!$res) { $this->error=$this->db->lasterror(); $error++; } From 323a62f1e7bdfd4521054edf2e21961cbc6b3b85 Mon Sep 17 00:00:00 2001 From: andreubisquerra Date: Sat, 11 Apr 2020 22:38:59 +0200 Subject: [PATCH 20/99] travis fix --- htdocs/takepos/invoice.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index c6d59323e6c..aa06addc5ff 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -590,8 +590,8 @@ if ($action == "valid" || $action == "history") } $sectionwithinvoicelink .= ''; if ($conf->global->TAKEPOS_PRINT_METHOD == "takeposconnector") { - if (filter_var($conf->global->TAKEPOS_PRINT_SERVER, FILTER_VALIDATE_URL) == TRUE) $sectionwithinvoicelink .= ' '; - else $sectionwithinvoicelink .= ' '; + if (filter_var($conf->global->TAKEPOS_PRINT_SERVER, FILTER_VALIDATE_URL) == true) $sectionwithinvoicelink .= ' '; + else $sectionwithinvoicelink .= ' '; } elseif ($conf->global->TAKEPOS_PRINT_METHOD == "receiptprinter") { $sectionwithinvoicelink .= ' '; } else { From 251f6d0cb196e15fe4dcfc58addb810f0ee3c423 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 11 Apr 2020 22:53:45 +0200 Subject: [PATCH 21/99] Update facture-rec.class.php --- htdocs/compta/facture/class/facture-rec.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index 6c82fd0a9f6..74180587cfc 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -6,7 +6,7 @@ * Copyright (C) 2012 Cedric Salvador * Copyright (C) 2013 Florian Henry * Copyright (C) 2015 Marcos García - * Copyright (C) 2017 Frédéric France + * Copyright (C) 2017-2020 Frédéric France * * 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 @@ -134,7 +134,7 @@ class FactureRec extends CommonInvoice */ public $fields = array( 'rowid' =>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>10), - 'titre' =>array('type'=>'varchar(100)', 'label'=>'Titre', 'enabled'=>1, 'visible'=>-1, 'position'=>15), + 'titre' =>array('type'=>'varchar(100)', 'label'=>'Titre', 'enabled'=>1, 'showoncombobox' => 1, 'visible'=>-1, 'position'=>15), 'entity' =>array('type'=>'integer', 'label'=>'Entity', 'default'=>1, 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>20, 'index'=>1), 'fk_soc' =>array('type'=>'integer:Societe:societe/class/societe.class.php', 'label'=>'ThirdParty', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>25), 'datec' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-1, 'position'=>30), From b05ea6573e26c9fac454db8e2d00c2e9e975e3dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 12 Apr 2020 00:37:05 +0200 Subject: [PATCH 22/99] info categorie --- htdocs/categories/class/categorie.class.php | 29 ++++++- htdocs/categories/info.php | 96 +++++++++++++++++++++ htdocs/categories/photos.php | 12 +-- htdocs/categories/traduction.php | 12 +-- htdocs/categories/viewcat.php | 15 +--- htdocs/core/lib/categories.lib.php | 7 +- 6 files changed, 136 insertions(+), 35 deletions(-) create mode 100644 htdocs/categories/info.php diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index eb6dfaafcc6..23e5e86bedc 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -144,6 +144,26 @@ class Categorie extends CommonObject 'website_page' => 'WebsitePage' ); + /** + * @var array Title Area mapping from type string + * + * @note Move to const array when PHP 5.6 will be our minimum target + */ + public static $MAP_TYPE_TITLE_AREA = array( + 'product' => 'ProductsCategoriesArea', + 'customer' => 'CustomersCategoriesArea', + 'supplier' => 'SuppliersCategoriesArea', + 'member' => 'MembersCategoriesArea', + 'contact' => 'ContactsCategoriesArea', + 'user' => 'UsersCategoriesArea', + 'account' => 'AccountsCategoriesArea', // old for bank account + 'bank_account' => 'AccountsCategoriesArea', + 'project' => 'ProjectsCategoriesArea', + 'warehouse'=> 'StocksCategoriesArea', + 'actioncomm' => 'ActioncommCategoriesArea', + 'website_page' => 'WebsitePageCategoriesArea' + ); + /** * @var array Object table mapping from type string (table llx_...) when value of key does not match table name. * @@ -291,6 +311,7 @@ class Categorie extends CommonObject if (!is_numeric($type)) $type = $this->MAP_ID[$type]; $sql = "SELECT rowid, fk_parent, entity, label, description, color, fk_soc, visible, type, ref_ext"; + $sql .= ", date_creation, tms, fk_user_creat, fk_user_modif"; $sql .= " FROM ".MAIN_DB_PREFIX."categorie"; if ($id > 0) { @@ -315,16 +336,20 @@ class Categorie extends CommonObject $res = $this->db->fetch_array($resql); $this->id = $res['rowid']; - //$this->ref = $res['rowid']; + //$this->ref = $res['rowid']; $this->fk_parent = $res['fk_parent']; $this->label = $res['label']; $this->description = $res['description']; $this->color = $res['color']; $this->socid = $res['fk_soc']; $this->visible = $res['visible']; - $this->type = $res['type']; + $this->type = $res['type']; $this->ref_ext = $res['ref_ext']; $this->entity = $res['entity']; + $this->date_creation = $this->db->jdate($$res['date_creation']); + $this->date_modification = $this->db->jdate($res['tms']); + $this->fk_user_create = $res['fk_user_create']; + $this->fk_user_modif = $res['fk_user_modif']; // Retreive all extrafield // fetch optionals attributes and labels diff --git a/htdocs/categories/info.php b/htdocs/categories/info.php new file mode 100644 index 00000000000..efc52aa15cb --- /dev/null +++ b/htdocs/categories/info.php @@ -0,0 +1,96 @@ + + * Copyright (C) 2005-2009 Regis Houssin + * Copyright (C) 2017 Ferran Marcet + * + * 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 + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file htdocs/categories/info.php + * \ingroup categories + * \brief Category info page + */ + +require '../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/categories.lib.php'; + +if (!$user->rights->categorie->lire) { + accessforbidden(); +} + +// Load translation files required by the page +$langs->loadLangs(array('categories', 'sendings')); + +$socid = 0; +$id = GETPOST('id', 'int'); + +// Security check +if ($user->socid) $socid = $user->socid; +$result = restrictedArea($user, 'categorie', $id, '&category'); + +$object = new Categorie($db); +if (!$object->fetch($id) > 0) { + dol_print_error($db); + exit; +} +$type = $object->type; +if (is_numeric($type)) $type = Categorie::$MAP_ID_TO_CODE[$type]; // For backward compatibility + +/* + * View + */ + +$form = new Form($db); + +llxHeader('', $langs->trans('Categories'), ''); + +//$object->info($object->id); + +$head = categories_prepare_head($object, $type); + +$title = Categorie::$MAP_TYPE_TITLE_AREA[$type]; + +dol_fiche_head($head, 'info', $langs->trans($title), -1, 'category'); +$backtolist = (GETPOST('backtolist') ? GETPOST('backtolist') : DOL_URL_ROOT.'/categories/index.php?leftmenu=cat&type='.$type); +$linkback = ''.$langs->trans("BackToList").''; +$object->next_prev_filter = ' type = '.$type; +$object->ref = $object->label; +$morehtmlref = '
'.$langs->trans("Root").' >> '; +$ways = $object->print_all_ways(" >> ", '', 1); +foreach ($ways as $way) { + $morehtmlref .= $way."
\n"; +} +$morehtmlref .= '
'; + +dol_banner_tab($object, 'label', $linkback, ($user->socid ? 0 : 1), 'label', 'label', $morehtmlref, '&type='.$type, 0, '', '', 1); + +print '
'; +print '
'; + +print '
'; + +print '
'; +dol_print_object_info($object); +print '
'; + +print '
'; + +dol_fiche_end(); + +// End of page +llxFooter(); +$db->close(); diff --git a/htdocs/categories/photos.php b/htdocs/categories/photos.php index 598d060e5f6..07e5d56d268 100644 --- a/htdocs/categories/photos.php +++ b/htdocs/categories/photos.php @@ -112,20 +112,12 @@ $formother = new FormOther($db); if ($object->id) { - if ($type == Categorie::TYPE_PRODUCT) $title = $langs->trans("ProductsCategoryShort"); - elseif ($type == Categorie::TYPE_SUPPLIER) $title = $langs->trans("SuppliersCategoryShort"); - elseif ($type == Categorie::TYPE_CUSTOMER) $title = $langs->trans("CustomersCategoryShort"); - elseif ($type == Categorie::TYPE_MEMBER) $title = $langs->trans("MembersCategoryShort"); - elseif ($type == Categorie::TYPE_CONTACT) $title = $langs->trans("ContactCategoriesShort"); - elseif ($type == Categorie::TYPE_ACCOUNT) $title = $langs->trans("AccountsCategoriesShort"); - elseif ($type == Categorie::TYPE_PROJECT) $title = $langs->trans("ProjectsCategoriesShort"); - elseif ($type == Categorie::TYPE_USER) $title = $langs->trans("UsersCategoriesShort"); - else $title = $langs->trans("Category"); + $title = Categorie::$MAP_TYPE_TITLE_AREA[$type]; $head = categories_prepare_head($object, $type); - dol_fiche_head($head, 'photos', $title, -1, 'category'); + dol_fiche_head($head, 'photos', $langs->trans($title), -1, 'category'); $linkback = ''.$langs->trans("BackToList").''; $object->next_prev_filter = ' type = '.$object->type; diff --git a/htdocs/categories/traduction.php b/htdocs/categories/traduction.php index caf79d81e04..c3f87e404b7 100644 --- a/htdocs/categories/traduction.php +++ b/htdocs/categories/traduction.php @@ -173,15 +173,7 @@ $form = new Form($db); $formadmin = new FormAdmin($db); $formother = new FormOther($db); -if ($type == Categorie::TYPE_PRODUCT) $title = $langs->trans("ProductsCategoryShort"); -elseif ($type == Categorie::TYPE_SUPPLIER) $title = $langs->trans("SuppliersCategoryShort"); -elseif ($type == Categorie::TYPE_CUSTOMER) $title = $langs->trans("CustomersCategoryShort"); -elseif ($type == Categorie::TYPE_MEMBER) $title = $langs->trans("MembersCategoryShort"); -elseif ($type == Categorie::TYPE_CONTACT) $title = $langs->trans("ContactCategoriesShort"); -elseif ($type == Categorie::TYPE_ACCOUNT) $title = $langs->trans("AccountsCategoriesShort"); -elseif ($type == Categorie::TYPE_PROJECT) $title = $langs->trans("ProjectsCategoriesShort"); -elseif ($type == Categorie::TYPE_USER) $title = $langs->trans("UsersCategoriesShort"); -else $title = $langs->trans("Category"); +$title = Categorie::$MAP_TYPE_TITLE_AREA[$type]; $head = categories_prepare_head($object, $type); @@ -195,7 +187,7 @@ if (!empty($object->multilangs)) } } -dol_fiche_head($head, 'translation', $title, -1, 'category'); +dol_fiche_head($head, 'translation', $langs->trans($title), -1, 'category'); $linkback = ''.$langs->trans("BackToList").''; $object->next_prev_filter = ' type = '.$object->type; diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php index 5b31d2285fc..d259c8ca5a5 100644 --- a/htdocs/categories/viewcat.php +++ b/htdocs/categories/viewcat.php @@ -207,21 +207,12 @@ $arrayofcss = array('/includes/jquery/plugins/jquerytreeview/jquery.treeview.css $helpurl = ''; llxHeader("", $langs->trans("Categories"), $helpurl, '', 0, 0, $arrayofjs, $arrayofcss); -if ($type == Categorie::TYPE_PRODUCT) { $title = $langs->trans("ProductsCategoriesArea"); $typetext = 'product'; } -elseif ($type == Categorie::TYPE_SUPPLIER) { $title = $langs->trans("SuppliersCategoriesArea"); $typetext = 'supplier'; } -elseif ($type == Categorie::TYPE_CUSTOMER) { $title = $langs->trans("CustomersCategoriesArea"); $typetext = 'customer'; } -elseif ($type == Categorie::TYPE_MEMBER) { $title = $langs->trans("MembersCategoriesArea"); $typetext = 'member'; } -elseif ($type == Categorie::TYPE_CONTACT) { $title = $langs->trans("ContactsCategoriesArea"); $typetext = 'contact'; } -elseif ($type == Categorie::TYPE_ACCOUNT) { $title = $langs->trans("AccountsCategoriesArea"); $typetext = 'bank_account'; } -elseif ($type == Categorie::TYPE_PROJECT) { $title = $langs->trans("ProjectsCategoriesArea"); $typetext = 'project'; } -elseif ($type == Categorie::TYPE_USER) { $title = $langs->trans("UsersCategoriesArea"); $typetext = 'user'; } -elseif ($type == Categorie::TYPE_WAREHOUSE) { $title = $langs->trans("StocksCategoriesArea"); $typetext = 'warehouse'; } -else { $title = $langs->trans("CategoriesArea"); $typetext = 'unknown'; } +$title = Categorie::$MAP_TYPE_TITLE_AREA[$type]; $head = categories_prepare_head($object, $type); -dol_fiche_head($head, 'card', $title, -1, 'category'); +dol_fiche_head($head, 'card', $langs->trans($title), -1, 'category'); $backtolist = (GETPOST('backtolist') ? GETPOST('backtolist') : DOL_URL_ROOT.'/categories/index.php?leftmenu=cat&type='.$type); $linkback = ''.$langs->trans("BackToList").''; $object->next_prev_filter = ' type = '.$object->type; @@ -350,7 +341,7 @@ else { $categstatic = new Categorie($db); - $fulltree = $categstatic->get_full_arbo($typetext, $object->id, 1); + $fulltree = $categstatic->get_full_arbo($type, $object->id, 1); // Load possible missing includes if ($conf->global->CATEGORY_SHOW_COUNTS) diff --git a/htdocs/core/lib/categories.lib.php b/htdocs/core/lib/categories.lib.php index 37ff7acad44..e0945f9a029 100644 --- a/htdocs/core/lib/categories.lib.php +++ b/htdocs/core/lib/categories.lib.php @@ -29,7 +29,7 @@ * @param string $type Type of category * @return array Array of tabs to show */ -function categories_prepare_head($object, $type) +function categories_prepare_head(Categorie $object, $type) { global $langs, $conf, $user; @@ -57,6 +57,11 @@ function categories_prepare_head($object, $type) $h++; } + $head[$h][0] = DOL_URL_ROOT.'/categories/info.php?id='.$object->id; + $head[$h][1] = $langs->trans("Info"); + $head[$h][2] = 'info'; + $h++; + // Show more tabs from modules // Entries must be declared in modules descriptor with line // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab From c06cf2eb8d33f33de592d398d9edf9fabcc3bc06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 12 Apr 2020 00:47:14 +0200 Subject: [PATCH 23/99] info categorie --- htdocs/categories/class/categorie.class.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index 23e5e86bedc..86e6b73ef30 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -348,7 +348,7 @@ class Categorie extends CommonObject $this->entity = $res['entity']; $this->date_creation = $this->db->jdate($$res['date_creation']); $this->date_modification = $this->db->jdate($res['tms']); - $this->fk_user_create = $res['fk_user_create']; + $this->fk_user_creat = $res['fk_user_creat']; $this->fk_user_modif = $res['fk_user_modif']; // Retreive all extrafield @@ -414,7 +414,7 @@ class Categorie extends CommonObject } $this->db->begin(); - + $now = dol_now(); $sql = "INSERT INTO ".MAIN_DB_PREFIX."categorie ("; $sql .= "fk_parent,"; $sql .= " label,"; @@ -428,7 +428,9 @@ class Categorie extends CommonObject $sql .= " type,"; $sql .= " import_key,"; $sql .= " ref_ext,"; - $sql .= " entity"; + $sql .= " entity,"; + $sql .= " date_creation,"; + $sql .= " fk_user_creat"; $sql .= ") VALUES ("; $sql .= $this->db->escape($this->fk_parent).","; $sql .= "'".$this->db->escape($this->label)."',"; @@ -442,7 +444,9 @@ class Categorie extends CommonObject $sql .= $this->db->escape($type).","; $sql .= (!empty($this->import_key) ? "'".$this->db->escape($this->import_key)."'" : 'null').","; $sql .= (!empty($this->ref_ext) ? "'".$this->db->escape($this->ref_ext)."'" : 'null').","; - $sql .= $this->db->escape($conf->entity); + $sql .= $this->db->escape($conf->entity).","; + $sql .= "'".$this->db->idate($now)."', "; + $sql .= (int) $user->id; $sql .= ")"; $res = $this->db->query($sql); @@ -540,6 +544,7 @@ class Categorie extends CommonObject } $sql .= ", visible = '".$this->db->escape($this->visible)."'"; $sql .= ", fk_parent = ".$this->fk_parent; + $sql .= ", fk_user_modif = ". (int) $user->id; $sql .= " WHERE rowid = ".$this->id; dol_syslog(get_class($this)."::update", LOG_DEBUG); From a91139f2d8fdfd2c7baac0b1194a3c1f4104fe14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 12 Apr 2020 00:57:08 +0200 Subject: [PATCH 24/99] add user --- htdocs/categories/class/categorie.class.php | 6 +++--- htdocs/categories/info.php | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index 86e6b73ef30..ab4d4531566 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -346,10 +346,10 @@ class Categorie extends CommonObject $this->type = $res['type']; $this->ref_ext = $res['ref_ext']; $this->entity = $res['entity']; - $this->date_creation = $this->db->jdate($$res['date_creation']); + $this->date_creation = $this->db->jdate($res['date_creation']); $this->date_modification = $this->db->jdate($res['tms']); - $this->fk_user_creat = $res['fk_user_creat']; - $this->fk_user_modif = $res['fk_user_modif']; + $this->user_creation = $res['fk_user_creat']; + $this->user_modification = $res['fk_user_modif']; // Retreive all extrafield // fetch optionals attributes and labels diff --git a/htdocs/categories/info.php b/htdocs/categories/info.php index efc52aa15cb..644886c7387 100644 --- a/htdocs/categories/info.php +++ b/htdocs/categories/info.php @@ -86,7 +86,6 @@ print '
'; print '
'; dol_print_object_info($object); print '
'; - print ''; dol_fiche_end(); From 9a1e3c1a747d9636af39ee599abe5373713366d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 12 Apr 2020 08:59:56 +0200 Subject: [PATCH 25/99] Update llx_blockedlog.sql --- htdocs/install/mysql/tables/llx_blockedlog.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/mysql/tables/llx_blockedlog.sql b/htdocs/install/mysql/tables/llx_blockedlog.sql index 80a4c150150..889b28d7a73 100644 --- a/htdocs/install/mysql/tables/llx_blockedlog.sql +++ b/htdocs/install/mysql/tables/llx_blockedlog.sql @@ -33,7 +33,7 @@ CREATE TABLE llx_blockedlog signature varchar(100) NOT NULL, signature_line varchar(100) NOT NULL, object_data mediumtext, - object_version varchar(32) DEFAULT ''; + object_version varchar(32) DEFAULT '', certified integer ) ENGINE=innodb; From 33a926e2512a606b2f87cb53a31b90ef2f068c72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 12 Apr 2020 09:08:27 +0200 Subject: [PATCH 26/99] Update llx_categorie_website_page.key.sql --- .../install/mysql/tables/llx_categorie_website_page.key.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/install/mysql/tables/llx_categorie_website_page.key.sql b/htdocs/install/mysql/tables/llx_categorie_website_page.key.sql index b2af52d8fe9..f819663fd31 100644 --- a/htdocs/install/mysql/tables/llx_categorie_website_page.key.sql +++ b/htdocs/install/mysql/tables/llx_categorie_website_page.key.sql @@ -16,9 +16,9 @@ -- -- ============================================================================ -ALTER TABLE llx_categorie_website_page ADD PRIMARY KEY pk_categorie_website_page (fk_categorie, fk_websitepage); +ALTER TABLE llx_categorie_website_page ADD PRIMARY KEY pk_categorie_website_page (fk_categorie, fk_website_page); ALTER TABLE llx_categorie_website_page ADD INDEX idx_categorie_website_page_fk_categorie (fk_categorie); -ALTER TABLE llx_categorie_website_page ADD INDEX idx_categorie_website_page_fk_website_page (fk_websitepage); +ALTER TABLE llx_categorie_website_page ADD INDEX idx_categorie_website_page_fk_website_page (fk_website_page); ALTER TABLE llx_categorie_website_page ADD CONSTRAINT fk_categorie_websitepage_categorie_rowid FOREIGN KEY (fk_categorie) REFERENCES llx_categorie (rowid); ALTER TABLE llx_categorie_website_page ADD CONSTRAINT fk_categorie_websitepage_website_page_rowid FOREIGN KEY (fk_website_page) REFERENCES llx_website_page (rowid); From 3f59ca6418d86f7f34f9c7ce7ee7a4f2aea21243 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Sun, 12 Apr 2020 10:13:37 +0200 Subject: [PATCH 27/99] Fix #13576 : links on variants --- htdocs/variants/combinations.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/variants/combinations.php b/htdocs/variants/combinations.php index 306586ec504..b39991e7f31 100644 --- a/htdocs/variants/combinations.php +++ b/htdocs/variants/combinations.php @@ -777,8 +777,8 @@ if (!empty($id) || !empty($ref)) print ''.$prodstatic->getLibStatut(2, 0).''; print ''.$prodstatic->getLibStatut(2, 1).''; print ''; - print ''.img_edit().''; - print ''.img_delete().''; + print 'id.'">'.img_edit().''; + print 'id.'">'.img_delete().''; print ''; print ''; if ($productCombinations || $massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined From 8bca68cfba3c0e08cb9d4e17851b446c54ccfa28 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Sun, 12 Apr 2020 10:39:16 +0200 Subject: [PATCH 28/99] Fix missing token on product composition --- htdocs/product/composition/card.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/product/composition/card.php b/htdocs/product/composition/card.php index 88945342af5..f67910cbef4 100644 --- a/htdocs/product/composition/card.php +++ b/htdocs/product/composition/card.php @@ -317,6 +317,7 @@ if ($id > 0 || ! empty($ref)) print load_fiche_titre($langs->trans("ProductAssociationList"), '', ''); print ''; + print ''; print ''; print ''; From 6b16a3ad390587f3e2e51e30445c0e17d1bea218 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 12 Apr 2020 13:25:19 +0200 Subject: [PATCH 29/99] NEW Can check all events in one click in setup of audited events --- htdocs/admin/events.php | 34 +++++++++++++++++++++------ htdocs/admin/perms.php | 4 +--- htdocs/core/class/html.form.class.php | 2 +- htdocs/langs/en_US/errors.lang | 1 + htdocs/website/index.php | 14 +++++------ 5 files changed, 37 insertions(+), 18 deletions(-) diff --git a/htdocs/admin/events.php b/htdocs/admin/events.php index 65a03adc4f1..c3b9b372915 100644 --- a/htdocs/admin/events.php +++ b/htdocs/admin/events.php @@ -28,14 +28,26 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/agenda.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/events.class.php'; -if (!$user->admin) -accessforbidden(); +if (!$user->admin) { + accessforbidden(); +} // Load translation files required by the page $langs->loadLangs(array("users", "admin", "other")); $action = GETPOST('action', 'aZ09'); +$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'myobjectlist'; // To manage different context of search +$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') +// Load variable for pagination +$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$sortfield = GETPOST('sortfield', 'alpha'); +$sortorder = GETPOST('sortorder', 'alpha'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { $page = 0; } // If $page is not defined, or '' or -1 or if we click on clear filters +$offset = $limit * $page; +$pageprev = $page - 1; +$pagenext = $page + 1; $securityevent = new Events($db); $eventstolog = $securityevent->eventstolog; @@ -44,6 +56,7 @@ $eventstolog = $securityevent->eventstolog; /* * Actions */ + if ($action == "save") { $i = 0; @@ -67,6 +80,12 @@ if ($action == "save") * View */ +$form = new Form($db); + +$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; +$selectedfields = ''; +$selectedfields .= $form->showCheckAddButtons('checkforselect', 1); + $wikihelp = 'EN:Setup_Security|FR:Paramétrage_Sécurité|ES:Configuración_Seguridad'; llxHeader('', $langs->trans("Audit"), $wikihelp); @@ -85,9 +104,10 @@ $head = security_prepare_head(); dol_fiche_head($head, 'audit', $langs->trans("Security"), -1); -print ""; +print '
'; print ""; -print ""; +print getTitleFieldOfList("LogEvents", 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, '')."\n"; +print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n"; print "\n"; // Loop on each event type foreach ($eventstolog as $key => $arr) @@ -96,10 +116,10 @@ foreach ($eventstolog as $key => $arr) { print ''; print ''; - print ''."\n"; } } @@ -109,7 +129,7 @@ dol_fiche_end(); print '
'; print "trans("Save")."\">"; -print "
"; +print ''; print "\n"; diff --git a/htdocs/admin/perms.php b/htdocs/admin/perms.php index 60bd157d283..0486edebeec 100644 --- a/htdocs/admin/perms.php +++ b/htdocs/admin/perms.php @@ -203,7 +203,7 @@ if ($result) // Show break line print ''; print ''; print ''; @@ -218,8 +218,6 @@ if ($result) // Picto and label of module print ''; // Tick diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 965bca72824..f59e57d3516 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -7788,7 +7788,7 @@ class Form $(document).ready(function() { $("#checkallactions'.$id.'").click(function() { if($(this).is(\':checked\')){ - console.log("We check all"); + console.log("We check all '.$cssclass.'"); $(".'.$cssclass.'").prop(\'checked\', true).trigger(\'change\'); } else diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang index 88e18c62943..0ea2940911b 100644 --- a/htdocs/langs/en_US/errors.lang +++ b/htdocs/langs/en_US/errors.lang @@ -236,6 +236,7 @@ ErrorBatchNoFoundForProductInWarehouse=No lot/serial found for product "%s" in w ErrorBatchNoFoundEnoughQuantityForProductInWarehouse=No enough quantity for this lot/serial for product "%s" in warehouse "%s". ErrorOnlyOneFieldForGroupByIsPossible=Only 1 field for the 'Group by' is possible (others are discarded) ErrorTooManyDifferentValueForSelectedGroupBy=Found too many different value (more than %s) for the field '%s', so we can't user it as a 'Group by' for graphics. The field 'Group By' has been removed. May be you wanted to use it as an X-Axis ? +ErrorReplaceStringEmpty=Error, the string to replace into is empty # Warnings WarningParamUploadMaxFileSizeHigherThanPostMaxSize=Your PHP parameter upload_max_filesize (%s) is higher than PHP parameter post_max_size (%s). This is not a consistent setup. WarningPasswordSetWithNoAccount=A password was set for this member. However, no user account was created. So this password is stored but can't be used to login to Dolibarr. It may be used by an external module/interface but if you don't need to define any login nor password for a member, you can disable option "Manage a login for each member" from Member module setup. If you need to manage a login but don't need any password, you can keep this field empty to avoid this warning. Note: Email can also be used as a login if the member is linked to a user. diff --git a/htdocs/website/index.php b/htdocs/website/index.php index 629e4b91584..c724ab4e3cf 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -369,7 +369,11 @@ if (($action == 'replacesite' || $action == 'replacesiteconfirm') && ! $searchke if ($massaction == 'replace') { $replacestring = GETPOST('replacestring', 'alphanohtml'); - if (! $replacestring) { + + if (empty($user->rights->website->writephp)) { + setEventMessages("NotAllowedToAddDynamicContent", null, 'errors'); + } + elseif (! $replacestring) { setEventMessages("ErrorReplaceStringEmpty", null, 'errors'); } else { @@ -3531,12 +3535,8 @@ if ($action == 'replacesite' || $action == 'replacesiteconfirm' || $massaction = $permissiontodelete = 0; // List of mass actions available - $arrayofmassactions = array( - //'validate'=>$langs->trans("Validate"), - //'generate_doc'=>$langs->trans("ReGeneratePDF"), - //'builddoc'=>$langs->trans("PDFMerge"), - 'replace'=>$langs->trans("Replace"), - ); + $arrayofmassactions = array(); + if ($user->rights->website->writephp) $arrayofmassactions['replace'] = $langs->trans("Replace"); if ($permissiontodelete) $arrayofmassactions['predelete'] = ''.$langs->trans("Delete"); if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) $arrayofmassactions = array(); $massactionbutton = $form->selectMassAction('', $arrayofmassactions); From d7784887d15fbb45ebd9667d4f25a81aee55a258 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 12 Apr 2020 14:58:50 +0200 Subject: [PATCH 30/99] More font awesome picto --- htdocs/contact/class/contact.class.php | 2 +- htdocs/core/lib/functions.lib.php | 22 ++++++++++++---------- htdocs/core/modules/modFckeditor.class.php | 2 +- htdocs/core/modules/modSalaries.class.php | 2 +- htdocs/societe/class/societe.class.php | 2 +- htdocs/societe/list.php | 2 +- htdocs/theme/eldy/global.inc.php | 2 +- 7 files changed, 18 insertions(+), 16 deletions(-) diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index 8d880226ff4..9cad793ba3d 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -1348,7 +1348,7 @@ class Contact extends CommonObject } $result .= $linkstart; - if ($withpicto) $result .= img_object(($notooltip ? '' : $label), ($this->picto ? $this->picto : 'generic'), ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip valigntextbottom"'), 0, 0, $notooltip ? 0 : 1); + if ($withpicto) $result .= img_object(($notooltip ? '' : $label), ($this->picto ? $this->picto : 'generic'), ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip ? 0 : 1); if ($withpicto != 2) $result .= ($maxlen ?dol_trunc($this->getFullName($langs), $maxlen) : $this->getFullName($langs)); $result .= $linkend; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index de8c73db44a..8256e268dc6 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3134,13 +3134,14 @@ 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', - 'address', 'bank_account', 'barcode', 'bank', 'bookmark', 'building', 'cash-register', 'check', 'close_title', 'cubes', 'delete', 'dolly', 'edit', 'ellipsis-h', + 'address', 'bank_account', 'barcode', 'bank', 'bookmark', 'building', 'cash-register', 'check', 'close_title', 'company', 'contact', 'cubes', + 'delete', 'dolly', 'edit', 'ellipsis-h', 'filter', 'file-code', 'folder', 'folder-open', 'grip', 'grip_title', 'help', 'language', 'list', 'listlight', 'note', 'object_action', 'object_account', 'object_barcode', 'object_phoning', 'object_phoning_fax', 'object_email', - 'object_bookmark', 'object_bug', 'object_generic', 'object_list-alt', 'object_calendar', 'object_calendarweek', 'object_calendarmonth', 'object_calendarday', 'object_calendarperuser', - 'object_cash-register', 'object_holiday', 'object_hrm', 'object_accounting', 'object_category', 'object_multicurrency', - 'object_printer', 'object_resource', 'object_technic', 'object_trip', 'object_user', 'object_group', 'object_member', 'object_other', - 'off', 'on', 'play', 'playdisabled', 'printer', 'resize', 'stats', 'trip', + 'object_accounting', 'object_category', 'object_bookmark', 'object_bug', 'object_generic', 'object_list-alt', 'object_calendar', 'object_calendarweek', 'object_calendarmonth', 'object_calendarday', 'object_calendarperuser', + 'object_cash-register', 'object_company', 'object_contact', 'object_holiday', 'object_hrm', 'object_multicurrency', 'object_payment', + 'object_paragraph', 'object_printer', 'object_resource', 'object_rss', 'object_technic', 'object_trip', 'object_user', 'object_group', 'object_member', 'object_other', + 'off', 'on', 'paiment', 'play', 'playdisabled', 'printer', 'resize', 'stats', 'trip', 'note', 'setup', 'sign-out', 'split', 'switch_off', 'switch_on', 'tools', 'unlink', 'uparrow', 'user', 'wrench', 'globe', 'jabber', 'skype', 'twitter', 'facebook', 'linkedin', 'instagram', 'snapchat', 'youtube', 'google-plus-g', 'whatsapp', 'chevron-left', 'chevron-right', 'chevron-down', 'chevron-top', @@ -3163,6 +3164,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ $arrayconvpictotofa = array( 'account'=>'university', 'action'=>'calendar-alt', 'address'=> 'address-book', 'bank_account'=>'university', + 'company'=>'building', 'contact'=>'address-book', 'setup'=>'cog', 'companies'=>'building', 'products'=>'cube', 'commercial'=>'suitcase', 'invoicing'=>'coins', 'accountancy'=>'money-check-alt', 'accounting'=>'chart-line', 'category'=>'tag', 'hrm'=>'umbrella-beach', 'members'=>'users', 'ticket'=>'ticket-alt', 'globe'=>'external-link-alt', @@ -3175,7 +3177,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'list-alt'=>'list-alt', 'calendar'=>'calendar-alt', 'calendarweek'=>'calendar-week', 'calendarmonth'=>'calendar-alt', 'calendarday'=>'calendar-day', 'calendarperuser'=>'table', 'multicurrency'=>'dollar-sign', 'other'=>'square', 'resource'=>'laptop-house', 'error'=>'exclamation-triangle', 'warning'=>'exclamation-triangle', - 'phoning'=>'phone', 'phoning_fax'=>'fax', 'printer'=>'print', 'technic'=>'cogs', + 'payment'=>'money-bill-alt', 'phoning'=>'phone', 'phoning_fax'=>'fax', 'printer'=>'print', 'technic'=>'cogs', 'title_setup'=>'tools', 'title_accountancy'=>'money-check-alt', 'title_bank'=>'university', 'title_hrm'=>'umbrella-beach', 'title_agenda'=>'calendar-alt', 'playdisabled'=>'play', 'preview'=>'binoculars', 'project'=>'sitemap', 'resize'=>'crop', @@ -3234,8 +3236,8 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'hrm'=>'bg-infoxbox-adherent', 'group'=>'bg-infoxbox-adherent', 'members'=>'bg-infoxbox-adherent', 'member'=>'bg-infoxbox-adherent', 'user'=>'bg-infoxbox-adherent', 'users'=>'bg-infoxbox-adherent', 'error'=>'pictoerror', 'warning'=>'pictowarning', 'switch_on'=>'font-status4', - 'holiday'=>'bg-infoxbox-holiday', 'project'=>'bg-infoxbox-project', 'resource'=>'bg-infoxbox-action', 'title_hrm'=>'bg-infoxbox-holiday', 'trip'=>'bg-infoxbox-expensereport', - 'title_agenda'=>'bg-infoxbox-action', + 'holiday'=>'bg-infoxbox-holiday', 'payment'=>'bg-infoxbox-bank_account', 'project'=>'bg-infoxbox-project', 'resource'=>'bg-infoxbox-action', + 'title_hrm'=>'bg-infoxbox-holiday', 'trip'=>'bg-infoxbox-expensereport', 'title_agenda'=>'bg-infoxbox-action', 'list-alt'=>'imgforviewmode', 'calendar'=>'imgforviewmode', 'calendarweek'=>'imgforviewmode', 'calendarmonth'=>'imgforviewmode', 'calendarday'=>'imgforviewmode', 'calendarperuser'=>'imgforviewmode' ); if (!empty($arrayconvpictotomorcess[$pictowithouttext])) { @@ -3244,9 +3246,9 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ // Define $color $arrayconvpictotocolor = array( - 'edit'=>'#444', 'note'=>'#999', 'error'=>'', 'listlight'=>'#999', + 'address'=>'#37a', 'building'=>'#37a', 'companies'=>'#37a', 'company'=>'#37a', 'contact'=>'#37a', 'edit'=>'#444', 'note'=>'#999', 'error'=>'', 'listlight'=>'#999', 'other'=>'#ddd', - 'playdisabled'=>'#ccc', 'printer'=>'#444', 'resize'=>'#444', + 'playdisabled'=>'#ccc', 'printer'=>'#444', 'resize'=>'#444', 'rss'=>'#cba', 'stats'=>'#444', 'switch_off'=>'#999', 'uparrow'=>'#555', 'warning'=>'' ); if (isset($arrayconvpictotocolor[$pictowithouttext])) { diff --git a/htdocs/core/modules/modFckeditor.class.php b/htdocs/core/modules/modFckeditor.class.php index 541615065bb..8f2d164e9ca 100644 --- a/htdocs/core/modules/modFckeditor.class.php +++ b/htdocs/core/modules/modFckeditor.class.php @@ -54,7 +54,7 @@ class modFckeditor extends DolibarrModules $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); // Name of png file (without png) used for this module. // Png file must be in theme/yourtheme/img directory under name object_pictovalue.png. - $this->picto = 'list'; + $this->picto = 'paragraph'; // Data directories to create when module is enabled $this->dirs = array("/medias/temp", "/medias/image"); diff --git a/htdocs/core/modules/modSalaries.class.php b/htdocs/core/modules/modSalaries.class.php index 0a3ff8f5591..7159ca634d5 100644 --- a/htdocs/core/modules/modSalaries.class.php +++ b/htdocs/core/modules/modSalaries.class.php @@ -62,7 +62,7 @@ class modSalaries extends DolibarrModules $this->version = 'dolibarr'; $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); - $this->picto = 'bill'; + $this->picto = 'payment'; // Data directories to create when module is enabled $this->dirs = array("/salaries/temp"); diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 6426d9ab98b..cd7ad23af7f 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -2480,7 +2480,7 @@ class Societe extends CommonObject } $result .= $linkstart; - if ($withpicto) $result .= img_object(($notooltip ? '' : $label), ($this->picto ? $this->picto : 'generic'), ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip valignmiddle"'), 0, 0, $notooltip ? 0 : 1); + if ($withpicto) $result .= img_object(($notooltip ? '' : $label), ($this->picto ? $this->picto : 'generic'), ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip ? 0 : 1); if ($withpicto != 2) $result .= ($maxlen ?dol_trunc($name, $maxlen) : $name); $result .= $linkend; diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index a1ca78fe67a..52ce0dc0ab0 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -1148,7 +1148,7 @@ while ($i < min($num, $limit)) } if (!empty($arrayfields['s.email']['checked'])) { - print "\n"; + print "\n"; if (!$i) $totalarray['nbfield']++; } if (!empty($arrayfields['s.phone']['checked'])) diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 4e77fc7fe2d..a05b0319ba3 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -1573,7 +1573,7 @@ div.nopadding { td.nobordernopadding.widthpictotitle.col-picto { color: var(--colortexttitlenotab); - opacity: 0.7; + opacity: 0.85; } .pictotitle { margin-: 8px; From 0916017519c4a38c1de79b8e51f1375f55126bf1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 12 Apr 2020 15:29:13 +0200 Subject: [PATCH 31/99] Fix addreplace hook --- htdocs/core/lib/functions.lib.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 8256e268dc6..35869df46f1 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -2269,10 +2269,15 @@ function dol_print_email($email, $cid = 0, $socid = 0, $addlink = 0, $max = 64, } } - $rep = '
'.($withpicto ?img_picto($langs->trans("EMail").' : '.$email, 'object_email.png').' ' : '').$newemail.'
'; + //$rep = '
'; + $rep .= ($withpicto ?img_picto($langs->trans("EMail").' : '.$email, 'object_email.png').' ' : '').$newemail; + //$rep .= '
'; if ($hookmanager) { $parameters = array('cid' => $cid, 'socid' => $socid, 'addlink' => $addlink, 'picto' => $withpicto); $reshook = $hookmanager->executeHooks('printEmail', $parameters, $email); + if ($reshook > 0) { + $rep = ''; + } $rep .= $hookmanager->resPrint; } @@ -3140,7 +3145,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'object_action', 'object_account', 'object_barcode', 'object_phoning', 'object_phoning_fax', 'object_email', 'object_accounting', 'object_category', 'object_bookmark', 'object_bug', 'object_generic', 'object_list-alt', 'object_calendar', 'object_calendarweek', 'object_calendarmonth', 'object_calendarday', 'object_calendarperuser', 'object_cash-register', 'object_company', 'object_contact', 'object_holiday', 'object_hrm', 'object_multicurrency', 'object_payment', - 'object_paragraph', 'object_printer', 'object_resource', 'object_rss', 'object_technic', 'object_trip', 'object_user', 'object_group', 'object_member', 'object_other', + 'object_paragraph', 'object_printer', 'object_resource', 'object_rss', 'object_technic', 'object_ticket', 'object_trip', 'object_user', 'object_group', 'object_member', 'object_other', 'off', 'on', 'paiment', 'play', 'playdisabled', 'printer', 'resize', 'stats', 'trip', 'note', 'setup', 'sign-out', 'split', 'switch_off', 'switch_on', 'tools', 'unlink', 'uparrow', 'user', 'wrench', 'globe', 'jabber', 'skype', 'twitter', 'facebook', 'linkedin', 'instagram', 'snapchat', 'youtube', 'google-plus-g', 'whatsapp', @@ -3177,7 +3182,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'list-alt'=>'list-alt', 'calendar'=>'calendar-alt', 'calendarweek'=>'calendar-week', 'calendarmonth'=>'calendar-alt', 'calendarday'=>'calendar-day', 'calendarperuser'=>'table', 'multicurrency'=>'dollar-sign', 'other'=>'square', 'resource'=>'laptop-house', 'error'=>'exclamation-triangle', 'warning'=>'exclamation-triangle', - 'payment'=>'money-bill-alt', 'phoning'=>'phone', 'phoning_fax'=>'fax', 'printer'=>'print', 'technic'=>'cogs', + 'payment'=>'money-bill-alt', 'phoning'=>'phone', 'phoning_fax'=>'fax', 'printer'=>'print', 'technic'=>'cogs', 'ticket'=>'ticket-alt', 'title_setup'=>'tools', 'title_accountancy'=>'money-check-alt', 'title_bank'=>'university', 'title_hrm'=>'umbrella-beach', 'title_agenda'=>'calendar-alt', 'playdisabled'=>'play', 'preview'=>'binoculars', 'project'=>'sitemap', 'resize'=>'crop', @@ -3237,7 +3242,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'members'=>'bg-infoxbox-adherent', 'member'=>'bg-infoxbox-adherent', 'user'=>'bg-infoxbox-adherent', 'users'=>'bg-infoxbox-adherent', 'error'=>'pictoerror', 'warning'=>'pictowarning', 'switch_on'=>'font-status4', 'holiday'=>'bg-infoxbox-holiday', 'payment'=>'bg-infoxbox-bank_account', 'project'=>'bg-infoxbox-project', 'resource'=>'bg-infoxbox-action', - 'title_hrm'=>'bg-infoxbox-holiday', 'trip'=>'bg-infoxbox-expensereport', 'title_agenda'=>'bg-infoxbox-action', + 'ticket'=>'bg-infoxbox-contrat', 'title_hrm'=>'bg-infoxbox-holiday', 'trip'=>'bg-infoxbox-expensereport', 'title_agenda'=>'bg-infoxbox-action', 'list-alt'=>'imgforviewmode', 'calendar'=>'imgforviewmode', 'calendarweek'=>'imgforviewmode', 'calendarmonth'=>'imgforviewmode', 'calendarday'=>'imgforviewmode', 'calendarperuser'=>'imgforviewmode' ); if (!empty($arrayconvpictotomorcess[$pictowithouttext])) { From 20e684ec69691c550db997f7629f04a398f82a61 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Sun, 12 Apr 2020 15:30:58 +0200 Subject: [PATCH 32/99] Fix #13468 setup working days and hours --- htdocs/admin/ihm.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/admin/ihm.php b/htdocs/admin/ihm.php index 83f7b03d67f..19c0bab7150 100644 --- a/htdocs/admin/ihm.php +++ b/htdocs/admin/ihm.php @@ -154,8 +154,8 @@ if ($action == 'update') //dolibarr_set_const($db, "MAIN_DISABLE_JAVASCRIPT", GETPOST("MAIN_DISABLE_JAVASCRIPT", 'aZ09'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_BUTTON_HIDE_UNAUTHORIZED", GETPOST("MAIN_BUTTON_HIDE_UNAUTHORIZED", 'aZ09'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_START_WEEK", GETPOST("MAIN_START_WEEK", 'int'), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_DEFAULT_WORKING_DAYS", GETPOST("MAIN_DEFAULT_WORKING_DAYS", 'int'), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_DEFAULT_WORKING_HOURS", GETPOST("MAIN_DEFAULT_WORKING_HOURS", 'int'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_DEFAULT_WORKING_DAYS", GETPOST("MAIN_DEFAULT_WORKING_DAYS", 'alpha'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_DEFAULT_WORKING_HOURS", GETPOST("MAIN_DEFAULT_WORKING_HOURS", 'alpha'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_SHOW_LOGO", GETPOST("MAIN_SHOW_LOGO", 'aZ09'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_FIRSTNAME_NAME_POSITION", GETPOST("MAIN_FIRSTNAME_NAME_POSITION", 'aZ09'), 'chaine', 0, '', $conf->entity); From 7c72e406591dee6576de972270c8516219117654 Mon Sep 17 00:00:00 2001 From: Matt Sidnell <54064522+pstructures@users.noreply.github.com> Date: Sun, 12 Apr 2020 15:21:14 +0100 Subject: [PATCH 33/99] Installation issue Installation SQL issue due to a ';' instead of a ','. --- htdocs/install/mysql/tables/llx_blockedlog.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/mysql/tables/llx_blockedlog.sql b/htdocs/install/mysql/tables/llx_blockedlog.sql index 80a4c150150..889b28d7a73 100644 --- a/htdocs/install/mysql/tables/llx_blockedlog.sql +++ b/htdocs/install/mysql/tables/llx_blockedlog.sql @@ -33,7 +33,7 @@ CREATE TABLE llx_blockedlog signature varchar(100) NOT NULL, signature_line varchar(100) NOT NULL, object_data mediumtext, - object_version varchar(32) DEFAULT ''; + object_version varchar(32) DEFAULT '', certified integer ) ENGINE=innodb; From 044a6192b60999af6ea7ae7ffa1a3d5aba1306cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 12 Apr 2020 16:26:19 +0200 Subject: [PATCH 34/99] doxygen --- htdocs/admin/system/phpinfo.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/system/phpinfo.php b/htdocs/admin/system/phpinfo.php index db9a893ff9f..ce21c1f3ad8 100644 --- a/htdocs/admin/system/phpinfo.php +++ b/htdocs/admin/system/phpinfo.php @@ -401,7 +401,7 @@ function getTableColumnFunction(array $functions) * @param array $loaded A list with all loaded PHP extensions * @param array $functions A list with all PHP functions to check * - * @return array + * @return string */ function getResultColumn($name, array $activated, array $loaded, array $functions) { From 7d430c08d02c0064c7e300fced85c199f9ef0040 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 12 Apr 2020 16:36:25 +0200 Subject: [PATCH 35/99] Look and feel v12 --- htdocs/core/class/hookmanager.class.php | 3 +- htdocs/core/lib/functions.lib.php | 5 +- .../class/api_interventions.class.php | 2 +- htdocs/fichinter/class/fichinter.class.php | 2 +- htdocs/index.php | 110 ++++++++++------- htdocs/langs/en_US/companies.lang | 1 - htdocs/societe/class/societe.class.php | 2 +- htdocs/societe/list.php | 2 +- .../class/supplier_proposal.class.php | 2 +- htdocs/theme/eldy/global.inc.php | 4 +- htdocs/theme/eldy/info-box.inc.php | 42 ++----- htdocs/theme/md/info-box.inc.php | 6 +- htdocs/ticket/card.php | 4 +- htdocs/ticket/class/ticket.class.php | 116 ++++++++++++++++++ 14 files changed, 207 insertions(+), 94 deletions(-) diff --git a/htdocs/core/class/hookmanager.class.php b/htdocs/core/class/hookmanager.class.php index bffbfec9c50..e24bce5e247 100644 --- a/htdocs/core/class/hookmanager.class.php +++ b/htdocs/core/class/hookmanager.class.php @@ -149,7 +149,7 @@ class HookManager $parameters['context'] = join(':', $this->contextarray); //dol_syslog(get_class($this).'::executeHooks method='.$method." action=".$action." context=".$parameters['context']); - // Define type of hook ('output' or 'addreplace'. 'returnvalue' is deprecated because a 'addreplace' hook can also return resPrint and resArray). + // Define type of hook ('output' or 'addreplace'). Type 'returnvalue' is deprecated because a 'addreplace' hook can also return resPrint and resArray). $hooktype = 'output'; if (in_array( $method, @@ -199,6 +199,7 @@ class HookManager 'pdf_getlinetotalwithtax', 'paymentsupplierinvoices', 'printAddress', + 'printEmail', 'printSearchForm', 'printTabsHead', 'printObjectLine', diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 35869df46f1..092e36cef72 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3144,7 +3144,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'filter', 'file-code', 'folder', 'folder-open', 'grip', 'grip_title', 'help', 'language', 'list', 'listlight', 'note', 'object_action', 'object_account', 'object_barcode', 'object_phoning', 'object_phoning_fax', 'object_email', 'object_accounting', 'object_category', 'object_bookmark', 'object_bug', 'object_generic', 'object_list-alt', 'object_calendar', 'object_calendarweek', 'object_calendarmonth', 'object_calendarday', 'object_calendarperuser', - 'object_cash-register', 'object_company', 'object_contact', 'object_holiday', 'object_hrm', 'object_multicurrency', 'object_payment', + 'object_cash-register', 'object_company', 'object_contact', 'object_contract', 'object_holiday', 'object_hrm', 'object_multicurrency', 'object_payment', 'object_paragraph', 'object_printer', 'object_resource', 'object_rss', 'object_technic', 'object_ticket', 'object_trip', 'object_user', 'object_group', 'object_member', 'object_other', 'off', 'on', 'paiment', 'play', 'playdisabled', 'printer', 'resize', 'stats', 'trip', 'note', 'setup', 'sign-out', 'split', 'switch_off', 'switch_on', 'tools', 'unlink', 'uparrow', 'user', 'wrench', 'globe', @@ -3169,7 +3169,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ $arrayconvpictotofa = array( 'account'=>'university', 'action'=>'calendar-alt', 'address'=> 'address-book', 'bank_account'=>'university', - 'company'=>'building', 'contact'=>'address-book', + 'company'=>'building', 'contact'=>'address-book', 'contract'=>'suitcase', 'setup'=>'cog', 'companies'=>'building', 'products'=>'cube', 'commercial'=>'suitcase', 'invoicing'=>'coins', 'accountancy'=>'money-check-alt', 'accounting'=>'chart-line', 'category'=>'tag', 'hrm'=>'umbrella-beach', 'members'=>'users', 'ticket'=>'ticket-alt', 'globe'=>'external-link-alt', @@ -3236,6 +3236,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ // Add CSS $arrayconvpictotomorcess = array( 'action'=>'bg-infoxbox-action', 'account'=>'bg-infoxbox-bank_account', 'bank_account'=>'bg-infoxbox-bank_account', 'cash-register'=>'bg-infoxbox-bank_account', + 'contract'=>'bg-infoxbox-contrat', 'multicurrency'=>'bg-infoxbox-bank_account', 'check'=>'font-status4', 'hrm'=>'bg-infoxbox-adherent', 'group'=>'bg-infoxbox-adherent', diff --git a/htdocs/fichinter/class/api_interventions.class.php b/htdocs/fichinter/class/api_interventions.class.php index 7dd6045b19b..4f81930355e 100644 --- a/htdocs/fichinter/class/api_interventions.class.php +++ b/htdocs/fichinter/class/api_interventions.class.php @@ -21,7 +21,7 @@ require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; /** - * API class for fichinters + * API class for Interventions * * @access protected * @class DolibarrApiAccess {@requires user,external} diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php index 118e21a841c..ff88847140b 100644 --- a/htdocs/fichinter/class/fichinter.class.php +++ b/htdocs/fichinter/class/fichinter.class.php @@ -202,7 +202,7 @@ class Fichinter extends CommonObject { while ($obj = $this->db->fetch_object($resql)) { - $this->nb["fichinters"] = $obj->nb; + $this->nb["interventions"] = $obj->nb; } $this->db->free($resql); return 1; diff --git a/htdocs/index.php b/htdocs/index.php index 110de972f2b..24330736287 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -108,7 +108,6 @@ if (!empty($conf->global->MAIN_MOTD)) * Hidden for external users */ - $boxstatItems = array(); $boxstatFromHook = ''; @@ -128,26 +127,27 @@ if (empty($user->socid) && empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTATS)) { // Condition to be checked for each display line dashboard $conditions = array( - $user->rights->user->user->lire, - !empty($conf->societe->enabled) && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS_STATS), - !empty($conf->societe->enabled) && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS_STATS), - !empty($conf->fournisseur->enabled) && $user->rights->fournisseur->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS), - !empty($conf->societe->enabled) && $user->rights->societe->contact->lire, - !empty($conf->adherent->enabled) && $user->rights->adherent->lire, - !empty($conf->product->enabled) && $user->rights->produit->lire, - !empty($conf->service->enabled) && $user->rights->service->lire, - !empty($conf->propal->enabled) && $user->rights->propale->lire, - !empty($conf->commande->enabled) && $user->rights->commande->lire, - !empty($conf->facture->enabled) && $user->rights->facture->lire, - !empty($conf->contrat->enabled) && $user->rights->contrat->lire, - !empty($conf->ficheinter->enabled) && $user->rights->ficheinter->lire, - !empty($conf->supplier_order->enabled) && $user->rights->fournisseur->commande->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_ORDERS_STATS), - !empty($conf->supplier_invoice->enabled) && $user->rights->fournisseur->facture->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_INVOICES_STATS), - !empty($conf->supplier_proposal->enabled) && $user->rights->supplier_proposal->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_PROPOSAL_STATS), - !empty($conf->projet->enabled) && $user->rights->projet->lire, - !empty($conf->expensereport->enabled) && $user->rights->expensereport->lire, - !empty($conf->holiday->enabled) && $user->rights->holiday->read, - !empty($conf->don->enabled) && $user->rights->don->lire + $user->rights->user->user->lire, + !empty($conf->societe->enabled) && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS_STATS), + !empty($conf->societe->enabled) && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS_STATS), + !empty($conf->fournisseur->enabled) && $user->rights->fournisseur->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS), + !empty($conf->societe->enabled) && $user->rights->societe->contact->lire, + !empty($conf->adherent->enabled) && $user->rights->adherent->lire, + !empty($conf->product->enabled) && $user->rights->produit->lire, + !empty($conf->service->enabled) && $user->rights->service->lire, + !empty($conf->propal->enabled) && $user->rights->propale->lire, + !empty($conf->commande->enabled) && $user->rights->commande->lire, + !empty($conf->facture->enabled) && $user->rights->facture->lire, + !empty($conf->contrat->enabled) && $user->rights->contrat->lire, + !empty($conf->ficheinter->enabled) && $user->rights->ficheinter->lire, + !empty($conf->supplier_order->enabled) && $user->rights->fournisseur->commande->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_ORDERS_STATS), + !empty($conf->supplier_invoice->enabled) && $user->rights->fournisseur->facture->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_INVOICES_STATS), + !empty($conf->supplier_proposal->enabled) && $user->rights->supplier_proposal->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_PROPOSAL_STATS), + !empty($conf->projet->enabled) && $user->rights->projet->lire, + !empty($conf->expensereport->enabled) && $user->rights->expensereport->lire, + !empty($conf->holiday->enabled) && $user->rights->holiday->read, + !empty($conf->don->enabled) && $user->rights->don->lire, + !empty($conf->ticket->enabled) && $user->rights->ticket->read ); // Class file containing the method load_state_board for each line $includes = array( @@ -170,7 +170,8 @@ if (empty($user->socid) && empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTATS)) DOL_DOCUMENT_ROOT."/projet/class/project.class.php", DOL_DOCUMENT_ROOT."/expensereport/class/expensereport.class.php", DOL_DOCUMENT_ROOT."/holiday/class/holiday.class.php", - DOL_DOCUMENT_ROOT."/don/class/don.class.php" + DOL_DOCUMENT_ROOT."/don/class/don.class.php", + DOL_DOCUMENT_ROOT."/ticket/class/ticket.class.php" ); // Name class containing the method load_state_board for each line $classes = array('User', @@ -192,7 +193,8 @@ if (empty($user->socid) && empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTATS)) 'Project', 'ExpenseReport', 'Holiday', - 'Don' + 'Don', + 'Ticket', ); // Cle array returned by the method load_state_board for each line $keys = array('users', @@ -206,15 +208,16 @@ if (empty($user->socid) && empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTATS)) 'proposals', 'orders', 'invoices', - 'Contracts', - 'fichinters', + 'contracts', + 'interventions', 'supplier_orders', 'supplier_invoices', 'askprice', 'projects', 'expensereports', 'holidays', - 'donations' + 'donations', + 'ticket' ); // Dashboard Icon lines $icons = array('user', @@ -228,15 +231,16 @@ if (empty($user->socid) && empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTATS)) 'propal', 'order', 'bill', - 'order', - 'order', + 'contract', + 'intervention', 'order', 'bill', 'propal', 'projectpub', 'trip', 'holiday', - 'generic' + 'generic', + 'ticket', ); // Translation keyword $titres = array("Users", @@ -258,7 +262,8 @@ if (empty($user->socid) && empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTATS)) "Projects", "ExpenseReports", "Holidays", - "Donations" + "Donations", + "Ticket", ); // Dashboard Link lines $links = array( @@ -282,7 +287,8 @@ if (empty($user->socid) && empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTATS)) DOL_URL_ROOT.'/projet/list.php?mainmenu=project', DOL_URL_ROOT.'/expensereport/list.php?mainmenu=hrm&leftmenu=expensereport', DOL_URL_ROOT.'/holiday/list.php?mainmenu=hrm&leftmenu=holiday', - DOL_URL_ROOT.'/don/list.php?leftmenu=donations' + DOL_URL_ROOT.'/don/list.php?leftmenu=donations', + DOL_URL_ROOT.'/ticket/list.php?leftmenu=ticket' ); // Translation lang files $langfile = array( @@ -306,12 +312,13 @@ if (empty($user->socid) && empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTATS)) "trips", "holiday", "donations", + "ticket" ); // Loop and displays each line of table $boardloaded = array(); - foreach ($keys as $key=>$val) + foreach ($keys as $key => $val) { if ($conditions[$key]) { @@ -331,7 +338,6 @@ if (empty($user->socid) && empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTATS)) $board = $boardloaded[$classe]; } - if (!empty($langfile[$key])) $langs->load($langfile[$key]); $text = $langs->trans($titres[$key]); $boxstatItem .= ''; @@ -415,7 +421,7 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) { $dashboardlines[$board->element.'_awaiting'] = $board->load_board($user, 'awaiting'); } - // Number of services enabled (delayed) + // Number of contract / services enabled (delayed) if (!empty($conf->contrat->enabled) && $user->rights->contrat->lire) { include_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; $board = new Contrat($db); @@ -423,6 +429,16 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) { // Number of active services (expired) $dashboardlines[$board->element.'_active'] = $board->load_board($user, "active"); } + + // Number of tickets open + if (!empty($conf->ticket->enabled) && $user->rights->ticket->read) { + include_once DOL_DOCUMENT_ROOT.'/ticket/class/ticket.class.php'; + $board = new Ticket($db); + $dashboardlines[$board->element.'_opened'] = $board->load_board($user, "opened"); + // Number of active services (expired) + //$dashboardlines[$board->element.'_active'] = $board->load_board($user, "active"); + } + // Number of invoices customers (has paid) if (!empty($conf->facture->enabled) && $user->rights->facture->lire) { include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; @@ -526,13 +542,6 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) { 'stats' => array('facture'), ), - 'contrat' => - array( - 'groupName' => 'Contracts', - 'globalStatsKey' => 'Contracts', - 'stats' => - array('contrat_inactive', 'contrat_active'), - ), 'supplier_proposal' => array( 'groupName' => 'SupplierProposals', @@ -554,7 +563,21 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) { 'stats' => array('invoice_supplier'), ), - 'bank_account' => + 'contrat' => + array( + 'groupName' => 'Contracts', + 'globalStatsKey' => 'Contracts', + 'stats' => + array('contrat_inactive', 'contrat_active'), + ), + 'ticket' => + array( + 'groupName' => 'Tickets', + 'globalStatsKey' => 'OpenTickets', + 'stats' => + array('ticket_opened'), + ), + 'bank_account' => array( 'groupName' => 'BankAccount', 'stats' => @@ -587,8 +610,7 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) { $parameters = array( 'dashboardgroup' => $dashboardgroup ); - $reshook = $hookmanager->executeHooks('addOpenElementsDashboardGroup', $parameters, $object, - $action); // Note that $action and $object may have been modified by some hooks + $reshook = $hookmanager->executeHooks('addOpenElementsDashboardGroup', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook == 0) { $dashboardgroup = array_merge($dashboardgroup, $hookmanager->resArray); } diff --git a/htdocs/langs/en_US/companies.lang b/htdocs/langs/en_US/companies.lang index c569a48c84a..609ea0efdf2 100644 --- a/htdocs/langs/en_US/companies.lang +++ b/htdocs/langs/en_US/companies.lang @@ -325,7 +325,6 @@ CompanyDeleted=Company "%s" deleted from database. ListOfContacts=List of contacts/addresses ListOfContactsAddresses=List of contacts/addresses ListOfThirdParties=List of Third Parties -ShowCompany=Show Third Party ShowContact=Show contact ContactsAllShort=All (No filter) ContactType=Contact type diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index cd7ad23af7f..6c5889b89fe 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -2407,7 +2407,7 @@ class Societe extends CommonObject // By default if (empty($linkstart)) { - $label .= ''.$langs->trans("ShowCompany").''; + $label .= ''.$langs->trans("ThirdParty").''; $linkstart = '".dol_print_email($obj->email, $obj->rowid, $obj->socid, 'AC_EMAIL', 18, 0, 1)."\n"; + print '
\n"; if (!$i) $totalarray['nbfield']++; } if (!empty($arrayfields['s.phone']['checked'])) diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php index 2f7d4b39cf3..21c7ea4c6dc 100644 --- a/htdocs/supplier_proposal/class/supplier_proposal.class.php +++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php @@ -2436,7 +2436,7 @@ class SupplierProposal extends CommonObject // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** - * Charge indicateurs this->nb de tableau de bord + * Load indicator this->nb of global stats widget * * @return int <0 if ko, >0 if ok */ diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index a05b0319ba3..3bf20f74c4e 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -3826,8 +3826,8 @@ div.boximport { .fieldrequired { font-weight: bold; color: var(--fieldrequiredcolor); } -.widthpictotitle { width: 32px; text-align: ; } -span.widthpictotitle { font-size: 2em; }; +.widthpictotitle { width: 26px; text-align: ; } +span.widthpictotitle { font-size: 1.7em; }; .dolgraphtitle { margin-top: 6px; margin-bottom: 4px; } .dolgraphtitlecssboxes { /* margin: 0px; */ } diff --git a/htdocs/theme/eldy/info-box.inc.php b/htdocs/theme/eldy/info-box.inc.php index 9f958943080..312521fe829 100644 --- a/htdocs/theme/eldy/info-box.inc.php +++ b/htdocs/theme/eldy/info-box.inc.php @@ -77,7 +77,7 @@ if (!defined('ISLOADEDBYSTEELSHEET')) die('Must be call by steelsheet'); ?> max-width: 100%; } .info-box-module .info-box-icon > img { - max-width: 50%; + max-width: 55%; } .info-box-icon-text{ @@ -220,11 +220,11 @@ if (GETPOSTISSET('THEME_AGRESSIVENESS_RATIO')) $conf->global->THEME_AGRESSIVENES .bg-infoxbox-order_supplier{ color: global->THEME_AGRESSIVENESS_RATIO); ?> !important; } -.bg-infoxbox-contrat{ - color: global->THEME_AGRESSIVENESS_RATIO); ?> !important; +.bg-infoxbox-contrat, .bg-infoxbox-ticket{ + color: global->THEME_AGRESSIVENESS_RATIO); ?> !important; } .bg-infoxbox-bank_account{ - color: global->THEME_AGRESSIVENESS_RATIO); ?> !important; + color: global->THEME_AGRESSIVENESS_RATIO); ?> !important; } .bg-infoxbox-adherent{ color: global->THEME_AGRESSIVENESS_RATIO); ?> !important; @@ -258,6 +258,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"; } @@ -297,37 +300,6 @@ if (GETPOSTISSET('THEME_AGRESSIVENESS_RATIO')) $conf->global->THEME_AGRESSIVENES color : #b91f1f; } -/* USING IMAGES FOR WEATHER INTEAD OF FONT AWESOME */ -/* For other themes just uncomment this part */ -/*.info-box-weather-level0, -.info-box-weather-level1, -.info-box-weather-level2, -.info-box-weather-level3, -.info-box-weather-level4 { - background-position: 15px 50%; - background-repeat: no-repeat; -} - -.info-box-weather .info-box-icon{ - display: none !important; -} -.info-box-weather-level0 { - background-image: url("img/weather/weather-clear.png"); -} -.info-box-weather-level1 { - background-image: url("img/weather/weather-few-clouds.png"); -} -.info-box-weather-level2 { - background-image: url("img/weather/weather-clouds.png"); -} -.info-box-weather-level3 { - background-image: url("img/weather/weather-many-clouds.png"); -} -.info-box-weather-level4 { - background-image: url("img/weather/weather-storm.png"); -}*/ - - .box-flex-container{ display: flex; /* or inline-flex */ diff --git a/htdocs/theme/md/info-box.inc.php b/htdocs/theme/md/info-box.inc.php index 6104c623c00..ad1f037ab1e 100644 --- a/htdocs/theme/md/info-box.inc.php +++ b/htdocs/theme/md/info-box.inc.php @@ -61,7 +61,7 @@ span.info-box-icon-text { /* hide box text number due to problems */ max-width: 100%; } .info-box-module .info-box-icon > img { - max-width: 50%; + max-width: 55%; } .info-box-content { padding: 5px 10px; @@ -126,11 +126,11 @@ if (GETPOSTISSET('THEME_AGRESSIVENESS_RATIO')) $conf->global->THEME_AGRESSIVENES .bg-infoxbox-order_supplier i.fa{ color: global->THEME_AGRESSIVENESS_RATIO); ?> !important; } -.bg-infoxbox-contrat i.fa{ +.bg-infoxbox-contrat i.fa, .bg-infoxbox-ticket i.fa{ color: global->THEME_AGRESSIVENESS_RATIO); ?> !important; } .bg-infoxbox-bank_account i.fa{ - color: global->THEME_AGRESSIVENESS_RATIO); ?> !important; + color: global->THEME_AGRESSIVENESS_RATIO); ?> !important; } .bg-infoxbox-adherent i.fa{ color: global->THEME_AGRESSIVENESS_RATIO); ?> !important; diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php index d59581fa914..8b8ba741ad3 100644 --- a/htdocs/ticket/card.php +++ b/htdocs/ticket/card.php @@ -742,7 +742,9 @@ if (empty($action) || $action == 'view' || $action == 'addlink' || $action == 'd $head = societe_prepare_head($object->thirdparty); dol_fiche_head($head, 'ticket', $langs->trans("ThirdParty"), 0, 'company'); + dol_banner_tab($object->thirdparty, 'socid', '', ($user->socid ? 0 : 1), 'rowid', 'nom'); + dol_fiche_end(); } @@ -790,7 +792,7 @@ if (empty($action) || $action == 'view' || $action == 'addlink' || $action == 'd if (!empty($conf->projet->enabled)) { $langs->load("projects"); - $morehtmlref .= '
'.$langs->trans('Project'); + $morehtmlref .= '
'.$langs->trans('Project').' '; if ($user->rights->ticket->write) { if ($action != 'classify') diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index d4f080bc3e2..8ee299f6f78 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -2781,6 +2781,122 @@ class Ticket extends CommonObject setEventMessages($langs->trans('ErrorMailRecipientIsEmptyForSendTicketMessage'), null, 'warnings'); } } + + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Load indicators for dashboard (this->nbtodo and this->nbtodolate) + * + * @param User $user Object user + * @param int $mode "opened" for askprice to close, "signed" for proposal to invoice + * @return int <0 if KO, >0 if OK + */ + public function load_board($user, $mode) + { + // phpcs:enable + global $conf, $user, $langs; + + $now = dol_now(); + + $this->nbtodo = $this->nbtodolate = 0; + $clause = " WHERE"; + + $sql = "SELECT p.rowid, p.ref, p.datec as datec"; + $sql .= " FROM ".MAIN_DB_PREFIX."ticket as p"; + if (!$user->rights->societe->client->voir && !$user->socid) + { + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON p.fk_soc = sc.fk_soc"; + $sql .= " WHERE sc.fk_user = ".$user->id; + $clause = " AND"; + } + $sql .= $clause." p.entity IN (".getEntity('ticket').")"; + if ($mode == 'opened') $sql .= " AND p.fk_statut in (".Ticket::STATUS_CLOSED.", ".Ticket::STATUS_CANCELED.")"; + if ($user->socid) $sql .= " AND p.fk_soc = ".$user->socid; + + $resql = $this->db->query($sql); + if ($resql) + { + $label = $labelShort = ''; + $status = ''; + if ($mode == 'opened') { + $status = 'openall'; + //$delay_warning = $conf->ticket->warning_delay; + $delay_warning = 0; + $label = $langs->trans("MenuListNonClosed"); + $labelShort = $langs->trans("MenuListNonClosed"); + } + + $response = new WorkboardResponse(); + $response->warning_delay = $delay_warning / 60 / 60 / 24; + $response->label = $label; + $response->labelShort = $labelShort; + $response->url = DOL_URL_ROOT.'/ticket/list.php?search_fk_statut[]='.$status; + $response->img = img_object('', "ticket"); + + // This assignment in condition is not a bug. It allows walking the results. + while ($obj = $this->db->fetch_object($resql)) + { + $response->nbtodo++; + if ($mode == 'opened') + { + $datelimit = $this->db->jdate($obj->datefin); + if ($datelimit < ($now - $delay_warning)) + { + //$response->nbtodolate++; + } + } + } + return $response; + } + else + { + $this->error = $this->db->lasterror(); + return -1; + } + } + + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Load indicator this->nb of global stats widget + * + * @return int <0 if ko, >0 if ok + */ + public function load_state_board() + { + // phpcs:enable + global $conf, $user; + + $this->nb = array(); + $clause = "WHERE"; + + $sql = "SELECT count(p.rowid) as nb"; + $sql .= " FROM ".MAIN_DB_PREFIX."ticket as p"; + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON p.fk_soc = s.rowid"; + if (!$user->rights->societe->client->voir && !$user->socid) + { + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON s.rowid = sc.fk_soc"; + $sql .= " WHERE sc.fk_user = ".$user->id; + $clause = "AND"; + } + $sql .= " ".$clause." p.entity IN (".getEntity('ticket').")"; + + $resql = $this->db->query($sql); + if ($resql) + { + // This assignment in condition is not a bug. It allows walking the results. + while ($obj = $this->db->fetch_object($resql)) + { + $this->nb["ticket"] = $obj->nb; + } + $this->db->free($resql); + return 1; + } + else + { + dol_print_error($this->db); + $this->error = $this->db->lasterror(); + return -1; + } + } } From acab0200a692544bf66e6380af73e4c11368f9b4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 12 Apr 2020 16:46:21 +0200 Subject: [PATCH 36/99] Update html.form.class.php --- 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 9b89a1bfc09..d08d230b3bd 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -6034,7 +6034,7 @@ class Form } else { - $fieldstoshow = 't.ref'; // Keep compatibility with old object not declare yet fields + $objecttmp->fields['ref']=array('type'=>'varchar(30)', 'label'=>'Ref'); } if (empty($fieldstoshow)) From 697043bbd378a557755fd0f06efb9544747df446 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 12 Apr 2020 16:47:56 +0200 Subject: [PATCH 37/99] Update html.form.class.php --- htdocs/core/class/html.form.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index d08d230b3bd..6f911260afd 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -6034,7 +6034,8 @@ class Form } else { - $objecttmp->fields['ref']=array('type'=>'varchar(30)', 'label'=>'Ref'); + // For backward compatibility + $objecttmp->fields['ref']=array('type'=>'varchar(30)', 'label'=>'Ref', 'showoncombobox'=>1); } if (empty($fieldstoshow)) From 2e27355dec0b23c0722806a0e5e693d0470b2d1d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 12 Apr 2020 16:51:35 +0200 Subject: [PATCH 38/99] FIX #13569 --- htdocs/compta/bank/class/account.class.php | 70 ++++++++++++++++++++++ 1 file changed, 70 insertions(+) diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index 6fc0efbd6e0..d030d523734 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -214,6 +214,76 @@ class Account extends CommonObject */ public $date_solde; + + /** + * '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. + * '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 + /** + * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + */ + public $fields=array( + 'rowid' =>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>10), + 'ref' =>array('type'=>'varchar(12)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'showoncombobox'=>1, 'position'=>25), + 'label' =>array('type'=>'varchar(30)', 'label'=>'Label', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>30), + 'entity' =>array('type'=>'integer', 'label'=>'Entity', 'default'=>1, 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>35, 'index'=>1), + 'bank' =>array('type'=>'varchar(60)', 'label'=>'Bank', 'enabled'=>1, 'visible'=>-1, 'position'=>40), + 'code_banque' =>array('type'=>'varchar(128)', 'label'=>'Code banque', 'enabled'=>1, 'visible'=>-1, 'position'=>45), + 'code_guichet' =>array('type'=>'varchar(6)', 'label'=>'Code guichet', 'enabled'=>1, 'visible'=>-1, 'position'=>50), + 'number' =>array('type'=>'varchar(255)', 'label'=>'Number', 'enabled'=>1, 'visible'=>-1, 'position'=>55), + 'cle_rib' =>array('type'=>'varchar(5)', 'label'=>'Cle rib', 'enabled'=>1, 'visible'=>-1, 'position'=>60), + 'bic' =>array('type'=>'varchar(11)', 'label'=>'Bic', 'enabled'=>1, 'visible'=>-1, 'position'=>65), + 'iban_prefix' =>array('type'=>'varchar(34)', 'label'=>'Iban prefix', 'enabled'=>1, 'visible'=>-1, 'position'=>70), + 'country_iban' =>array('type'=>'varchar(2)', 'label'=>'Country iban', 'enabled'=>1, 'visible'=>-1, 'position'=>75), + 'cle_iban' =>array('type'=>'varchar(2)', 'label'=>'Cle iban', 'enabled'=>1, 'visible'=>-1, 'position'=>80), + 'domiciliation' =>array('type'=>'varchar(255)', 'label'=>'Domiciliation', 'enabled'=>1, 'visible'=>-1, 'position'=>85), + 'state_id' =>array('type'=>'integer', 'label'=>'State id', 'enabled'=>1, 'visible'=>-1, 'position'=>90), + 'fk_pays' =>array('type'=>'integer', 'label'=>'Fk pays', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>95), + 'proprio' =>array('type'=>'varchar(60)', 'label'=>'Proprio', 'enabled'=>1, 'visible'=>-1, 'position'=>100), + 'owner_address' =>array('type'=>'text', 'label'=>'Owner address', 'enabled'=>1, 'visible'=>-1, 'position'=>105), + 'courant' =>array('type'=>'smallint(6)', 'label'=>'Courant', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>110), + 'clos' =>array('type'=>'smallint(6)', 'label'=>'Clos', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>115), + 'rappro' =>array('type'=>'smallint(6)', 'label'=>'Rappro', 'enabled'=>1, 'visible'=>-1, 'position'=>120), + 'url' =>array('type'=>'varchar(128)', 'label'=>'Url', 'enabled'=>1, 'visible'=>-1, 'position'=>125), + 'account_number' =>array('type'=>'varchar(32)', 'label'=>'Account number', 'enabled'=>1, 'visible'=>-1, 'position'=>130), + 'accountancy_journal' =>array('type'=>'varchar(20)', 'label'=>'Accountancy journal', 'enabled'=>1, 'visible'=>-1, 'position'=>135), + 'currency_code' =>array('type'=>'varchar(3)', 'label'=>'Currency code', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>140), + 'min_allowed' =>array('type'=>'integer', 'label'=>'Min allowed', 'enabled'=>1, 'visible'=>-1, 'position'=>145), + 'min_desired' =>array('type'=>'integer', 'label'=>'Min desired', 'enabled'=>1, 'visible'=>-1, 'position'=>150), + 'comment' =>array('type'=>'text', 'label'=>'Comment', 'enabled'=>1, 'visible'=>-1, 'position'=>155), + 'datec' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-1, 'position'=>156), + 'tms' =>array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>157), + 'fk_user_author' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'Fk user author', 'enabled'=>1, 'visible'=>-1, 'position'=>160), + 'fk_user_modif' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'position'=>165), + 'note_public' =>array('type'=>'text', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>0, 'position'=>170), + 'model_pdf' =>array('type'=>'varchar(255)', 'label'=>'Model pdf', 'enabled'=>1, 'visible'=>0, 'position'=>175), + 'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>180), + 'extraparams' =>array('type'=>'varchar(255)', 'label'=>'Extraparams', 'enabled'=>1, 'visible'=>-1, 'position'=>185), + 'fk_accountancy_journal' =>array('type'=>'integer', 'label'=>'Fk accountancy journal', 'enabled'=>1, 'visible'=>-1, 'position'=>190), + ); + // END MODULEBUILDER PROPERTIES + /** * Current account */ From 8e246f2a18b6eb914dd167d202600fcb74fd36a2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 12 Apr 2020 16:54:54 +0200 Subject: [PATCH 39/99] Prepare 11.0.4 --- 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 6463736ac93..0352963b13e 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', '11.0.3'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c +if (! defined('DOL_VERSION')) define('DOL_VERSION', '11.0.4'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c if (! defined('EURO')) define('EURO', chr(128)); From fe4cd2e7bcd7f6bbedf8bb8c92dc12e353cd2d90 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 12 Apr 2020 17:05:12 +0200 Subject: [PATCH 40/99] Update actioncomm.class.php --- htdocs/comm/action/class/actioncomm.class.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index f451ab2e3bd..1ca0c512815 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -898,13 +898,14 @@ class ActionComm extends CommonObject $error = 0; + dol_syslog(get_class($this)."::delete", LOG_DEBUG); + $this->db->begin(); // remove categorie association $sql = "DELETE FROM ".MAIN_DB_PREFIX."categorie_actioncomm"; $sql .= " WHERE fk_actioncomm=".$this->id; - dol_syslog(get_class($this)."::delete categorie", LOG_DEBUG); $res = $this->db->query($sql); if ($res < 0) { $this->error = $this->db->lasterror(); @@ -915,7 +916,6 @@ class ActionComm extends CommonObject $sql = "DELETE FROM ".MAIN_DB_PREFIX."actioncomm"; $sql .= " WHERE id=".$this->id; - dol_syslog(get_class($this)."::delete", LOG_DEBUG); $res = $this->db->query($sql); if ($res < 0) { $this->error = $this->db->lasterror(); @@ -927,7 +927,6 @@ class ActionComm extends CommonObject $sql = "DELETE FROM ".MAIN_DB_PREFIX."actioncomm_resources"; $sql .= " WHERE fk_actioncomm=".$this->id; - dol_syslog(get_class($this)."::delete", LOG_DEBUG); $res = $this->db->query($sql); if ($res < 0) { $this->error = $this->db->lasterror(); From a873afdad9b6524468f6e4205b6e7bd5c05a1db3 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Sun, 12 Apr 2020 15:08:44 +0000 Subject: [PATCH 41/99] Fixing style errors. --- htdocs/comm/action/class/actioncomm.class.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 31c280714b7..03a78a95f9f 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -904,16 +904,16 @@ class ActionComm extends CommonObject // remove categorie association if (!$error) { - $sql = "DELETE FROM ".MAIN_DB_PREFIX."categorie_actioncomm"; - $sql .= " WHERE fk_actioncomm=".$this->id; + $sql = "DELETE FROM ".MAIN_DB_PREFIX."categorie_actioncomm"; + $sql .= " WHERE fk_actioncomm=".$this->id; - $res = $this->db->query($sql); - if (!$res) { - $this->error = $this->db->lasterror(); - $error++; - } + $res = $this->db->query($sql); + if (!$res) { + $this->error = $this->db->lasterror(); + $error++; + } } - + // remove actioncomm_resources if (!$error) { $sql = "DELETE FROM ".MAIN_DB_PREFIX."actioncomm_resources"; From e18d6bd6b80c31e04f66e7e99b69addcbb5c4e16 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 12 Apr 2020 17:28:10 +0200 Subject: [PATCH 42/99] Look and feel v12 --- htdocs/user/bank.php | 2 +- htdocs/user/clicktodial.php | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/htdocs/user/bank.php b/htdocs/user/bank.php index 186cc57d36e..10441299e2b 100644 --- a/htdocs/user/bank.php +++ b/htdocs/user/bank.php @@ -381,7 +381,7 @@ if ($action != 'edit' && $action != 'create') // If not bank account yet, $acco $morehtmlright = dolGetButtonTitle($langs->trans('Add'), '', 'fa fa-plus-circle', $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=create'); } - print load_fiche_titre($langs->trans("BankAccounts"), $morehtmlright, 'bank'); + print load_fiche_titre($langs->trans("BankAccounts"), $morehtmlright, 'bank_account'); print '
'; // You can use div-table-responsive-no-min if you dont need reserved height for your table print '
".$langs->trans("LogEvents")."
'.$arr['id'].''; + print ''; $key = 'MAIN_LOGEVENTS_'.$arr['id']; $value = $conf->global->$key; - print ''; + print ''; print '
'; - print img_object('', $picto, 'class="pictoobjectwidth"').' '.$objMod->getName(); + print img_object('', $picto, 'class="pictoobjectwidth paddingright"').' '.$objMod->getName(); print ''; print ' '; - //print img_object('', $picto, 'class="pictoobjectwidth"').' '.$objMod->getName(); - //print ' '; print '".dol_print_email($obj->email, $obj->rowid, $obj->socid, 'AC_EMAIL', 18)."".dol_print_email($obj->email, $obj->rowid, $obj->socid, 'AC_EMAIL', 18, 0, 1)."'.dol_print_email($obj->email, $obj->rowid, $obj->socid, 'AC_EMAIL', 0, 0, 1)."
'; diff --git a/htdocs/user/clicktodial.php b/htdocs/user/clicktodial.php index f77a3b44b97..c81e4068558 100644 --- a/htdocs/user/clicktodial.php +++ b/htdocs/user/clicktodial.php @@ -114,7 +114,7 @@ if ($id > 0) if ($user->admin) { - print ''; + print ''; print ''; } - print ''; + print ''; print ''; print "\n"; @@ -153,7 +153,7 @@ if ($id > 0) if (!empty($user->admin)) { - print ''; + print ''; print ''; } - print ''; + print ''; print ''; print ""; @@ -189,6 +189,7 @@ if ($id > 0) if ($action == 'edit') { + print '
'; print '
'; print '     '; print ''; From ecd49c21c938e5252dd90da9689d853143b5e27d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 12 Apr 2020 17:32:22 +0200 Subject: [PATCH 43/99] Look and feel v12 --- htdocs/adherents/list.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php index 0a9fc7cd2c6..7ed417750a7 100644 --- a/htdocs/adherents/list.php +++ b/htdocs/adherents/list.php @@ -425,10 +425,9 @@ print ''; print ''; print ''; -print ''; print ''; -print_barre_liste($titre, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'members', 0, $newcardbutton, '', $limit); +print_barre_liste($titre, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'members', 0, $newcardbutton, '', $limit, 0, 0, 1); $topicmail = "Information"; $modelmail = "member"; @@ -950,8 +949,6 @@ print "
ClickToDial URL
ClickToDial URL'; print ''; if (empty($conf->global->CLICKTODIAL_URL) && empty($object->clicktodial_url)) @@ -130,7 +130,7 @@ if ($id > 0) print '
ClickToDial '.$langs->trans("IdPhoneCaller").'
ClickToDial '.$langs->trans("IdPhoneCaller").''; print '
ClickToDial URL
ClickToDial URL'; $url = $conf->global->CLICKTODIAL_URL; if (!empty($object->clicktodial_url)) $url = $object->clicktodial_url; @@ -170,7 +170,7 @@ if ($id > 0) print '
ClickToDial '.$langs->trans("IdPhoneCaller").'
ClickToDial '.$langs->trans("IdPhoneCaller").''.(!empty($object->clicktodial_poste) ? $object->clicktodial_poste : '').'
\n"; print ""; print ''; -if ($num > $limit || $page) print_barre_liste('', $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'generic', 0, '', '', $limit, 1); - // End of page llxFooter(); $db->close(); From ea78fc48a8f08357e77cd1292eb593c5b684c994 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 12 Apr 2020 18:03:51 +0200 Subject: [PATCH 44/99] The variable $rep seems to be never defined. --- htdocs/core/lib/functions.lib.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 092e36cef72..df98bd66db3 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1,19 +1,19 @@ +/* Copyright (C) 2000-2007 Rodolphe Quiedeville * Copyright (C) 2003 Jean-Louis Bergamo * Copyright (C) 2004-2018 Laurent Destailleur * Copyright (C) 2004 Sebastien Di Cintio * Copyright (C) 2004 Benoit Mortier - * Copyright (C) 2004 Christophe Combelles + * Copyright (C) 2004 Christophe Combelles * Copyright (C) 2005-2019 Regis Houssin * Copyright (C) 2008 Raphael Bertrand (Resultic) * Copyright (C) 2010-2018 Juanjo Menent * Copyright (C) 2013 Cédric Salvador * Copyright (C) 2013-2017 Alexandre Spangaro - * Copyright (C) 2014 Cédric GROSS + * Copyright (C) 2014 Cédric GROSS * Copyright (C) 2014-2015 Marcos García * Copyright (C) 2015 Jean-François Ferry - * Copyright (C) 2018-2019 Frédéric France + * Copyright (C) 2018-2020 Frédéric France * Copyright (C) 2019 Thibault Foucart * * This program is free software; you can redistribute it and/or modify @@ -2270,7 +2270,7 @@ function dol_print_email($email, $cid = 0, $socid = 0, $addlink = 0, $max = 64, } //$rep = '
'; - $rep .= ($withpicto ?img_picto($langs->trans("EMail").' : '.$email, 'object_email.png').' ' : '').$newemail; + $rep = ($withpicto ?img_picto($langs->trans("EMail").' : '.$email, 'object_email.png').' ' : '').$newemail; //$rep .= '
'; if ($hookmanager) { $parameters = array('cid' => $cid, 'socid' => $socid, 'addlink' => $addlink, 'picto' => $withpicto); From 92b6b1a04256db55148b6c66e98fa0ebfcb157b3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 12 Apr 2020 18:13:43 +0200 Subject: [PATCH 45/99] Look and feel v12 --- htdocs/asset/list.php | 3 +- htdocs/bom/bom_list.php | 3 +- htdocs/comm/action/list.php | 3 +- htdocs/comm/mailing/list.php | 44 +++++++++++++------ htdocs/comm/propal/list.php | 3 +- htdocs/commande/list.php | 4 +- htdocs/compta/bank/bankentries_list.php | 11 ++++- .../compta/cashcontrol/cashcontrol_list.php | 3 +- htdocs/compta/facture/list.php | 3 +- htdocs/contrat/list.php | 3 +- htdocs/expensereport/list.php | 3 +- htdocs/fichinter/list.php | 3 +- htdocs/fourn/commande/list.php | 4 +- htdocs/fourn/facture/list.php | 3 +- htdocs/holiday/list.php | 3 +- htdocs/langs/en_US/bills.lang | 4 +- htdocs/loan/list.php | 4 +- htdocs/mrp/mo_list.php | 3 +- htdocs/opensurvey/list.php | 3 +- htdocs/projet/list.php | 3 +- htdocs/projet/tasks/list.php | 3 +- htdocs/resource/list.php | 15 +++++-- htdocs/supplier_proposal/list.php | 3 +- htdocs/ticket/list.php | 3 +- htdocs/user/group/list.php | 3 +- htdocs/user/list.php | 5 +-- 26 files changed, 75 insertions(+), 70 deletions(-) diff --git a/htdocs/asset/list.php b/htdocs/asset/list.php index e414193fb83..39fd0e0761d 100644 --- a/htdocs/asset/list.php +++ b/htdocs/asset/list.php @@ -328,12 +328,11 @@ print ''; print ''; print ''; -print ''; print ''; $newcardbutton = dolGetButtonTitle($langs->trans('NewAsset'), '', 'fa fa-plus-circle', dol_buildpath('/asset/card.php', 1).'?action=create&backtopage='.urlencode($_SERVER['PHP_SELF']), '', $permissiontoadd); -print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'accountancy', 0, $newcardbutton, '', $limit); +print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'accountancy', 0, $newcardbutton, '', $limit, 0, 0, 1); // Add code for pre mass action (confirmation or email presend form) $topicmail = "SendAssetsRef"; diff --git a/htdocs/bom/bom_list.php b/htdocs/bom/bom_list.php index 7f8826bf9e0..9678464327b 100644 --- a/htdocs/bom/bom_list.php +++ b/htdocs/bom/bom_list.php @@ -440,12 +440,11 @@ print ''; print ''; print ''; -print ''; print ''; $newcardbutton = dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/bom/bom_card.php?action=create&backtopage='.urlencode($_SERVER['PHP_SELF']), '', $user->rights->bom->write); -print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'cubes', 0, $newcardbutton, '', $limit); +print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'cubes', 0, $newcardbutton, '', $limit, 0, 0, 1); // Add code for pre mass action (confirmation or email presend form) $topicmail = "SendBillOfMaterialsRef"; diff --git a/htdocs/comm/action/list.php b/htdocs/comm/action/list.php index 3b738452699..9f28d278ed1 100644 --- a/htdocs/comm/action/list.php +++ b/htdocs/comm/action/list.php @@ -382,7 +382,6 @@ if ($resql) print ''; print ''; print ''; - print ''; print ''; $nav = ''; @@ -443,7 +442,7 @@ if ($resql) $newcardbutton .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create&datep='.sprintf("%04d%02d%02d", $tmpforcreatebutton['year'], $tmpforcreatebutton['mon'], $tmpforcreatebutton['mday']).$hourminsec.'&backtopage='.urlencode($_SERVER["PHP_SELF"].($newparam ? '?'.$newparam : ''))); } - print_barre_liste($s, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, -1 * $nbtotalofrecords, '', 0, $nav.$newcardbutton, '', $limit); + print_barre_liste($s, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, -1 * $nbtotalofrecords, '', 0, $nav.$newcardbutton, '', $limit, 0, 0, 1); $moreforfilter = ''; diff --git a/htdocs/comm/mailing/list.php b/htdocs/comm/mailing/list.php index 1eadb2d0da0..8feaa5a4d93 100644 --- a/htdocs/comm/mailing/list.php +++ b/htdocs/comm/mailing/list.php @@ -34,6 +34,7 @@ $result = restrictedArea($user, 'mailing'); $sortfield = GETPOST("sortfield", 'alpha'); $sortorder = GETPOST("sortorder", 'alpha'); $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; +$optioncss = GETPOST('optioncss', 'alpha'); $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); if (empty($page) || $page == -1 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha') || (empty($toselect) && $massaction === '0')) { $page = 0; } // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action $offset = $limit * $page; @@ -129,8 +130,6 @@ if ($filteremail) if ($search_all) $sql .= " AND (m.titre like '%".$db->escape($search_all)."%' OR m.sujet like '%".$db->escape($search_all)."%' OR m.body like '%".$db->escape($search_all)."%')"; if (!$sortorder) $sortorder = "ASC"; if (!$sortfield) $sortfield = "m.rowid"; - $sql .= $db->order($sortfield, $sortorder); - $sql .= $db->plimit($conf->liste_limit + 1, $offset); } else { @@ -141,15 +140,30 @@ else if ($search_all) $sql .= " AND (m.titre like '%".$db->escape($search_all)."%' OR m.sujet like '%".$db->escape($search_all)."%' OR m.body like '%".$db->escape($search_all)."%')"; if (!$sortorder) $sortorder = "ASC"; if (!$sortfield) $sortfield = "m.rowid"; - $sql .= $db->order($sortfield, $sortorder); - $sql .= $db->plimit($conf->liste_limit + 1, $offset); } -//print $sql; -$result = $db->query($sql); -if ($result) +$sql .= $db->order($sortfield, $sortorder); + +$nbtotalofrecords = ''; +if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { - $num = $db->num_rows($result); + $resql = $db->query($sql); + $nbtotalofrecords = $db->num_rows($resql); + if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0 + { + $page = 0; + $offset = 0; + } +} + +$sql .= $db->plimit($limit + 1, $offset); +//print $sql; + +dol_syslog("comm/mailing/list.php", LOG_DEBUG); +$resql = $db->query($sql); +if ($resql) +{ + $num = $db->num_rows($resql); $title = $langs->trans("ListOfEMailings"); if ($filteremail) $title .= ' ('.$langs->trans("SentTo", $filteremail).')'; @@ -163,17 +177,18 @@ if ($result) $i = 0; $param = "&search_all=".urlencode($search_all); + if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.urlencode($contextpage); + if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.urlencode($limit); if ($filteremail) $param .= '&filteremail='.urlencode($filteremail); - print '
'; + print ''; if ($optioncss != '') print ''; print ''; print ''; print ''; print ''; - print ''; - print_barre_liste($title, $page, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, '', $num, '', 'generic', 0, $newcardbutton); + print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'generic', 0, $newcardbutton, '', $limit, 0, 0, 1); $moreforfilter = ''; @@ -214,12 +229,12 @@ if ($result) while ($i < min($num, $limit)) { - $obj = $db->fetch_object($result); + $obj = $db->fetch_object($resql); $email->id = $obj->rowid; $email->ref = $obj->rowid; - print ""; + print ''; print ''; print $email->getNomUrl(1); @@ -280,7 +295,8 @@ if ($result) print ''; print ''; print '
'; - $db->free($result); + + $db->free($resql); } else { diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 7119bf2e01d..74a8ce7697f 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -494,10 +494,9 @@ if ($resql) print ''; print ''; print ''; - print ''; print ''; - print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'commercial', 0, $newcardbutton, '', $limit); + print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'commercial', 0, $newcardbutton, '', $limit, 0, 0, 1); $topicmail = "SendPropalRef"; $modelmail = "proposal_send"; diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 43fed8a4e77..0fcce9ad14f 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -499,13 +499,11 @@ if ($resql) print ''; print ''; print ''; - print ''; print ''; print ''; print ''; - - print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'commercial', 0, $newcardbutton, '', $limit); + print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'commercial', 0, $newcardbutton, '', $limit, 0, 0, 1); $topicmail = "SendOrderRef"; $modelmail = "order_send"; diff --git a/htdocs/compta/bank/bankentries_list.php b/htdocs/compta/bank/bankentries_list.php index 481ca2b03fe..fb97a2e9129 100644 --- a/htdocs/compta/bank/bankentries_list.php +++ b/htdocs/compta/bank/bankentries_list.php @@ -1187,7 +1187,13 @@ if ($resql) $reg = array(); preg_match('/\((.+)\)/i', $objp->label, $reg); // Si texte entoure de parenthee on tente recherche de traduction if ($reg[1] && $langs->trans($reg[1]) != $reg[1]) print $langs->trans($reg[1]); - else print dol_trunc($objp->label, 40); + else { + if ($objp->label == '(payment_salary)') { + print dol_trunc($langs->trans("SalaryPayment", 40)); + } else { + print dol_trunc($objp->label, 40); + } + } //print "
 "; // Add links after description @@ -1195,6 +1201,7 @@ if ($resql) $cachebankaccount = array(); foreach ($links as $key=>$val) { + print ''; if ($links[$key]['type'] == 'withdraw') { $banktransferstatic->id = $links[$key]['url_id']; @@ -1540,7 +1547,7 @@ if ($resql) if ($user->rights->banque->modifier) { print 'rowid.'&id='.$objp->bankid.'&page='.$page.'">'; - print img_delete(); + print img_delete('', 'class="marginleftonly"'); print ''; } } diff --git a/htdocs/compta/cashcontrol/cashcontrol_list.php b/htdocs/compta/cashcontrol/cashcontrol_list.php index d559fad2b30..313627016c8 100644 --- a/htdocs/compta/cashcontrol/cashcontrol_list.php +++ b/htdocs/compta/cashcontrol/cashcontrol_list.php @@ -333,14 +333,13 @@ print ''; print ''; print ''; -print ''; print ''; $permforcashfence = 1; $newcardbutton = dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/compta/cashcontrol/cashcontrol_card.php?action=create&backtopage='.urlencode($_SERVER['PHP_SELF']), '', $permforcashfence); -print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'cash-register', 0, $newcardbutton, '', $limit); +print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'cash-register', 0, $newcardbutton, '', $limit, 0, 0, 1); // Add code for pre mass action (confirmation or email presend form) $topicmail = "SendCashControlRef"; diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index d1df1d6ea24..9dc99b482ff 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -688,11 +688,10 @@ if ($resql) print ''; print ''; print ''; - print ''; print ''; print ''; - print_barre_liste($langs->trans('BillsCustomers').' '.($socid ? ' '.$soc->name : ''), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'invoicing', 0, $newcardbutton, '', $limit); + print_barre_liste($langs->trans('BillsCustomers').' '.($socid ? ' '.$soc->name : ''), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'invoicing', 0, $newcardbutton, '', $limit, 0, 0, 1); $topicmail = "SendBillRef"; $modelmail = "facture_send"; diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php index 7563013edf0..380ab05f01a 100644 --- a/htdocs/contrat/list.php +++ b/htdocs/contrat/list.php @@ -382,10 +382,9 @@ print ''; print ''; print ''; -print ''; print ''; -print_barre_liste($langs->trans("ListOfContracts"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $totalnboflines, 'commercial', 0, $newcardbutton, '', $limit); +print_barre_liste($langs->trans("ListOfContracts"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $totalnboflines, 'commercial', 0, $newcardbutton, '', $limit, 0, 0, 1); $topicmail = "SendContractRef"; $modelmail = "contract"; diff --git a/htdocs/expensereport/list.php b/htdocs/expensereport/list.php index 7e908cc7971..bf2e1ee696f 100644 --- a/htdocs/expensereport/list.php +++ b/htdocs/expensereport/list.php @@ -373,7 +373,6 @@ if ($resql) print ''; print ''; print ''; - print ''; print ''; print ''; print ''; @@ -477,7 +476,7 @@ if ($resql) $newcardbutton .= dolGetButtonTitle($langs->trans('NewTrip'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/expensereport/card.php?action=create'); } - print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'trip', 0, $newcardbutton, '', $limit); + print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'trip', 0, $newcardbutton, '', $limit, 0, 0, 1); } $topicmail = "SendExpenseReport"; diff --git a/htdocs/fichinter/list.php b/htdocs/fichinter/list.php index cd62ac50fcb..f67e12684fa 100644 --- a/htdocs/fichinter/list.php +++ b/htdocs/fichinter/list.php @@ -329,12 +329,11 @@ if ($resql) print ''; print ''; print ''; - print ''; print ''; print ''; print ''; - print_barre_liste($title, $page, $_SERVER['PHP_SELF'], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'commercial', 0, $newcardbutton, '', $limit); + print_barre_liste($title, $page, $_SERVER['PHP_SELF'], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'commercial', 0, $newcardbutton, '', $limit, 0, 0, 1); $topicmail = "Information"; $modelmail = "intervention"; diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index d7836d47d86..7cfdd99ce78 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -671,12 +671,12 @@ if ($resql) print ''; print ''; print ''; - print ''; print ''; print ''; print ''; print ''; - print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'commercial', 0, $newcardbutton, '', $limit); + + print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'commercial', 0, $newcardbutton, '', $limit, 0, 0, 1); $topicmail = "SendOrderRef"; $modelmail = "order_supplier_send"; diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index e7055399f6f..6197f6ba363 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -523,11 +523,10 @@ if ($resql) print ''; print ''; print ''; - print ''; print ''; print ''; - print_barre_liste($langs->trans("BillsSuppliers").($socid ? ' '.$soc->name : ''), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'invoicing', 0, $newcardbutton, '', $limit); + print_barre_liste($langs->trans("BillsSuppliers").($socid ? ' '.$soc->name : ''), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'invoicing', 0, $newcardbutton, '', $limit, 0, 0, 1); $topicmail = "SendBillRef"; $modelmail = "invoice_supplier_send"; diff --git a/htdocs/holiday/list.php b/htdocs/holiday/list.php index d21809ade7b..daa5a37b51b 100644 --- a/htdocs/holiday/list.php +++ b/htdocs/holiday/list.php @@ -391,7 +391,6 @@ if ($resql) print ''; print ''; print ''; - print ''; print ''; print ''; print ''; @@ -441,7 +440,7 @@ if ($resql) $newcardbutton .= dolGetButtonTitle($langs->trans('MenuAddCP'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/holiday/card.php?action=request'); } - print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_hrm', 0, $newcardbutton, '', $limit); + print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_hrm', 0, $newcardbutton, '', $limit, 0, 0, 1); } $topicmail = "Information"; diff --git a/htdocs/langs/en_US/bills.lang b/htdocs/langs/en_US/bills.lang index 55b2aa88ec1..1293a51c193 100644 --- a/htdocs/langs/en_US/bills.lang +++ b/htdocs/langs/en_US/bills.lang @@ -58,8 +58,8 @@ SuppliersInvoices=Vendors invoices SupplierBill=Vendor invoice SupplierBills=suppliers invoices Payment=Payment -PaymentBack=Payment back -CustomerInvoicePaymentBack=Payment back +PaymentBack=Refund +CustomerInvoicePaymentBack=Refund Payments=Payments PaymentsBack=Refunds paymentInInvoiceCurrency=in invoices currency diff --git a/htdocs/loan/list.php b/htdocs/loan/list.php index 1cde7792981..380d475398e 100644 --- a/htdocs/loan/list.php +++ b/htdocs/loan/list.php @@ -165,11 +165,9 @@ if ($resql) print ''; print ''; print ''; - print ''; print ''; - print ''; - print_barre_liste($langs->trans("Loans"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_accountancy.png', 0, $newcardbutton, '', $limit); + print_barre_liste($langs->trans("Loans"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_accountancy.png', 0, $newcardbutton, '', $limit, 0, 0, 1); $moreforfilter = ''; diff --git a/htdocs/mrp/mo_list.php b/htdocs/mrp/mo_list.php index 4e5a2db68f0..3c1cb1a588e 100644 --- a/htdocs/mrp/mo_list.php +++ b/htdocs/mrp/mo_list.php @@ -356,12 +356,11 @@ print ''; print ''; print ''; -print ''; print ''; $newcardbutton = dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/mrp/mo_card.php?action=create&backtopage='.urlencode($_SERVER['PHP_SELF']), '', $permissiontoadd); -print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'cubes', 0, $newcardbutton, '', $limit); +print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'cubes', 0, $newcardbutton, '', $limit, 0, 0, 1); // Add code for pre mass action (confirmation or email presend form) $topicmail = "SendMoRef"; diff --git a/htdocs/opensurvey/list.php b/htdocs/opensurvey/list.php index a1da38545fc..990f9a30e73 100644 --- a/htdocs/opensurvey/list.php +++ b/htdocs/opensurvey/list.php @@ -250,12 +250,11 @@ print ''; print ''; print ''; -print ''; print ''; $newcardbutton = dolGetButtonTitle($langs->trans('NewSurvey'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/opensurvey/wizard/index.php', '', $user->rights->opensurvey->write); -print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'generic', 0, $newcardbutton, '', $limit); +print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'generic', 0, $newcardbutton, '', $limit, 0, 0, 1); // Add code for pre mass action (confirmation or email presend form) $topicmail = "SendOpenSurveyRef"; diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php index e04875294bf..8ed94cc1180 100644 --- a/htdocs/projet/list.php +++ b/htdocs/projet/list.php @@ -453,7 +453,6 @@ print ''; print ''; print ''; -print ''; print ''; print ''; @@ -466,7 +465,7 @@ else else $texthelp .= $langs->trans("ProjectsPublicDesc"); } -print_barre_liste($form->textwithpicto($title, $texthelp), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'project', 0, $newcardbutton, '', $limit); +print_barre_liste($form->textwithpicto($title, $texthelp), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'project', 0, $newcardbutton, '', $limit, 0, 0, 1); $topicmail = "Information"; diff --git a/htdocs/projet/tasks/list.php b/htdocs/projet/tasks/list.php index 014befe51c0..67131c29ef4 100644 --- a/htdocs/projet/tasks/list.php +++ b/htdocs/projet/tasks/list.php @@ -429,7 +429,6 @@ print ''; print ''; print ''; print ''; -print ''; print ''; print ''; @@ -442,7 +441,7 @@ else else $texthelp .= $langs->trans("TasksOnProjectsPublicDesc"); } -print_barre_liste($form->textwithpicto($title, $texthelp), $page, $_SERVER["PHP_SELF"], "", $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'project', 0, $newcardbutton, '', $limit); +print_barre_liste($form->textwithpicto($title, $texthelp), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'project', 0, $newcardbutton, '', $limit, 0, 0, 1); $topicmail = "Information"; $modelmail = "task"; diff --git a/htdocs/resource/list.php b/htdocs/resource/list.php index 07c43251d3d..e987ef474f6 100644 --- a/htdocs/resource/list.php +++ b/htdocs/resource/list.php @@ -55,8 +55,16 @@ if (!is_array($search_array_options)) $search_array_options = array(); $search_ref = GETPOST("search_ref", 'alpha'); $search_type = GETPOST("search_type", 'alpha'); +// Load variable for pagination +$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; + + $filter = array(); +$param = ''; +if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.urlencode($contextpage); +if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.urlencode($limit); + if ($search_ref != '') { $param .= '&search_ref='.urlencode($search_ref); $filter['t.ref'] = $search_ref; @@ -170,7 +178,6 @@ print ''; print ''; print ''; -print ''; print ''; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) @@ -196,7 +203,7 @@ if ($ret == -1) { $newcardbutton .= dolGetButtonTitle($langs->trans('MenuResourceAdd'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/resource/card.php?action=create'); } - print_barre_liste($pagetitle, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $ret + 1, $nbtotalofrecords, 'generic', 0, $newcardbutton, '', $limit); + print_barre_liste($pagetitle, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $ret + 1, $nbtotalofrecords, 'generic', 0, $newcardbutton, '', $limit, 0, 0, 1); } $moreforfilter = ''; @@ -261,12 +268,12 @@ if ($ret) include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; print ''; - print ''; + print ''; print img_edit(); print ''; print ' '; print ''; - print img_delete(); + print img_delete('', 'class="marginleftonly"'); print ''; print ''; if (!$i) $totalarray['nbfield']++; diff --git a/htdocs/supplier_proposal/list.php b/htdocs/supplier_proposal/list.php index 5d408be75ef..eaae3be5e84 100644 --- a/htdocs/supplier_proposal/list.php +++ b/htdocs/supplier_proposal/list.php @@ -429,9 +429,8 @@ if ($resql) print ''; print ''; print ''; - print ''; - print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'commercial', 0, $newcardbutton, '', $limit); + print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'commercial', 0, $newcardbutton, '', $limit, 0, 0, 1); $topicmail = "SendSupplierProposalRef"; $modelmail = "supplier_proposal_send"; diff --git a/htdocs/ticket/list.php b/htdocs/ticket/list.php index a63e0be34b4..078b8fc6d53 100644 --- a/htdocs/ticket/list.php +++ b/htdocs/ticket/list.php @@ -463,7 +463,6 @@ print ''; print ''; print ''; -print ''; print ''; print ''; if ($socid) print ''; @@ -475,7 +474,7 @@ $newcardbutton .= dolGetButtonTitle($langs->trans('NewTicket'), '', 'fa fa-plus- $picto = 'ticket'; if ($socid > 0) $picto = ''; -print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, $picto, 0, $newcardbutton, '', $limit); +print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, $picto, 0, $newcardbutton, '', $limit, 0, 0, 1); if ($mode == 'mine') { print '
'.$langs->trans('TicketAssignedToMeInfos').'

'; diff --git a/htdocs/user/group/list.php b/htdocs/user/group/list.php index 3dd55994188..4d2875f07ef 100644 --- a/htdocs/user/group/list.php +++ b/htdocs/user/group/list.php @@ -152,11 +152,10 @@ if ($resql) print ''; print ''; print ''; - print ''; print ''; print ''; - print_barre_liste($text, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, "", $num, $nbtotalofrecords, 'generic', 0, $newcardbutton, '', $limit); + print_barre_liste($text, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, "", $num, $nbtotalofrecords, 'generic', 0, $newcardbutton, '', $limit, 0, 0, 1); if ($sall) { diff --git a/htdocs/user/list.php b/htdocs/user/list.php index e81d50f077f..090be8f855c 100644 --- a/htdocs/user/list.php +++ b/htdocs/user/list.php @@ -315,15 +315,12 @@ print ''; print ''; print ''; print ''; -print ''; print ''; print ''; - $morehtmlright .= dolGetButtonTitle($langs->trans("HierarchicView"), '', 'fa fa-sitemap paddingleft', DOL_URL_ROOT.'/user/hierarchy.php'.(($search_statut != '' && $search_statut >= 0) ? '?search_statut='.$search_statut : '')); - -print_barre_liste($text, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, "", $num, $nbtotalofrecords, 'user', 0, $morehtmlright.' '.$newcardbutton, '', $limit); +print_barre_liste($text, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, "", $num, $nbtotalofrecords, 'user', 0, $morehtmlright.' '.$newcardbutton, '', $limit, 0, 0, 1); if (!empty($catid)) { From d47c566c4d322581a851106162392b0d759a0772 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 12 Apr 2020 18:15:38 +0200 Subject: [PATCH 46/99] Fix class not found --- htdocs/takepos/index.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/htdocs/takepos/index.php b/htdocs/takepos/index.php index f9a3c725032..bba62298989 100644 --- a/htdocs/takepos/index.php +++ b/htdocs/takepos/index.php @@ -33,6 +33,7 @@ if (!defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); if (!defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); require '../main.inc.php'; // Load $user and permissions +require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; @@ -82,10 +83,13 @@ else $soc->fetch($conf->global->$constforcompanyid); $result = restrictedArea($user, 'takepos', 0, ''); + /* * View */ +$form = new Form($db); + // Title $title = 'TakePOS - Dolibarr '.DOL_VERSION; if (!empty($conf->global->MAIN_APPLICATION_TITLE)) $title = 'TakePOS - '.$conf->global->MAIN_APPLICATION_TITLE; From 239ae78b283db4e60fecaa668578c9a2073ee8ae Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 12 Apr 2020 18:36:22 +0200 Subject: [PATCH 47/99] Look and feel v12 --- htdocs/user/group/card.php | 6 ++++-- htdocs/user/group/list.php | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/htdocs/user/group/card.php b/htdocs/user/group/card.php index 19c52b6fa7f..335b66ebdd2 100644 --- a/htdocs/user/group/card.php +++ b/htdocs/user/group/card.php @@ -266,7 +266,7 @@ $formfile = new FormFile($db); if ($action == 'create') { - print load_fiche_titre($langs->trans("NewGroup")); + print load_fiche_titre($langs->trans("NewGroup"), '', 'object_group'); print dol_set_focus('#nom'); @@ -404,6 +404,7 @@ else /* * Barre d'actions */ + print '
'; if ($caneditperms) @@ -512,6 +513,7 @@ else /* * Documents generes */ + $filename = dol_sanitizeFileName($object->ref); $filedir = $conf->usergroup->dir_output."/".dol_sanitizeFileName($object->ref); $urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id; @@ -531,13 +533,13 @@ else $formactions = new FormActions($db); $somethingshown = $formactions->showactions($object, 'usergroup', $socid, 1);*/ - print '
'; } /* * Fiche en mode edition */ + if ($action == 'edit' && $caneditperms) { print '
'; diff --git a/htdocs/user/group/list.php b/htdocs/user/group/list.php index 4d2875f07ef..1701d2ae9c1 100644 --- a/htdocs/user/group/list.php +++ b/htdocs/user/group/list.php @@ -155,7 +155,7 @@ if ($resql) print ''; print ''; - print_barre_liste($text, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, "", $num, $nbtotalofrecords, 'generic', 0, $newcardbutton, '', $limit, 0, 0, 1); + print_barre_liste($text, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, "", $num, $nbtotalofrecords, 'object_group', 0, $newcardbutton, '', $limit, 0, 0, 1); if ($sall) { From 4bfc90079888e7b17df4c66753858257bfa8f149 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 12 Apr 2020 18:41:42 +0200 Subject: [PATCH 48/99] Look and feel v12 --- htdocs/adherents/stats/byproperties.php | 5 +++-- htdocs/adherents/stats/geo.php | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/htdocs/adherents/stats/byproperties.php b/htdocs/adherents/stats/byproperties.php index abc9b6d80a7..7927c2e3f00 100644 --- a/htdocs/adherents/stats/byproperties.php +++ b/htdocs/adherents/stats/byproperties.php @@ -58,7 +58,7 @@ llxHeader('', $langs->trans("MembersStatisticsByProperties"), '', '', 0, 0, arra $title = $langs->trans("MembersStatisticsByProperties"); -print load_fiche_titre($title, ''); +print load_fiche_titre($title, '', 'object_group'); dol_mkdir($dir); @@ -113,7 +113,8 @@ if (!count($data)) } else { - print load_fiche_titre($langs->trans("MembersByNature"), '', ''); + print $langs->trans("MembersByNature").'
'; + print '
'; } // Print array diff --git a/htdocs/adherents/stats/geo.php b/htdocs/adherents/stats/geo.php index 683ae558d28..5b51008a9a2 100644 --- a/htdocs/adherents/stats/geo.php +++ b/htdocs/adherents/stats/geo.php @@ -64,7 +64,7 @@ if ($mode == 'memberbyregion') $title = $langs->trans("MembersStatisticsByRegion llxHeader('', $title, '', '', 0, 0, $arrayjs); -print load_fiche_titre($title, $mesg); +print load_fiche_titre($title, '', 'object_group'); dol_mkdir($dir); From b6baba7651266374fb99427f67c66ed4c96b55a7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 12 Apr 2020 18:59:22 +0200 Subject: [PATCH 49/99] Removed deprecated var --- htdocs/accountancy/admin/fiscalyear_card.php | 12 ++++++------ htdocs/compta/deplacement/card.php | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/htdocs/accountancy/admin/fiscalyear_card.php b/htdocs/accountancy/admin/fiscalyear_card.php index facbb5052e2..88890aa004f 100644 --- a/htdocs/accountancy/admin/fiscalyear_card.php +++ b/htdocs/accountancy/admin/fiscalyear_card.php @@ -274,23 +274,23 @@ if ($action == 'create') // Label print ''; - print $form->editfieldkey("Label", 'label', $object->label, $object, $conf->global->MAIN_EDIT_ALSO_INLINE, 'alpha:32'); + print $form->editfieldkey("Label", 'label', $object->label, $object, 1, 'alpha:32'); print ''; - print $form->editfieldval("Label", 'label', $object->label, $object, $conf->global->MAIN_EDIT_ALSO_INLINE, 'alpha:32'); + print $form->editfieldval("Label", 'label', $object->label, $object, 1, 'alpha:32'); print ""; // Date start print ''; - print $form->editfieldkey("DateStart", 'date_start', $object->date_start, $object, $conf->global->MAIN_EDIT_ALSO_INLINE, 'datepicker'); + print $form->editfieldkey("DateStart", 'date_start', $object->date_start, $object, 1, 'datepicker'); print ''; - print $form->editfieldval("DateStart", 'date_start', $object->date_start, $object, $conf->global->MAIN_EDIT_ALSO_INLINE, 'datepicker'); + print $form->editfieldval("DateStart", 'date_start', $object->date_start, $object, 1, 'datepicker'); print ''; // Date end print ''; - print $form->editfieldkey("DateEnd", 'date_end', $object->date_end, $object, $conf->global->MAIN_EDIT_ALSO_INLINE, 'datepicker'); + print $form->editfieldkey("DateEnd", 'date_end', $object->date_end, $object, 1, 'datepicker'); print ''; - print $form->editfieldval("DateEnd", 'date_end', $object->date_end, $object, $conf->global->MAIN_EDIT_ALSO_INLINE, 'datepicker'); + print $form->editfieldval("DateEnd", 'date_end', $object->date_end, $object, 1, 'datepicker'); print ''; // Statut diff --git a/htdocs/compta/deplacement/card.php b/htdocs/compta/deplacement/card.php index de5cdb30205..463d9ea699f 100644 --- a/htdocs/compta/deplacement/card.php +++ b/htdocs/compta/deplacement/card.php @@ -439,9 +439,9 @@ elseif ($id) // Type print ''; - print $form->editfieldkey("Type", 'type', $langs->trans($object->type), $object, $conf->global->MAIN_EDIT_ALSO_INLINE && $user->rights->deplacement->creer, 'select:types_fees'); + print $form->editfieldkey("Type", 'type', $langs->trans($object->type), $object, $user->rights->deplacement->creer, 'select:types_fees'); print ''; - print $form->editfieldval("Type", 'type', $form->cache_types_fees[$object->type], $object, $conf->global->MAIN_EDIT_ALSO_INLINE && $user->rights->deplacement->creer, 'select:types_fees'); + print $form->editfieldval("Type", 'type', $form->cache_types_fees[$object->type], $object, $user->rights->deplacement->creer, 'select:types_fees'); print ''; // Who @@ -453,16 +453,16 @@ elseif ($id) // Date print ''; - print $form->editfieldkey("Date", 'dated', $object->date, $object, $conf->global->MAIN_EDIT_ALSO_INLINE && $user->rights->deplacement->creer, 'datepicker'); + print $form->editfieldkey("Date", 'dated', $object->date, $object, $user->rights->deplacement->creer, 'datepicker'); print ''; - print $form->editfieldval("Date", 'dated', $object->date, $object, $conf->global->MAIN_EDIT_ALSO_INLINE && $user->rights->deplacement->creer, 'datepicker'); + print $form->editfieldval("Date", 'dated', $object->date, $object, $user->rights->deplacement->creer, 'datepicker'); print ''; // Km/Price print ''; - print $form->editfieldkey("FeesKilometersOrAmout", 'km', $object->km, $object, $conf->global->MAIN_EDIT_ALSO_INLINE && $user->rights->deplacement->creer, 'numeric:6'); + print $form->editfieldkey("FeesKilometersOrAmout", 'km', $object->km, $object, $user->rights->deplacement->creer, 'numeric:6'); print ''; - print $form->editfieldval("FeesKilometersOrAmout", 'km', $object->km, $object, $conf->global->MAIN_EDIT_ALSO_INLINE && $user->rights->deplacement->creer, 'numeric:6'); + print $form->editfieldval("FeesKilometersOrAmout", 'km', $object->km, $object, $user->rights->deplacement->creer, 'numeric:6'); print ""; // Where From 52b467d2fc8aa6ab12f43deffe3aec09aac8daeb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 12 Apr 2020 19:06:44 +0200 Subject: [PATCH 50/99] FIX #13550 Removed not used table --- .../install/mysql/tables/llx_societe_log.sql | 29 ------------------- htdocs/societe/class/societe.class.php | 2 -- 2 files changed, 31 deletions(-) delete mode 100644 htdocs/install/mysql/tables/llx_societe_log.sql diff --git a/htdocs/install/mysql/tables/llx_societe_log.sql b/htdocs/install/mysql/tables/llx_societe_log.sql deleted file mode 100644 index 91a7ea65087..00000000000 --- a/htdocs/install/mysql/tables/llx_societe_log.sql +++ /dev/null @@ -1,29 +0,0 @@ --- ======================================================================== --- Copyright (C) 2002-2003 Rodolphe Quiedeville --- Copyright (C) 2007 Laurent Destailleur --- --- 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 --- the Free Software Foundation; either version 3 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program. If not, see . --- --- ======================================================================== - -create table llx_societe_log -( - id integer AUTO_INCREMENT PRIMARY KEY, - datel datetime, - fk_soc integer, -- Ne pas mettre de controle d'integrite sur les tables de logs - fk_statut integer, -- Ne pas mettre de controle d'integrite sur les tables de logs - fk_user integer, -- Ne pas mettre de controle d'integrite sur les tables de logs - author varchar(30), - label varchar(128) -)ENGINE=innodb; diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 6c5889b89fe..2267816f87b 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -87,7 +87,6 @@ class Societe extends CommonObject */ protected $childtablesoncascade = array( "societe_prices", - "societe_log", "societe_address", "product_fournisseur_price", "product_customer_price_log", @@ -4424,7 +4423,6 @@ class Societe extends CommonObject $tables = array( 'societe_address', 'societe_commerciaux', - 'societe_log', 'societe_prices', 'societe_remise', 'societe_remise_except', From ed51ce8734c1587b22b64188261b139ce5cca36f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 12 Apr 2020 19:56:50 +0200 Subject: [PATCH 51/99] Look and feel v12 --- htdocs/bom/bom_card.php | 2 +- htdocs/bom/bom_list.php | 2 +- htdocs/core/lib/functions.lib.php | 21 +++++++++++++-------- htdocs/mrp/index.php | 2 +- htdocs/mrp/mo_card.php | 4 ++-- htdocs/mrp/mo_list.php | 2 +- htdocs/product/stock/card.php | 2 +- htdocs/product/stock/index.php | 2 +- htdocs/product/stock/list.php | 2 +- htdocs/product/stock/massstockmove.php | 2 +- htdocs/product/stock/movement_list.php | 5 ++--- htdocs/product/stock/replenish.php | 2 +- 12 files changed, 26 insertions(+), 22 deletions(-) diff --git a/htdocs/bom/bom_card.php b/htdocs/bom/bom_card.php index 1f4498cf9cc..48e9c9d965a 100644 --- a/htdocs/bom/bom_card.php +++ b/htdocs/bom/bom_card.php @@ -256,7 +256,7 @@ jQuery(document).ready(function() { // Part to create if ($action == 'create') { - print load_fiche_titre($langs->trans("NewBOM"), '', 'cubes'); + print load_fiche_titre($langs->trans("NewBOM"), '', 'bom'); print ''; print ''; diff --git a/htdocs/bom/bom_list.php b/htdocs/bom/bom_list.php index 9678464327b..e2bafbecb48 100644 --- a/htdocs/bom/bom_list.php +++ b/htdocs/bom/bom_list.php @@ -444,7 +444,7 @@ print ''; $newcardbutton = dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/bom/bom_card.php?action=create&backtopage='.urlencode($_SERVER['PHP_SELF']), '', $user->rights->bom->write); -print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'cubes', 0, $newcardbutton, '', $limit, 0, 0, 1); +print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'bom', 0, $newcardbutton, '', $limit, 0, 0, 1); // Add code for pre mass action (confirmation or email presend form) $topicmail = "SendBillOfMaterialsRef"; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index df98bd66db3..4b436b61c47 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3139,13 +3139,15 @@ 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', - 'address', 'bank_account', 'barcode', 'bank', 'bookmark', 'building', 'cash-register', 'check', 'close_title', 'company', 'contact', 'cubes', + 'address', 'bank_account', 'barcode', 'bank', 'bookmark', 'bom', 'building', 'cash-register', 'check', 'close_title', 'company', 'contact', 'cubes', 'delete', 'dolly', 'edit', 'ellipsis-h', - 'filter', 'file-code', 'folder', 'folder-open', 'grip', 'grip_title', 'help', 'language', 'list', 'listlight', 'note', - 'object_action', 'object_account', 'object_barcode', 'object_phoning', 'object_phoning_fax', 'object_email', - 'object_accounting', 'object_category', 'object_bookmark', 'object_bug', 'object_generic', 'object_list-alt', 'object_calendar', 'object_calendarweek', 'object_calendarmonth', 'object_calendarday', 'object_calendarperuser', + 'filter', 'file-code', 'folder', 'folder-open', 'grip', 'grip_title', 'help', 'language', 'list', 'listlight', 'mrp', 'note', 'stock', + 'object_accounting', 'object_action', 'object_account', 'object_barcode', 'object_bom', + 'object_category', 'object_bookmark', 'object_bug', 'object_generic', 'object_list-alt', 'object_calendar', 'object_calendarweek', 'object_calendarmonth', 'object_calendarday', 'object_calendarperuser', 'object_cash-register', 'object_company', 'object_contact', 'object_contract', 'object_holiday', 'object_hrm', 'object_multicurrency', 'object_payment', + 'object_mrp', 'object_stock', 'object_paragraph', 'object_printer', 'object_resource', 'object_rss', 'object_technic', 'object_ticket', 'object_trip', 'object_user', 'object_group', 'object_member', 'object_other', + 'object_phoning', 'object_phoning_fax', 'object_email', 'off', 'on', 'paiment', 'play', 'playdisabled', 'printer', 'resize', 'stats', 'trip', 'note', 'setup', 'sign-out', 'split', 'switch_off', 'switch_on', 'tools', 'unlink', 'uparrow', 'user', 'wrench', 'globe', 'jabber', 'skype', 'twitter', 'facebook', 'linkedin', 'instagram', 'snapchat', 'youtube', 'google-plus-g', 'whatsapp', @@ -3168,21 +3170,22 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ $pictowithouttext = str_replace('object_', '', $pictowithouttext); $arrayconvpictotofa = array( - 'account'=>'university', 'action'=>'calendar-alt', 'address'=> 'address-book', 'bank_account'=>'university', + 'account'=>'university', 'action'=>'calendar-alt', 'address'=> 'address-book', 'bank_account'=>'university', 'bom'=>'cubes', 'company'=>'building', 'contact'=>'address-book', 'contract'=>'suitcase', 'setup'=>'cog', 'companies'=>'building', 'products'=>'cube', 'commercial'=>'suitcase', 'invoicing'=>'coins', 'accountancy'=>'money-check-alt', 'accounting'=>'chart-line', 'category'=>'tag', 'hrm'=>'umbrella-beach', 'members'=>'users', 'ticket'=>'ticket-alt', 'globe'=>'external-link-alt', 'email'=>'at', 'edit'=>'pencil-alt', 'grip_title'=>'arrows-alt', 'grip'=>'arrows-alt', 'help'=>'info-circle', - 'generic'=>'file', 'holiday'=>'umbrella-beach', 'member'=>'users', 'trip'=>'wallet', 'group'=>'users', + 'generic'=>'file', 'holiday'=>'umbrella-beach', 'member'=>'users', 'mrp'=>'cubes', 'trip'=>'wallet', 'group'=>'users', 'sign-out'=>'sign-out-alt', 'switch_off'=>'toggle-off', 'switch_on'=>'toggle-on', 'check'=>'check', 'bookmark'=>'star', 'bookmark'=>'star', 'stats' => 'chart-bar', 'bank'=>'university', 'close_title'=>'window-close', 'delete'=>'trash', 'edit'=>'pencil-alt', 'filter'=>'filter', 'split'=>'code-branch', 'list-alt'=>'list-alt', 'calendar'=>'calendar-alt', 'calendarweek'=>'calendar-week', 'calendarmonth'=>'calendar-alt', 'calendarday'=>'calendar-day', 'calendarperuser'=>'table', 'multicurrency'=>'dollar-sign', 'other'=>'square', 'resource'=>'laptop-house', 'error'=>'exclamation-triangle', 'warning'=>'exclamation-triangle', - 'payment'=>'money-bill-alt', 'phoning'=>'phone', 'phoning_fax'=>'fax', 'printer'=>'print', 'technic'=>'cogs', 'ticket'=>'ticket-alt', + 'payment'=>'money-bill-alt', 'phoning'=>'phone', 'phoning_fax'=>'fax', 'printer'=>'print', + 'stock'=>'box-open', 'technic'=>'cogs', 'ticket'=>'ticket-alt', 'title_setup'=>'tools', 'title_accountancy'=>'money-check-alt', 'title_bank'=>'university', 'title_hrm'=>'umbrella-beach', 'title_agenda'=>'calendar-alt', 'playdisabled'=>'play', 'preview'=>'binoculars', 'project'=>'sitemap', 'resize'=>'crop', @@ -3252,7 +3255,9 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ // Define $color $arrayconvpictotocolor = array( - 'address'=>'#37a', 'building'=>'#37a', 'companies'=>'#37a', 'company'=>'#37a', 'contact'=>'#37a', 'edit'=>'#444', 'note'=>'#999', 'error'=>'', 'listlight'=>'#999', + 'address'=>'#37a', 'building'=>'#37a', 'bom'=>'#993', + 'companies'=>'#37a', 'company'=>'#37a', 'contact'=>'#37a', 'edit'=>'#444', 'note'=>'#999', 'error'=>'', 'listlight'=>'#999', + 'mrp'=>'#993', 'stock'=>'#993', 'other'=>'#ddd', 'playdisabled'=>'#ccc', 'printer'=>'#444', 'resize'=>'#444', 'rss'=>'#cba', 'stats'=>'#444', 'switch_off'=>'#999', 'uparrow'=>'#555', 'warning'=>'' diff --git a/htdocs/mrp/index.php b/htdocs/mrp/index.php index 5762b260b60..f0bdc8ba62d 100644 --- a/htdocs/mrp/index.php +++ b/htdocs/mrp/index.php @@ -51,7 +51,7 @@ $staticmo = new Mo($db); llxHeader('', $langs->trans("MRP"), ''); -print load_fiche_titre($langs->trans("MRPArea"), '', 'cubes'); +print load_fiche_titre($langs->trans("MRPArea"), '', 'mrp'); print '
'; diff --git a/htdocs/mrp/mo_card.php b/htdocs/mrp/mo_card.php index 5f23daa036d..91f6f75b332 100644 --- a/htdocs/mrp/mo_card.php +++ b/htdocs/mrp/mo_card.php @@ -203,7 +203,7 @@ jQuery(document).ready(function() { // Part to create if ($action == 'create') { - print load_fiche_titre($langs->trans("NewObject", $langs->transnoentitiesnoconv("Mo")), '', 'cubes'); + print load_fiche_titre($langs->trans("NewObject", $langs->transnoentitiesnoconv("Mo")), '', 'mrp'); print ''; print ''; @@ -306,7 +306,7 @@ if ($action == 'create') // Part to edit record if (($id || $ref) && $action == 'edit') { - print load_fiche_titre($langs->trans("MO"), '', 'cubes'); + print load_fiche_titre($langs->trans("MO"), '', 'mrp'); print ''; print ''; diff --git a/htdocs/mrp/mo_list.php b/htdocs/mrp/mo_list.php index 3c1cb1a588e..b51171e6684 100644 --- a/htdocs/mrp/mo_list.php +++ b/htdocs/mrp/mo_list.php @@ -360,7 +360,7 @@ print ''; $newcardbutton = dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/mrp/mo_card.php?action=create&backtopage='.urlencode($_SERVER['PHP_SELF']), '', $permissiontoadd); -print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'cubes', 0, $newcardbutton, '', $limit, 0, 0, 1); +print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'mrp', 0, $newcardbutton, '', $limit, 0, 0, 1); // Add code for pre mass action (confirmation or email presend form) $topicmail = "SendMoRef"; diff --git a/htdocs/product/stock/card.php b/htdocs/product/stock/card.php index 074471c2a75..11b901a9c66 100644 --- a/htdocs/product/stock/card.php +++ b/htdocs/product/stock/card.php @@ -248,7 +248,7 @@ llxHeader("", $langs->trans("WarehouseCard"), $help_url); if ($action == 'create') { - print load_fiche_titre($langs->trans("NewWarehouse")); + print load_fiche_titre($langs->trans("NewWarehouse"), '', 'stock'); dol_set_focus('input[name="libelle"]'); diff --git a/htdocs/product/stock/index.php b/htdocs/product/stock/index.php index c5cc3b90a7e..92b68da7d10 100644 --- a/htdocs/product/stock/index.php +++ b/htdocs/product/stock/index.php @@ -50,7 +50,7 @@ $warehouse = new Entrepot($db); $help_url = 'EN:Module_Stocks_En|FR:Module_Stock|ES:Módulo_Stocks'; llxHeader("", $langs->trans("Stocks"), $help_url); -print load_fiche_titre($langs->trans("StocksArea")); +print load_fiche_titre($langs->trans("StocksArea"), '', 'stock'); //print ''; diff --git a/htdocs/product/stock/list.php b/htdocs/product/stock/list.php index a2f3da7abf0..b3ed7e39663 100644 --- a/htdocs/product/stock/list.php +++ b/htdocs/product/stock/list.php @@ -360,7 +360,7 @@ print ''; $newcardbutton = dolGetButtonTitle($langs->trans('MenuNewWarehouse'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/product/stock/card.php?action=create&backtopage='.urlencode($_SERVER['PHP_SELF']), '', $user->rights->stock->creer); -print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'generic', 0, $newcardbutton, '', $limit); +print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'stock', 0, $newcardbutton, '', $limit); // Add code for pre mass action (confirmation or email presend form) $topicmail = "Information"; diff --git a/htdocs/product/stock/massstockmove.php b/htdocs/product/stock/massstockmove.php index 36db491629f..41dee3c6d34 100644 --- a/htdocs/product/stock/massstockmove.php +++ b/htdocs/product/stock/massstockmove.php @@ -323,7 +323,7 @@ $title = $langs->trans('MassMovement'); llxHeader('', $title); -print load_fiche_titre($langs->trans("MassStockTransferShort")); +print load_fiche_titre($langs->trans("MassStockTransferShort"), '', 'stock'); $titletoadd = $langs->trans("Select"); $buttonrecord = $langs->trans("RecordMovement"); diff --git a/htdocs/product/stock/movement_list.php b/htdocs/product/stock/movement_list.php index 44f45c1ec07..e2cd50fd2e2 100644 --- a/htdocs/product/stock/movement_list.php +++ b/htdocs/product/stock/movement_list.php @@ -722,13 +722,12 @@ if ($resql) print ''; print ''; print ''; - print ''; print ''; print ''; if ($id > 0) print ''; - if ($id > 0) print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, '', 0, '', '', $limit); - else print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'generic', 0, '', '', $limit); + if ($id > 0) print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'stock', 0, '', '', $limit, 0, 0, 1); + else print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'stock', 0, '', '', $limit, 0, 0, 1); // Add code for pre mass action (confirmation or email presend form) $topicmail = "SendStockMovement"; diff --git a/htdocs/product/stock/replenish.php b/htdocs/product/stock/replenish.php index 71a69087ba3..89c7c6d0e86 100644 --- a/htdocs/product/stock/replenish.php +++ b/htdocs/product/stock/replenish.php @@ -486,7 +486,7 @@ $head[1][1] = $langs->trans("ReplenishmentOrders"); $head[1][2] = 'replenishorders'; -print load_fiche_titre($langs->trans('Replenishment'), '', 'generic'); +print load_fiche_titre($langs->trans('Replenishment'), '', 'stock'); dol_fiche_head($head, 'replenish', '', -1, ''); From 549b126eff813f4e5f7f65fd6e254d59fe681818 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 12 Apr 2020 21:36:57 +0200 Subject: [PATCH 52/99] Look and feel v12 --- htdocs/barcode/codeinit.php | 2 +- htdocs/core/lib/functions.lib.php | 20 ++++++++++--------- .../core/modules/modDynamicPrices.class.php | 2 +- htdocs/core/modules/modProductBatch.class.php | 2 +- htdocs/index.php | 6 +++--- .../canvas/product/tpl/card_create.tpl.php | 2 +- .../canvas/service/tpl/card_create.tpl.php | 2 +- htdocs/product/card.php | 12 ++++++++--- htdocs/product/index.php | 2 +- htdocs/product/inventory/card.php | 4 ++-- htdocs/product/inventory/list.php | 2 +- htdocs/product/list.php | 2 +- htdocs/product/popucom.php | 2 +- htdocs/product/popuprop.php | 2 +- htdocs/product/reassort.php | 2 +- htdocs/product/reassortlot.php | 2 +- htdocs/product/stats/card.php | 2 +- .../product/stock/class/productlot.class.php | 2 +- htdocs/product/stock/productlot_list.php | 2 +- htdocs/variants/list.php | 2 +- 20 files changed, 41 insertions(+), 33 deletions(-) diff --git a/htdocs/barcode/codeinit.php b/htdocs/barcode/codeinit.php index dd700de8ce3..d2afa5e6871 100644 --- a/htdocs/barcode/codeinit.php +++ b/htdocs/barcode/codeinit.php @@ -253,7 +253,7 @@ if ($conf->product->enabled || $conf->product->service) $nbno = $nbtotal = 0; - print load_fiche_titre($langs->trans("BarcodeInitForProductsOrServices"), '', 'products'); + print load_fiche_titre($langs->trans("BarcodeInitForProductsOrServices"), '', 'product'); print '
'."\n"; $sql = "SELECT count(rowid) as nb, fk_product_type, datec"; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 4b436b61c47..fd9b598f245 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3141,14 +3141,15 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ '1downarrow', '1uparrow', '1leftarrow', '1rightarrow', '1uparrow_selected', '1downarrow_selected', '1leftarrow_selected', '1rightarrow_selected', 'address', 'bank_account', 'barcode', 'bank', 'bookmark', 'bom', 'building', 'cash-register', 'check', 'close_title', 'company', 'contact', 'cubes', 'delete', 'dolly', 'edit', 'ellipsis-h', - 'filter', 'file-code', 'folder', 'folder-open', 'grip', 'grip_title', 'help', 'language', 'list', 'listlight', 'mrp', 'note', 'stock', + 'filter', 'file-code', 'folder', 'folder-open', 'grip', 'grip_title', 'help', 'language', 'list', 'listlight', 'lot', 'mrp', 'note', 'stock', 'object_accounting', 'object_action', 'object_account', 'object_barcode', 'object_bom', 'object_category', 'object_bookmark', 'object_bug', 'object_generic', 'object_list-alt', 'object_calendar', 'object_calendarweek', 'object_calendarmonth', 'object_calendarday', 'object_calendarperuser', - 'object_cash-register', 'object_company', 'object_contact', 'object_contract', 'object_holiday', 'object_hrm', 'object_multicurrency', 'object_payment', - 'object_mrp', 'object_stock', + 'object_cash-register', 'object_company', 'object_contact', 'object_contract', 'object_dynamicprice', + 'object_holiday', 'object_hrm', 'object_multicurrency', 'object_payment', + 'object_lot', 'object_mrp', 'object_product', 'object_service', 'object_stock', 'object_paragraph', 'object_printer', 'object_resource', 'object_rss', 'object_technic', 'object_ticket', 'object_trip', 'object_user', 'object_group', 'object_member', 'object_other', 'object_phoning', 'object_phoning_fax', 'object_email', - 'off', 'on', 'paiment', 'play', 'playdisabled', 'printer', 'resize', 'stats', 'trip', + 'off', 'on', 'paiment', 'play', 'playdisabled', 'printer', 'product', 'resize', 'service', 'stats', 'trip', 'note', 'setup', 'sign-out', 'split', 'switch_off', 'switch_on', 'tools', 'unlink', 'uparrow', 'user', 'wrench', 'globe', 'jabber', 'skype', 'twitter', 'facebook', 'linkedin', 'instagram', 'snapchat', 'youtube', 'google-plus-g', 'whatsapp', 'chevron-left', 'chevron-right', 'chevron-down', 'chevron-top', @@ -3171,10 +3172,10 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ $arrayconvpictotofa = array( 'account'=>'university', 'action'=>'calendar-alt', 'address'=> 'address-book', 'bank_account'=>'university', 'bom'=>'cubes', - 'company'=>'building', 'contact'=>'address-book', 'contract'=>'suitcase', + 'company'=>'building', 'contact'=>'address-book', 'contract'=>'suitcase', 'dynamicprice'=>'hand-holding-usd', 'setup'=>'cog', 'companies'=>'building', 'products'=>'cube', 'commercial'=>'suitcase', 'invoicing'=>'coins', 'accountancy'=>'money-check-alt', 'accounting'=>'chart-line', 'category'=>'tag', - 'hrm'=>'umbrella-beach', 'members'=>'users', 'ticket'=>'ticket-alt', 'globe'=>'external-link-alt', + 'hrm'=>'umbrella-beach', 'members'=>'users', 'ticket'=>'ticket-alt', 'globe'=>'external-link-alt', 'lot'=>'barcode', 'email'=>'at', 'edit'=>'pencil-alt', 'grip_title'=>'arrows-alt', 'grip'=>'arrows-alt', 'help'=>'info-circle', 'generic'=>'file', 'holiday'=>'umbrella-beach', 'member'=>'users', 'mrp'=>'cubes', 'trip'=>'wallet', 'group'=>'users', @@ -3184,7 +3185,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'list-alt'=>'list-alt', 'calendar'=>'calendar-alt', 'calendarweek'=>'calendar-week', 'calendarmonth'=>'calendar-alt', 'calendarday'=>'calendar-day', 'calendarperuser'=>'table', 'multicurrency'=>'dollar-sign', 'other'=>'square', 'resource'=>'laptop-house', 'error'=>'exclamation-triangle', 'warning'=>'exclamation-triangle', - 'payment'=>'money-bill-alt', 'phoning'=>'phone', 'phoning_fax'=>'fax', 'printer'=>'print', + 'payment'=>'money-bill-alt', 'phoning'=>'phone', 'phoning_fax'=>'fax', 'printer'=>'print', 'product'=>'cube', 'service'=>'concierge-bell', 'stock'=>'box-open', 'technic'=>'cogs', 'ticket'=>'ticket-alt', 'title_setup'=>'tools', 'title_accountancy'=>'money-check-alt', 'title_bank'=>'university', 'title_hrm'=>'umbrella-beach', 'title_agenda'=>'calendar-alt', @@ -3256,8 +3257,9 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ // Define $color $arrayconvpictotocolor = array( 'address'=>'#37a', 'building'=>'#37a', 'bom'=>'#993', - 'companies'=>'#37a', 'company'=>'#37a', 'contact'=>'#37a', 'edit'=>'#444', 'note'=>'#999', 'error'=>'', 'listlight'=>'#999', - 'mrp'=>'#993', 'stock'=>'#993', + 'companies'=>'#37a', 'company'=>'#37a', 'contact'=>'#37a', 'dynamicprice'=>'#993', + 'edit'=>'#444', 'note'=>'#999', 'error'=>'', 'listlight'=>'#999', + 'lot'=>'#993', 'mrp'=>'#993', 'product'=>'#993', 'service'=>'#993', 'stock'=>'#993', 'other'=>'#ddd', 'playdisabled'=>'#ccc', 'printer'=>'#444', 'resize'=>'#444', 'rss'=>'#cba', 'stats'=>'#444', 'switch_off'=>'#999', 'uparrow'=>'#555', 'warning'=>'' diff --git a/htdocs/core/modules/modDynamicPrices.class.php b/htdocs/core/modules/modDynamicPrices.class.php index d0f4f8f83ae..c5e429b465c 100644 --- a/htdocs/core/modules/modDynamicPrices.class.php +++ b/htdocs/core/modules/modDynamicPrices.class.php @@ -51,7 +51,7 @@ class modDynamicPrices 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 = 'technic'; + $this->picto = 'dynamicprice'; // Data directories to create when module is enabled $this->dirs = array(); diff --git a/htdocs/core/modules/modProductBatch.class.php b/htdocs/core/modules/modProductBatch.class.php index f90817e40c6..7a1d89c8b41 100644 --- a/htdocs/core/modules/modProductBatch.class.php +++ b/htdocs/core/modules/modProductBatch.class.php @@ -57,7 +57,7 @@ class modProductBatch extends DolibarrModules // Key used in llx_const table to save module status enabled/disabled (where dluo is value of property name of module in uppercase) $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); - $this->picto = 'stock'; + $this->picto = 'lot'; $this->module_parts = array(); diff --git a/htdocs/index.php b/htdocs/index.php index 24330736287..b3bf48ef3df 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -508,7 +508,7 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) { $dashboardlines = array_merge($dashboardlines, $hookmanager->resArray); } - /* grouping dashboard stats */ + /* Open object dashboard */ $dashboardgroup = array( 'action' => array( @@ -573,7 +573,7 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) { 'ticket' => array( 'groupName' => 'Tickets', - 'globalStatsKey' => 'OpenTickets', + 'globalStatsKey' => 'ticket', 'stats' => array('ticket_opened'), ), @@ -709,6 +709,7 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) { $classe = $classes[$keyIndex]; if (isset($boardloaded[$classe]) && is_object($boardloaded[$classe])) { + $groupElement['globalStats']['total'] = $boardloaded[$classe]->nb[$globalStatsKey] ? $boardloaded[$classe]->nb[$globalStatsKey] : 0; $nbTotal = doubleval($groupElement['globalStats']['total']); if ($nbTotal >= 10000) { $nbTotal = round($nbTotal / 1000, 2).'k'; } @@ -719,7 +720,6 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) { } } - $openedDashBoard .= '
'."\n"; $openedDashBoard .= '
'."\n"; $openedDashBoard .= ' '."\n"; diff --git a/htdocs/product/canvas/product/tpl/card_create.tpl.php b/htdocs/product/canvas/product/tpl/card_create.tpl.php index 99ddd39d49b..a06fd9fd24f 100644 --- a/htdocs/product/canvas/product/tpl/card_create.tpl.php +++ b/htdocs/product/canvas/product/tpl/card_create.tpl.php @@ -31,7 +31,7 @@ $statutarray = array('1' => $langs->trans("OnSell"), '0' => $langs->trans("NotOn trans("NewProduct"), '', 'products'); +print load_fiche_titre($langs->trans("NewProduct"), '', 'product'); dol_fiche_head(''); ?> diff --git a/htdocs/product/canvas/service/tpl/card_create.tpl.php b/htdocs/product/canvas/service/tpl/card_create.tpl.php index 26daca173a4..a51e2fa72b8 100644 --- a/htdocs/product/canvas/service/tpl/card_create.tpl.php +++ b/htdocs/product/canvas/service/tpl/card_create.tpl.php @@ -31,7 +31,7 @@ $statutarray = array('1' => $langs->trans("OnSell"), '0' => $langs->trans("NotOn trans("NewService"), '', 'products'); +print load_fiche_titre($langs->trans("NewService"), '', 'service'); dol_fiche_head(''); ?> diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 7ffcb3392f1..87e86e8e0bc 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -971,10 +971,16 @@ else print ''; print ''; - if ($type == 1) $title = $langs->trans("NewService"); - else $title = $langs->trans("NewProduct"); + if ($type == 1) { + $picto = 'service'; + $title = $langs->trans("NewService"); + } + else { + $picto = 'product'; + $title = $langs->trans("NewProduct"); + } $linkback = ""; - print load_fiche_titre($title, $linkback, 'products'); + print load_fiche_titre($title, $linkback, $picto); dol_fiche_head(''); diff --git a/htdocs/product/index.php b/htdocs/product/index.php index 1c54d002be2..4d0f2e220b7 100644 --- a/htdocs/product/index.php +++ b/htdocs/product/index.php @@ -77,7 +77,7 @@ if ((isset($_GET["type"]) && $_GET["type"] == 1) || empty($conf->product->enable llxHeader("", $langs->trans("ProductsAndServices"), $helpurl); $linkback = ""; -print load_fiche_titre($transAreaType, $linkback, 'products'); +print load_fiche_titre($transAreaType, $linkback, 'product'); print '
'; diff --git a/htdocs/product/inventory/card.php b/htdocs/product/inventory/card.php index fdb2e22a262..0e8ab8bda55 100644 --- a/htdocs/product/inventory/card.php +++ b/htdocs/product/inventory/card.php @@ -148,7 +148,7 @@ jQuery(document).ready(function() { // Part to create if ($action == 'create') { - print load_fiche_titre($langs->trans("NewInventory"), '', 'products'); + print load_fiche_titre($langs->trans("NewInventory"), '', 'product'); print ''; print ''; @@ -183,7 +183,7 @@ if ($action == 'create') // Part to edit record if (($id || $ref) && $action == 'edit') { - print load_fiche_titre($langs->trans("Inventory"), '', 'products'); + print load_fiche_titre($langs->trans("Inventory"), '', 'product'); print ''; print ''; diff --git a/htdocs/product/inventory/list.php b/htdocs/product/inventory/list.php index aab18a9b7fd..f3f7621b821 100644 --- a/htdocs/product/inventory/list.php +++ b/htdocs/product/inventory/list.php @@ -322,7 +322,7 @@ print ''; $newcardbutton = dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/product/inventory/card.php?action=create&backtopage='.urlencode($_SERVER['PHP_SELF']), '', $permissiontoadd); -print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'products', 0, $newcardbutton, '', $limit); +print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'product', 0, $newcardbutton, '', $limit); // Add code for pre mass action (confirmation or email presend form) $topicmail = "Information"; diff --git a/htdocs/product/list.php b/htdocs/product/list.php index a37acf91ebe..778acfc927b 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -540,7 +540,7 @@ if ($resql) print ''; if (empty($arrayfields['p.fk_product_type']['checked'])) print ''; - print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'products', 0, $newcardbutton, '', $limit, 0, 0, 1); + print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'product', 0, $newcardbutton, '', $limit, 0, 0, 1); $topicmail = "Information"; $modelmail = "product"; diff --git a/htdocs/product/popucom.php b/htdocs/product/popucom.php index c8ff2757880..2c28266ad15 100644 --- a/htdocs/product/popucom.php +++ b/htdocs/product/popucom.php @@ -76,7 +76,7 @@ $title = $langs->trans("Statistics"); llxHeader('', $title, $helpurl); -print load_fiche_titre($title, $mesg, 'products'); +print load_fiche_titre($title, $mesg, 'product'); $param = ''; diff --git a/htdocs/product/popuprop.php b/htdocs/product/popuprop.php index 3a82d792ddc..bf2ae9020ec 100644 --- a/htdocs/product/popuprop.php +++ b/htdocs/product/popuprop.php @@ -76,7 +76,7 @@ $title = $langs->trans("Statistics"); llxHeader('', $title, $helpurl); -print load_fiche_titre($title, $mesg, 'products'); +print load_fiche_titre($title, $mesg, 'product'); $param = ''; diff --git a/htdocs/product/reassort.php b/htdocs/product/reassort.php index 7bb0eb3c9c1..94d2e80c303 100644 --- a/htdocs/product/reassort.php +++ b/htdocs/product/reassort.php @@ -219,7 +219,7 @@ if ($resql) print ''; print ''; - print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'products', 0, '', '', $limit); + print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'product', 0, '', '', $limit); if (!empty($catid)) { diff --git a/htdocs/product/reassortlot.php b/htdocs/product/reassortlot.php index cd65b2c09f7..83bad5c43ad 100644 --- a/htdocs/product/reassortlot.php +++ b/htdocs/product/reassortlot.php @@ -233,7 +233,7 @@ if ($resql) print ''; print ''; - print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'products', 0, '', '', $limit); + print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'product', 0, '', '', $limit); if (!empty($catid)) diff --git a/htdocs/product/stats/card.php b/htdocs/product/stats/card.php index dd87dfe1e28..8a5fc2c7c50 100644 --- a/htdocs/product/stats/card.php +++ b/htdocs/product/stats/card.php @@ -104,7 +104,7 @@ if (!$id && empty($ref)) $title = $langs->trans("Statistics"); } - print load_fiche_titre($title, $mesg, 'products'); + print load_fiche_titre($title, $mesg, 'product'); } else { diff --git a/htdocs/product/stock/class/productlot.class.php b/htdocs/product/stock/class/productlot.class.php index d02d1599dbc..6db4e81db79 100644 --- a/htdocs/product/stock/class/productlot.class.php +++ b/htdocs/product/stock/class/productlot.class.php @@ -48,7 +48,7 @@ class Productlot extends CommonObject /** * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png */ - public $picto = 'barcode'; + public $picto = 'lot'; /** * 0=No test on entity, 1=Test with field entity, 2=Test with link by societe diff --git a/htdocs/product/stock/productlot_list.php b/htdocs/product/stock/productlot_list.php index 5eedc40f40c..f87a772ef56 100644 --- a/htdocs/product/stock/productlot_list.php +++ b/htdocs/product/stock/productlot_list.php @@ -302,7 +302,7 @@ if ($resql) print ''; print ''; - print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'barcode', 0, '', '', $limit); + print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'lot', 0, '', '', $limit); $topicmail = "Information"; $modelmail = "productlot"; diff --git a/htdocs/variants/list.php b/htdocs/variants/list.php index 99529cf12a5..2390ec99345 100644 --- a/htdocs/variants/list.php +++ b/htdocs/variants/list.php @@ -62,7 +62,7 @@ if ($user->rights->produit->creer) $newcardbutton .= dolGetButtonTitle($langs->trans('Create'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/variants/create.php'); } -print load_fiche_titre($title, $newcardbutton, 'products'); +print load_fiche_titre($title, $newcardbutton, 'product'); $forcereloadpage = empty($conf->global->MAIN_FORCE_RELOAD_PAGE) ? 0 : 1; ?> From 46ccd610096f8aee7267fc974d1d8e358b69f1c7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 12 Apr 2020 21:38:23 +0200 Subject: [PATCH 53/99] Fix phpcs --- 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 6f911260afd..39a006e0342 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -6035,7 +6035,7 @@ class Form else { // For backward compatibility - $objecttmp->fields['ref']=array('type'=>'varchar(30)', 'label'=>'Ref', 'showoncombobox'=>1); + $objecttmp->fields['ref'] = array('type'=>'varchar(30)', 'label'=>'Ref', 'showoncombobox'=>1); } if (empty($fieldstoshow)) From cdc8eb27fbd0b384df31385b48250f639c9db152 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 12 Apr 2020 21:45:43 +0200 Subject: [PATCH 54/99] Look and feel v12 --- htdocs/product/list.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/product/list.php b/htdocs/product/list.php index 778acfc927b..90464742839 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -540,7 +540,10 @@ if ($resql) print ''; if (empty($arrayfields['p.fk_product_type']['checked'])) print ''; - print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'product', 0, $newcardbutton, '', $limit, 0, 0, 1); + $picto = 'product'; + if ($type == 1) $picto = 'service'; + + print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, $picto, 0, $newcardbutton, '', $limit, 0, 0, 1); $topicmail = "Information"; $modelmail = "product"; From 72623f88df608ae1c82c02d1500be2dfd45c3976 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 12 Apr 2020 22:54:39 +0200 Subject: [PATCH 55/99] Fix phpcs --- htdocs/index.php | 1 - htdocs/website/index.php | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/index.php b/htdocs/index.php index b3bf48ef3df..026e6dc8347 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -709,7 +709,6 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) { $classe = $classes[$keyIndex]; if (isset($boardloaded[$classe]) && is_object($boardloaded[$classe])) { - $groupElement['globalStats']['total'] = $boardloaded[$classe]->nb[$globalStatsKey] ? $boardloaded[$classe]->nb[$globalStatsKey] : 0; $nbTotal = doubleval($groupElement['globalStats']['total']); if ($nbTotal >= 10000) { $nbTotal = round($nbTotal / 1000, 2).'k'; } diff --git a/htdocs/website/index.php b/htdocs/website/index.php index c724ab4e3cf..315492eefe6 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -3580,7 +3580,7 @@ if ($action == 'replacesite' || $action == 'replacesiteconfirm' || $massaction = print getTitleFieldOfList("Type", 0, $_SERVER['PHP_SELF'], 'type_container', '', $param, '', $sortfield, $sortorder, '')."\n"; print getTitleFieldOfList("Page", 0, $_SERVER['PHP_SELF'], 'pageurl', '', $param, '', $sortfield, $sortorder, '')."\n"; //print getTitleFieldOfList("Description", 0, $_SERVER['PHP_SELF'], '', '', $param, '', $sortfield, $sortorder, '')."\n"; - print getTitleFieldOfList("", 0 , $_SERVER['PHP_SELF']); + print getTitleFieldOfList("", 0, $_SERVER['PHP_SELF']); print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n"; print ''; From d503c1b6be9eb3480ab89c242648920d27cc494d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 12 Apr 2020 23:18:21 +0200 Subject: [PATCH 56/99] Fix help --- htdocs/admin/modules.php | 4 ++-- htdocs/core/modules/modWebsite.class.php | 8 ++++---- htdocs/langs/en_US/admin.lang | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index 9608b0270a3..5d03a19a829 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -482,8 +482,8 @@ if ($nbofactivatedmodules <= 1) $moreinfo .= ' '.img_warning($langs->trans("YouM print load_fiche_titre($langs->trans("ModulesSetup"), '', 'title_setup'); // Start to show page -if ($mode == 'common') print ''.$langs->trans("ModulesDesc")."
\n"; -if ($mode == 'commonkanban') print ''.$langs->trans("ModulesDesc")."
\n"; +if ($mode == 'common') print ''.$langs->trans("ModulesDesc", img_picto('', 'switch_off'))."
\n"; +if ($mode == 'commonkanban') print ''.$langs->trans("ModulesDesc", img_picto('', 'switch_off'))."
\n"; if ($mode == 'marketplace') print ''.$langs->trans("ModulesMarketPlaceDesc")."
\n"; if ($mode == 'deploy') print ''.$langs->trans("ModulesDeployDesc", $langs->transnoentitiesnoconv("AvailableModules"))."
\n"; if ($mode == 'develop') print ''.$langs->trans("ModulesDevelopDesc")."
\n"; diff --git a/htdocs/core/modules/modWebsite.class.php b/htdocs/core/modules/modWebsite.class.php index dd028d4f301..3e3b4bae374 100644 --- a/htdocs/core/modules/modWebsite.class.php +++ b/htdocs/core/modules/modWebsite.class.php @@ -158,11 +158,11 @@ class modWebsite extends DolibarrModules $this->remove($options); // Copy flags and octicons directory - $dirarray = array('common/flags', 'common/octicons'); - foreach ($dirarray as $dir) + $dirarray = array('common/flags'=>'flags', 'common/octicons/build/svg'=>'octicons'); + foreach ($dirarray as $dirfrom => $dirtarget) { - $src = DOL_DOCUMENT_ROOT.'/theme/'.$dir; - $dest = DOL_DATA_ROOT.'/medias/image/'.$dir; + $src = DOL_DOCUMENT_ROOT.'/theme/'.$dirfrom; + $dest = DOL_DATA_ROOT.'/medias/image/'.$dirtarget; if (is_dir($src)) { diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 62a7c82437d..9baa074eb75 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -199,7 +199,7 @@ FeatureDisabledInDemo=Feature disabled in demo FeatureAvailableOnlyOnStable=Feature only available on official stable versions BoxesDesc=Widgets are components showing some information that you can add to personalize some pages. You can choose between showing the widget or not by selecting target page and clicking 'Activate', or by clicking the trashcan to disable it. OnlyActiveElementsAreShown=Only elements from enabled modules are shown. -ModulesDesc=The modules/applications determine which features are available in the software. Some modules require permissions to be granted to users after activating the module. Click the on/off button (at end of module line) to enable/disable a module/application. +ModulesDesc=The modules/applications determine which features are available in the software. Some modules require permissions to be granted to users after activating the module. Click the on/off button %s of each module to enable or disable a module/application. ModulesMarketPlaceDesc=You can find more modules to download on external websites on the Internet... ModulesDeployDesc=If permissions on your file system allow it, you can use this tool to deploy an external module. The module will then be visible on the tab %s. ModulesMarketPlaces=Find external app/modules From 8842a1f4e71b57d13886e7162f28cd8c057bdb95 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 12 Apr 2020 23:41:35 +0200 Subject: [PATCH 57/99] css --- htdocs/core/customreports.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/customreports.php b/htdocs/core/customreports.php index aa93acd4a75..e6d773f788d 100644 --- a/htdocs/core/customreports.php +++ b/htdocs/core/customreports.php @@ -313,7 +313,7 @@ foreach ($arrayoftype as $key => $val) { } } print $form->selectarray('objecttype', $newarrayoftype, $objecttype, 0, 0, 0, '', 1, 0, 0, '', 'minwidth200', 1); -if (empty($conf->use_javascript_ajax)) print ''; +if (empty($conf->use_javascript_ajax)) print ''; else { print '