From 37401df1062f509adc93321a8484af23b4532858 Mon Sep 17 00:00:00 2001 From: Laurent Dinclaux Date: Wed, 8 Jul 2020 14:48:34 +1100 Subject: [PATCH 01/59] Improve printStdColumnContent by passing the $pdf object. It isn't possible to replace the pdf edition done by this method without the $pdf object. --- htdocs/core/class/commondocgenerator.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index 72d45f2467c..a8d5fac0c3c 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -1082,7 +1082,8 @@ abstract class CommonDocGenerator $parameters = array( 'curY' => &$curY, 'columnText' => $columnText, - 'colKey' => $colKey + 'colKey' => $colKey, + 'pdf' => $pdf, ); $reshook = $hookmanager->executeHooks('printStdColumnContent', $parameters, $this); // Note that $action and $object may have been modified by hook if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); From 2f8968478d9260f9385ec1f866edd3a6447ed33b Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Sun, 12 Jul 2020 10:06:04 +0200 Subject: [PATCH 02/59] fix missing entity into fetch wahrehouse --- htdocs/product/stock/class/entrepot.class.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/product/stock/class/entrepot.class.php b/htdocs/product/stock/class/entrepot.class.php index 0b259018cfc..39fad14c544 100644 --- a/htdocs/product/stock/class/entrepot.class.php +++ b/htdocs/product/stock/class/entrepot.class.php @@ -441,6 +441,7 @@ class Entrepot extends CommonObject } $sql = "SELECT rowid, fk_parent, ref as label, description, statut, lieu, address, zip, town, fk_pays as country_id"; + $sql .= " , entity"; $sql .= " FROM ".MAIN_DB_PREFIX."entrepot"; if ($id) { @@ -460,6 +461,7 @@ class Entrepot extends CommonObject $obj=$this->db->fetch_object($result); $this->id = $obj->rowid; + $this->entity = $obj->entity; $this->fk_parent = $obj->fk_parent; $this->ref = $obj->label; $this->label = $obj->label; From 7b5072a21b49fd4816f8cae72924e29743ae5dfd Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Sun, 12 Jul 2020 10:10:46 +0200 Subject: [PATCH 03/59] fix missing entity --- htdocs/product/stock/class/entrepot.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/product/stock/class/entrepot.class.php b/htdocs/product/stock/class/entrepot.class.php index 39fad14c544..f5500812290 100644 --- a/htdocs/product/stock/class/entrepot.class.php +++ b/htdocs/product/stock/class/entrepot.class.php @@ -104,6 +104,7 @@ class Entrepot extends CommonObject */ public $fields=array( 'rowid' =>array('type'=>'integer', 'label'=>'ID', 'enabled'=>1, 'visible'=>0, 'notnull'=>1, 'position'=>10), + 'entity' =>array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'default'=>1, 'notnull'=>1, 'index'=>1, 'position'=>15), 'ref' =>array('type'=>'varchar(255)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>1, 'showoncombobox'=>1, 'position'=>25), 'entity' =>array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'notnull'=>1, 'position'=>30), 'description' =>array('type'=>'text', 'label'=>'Description', 'enabled'=>1, 'visible'=>-2, 'position'=>35), From 32e4635e84203596db9ebcef85ef78863644e88a Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Sun, 12 Jul 2020 21:34:13 +0200 Subject: [PATCH 04/59] fix missing entity into fetch wharehouse --- htdocs/product/stock/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/stock/list.php b/htdocs/product/stock/list.php index 057735c49cc..9baaeebf90e 100644 --- a/htdocs/product/stock/list.php +++ b/htdocs/product/stock/list.php @@ -209,7 +209,7 @@ $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as ccount ON ccount.rowid = t.fk $sql .= " WHERE t.entity IN (".getEntity('stock').")"; foreach ($search as $key => $val) { - if ($key == 'status' && $search[$key] == -1) continue; + if (($key == 'status' && $search[$key] == -1) || $key=='entity') continue; $mode_search = (($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key])) ? 1 : 0); if (strpos($object->fields[$key]['type'], 'integer:') === 0) { if ($search[$key] == '-1') $search[$key] = ''; From f4074428f8b8a6bdd2cf8a3b97a9aae6a1918e68 Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Tue, 14 Jul 2020 09:38:52 +0200 Subject: [PATCH 05/59] fix filter wharehouse list on ref --- htdocs/product/stock/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/stock/list.php b/htdocs/product/stock/list.php index 057735c49cc..8ccc887641f 100644 --- a/htdocs/product/stock/list.php +++ b/htdocs/product/stock/list.php @@ -215,7 +215,7 @@ foreach ($search as $key => $val) if ($search[$key] == '-1') $search[$key] = ''; $mode_search = 2; } - if ($search[$key] != '') $sql .= natural_search($key, $search[$key], (($key == 'status') ? 2 : $mode_search)); + if ($search[$key] != '') $sql .= natural_search((($key == 'ref') ? 't.ref' : $key), $search[$key], (($key == 'status') ? 2 : $mode_search)); } if ($search_all) $sql .= natural_search(array_keys($fieldstosearchall), $search_all); // Add where from extra fields From 1bc1fd4cb4323fc7d658dd7e989d73fe72e26eb9 Mon Sep 17 00:00:00 2001 From: Francis Appels Date: Wed, 15 Jul 2020 11:24:11 +0200 Subject: [PATCH 06/59] Fix date in supplier price log tooltip. --- htdocs/fourn/class/fournisseur.product.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php index f9dcdbeee6a..994b2e662d8 100644 --- a/htdocs/fourn/class/fournisseur.product.class.php +++ b/htdocs/fourn/class/fournisseur.product.class.php @@ -1008,7 +1008,7 @@ class ProductFournisseur extends Product //$out .= ''.$langs->trans("QtyMin").''; $out .= ''.$langs->trans("User").''; foreach ($productFournLogList as $productFournLog) { - $out .= ''.dol_print_date($this->db->jdate($productFournLog['datec']), 'dayhour', 'tzuser').''; + $out .= ''.dol_print_date($this->db->idate($productFournLog['datec']), 'dayhour', 'tzuser').''; $out .= ''.price($productFournLog['price']).''; //$out.= ''.$productFournLog['quantity'].''; $out .= ''.$productFournLog['lastname'].''; From c2030a7db56204eb27aec367ea4d46f32c287c11 Mon Sep 17 00:00:00 2001 From: Francis Appels Date: Sun, 19 Jul 2020 09:43:15 +0200 Subject: [PATCH 07/59] jdate already in function listProductFournisseurPriceLog So no conversion needed. --- htdocs/fourn/class/fournisseur.product.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php index 994b2e662d8..d6da85cf2ae 100644 --- a/htdocs/fourn/class/fournisseur.product.class.php +++ b/htdocs/fourn/class/fournisseur.product.class.php @@ -1008,7 +1008,7 @@ class ProductFournisseur extends Product //$out .= ''.$langs->trans("QtyMin").''; $out .= ''.$langs->trans("User").''; foreach ($productFournLogList as $productFournLog) { - $out .= ''.dol_print_date($this->db->idate($productFournLog['datec']), 'dayhour', 'tzuser').''; + $out .= ''.dol_print_date($productFournLog['datec'], 'dayhour', 'tzuser').''; $out .= ''.price($productFournLog['price']).''; //$out.= ''.$productFournLog['quantity'].''; $out .= ''.$productFournLog['lastname'].''; From 3cdabbaafff7c338aa5e7bce3e5dcda90c1eeae1 Mon Sep 17 00:00:00 2001 From: Laurent Dinclaux Date: Sun, 19 Jul 2020 21:53:06 +1100 Subject: [PATCH 08/59] Explicitly pass the pdf object by reference in the printStdColumnContent hook call. --- htdocs/core/class/commondocgenerator.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index a8d5fac0c3c..f66430e30a2 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -1083,7 +1083,7 @@ abstract class CommonDocGenerator 'curY' => &$curY, 'columnText' => $columnText, 'colKey' => $colKey, - 'pdf' => $pdf, + 'pdf' => &$pdf, ); $reshook = $hookmanager->executeHooks('printStdColumnContent', $parameters, $this); // Note that $action and $object may have been modified by hook if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); From 55298317e389bb7e87796c608d64666b4197203c Mon Sep 17 00:00:00 2001 From: VERDOL Gauthier Date: Mon, 20 Jul 2020 16:22:48 +0200 Subject: [PATCH 09/59] FIX : wrong link to third invoice templates --- htdocs/comm/card.php | 2 +- htdocs/compta/facture/invoicetemplate_list.php | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index 9130efabeeb..37c19525afa 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -1065,7 +1065,7 @@ if ($object->id > 0) print ''; print ''; - print ''; print ''; print ''; + print ' '.$langs->trans("By").' '.$muser->getFullName($langs).''; print ''; @@ -223,7 +226,9 @@ if ($id > 0 || $ref) $result = $acc->fetch($conf->global->PRELEVEMENT_ID_BANKACCOUNT); print ''; print ''; print '
'; + print ''; print ''; } diff --git a/htdocs/compta/facture/invoicetemplate_list.php b/htdocs/compta/facture/invoicetemplate_list.php index 661f9604500..c030d0d5464 100644 --- a/htdocs/compta/facture/invoicetemplate_list.php +++ b/htdocs/compta/facture/invoicetemplate_list.php @@ -53,6 +53,8 @@ $cancel = GETPOST('cancel', 'alpha'); $toselect = GETPOST('toselect', 'array'); $contextpage= GETPOST('contextpage', 'aZ')?GETPOST('contextpage', 'aZ'):'invoicetemplatelist'; // To manage different context of search +$socid = GETPOST('socid', 'int'); + // Security check $id=(GETPOST('facid', 'int')?GETPOST('facid', 'int'):GETPOST('id', 'int')); $lineid=GETPOST('lineid', 'int'); @@ -141,6 +143,11 @@ if (is_array($extrafields->attribute_label) && count($extrafields->attribute_lab } } +if ($socid > 0) { + $tmpthirdparty = new Societe($db); + $res = $tmpthirdparty->fetch($socid); + if ($res > 0) $search_societe = $tmpthirdparty->name; +} /* * Actions From e2592d90490b46ac251b767197a65ed5cc95971f Mon Sep 17 00:00:00 2001 From: Frans Bosman Date: Wed, 22 Jul 2020 11:44:26 +0200 Subject: [PATCH 10/59] Update card_presend.tpl.php Add hidden options for specific sender email-adress for Invoices, Shipments and Order-confirmations --- htdocs/core/tpl/card_presend.tpl.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/htdocs/core/tpl/card_presend.tpl.php b/htdocs/core/tpl/card_presend.tpl.php index a8594ec1b62..aac72ce774f 100644 --- a/htdocs/core/tpl/card_presend.tpl.php +++ b/htdocs/core/tpl/card_presend.tpl.php @@ -131,6 +131,21 @@ if ($action == 'presend') { $formmail->fromid = $user->id; } + if ($object->element === 'facture' && !empty($conf->global->INVOICE_EMAIL_SENDER)) { + $formmail->frommail = $conf->global->INVOICE_EMAIL_SENDER; + $formmail->fromname = ''; + $formmail->fromtype = 'special'; + } + if ($object->element === 'shipping' && !empty($conf->global->SHIPPING_EMAIL_SENDER)) { + $formmail->frommail = $conf->global->SHIPPING_EMAIL_SENDER; + $formmail->fromname = ''; + $formmail->fromtype = 'special'; + } + if ($object->element === 'commande' && !empty($conf->global->COMMANDE_EMAIL_SENDER)) { + $formmail->frommail = $conf->global->COMMANDE_EMAIL_SENDER; + $formmail->fromname = ''; + $formmail->fromtype = 'special'; + } $formmail->trackid=$trackid; if (! empty($conf->global->MAIN_EMAIL_ADD_TRACK_ID) && ($conf->global->MAIN_EMAIL_ADD_TRACK_ID & 2)) // If bit 2 is set { From 7bc683b23409fd9eee014975822454f7229d3db7 Mon Sep 17 00:00:00 2001 From: quentin Date: Wed, 22 Jul 2020 15:07:55 +0200 Subject: [PATCH 11/59] FIX warning --- htdocs/core/tpl/extrafields_list_print_fields.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/tpl/extrafields_list_print_fields.tpl.php b/htdocs/core/tpl/extrafields_list_print_fields.tpl.php index 0d2949b4e24..85dd111bf55 100644 --- a/htdocs/core/tpl/extrafields_list_print_fields.tpl.php +++ b/htdocs/core/tpl/extrafields_list_print_fields.tpl.php @@ -60,7 +60,7 @@ if (!empty($extrafieldsobjectkey)) // $extrafieldsobject is the $object->table_e // we keep position for the first line $totalarray['totalizable'][$key]['pos'] = $totalarray['nbfield']; } - $totalarray['totalizable'][$key]['total'] += $obj->$tmpkey; + if(is_numeric($obj->$tmpkey)) $totalarray['totalizable'][$key]['total'] += $obj->$tmpkey; } if (!empty($val['isameasure'])) { From fc1de5b4f37cf521f39f5cc7c0e84aa7b864fe0e Mon Sep 17 00:00:00 2001 From: John Botella Date: Thu, 23 Jul 2020 11:10:18 +0200 Subject: [PATCH 12/59] Fix multicurecy option not applied --- htdocs/compta/facture/class/facture.class.php | 2 +- htdocs/fourn/class/fournisseur.commande.class.php | 6 +++++- htdocs/fourn/class/fournisseur.facture.class.php | 2 +- htdocs/supplier_proposal/class/supplier_proposal.class.php | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index d3c9ae19721..a9267201858 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -416,7 +416,7 @@ class Facture extends CommonInvoice $this->brouillon = 1; // Multicurrency (test on $this->multicurrency_tx because we should take the default rate only if not using origin rate) - if (!empty($this->multicurrency_code) && empty($this->multicurrency_tx)) list($this->fk_multicurrency, $this->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($this->db, $this->multicurrency_code); + if (!empty($this->multicurrency_code) && empty($this->multicurrency_tx)) list($this->fk_multicurrency, $this->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($this->db, $this->multicurrency_code, $this->date); else $this->fk_multicurrency = MultiCurrency::getIdFromCode($this->db, $this->multicurrency_code); if (empty($this->fk_multicurrency)) { diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index bc975a9267a..cd35e1d34de 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -1271,11 +1271,15 @@ class CommandeFournisseur extends CommonOrder $error = 0; $now = dol_now(); + // $date_commande is deprecated + $date = ($this->date_commande ? $this->date_commande : $this->date); // in case of date is set + if(empty($date)) $date = $now; + // Clean parameters if (empty($this->source)) $this->source = 0; // Multicurrency (test on $this->multicurrency_tx because we should take the default rate only if not using origin rate) - if (!empty($this->multicurrency_code) && empty($this->multicurrency_tx)) list($this->fk_multicurrency, $this->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($this->db, $this->multicurrency_code); + if (!empty($this->multicurrency_code) && empty($this->multicurrency_tx)) list($this->fk_multicurrency, $this->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($this->db, $this->multicurrency_code, $date); else $this->fk_multicurrency = MultiCurrency::getIdFromCode($this->db, $this->multicurrency_code); if (empty($this->fk_multicurrency)) { diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 9cbcec32a9a..46c2c032786 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -359,7 +359,7 @@ class FactureFournisseur extends CommonInvoice $remise = $this->remise; // Multicurrency (test on $this->multicurrency_tx because we should take the default rate only if not using origin rate) - if (!empty($this->multicurrency_code) && empty($this->multicurrency_tx)) list($this->fk_multicurrency, $this->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($this->db, $this->multicurrency_code); + if (!empty($this->multicurrency_code) && empty($this->multicurrency_tx)) list($this->fk_multicurrency, $this->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($this->db, $this->multicurrency_code, $this->date); else $this->fk_multicurrency = MultiCurrency::getIdFromCode($this->db, $this->multicurrency_code); if (empty($this->fk_multicurrency)) { diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php index d292ebe13bf..1801bf16d71 100644 --- a/htdocs/supplier_proposal/class/supplier_proposal.class.php +++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php @@ -891,7 +891,7 @@ class SupplierProposal extends CommonObject } // Multicurrency - if (!empty($this->multicurrency_code)) list($this->fk_multicurrency,$this->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($this->db, $this->multicurrency_code); + if (!empty($this->multicurrency_code)) list($this->fk_multicurrency,$this->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($this->db, $this->multicurrency_code, $now); if (empty($this->fk_multicurrency)) { $this->multicurrency_code = $conf->currency; From 55e65bbabf46919368a3dde1eeaefdca93bec316 Mon Sep 17 00:00:00 2001 From: John Botella Date: Thu, 23 Jul 2020 11:12:04 +0200 Subject: [PATCH 13/59] Fix variable init --- htdocs/multicurrency/class/multicurrency.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/multicurrency/class/multicurrency.class.php b/htdocs/multicurrency/class/multicurrency.class.php index 3c6b7044486..50288459a7d 100644 --- a/htdocs/multicurrency/class/multicurrency.class.php +++ b/htdocs/multicurrency/class/multicurrency.class.php @@ -530,7 +530,7 @@ class MultiCurrency extends CommonObject $sql1.= " AND m.entity IN (".getEntity('multicurrency').")"; $sql2= ''; if (!empty($conf->global->MULTICURRENCY_USE_RATE_ON_DOCUMENT_DATE) && !empty($date_document)) $sql2.= ' AND DATE_FORMAT(mc.date_sync, "%Y-%m-%d") = "'.date('Y-m-d', $date_document).'"'; - $sql3.= ' ORDER BY mc.date_sync DESC LIMIT 1'; + $sql3 = ' ORDER BY mc.date_sync DESC LIMIT 1'; dol_syslog(__METHOD__, LOG_DEBUG); $resql = $db->query($sql1.$sql2.$sql3); From e5a16c530dbe77fea19f0a617ba3c2bbbdccdc12 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 23 Jul 2020 23:57:12 +0200 Subject: [PATCH 14/59] FIX Can go on page even when module disabled --- htdocs/admin/clicktodial.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/admin/clicktodial.php b/htdocs/admin/clicktodial.php index 36205697e89..9efd98622e4 100644 --- a/htdocs/admin/clicktodial.php +++ b/htdocs/admin/clicktodial.php @@ -1,6 +1,6 @@ - * Copyright (C) 2005-2011 Laurent Destailleur + * Copyright (C) 2005-2020 Laurent Destailleur * Copyright (C) 2011-2013 Juanjo Menent * * This program is free software; you can redistribute it and/or modify @@ -33,6 +33,10 @@ if (!$user->admin) accessforbidden(); $action = GETPOST('action', 'aZ09'); +if (empty($conf->modules['clicktodial'])) { + accessforbidden($langs->trans("WarningModuleNotActive", $langs->transnoentitiesnoconv("Module58Name"))); +} + /* * Actions From c6c1830e708977ea526b493c4cd19bbab8b8e69b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 24 Jul 2020 00:06:18 +0200 Subject: [PATCH 15/59] FIX ClickToDial tab of users has disappeared --- htdocs/admin/clicktodial.php | 2 +- htdocs/admin/resource.php | 2 +- htdocs/core/lib/usergroups.lib.php | 2 +- htdocs/user/clicktodial.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/admin/clicktodial.php b/htdocs/admin/clicktodial.php index 9efd98622e4..8d22e01b436 100644 --- a/htdocs/admin/clicktodial.php +++ b/htdocs/admin/clicktodial.php @@ -33,7 +33,7 @@ if (!$user->admin) accessforbidden(); $action = GETPOST('action', 'aZ09'); -if (empty($conf->modules['clicktodial'])) { +if (! in_array('clicktodial', $conf->modules)) { accessforbidden($langs->trans("WarningModuleNotActive", $langs->transnoentitiesnoconv("Module58Name"))); } diff --git a/htdocs/admin/resource.php b/htdocs/admin/resource.php index 3efdd05bdc7..c700c2c9cf1 100644 --- a/htdocs/admin/resource.php +++ b/htdocs/admin/resource.php @@ -28,7 +28,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/resource.lib.php'; -if (!empty($conf->resouce->enabled)) require_once DOL_DOCUMENT_ROOT.'/resource/class/html.formresource.class.php'; +require_once DOL_DOCUMENT_ROOT.'/resource/class/html.formresource.class.php'; // Load translation files required by the page $langs->loadLangs(array("admin", "resource")); diff --git a/htdocs/core/lib/usergroups.lib.php b/htdocs/core/lib/usergroups.lib.php index 0b07e96ab50..96a868c4599 100644 --- a/htdocs/core/lib/usergroups.lib.php +++ b/htdocs/core/lib/usergroups.lib.php @@ -22,7 +22,7 @@ /** * \file htdocs/core/lib/usergroups.lib.php - * \brief Ensemble de fonctions de base pour la gestion des utilisaterus et groupes + * \brief Set of function to manage users, groups and permissions */ /** diff --git a/htdocs/user/clicktodial.php b/htdocs/user/clicktodial.php index c81e4068558..2b915fbb46f 100644 --- a/htdocs/user/clicktodial.php +++ b/htdocs/user/clicktodial.php @@ -164,7 +164,7 @@ if ($id > 0) } else { - print $form->textwithpicto((empty($object->clicktodial_url) ? $langs->trans("DefaultLink").': ' : '').$url, $langs->trans("ClickToDialUrlDesc")); + print $form->textwithpicto((empty($object->clicktodial_url) ? ''.$langs->trans("DefaultLink").': ' : '').$url, $langs->trans("ClickToDialUrlDesc")); } print ''; print ''; From 431b207dab66199f1dbcb75c8aff0bc5a2540077 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 24 Jul 2020 01:02:07 +0200 Subject: [PATCH 16/59] Fix to solve sql error on some databases --- htdocs/core/lib/order.lib.php | 4 ++-- htdocs/install/mysql/migration/11.0.0-12.0.0.sql | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/order.lib.php b/htdocs/core/lib/order.lib.php index 3d2847e926b..96d66c3272a 100644 --- a/htdocs/core/lib/order.lib.php +++ b/htdocs/core/lib/order.lib.php @@ -65,10 +65,10 @@ function commande_prepare_head(Commande $object) $head[$h][0] = DOL_URL_ROOT.'/expedition/shipment.php?id='.$object->id; $text = ''; if ($conf->expedition_bon->enabled) $text .= $langs->trans("Shipments"); - if ($conf->expedition_bon->enabled && $conf->livraison_bon->enabled) $text .= '/'; + if ($conf->expedition_bon->enabled && $conf->livraison_bon->enabled) $text .= ' - '; if ($conf->livraison_bon->enabled) $text .= $langs->trans("Receivings"); if ($nbShipments > 0 || $nbReceiption > 0) $text .= ''.($nbShipments ? $nbShipments : 0); - if ($conf->expedition_bon->enabled && $conf->livraison_bon->enabled && ($nbShipments > 0 || $nbReceiption > 0)) $text .= '/'; + if ($conf->expedition_bon->enabled && $conf->livraison_bon->enabled && ($nbShipments > 0 || $nbReceiption > 0)) $text .= ' - '; if ($conf->expedition_bon->enabled && $conf->livraison_bon->enabled && ($nbShipments > 0 || $nbReceiption > 0)) $text .= ($nbReceiption ? $nbReceiption : 0); if ($nbShipments > 0 || $nbReceiption > 0) $text .= ''; $head[$h][1] = $text; diff --git a/htdocs/install/mysql/migration/11.0.0-12.0.0.sql b/htdocs/install/mysql/migration/11.0.0-12.0.0.sql index 82a0f11e893..2d5bcd5d28e 100644 --- a/htdocs/install/mysql/migration/11.0.0-12.0.0.sql +++ b/htdocs/install/mysql/migration/11.0.0-12.0.0.sql @@ -329,3 +329,5 @@ ALTER TABLE llx_prelevement_facture_demande ADD INDEX idx_prelevement_facture_de insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (721, 72, '0','0','VAT Rate 0',1); insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,localtax1_type,note,active) values (722, 72, '18','0', '0.9', '1', 'VAT Rate 18+0.9', 1); + +ALTER TABLE llx_expedition ADD COLUMN billed smallint DEFAULT 0; From 99935ce11fd6019814504f32dab96630c5aa1527 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 24 Jul 2020 01:30:34 +0200 Subject: [PATCH 17/59] FIX Should not be able to edit qty on shipment when no stock available --- htdocs/expedition/card.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index c362bcfb8ac..a14258e6419 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -1524,8 +1524,11 @@ if ($action == 'create') } if ($subj == 0) // Line not shown yet, we show it { - print ''; - print ''; // Action column - print ''; From c48a294a2ba25a326ec8535a0d19ae5e59bdfe84 Mon Sep 17 00:00:00 2001 From: FlorianMortgat <5845502+FlorianMortgat@users.noreply.github.com> Date: Sat, 25 Jul 2020 00:57:40 +0200 Subject: [PATCH 27/59] FIX: allow more harmless html tags --- htdocs/core/lib/functions.lib.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index a72d2057004..4627a66bbba 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -5694,8 +5694,7 @@ function dol_string_onlythesehtmltags($stringtoclean, $cleanalsosomestyles = 1) { $allowed_tags = array( "html", "head", "meta", "body", "article", "a", "abbr", "b", "blockquote", "br", "cite", "div", "dl", "dd", "dt", "em", "font", "img", "ins", "hr", "i", "li", "link", - "ol", "p", "q", "s", "section", "span", "strike", "strong", "title", - "table", "tr", "th", "td", "u", "ul" + "ol", "p", "q", "s", "section", "span", "strike", "strong", "title", "table", "tr", "th", "td", "u", "ul", "sup", "sub", "blockquote", "pre", "h1", "h2", "h3", "h4", "h5", "h6" ); $allowed_tags_string = join("><", $allowed_tags); $allowed_tags_string = preg_replace('/^>/', '', $allowed_tags_string); From 573feed66fecbefd2ed45f2a92d46964a7208e0d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 25 Jul 2020 02:59:49 +0200 Subject: [PATCH 28/59] FIX locataxes lost on lines when cloning a vendor invoice --- htdocs/core/lib/price.lib.php | 4 ++-- htdocs/fourn/class/fournisseur.facture.class.php | 6 +++++- htdocs/fourn/facture/card.php | 2 +- htdocs/societe/card.php | 2 +- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/htdocs/core/lib/price.lib.php b/htdocs/core/lib/price.lib.php index 81c62958418..2cb8d8e30f6 100644 --- a/htdocs/core/lib/price.lib.php +++ b/htdocs/core/lib/price.lib.php @@ -40,8 +40,8 @@ * @param float $pu Unit price (HT or TTC selon price_base_type) * @param float $remise_percent_ligne Discount for line * @param float $txtva 0=do not apply VAT tax, VAT rate=apply (this is VAT rate only without text code, we don't need text code because we alreaydy have all tax info into $localtaxes_array) - * @param float $uselocaltax1_rate 0=do not use this localtax, >0=apply and get value from localtaxes_array (or database if empty), -1=autodetect according to seller if we must apply, get value from localtaxes_array (or database if empty). Try to always use -1. - * @param float $uselocaltax2_rate 0=do not use this localtax, >0=apply and get value from localtaxes_array (or database if empty), -1=autodetect according to seller if we must apply, get value from localtaxes_array (or database if empty). Try to always use -1. + * @param float $uselocaltax1_rate 0=do not use localtax1, >0=apply and get value from localtaxes_array (or database if empty), -1=autodetect according to seller if we must apply, get value from localtaxes_array (or database if empty). Try to always use -1. + * @param float $uselocaltax2_rate 0=do not use localtax2, >0=apply and get value from localtaxes_array (or database if empty), -1=autodetect according to seller if we must apply, get value from localtaxes_array (or database if empty). Try to always use -1. * @param float $remise_percent_global 0 * @param string $price_base_type HT=Unit price parameter is HT, TTC=Unit price parameter is TTC * @param int $info_bits Miscellaneous informations on line diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index b877cd0b0d6..63ca7e0d88b 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -486,7 +486,7 @@ class FactureFournisseur extends CommonInvoice $idligne, $this->lines[$i]->description, $this->lines[$i]->pu_ht, - $this->lines[$i]->tva_tx, + $this->lines[$i]->tva_tx.($this->lines[$i]->vat_src_code ? ' ('.$this->lines[$i]->vat_src_code.')' : ''), $this->lines[$i]->localtax1_tx, $this->lines[$i]->localtax2_tx, $this->lines[$i]->qty, @@ -1945,6 +1945,8 @@ class FactureFournisseur extends CommonInvoice $localtaxes_type = getLocalTaxesFromRate($vatrate, 0, $mysoc, $this->thirdparty); + $reg = array(); + // Clean vat code $vat_src_code = ''; if (preg_match('/\((.*)\)/', $vatrate, $reg)) @@ -2648,6 +2650,8 @@ class FactureFournisseur extends CommonInvoice $object->id = 0; $object->statut = self::STATUS_DRAFT; + $object->fetch_thirdparty(); // We need it to recalculate VAT localtaxes according to main sale taxes and vendor + // Clear fields $object->ref_supplier = (empty($this->ref_supplier) ? $langs->trans("CopyOf").' '.$object->ref_supplier : $this->ref_supplier); $object->author = $user->id; diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 2113d7ebb12..10cf8ee1b6f 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2016 Laurent Destailleur + * Copyright (C) 2004-2020 Laurent Destailleur * Copyright (C) 2004 Christophe Combelles * Copyright (C) 2005 Marc Barilley * Copyright (C) 2005-2013 Regis Houssin diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 97226314209..2ac6d0d33f3 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -2044,7 +2044,7 @@ else print ''; } print ''; - if ($conf->browser->layout == 'phone') print ''; + print ''; print ''; - $html_id = !empty($object->id) ? $object->element.'_extras_'.$key.'_'.$object->id : ''; + $html_id = !empty($object->id) ? $object->element.'_extras_'.$tmpkeyextra.'_'.$object->id : ''; - print ''; From 25994e61bce5d8d165dd5fd91fcd9d5113b8b6da Mon Sep 17 00:00:00 2001 From: VERDOL Gauthier Date: Mon, 27 Jul 2020 16:04:21 +0200 Subject: [PATCH 41/59] FIX : We need to see unit line on PDF even though it's an option --- htdocs/core/lib/pdf.lib.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index af1da161dc7..1d9d218f7af 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -1826,7 +1826,6 @@ function pdf_getlineunit($object, $i, $outputlangs, $hidedetails = 0, $hookmanag } if (empty($reshook)) { - if ($object->lines[$i]->special_code == 3) return ''; if (empty($hidedetails) || $hidedetails > 1) $result.=$langs->transnoentitiesnoconv($object->lines[$i]->getLabelOfUnit('short')); } return $result; From 8c06e3577df185428c01cc971d3e2a06f6e14865 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 27 Jul 2020 19:33:24 +0200 Subject: [PATCH 42/59] Fix several trouble with diret debit module and credit transfer module --- dev/resources/sepa/sample-credit-transfer.xml | 172 ++++++++++++++++++ .../{test.xml => sample-direct-debit.xml} | 0 htdocs/compta/paymentbybanktransfer/index.php | 5 +- htdocs/compta/prelevement/card.php | 29 ++- .../class/bonprelevement.class.php | 137 ++++++++++++-- htdocs/compta/prelevement/create.php | 6 +- htdocs/compta/prelevement/demandes.php | 8 + htdocs/compta/prelevement/factures.php | 57 ++++-- htdocs/compta/prelevement/fiche-rejet.php | 35 ++-- htdocs/compta/prelevement/fiche-stat.php | 41 +++-- htdocs/core/lib/prelevement.lib.php | 7 +- htdocs/langs/en_US/withdrawals.lang | 8 +- 12 files changed, 426 insertions(+), 79 deletions(-) create mode 100644 dev/resources/sepa/sample-credit-transfer.xml rename dev/resources/sepa/{test.xml => sample-direct-debit.xml} (100%) diff --git a/dev/resources/sepa/sample-credit-transfer.xml b/dev/resources/sepa/sample-credit-transfer.xml new file mode 100644 index 00000000000..087fd2f57d7 --- /dev/null +++ b/dev/resources/sepa/sample-credit-transfer.xml @@ -0,0 +1,172 @@ + + + + + message-id-001 + 2010-09-28T14:07:00 + 1 + 10.1 + + Bedrijfsnaam + + + + 123456789123456 + + + + + + + minimaal gevuld + TRF + 1 + 10.1 + 2009-11-01 + + Naam + + + + NL44RABO0123456789 + + + + + RABONL2U + + + + + non ref + + + 10.1 + + SLEV + + + ABNANL2A + + + + Naam creditor + + + + NL90ABNA0111111111 + + + + vrije tekst + + + + + maximaal gevuld + TRF + true + 1 + 20.2 + + NORM + + SEPA + + + IDEAL + + + SECU + + + 2009-11-01 + + Naam + + NL + Debtor straat 1 + 9999 XX Plaats debtor + + + + + NL44RABO0123456789 + + + + + RABONL2U + + + + + + + 12345678 + + klantnummer + + klantnummer uitgifte instantie + + + + + SLEV + + + debtor-to-debtor-bank-01 + End-to-end-id-debtor-to-creditor-01 + + + 20.2 + + + + ABNANL2A + + + + Naam creditor + + NL + Straat creditor 1 + 9999 XX Plaats creditor + + + + + NL90ABNA0111111111 + + + + + + + 1969-07-03 + PLAATS + NL + + + + + + CHAR + + + + + + + SCOR + + CUR + + 1234567 + + + + + + + diff --git a/dev/resources/sepa/test.xml b/dev/resources/sepa/sample-direct-debit.xml similarity index 100% rename from dev/resources/sepa/test.xml rename to dev/resources/sepa/sample-direct-debit.xml diff --git a/htdocs/compta/paymentbybanktransfer/index.php b/htdocs/compta/paymentbybanktransfer/index.php index 1fc6c53cf99..79bb2f6e7fb 100644 --- a/htdocs/compta/paymentbybanktransfer/index.php +++ b/htdocs/compta/paymentbybanktransfer/index.php @@ -94,7 +94,7 @@ print '
'.$langs->trans("LatestCustomerTemplateInvoices", ($num<=$MAXLIST?"":$MAXLIST)).''.$langs->trans("AllCustomerTemplateInvoices").' '.$num.''; print '
'.$langs->trans("LatestCustomerTemplateInvoices", ($num<=$MAXLIST?"":$MAXLIST)).''.$langs->trans("AllCustomerTemplateInvoices").' '.$num.'
'; + $warehouse_selected_id = GETPOST('entrepot_id', 'int'); + + print ''; + print '
'; + if ($line->product_type == Product::TYPE_PRODUCT || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) { $disabled = ''; @@ -1533,6 +1536,9 @@ if ($action == 'create') { $disabled = 'disabled="disabled"'; } + if ($warehouse_selected_id <= 0) { // We did not force a given warehouse, so we won't have no warehouse to change qty. + $disabled = 'disabled="disabled"'; + } print ' '; } else @@ -1544,7 +1550,6 @@ if ($action == 'create') print ''; if ($line->product_type == Product::TYPE_PRODUCT || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) { - $warehouse_selected_id = GETPOST('entrepot_id', 'int'); if ($warehouse_selected_id > 0) { $warehouseObject = new Entrepot($db); From 0f4e00a2a3e9f467b090dbaa2b9ab7cd3fe0d91a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 24 Jul 2020 01:43:03 +0200 Subject: [PATCH 18/59] Fix language --- htdocs/langs/en_US/admin.lang | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 860d9e1b64c..5887f6cde4a 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -300,8 +300,9 @@ MAIN_MAIL_DEFAULT_FROMTYPE=Default sender email for manual sending (User email o UserEmail=User email CompanyEmail=Company Email FeatureNotAvailableOnLinux=Feature not available on Unix like systems. Test your sendmail program locally. +FixOnTransifex=Fix the translation on the online translation platform of project SubmitTranslation=If the translation for this language is not complete or you find errors, you can correct this by editing files in directory langs/%s and submit your change to www.transifex.com/dolibarr-association/dolibarr/ -SubmitTranslationENUS=If translation for this language is not complete or you find errors, you can correct this by editing files into directory langs/%s and submit modified files on dolibarr.org/forum or for developers on github.com/Dolibarr/dolibarr. +SubmitTranslationENUS=If translation for this language is not complete or you find errors, you can correct this by editing files into directory langs/%s and submit modified files on dolibarr.org/forum or, if you are a developer, with a PR on github.com/Dolibarr/dolibarr ModuleSetup=Module setup ModulesSetup=Modules/Application setup ModuleFamilyBase=System From 34a9eee7a6d7d648e56eec810a00da146eaf6db4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 24 Jul 2020 01:50:57 +0200 Subject: [PATCH 19/59] Minor fix in translation --- htdocs/admin/translation.php | 8 ++++---- htdocs/core/lib/admin.lib.php | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/htdocs/admin/translation.php b/htdocs/admin/translation.php index ecc25c58509..8f764a93b98 100644 --- a/htdocs/admin/translation.php +++ b/htdocs/admin/translation.php @@ -40,7 +40,7 @@ $transkey = GETPOST('transkey', 'alphanohtml'); $transvalue = GETPOST('transvalue', 'none'); -$mode = GETPOST('mode', 'aZ09') ?GETPOST('mode', 'aZ09') : 'overwrite'; +$mode = GETPOST('mode', 'aZ09') ?GETPOST('mode', 'aZ09') : 'searchkey'; $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; $sortfield = GETPOST("sortfield", 'alpha'); @@ -514,7 +514,7 @@ if ($mode == 'searchkey') if ($i > ($offset + $limit)) break; print '
'.$langcode.''.$key.''; print dol_escape_htmltag($val); - print ''; + print ''; if (!empty($newlangfileonly->tab_translate[$key])) { if ($val != $newlangfileonly->tab_translate[$key]) @@ -534,7 +534,7 @@ if ($mode == 'searchkey') print ' '; print ''.img_delete().''; print '  '; - $htmltext = $langs->trans("OriginalValueWas", $newlangfileonly->tab_translate[$key]); + $htmltext = $langs->trans("OriginalValueWas", ''.$newlangfileonly->tab_translate[$key].''); print $form->textwithpicto('', $htmltext, 1, 'info'); } elseif (!empty($conf->global->MAIN_ENABLE_OVERWRITE_TRANSLATION)) @@ -549,7 +549,7 @@ if ($mode == 'searchkey') //$transifexurl = 'https://www.transifex.com/dolibarr-association/dolibarr/translate/#'.$langcode.'/'.$transifexlangfile.'?key='.$key; $transifexurl = 'https://www.transifex.com/dolibarr-association/dolibarr/translate/#'.$langcode.'/'.$transifexlangfile.'?q=key%3A'.$key; - print '   '.img_picto('FixOnTransifex', 'globe').''; + print '   '.img_picto($langs->trans('FixOnTransifex'), 'globe').''; } } else diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index 12fb15d3b2a..7b3d66f9003 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -721,16 +721,16 @@ function translation_prepare_head() $h = 0; $head = array(); - $head[$h][0] = DOL_URL_ROOT."/admin/translation.php?mode=overwrite"; - $head[$h][1] = $langs->trans("TranslationOverwriteKey").''; - $head[$h][2] = 'overwrite'; - $h++; - $head[$h][0] = DOL_URL_ROOT."/admin/translation.php?mode=searchkey"; $head[$h][1] = $langs->trans("TranslationKeySearch"); $head[$h][2] = 'searchkey'; $h++; + $head[$h][0] = DOL_URL_ROOT."/admin/translation.php?mode=overwrite"; + $head[$h][1] = $langs->trans("TranslationOverwriteKey").''; + $head[$h][2] = 'overwrite'; + $h++; + complete_head_from_modules($conf, $langs, null, $head, $h, 'translation_admin'); complete_head_from_modules($conf, $langs, null, $head, $h, 'translation_admin', 'remove'); From 94498b191bb7c584be3df5a5adb0a827a35f877c Mon Sep 17 00:00:00 2001 From: Frans Bosman Date: Fri, 24 Jul 2020 10:37:19 +0200 Subject: [PATCH 20/59] Update card_presend.tpl.php --- htdocs/core/tpl/card_presend.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/tpl/card_presend.tpl.php b/htdocs/core/tpl/card_presend.tpl.php index aac72ce774f..67de56e16fa 100644 --- a/htdocs/core/tpl/card_presend.tpl.php +++ b/htdocs/core/tpl/card_presend.tpl.php @@ -139,7 +139,7 @@ if ($action == 'presend') if ($object->element === 'shipping' && !empty($conf->global->SHIPPING_EMAIL_SENDER)) { $formmail->frommail = $conf->global->SHIPPING_EMAIL_SENDER; $formmail->fromname = ''; - $formmail->fromtype = 'special'; + $formmail->fromtype = 'special'; } if ($object->element === 'commande' && !empty($conf->global->COMMANDE_EMAIL_SENDER)) { $formmail->frommail = $conf->global->COMMANDE_EMAIL_SENDER; From 8273dbcd4948b79baac12f2d5d0f9adc95a8bf33 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Fri, 24 Jul 2020 08:39:09 +0000 Subject: [PATCH 21/59] Fixing style errors. --- htdocs/core/tpl/card_presend.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/tpl/card_presend.tpl.php b/htdocs/core/tpl/card_presend.tpl.php index 67de56e16fa..aac72ce774f 100644 --- a/htdocs/core/tpl/card_presend.tpl.php +++ b/htdocs/core/tpl/card_presend.tpl.php @@ -139,7 +139,7 @@ if ($action == 'presend') if ($object->element === 'shipping' && !empty($conf->global->SHIPPING_EMAIL_SENDER)) { $formmail->frommail = $conf->global->SHIPPING_EMAIL_SENDER; $formmail->fromname = ''; - $formmail->fromtype = 'special'; + $formmail->fromtype = 'special'; } if ($object->element === 'commande' && !empty($conf->global->COMMANDE_EMAIL_SENDER)) { $formmail->frommail = $conf->global->COMMANDE_EMAIL_SENDER; From 6261fa191fbdb3efbd178120d75dab057db88895 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 24 Jul 2020 12:47:29 +0200 Subject: [PATCH 22/59] Prepare compatibilty with mysql 8 --- test/phpunit/CodingSqlTest.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/phpunit/CodingSqlTest.php b/test/phpunit/CodingSqlTest.php index b62b9befcc7..207f2db0d47 100644 --- a/test/phpunit/CodingSqlTest.php +++ b/test/phpunit/CodingSqlTest.php @@ -156,7 +156,10 @@ class CodingSqlTest extends PHPUnit\Framework\TestCase continue; print 'Check sql file '.$file."\n"; - $filecontent=file_get_contents($dir.'/'.$file); + $filecontent = file_get_contents($dir.'/'.$file); + + // Allow ` for 'rank' column name + $filecontent = str_replace('`rank`', '_rank_', $filecontent); $result=strpos($filecontent, '`'); print __METHOD__." Result for checking we don't have back quote = ".$result."\n"; From 943e7c988f1ead77e506d5b093b76a88bd24a4e0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 24 Jul 2020 12:55:12 +0200 Subject: [PATCH 23/59] Update extrafields_list_print_fields.tpl.php --- htdocs/core/tpl/extrafields_list_print_fields.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/tpl/extrafields_list_print_fields.tpl.php b/htdocs/core/tpl/extrafields_list_print_fields.tpl.php index 85dd111bf55..817d1aadfc9 100644 --- a/htdocs/core/tpl/extrafields_list_print_fields.tpl.php +++ b/htdocs/core/tpl/extrafields_list_print_fields.tpl.php @@ -60,7 +60,7 @@ if (!empty($extrafieldsobjectkey)) // $extrafieldsobject is the $object->table_e // we keep position for the first line $totalarray['totalizable'][$key]['pos'] = $totalarray['nbfield']; } - if(is_numeric($obj->$tmpkey)) $totalarray['totalizable'][$key]['total'] += $obj->$tmpkey; + if (is_numeric($obj->$tmpkey)) $totalarray['totalizable'][$key]['total'] += $obj->$tmpkey; } if (!empty($val['isameasure'])) { From fb1c226e5681f69cd88dc6445458f7d8fc909518 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 24 Jul 2020 13:05:19 +0200 Subject: [PATCH 24/59] Init var --- htdocs/core/db/pgsql.class.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/core/db/pgsql.class.php b/htdocs/core/db/pgsql.class.php index 6b71366c46c..08b23156f64 100644 --- a/htdocs/core/db/pgsql.class.php +++ b/htdocs/core/db/pgsql.class.php @@ -183,6 +183,8 @@ class DoliDBPgsql extends DoliDB if ($type == 'dml') { + $reg = array(); + $line = preg_replace('/\s/', ' ', $line); // Replace tabulation with space // we are inside create table statement so lets process datatypes From d6f1a897f65b74771962c1d4353109ccc4670627 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 24 Jul 2020 13:44:32 +0200 Subject: [PATCH 25/59] Fix size of module box --- htdocs/theme/eldy/info-box.inc.php | 10 ++++++++-- htdocs/theme/md/info-box.inc.php | 12 ++++++++++++ 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/htdocs/theme/eldy/info-box.inc.php b/htdocs/theme/eldy/info-box.inc.php index c5f4b8d248c..3b6bf98a1f9 100644 --- a/htdocs/theme/eldy/info-box.inc.php +++ b/htdocs/theme/eldy/info-box.inc.php @@ -381,12 +381,18 @@ if (GETPOSTISSET('THEME_SATURATE_RATIO')) $conf->global->THEME_SATURATE_RATIO = height: 0; } +.info-box-title { + width: calc(100% - 20px); +} .info-box-module { min-width: 350px; max-width: 350px; } -.info-box-title { - width: calc(100% - 20px); +@media only screen and (max-width: 1740px) { + .info-box-module { + min-width: 315px; + max-width: 315px; + } } @media only screen and (max-width: 767px) { .info-box-module { diff --git a/htdocs/theme/md/info-box.inc.php b/htdocs/theme/md/info-box.inc.php index f1c58b4241e..86e6411a923 100644 --- a/htdocs/theme/md/info-box.inc.php +++ b/htdocs/theme/md/info-box.inc.php @@ -439,6 +439,18 @@ if (GETPOSTISSET('THEME_SATURATE_RATIO')) $conf->global->THEME_SATURATE_RATIO = min-width: 350px; max-width: 350px; } +@media only screen and (max-width: 1740px) { + .info-box-module { + min-width: 315px; + max-width: 315px; + } +} +@media only screen and (max-width: 767px) { + .info-box-module { + min-width: 260px; + } +} + .info-box-module .info-box-content { height: 6.3em; } From b82b6736d1139a50cf01d73701ab49d96b65d834 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 24 Jul 2020 18:13:01 +0200 Subject: [PATCH 26/59] Look and feel --- htdocs/holiday/define_holiday.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/holiday/define_holiday.php b/htdocs/holiday/define_holiday.php index d957ade168e..5e8798d901a 100644 --- a/htdocs/holiday/define_holiday.php +++ b/htdocs/holiday/define_holiday.php @@ -268,7 +268,7 @@ else print ''; + print ''; $searchpicto = $form->showFilterButtons(); print $searchpicto; print '
'.$form->editfieldkey($langs->transcountry("LocalTax2IsUsed", $mysoc->country_code), 'localtax2assuj_value', '', $object, 0).''; print $form->selectyesno('localtax2assuj_value', $object->localtax2_assuj, 1); if (!isOnlyOneLocalTax(2)) From dd86c213822fbde73ea0f91155c37a33bb674292 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 24 Jul 2020 11:53:44 +0200 Subject: [PATCH 29/59] FIX dolGetElementUrl and agenda page for external modules --- htdocs/comm/action/card.php | 5 +++-- htdocs/core/lib/company.lib.php | 8 +++++--- htdocs/core/lib/functions2.lib.php | 19 ++++++++++--------- htdocs/langs/en_US/main.lang | 3 ++- .../template/class/myobject.class.php | 4 ++-- .../doc/pdf_standard_myobject.modules.php | 2 +- .../template/myobject_agenda.php | 2 +- .../modulebuilder/template/myobject_card.php | 2 +- 8 files changed, 25 insertions(+), 20 deletions(-) diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 860254756c9..129696a60d9 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -6,8 +6,8 @@ * Copyright (C) 2010-2013 Juanjo Menent * Copyright (C) 2013 Florian Henry * Copyright (C) 2014 Cedric GROSS - * Copyright (C) 2015 Alexandre Spangaro - * Copyright (C) 2018-2019 Frédéric France + * Copyright (C) 2015 Alexandre Spangaro + * Copyright (C) 2018-2019 Frédéric France * Copyright (C) 2019 Ferran Marcet * * This program is free software; you can redistribute it and/or modify @@ -1105,6 +1105,7 @@ if ($action == 'create') print ''; } + $reg = array(); if (GETPOST("datep") && preg_match('/^([0-9][0-9][0-9][0-9])([0-9][0-9])([0-9][0-9])$/', GETPOST("datep"), $reg)) { $object->datep = dol_mktime(0, 0, 0, $reg[2], $reg[3], $reg[1]); diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index e102e0e155d..67611649142 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -1286,7 +1286,7 @@ function show_actions_todo($conf, $langs, $db, $filterobj, $objcon = '', $noprin * @param Conf $conf Object conf * @param Translate $langs Object langs * @param DoliDB $db Object db - * @param mixed $filterobj Filter on object Adherent|Societe|Project|Product|CommandeFournisseur|Dolresource|Ticket|... to list events linked to an object + * @param mixed $filterobj Filter on object Adherent|Societe|Project|Product|CommandeFournisseur|Dolresource|Ticket... to list events linked to an object * @param Contact $objcon Filter on object contact to filter events on a contact * @param int $noprint Return string but does not output it * @param string $actioncode Filter on actioncode @@ -1294,9 +1294,10 @@ function show_actions_todo($conf, $langs, $db, $filterobj, $objcon = '', $noprin * @param array $filters Filter on other fields * @param string $sortfield Sort field * @param string $sortorder Sort order + * @param string $module You can add module name here if elementtype in table llx_actioncomm is objectkey@module * @return string|void Return html part or void if noprint is 1 */ -function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprint = 0, $actioncode = '', $donetodo = 'done', $filters = array(), $sortfield = 'a.datep,a.id', $sortorder = 'DESC') +function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprint = 0, $actioncode = '', $donetodo = 'done', $filters = array(), $sortfield = 'a.datep,a.id', $sortorder = 'DESC', $module = '') { global $user, $conf; global $form; @@ -1416,7 +1417,8 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin } elseif (is_object($filterobj) && is_array($filterobj->fields) && is_array($filterobj->fields['rowid']) && is_array($filterobj->fields['ref']) && $filterobj->table_element && $filterobj->element) { - $sql .= " AND a.fk_element = o.rowid AND a.elementtype = '".$db->escape($filterobj->element)."'"; + // Generic case + $sql .= " AND a.fk_element = o.rowid AND a.elementtype = '".$db->escape($filterobj->element).($module ? '@'.$module : '')."'"; if ($filterobj->id) $sql .= " AND a.fk_element = ".$filterobj->id; } } diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php index b50090ee2cf..84670de46d2 100644 --- a/htdocs/core/lib/functions2.lib.php +++ b/htdocs/core/lib/functions2.lib.php @@ -1809,18 +1809,19 @@ function dolGetElementUrl($objectid, $objecttype, $withpicto = 0, $option = '') $ret = ''; $regs = array(); - // If we ask an resource form external module (instead of default path) + // If we ask a resource form external module (instead of default path) if (preg_match('/^([^@]+)@([^@]+)$/i', $objecttype, $regs)) { $myobject = $regs[1]; $module = $regs[2]; } - - // Parse $objecttype (ex: project_task) - $module = $myobject = $objecttype; - if (preg_match('/^([^_]+)_([^_]+)/i', $objecttype, $regs)) - { - $module = $regs[1]; - $myobject = $regs[2]; + else { + // Parse $objecttype (ex: project_task) + $module = $myobject = $objecttype; + if (preg_match('/^([^_]+)_([^_]+)/i', $objecttype, $regs)) + { + $module = $regs[1]; + $myobject = $regs[2]; + } } // Generic case for $classpath @@ -1896,7 +1897,7 @@ function dolGetElementUrl($objectid, $objecttype, $withpicto = 0, $option = '') // Generic case for $classfile and $classname $classfile = strtolower($myobject); $classname = ucfirst($myobject); - //print "objecttype=".$objecttype." module=".$module." subelement=".$subelement." classfile=".$classfile." classname=".$classname; + //print "objecttype=".$objecttype." module=".$module." subelement=".$subelement." classfile=".$classfile." classname=".$classname." classpath=".$classpath; if ($objecttype == 'invoice_supplier') { $classfile = 'fournisseur.facture'; diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index ab9ead7e991..f87f3a277de 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -1037,4 +1037,5 @@ ShowOtherLanguages=Show other languages SwitchInEditModeToAddTranslation=Switch in edit mode to add translations for this language NotUsedForThisCustomer=Not used for this customer AmountMustBePositive=Amount must be positive -ByStatus=By status \ No newline at end of file +ByStatus=By status +InformationMessage=Information \ No newline at end of file diff --git a/htdocs/modulebuilder/template/class/myobject.class.php b/htdocs/modulebuilder/template/class/myobject.class.php index 19a5cbc99ce..bfd1cd46fb5 100644 --- a/htdocs/modulebuilder/template/class/myobject.class.php +++ b/htdocs/modulebuilder/template/class/myobject.class.php @@ -840,7 +840,7 @@ class MyObject extends CommonObject if (empty($this->labelStatus) || empty($this->labelStatusShort)) { global $langs; - //$langs->load("mymodule"); + //$langs->load("mymodule@mymodule"); $this->labelStatus[self::STATUS_DRAFT] = $langs->trans('Draft'); $this->labelStatus[self::STATUS_VALIDATED] = $langs->trans('Enabled'); $this->labelStatus[self::STATUS_CANCELED] = $langs->trans('Disabled'); @@ -953,7 +953,7 @@ class MyObject extends CommonObject public function getNextNumRef() { global $langs, $conf; - $langs->load("mymodule@myobject"); + $langs->load("mymodule@mymodule"); if (empty($conf->global->MYMODULE_MYOBJECT_ADDON)) { $conf->global->MYMODULE_MYOBJECT_ADDON = 'mod_myobject_standard'; diff --git a/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php b/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php index 7c242c26444..417a3b0c173 100644 --- a/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php +++ b/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php @@ -147,7 +147,7 @@ class pdf_standard_myobject extends ModelePDFMyObject $this->db = $db; $this->name = "standard"; - $this->description = $langs->trans('PDFStandardDescription'); + $this->description = $langs->trans('DocumentModelStandardPDF'); $this->update_main_doc_field = 1; // Save the name of generated file as the main doc when generating a doc with this template // Dimension page diff --git a/htdocs/modulebuilder/template/myobject_agenda.php b/htdocs/modulebuilder/template/myobject_agenda.php index 8f4117a871e..58d64b622d0 100644 --- a/htdocs/modulebuilder/template/myobject_agenda.php +++ b/htdocs/modulebuilder/template/myobject_agenda.php @@ -249,7 +249,7 @@ if ($object->id > 0) $filters['search_agenda_label'] = $search_agenda_label; // TODO Replace this with same code than into list.php - show_actions_done($conf, $langs, $db, $object, null, 0, $actioncode, '', $filters, $sortfield, $sortorder); + show_actions_done($conf, $langs, $db, $object, null, 0, $actioncode, '', $filters, $sortfield, $sortorder, 'mymmodule'); } } diff --git a/htdocs/modulebuilder/template/myobject_card.php b/htdocs/modulebuilder/template/myobject_card.php index f67be16ade1..e00c0a3b618 100644 --- a/htdocs/modulebuilder/template/myobject_card.php +++ b/htdocs/modulebuilder/template/myobject_card.php @@ -589,7 +589,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // List of actions on element include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; $formactions = new FormActions($db); - $somethingshown = $formactions->showactions($object, $object->element, (is_object($object->thirdparty) ? $object->thirdparty->id : 0), 1, '', $MAXEVENT, '', $morehtmlright); + $somethingshown = $formactions->showactions($object, $object->element.'@mymodule', (is_object($object->thirdparty) ? $object->thirdparty->id : 0), 1, '', $MAXEVENT, '', $morehtmlright); print ''; } From 93348630bfd9d57f2bd0cb492d770234ec5d4c78 Mon Sep 17 00:00:00 2001 From: FlorianMortgat <5845502+FlorianMortgat@users.noreply.github.com> Date: Sat, 25 Jul 2020 11:05:05 +0200 Subject: [PATCH 30/59] FIX 11.0: computation of the bottom margin of returns NaN because body is not loaded yet --- htdocs/includes/DebugBar/Resources/debugbar.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/htdocs/includes/DebugBar/Resources/debugbar.js b/htdocs/includes/DebugBar/Resources/debugbar.js index faf567e37c1..1dcbec2146f 100644 --- a/htdocs/includes/DebugBar/Resources/debugbar.js +++ b/htdocs/includes/DebugBar/Resources/debugbar.js @@ -409,12 +409,11 @@ if (typeof(PhpDebugBar) == 'undefined') { className: "phpdebugbar " + csscls('minimized'), - options: { - bodyMarginBottom: true, - bodyMarginBottomHeight: parseInt($('body').css('margin-bottom')) - }, - initialize: function() { + this.options = { + bodyMarginBottom: true, + bodyMarginBottomHeight: parseInt($('body').css('margin-bottom')), + }; this.controls = {}; this.dataMap = {}; this.datasets = {}; From 378c45fe5cd6110b5c7393624f53c2d618dd0262 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 26 Jul 2020 19:21:47 +0200 Subject: [PATCH 31/59] Fix look and feel --- htdocs/admin/confexped.php | 2 +- htdocs/admin/expedition.php | 2 +- htdocs/admin/expedition_extrafields.php | 2 +- htdocs/admin/expeditiondet_extrafields.php | 2 +- htdocs/admin/livraison.php | 2 +- htdocs/admin/livraison_extrafields.php | 2 +- htdocs/admin/livraisondet_extrafields.php | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/admin/confexped.php b/htdocs/admin/confexped.php index fd93b0fa83d..8e666c4be93 100644 --- a/htdocs/admin/confexped.php +++ b/htdocs/admin/confexped.php @@ -93,7 +93,7 @@ print load_fiche_titre($langs->trans("SendingsSetup"), $linkback, 'title_setup') print '
'; $head = expedition_admin_prepare_head(); -dol_fiche_head($head, 'general', $langs->trans("Sendings"), -1, 'sending'); +dol_fiche_head($head, 'general', $langs->trans("Sendings"), -1, 'shipment'); // Miscellaneous parameters diff --git a/htdocs/admin/expedition.php b/htdocs/admin/expedition.php index be9e7091300..4fc0e241dc0 100644 --- a/htdocs/admin/expedition.php +++ b/htdocs/admin/expedition.php @@ -197,7 +197,7 @@ print load_fiche_titre($langs->trans("SendingsSetup"), $linkback, 'title_setup') print '
'; $head = expedition_admin_prepare_head(); -dol_fiche_head($head, 'shipment', $langs->trans("Sendings"), -1, 'sending'); +dol_fiche_head($head, 'shipment', $langs->trans("Sendings"), -1, 'shipment'); // Shipment numbering model diff --git a/htdocs/admin/expedition_extrafields.php b/htdocs/admin/expedition_extrafields.php index 6ff8cd42669..e40519f9104 100644 --- a/htdocs/admin/expedition_extrafields.php +++ b/htdocs/admin/expedition_extrafields.php @@ -76,7 +76,7 @@ print "
\n"; $head = expedition_admin_prepare_head(); -dol_fiche_head($head, 'attributes_shipment', $langs->trans("Sendings"), -1, 'sending'); +dol_fiche_head($head, 'attributes_shipment', $langs->trans("Sendings"), -1, 'shipment'); require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; diff --git a/htdocs/admin/expeditiondet_extrafields.php b/htdocs/admin/expeditiondet_extrafields.php index 8b27aec895e..03cd140d0ee 100644 --- a/htdocs/admin/expeditiondet_extrafields.php +++ b/htdocs/admin/expeditiondet_extrafields.php @@ -77,7 +77,7 @@ print "
\n"; $head = expedition_admin_prepare_head(); -dol_fiche_head($head, 'attributeslines_shipment', $langs->trans("Sendings"), -1, 'sending'); +dol_fiche_head($head, 'attributeslines_shipment', $langs->trans("Sendings"), -1, 'shipment'); require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; diff --git a/htdocs/admin/livraison.php b/htdocs/admin/livraison.php index 4cd8f4841e5..83e2e3b7d54 100644 --- a/htdocs/admin/livraison.php +++ b/htdocs/admin/livraison.php @@ -187,7 +187,7 @@ print load_fiche_titre($langs->trans("SendingsSetup"), $linkback, 'title_setup') print '
'; $head = expedition_admin_prepare_head(); -dol_fiche_head($head, 'receivings', $langs->trans("Receivings"), -1, 'sending'); +dol_fiche_head($head, 'receivings', $langs->trans("Receivings"), -1, 'shipment'); // Delivery numbering model diff --git a/htdocs/admin/livraison_extrafields.php b/htdocs/admin/livraison_extrafields.php index 5594273320f..3b6d03ac98e 100644 --- a/htdocs/admin/livraison_extrafields.php +++ b/htdocs/admin/livraison_extrafields.php @@ -76,7 +76,7 @@ print "
\n"; $head = expedition_admin_prepare_head(); -dol_fiche_head($head, 'attributes_receivings', $langs->trans("Receivings"), -1, 'sending'); +dol_fiche_head($head, 'attributes_receivings', $langs->trans("Receivings"), -1, 'shipment'); require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; diff --git a/htdocs/admin/livraisondet_extrafields.php b/htdocs/admin/livraisondet_extrafields.php index 2c9aae6b253..ebed8de9608 100644 --- a/htdocs/admin/livraisondet_extrafields.php +++ b/htdocs/admin/livraisondet_extrafields.php @@ -77,7 +77,7 @@ print "
\n"; $head = expedition_admin_prepare_head(); -dol_fiche_head($head, 'attributeslines_receivings', $langs->trans("Receivings"), -1, 'sending'); +dol_fiche_head($head, 'attributeslines_receivings', $langs->trans("Receivings"), -1, 'shipment'); require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; From cdf7261c7e7e8d325a65d782d67d6196038ceda1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 26 Jul 2020 19:27:29 +0200 Subject: [PATCH 32/59] Fix look and feel --- 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 ad5bbdd0867..f2cb455cc6b 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -1954,7 +1954,7 @@ elseif ($id || $ref) print '
'; print '
'; - print ''; + print '
'; // Sending method print 'attributes[$object->table_element]['required'][$key])) print ' fieldrequired'; + if ((!empty($action) && ($action == 'create' || $action == 'edit')) && !empty($extrafields->attributes[$object->table_element]['required'][$tmpkeyextra])) print ' fieldrequired'; print '">'; - if (!empty($extrafields->attributes[$object->table_element]['help'][$key])) print $form->textwithpicto($langs->trans($label), $langs->trans($extrafields->attributes[$object->table_element]['help'][$key])); - else print $langs->trans($label); + if (!empty($extrafields->attributes[$object->table_element]['help'][$tmpkeyextra])) print $form->textwithpicto($langs->trans($tmplabelextra), $langs->trans($extrafields->attributes[$object->table_element]['help'][$tmpkeyextra])); + else print $langs->trans($tmplabelextra); print ''; //TODO Improve element and rights detection @@ -151,54 +147,52 @@ if (empty($reshook) && is_array($extrafields->attributes[$object->table_element] if ($object->element == 'mo') $permok = $user->rights->mrp->write; $isdraft = ((isset($object->statut) && $object->statut == 0) || (isset($object->status) && $object->status == 0)); - if (($isdraft || !empty($extrafields->attributes[$object->table_element]['alwayseditable'][$key])) - && $permok && $enabled != 5 && ($action != 'edit_extras' || GETPOST('attribute') != $key) - && empty($extrafields->attributes[$object->table_element]['computed'][$key])) + if (($isdraft || !empty($extrafields->attributes[$object->table_element]['alwayseditable'][$tmpkeyextra])) + && $permok && $enabled != 5 && ($action != 'edit_extras' || GETPOST('attribute') != $tmpkeyextra) + && empty($extrafields->attributes[$object->table_element]['computed'][$tmpkeyextra])) { $fieldid = 'id'; if ($object->table_element == 'societe') $fieldid = 'socid'; - print ''; + print ''; } print '
'; From 353e99c26a77f1fbda89b7f91cc599322b4d9044 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 26 Jul 2020 19:43:55 +0200 Subject: [PATCH 33/59] Fix look and feel --- htdocs/admin/boxes.php | 6 +++--- htdocs/admin/menus.php | 2 +- htdocs/admin/menus/index.php | 2 +- htdocs/admin/menus/other.php | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/admin/boxes.php b/htdocs/admin/boxes.php index c6ff9e94749..afad55a6211 100644 --- a/htdocs/admin/boxes.php +++ b/htdocs/admin/boxes.php @@ -324,7 +324,7 @@ $boxactivated = InfoBox::listBoxes($db, 'activated', -1, null); print "
\n"; print "\n\n".''."\n"; -print load_fiche_titre($langs->trans("BoxesAvailable")); +print load_fiche_titre($langs->trans("BoxesAvailable"), '', ''); print '
'."\n"; print ''."\n"; @@ -390,7 +390,7 @@ print "\n".''."\n"; //var_dump($boxactivated); print "
\n\n"; -print load_fiche_titre($langs->trans("BoxesActivated")); +print load_fiche_titre($langs->trans("BoxesActivated"), '', ''); print '
'; print ''."\n"; @@ -452,7 +452,7 @@ print '
'; // Other parameters print "\n\n".''."\n"; -print load_fiche_titre($langs->trans("Other")); +print load_fiche_titre($langs->trans("Other"), '', ''); print ''; print ''; print ''; diff --git a/htdocs/admin/menus.php b/htdocs/admin/menus.php index 856ad50c28b..7e734a5b093 100644 --- a/htdocs/admin/menus.php +++ b/htdocs/admin/menus.php @@ -153,7 +153,7 @@ print ''; print ''; print ''; -dol_fiche_head($head, 'handler', $langs->trans("Menus"), -1); +dol_fiche_head($head, 'handler', '', -1); print ''.$langs->trans("MenusDesc")."
\n"; print "
\n"; diff --git a/htdocs/admin/menus/index.php b/htdocs/admin/menus/index.php index 1dea0ca4473..0cb69efdf4a 100644 --- a/htdocs/admin/menus/index.php +++ b/htdocs/admin/menus/index.php @@ -235,7 +235,7 @@ $head[$h][1] = $langs->trans("Miscellaneous"); $head[$h][2] = 'misc'; $h++; -dol_fiche_head($head, 'editor', $langs->trans("Menus"), -1); +dol_fiche_head($head, 'editor', '', -1); print ''.$langs->trans("MenusEditorDesc")."
\n"; print "
\n"; diff --git a/htdocs/admin/menus/other.php b/htdocs/admin/menus/other.php index ed35f48d90e..bed6c2a3b4e 100644 --- a/htdocs/admin/menus/other.php +++ b/htdocs/admin/menus/other.php @@ -76,7 +76,7 @@ $head[$h][1] = $langs->trans("Miscellaneous"); $head[$h][2] = 'misc'; $h++; -dol_fiche_head($head, 'misc', $langs->trans("Menus"), -1); +dol_fiche_head($head, 'misc', '', -1); // Other Options From d945ef67e11031f8ff91f607bed56479c77efcd9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 26 Jul 2020 20:51:49 +0200 Subject: [PATCH 34/59] FIX Picto of HRM module Conflicts: htdocs/core/lib/functions.lib.php --- htdocs/core/lib/functions.lib.php | 4 ++-- htdocs/hrm/index.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index a72d2057004..f971afc73c5 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3172,7 +3172,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'setup', 'sign-out', 'split', 'stripe-s', 'switch_off', 'switch_on', 'tools', 'unlink', 'uparrow', 'user', 'vcard', 'wrench', 'jabber', 'skype', 'twitter', 'facebook', 'linkedin', 'instagram', 'snapchat', 'youtube', 'google-plus-g', 'whatsapp', 'chevron-left', 'chevron-right', 'chevron-down', 'chevron-top', - 'home', 'companies', 'products', 'commercial', 'invoicing', 'preview', 'project', 'projectpub', 'supplier_invoice', 'hrm', 'members', 'ticket', 'generic', + 'home', 'hrm', 'companies', 'products', 'commercial', 'invoicing', 'pencil-ruler', 'preview', 'project', 'projectpub', 'supplier_invoice', 'members', 'ticket', 'generic', 'error', 'warning', 'supplier_proposal', 'supplier_order', 'supplier_invoice', 'title_setup', 'title_accountancy', 'title_bank', 'title_hrm', 'title_agenda' ) @@ -3195,7 +3195,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'company'=>'building', 'contact'=>'address-book', 'contract'=>'suitcase', 'conversation'=>'comments', 'donation'=>'file-alt', 'dynamicprice'=>'hand-holding-usd', 'setup'=>'cog', 'companies'=>'building', 'products'=>'cube', 'commercial'=>'suitcase', 'invoicing'=>'coins', 'accounting'=>'chart-line', 'category'=>'tag', 'dollyrevert'=>'dolly', - 'hrm'=>'umbrella-beach', 'margin'=>'calculator', 'members'=>'users', 'ticket'=>'ticket-alt', 'globe'=>'external-link-alt', 'lot'=>'barcode', + 'hrm'=>'user-tie', 'margin'=>'calculator', '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', 'label'=>'layer-group', diff --git a/htdocs/hrm/index.php b/htdocs/hrm/index.php index e31266f755c..ba33ecbbdb3 100644 --- a/htdocs/hrm/index.php +++ b/htdocs/hrm/index.php @@ -77,7 +77,7 @@ $childids[] = $user->id; llxHeader('', $langs->trans('HRMArea')); -print load_fiche_titre($langs->trans("HRMArea"), '', 'user'); +print load_fiche_titre($langs->trans("HRMArea"), '', 'hrm'); if (!empty($setupcompanynotcomplete)) From 714481f7e5289d63ec1908669b1d3aeb22574ef8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 26 Jul 2020 21:07:39 +0200 Subject: [PATCH 35/59] FIX Navigation in object fails to find the next ref in some cases --- htdocs/core/class/commonobject.class.php | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 9601320af49..7fc42512baf 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -1899,14 +1899,15 @@ abstract class CommonObject $row = $this->db->fetch_row($result); $this->ref_previous = $row[0]; - $sql = "SELECT MIN(te.".$fieldid.")"; $sql .= " FROM ".(empty($nodbprefix) ?MAIN_DB_PREFIX:'').$this->table_element." as te"; if ($this->element == 'user' && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) { $sql .= ",".MAIN_DB_PREFIX."usergroup_user as ug"; } - if (isset($this->ismultientitymanaged) && $this->ismultientitymanaged == 'fk_soc@societe') $sql .= ", ".MAIN_DB_PREFIX."societe as s"; // If we need to link to societe to limit select to entity - elseif ($this->restrictiononfksoc == 1 && $this->element != 'societe' && !$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe as s"; // If we need to link to societe to limit select to socid + if (isset($this->ismultientitymanaged) && !is_numeric($this->ismultientitymanaged)) { + $tmparray = explode('@', $this->ismultientitymanaged); + $sql .= ", ".MAIN_DB_PREFIX.$tmparray[1]." as ".($tmparray[1] == 'societe' ? 's' : 'parenttable'); // If we need to link to this table to limit select to entity + } elseif ($this->restrictiononfksoc == 1 && $this->element != 'societe' && !$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe as s"; // If we need to link to societe to limit select to socid elseif ($this->restrictiononfksoc == 2 && $this->element != 'societe' && !$user->rights->societe->client->voir && !$socid) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON te.fk_soc = s.rowid"; // If we need to link to societe to limit select to socid if ($this->restrictiononfksoc && !$user->rights->societe->client->voir && !$socid) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON ".$aliastablesociete.".rowid = sc.fk_soc"; $sql .= " WHERE te.".$fieldid." > '".$this->db->escape($this->ref)."'"; // ->ref must always be defined (set to id if field does not exists) @@ -1917,8 +1918,10 @@ abstract class CommonObject if (!preg_match('/^\s*AND/i', $filter)) $sql .= " AND "; // For backward compatibility $sql .= $filter; } - if (isset($this->ismultientitymanaged) && $this->ismultientitymanaged == 'fk_soc@societe') $sql .= ' AND te.fk_soc = s.rowid'; // If we need to link to societe to limit select to entity - elseif ($this->restrictiononfksoc == 1 && $this->element != 'societe' && !$user->rights->societe->client->voir && !$socid) $sql .= ' AND te.fk_soc = s.rowid'; // If we need to link to societe to limit select to socid + if (isset($this->ismultientitymanaged) && !is_numeric($this->ismultientitymanaged)) { + $tmparray = explode('@', $this->ismultientitymanaged); + $sql .= ' AND te.'.$tmparray[0].' = '.($tmparray[1] == 'societe' ? 's' : 'parenttable').'.rowid'; // If we need to link to this table to limit select to entity + } elseif ($this->restrictiononfksoc == 1 && $this->element != 'societe' && !$user->rights->societe->client->voir && !$socid) $sql .= ' AND te.fk_soc = s.rowid'; // If we need to link to societe to limit select to socid if (isset($this->ismultientitymanaged) && $this->ismultientitymanaged == 1) { if ($this->element == 'user' && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) { if (!empty($user->admin) && empty($user->entity) && $conf->entity == 1) { @@ -1931,6 +1934,10 @@ abstract class CommonObject $sql .= ' AND te.entity IN ('.getEntity($this->element).')'; } } + if (isset($this->ismultientitymanaged) && !is_numeric($this->ismultientitymanaged) && $this->element != 'societe') { + $tmparray = explode('@', $this->ismultientitymanaged); + $sql .= ' AND parenttable.entity IN ('.getEntity($tmparray[1]).')'; + } if ($this->restrictiononfksoc == 1 && $socid && $this->element != 'societe') $sql .= ' AND te.fk_soc = '.$socid; if ($this->restrictiononfksoc == 2 && $socid && $this->element != 'societe') $sql .= ' AND (te.fk_soc = '.$socid.' OR te.fk_soc IS NULL)'; if ($this->restrictiononfksoc && $socid && $this->element == 'societe') $sql .= ' AND te.rowid = '.$socid; From 26c253113b08342a98ae030aba0c8618803bf35e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 26 Jul 2020 22:04:19 +0200 Subject: [PATCH 36/59] Removed not used files --- htdocs/public/ticket/img/bg_ticket.png | Bin 9235 -> 0 bytes htdocs/public/ticket/img/index.html | 1 - 2 files changed, 1 deletion(-) delete mode 100644 htdocs/public/ticket/img/bg_ticket.png delete mode 100644 htdocs/public/ticket/img/index.html diff --git a/htdocs/public/ticket/img/bg_ticket.png b/htdocs/public/ticket/img/bg_ticket.png deleted file mode 100644 index c5fd05c662a721015116ec7cc87e4acf3276721d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 9235 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 Date: Mon, 27 Jul 2020 02:25:09 +0200 Subject: [PATCH 37/59] FIX Setup of clicktodial hang on smartphone --- htdocs/admin/clicktodial.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/admin/clicktodial.php b/htdocs/admin/clicktodial.php index 8d22e01b436..f6033934077 100644 --- a/htdocs/admin/clicktodial.php +++ b/htdocs/admin/clicktodial.php @@ -62,6 +62,8 @@ if ($action == 'setvalue' && $user->admin) * View */ +$form = new Form($db); + $user->fetch_clicktodial(); $wikihelp = 'EN:Module_ClickToDial_En|FR:Module_ClickToDial|ES:Módulo_ClickTodial_Es'; From 9798bb1b30b92b18ff05495983538533d94b91b3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 27 Jul 2020 02:27:27 +0200 Subject: [PATCH 38/59] Fix responsive --- htdocs/admin/clicktodial.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/admin/clicktodial.php b/htdocs/admin/clicktodial.php index f6033934077..13efb42af1a 100644 --- a/htdocs/admin/clicktodial.php +++ b/htdocs/admin/clicktodial.php @@ -79,6 +79,7 @@ print ''; print ''; print ''; +print '
'; print '
'; print ''; print ''; @@ -111,6 +112,7 @@ print $langs->trans("Example").':
http://myphoneserver/mypage?login=__LOGIN__ print '
'; print '
'.$langs->trans("Name").'
'; +print '
'; print '

'; From 19b550009b3dd9710d6795acc8c0229641967e1e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 27 Jul 2020 02:38:31 +0200 Subject: [PATCH 39/59] Trans --- htdocs/langs/en_US/admin.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 5887f6cde4a..c99c436915d 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1687,7 +1687,7 @@ AGENDA_SHOW_LINKED_OBJECT=Show linked object into agenda view ##### Clicktodial ##### ClickToDialSetup=Click To Dial module setup ClickToDialUrlDesc=Url called when a click on phone picto is done. In URL, you can use tags
__PHONETO__ that will be replaced with the phone number of person to call
__PHONEFROM__ that will be replaced with phone number of calling person (yours)
__LOGIN__ that will be replaced with clicktodial login (defined on user card)
__PASS__ that will be replaced with clicktodial password (defined on user card). -ClickToDialDesc=This module makea phone numbers clickable links. A click on the icon will make your phone call the number. This can be used to call a call-center system from Dolibarr that can call the phone number on a SIP system for example. +ClickToDialDesc=This module change phone numbers, when using a desktop computer, into clickable links. A click will call the number. This can be used to start the phone call when using a soft phone on your desktop or when using a CTI system based on SIP protocol for example. Note: When using a smartphone, phone numbers are always clickable. ClickToDialUseTelLink=Use just a link "tel:" on phone numbers ClickToDialUseTelLinkDesc=Use this method if your users have a softphone or a software interface installed on the same computer as the browser, and called when you click on a link in your browser that starts with "tel:". If you need a full server solution (no need of local software installation), you must set this to "No" and fill next field. ##### Point Of Sale (CashDesk) ##### From 6d8060bc502784a439c47d939a412807ea467d28 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 27 Jul 2020 14:04:41 +0200 Subject: [PATCH 40/59] FIX DO not erase variable $key and $label during output of extrafields Conflicts: htdocs/core/tpl/extrafields_view.tpl.php --- htdocs/core/tpl/extrafields_view.tpl.php | 86 +++++++++++------------- 1 file changed, 40 insertions(+), 46 deletions(-) diff --git a/htdocs/core/tpl/extrafields_view.tpl.php b/htdocs/core/tpl/extrafields_view.tpl.php index 9b324817464..f3a181f0b2e 100644 --- a/htdocs/core/tpl/extrafields_view.tpl.php +++ b/htdocs/core/tpl/extrafields_view.tpl.php @@ -54,50 +54,48 @@ if (empty($reshook) && is_array($extrafields->attributes[$object->table_element] $extrafields_collapse_num = ''; $extrafields_collapse_num_old = ''; $i = 0; - foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $label) + foreach ($extrafields->attributes[$object->table_element]['label'] as $tmpkeyextra => $tmplabelextra) { $i++; // Discard if extrafield is a hidden field on form $enabled = 1; - if ($enabled && isset($extrafields->attributes[$object->table_element]['enabled'][$key])) + if ($enabled && isset($extrafields->attributes[$object->table_element]['enabled'][$tmpkeyextra])) { - $enabled = dol_eval($extrafields->attributes[$object->table_element]['enabled'][$key], 1); + $enabled = dol_eval($extrafields->attributes[$object->table_element]['enabled'][$tmpkeyextra], 1); } - if ($enabled && isset($extrafields->attributes[$object->table_element]['list'][$key])) + if ($enabled && isset($extrafields->attributes[$object->table_element]['list'][$tmpkeyextra])) { - $enabled = dol_eval($extrafields->attributes[$object->table_element]['list'][$key], 1); + $enabled = dol_eval($extrafields->attributes[$object->table_element]['list'][$tmpkeyextra], 1); } $perms = 1; - if ($perms && isset($extrafields->attributes[$object->table_element]['perms'][$key])) + if ($perms && isset($extrafields->attributes[$object->table_element]['perms'][$tmpkeyextra])) { - $perms = dol_eval($extrafields->attributes[$object->table_element]['perms'][$key], 1); + $perms = dol_eval($extrafields->attributes[$object->table_element]['perms'][$tmpkeyextra], 1); } - //print $key.'-'.$enabled.'-'.$perms.'-'.$label.$_POST["options_" . $key].'
'."\n"; + //print $tmpkeyextra.'-'.$enabled.'-'.$perms.'-'.$tmplabelextra.$_POST["options_" . $tmpkeyextra].'
'."\n"; if (empty($enabled)) continue; // 0 = Never visible field if (abs($enabled) != 1 && abs($enabled) != 3 && abs($enabled) != 5 && abs($enabled) != 4) continue; // <> -1 and <> 1 and <> 3 = not visible on forms, only on list <> 4 = not visible at the creation if (empty($perms)) continue; // 0 = Not visible // Load language if required - if (!empty($extrafields->attributes[$object->table_element]['langfile'][$key])) $langs->load($extrafields->attributes[$object->table_element]['langfile'][$key]); + if (!empty($extrafields->attributes[$object->table_element]['langfile'][$tmpkeyextra])) $langs->load($extrafields->attributes[$object->table_element]['langfile'][$tmpkeyextra]); if ($action == 'edit_extras') { - $value = (isset($_POST["options_".$key]) ? $_POST["options_".$key] : $object->array_options["options_".$key]); - } - else - { - $value = $object->array_options["options_".$key]; - //var_dump($key.' - '.$value); + $value = (isset($_POST["options_".$tmpkeyextra]) ? $_POST["options_".$tmpkeyextra] : $object->array_options["options_".$tmpkeyextra]); + } else { + $value = $object->array_options["options_".$tmpkeyextra]; + //var_dump($tmpkeyextra.' - '.$value); } // Print line tr of extra field - if ($extrafields->attributes[$object->table_element]['type'][$key] == 'separate') + if ($extrafields->attributes[$object->table_element]['type'][$tmpkeyextra] == 'separate') { $extrafields_collapse_num = ''; - $extrafield_param = $extrafields->attributes[$object->table_element]['param'][$key]; + $extrafield_param = $extrafields->attributes[$object->table_element]['param'][$tmpkeyextra]; if (!empty($extrafield_param) && is_array($extrafield_param)) { $extrafield_param_list = array_keys($extrafield_param['options']); @@ -105,17 +103,15 @@ if (empty($reshook) && is_array($extrafields->attributes[$object->table_element] $extrafield_collapse_display_value = intval($extrafield_param_list[0]); if ($extrafield_collapse_display_value == 1 || $extrafield_collapse_display_value == 2) { - $extrafields_collapse_num = $extrafields->attributes[$object->table_element]['pos'][$key]; + $extrafields_collapse_num = $extrafields->attributes[$object->table_element]['pos'][$tmpkeyextra]; } } } - print $extrafields->showSeparator($key, $object); + print $extrafields->showSeparator($tmpkeyextra, $object); - $lastseparatorkeyfound = $key; - } - else - { + $lastseparatorkeyfound = $tmpkeyextra; + } else { print '
'.img_edit().''.img_edit().'
'; print '
'; + print ''; // Convert date into timestamp format - if (in_array($extrafields->attributes[$object->table_element]['type'][$key], array('date', 'datetime'))) + if (in_array($extrafields->attributes[$object->table_element]['type'][$tmpkeyextra], array('date', 'datetime'))) { - $datenotinstring = $object->array_options['options_'.$key]; - // print 'X'.$object->array_options['options_' . $key].'-'.$datenotinstring.'x'; - if (!is_numeric($object->array_options['options_'.$key])) // For backward compatibility + $datenotinstring = $object->array_options['options_'.$tmpkeyextra]; + // print 'X'.$object->array_options['options_' . $tmpkeyextra].'-'.$datenotinstring.'x'; + if (!is_numeric($object->array_options['options_'.$tmpkeyextra])) // For backward compatibility { $datenotinstring = $db->jdate($datenotinstring); } - //print 'x'.$object->array_options['options_' . $key].'-'.$datenotinstring.' - '.dol_print_date($datenotinstring, 'dayhour'); - $value = isset($_POST["options_".$key]) ? dol_mktime($_POST["options_".$key."hour"], $_POST["options_".$key."min"], 0, $_POST["options_".$key."month"], $_POST["options_".$key."day"], $_POST["options_".$key."year"]) : $datenotinstring; + //print 'x'.$object->array_options['options_' . $tmpkeyextra].'-'.$datenotinstring.' - '.dol_print_date($datenotinstring, 'dayhour'); + $value = isset($_POST["options_".$tmpkeyextra]) ? dol_mktime($_POST["options_".$tmpkeyextra."hour"], $_POST["options_".$tmpkeyextra."min"], 0, $_POST["options_".$tmpkeyextra."month"], $_POST["options_".$tmpkeyextra."day"], $_POST["options_".$tmpkeyextra."year"]) : $datenotinstring; } //TODO Improve element and rights detection - if ($action == 'edit_extras' && $permok && GETPOST('attribute', 'none') == $key) + if ($action == 'edit_extras' && $permok && GETPOST('attribute', 'none') == $tmpkeyextra) { $fieldid = 'id'; if ($object->table_element == 'societe') $fieldid = 'socid'; print ''; print ''; - print ''; + print ''; print ''; print ''; - print $extrafields->showInputField($key, $value, '', '', '', 0, $object->id, $object->table_element); + print $extrafields->showInputField($tmpkeyextra, $value, '', '', '', 0, $object->id, $object->table_element); print ''; print ''; - } - else - { - //var_dump($key.'-'.$value.'-'.$object->table_element); - print $extrafields->showOutputField($key, $value, '', $object->table_element); + } else { + //var_dump($tmpkeyextra.'-'.$value.'-'.$object->table_element); + print $extrafields->showOutputField($tmpkeyextra, $value, '', $object->table_element); } print '

'; */ $sql = "SELECT f.ref, f.rowid, f.total_ttc, f.fk_statut, f.paye, f.type,"; $sql .= " pfd.date_demande, pfd.amount,"; -$sql .= " s.nom as name, s.email, s.rowid as socid"; +$sql .= " s.nom as name, s.email, s.rowid as socid, s.tva_intra"; $sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f,"; $sql .= " ".MAIN_DB_PREFIX."societe as s"; if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; @@ -138,13 +138,14 @@ if ($resql) $thirdpartystatic->id = $obj->socid; $thirdpartystatic->name = $obj->name; $thirdpartystatic->email = $obj->email; + $thirdpartystatic->tva_intra = $obj->tva_intra; print '
'; print $invoicestatic->getNomUrl(1, 'withdraw'); print ''; - print $thirdpartystatic->getNomUrl(1, 'customer'); + print $thirdpartystatic->getNomUrl(1, 'supplier'); print ''; diff --git a/htdocs/compta/prelevement/card.php b/htdocs/compta/prelevement/card.php index 3ad145e2f56..23b6fdac500 100644 --- a/htdocs/compta/prelevement/card.php +++ b/htdocs/compta/prelevement/card.php @@ -31,10 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.p require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; // Load translation files required by the page -$langs->loadLangs(array('banks', 'categories', 'bills', 'withdrawals')); - -if (!$user->rights->prelevement->bons->lire) -accessforbidden(); +$langs->loadLangs(array('banks', 'categories', 'bills', 'companies', 'withdrawals')); // Security check if ($user->socid > 0) accessforbidden(); @@ -44,7 +41,6 @@ $action = GETPOST('action', 'alpha'); $id = GETPOST('id', 'int'); $ref = GETPOST('ref', 'alpha'); $socid = GETPOST('socid', 'int'); - $type = GETPOST('type', 'aZ09'); // Load variable for pagination @@ -67,6 +63,13 @@ include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be includ $hookmanager->initHooks(array('directdebitprevcard', 'globalcard', 'directdebitprevlist')); +if (!$user->rights->prelevement->bons->lire && $object->type != 'bank-transfer') { + accessforbidden(); +} +if (!$user->rights->paymentbybanktransfer->read && $object->type == 'bank-transfer') { + accessforbidden(); +} + /* * Actions @@ -174,7 +177,7 @@ if ($id > 0 || $ref) }*/ - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref'); @@ -200,7 +203,7 @@ if ($id > 0 || $ref) print '
'.$langs->trans("TransData").''; print dol_print_date($object->date_trans, 'day'); - print ' '.$langs->trans("By").' '.$muser->getFullName($langs).'
'.$langs->trans("TransMetod").''; print $object->methodes_trans[$object->method_trans]; print '
'; - print $langs->trans("BankToReceiveWithdraw"); + $labelofbankfield = "BankToReceiveWithdraw"; + if ($object->type == 'bank-transfer') $labelofbankfield = 'BankToPayCreditTransfer'; + print $langs->trans($labelofbankfield); print ''; if ($acc->id > 0) @@ -232,9 +237,13 @@ if ($id > 0 || $ref) print '
'; - print $langs->trans("WithdrawalFile").''; + $labelfororderfield = 'WithdrawalFile'; + if ($object->type == 'bank-transfer') $labelfororderfield = 'CreditTransferFile'; + print $langs->trans($labelfororderfield).''; $relativepath = 'receipts/'.$object->ref.'.xml'; - print ''.$relativepath.''; + $modulepart = 'prelevement'; + if ($object->type == 'bank-transfer') $modulepart = 'paymentbybanktransfer'; + print ''.$relativepath.''; print '
'; print ''; diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index 8cf77667a62..29c70ba8fab 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -295,6 +295,7 @@ class BonPrelevement extends CommonObject $sql .= ", p.method_trans, p.fk_user_trans"; $sql .= ", p.date_credit as date_credit"; $sql .= ", p.fk_user_credit"; + $sql .= ", p.type"; $sql .= ", p.statut as status"; $sql .= " FROM ".MAIN_DB_PREFIX."prelevement_bons as p"; $sql .= " WHERE p.entity IN (".getEntity('invoice').")"; @@ -322,6 +323,8 @@ class BonPrelevement extends CommonObject $this->date_credit = $this->db->jdate($obj->date_credit); $this->user_credit = $obj->fk_user_credit; + $this->type = $obj->type; + $this->status = $obj->status; $this->statut = $obj->status; // For backward compatibility @@ -930,14 +933,14 @@ class BonPrelevement extends CommonObject foreach ($factures as $key => $fac) { if ($type != 'bank-transfer') { - $fact = new Facture($this->db); + $tmpinvoice = new Facture($this->db); } else { - $fact = new FactureFournisseur($this->db); + $tmpinvoice = new FactureFournisseur($this->db); } - $resfetch = $fact->fetch($fac[0]); + $resfetch = $tmpinvoice->fetch($fac[0]); if ($resfetch >= 0) // Field 0 of $fac is rowid of invoice { - if ($soc->fetch($fact->socid) >= 0) + if ($soc->fetch($tmpinvoice->socid) >= 0) { $bac = new CompanyBankAccount($this->db); $bac->fetch(0, $soc->id); @@ -963,9 +966,9 @@ class BonPrelevement extends CommonObject } else { - dol_syslog(__METHOD__."::Check BAN Error on default bank number IBAN/BIC for thirdparty reported by verif() ".$fact->socid." ".$soc->name, LOG_WARNING); - $this->invoice_in_error[$fac[0]] = "Error on default bank number IBAN/BIC for invoice ".$fact->getNomUrl(0)." for thirdparty ".$soc->getNomUrl(0); - $this->thirdparty_in_error[$soc->id] = "Error on default bank number IBAN/BIC for invoice ".$fact->getNomUrl(0)." for thirdparty ".$soc->getNomUrl(0); + dol_syslog(__METHOD__."::Check BAN Error on default bank number IBAN/BIC for thirdparty reported by verif() ".$tmpinvoice->socid." ".$soc->name, LOG_WARNING); + $this->invoice_in_error[$fac[0]] = "Error on default bank number IBAN/BIC for invoice ".$tmpinvoice->getNomUrl(0)." for thirdparty ".$soc->getNomUrl(0); + $this->thirdparty_in_error[$soc->id] = "Error on default bank number IBAN/BIC for invoice ".$tmpinvoice->getNomUrl(0)." for thirdparty ".$soc->getNomUrl(0); } } else @@ -1142,7 +1145,7 @@ class BonPrelevement extends CommonObject * Create file of direct debit order or credit transfer into a XML file */ - dol_syslog(__METHOD__."::Init direct debit file for ".count($factures_prev)." invoices", LOG_DEBUG); + dol_syslog(__METHOD__."::Init direct debit or credit transfer file for ".count($factures_prev)." invoices", LOG_DEBUG); if (count($factures_prev) > 0) { @@ -1168,8 +1171,8 @@ class BonPrelevement extends CommonObject $this->factures = $factures_prev_id; $this->context['factures_prev'] = $factures_prev; - // Generation of SEPA file $this->filename - // This also the the property $this->total that is included into file + // Generation of direct debit or credti transfer file $this->filename (May be a SEPA file for european countries) + // This also set the property $this->total with amount that is included into file $result = $this->generate($format, $executiondate, $type); } dol_syslog(__METHOD__."::End withdraw receipt, file ".$this->filename, LOG_DEBUG); @@ -1499,8 +1502,110 @@ class BonPrelevement extends CommonObject $found++; if ($type == 'bank-transfer') { - print 'TODO'; - exit; + /** + * SECTION CREATION FICHIER SEPA - CREDIT TRANSFER + */ + // SEPA Initialisation + $CrLf = "\n"; + + $now = dol_now(); + + $dateTime_ECMA = dol_print_date($now, '%Y-%m-%dT%H:%M:%S'); + + $date_actu = $now; + if (!empty($executiondate)) $date_actu = $executiondate; + + $dateTime_YMD = dol_print_date($date_actu, '%Y%m%d'); + $dateTime_YMDHMS = dol_print_date($date_actu, '%Y%m%d%H%M%S'); + $fileCrediteurSection = ''; + $fileEmetteurSection = ''; + $i = 0; + + /* + * Section Creditor (sepa Crediteurs bloc lines) + */ + + $sql = "SELECT soc.code_client as code, soc.address, soc.zip, soc.town, c.code as country_code,"; + $sql .= " pl.client_nom as nom, pl.code_banque as cb, pl.code_guichet as cg, pl.number as cc, pl.amount as somme,"; + $sql .= " f.ref as fac, pf.fk_facture as idfac, rib.datec, rib.iban_prefix as iban, rib.bic as bic, rib.rowid as drum, rib.rum, rib.date_rum"; + $sql .= " FROM"; + $sql .= " ".MAIN_DB_PREFIX."prelevement_lignes as pl,"; + $sql .= " ".MAIN_DB_PREFIX."facture_fourn as f,"; + $sql .= " ".MAIN_DB_PREFIX."prelevement_facture as pf,"; + $sql .= " ".MAIN_DB_PREFIX."societe as soc,"; + $sql .= " ".MAIN_DB_PREFIX."c_country as c,"; + $sql .= " ".MAIN_DB_PREFIX."societe_rib as rib"; + $sql .= " WHERE pl.fk_prelevement_bons = ".$this->id; + $sql .= " AND pl.rowid = pf.fk_prelevement_lignes"; + $sql .= " AND pf.fk_facture_fourn = f.rowid"; + $sql .= " AND soc.fk_pays = c.rowid"; + $sql .= " AND soc.rowid = f.fk_soc"; + $sql .= " AND rib.fk_soc = f.fk_soc"; + $sql .= " AND rib.default_rib = 1"; + $sql .= " AND rib.type = 'ban'"; + //print $sql; + + // Define $fileCrediteurSection. One section DrctDbtTxInf per invoice. + $resql = $this->db->query($sql); + if ($resql) + { + $num = $this->db->num_rows($resql); + while ($i < $num) + { + $obj = $this->db->fetch_object($resql); + $daterum = (!empty($obj->date_rum)) ? $this->db->jdate($obj->date_rum) : $this->db->jdate($obj->datec); + $fileCrediteurSection .= $this->EnregDestinataireSEPA($obj->code, $obj->nom, $obj->address, $obj->zip, $obj->town, $obj->country_code, $obj->cb, $obj->cg, $obj->cc, $obj->somme, $obj->fac, $obj->idfac, $obj->iban, $obj->bic, $daterum, $obj->drum, $obj->rum); + $this->total = $this->total + $obj->somme; + $i++; + } + $nbtotalDrctDbtTxInf = $i; + } + else + { + fputs($this->file, 'ERROR CREDITOR '.$sql.$CrLf); // CREDITORS = Suppliers + $result = -2; + } + + // Define $fileEmetteurSection. Start of bloc PmtInf. Will contains all $nbtotalDrctDbtTxInf + if ($result != -2) + { + $fileEmetteurSection .= $this->EnregEmetteurSEPA($conf, $date_actu, $nbtotalDrctDbtTxInf, $this->total, $CrLf, $format); + } + + /** + * SECTION CREATION SEPA FILE - CREDTI TRANSFER - ISO200022 + */ + // SEPA File Header + fputs($this->file, '<'.'?xml version="1.0" encoding="UTF-8" standalone="yes"?'.'>'.$CrLf); + fputs($this->file, ''.$CrLf); + fputs($this->file, ' '.$CrLf); + // SEPA Group header + fputs($this->file, ' '.$CrLf); + fputs($this->file, ' '.('CREDTRANS'.$dateTime_YMD.'/REF'.$this->id).''.$CrLf); + fputs($this->file, ' '.$dateTime_ECMA.''.$CrLf); + fputs($this->file, ' '.$i.''.$CrLf); + fputs($this->file, ' '.$this->total.''.$CrLf); + fputs($this->file, ' '.$CrLf); + fputs($this->file, ' '.strtoupper(dol_string_unaccent($this->raison_sociale)).''.$CrLf); + fputs($this->file, ' '.$CrLf); + fputs($this->file, ' '.$CrLf); + fputs($this->file, ' '.$CrLf); + fputs($this->file, ' '.$conf->global->PRELEVEMENT_ICS.''.$CrLf); + fputs($this->file, ' '.$CrLf); + fputs($this->file, ' '.$CrLf); + fputs($this->file, ' '.$CrLf); + fputs($this->file, ' '.$CrLf); + fputs($this->file, ' '.$CrLf); + // SEPA File Emetteur (mycompany) + if ($result != -2) + { fputs($this-> file, $fileEmetteurSection); } + // SEPA File Creditors + if ($result != -2) + { fputs($this-> file, $fileCrediteurSection); } + // SEPA FILE FOOTER + fputs($this->file, ' '.$CrLf); + fputs($this->file, ' '.$CrLf); + fputs($this->file, ''.$CrLf); } else { /** * SECTION CREATION FICHIER SEPA @@ -1566,18 +1671,14 @@ class BonPrelevement extends CommonObject $result = -2; } - // Define $fileEmetteurSection. Start of bloc PmtInf. Will contains all DrctDbtTxInf + // Define $fileEmetteurSection. Start of bloc PmtInf. Will contains all $nbtotalDrctDbtTxInf if ($result != -2) { $fileEmetteurSection .= $this->EnregEmetteurSEPA($conf, $date_actu, $nbtotalDrctDbtTxInf, $this->total, $CrLf, $format); } - else - { - fputs($this->file, 'ERROR CREDITOR'.$CrLf); // CREDITOR = My company - } /** - * SECTION CREATION SEPA FILE + * SECTION CREATION SEPA FILE - ISO200022 */ // SEPA File Header fputs($this->file, '<'.'?xml version="1.0" encoding="UTF-8" standalone="yes"?'.'>'.$CrLf); diff --git a/htdocs/compta/prelevement/create.php b/htdocs/compta/prelevement/create.php index ff25af5e0e9..fdbb6189c5c 100644 --- a/htdocs/compta/prelevement/create.php +++ b/htdocs/compta/prelevement/create.php @@ -104,7 +104,11 @@ if (empty($reshook)) } else { - setEventMessages($langs->trans("DirectDebitOrderCreated", $bprev->getNomUrl(1)), null); + if ($type != 'bank-transfer') { + setEventMessages($langs->trans("DirectDebitOrderCreated", $bprev->getNomUrl(1)), null); + } else { + setEventMessages($langs->trans("CreditTransferOrderCreated", $bprev->getNomUrl(1)), null); + } header("Location: ".DOL_URL_ROOT.'/compta/prelevement/card.php?id='.$bprev->id); exit; diff --git a/htdocs/compta/prelevement/demandes.php b/htdocs/compta/prelevement/demandes.php index b92df4e446c..2d2be116aaf 100644 --- a/htdocs/compta/prelevement/demandes.php +++ b/htdocs/compta/prelevement/demandes.php @@ -192,6 +192,14 @@ print ''; $param = ''; +$label = 'NewStandingOrder'; +$typefilter = ''; +if ($type == 'bank-transfer') { + $label = 'NewPaymentByBankTransfer'; + $typefilter = 'type='.$type; +} +$newcardbutton .= dolGetButtonTitle($langs->trans($label), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/compta/prelevement/create.php'.($typefilter ? '?'.$typefilter : '')); + print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'generic', 0, $newcardbutton, '', $limit); print ''; diff --git a/htdocs/compta/prelevement/factures.php b/htdocs/compta/prelevement/factures.php index 556f40de9be..816795bfdbd 100644 --- a/htdocs/compta/prelevement/factures.php +++ b/htdocs/compta/prelevement/factures.php @@ -32,21 +32,21 @@ require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; // Load translation files required by the page -$langs->loadLangs(array('banks', 'categories', 'companies', 'withdrawals', 'bills')); +$langs->loadLangs(array('banks', 'categories', 'bills', 'companies', 'withdrawals')); // Securite acces client if ($user->socid > 0) accessforbidden(); // Get supervariables $id = GETPOST('id', 'int'); -$socid = GETPOST('socid', 'int'); $ref = GETPOST('ref', 'alpha'); - +$socid = GETPOST('socid', 'int'); $type = GETPOST('type', 'aZ09'); +// Load variable for pagination $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; -$sortfield = GETPOST("sortfield", 'alpha'); -$sortorder = GETPOST("sortorder", 'alpha'); +$sortfield = GETPOST('sortfield', 'alpha'); +$sortorder = GETPOST('sortorder', 'alpha'); $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 $offset = $limit * $page; @@ -57,6 +57,17 @@ if (!$sortorder) $sortorder = 'DESC'; $object = new BonPrelevement($db); +// Load object +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals + +$hookmanager->initHooks(array('directdebitprevcard', 'globalcard', 'directdebitprevlist')); + +if (!$user->rights->prelevement->bons->lire && $object->type != 'bank-transfer') { + accessforbidden(); +} +if (!$user->rights->paymentbybanktransfer->read && $object->type == 'bank-transfer') { + accessforbidden(); +} /* @@ -75,19 +86,17 @@ if ($id > 0 || $ref) $head = prelevement_prepare_head($object); dol_fiche_head($head, 'invoices', $langs->trans("WithdrawalsReceipts"), -1, 'payment'); - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref'); print '
'; print '
'; - print '
'; + print '
'."\n"; //print ''; print ''; print ''; - // Status - //print ''; if ($object->date_trans <> 0) { @@ -119,7 +128,9 @@ if ($id > 0 || $ref) $result = $acc->fetch($conf->global->PRELEVEMENT_ID_BANKACCOUNT); print ''; print ''; print '
'.$langs->trans("Ref").''.$object->getNomUrl(1).'
'.$langs->trans("Date").''.dol_print_date($object->datec, 'day').'
'.$langs->trans("Amount").''.price($object->amount).'
'.$langs->trans('Status').''.$object->getLibStatut(1).'
'; - print $langs->trans("BankToReceiveWithdraw"); + $labelofbankfield = "BankToReceiveWithdraw"; + if ($object->type == 'bank-transfer') $labelofbankfield = 'BankToPayCreditTransfer'; + print $langs->trans($labelofbankfield); print ''; if ($acc->id > 0) @@ -128,9 +139,13 @@ if ($id > 0 || $ref) print '
'; - print $langs->trans("WithdrawalFile").''; + $labelfororderfield = 'WithdrawalFile'; + if ($object->type == 'bank-transfer') $labelfororderfield = 'CreditTransferFile'; + print $langs->trans($labelfororderfield).''; $relativepath = 'receipts/'.$object->ref.'.xml'; - print ''.$relativepath.''; + $modulepart = 'prelevement'; + if ($object->type == 'bank-transfer') $modulepart = 'paymentbybanktransfer'; + print ''.$relativepath.''; print '
'; print ''; @@ -151,13 +166,25 @@ $sql .= " s.rowid as socid, s.nom as name, pl.statut, pl.amount as amount_reques $sql .= " FROM ".MAIN_DB_PREFIX."prelevement_bons as p"; $sql .= ", ".MAIN_DB_PREFIX."prelevement_lignes as pl"; $sql .= ", ".MAIN_DB_PREFIX."prelevement_facture as pf"; -$sql .= ", ".MAIN_DB_PREFIX."facture as f"; +if ($object->type != 'bank-transfer') { + $sql .= ", ".MAIN_DB_PREFIX."facture as f"; +} else { + $sql .= ", ".MAIN_DB_PREFIX."facture_fourn as f"; +} $sql .= ", ".MAIN_DB_PREFIX."societe as s"; $sql .= " WHERE pf.fk_prelevement_lignes = pl.rowid"; $sql .= " AND pl.fk_prelevement_bons = p.rowid"; $sql .= " AND f.fk_soc = s.rowid"; -$sql .= " AND pf.fk_facture = f.rowid"; -$sql .= " AND f.entity IN (".getEntity('invoice').")"; +if ($object->type != 'bank-transfer') { + $sql .= " AND pf.fk_facture = f.rowid"; +} else { + $sql .= " AND pf.fk_facture_fourn = f.rowid"; +} +if ($object->type != 'bank-transfer') { + $sql .= " AND f.entity IN (".getEntity('invoice').")"; +} else { + $sql .= " AND f.entity IN (".getEntity('supplier_invoice').")"; +} if ($object->id > 0) $sql .= " AND p.rowid=".$object->id; if ($socid) $sql .= " AND s.rowid = ".$socid; $sql .= $db->order($sortfield, $sortorder); diff --git a/htdocs/compta/prelevement/fiche-rejet.php b/htdocs/compta/prelevement/fiche-rejet.php index 75cff74da8a..10abbcf5166 100644 --- a/htdocs/compta/prelevement/fiche-rejet.php +++ b/htdocs/compta/prelevement/fiche-rejet.php @@ -21,7 +21,7 @@ /** * \file htdocs/compta/prelevement/fiche-rejet.php * \ingroup prelevement - * \brief Withdraw reject + * \brief Debit order or credit transfer reject */ require '../../main.inc.php'; @@ -34,7 +34,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; // Load translation files required by the page $langs->loadLangs(array("banks", "categories", 'withdrawals', 'bills')); -// Securite acces client +// Security check if ($user->socid > 0) accessforbidden(); // Get supervariables @@ -55,6 +55,15 @@ $pagenext = $page + 1; $object = new BonPrelevement($db); +// Load object +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals + +if (!$user->rights->prelevement->bons->lire && $object->type != 'bank-transfer') { + accessforbidden(); +} +if (!$user->rights->paymentbybanktransfer->read && $object->type == 'bank-transfer') { + accessforbidden(); +} @@ -71,7 +80,7 @@ if ($prev_id > 0 || $ref) $head = prelevement_prepare_head($object); dol_fiche_head($head, 'rejects', $langs->trans("WithdrawalsReceipts"), -1, 'payment'); - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref'); @@ -83,13 +92,6 @@ if ($prev_id > 0 || $ref) print ''.$langs->trans("Date").''.dol_print_date($object->datec, 'day').''; print ''.$langs->trans("Amount").''.price($object->amount).''; - // Status - /* - print ''.$langs->trans('Status').''; - print ''.$object->getLibStatut(1).''; - print ''; - */ - if ($object->date_trans <> 0) { $muser = new User($db); @@ -120,7 +122,9 @@ if ($prev_id > 0 || $ref) $result = $acc->fetch($conf->global->PRELEVEMENT_ID_BANKACCOUNT); print ''; - print $langs->trans("BankToReceiveWithdraw"); + $labelofbankfield = "BankToReceiveWithdraw"; + if ($object->type == 'bank-transfer') $labelofbankfield = 'BankToPayCreditTransfer'; + print $langs->trans($labelofbankfield); print ''; print ''; if ($acc->id > 0) @@ -129,9 +133,13 @@ if ($prev_id > 0 || $ref) print ''; print ''; - print $langs->trans("WithdrawalFile").''; + $labelfororderfield = 'WithdrawalFile'; + if ($object->type == 'bank-transfer') $labelfororderfield = 'CreditTransferFile'; + print $langs->trans($labelfororderfield).''; $relativepath = 'receipts/'.$object->ref.'.xml'; - print ''.$relativepath.''; + $modulepart = 'prelevement'; + if ($object->type == 'bank-transfer') $modulepart = 'paymentbybanktransfer'; + print ''.$relativepath.''; print ''; print ''; @@ -144,6 +152,7 @@ if ($prev_id > 0 || $ref) } } + $rej = new RejetPrelevement($db, $user); /* diff --git a/htdocs/compta/prelevement/fiche-stat.php b/htdocs/compta/prelevement/fiche-stat.php index 899ff69fea1..49508cdde46 100644 --- a/htdocs/compta/prelevement/fiche-stat.php +++ b/htdocs/compta/prelevement/fiche-stat.php @@ -20,7 +20,7 @@ /** * \file htdocs/compta/prelevement/fiche-stat.php * \ingroup prelevement - * \brief Prelevement statistics + * \brief Debit order or credit transfer statistics */ require '../../main.inc.php'; @@ -54,6 +54,17 @@ $pagenext = $page + 1; $object = new BonPrelevement($db); +// Load object +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals + +if (!$user->rights->prelevement->bons->lire && $object->type != 'bank-transfer') { + accessforbidden(); +} +if (!$user->rights->paymentbybanktransfer->read && $object->type == 'bank-transfer') { + accessforbidden(); +} + + /* * View @@ -68,7 +79,7 @@ if ($prev_id > 0 || $ref) $head = prelevement_prepare_head($object); dol_fiche_head($head, 'statistics', $langs->trans("WithdrawalsReceipts"), -1, 'payment'); - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref'); @@ -80,13 +91,6 @@ if ($prev_id > 0 || $ref) print ''.$langs->trans("Date").''.dol_print_date($object->datec, 'day').''; print ''.$langs->trans("Amount").''.price($object->amount).''; - // Status - /* - print ''.$langs->trans('Status').''; - print ''.$object->getLibStatut(1).''; - print ''; - */ - if ($object->date_trans <> 0) { $muser = new User($db); @@ -117,7 +121,9 @@ if ($prev_id > 0 || $ref) $result = $acc->fetch($conf->global->PRELEVEMENT_ID_BANKACCOUNT); print ''; - print $langs->trans("BankToReceiveWithdraw"); + $labelofbankfield = "BankToReceiveWithdraw"; + if ($object->type == 'bank-transfer') $labelofbankfield = 'BankToPayCreditTransfer'; + print $langs->trans($labelofbankfield); print ''; print ''; if ($acc->id > 0) @@ -126,9 +132,13 @@ if ($prev_id > 0 || $ref) print ''; print ''; - print $langs->trans("WithdrawalFile").''; + $labelfororderfield = 'WithdrawalFile'; + if ($object->type == 'bank-transfer') $labelfororderfield = 'CreditTransferFile'; + print $langs->trans($labelfororderfield).''; $relativepath = 'receipts/'.$object->ref.'.xml'; - print ''.$relativepath.''; + $modulepart = 'prelevement'; + if ($object->type == 'bank-transfer') $modulepart = 'paymentbybanktransfer'; + print ''.$relativepath.''; print ''; print ''; @@ -137,14 +147,13 @@ if ($prev_id > 0 || $ref) } else { - $langs->load("errors"); - print $langs->trans("Error"); + dol_print_error($db); } /* * Stats */ - $ligne = new LignePrelevement($db); + $line = new LignePrelevement($db); $sql = "SELECT sum(pl.amount), pl.statut"; $sql .= " FROM ".MAIN_DB_PREFIX."prelevement_lignes as pl"; @@ -170,7 +179,7 @@ if ($prev_id > 0 || $ref) print ''; - print $ligne->LibStatut($row[1], 1); + print $line->LibStatut($row[1], 1); print ''; print price($row[0]); diff --git a/htdocs/core/lib/prelevement.lib.php b/htdocs/core/lib/prelevement.lib.php index a404e19184e..8008c9fd51f 100644 --- a/htdocs/core/lib/prelevement.lib.php +++ b/htdocs/core/lib/prelevement.lib.php @@ -39,8 +39,13 @@ function prelevement_prepare_head(BonPrelevement $object) $h = 0; $head = array(); + $titleoftab = "WithdrawalsReceipts"; + if ($object->type == 'bank-transfer') { + $titleoftab = "BankTransferReceipts"; + } + $head[$h][0] = DOL_URL_ROOT.'/compta/prelevement/card.php?id='.$object->id; - $head[$h][1] = $langs->trans("WithdrawalsReceipts"); + $head[$h][1] = $langs->trans($titleoftab); $head[$h][2] = 'prelevement'; $h++; diff --git a/htdocs/langs/en_US/withdrawals.lang b/htdocs/langs/en_US/withdrawals.lang index 841a9c2d480..662c587108a 100644 --- a/htdocs/langs/en_US/withdrawals.lang +++ b/htdocs/langs/en_US/withdrawals.lang @@ -77,12 +77,12 @@ StatusMotif8=Other reason CreateForSepaFRST=Create direct debit file (SEPA FRST) CreateForSepaRCUR=Create direct debit file (SEPA RCUR) CreateAll=Create direct debit file (all) -CreateFileForPaymentByBankTransfer=Create credit transfer (all) +CreateFileForPaymentByBankTransfer=Create file for credit transfer (all) CreateSepaFileForPaymentByBankTransfer=Create credit transfer file (SEPA) CreateGuichet=Only office CreateBanque=Only bank OrderWaiting=Waiting for treatment -NotifyTransmision=Withdrawal Transmission +NotifyTransmision=File transmission NotifyCredit=Withdrawal Credit NumeroNationalEmetter=National Transmitter Number WithBankUsingRIB=For bank accounts using RIB @@ -95,7 +95,8 @@ ShowWithdraw=Show Direct Debit Order IfInvoiceNeedOnWithdrawPaymentWontBeClosed=However, if invoice has at least one direct debit payment order not yet processed, it won't be set as paid to allow prior withdrawal management. DoStandingOrdersBeforePayments=This tab allows you to request a direct debit payment order. Once done, go into menu Bank->Payment by direct debit to generate and manage the direct debit order. When direct debit order is closed, payment on invoices will be automatically recorded, and invoices closed if remainder to pay is null. DoCreditTransferBeforePayments=This tab allows you to request a credit transfer order. Once done, go into menu Bank->Payment by credit transfer to generate and manage the credit transfer order. When credit transfer order is closed, payment on invoices will be automatically recorded, and invoices closed if remainder to pay is null. -WithdrawalFile=Withdrawal file +WithdrawalFile=Debit order file +CreditTransferFile=Credit transfer file SetToStatusSent=Set to status "File Sent" ThisWillAlsoAddPaymentOnInvoice=This will also record payments on invoices and will classify them as "Paid" if remain to pay is null StatisticsByLineStatus=Statistics by status of lines @@ -121,6 +122,7 @@ SEPAFrstOrRecur=Type of payment ModeRECUR=Recurring payment ModeFRST=One-off payment PleaseCheckOne=Please check one only +CreditTransferOrderCreated=Credit transfer order %s created DirectDebitOrderCreated=Direct debit order %s created AmountRequested=Amount requested SEPARCUR=SEPA CUR From ee55b82a8d7449b53f649417102ffb43e2e9e5cb Mon Sep 17 00:00:00 2001 From: Marc DLL <68746600@users.noreply.github.com> Date: Mon, 27 Jul 2020 23:27:44 +0200 Subject: [PATCH 43/59] FIX: shipping creation: checks not done on weight and sizes --- htdocs/expedition/class/expedition.class.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index b623ea9c629..8417ddb9bfb 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -321,10 +321,10 @@ class Expedition extends CommonObject $sql.= ", ".($this->fk_delivery_address>0?$this->fk_delivery_address:"null"); $sql.= ", ".($this->shipping_method_id>0?$this->shipping_method_id:"null"); $sql.= ", '".$this->db->escape($this->tracking_number)."'"; - $sql.= ", ".$this->weight; - $sql.= ", ".$this->sizeS; // TODO Should use this->trueDepth - $sql.= ", ".$this->sizeW; // TODO Should use this->trueWidth - $sql.= ", ".$this->sizeH; // TODO Should use this->trueHeight + $sql.= ", ".(is_numeric($this->weight)?$this->weight:'NULL'); + $sql.= ", ".(is_numeric($this->sizeS)?$this->sizeS:'NULL'); // TODO Should use this->trueDepth + $sql.= ", ".(is_numeric($this->sizeW)?$this->sizeW:'NULL'); // TODO Should use this->trueWidth + $sql.= ", ".(is_numeric($this->sizeH)?$this->sizeH:'NULL'); // TODO Should use this->trueHeight $sql.= ", ".($this->weight_units != '' ? (int) $this->weight_units : 'NULL'); $sql.= ", ".($this->size_units != '' ? (int) $this->size_units : 'NULL'); $sql.= ", ".(!empty($this->note_private)?"'".$this->db->escape($this->note_private)."'":"null"); From 98064f73298fe6e33b7bfcbca8abe7f9526c81e6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 28 Jul 2020 02:47:46 +0200 Subject: [PATCH 44/59] FIX Bad param --- htdocs/modulebuilder/template/admin/myobject_extrafields.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/modulebuilder/template/admin/myobject_extrafields.php b/htdocs/modulebuilder/template/admin/myobject_extrafields.php index 13a6e7b54c5..065feb6cebe 100644 --- a/htdocs/modulebuilder/template/admin/myobject_extrafields.php +++ b/htdocs/modulebuilder/template/admin/myobject_extrafields.php @@ -68,7 +68,7 @@ $linkback = 'trans("MyObjectExtraFields"), -1, 'account'); From 4e4f0a4575cbff32534b77a7af37174533030dab Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 28 Jul 2020 09:44:48 +0200 Subject: [PATCH 45/59] Use same case for all sql files --- htdocs/admin/system/database-tables.php | 2 +- htdocs/install/mysql/tables/llx_c_format_cards.sql | 2 +- htdocs/install/mysql/tables/llx_establishment.sql | 2 +- htdocs/install/mysql/tables/llx_expeditiondet_batch.sql | 2 +- htdocs/install/mysql/tables/llx_expensereport_rules.sql | 2 +- htdocs/install/mysql/tables/llx_inventory.sql | 2 +- htdocs/install/mysql/tables/llx_inventorydet.sql | 2 +- htdocs/install/mysql/tables/llx_oauth_state.sql | 2 +- htdocs/install/mysql/tables/llx_oauth_token.sql | 2 +- htdocs/install/mysql/tables/llx_opensurvey_comments.sql | 2 +- htdocs/install/mysql/tables/llx_opensurvey_formquestions.sql | 2 +- htdocs/install/mysql/tables/llx_opensurvey_sondage.sql | 2 +- htdocs/install/mysql/tables/llx_opensurvey_user_formanswers.sql | 2 +- htdocs/install/mysql/tables/llx_opensurvey_user_studs.sql | 2 +- htdocs/install/mysql/tables/llx_product_batch.sql | 2 +- htdocs/install/mysql/tables/llx_product_lot.sql | 2 +- htdocs/install/mysql/tables/llx_propal_merge_pdf_product.sql | 2 +- 17 files changed, 17 insertions(+), 17 deletions(-) diff --git a/htdocs/admin/system/database-tables.php b/htdocs/admin/system/database-tables.php index 323d9b4c115..97b8237c6f2 100644 --- a/htdocs/admin/system/database-tables.php +++ b/htdocs/admin/system/database-tables.php @@ -119,7 +119,7 @@ else print ''.$obj->Engine.''; if (isset($obj->Engine) && $obj->Engine == "MyISAM") { - print ''.$langs->trans("Convert").' InnoDB'; + print ''.$langs->trans("Convert").' InnoDb'; } else { diff --git a/htdocs/install/mysql/tables/llx_c_format_cards.sql b/htdocs/install/mysql/tables/llx_c_format_cards.sql index b69b9eb19d1..d3885b5d256 100644 --- a/htdocs/install/mysql/tables/llx_c_format_cards.sql +++ b/htdocs/install/mysql/tables/llx_c_format_cards.sql @@ -36,4 +36,4 @@ CREATE TABLE llx_c_format_cards custom_x double(24,8) NOT NULL, custom_y double(24,8) NOT NULL, active integer NOT NULL -) ENGINE=InnoDB; +) ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_establishment.sql b/htdocs/install/mysql/tables/llx_establishment.sql index 89fec8f54e2..83cfadb7307 100644 --- a/htdocs/install/mysql/tables/llx_establishment.sql +++ b/htdocs/install/mysql/tables/llx_establishment.sql @@ -37,5 +37,5 @@ CREATE TABLE llx_establishment ( datec datetime NOT NULL, tms timestamp NOT NULL, status tinyint DEFAULT 1 -) ENGINE=InnoDB; +) ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_expeditiondet_batch.sql b/htdocs/install/mysql/tables/llx_expeditiondet_batch.sql index 7a6a3bfd777..43b64451364 100644 --- a/htdocs/install/mysql/tables/llx_expeditiondet_batch.sql +++ b/htdocs/install/mysql/tables/llx_expeditiondet_batch.sql @@ -23,5 +23,5 @@ CREATE TABLE llx_expeditiondet_batch ( batch varchar(128) DEFAULT NULL, qty double NOT NULL DEFAULT '0', fk_origin_stock integer NOT NULL -) ENGINE=InnoDB; +) ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_expensereport_rules.sql b/htdocs/install/mysql/tables/llx_expensereport_rules.sql index aa6d7553639..2a10cc24a7d 100644 --- a/htdocs/install/mysql/tables/llx_expensereport_rules.sql +++ b/htdocs/install/mysql/tables/llx_expensereport_rules.sql @@ -31,4 +31,4 @@ CREATE TABLE llx_expensereport_rules ( code_expense_rules_type varchar(50) NOT NULL, is_for_all tinyint DEFAULT 0, entity integer DEFAULT 1 -) ENGINE=InnoDB; +) ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_inventory.sql b/htdocs/install/mysql/tables/llx_inventory.sql index 70e409193aa..4ccb234e26e 100644 --- a/htdocs/install/mysql/tables/llx_inventory.sql +++ b/htdocs/install/mysql/tables/llx_inventory.sql @@ -35,4 +35,4 @@ CREATE TABLE llx_inventory date_validation datetime DEFAULT NULL, import_key varchar(14) -- import key ) -ENGINE=InnoDB; +ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_inventorydet.sql b/htdocs/install/mysql/tables/llx_inventorydet.sql index b4df529433e..161e34183a0 100644 --- a/htdocs/install/mysql/tables/llx_inventorydet.sql +++ b/htdocs/install/mysql/tables/llx_inventorydet.sql @@ -30,4 +30,4 @@ qty_stock double DEFAULT NULL, -- The targeted value. can be filled during dra qty_view double DEFAULT NULL, -- must be filled once regulation is done qty_regulated double DEFAULT NULL -- must be filled once regulation is done ) -ENGINE=InnoDB; +ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_oauth_state.sql b/htdocs/install/mysql/tables/llx_oauth_state.sql index 39ade6bc529..77093f6d1b4 100644 --- a/htdocs/install/mysql/tables/llx_oauth_state.sql +++ b/htdocs/install/mysql/tables/llx_oauth_state.sql @@ -22,4 +22,4 @@ CREATE TABLE llx_oauth_state ( fk_user integer, fk_adherent integer, entity integer DEFAULT 1 -)ENGINE=InnoDB; +)ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_oauth_token.sql b/htdocs/install/mysql/tables/llx_oauth_token.sql index bbc236be6c1..145e646230d 100644 --- a/htdocs/install/mysql/tables/llx_oauth_token.sql +++ b/htdocs/install/mysql/tables/llx_oauth_token.sql @@ -24,4 +24,4 @@ CREATE TABLE llx_oauth_token ( fk_user integer, fk_adherent integer, entity integer DEFAULT 1 -)ENGINE=InnoDB; +)ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_opensurvey_comments.sql b/htdocs/install/mysql/tables/llx_opensurvey_comments.sql index 74a9d9ec3cb..3fcc5a0abf9 100644 --- a/htdocs/install/mysql/tables/llx_opensurvey_comments.sql +++ b/htdocs/install/mysql/tables/llx_opensurvey_comments.sql @@ -21,5 +21,5 @@ CREATE TABLE llx_opensurvey_comments ( comment text NOT NULL, tms timestamp, usercomment text -) ENGINE=InnoDB; +) ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_opensurvey_formquestions.sql b/htdocs/install/mysql/tables/llx_opensurvey_formquestions.sql index 044fabc5029..8a15936c86f 100644 --- a/htdocs/install/mysql/tables/llx_opensurvey_formquestions.sql +++ b/htdocs/install/mysql/tables/llx_opensurvey_formquestions.sql @@ -20,5 +20,5 @@ CREATE TABLE llx_opensurvey_formquestions ( id_sondage VARCHAR(16), question TEXT, available_answers TEXT -- List of available answers -) ENGINE=InnoDB; +) ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_opensurvey_sondage.sql b/htdocs/install/mysql/tables/llx_opensurvey_sondage.sql index c3f1cdbfee1..0521f533fdd 100644 --- a/htdocs/install/mysql/tables/llx_opensurvey_sondage.sql +++ b/htdocs/install/mysql/tables/llx_opensurvey_sondage.sql @@ -31,4 +31,4 @@ CREATE TABLE llx_opensurvey_sondage ( allow_spy tinyint NOT NULL DEFAULT 1, tms TIMESTAMP, sujet TEXT -- Not filled if format = 'F'. Question are into table llx_opensurvey_formquestions -) ENGINE=InnoDB; +) ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_opensurvey_user_formanswers.sql b/htdocs/install/mysql/tables/llx_opensurvey_user_formanswers.sql index bd55d256a06..957818db4a1 100644 --- a/htdocs/install/mysql/tables/llx_opensurvey_user_formanswers.sql +++ b/htdocs/install/mysql/tables/llx_opensurvey_user_formanswers.sql @@ -19,4 +19,4 @@ CREATE TABLE llx_opensurvey_user_formanswers ( fk_user_survey INTEGER NOT NULL, fk_question INTEGER NOT NULL, reponses TEXT -) ENGINE=InnoDB; +) ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_opensurvey_user_studs.sql b/htdocs/install/mysql/tables/llx_opensurvey_user_studs.sql index 16ef0b2cf7e..a2ddafa1b54 100644 --- a/htdocs/install/mysql/tables/llx_opensurvey_user_studs.sql +++ b/htdocs/install/mysql/tables/llx_opensurvey_user_studs.sql @@ -21,4 +21,4 @@ CREATE TABLE llx_opensurvey_user_studs ( id_sondage VARCHAR(16) NOT NULL, reponses VARCHAR(100) NOT NULL, -- Not used for 'F' surveys tms timestamp -) ENGINE=InnoDB; +) ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_product_batch.sql b/htdocs/install/mysql/tables/llx_product_batch.sql index 7b09d6a0024..9b736278e3a 100644 --- a/htdocs/install/mysql/tables/llx_product_batch.sql +++ b/htdocs/install/mysql/tables/llx_product_batch.sql @@ -27,5 +27,5 @@ CREATE TABLE llx_product_batch ( batch varchar(128) NOT NULL, qty double NOT NULL DEFAULT 0, import_key varchar(14) DEFAULT NULL -) ENGINE=InnoDB; +) ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_product_lot.sql b/htdocs/install/mysql/tables/llx_product_lot.sql index 885f699d800..4d59a46c153 100644 --- a/htdocs/install/mysql/tables/llx_product_lot.sql +++ b/htdocs/install/mysql/tables/llx_product_lot.sql @@ -29,4 +29,4 @@ CREATE TABLE llx_product_lot ( fk_user_creat integer, fk_user_modif integer, import_key integer -) ENGINE=InnoDB; +) ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_propal_merge_pdf_product.sql b/htdocs/install/mysql/tables/llx_propal_merge_pdf_product.sql index e081b97969f..0c636b2507c 100644 --- a/htdocs/install/mysql/tables/llx_propal_merge_pdf_product.sql +++ b/htdocs/install/mysql/tables/llx_propal_merge_pdf_product.sql @@ -24,5 +24,5 @@ CREATE TABLE llx_propal_merge_pdf_product ( datec datetime NOT NULL, tms timestamp NOT NULL, import_key varchar(14) DEFAULT NULL -) ENGINE=InnoDB; +) ENGINE=innodb; From d46d34915eebd58a0a81768b65c857ffff54f560 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 28 Jul 2020 10:23:09 +0200 Subject: [PATCH 46/59] FIX Checkbox "drop table" was not checked when using php method for dump --- htdocs/admin/tools/dolibarr_export.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/tools/dolibarr_export.php b/htdocs/admin/tools/dolibarr_export.php index 6bbaeb7c6c8..e168f5fbdc0 100644 --- a/htdocs/admin/tools/dolibarr_export.php +++ b/htdocs/admin/tools/dolibarr_export.php @@ -302,7 +302,7 @@ if (in_array($type, array('mysql', 'mysqli'))) { print '
'; print '
'.$langs->trans('ExportStructure').''; - print ''; + print ''; print ''; print '
'; print '
'; From 9f0c3b0db1a665a3daeb3d099fc357363f382933 Mon Sep 17 00:00:00 2001 From: atm-lena Date: Tue, 28 Jul 2020 15:13:56 +0200 Subject: [PATCH 47/59] fetch() command fourn : Same management as commande.class.php of entity --- htdocs/fourn/class/fournisseur.commande.class.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index cd35e1d34de..c6c06a8d9b7 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -331,8 +331,11 @@ class CommandeFournisseur extends CommonOrder $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_input_method as cm ON cm.rowid = c.fk_input_method"; $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_incoterms as i ON c.fk_incoterms = i.rowid'; $sql .= " WHERE c.entity IN (".getEntity('supplier_order').")"; + + if(empty($id)) $sql .= " WHERE c.entity IN (".getEntity('supplier_order').")"; + else $sql .= " WHERE c.rowid=".$id; + if ($ref) $sql .= " AND c.ref='".$this->db->escape($ref)."'"; - else $sql .= " AND c.rowid=".$id; dol_syslog(get_class($this)."::fetch", LOG_DEBUG); $resql = $this->db->query($sql); From b480fb2dfcf73c3331a66b9cbb0bc33c1cd5e3c9 Mon Sep 17 00:00:00 2001 From: atm-lena Date: Tue, 28 Jul 2020 15:32:58 +0200 Subject: [PATCH 48/59] Delete double line --- htdocs/fourn/class/fournisseur.commande.class.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index c6c06a8d9b7..fc76a158cab 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -330,7 +330,6 @@ class CommandeFournisseur extends CommonOrder $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as p ON c.fk_mode_reglement = p.id"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_input_method as cm ON cm.rowid = c.fk_input_method"; $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_incoterms as i ON c.fk_incoterms = i.rowid'; - $sql .= " WHERE c.entity IN (".getEntity('supplier_order').")"; if(empty($id)) $sql .= " WHERE c.entity IN (".getEntity('supplier_order').")"; else $sql .= " WHERE c.rowid=".$id; From d214dbb5fd4f99216466265254d84e6c1148965a Mon Sep 17 00:00:00 2001 From: VERDOL Gauthier Date: Tue, 28 Jul 2020 15:42:54 +0200 Subject: [PATCH 49/59] FIX : Order by amount in product propal stats must be done on d.total_ht and not p.total --- htdocs/product/stats/propal.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/stats/propal.php b/htdocs/product/stats/propal.php index 208ff49e158..52f0510cb80 100644 --- a/htdocs/product/stats/propal.php +++ b/htdocs/product/stats/propal.php @@ -208,7 +208,7 @@ if ($id > 0 || ! empty($ref)) print_liste_field_titre("Company", $_SERVER["PHP_SELF"], "s.nom", "", $option, '', $sortfield, $sortorder); print_liste_field_titre("DatePropal", $_SERVER["PHP_SELF"], "p.datep", "", $option, 'align="center"', $sortfield, $sortorder); print_liste_field_titre("Qty", $_SERVER["PHP_SELF"], "d.qty", "", $option, 'align="center"', $sortfield, $sortorder); - print_liste_field_titre("AmountHT", $_SERVER["PHP_SELF"], "p.total", "", $option, 'align="right"', $sortfield, $sortorder); + print_liste_field_titre("AmountHT", $_SERVER["PHP_SELF"], "d.total_ht", "", $option, 'align="right"', $sortfield, $sortorder); print_liste_field_titre("Status", $_SERVER["PHP_SELF"], "p.fk_statut", "", $option, 'align="right"', $sortfield, $sortorder); print "\n"; From 8ee5b16e895f39b3126a553a61ace03cbe29b14b Mon Sep 17 00:00:00 2001 From: lvessiller Date: Wed, 29 Jul 2020 12:00:22 +0200 Subject: [PATCH 50/59] FIX redirect on contact card from main search --- htdocs/contact/list.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index b0db8b0affb..b8f9d3d14a4 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -389,8 +389,8 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) $sql.= $db->plimit($limit+1, $offset); -$result = $db->query($sql); -if (! $result) +$resql = $db->query($sql); +if (! $resql) { dol_print_error($db); exit; @@ -763,7 +763,7 @@ $i = 0; $totalarray=array(); while ($i < min($num, $limit)) { - $obj = $db->fetch_object($result); + $obj = $db->fetch_object($resql); print ''; @@ -980,7 +980,7 @@ while ($i < min($num, $limit)) $i++; } -$db->free($result); +$db->free($resql); $parameters=array('arrayfields'=>$arrayfields, 'sql'=>$sql); $reshook=$hookmanager->executeHooks('printFieldListFooter', $parameters); // Note that $action and $object may have been modified by hook From 41483df6893333edebdd80ccfda593a4061bf3b9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 29 Jul 2020 12:31:03 +0200 Subject: [PATCH 51/59] FIX #14076 --- htdocs/theme/md/dropdown.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/theme/md/dropdown.inc.php b/htdocs/theme/md/dropdown.inc.php index aae84a27c1b..b86b935c5d1 100644 --- a/htdocs/theme/md/dropdown.inc.php +++ b/htdocs/theme/md/dropdown.inc.php @@ -147,7 +147,7 @@ button.dropdown-item.global-search-item { * MENU Dropdown */ .login_block.usedropdown .logout-btn{ - display: none; + /* display: none; */ } .tmenu .open.dropdown, .tmenu .open.dropdown { From 44cfb776227c21c8d1b2ba25890a1dd50d2c94c0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 29 Jul 2020 12:43:53 +0200 Subject: [PATCH 52/59] FIX #14292 --- htdocs/install/pgsql/functions/functions.sql | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/htdocs/install/pgsql/functions/functions.sql b/htdocs/install/pgsql/functions/functions.sql index 40628f93ac6..22c122a1164 100644 --- a/htdocs/install/pgsql/functions/functions.sql +++ b/htdocs/install/pgsql/functions/functions.sql @@ -58,6 +58,7 @@ CREATE OR REPLACE FUNCTION dol_util_triggerall(DoEnable boolean) RETURNS integer -- Add triggers for timestamp fields named tms CREATE OR REPLACE FUNCTION update_modified_column_tms() RETURNS TRIGGER AS $$ BEGIN NEW.tms = now(); RETURN NEW; END; $$ LANGUAGE plpgsql; + CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_accounting_account FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_accounting_fiscalyear FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_actioncomm FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); @@ -127,6 +128,9 @@ CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_localtax FOR EACH RO CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_mailing FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_mailing_cibles FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_menu FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); +CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_mrp_mo FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); +CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_mrp_mo_extrafields FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); +CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_mrp_production FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_notify FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_notify_def FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_opensurvey_comments FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); From 391fcc799bf8f03487c7da946c2b9f1dc50b2352 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 29 Jul 2020 12:51:18 +0200 Subject: [PATCH 53/59] FIX #14279 --- htdocs/api/index.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/htdocs/api/index.php b/htdocs/api/index.php index 112eb58059f..b5b34658551 100644 --- a/htdocs/api/index.php +++ b/htdocs/api/index.php @@ -254,15 +254,17 @@ if (!empty($reg[1]) && ($reg[1] != 'explorer' || ($reg[2] != '/swagger.json' && if ($tmpmodule != 'api') $tmpmodule = preg_replace('/api$/i', '', $tmpmodule); $classfile = str_replace('_', '', $tmpmodule); - if ($module == 'supplierproposals') + + // Special cases that does not match name rules conventions + if ($moduleobject == 'supplierproposals') $classfile = 'supplier_proposals'; - if ($module == 'supplierorders') + if ($moduleobject == 'supplierorders') $classfile = 'supplier_orders'; - if ($module == 'supplierinvoices') + if ($moduleobject == 'supplierinvoices') $classfile = 'supplier_invoices'; - if ($module == 'ficheinter') + if ($moduleobject == 'ficheinter') $classfile = 'interventions'; - if ($module == 'interventions') + if ($moduleobject == 'interventions') $classfile = 'interventions'; $dir_part_file = dol_buildpath('/'.$moduledirforclass.'/class/api_'.$classfile.'.class.php', 0, 2); From 85c5f423b119ee58a99e01480266461a8c4c0b63 Mon Sep 17 00:00:00 2001 From: Tim Otte Date: Tue, 28 Jul 2020 11:14:55 +0200 Subject: [PATCH 54/59] Added fetch_thirdparty (without the site crashes) --- htdocs/comm/propal/card.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index e07f69ea5dc..eddf967c7d1 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -236,6 +236,7 @@ if (empty($reshook)) $outputlangs->setDefaultLang($newlang); } $ret = $object->fetch($id); // Reload to get new records + if ($ret > 0) $object->fetch_thirdparty(); $object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); } @@ -803,6 +804,7 @@ if (empty($reshook)) $outputlangs->setDefaultLang($newlang); } $ret = $object->fetch($id); // Reload to get new records + if ($ret > 0) $object->fetch_thirdparty(); $object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); } } @@ -1284,6 +1286,7 @@ if (empty($reshook)) $outputlangs->setDefaultLang($newlang); } $ret = $object->fetch($id); // Reload to get new records + if ($ret > 0) $object->fetch_thirdparty(); $object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); } From d9191c74d8f3212d20125e47c4faed056d6e4214 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 29 Jul 2020 12:59:59 +0200 Subject: [PATCH 55/59] Update fournisseur.commande.class.php --- htdocs/fourn/class/fournisseur.commande.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index fc76a158cab..dd34555dd79 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -331,7 +331,7 @@ class CommandeFournisseur extends CommonOrder $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_input_method as cm ON cm.rowid = c.fk_input_method"; $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_incoterms as i ON c.fk_incoterms = i.rowid'; - if(empty($id)) $sql .= " WHERE c.entity IN (".getEntity('supplier_order').")"; + if (empty($id)) $sql .= " WHERE c.entity IN (".getEntity('supplier_order').")"; else $sql .= " WHERE c.rowid=".$id; if ($ref) $sql .= " AND c.ref='".$this->db->escape($ref)."'"; From 3c6eb5e0e2b669fe5121dc40e0e4290a37f28c5e Mon Sep 17 00:00:00 2001 From: AXeL Date: Sat, 25 Jul 2020 14:07:44 +0100 Subject: [PATCH 56/59] Add missing "Default values" menu entry to auguria menu --- htdocs/core/menus/init_menu_auguria.sql | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/menus/init_menu_auguria.sql b/htdocs/core/menus/init_menu_auguria.sql index 03f8951b0f8..ec75b35073c 100644 --- a/htdocs/core/menus/init_menu_auguria.sql +++ b/htdocs/core/menus/init_menu_auguria.sql @@ -29,6 +29,7 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup"', __HANDLER__, 'left', 101__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/company.php?mainmenu=home&leftmenu=setup', 'MenuCompanySetup', 1, 'admin', '', '', 2, 1, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup"', __HANDLER__, 'left', 102__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/ihm.php?mainmenu=home&leftmenu=setup', 'GUISetup', 1, 'admin', '', '', 2, 4, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup"', __HANDLER__, 'left', 114__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/translation.php?mainmenu=home&leftmenu=setup', 'Translation', 1, 'admin', '', '', 2, 4, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup"', __HANDLER__, 'left', 115__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/defaultvalues.php?mainmenu=home&leftmenu=setup', 'DefaultValues', 1, 'admin', '', '', 2, 4, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup"', __HANDLER__, 'left', 103__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/modules.php?mainmenu=home&leftmenu=setup', 'Modules', 1, 'admin', '', '', 2, 2, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup"', __HANDLER__, 'left', 104__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/boxes.php?mainmenu=home&leftmenu=setup', 'Boxes', 1, 'admin', '', '', 2, 6, __ENTITY__); From 6bd450dcd022b33ad5cf2a75cad42ab50ea8d4d5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 29 Jul 2020 13:10:31 +0200 Subject: [PATCH 57/59] Doc --- dev/dolibarr_changes.txt | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/dev/dolibarr_changes.txt b/dev/dolibarr_changes.txt index 48c6bf342a9..169fa27b5bd 100644 --- a/dev/dolibarr_changes.txt +++ b/dev/dolibarr_changes.txt @@ -8,6 +8,7 @@ ALL: Check "@CHANGE" + PrestaShopWebservice: --------------------- Replace @@ -27,6 +28,19 @@ With +DEBUGBAR: +--------- + +Move + this.options = { + bodyMarginBottom: true, + bodyMarginBottomHeight: parseInt($('body').css('margin-bottom')), + }; +few line lower in the + initialize: function() { + + + ESCPOS: ------- Replace From eaef99b7af5b8a86bb81e17c8387b2069a8aac6e Mon Sep 17 00:00:00 2001 From: Romain DESCHAMPS Date: Fri, 24 Jul 2020 14:11:42 +0200 Subject: [PATCH 58/59] second approval back in stable feature as is the setting for minimum amount --- htdocs/fourn/commande/card.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 71ed66ffc09..ff79524f874 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -2390,7 +2390,7 @@ elseif (!empty($object->id)) { if ($user->rights->fournisseur->commande->approuver) { - if (!empty($conf->global->SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED) && $conf->global->MAIN_FEATURES_LEVEL > 0 && $object->total_ht >= $conf->global->SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED && !empty($object->user_approve_id)) + if (!empty($conf->global->SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED) && $object->total_ht >= $conf->global->SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED && !empty($object->user_approve_id)) { print ''.$langs->trans("ApproveOrder").''; } @@ -2406,7 +2406,7 @@ elseif (!empty($object->id)) } // Second approval (if option SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED is set) - if (!empty($conf->global->SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED) && $conf->global->MAIN_FEATURES_LEVEL > 0 && $object->total_ht >= $conf->global->SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED) + if (!empty($conf->global->SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED) && $object->total_ht >= $conf->global->SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED) { if ($object->statut == CommandeFournisseur::STATUS_VALIDATED) { From 4a291f181fadca23d9843e1043ec15112d5dbf38 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 29 Jul 2020 13:47:04 +0200 Subject: [PATCH 59/59] Fix regression --- htdocs/contact/list.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index bb8f9497969..dbdc9388404 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -365,8 +365,8 @@ else $nbtotalofrecords = ''; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { - $result = $db->query($sql); - $nbtotalofrecords = $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; @@ -376,18 +376,18 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) $sql.= $db->plimit($limit+1, $offset); -$result = $db->query($sql); -if (! $result) +$resql = $db->query($sql); +if (! $resql) { dol_print_error($db); exit; } -$num = $db->num_rows($result); +$num = $db->num_rows($resql); $arrayofselected=is_array($toselect)?$toselect:array(); -if ($num == 1 && ! empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && ($sall != '' || $seearch_cti != '')) +if ($num == 1 && ! empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && ($sall != '' || $search_cti != '')) { $obj = $db->fetch_object($resql); $id = $obj->rowid; @@ -715,7 +715,7 @@ $i = 0; $totalarray=array(); while ($i < min($num,$limit)) { - $obj = $db->fetch_object($result); + $obj = $db->fetch_object($resql); print ''; @@ -914,7 +914,7 @@ while ($i < min($num,$limit)) $i++; } -$db->free($result); +$db->free($resql); $parameters=array('arrayfields'=>$arrayfields, 'sql'=>$sql); $reshook=$hookmanager->executeHooks('printFieldListFooter',$parameters); // Note that $action and $object may have been modified by hook