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/84] 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 9573f1289a17553f5a33f6164c3394d9da9edb0f Mon Sep 17 00:00:00 2001 From: simicar29 Date: Sat, 11 Apr 2020 13:42:37 +0200 Subject: [PATCH 02/84] 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 d842a436ae7f2a870cccbb4bae364db21449d284 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Sat, 11 Apr 2020 17:06:50 +0200 Subject: [PATCH 03/84] 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 04/84] 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 05/84] 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 f5ab957faff92e6574e73d99bbdc82131aa77bdb Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Sat, 11 Apr 2020 17:55:07 +0200 Subject: [PATCH 06/84] FIX #13535 : state in italian address --- htdocs/core/lib/functions.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 9c9bf505b05..1f7c08c8d7a 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1651,7 +1651,7 @@ function dol_format_address($object, $withcountry = 0, $sep = "\n", $outputlangs { $ret .= ($ret ? $sep : '' ).$object->zip; $ret .= ($object->town?(($object->zip?' ':'').$object->town):''); - $ret .= ($object->state_id?(' ('.($object->state_id).')'):''); + $ret .= ($object->state_code?(' ('.($object->state_code).')'):''); } else // Other: title firstname name \n address lines \n zip town \n country { 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 07/84] 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 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 08/84] 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 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 09/84] 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 10/84] 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 11/84] 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 12/84] 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 3ca0d48b37a50a0e7afe961017c6346ac9da193f Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Sun, 12 Apr 2020 10:45:30 +0200 Subject: [PATCH 13/84] Fix warning on shipment because of count func --- htdocs/expedition/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index c6b172a5366..236534fa35d 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -2544,7 +2544,7 @@ else if ($id || $ref) // This is just to generate a delivery receipt //var_dump($object->linkedObjectsIds['delivery']); - if ($conf->livraison_bon->enabled && ($object->statut == Expedition::STATUS_VALIDATED || $object->statut == Expedition::STATUS_CLOSED) && $user->rights->expedition->livraison->creer && count($object->linkedObjectsIds['delivery']) == 0) + if ($conf->livraison_bon->enabled && ($object->statut == Expedition::STATUS_VALIDATED || $object->statut == Expedition::STATUS_CLOSED) && $user->rights->expedition->livraison->creer && empty($object->linkedObjectsIds['delivery'])) { print ''.$langs->trans("CreateDeliveryOrder").''; } From fe4cd2e7bcd7f6bbedf8bb8c92dc12e353cd2d90 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 12 Apr 2020 17:05:12 +0200 Subject: [PATCH 14/84] 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 15/84] 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 16/84] 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 ''; 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 17/84] 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 18/84] 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 19/84] 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 20/84] 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 21/84] 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 22/84] 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 23/84] 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 24/84] 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 25/84] 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 26/84] 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 27/84] 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 28/84] 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 29/84] 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 30/84] 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 31/84] 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 '