From 1f00689831467716fffcdb80be16ea748f285be1 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Mon, 10 May 2021 06:46:07 +0200 Subject: [PATCH 01/24] Fix Title supplier order card --- htdocs/fourn/commande/card.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index cc2cdc9fb86..bb0ad661c82 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -1464,8 +1464,9 @@ if (!empty($conf->projet->enabled)) { $formproject = new FormProjets($db); } +$title = $langs->trans('SupplierOrder')." - ".$langs->trans('Card'); $help_url = 'EN:Module_Suppliers_Orders|FR:CommandeFournisseur|ES:Módulo_Pedidos_a_proveedores'; -llxHeader('', $langs->trans("Order"), $help_url); +llxHeader('', $title, $help_url); $now = dol_now(); From 9f0cdb0153a18b18b400ebe18ade70aceb963c45 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Mon, 10 May 2021 06:48:27 +0200 Subject: [PATCH 02/24] Fix Title supplier order contact card --- htdocs/fourn/commande/contact.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/fourn/commande/contact.php b/htdocs/fourn/commande/contact.php index f52aa20d494..d3618c2fe99 100644 --- a/htdocs/fourn/commande/contact.php +++ b/htdocs/fourn/commande/contact.php @@ -98,8 +98,9 @@ if ($action == 'addcontact' && ($user->rights->fournisseur->commande->creer || $ /* * View */ +$title = $langs->trans('SupplierOrder')." - ".$langs->trans('ContactsAddresses'); $help_url = 'EN:Module_Suppliers_Orders|FR:CommandeFournisseur|ES:Módulo_Pedidos_a_proveedores'; -llxHeader('', $langs->trans("Order"), $help_url); +llxHeader('', $title, $help_url); $form = new Form($db); $formcompany = new FormCompany($db); From db50f8c27b8ae37430f6d8fdeb68a8c1f4f162a4 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Mon, 10 May 2021 06:49:49 +0200 Subject: [PATCH 03/24] Fix Title supplier order note card --- htdocs/fourn/commande/note.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/fourn/commande/note.php b/htdocs/fourn/commande/note.php index c4cc134fee7..cc39e589663 100644 --- a/htdocs/fourn/commande/note.php +++ b/htdocs/fourn/commande/note.php @@ -61,8 +61,9 @@ include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, /* * View */ +$title = $langs->trans('SupplierOrder')." - ".$langs->trans('Notes'); $help_url = 'EN:Module_Suppliers_Orders|FR:CommandeFournisseur|ES:Módulo_Pedidos_a_proveedores'; -llxHeader('', $langs->trans("Order"), $help_url); +llxHeader('', $title, $help_url); $form = new Form($db); From eccd883156a977d9637feb517c1f68cc32d2d4d6 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Mon, 10 May 2021 06:54:17 +0200 Subject: [PATCH 04/24] Fix Title supplier order document card --- htdocs/fourn/commande/document.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/fourn/commande/document.php b/htdocs/fourn/commande/document.php index f3dc1d26496..31e59342860 100644 --- a/htdocs/fourn/commande/document.php +++ b/htdocs/fourn/commande/document.php @@ -94,9 +94,11 @@ include DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php'; $form = new Form($db); +$title = $langs->trans('SupplierOrder')." - ".$langs->trans('Documents'); +$help_url = 'EN:Module_Suppliers_Orders|FR:CommandeFournisseur|ES:Módulo_Pedidos_a_proveedores'; +llxHeader('', $title, $help_url); + if ($object->id > 0) { - $help_url = 'EN:Module_Suppliers_Orders|FR:CommandeFournisseur|ES:Módulo_Pedidos_a_proveedores'; - llxHeader('', $langs->trans("Order"), $help_url); $object->fetch_thirdparty(); From 7993e4634ac1da519a2dbc1278cd7a4ba288d8b1 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Mon, 10 May 2021 07:01:24 +0200 Subject: [PATCH 05/24] Fix Title supplier order info card --- htdocs/fourn/commande/info.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/commande/info.php b/htdocs/fourn/commande/info.php index 9260dab0b42..32af16d7dde 100644 --- a/htdocs/fourn/commande/info.php +++ b/htdocs/fourn/commande/info.php @@ -112,7 +112,7 @@ if ($id > 0 || !empty($ref)) { $object->info($object->id); } -$title = $langs->trans("SupplierOrder").' - '.$object->ref.' '.$object->name; +$title = $langs->trans("SupplierOrder").' - '.$langs->trans('Info').' - '.$object->ref.' '.$object->name; if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/projectnameonly/', $conf->global->MAIN_HTML_TITLE) && $object->name) { $title = $object->ref.' '.$object->name.' - '.$langs->trans("Info"); } From dfe0ccee4547615a09b1caa54b0f02a52d673958 Mon Sep 17 00:00:00 2001 From: oscim Date: Mon, 10 May 2021 14:10:54 +0200 Subject: [PATCH 06/24] Update card.php Add hook for block boxstats in fourn card --- htdocs/fourn/card.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/htdocs/fourn/card.php b/htdocs/fourn/card.php index 66de187bfe7..92c3d47b7fd 100644 --- a/htdocs/fourn/card.php +++ b/htdocs/fourn/card.php @@ -481,6 +481,13 @@ if ($object->id > 0) { } } + + $parameters = array(); + $reshook = $hookmanager->executeHooks('addMoreBoxStatsSupplier', $parameters, $object, $action); + if (empty($reshook)) { + $boxstat .= $hookmanager->resPrint; + } + $boxstat .= ''; $boxstat .= ''; $boxstat .= ''; From b9bdd9ed8a49012802d85e425bf8962379346f84 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Mon, 10 May 2021 12:13:50 +0000 Subject: [PATCH 07/24] Fixing style errors. --- htdocs/fourn/card.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/fourn/card.php b/htdocs/fourn/card.php index 92c3d47b7fd..90934062910 100644 --- a/htdocs/fourn/card.php +++ b/htdocs/fourn/card.php @@ -481,13 +481,13 @@ if ($object->id > 0) { } } - + $parameters = array(); $reshook = $hookmanager->executeHooks('addMoreBoxStatsSupplier', $parameters, $object, $action); if (empty($reshook)) { $boxstat .= $hookmanager->resPrint; } - + $boxstat .= ''; $boxstat .= ''; $boxstat .= ''; From ed36db2b0fbae7e0d6c9dc047c28d60947b9f8f2 Mon Sep 17 00:00:00 2001 From: "M.Afzalzadeh Torfeh" Date: Mon, 10 May 2021 17:25:14 +0430 Subject: [PATCH 08/24] fix syntax error on #a2cd181 --- htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php b/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php index 4cb80e0a81e..8d860a3fcda 100644 --- a/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php +++ b/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php @@ -1369,7 +1369,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders $pdf->SetTextColor(0, 0, 0); $pdf->SetFont('', '', $default_font_size - 2); $pdf->SetXY($posx, $posy - 5); - $pdf->MultiCell(80, 5, $outputlangs->transnoentities("BillFrom", 0, 'L'); + $pdf->MultiCell(80, 5, $outputlangs->transnoentities("BillFrom", 0, 'L')); $pdf->SetXY($posx, $posy); $pdf->SetFillColor(230, 230, 230); $pdf->MultiCell(82, $hautcadre, "", 0, 'R', 1); From 20724efd44641698ee42d4691c0397f90579ca3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 11 May 2021 00:04:11 +0200 Subject: [PATCH 09/24] fix $mysoc not defined (php8 warning) --- htdocs/main.inc.php | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 4231160b64f..0c3679adac5 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1960,7 +1960,7 @@ function top_menu($head, $title = '', $target = '', $disablejs = 0, $disablehead */ function top_menu_user($hideloginname = 0, $urllogout = '') { - global $langs, $conf, $db, $hookmanager, $user; + global $langs, $conf, $db, $hookmanager, $user, $mysoc; global $dolibarr_main_authentication, $dolibarr_main_demo; global $menumanager; @@ -1985,13 +1985,27 @@ function top_menu_user($hideloginname = 0, $urllogout = '') $dropdownBody .= ' '.$langs->trans("ShowCompanyInfos").''; $dropdownBody .= '
'; - if (!empty($conf->global->MAIN_INFO_SIREN)) $dropdownBody .= '
'.$langs->transcountry("ProfId1Short", $mysoc->country_code).': '.showValueWithClipboardCPButton($conf->global->MAIN_INFO_SIREN).''; - if (!empty($conf->global->MAIN_INFO_SIRET)) $dropdownBody .= '
'.$langs->transcountry("ProfId2Short", $mysoc->country_code).': '.showValueWithClipboardCPButton($conf->global->MAIN_INFO_SIRET).''; - if (!empty($conf->global->MAIN_INFO_APE)) $dropdownBody .= '
'.$langs->transcountry("ProfId3Short", $mysoc->country_code).': '.showValueWithClipboardCPButton($conf->global->MAIN_INFO_APE).''; - if (!empty($conf->global->MAIN_INFO_RCS)) $dropdownBody .= '
'.$langs->transcountry("ProfId4Short", $mysoc->country_code).': '.showValueWithClipboardCPButton($conf->global->MAIN_INFO_RCS).''; - if (!empty($conf->global->MAIN_INFO_PROFID5)) $dropdownBody .= '
'.$langs->transcountry("ProfId5Short", $mysoc->country_code).': '.showValueWithClipboardCPButton($conf->global->MAIN_INFO_PROFID5).''; - if (!empty($conf->global->MAIN_INFO_PROFID6)) $dropdownBody .= '
'.$langs->transcountry("ProfId6Short", $mysoc->country_code).': '.showValueWithClipboardCPButton($conf->global->MAIN_INFO_PROFID6).''; - if (!empty($conf->global->MAIN_INFO_TVAINTRA)) $dropdownBody .= '
'.$langs->trans("VATIntraShort").': '.showValueWithClipboardCPButton($conf->global->MAIN_INFO_TVAINTRA).''; + if (!empty($conf->global->MAIN_INFO_SIREN)) { + $dropdownBody .= '
'.$langs->transcountry("ProfId1Short", $mysoc->country_code).': '.showValueWithClipboardCPButton($conf->global->MAIN_INFO_SIREN).''; + } + if (!empty($conf->global->MAIN_INFO_SIRET)) { + $dropdownBody .= '
'.$langs->transcountry("ProfId2Short", $mysoc->country_code).': '.showValueWithClipboardCPButton($conf->global->MAIN_INFO_SIRET).''; + } + if (!empty($conf->global->MAIN_INFO_APE)) { + $dropdownBody .= '
'.$langs->transcountry("ProfId3Short", $mysoc->country_code).': '.showValueWithClipboardCPButton($conf->global->MAIN_INFO_APE).''; + } + if (!empty($conf->global->MAIN_INFO_RCS)) { + $dropdownBody .= '
'.$langs->transcountry("ProfId4Short", $mysoc->country_code).': '.showValueWithClipboardCPButton($conf->global->MAIN_INFO_RCS).''; + } + if (!empty($conf->global->MAIN_INFO_PROFID5)) { + $dropdownBody .= '
'.$langs->transcountry("ProfId5Short", $mysoc->country_code).': '.showValueWithClipboardCPButton($conf->global->MAIN_INFO_PROFID5).''; + } + if (!empty($conf->global->MAIN_INFO_PROFID6)) { + $dropdownBody .= '
'.$langs->transcountry("ProfId6Short", $mysoc->country_code).': '.showValueWithClipboardCPButton($conf->global->MAIN_INFO_PROFID6).''; + } + if (!empty($conf->global->MAIN_INFO_TVAINTRA)) { + $dropdownBody .= '
'.$langs->trans("VATIntraShort").': '.showValueWithClipboardCPButton($conf->global->MAIN_INFO_TVAINTRA).''; + } $dropdownBody .= '
'; From 7b764486fdff3d788aadb8f3d482b91d245488c5 Mon Sep 17 00:00:00 2001 From: "M.Afzalzadeh Torfeh" Date: Tue, 11 May 2021 09:59:26 +0430 Subject: [PATCH 10/24] fix integration testing error --- htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php b/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php index 8d860a3fcda..6e89c6f00ad 100644 --- a/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php +++ b/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php @@ -1369,7 +1369,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders $pdf->SetTextColor(0, 0, 0); $pdf->SetFont('', '', $default_font_size - 2); $pdf->SetXY($posx, $posy - 5); - $pdf->MultiCell(80, 5, $outputlangs->transnoentities("BillFrom", 0, 'L')); + $pdf->MultiCell(80, 5, $outputlangs->transnoentities("BillFrom"), 0, 'L'); $pdf->SetXY($posx, $posy); $pdf->SetFillColor(230, 230, 230); $pdf->MultiCell(82, $hautcadre, "", 0, 'R', 1); From c2de343b4e4661a81e3df92942e7a26b59843ac6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 11 May 2021 08:01:13 +0200 Subject: [PATCH 11/24] fix php8 warning --- htdocs/ticket/card.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php index e6f3f21050c..ae79bcb2db2 100644 --- a/htdocs/ticket/card.php +++ b/htdocs/ticket/card.php @@ -2,6 +2,7 @@ /* Copyright (C) 2013-2016 Jean-François FERRY * Copyright (C) 2016 Christophe Battarel * Copyright (C) 2018 Laurent Destailleur + * Copyright (C) 2021 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -751,7 +752,7 @@ if ($action == 'create' || $action == 'presend') { || $action == 'editsubject' || $action == 'edit_extras' || $action == 'update_extras' || $action == 'edit_extrafields' || $action == 'set_extrafields' || $action == 'classify' || $action == 'sel_contract' || $action == 'edit_message_init' || $action == 'set_status' || $action == 'dellink') { if ($res > 0) { // or for unauthorized internals users - if (!$user->socid && ($conf->global->TICKET_LIMIT_VIEW_ASSIGNED_ONLY && $object->fk_user_assign != $user->id) && !$user->rights->ticket->manage) { + if (!$user->socid && (!empty($conf->global->TICKET_LIMIT_VIEW_ASSIGNED_ONLY) && $object->fk_user_assign != $user->id) && !$user->rights->ticket->manage) { accessforbidden('', 0, 1); } @@ -853,7 +854,7 @@ if ($action == 'create' || $action == 'presend') { print dol_get_fiche_end(); } - if (!$user->socid && $conf->global->TICKET_LIMIT_VIEW_ASSIGNED_ONLY) { + if (!$user->socid && !empty($conf->global->TICKET_LIMIT_VIEW_ASSIGNED_ONLY)) { $object->next_prev_filter = "te.fk_user_assign = '".$user->id."'"; } elseif ($user->socid > 0) { $object->next_prev_filter = "te.fk_soc = '".$user->socid."'"; @@ -1030,7 +1031,7 @@ if ($action == 'create' || $action == 'presend') { print ''; // Timing (Duration sum of linked fichinter) - if ($conf->fichinter->enabled) { + if ($conf->ficheinter->enabled) { $object->fetchObjectLinked(); $num = count($object->linkedObjects); $timing = 0; From 9725c8f3090cee35345e11bbc85bc993463dafdf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 11 May 2021 08:05:30 +0200 Subject: [PATCH 12/24] fix php8 warning --- htdocs/core/tpl/extrafields_view.tpl.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/tpl/extrafields_view.tpl.php b/htdocs/core/tpl/extrafields_view.tpl.php index 9c15a71f43c..3b826b2ead5 100644 --- a/htdocs/core/tpl/extrafields_view.tpl.php +++ b/htdocs/core/tpl/extrafields_view.tpl.php @@ -1,6 +1,7 @@ * Copyright (C) 2014 Juanjo Menent + * Copyright (C) 2021 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -59,7 +60,7 @@ if ($reshook < 0) { //var_dump($extrafields->attributes[$object->table_element]); -if (empty($reshook) && is_array($extrafields->attributes[$object->table_element]['label'])) { +if (empty($reshook) && isset($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label'])) { $lastseparatorkeyfound = ''; $extrafields_collapse_num = ''; $extrafields_collapse_num_old = ''; From 3c52636c22b22ceee91d9af4e458eb9e04f5ac2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 11 May 2021 08:09:56 +0200 Subject: [PATCH 13/24] fix php8 warnings --- htdocs/ticket/document.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/ticket/document.php b/htdocs/ticket/document.php index 740061f99ba..5e4d80cd8be 100644 --- a/htdocs/ticket/document.php +++ b/htdocs/ticket/document.php @@ -37,6 +37,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; $langs->loadLangs(array("companies", "other", "ticket", "mails")); $id = GETPOST('id', 'int'); +$socid = GETPOST('socid', 'int'); $ref = GETPOST('ref', 'alpha'); $track_id = GETPOST('track_id', 'alpha'); $action = GETPOST('action', 'alpha'); @@ -104,7 +105,7 @@ if ($object->id) { print dol_get_fiche_end(); } - if (!$user->socid && $conf->global->TICKET_LIMIT_VIEW_ASSIGNED_ONLY) { + if (!$user->socid && !empty($conf->global->TICKET_LIMIT_VIEW_ASSIGNED_ONLY)) { $object->next_prev_filter = "te.fk_user_assign = '".$user->id."'"; } elseif ($user->socid > 0) { $object->next_prev_filter = "te.fk_soc = '".$user->socid."'"; From edad8cdf8f95bf67d99a37508258f3c2153f8206 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 11 May 2021 08:13:40 +0200 Subject: [PATCH 14/24] Update card.php --- htdocs/ticket/card.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php index ae79bcb2db2..4b4b8e594d4 100644 --- a/htdocs/ticket/card.php +++ b/htdocs/ticket/card.php @@ -212,14 +212,14 @@ if (empty($reshook)) { } // Auto assign user - if ($conf->global->TICKET_AUTO_ASSIGN_USER_CREATE) { + if (!empty($conf->global->TICKET_AUTO_ASSIGN_USER_CREATE)) { $result = $object->assignUser($user, $user->id, 1); $object->add_contact($user->id, "SUPPORTTEC", 'internal'); } // Auto assign contrat $contractid = 0; - if ($conf->global->TICKET_AUTO_ASSIGN_CONTRACT_CREATE) { + if (!empty($conf->global->TICKET_AUTO_ASSIGN_CONTRACT_CREATE)) { $contrat = new Contrat($db); $contrat->socid = $object->fk_soc; $list = $contrat->getListOfContracts(); @@ -234,7 +234,7 @@ if (empty($reshook)) { } // Auto create fiche intervention - if ($conf->global->TICKET_AUTO_CREATE_FICHINTER_CREATE) { + if (!empty($conf->global->TICKET_AUTO_CREATE_FICHINTER_CREATE)) { $fichinter = new Fichinter($db); $fichinter->socid = $object->fk_soc; $fichinter->fk_project = $projectid; From da7f5e462608e81e8595637c94b5ca4142178bd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 11 May 2021 08:15:44 +0200 Subject: [PATCH 15/24] fix php8 warning --- htdocs/ticket/messaging.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/ticket/messaging.php b/htdocs/ticket/messaging.php index 527b28c8fac..c3e70def7da 100644 --- a/htdocs/ticket/messaging.php +++ b/htdocs/ticket/messaging.php @@ -91,7 +91,7 @@ if ($user->socid > 0 && ($object->fk_soc != $user->socid)) { accessforbidden(); } // or for unauthorized internals users -if (!$user->socid && ($conf->global->TICKET_LIMIT_VIEW_ASSIGNED_ONLY && $object->fk_user_assign != $user->id) && !$user->rights->ticket->manage) { +if (!$user->socid && (!empty($conf->global->TICKET_LIMIT_VIEW_ASSIGNED_ONLY) && $object->fk_user_assign != $user->id) && !$user->rights->ticket->manage) { accessforbidden(); } @@ -146,7 +146,7 @@ if ($socid > 0) { print dol_get_fiche_end(); } -if (!$user->socid && $conf->global->TICKET_LIMIT_VIEW_ASSIGNED_ONLY) { +if (!$user->socid && !empty($conf->global->TICKET_LIMIT_VIEW_ASSIGNED_ONLY)) { $object->next_prev_filter = "te.fk_user_assign = '".$user->id."'"; } elseif ($user->socid > 0) { $object->next_prev_filter = "te.fk_soc = '".$user->socid."'"; From 0c8b74b54cd4817002697cb15e5475e74bc505d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 11 May 2021 08:20:31 +0200 Subject: [PATCH 16/24] fix php8 warning --- htdocs/ticket/list.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/ticket/list.php b/htdocs/ticket/list.php index 19b352ee936..45a11a9daef 100644 --- a/htdocs/ticket/list.php +++ b/htdocs/ticket/list.php @@ -118,7 +118,7 @@ foreach ($object->fields as $key => $val) { // List of fields to search into when doing a "search in all" $fieldstosearchall = array(); foreach ($object->fields as $key => $val) { - if ($val['searchall']) { + if (!empty($val['searchall'])) { $fieldstosearchall['t.'.$key] = $val['label']; } } @@ -340,7 +340,7 @@ $reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $obje $sql .= $hookmanager->resPrint; $sql = preg_replace('/, $/', '', $sql); $sql .= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t"; -if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { +if (isset($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (t.rowid = ef.fk_object)"; } $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON (t.fk_soc = s.rowid)"; From 7e1ed0791033b0fdc144e5921bdacf1cb5e8dbe2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 11 May 2021 08:26:03 +0200 Subject: [PATCH 17/24] fix php8 warning --- htdocs/core/boxes/box_task.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/boxes/box_task.php b/htdocs/core/boxes/box_task.php index 16cd41ce564..9b7cbfc2fe6 100644 --- a/htdocs/core/boxes/box_task.php +++ b/htdocs/core/boxes/box_task.php @@ -1,6 +1,6 @@ - * Copyright (C) 2015-2020 Frederic France + * Copyright (C) 2015-2021 Frederic France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -150,7 +150,7 @@ class box_task extends ModeleBoxes } $sql = "SELECT pt.rowid, pt.ref, pt.fk_projet, pt.fk_task_parent, pt.datec, pt.dateo, pt.datee, pt.datev, pt.label, pt.description, pt.duration_effective, pt.planned_workload, pt.progress"; - $sql .= ", p.rowid project_id, p.ref project_ref, p.title project_title"; + $sql .= ", p.rowid project_id, p.ref project_ref, p.title project_title, p.fk_statut"; $sql .= " FROM ".MAIN_DB_PREFIX."projet_task as pt"; $sql .= " JOIN ".MAIN_DB_PREFIX."projet as p ON (pt.fk_projet = p.rowid)"; From eccfa4039631daef85f4e78beb0ef28ad13ed52f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 11 May 2021 08:28:35 +0200 Subject: [PATCH 18/24] fix php8 warning remove variables not used --- htdocs/core/boxes/box_last_modified_ticket.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/htdocs/core/boxes/box_last_modified_ticket.php b/htdocs/core/boxes/box_last_modified_ticket.php index 7cc20bd1b89..320a23f745b 100644 --- a/htdocs/core/boxes/box_last_modified_ticket.php +++ b/htdocs/core/boxes/box_last_modified_ticket.php @@ -2,7 +2,7 @@ /* Module descriptor for ticket system * Copyright (C) 2013-2016 Jean-François FERRY * 2016 Christophe Battarel - * Copyright (C) 2019 Frédéric France + * Copyright (C) 2019-2021 Frédéric France * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -113,9 +113,6 @@ class box_last_modified_ticket extends ModeleBoxes while ($i < $num) { $objp = $this->db->fetch_object($resql); $datec = $this->db->jdate($objp->datec); - $dateterm = $this->db->jdate($objp->fin_validite); - $dateclose = $this->db->jdate($objp->date_cloture); - $late = ''; $ticket = new Ticket($this->db); $ticket->id = $objp->id; @@ -162,7 +159,6 @@ class box_last_modified_ticket extends ModeleBoxes ); $r++; - // Date creation $this->info_box_contents[$i][$r] = array( 'td' => 'class="right"', From 73972bcbd06cf5be82e1d41d44209402ba6c8858 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 11 May 2021 10:30:46 +0200 Subject: [PATCH 19/24] More complete log --- htdocs/compta/facture/class/facture.class.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 8827c56e132..549862c53cc 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -4956,7 +4956,11 @@ class Facture extends CommonInvoice $resql = $this->db->query($sql); $stmpidate = dol_print_date($tmpidate, 'day', 'gmt'); - $this->output .= $langs->trans("SearchUnpaidInvoicesWithDueDate", $stmpidate).'
'; + $this->output .= $langs->transnoentitiesnoconv("SearchUnpaidInvoicesWithDueDate", $stmpidate); + if (!empty($paymentmode) && $paymentmode != 'all') { + $this->output .= ' ('.$langs->transnoentitiesnoconv("PaymentMode").' '.$paymentmode.')'; + } + $this->output .= '
'; if ($resql) { while ($obj = $this->db->fetch_object($resql)) { From 64cf65c47fbf4dae88eb028279181a2eff71c87a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 11 May 2021 10:32:12 +0200 Subject: [PATCH 20/24] Doc --- ChangeLog | 1 + 1 file changed, 1 insertion(+) diff --git a/ChangeLog b/ChangeLog index 7a2cf7c2c45..ab0111dc073 100644 --- a/ChangeLog +++ b/ChangeLog @@ -13,6 +13,7 @@ NEW: Add a security center page with all information and advices related to the NEW: Add a performance center page with all information and advices related to the performance of your instance NEW: A lot of fix into english text after a small proofreading campaign (still not perfect, but really better) NEW: All main menu entries are using the picto of the module +NEW: Add an example of scheduled job to send email reminder for unpayed invoices NEW: Accountancy - Add closure menu NEW: Accountancy - Add FEC import NEW: Accountancy - Add a confirmation form with options on export From 200c36836b34c1eea7fd616d64c76f48f3dabea1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 11 May 2021 10:44:53 +0200 Subject: [PATCH 21/24] v14 --- htdocs/commande/class/commande.class.php | 2 +- htdocs/commande/list.php | 39 +++++++++++++----------- 2 files changed, 22 insertions(+), 19 deletions(-) diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index faf10596d8c..c0851dfee1d 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -344,8 +344,8 @@ class Commande extends CommonOrder 'last_main_doc' =>array('type'=>'varchar(255)', 'label'=>'LastMainDoc', 'enabled'=>1, 'visible'=>-1, 'position'=>270), 'module_source' =>array('type'=>'varchar(32)', 'label'=>'POSModule', 'enabled'=>1, 'visible'=>-1, 'position'=>275), 'pos_source' =>array('type'=>'varchar(32)', 'label'=>'POSTerminal', 'enabled'=>1, 'visible'=>-1, 'position'=>280), + 'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>400), 'fk_statut' =>array('type'=>'smallint(6)', 'label'=>'Status', 'enabled'=>1, 'visible'=>-1, 'position'=>500), - 'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>900), ); // END MODULEBUILDER PROPERTIES diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index df1c3e096e2..b8c3ad28039 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -163,21 +163,21 @@ $checkedtypetiers = 0; $arrayfields = array( 'c.ref'=>array('label'=>"Ref", 'checked'=>1, 'position'=>5), 'c.ref_client'=>array('label'=>"RefCustomerOrder", 'checked'=>-1, 'position'=>10), - 'p.ref'=>array('label'=>"ProjectRef", 'checked'=>1, 'enabled'=>(empty($conf->projet->enabled) ? 0 : 1), 'position'=>20), + 'p.ref'=>array('label'=>"ProjectRef", 'checked'=>-1, 'enabled'=>(empty($conf->projet->enabled) ? 0 : 1), 'position'=>20), 'p.title'=>array('label'=>"ProjectLabel", 'checked'=>0, 'enabled'=>(empty($conf->projet->enabled) ? 0 : 1), 'position'=>25), 's.nom'=>array('label'=>"ThirdParty", 'checked'=>1, 'position'=>30), - 's.name_alias'=>array('label'=>"AliasNameShort", 'checked'=>1, 'position'=>31), - 's.town'=>array('label'=>"Town", 'checked'=>1, 'position'=>35), - 's.zip'=>array('label'=>"Zip", 'checked'=>1, 'position'=>40), + 's.name_alias'=>array('label'=>"AliasNameShort", 'checked'=>-1, 'position'=>31), + 's.town'=>array('label'=>"Town", 'checked'=>-1, 'position'=>35), + 's.zip'=>array('label'=>"Zip", 'checked'=>-1, 'position'=>40), 'state.nom'=>array('label'=>"StateShort", 'checked'=>0, 'position'=>45), 'country.code_iso'=>array('label'=>"Country", 'checked'=>0, 'position'=>50), 'typent.code'=>array('label'=>"ThirdPartyType", 'checked'=>$checkedtypetiers, 'position'=>55), 'c.date_commande'=>array('label'=>"OrderDateShort", 'checked'=>1, 'position'=>60), 'c.date_delivery'=>array('label'=>"DateDeliveryPlanned", 'checked'=>1, 'enabled'=>empty($conf->global->ORDER_DISABLE_DELIVERY_DATE), 'position'=>65), - 'c.fk_shipping_method'=>array('label'=>"SendingMethod", 'checked'=>0, 'position'=>66 , 'enabled'=>!empty($conf->expedition->enabled)), - 'c.fk_cond_reglement'=>array('label'=>"PaymentConditionsShort", 'checked'=>0, 'position'=>67), - 'c.fk_mode_reglement'=>array('label'=>"PaymentMode", 'checked'=>0, 'position'=>68), - 'c.fk_input_reason'=>array('label'=>"Channel", 'checked'=>0, 'position'=>69), + 'c.fk_shipping_method'=>array('label'=>"SendingMethod", 'checked'=>-1, 'position'=>66 , 'enabled'=>!empty($conf->expedition->enabled)), + 'c.fk_cond_reglement'=>array('label'=>"PaymentConditionsShort", 'checked'=>-1, 'position'=>67), + 'c.fk_mode_reglement'=>array('label'=>"PaymentMode", 'checked'=>-1, 'position'=>68), + 'c.fk_input_reason'=>array('label'=>"Channel", 'checked'=>-1, 'position'=>69), 'c.total_ht'=>array('label'=>"AmountHT", 'checked'=>1, 'position'=>75), 'c.total_vat'=>array('label'=>"AmountVAT", 'checked'=>0, 'position'=>80), 'c.total_ttc'=>array('label'=>"AmountTTC", 'checked'=>0, 'position'=>85), @@ -186,15 +186,15 @@ $arrayfields = array( 'c.multicurrency_total_ht'=>array('label'=>'MulticurrencyAmountHT', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>100), 'c.multicurrency_total_vat'=>array('label'=>'MulticurrencyAmountVAT', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>105), 'c.multicurrency_total_ttc'=>array('label'=>'MulticurrencyAmountTTC', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>110), - 'u.login'=>array('label'=>"Author", 'checked'=>1, 'position'=>10, 'position'=>115), - 'c.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>500, 'position'=>120), - 'c.tms'=>array('label'=>"DateModificationShort", 'checked'=>0, 'position'=>500, 'position'=>125), - 'c.date_cloture'=>array('label'=>"DateClosing", 'checked'=>0, 'position'=>500, 'position'=>130), - 'c.note_public'=>array('label'=>'NotePublic', 'checked'=>0, 'position'=>510, 'enabled'=>(empty($conf->global->MAIN_LIST_ALLOW_PUBLIC_NOTES)), 'position'=>135), - 'c.note_private'=>array('label'=>'NotePrivate', 'checked'=>0, 'position'=>511, 'enabled'=>(empty($conf->global->MAIN_LIST_ALLOW_PRIVATE_NOTES)), 'position'=>140), - 'c.facture'=>array('label'=>"Billed", 'checked'=>1, 'position'=>990, 'enabled'=>(empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT)), 'position'=>145), - 'shippable'=>array('label'=>"Shippable", 'checked'=>1, 'position'=>995, 'enabled'=>(!empty($conf->expedition->enabled)), 'position'=>150), - 'c.fk_statut'=>array('label'=>"Status", 'checked'=>1, 'position'=>1000, 'position'=>155) + 'u.login'=>array('label'=>"Author", 'checked'=>1, 'position'=>115), + 'c.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>120), + 'c.tms'=>array('label'=>"DateModificationShort", 'checked'=>0, 'position'=>125), + 'c.date_cloture'=>array('label'=>"DateClosing", 'checked'=>0, 'position'=>130), + 'c.note_public'=>array('label'=>'NotePublic', 'checked'=>0, 'enabled'=>(empty($conf->global->MAIN_LIST_ALLOW_PUBLIC_NOTES)), 'position'=>135), + 'c.note_private'=>array('label'=>'NotePrivate', 'checked'=>0, 'enabled'=>(empty($conf->global->MAIN_LIST_ALLOW_PRIVATE_NOTES)), 'position'=>140), + 'shippable'=>array('label'=>"Shippable", 'checked'=>1,'enabled'=>(!empty($conf->expedition->enabled)), 'position'=>990), + 'c.facture'=>array('label'=>"Billed", 'checked'=>1, 'enabled'=>(empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT)), 'position'=>995), + 'c.fk_statut'=>array('label'=>"Status", 'checked'=>1, 'position'=>1000) ); // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php'; @@ -1115,7 +1115,7 @@ if ($resql) { // Channel if (!empty($arrayfields['c.fk_input_reason']['checked'])) { print ''; - $form->selectInputReason($search_fk_input_reason, 'search_fk_input_reason', '', 1); + $form->selectInputReason($search_fk_input_reason, 'search_fk_input_reason', '', 1, '', 1); print ''; } if (!empty($arrayfields['c.total_ht']['checked'])) { @@ -1838,6 +1838,9 @@ if ($resql) { } } print ''; + if (!$i) { + $totalarray['nbfield']++; + } } // Billed From c37ccc10b1bfce92757110b56149c5e3a87378dc Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 11 May 2021 14:50:04 +0200 Subject: [PATCH 22/24] Debug v14 --- ChangeLog | 1 - htdocs/core/actions_setmoduleoptions.inc.php | 1 + htdocs/core/lib/functions.lib.php | 7 +- htdocs/cron/card.php | 4 +- htdocs/datapolicy/admin/setup.php | 80 ++++--- .../datapolicy/class/datapolicycron.class.php | 212 ++++++++---------- htdocs/langs/en_US/admin.lang | 2 +- 7 files changed, 157 insertions(+), 150 deletions(-) diff --git a/ChangeLog b/ChangeLog index ab0111dc073..b81719cafd3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -14,7 +14,6 @@ NEW: Add a performance center page with all information and advices related to t NEW: A lot of fix into english text after a small proofreading campaign (still not perfect, but really better) NEW: All main menu entries are using the picto of the module NEW: Add an example of scheduled job to send email reminder for unpayed invoices -NEW: Accountancy - Add closure menu NEW: Accountancy - Add FEC import NEW: Accountancy - Add a confirmation form with options on export NEW: Accountancy - Add select date from/to in already bind customer and supplier list diff --git a/htdocs/core/actions_setmoduleoptions.inc.php b/htdocs/core/actions_setmoduleoptions.inc.php index 797bb8e4cb7..7bd84e318d6 100644 --- a/htdocs/core/actions_setmoduleoptions.inc.php +++ b/htdocs/core/actions_setmoduleoptions.inc.php @@ -31,6 +31,7 @@ if ($action == 'update' && is_array($arrayofparameters)) { $db->begin(); foreach ($arrayofparameters as $key => $val) { +var_dump($key); // Modify constant only if key was posted (avoid resetting key to the null value) if (GETPOSTISSET($key)) { if (preg_match('/category:/', $val['type'])) { diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 727bfaee5b8..0d4b8b177b9 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3512,7 +3512,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'partnership', 'payment', 'pencil-ruler', 'preview', 'project', 'projectpub', 'projecttask', 'refresh', 'salary', 'shipment', 'supplier_invoice', 'technic', 'ticket', 'error', 'warning', 'reception', 'recruitmentcandidature', 'recruitmentjobposition', 'resource', - 'shapes', 'supplier_proposal', 'supplier_order', 'supplier_invoice', + 'shapes', 'supplier', 'supplier_proposal', 'supplier_order', 'supplier_invoice', 'timespent', 'title_setup', 'title_accountancy', 'title_bank', 'title_hrm', 'title_agenda', 'uncheck', 'user-cog', 'website', 'workstation', 'conferenceorbooth', 'eventorganization' @@ -3556,7 +3556,8 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'reception'=>'dolly', 'recruitmentjobposition'=>'id-card-alt', 'recruitmentcandidature'=>'id-badge', 'resize'=>'crop', 'supplier_order'=>'dol-order_supplier', 'supplier_proposal'=>'file-signature', 'refresh'=>'redo', 'resource'=>'laptop-house', - 'salary'=>'wallet', 'shipment'=>'dolly', 'stock'=>'box-open', 'stats' => 'chart-bar', 'split'=>'code-branch', 'stripe'=>'stripe-s', 'supplier_invoice'=>'file-invoice-dollar', 'technic'=>'cogs', 'ticket'=>'ticket-alt', + 'salary'=>'wallet', 'shipment'=>'dolly', 'stock'=>'box-open', 'stats' => 'chart-bar', 'split'=>'code-branch', 'stripe'=>'stripe-s', + 'supplier'=>'building', 'supplier_invoice'=>'file-invoice-dollar', 'technic'=>'cogs', 'ticket'=>'ticket-alt', 'timespent'=>'clock', 'title_setup'=>'tools', 'title_accountancy'=>'money-check-alt', 'title_bank'=>'university', 'title_hrm'=>'umbrella-beach', 'title_agenda'=>'calendar-alt', 'uncheck'=>'times', 'uparrow'=>'share', 'vcard'=>'address-card', @@ -3634,7 +3635,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'reception'=>'flip', 'recruitmentjobposition'=>'infobox-adherent', 'recruitmentcandidature'=>'infobox-adherent', 'resource'=>'infobox-action', 'salary'=>'infobox-bank_account', 'shipment'=>'infobox-commande', 'supplier_invoice'=>'infobox-order_supplier', 'supplier_invoicea'=>'infobox-order_supplier', 'supplier_invoiced'=>'infobox-order_supplier', - 'supplier_order'=>'infobox-order_supplier', 'supplier_proposal'=>'infobox-supplier_proposal', + 'supplier'=>'infobox-order_supplier', 'supplier_order'=>'infobox-order_supplier', 'supplier_proposal'=>'infobox-supplier_proposal', 'ticket'=>'infobox-contrat', 'title_accountancy'=>'infobox-bank_account', 'title_hrm'=>'infobox-holiday', 'expensereport'=>'infobox-expensereport', 'trip'=>'infobox-expensereport', 'title_agenda'=>'infobox-action', //'title_setup'=>'infobox-action', 'tools'=>'infobox-action', 'list-alt'=>'imgforviewmode', 'calendar'=>'imgforviewmode', 'calendarweek'=>'imgforviewmode', 'calendarmonth'=>'imgforviewmode', 'calendarday'=>'imgforviewmode', 'calendarperuser'=>'imgforviewmode' diff --git a/htdocs/cron/card.php b/htdocs/cron/card.php index 1683fadf16a..fb8699b911e 100644 --- a/htdocs/cron/card.php +++ b/htdocs/cron/card.php @@ -352,7 +352,7 @@ if (($action == "create") || ($action == "edit")) { print ''; print $langs->trans('CronModule').""; - print "module_name."\" /> "; + print "module_name."\" /> "; print ""; print ""; print $form->textwithpicto('', $langs->trans("CronModuleHelp"), 1, 'help'); @@ -370,7 +370,7 @@ if (($action == "create") || ($action == "edit")) { print ''; print $langs->trans('CronObject').""; - print "objectname."\" /> "; + print "objectname."\" /> "; print ""; print ""; print $form->textwithpicto('', $langs->trans("CronObjectHelp"), 1, 'help'); diff --git a/htdocs/datapolicy/admin/setup.php b/htdocs/datapolicy/admin/setup.php index a334b36929e..dde8644571e 100644 --- a/htdocs/datapolicy/admin/setup.php +++ b/htdocs/datapolicy/admin/setup.php @@ -27,15 +27,7 @@ require_once DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php"; require_once '../lib/datapolicy.lib.php'; // Translations -$langs->load('admin'); -$langs->load('companies'); -$langs->load('members'); -$langs->load('datapolicy@datapolicy'); - -// Access control -if (!$user->admin) { - accessforbidden(); -} +$langs->loadLangs(array('admin', 'companies', 'members', 'datapolicy@datapolicy')); // Parameters $action = GETPOST('action', 'aZ09'); @@ -43,35 +35,27 @@ $backtopage = GETPOST('backtopage', 'alpha'); $arrayofparameters = array(); $arrayofparameters['ThirdParty'] = array( - 'DATAPOLICY_TIERS_CLIENT'=>array('css'=>'minwidth200'), - 'DATAPOLICY_TIERS_PROSPECT'=>array('css'=>'minwidth200'), - 'DATAPOLICY_TIERS_PROSPECT_CLIENT'=>array('css'=>'minwidth200'), - 'DATAPOLICY_TIERS_NIPROSPECT_NICLIENT'=>array('css'=>'minwidth200'), - 'DATAPOLICY_TIERS_FOURNISSEUR'=>array('css'=>'minwidth200'), + 'DATAPOLICY_TIERS_CLIENT'=>array('css'=>'minwidth200', 'picto'=>img_picto('', 'company', 'class="pictofixedwidth"')), + 'DATAPOLICY_TIERS_PROSPECT'=>array('css'=>'minwidth200', 'picto'=>img_picto('', 'company', 'class="pictofixedwidth"')), + 'DATAPOLICY_TIERS_PROSPECT_CLIENT'=>array('css'=>'minwidth200', 'picto'=>img_picto('', 'company', 'class="pictofixedwidth"')), + 'DATAPOLICY_TIERS_NIPROSPECT_NICLIENT'=>array('css'=>'minwidth200', 'picto'=>img_picto('', 'company', 'class="pictofixedwidth"')), + 'DATAPOLICY_TIERS_FOURNISSEUR'=>array('css'=>'minwidth200', 'picto'=>img_picto('', 'supplier', 'class="pictofixedwidth"')), ); if (!empty($conf->global->DATAPOLICY_USE_SPECIFIC_DELAY_FOR_CONTACT)) { $arrayofparameters['Contact'] = array( - 'DATAPOLICY_CONTACT_CLIENT'=>array('css'=>'minwidth200'), - 'DATAPOLICY_CONTACT_PROSPECT'=>array('css'=>'minwidth200'), - 'DATAPOLICY_CONTACT_PROSPECT_CLIENT'=>array('css'=>'minwidth200'), - 'DATAPOLICY_CONTACT_NIPROSPECT_NICLIENT'=>array('css'=>'minwidth200'), - 'DATAPOLICY_CONTACT_FOURNISSEUR'=>array('css'=>'minwidth200'), + 'DATAPOLICY_CONTACT_CLIENT'=>array('css'=>'minwidth200', 'picto'=>img_picto('', 'contact', 'class="pictofixedwidth"')), + 'DATAPOLICY_CONTACT_PROSPECT'=>array('css'=>'minwidth200', 'picto'=>img_picto('', 'contact', 'class="pictofixedwidth"')), + 'DATAPOLICY_CONTACT_PROSPECT_CLIENT'=>array('css'=>'minwidth200', 'picto'=>img_picto('', 'contact', 'class="pictofixedwidth"')), + 'DATAPOLICY_CONTACT_NIPROSPECT_NICLIENT'=>array('css'=>'minwidth200', 'picto'=>img_picto('', 'contact', 'class="pictofixedwidth"')), + 'DATAPOLICY_CONTACT_FOURNISSEUR'=>array('css'=>'minwidth200', 'picto'=>img_picto('', 'contact', 'class="pictofixedwidth"')), ); } if (!empty($conf->adherent->enabled)) { $arrayofparameters['Member'] = array( - 'DATAPOLICY_ADHERENT'=>array('css'=>'minwidth200'), + 'DATAPOLICY_ADHERENT'=>array('css'=>'minwidth200', 'picto'=>img_picto('', 'member', 'class="pictofixedwidth"')), ); } - - -/* - * Actions - */ - -include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php'; - $valTab = array( '' => $langs->trans('Never'), '6' => $langs->trans('NB_MONTHS', 6), @@ -85,6 +69,40 @@ $valTab = array( '240' => $langs->trans('NB_YEARS', 20), ); +// Access control +if (!$user->admin) { + accessforbidden(); +} + + +/* + * Actions + */ + +foreach ($arrayofparameters as $title => $tab) { + foreach ($tab as $key => $val) { + // Modify constant only if key was posted (avoid resetting key to the null value) + if (GETPOSTISSET($key)) { + if (preg_match('/category:/', $val['type'])) { + if (GETPOST($key, 'int') == '-1') { + $val_const = ''; + } else { + $val_const = GETPOST($key, 'int'); + } + } else { + $val_const = GETPOST($key, 'alpha'); + } + + $result = dolibarr_set_const($db, $key, $val_const, 'chaine', 0, '', $conf->entity); + if ($result < 0) { + $error++; + break; + } + } + } +} + + /* * View @@ -96,11 +114,11 @@ llxHeader('', $langs->trans($page_name)); // Subheader $linkback = ''.$langs->trans("BackToModuleList").''; -print load_fiche_titre($langs->trans($page_name), $linkback, 'object_generic'); +print load_fiche_titre($langs->trans($page_name), $linkback, 'generic'); // Configuration header $head = datapolicyAdminPrepareHead(); -print dol_get_fiche_head($head, 'settings', '', -1, "datapolicy@datapolicy"); +print dol_get_fiche_head($head, 'settings', '', -1, ''); // Setup page goes here echo ''.$langs->trans("datapolicySetupPage").'

'; @@ -118,6 +136,7 @@ if ($action == 'edit') { print ''.$langs->trans($title).''; foreach ($tab as $key => $val) { print ''; + print $val['picto']; print $form->textwithpicto($langs->trans($key), $langs->trans($key.'Tooltip')); print ''; print '