From 22522f5aa2e127b945182065c8a9a969e764973d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 25 Jan 2021 17:06:25 +0100 Subject: [PATCH 01/37] fix include --- htdocs/core/boxes/box_clients.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/boxes/box_clients.php b/htdocs/core/boxes/box_clients.php index 11e8b6a8f29..adcff0d158c 100644 --- a/htdocs/core/boxes/box_clients.php +++ b/htdocs/core/boxes/box_clients.php @@ -2,7 +2,7 @@ /* Copyright (C) 2003-2007 Rodolphe Quiedeville * Copyright (C) 2004-2010 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin - * Copyright (C) 2015 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 @@ -79,7 +79,7 @@ class box_clients extends ModeleBoxes $this->max = $max; - include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; + include_once DOL_DOCUMENT_ROOT.'/societe/class/client.class.php'; $thirdpartystatic = new Client($this->db); $this->info_box_head = array('text' => $langs->trans("BoxTitleLastModifiedCustomers", $max)); From 7670a4f76ce4949a8bd9141eb23ca89076662e3c Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Tue, 26 Jan 2021 04:46:09 +0100 Subject: [PATCH 02/37] Missing file language & uniformize --- htdocs/accountancy/customer/lines.php | 4 ++-- htdocs/accountancy/customer/list.php | 2 +- htdocs/accountancy/supplier/lines.php | 8 ++++---- htdocs/accountancy/supplier/list.php | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/accountancy/customer/lines.php b/htdocs/accountancy/customer/lines.php index af636c5609d..a5c603c2504 100644 --- a/htdocs/accountancy/customer/lines.php +++ b/htdocs/accountancy/customer/lines.php @@ -37,7 +37,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; // Load translation files required by the page -$langs->loadLangs(array("bills", "compta", "accountancy", "productbatch")); +$langs->loadLangs(array("bills", "compta", "accountancy", "productbatch", "products")); $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') @@ -339,7 +339,7 @@ if ($result) { print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "f.datef, f.ref, fd.rowid", "", $param, '', $sortfield, $sortorder, 'center '); print_liste_field_titre("ProductRef", $_SERVER["PHP_SELF"], "p.ref", "", $param, '', $sortfield, $sortorder); //print_liste_field_titre("ProductLabel", $_SERVER["PHP_SELF"], "p.label", "", $param, '', $sortfield, $sortorder); - print_liste_field_titre("Description", $_SERVER["PHP_SELF"], "fd.description", "", $param, '', $sortfield, $sortorder); + print_liste_field_titre("ProductDescription", $_SERVER["PHP_SELF"], "fd.description", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "fd.total_ht", "", $param, '', $sortfield, $sortorder, 'right '); print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "fd.tva_tx", "", $param, '', $sortfield, $sortorder, 'right '); print_liste_field_titre("ThirdParty", $_SERVER["PHP_SELF"], "s.nom", "", $param, '', $sortfield, $sortorder); diff --git a/htdocs/accountancy/customer/list.php b/htdocs/accountancy/customer/list.php index a45bccbf4e1..80396319a1a 100644 --- a/htdocs/accountancy/customer/list.php +++ b/htdocs/accountancy/customer/list.php @@ -38,7 +38,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; // Load translation files required by the page -$langs->loadLangs(array("bills", "companies", "compta", "accountancy", "other", "productbatch")); +$langs->loadLangs(array("bills", "companies", "compta", "accountancy", "other", "productbatch", "products")); $action = GETPOST('action', 'aZ09'); $massaction = GETPOST('massaction', 'alpha'); diff --git a/htdocs/accountancy/supplier/lines.php b/htdocs/accountancy/supplier/lines.php index 4bb163b6653..70d6d89216f 100644 --- a/htdocs/accountancy/supplier/lines.php +++ b/htdocs/accountancy/supplier/lines.php @@ -38,7 +38,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; // Load translation files required by the page -$langs->loadLangs(array("compta", "bills", "other", "accountancy", "productbatch")); +$langs->loadLangs(array("compta", "bills", "other", "accountancy", "productbatch", "products")); $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') @@ -334,16 +334,16 @@ if ($result) { print ''; print_liste_field_titre("LineId", $_SERVER["PHP_SELF"], "l.rowid", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("Invoice", $_SERVER["PHP_SELF"], "f.ref", "", $param, '', $sortfield, $sortorder); - print_liste_field_titre("InvoiceLabel", $_SERVER["PHP_SELF"], "f.libelle", "", $param, '', $sortfield, $sortorder); + //print_liste_field_titre("InvoiceLabel", $_SERVER["PHP_SELF"], "f.libelle", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "f.datef, f.ref, l.rowid", "", $param, '', $sortfield, $sortorder, 'center '); print_liste_field_titre("ProductRef", $_SERVER["PHP_SELF"], "p.ref", "", $param, '', $sortfield, $sortorder); //print_liste_field_titre("ProductLabel", $_SERVER["PHP_SELF"], "p.label", "", $param, '', $sortfield, $sortorder); - print_liste_field_titre("Description", $_SERVER["PHP_SELF"], "l.description", "", $param, '', $sortfield, $sortorder); + print_liste_field_titre("ProductDescription", $_SERVER["PHP_SELF"], "l.description", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "l.total_ht", "", $param, '', $sortfield, $sortorder, 'right '); print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "l.tva_tx", "", $param, '', $sortfield, $sortorder, 'right '); print_liste_field_titre("ThirdParty", $_SERVER["PHP_SELF"], "s.nom", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("Country", $_SERVER["PHP_SELF"], "co.label", "", $param, '', $sortfield, $sortorder); - print_liste_field_titre("VATIntra", $_SERVER["PHP_SELF"], "s.tva_intra", "", $param, '', $sortfield, $sortorder); + print_liste_field_titre("VATIntraShort", $_SERVER["PHP_SELF"], "s.tva_intra", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("AccountAccounting", $_SERVER["PHP_SELF"], "aa.account_number", "", $param, '', $sortfield, $sortorder); $checkpicto = $form->showCheckAddButtons(); print_liste_field_titre($checkpicto, '', '', '', '', '', '', '', 'center '); diff --git a/htdocs/accountancy/supplier/list.php b/htdocs/accountancy/supplier/list.php index b4b54389453..2de31383375 100644 --- a/htdocs/accountancy/supplier/list.php +++ b/htdocs/accountancy/supplier/list.php @@ -39,7 +39,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; // Load translation files required by the page -$langs->loadLangs(array("bills", "companies", "compta", "accountancy", "other", "productbatch")); +$langs->loadLangs(array("bills", "companies", "compta", "accountancy", "other", "productbatch", "products")); $action = GETPOST('action', 'aZ09'); $massaction = GETPOST('massaction', 'alpha'); From 94d4f2da8e34cde669388deef93ad977ac92986e Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Tue, 26 Jan 2021 05:14:01 +0100 Subject: [PATCH 03/37] Missing language key & error translation --- htdocs/core/modules/modCommande.class.php | 4 ++-- htdocs/langs/en_US/admin.lang | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/htdocs/core/modules/modCommande.class.php b/htdocs/core/modules/modCommande.class.php index ac4d26725bc..f257c6e3132 100644 --- a/htdocs/core/modules/modCommande.class.php +++ b/htdocs/core/modules/modCommande.class.php @@ -271,7 +271,7 @@ class modCommande extends DolibarrModules $r++; $this->import_code[$r] = 'commande_'.$r; - $this->import_label[$r] = 'Sales Orders'; + $this->import_label[$r] = 'CustomersOrders'; $this->import_icon[$r] = $this->picto; $this->import_entities_array[$r] = []; $this->import_tables_array[$r] = ['c' => MAIN_DB_PREFIX.'commande', 'extra' => MAIN_DB_PREFIX.'commande_extrafields']; @@ -357,7 +357,7 @@ class modCommande extends DolibarrModules //Import CPV Lines $r++; $this->import_code[$r] = 'commande_lines_'.$r; - $this->import_label[$r] = 'Order Details'; + $this->import_label[$r] = 'OrderLine'; $this->import_icon[$r] = $this->picto; $this->import_entities_array[$r] = []; $this->import_tables_array[$r] = ['cd' => MAIN_DB_PREFIX.'commandedet', 'extra' => MAIN_DB_PREFIX.'commandedet_extrafields']; diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 48a44577528..bba6966fa45 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -541,6 +541,8 @@ Module40Name=Vendors Module40Desc=Vendors and purchase management (purchase orders and billing of supplier invoices) Module42Name=Debug Logs Module42Desc=Logging facilities (file, syslog, ...). Such logs are for technical/debug purposes. +Module43Name=Debug Bar +Module43Desc=A tool for developper adding a debug bar in your browser. Module49Name=Editors Module49Desc=Editor management Module50Name=Products @@ -639,6 +641,8 @@ Module2900Name=GeoIPMaxmind Module2900Desc=GeoIP Maxmind conversions capabilities Module3200Name=Unalterable Archives Module3200Desc=Enable an unalterable log of business events. Events are archived in real-time. The log is a read-only table of chained events that can be exported. This module may be mandatory for some countries. +Module3400Name=Social Networks +Module3400Desc=Enable Social Networks fields into third parties and addresses (skype, twitter, facebook, ...). Module4000Name=HRM Module4000Desc=Human resources management (management of department, employee contracts and feelings) Module5000Name=Multi-company @@ -2090,4 +2094,4 @@ CombinationsSeparator=Separator character for product combinations SeeLinkToOnlineDocumentation=See link to online documention on top menu for examples SHOW_SUBPRODUCT_REF_IN_PDF=If the feature "%s" of module %s is used, show details of subproducts of a kit on PDF. AskThisIDToYourBank=Contact your bank to get this ID -AdvancedModeOnly=Permision available in Advanced permission mode only \ No newline at end of file +AdvancedModeOnly=Permision available in Advanced permission mode only From 0ef02880ebaa91caec77dc2ee0a40a706c3b536f Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Tue, 26 Jan 2021 08:54:21 +0100 Subject: [PATCH 04/37] Fix: Fa-icon on movement --- htdocs/core/lib/functions.lib.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 142d91565d6..eaffe04e24d 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3279,7 +3279,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'object_recruitmentjobposition', 'object_recruitmentcandidature', 'object_shipment', 'object_share-alt', 'object_supplier_invoice', 'object_supplier_invoicea', 'object_supplier_invoiced', 'object_supplier_order', 'object_supplier_proposal', 'object_service', 'object_stock', 'object_technic', 'object_ticket', 'object_trip', 'object_user', 'object_group', 'object_member', - 'object_phoning', 'object_phoning_mobile', 'object_phoning_fax', 'object_email', 'object_website', + 'object_phoning', 'object_phoning_mobile', 'object_phoning_fax', 'object_email', 'object_website', 'object_movement', 'off', 'on', 'order', 'paiment', 'play', 'pdf', 'playdisabled', 'previous', 'poll', 'printer', 'product', 'propal', 'projecttask', 'stock', 'resize', 'service', 'stats', 'trip', 'setup', 'share-alt', 'sign-out', 'split', 'stripe-s', 'switch_off', 'switch_on', 'tools', 'unlink', 'uparrow', 'user', 'vcard', 'wrench', @@ -3316,7 +3316,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'edit'=>'pencil-alt', 'grip_title'=>'arrows-alt', 'grip'=>'arrows-alt', 'help'=>'question-circle', 'generic'=>'file', 'holiday'=>'umbrella-beach', 'label'=>'layer-group', 'member'=>'users', 'mrp'=>'cubes', 'next'=>'arrow-alt-circle-right', - 'trip'=>'wallet', 'group'=>'users', + 'trip'=>'wallet', 'group'=>'users', 'movement'=>'people-carry', 'sign-out'=>'sign-out-alt', 'switch_off'=>'toggle-off', 'switch_on'=>'toggle-on', 'check'=>'check', 'bookmark'=>'star', 'bookmark'=>'star', 'bank'=>'university', 'close_title'=>'times', 'delete'=>'trash', 'edit'=>'pencil-alt', 'filter'=>'filter', @@ -3405,7 +3405,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'companies'=>'#6c6aa8', 'company'=>'#6c6aa8', 'contact'=>'#6c6aa8', 'dynamicprice'=>'#a69944', 'edit'=>'#444', 'note'=>'#999', 'error'=>'', 'help'=>'#bbb', 'listlight'=>'#999', 'dolly'=>'#a69944', 'dollyrevert'=>'#a69944', 'lot'=>'#a69944', - 'map-marker-alt'=>'#aaa', 'mrp'=>'#a69944', 'product'=>'#a69944', 'service'=>'#a69944', 'stock'=>'#a69944', + 'map-marker-alt'=>'#aaa', 'mrp'=>'#a69944', 'product'=>'#a69944', 'service'=>'#a69944', 'stock'=>'#a69944', 'movement'=>'#a69944', 'other'=>'#ddd', 'playdisabled'=>'#ccc', 'printer'=>'#444', 'projectpub'=>'#986c6a', 'resize'=>'#444', 'rss'=>'#cba', 'shipment'=>'#a69944', 'stats'=>'#444', 'switch_off'=>'#999', 'uparrow'=>'#555', 'globe-americas'=>'#aaa', From 8db80ff44dadfb76b55771e7a244a3d7a6445fcb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 26 Jan 2021 11:19:13 +0100 Subject: [PATCH 05/37] Fix reponsive --- htdocs/admin/mails.php | 8 +++++++- htdocs/core/lib/admin.lib.php | 10 +++++----- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php index 5e32a637c8f..88ae8964c1b 100644 --- a/htdocs/admin/mails.php +++ b/htdocs/admin/mails.php @@ -532,6 +532,7 @@ if ($action == 'edit') print ''.$langs->trans("EMailsDesc")."
\n"; print "
\n"; + print '
'; // You can use div-table-responsive-no-min if you dont need reserved height for your table print ''; print ''; @@ -552,10 +553,12 @@ if ($action == 'edit') } print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; + print '
'; if (empty($conf->global->MAIN_DISABLE_ALL_MAILS)) { print '
'; + print '
'; // You can use div-table-responsive-no-min if you dont need reserved height for your table print ''; print ''; @@ -663,6 +666,7 @@ if ($action == 'edit') } print '
'.$langs->trans("MAIN_MAIL_SENDMODE").'
'; + print '
'; if ($conf->global->MAIN_MAIL_SENDMODE == 'mail' && empty($conf->global->MAIN_HIDE_WARNING_TO_ENCOURAGE_SMTP_SETUP)) { print info_admin($langs->trans("WarningPHPMail").'
'.$langs->trans("WarningPHPMailA").'
'.$langs->trans("WarningPHPMailB").'
'.$langs->trans("WarningPHPMailC").'

'.$langs->trans("WarningPHPMailD"), 0, 0, 'warning'); @@ -670,11 +674,12 @@ if ($action == 'edit') print '
'; + print '
'; // You can use div-table-responsive-no-min if you dont need reserved height for your table print ''; print ''; // From - print ''; + print ''; print ''; @@ -746,6 +751,7 @@ if ($action == 'edit') print ''; print '
'.$langs->trans("OtherOptions").'
'.$langs->trans("MAIN_MAIL_EMAIL_FROM", ini_get('sendmail_from') ?ini_get('sendmail_from') : $langs->transnoentities("Undefined")).'
'.$langs->trans("MAIN_MAIL_EMAIL_FROM", ini_get('sendmail_from') ?ini_get('sendmail_from') : $langs->transnoentities("Undefined")).''.$conf->global->MAIN_MAIL_EMAIL_FROM; if (!empty($conf->global->MAIN_MAIL_EMAIL_FROM) && !isValidEmail($conf->global->MAIN_MAIL_EMAIL_FROM)) print img_warning($langs->trans("ErrorBadEMail")); print '
'.$langs->trans("MAIN_MAIL_ENABLED_USER_DEST_SELECT").''.yn($conf->global->MAIN_MAIL_ENABLED_USER_DEST_SELECT).'
'; + print '
'; } print dol_get_fiche_end(); diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index f3faeda4b3a..ce9ffb31697 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -1870,11 +1870,6 @@ function email_admin_prepare_head() } } - $head[$h][0] = DOL_URL_ROOT."/admin/mails_templates.php"; - $head[$h][1] = $langs->trans("EMailTemplates"); - $head[$h][2] = 'templates'; - $h++; - if (!empty($user->admin) && (empty($_SESSION['leftmenu']) || $_SESSION['leftmenu'] != 'email_templates')) { $head[$h][0] = DOL_URL_ROOT."/admin/mails_senderprofile_list.php"; $head[$h][1] = $langs->trans("EmailSenderProfiles"); @@ -1882,6 +1877,11 @@ function email_admin_prepare_head() $h++; } + $head[$h][0] = DOL_URL_ROOT."/admin/mails_templates.php"; + $head[$h][1] = $langs->trans("EMailTemplates"); + $head[$h][2] = 'templates'; + $h++; + complete_head_from_modules($conf, $langs, null, $head, $h, 'email_admin', 'remove'); return $head; From 977e4dde865f3ccf1ab8618af8bc7fbdd1c71ec1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 26 Jan 2021 12:08:54 +0100 Subject: [PATCH 06/37] Fix regression --- htdocs/core/lib/functions.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 142d91565d6..d2e919e49fe 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -5786,7 +5786,7 @@ function dol_string_nohtmltag($stringtoclean, $removelinefeed = 1, $pagecodeto = $temp = preg_replace($pattern, "", $temp); // pass 1 - $temp after pass 1: 0000-021 $temp = preg_replace($pattern, "", $temp); // pass 2 - $temp after pass 2: 0000-021 // removed '<' into non closing html tags like ' Date: Tue, 26 Jan 2021 12:42:04 +0100 Subject: [PATCH 07/37] FIX 11.0: when a new intervention is created from an object, a new $extrafields object is instantiated but not initialized Because of this, missing mandatory extrafields are not checked and no extrafields are inserted --- htdocs/fichinter/card.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index ed6d7996eff..754ef061247 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -258,7 +258,13 @@ if (empty($reshook)) } // Extrafields - $extrafields = new ExtraFields($db); + + // Fill array 'array_options' with data from add form + $ret = $extrafields->setOptionalsFromPost(null, $object); + if ($ret < 0) { + $error++; + $action = 'create'; + } $array_options = $extrafields->getOptionalsFromPost($object->table_element); $object->array_options = $array_options; From 02098bf37b8ba9b2a90f535d86f85b662ffabb28 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 26 Jan 2021 12:43:23 +0100 Subject: [PATCH 08/37] Fix default --- htdocs/website/class/websitepage.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/website/class/websitepage.class.php b/htdocs/website/class/websitepage.class.php index 30961013806..d0f11a6c9cf 100644 --- a/htdocs/website/class/websitepage.class.php +++ b/htdocs/website/class/websitepage.class.php @@ -161,7 +161,7 @@ class WebsitePage extends CommonObject //'status' =>array('type'=>'integer', 'label'=>'Status', 'enabled'=>1, 'visible'=>1, 'index'=>true, 'position'=>1000), 'fk_website' =>array('type'=>'integer', 'label'=>'WebsiteId', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'position'=>40, 'searchall'=>0, 'foreignkey'=>'websitepage.rowid'), 'fk_page' =>array('type'=>'integer', 'label'=>'ParentPageId', 'enabled'=>1, 'visible'=>1, 'notnull'=>-1, 'position'=>45, 'searchall'=>0, 'foreignkey'=>'website.rowid'), - 'allowed_in_frames' =>array('type'=>'integer', 'label'=>'AllowedInFrames', 'enabled'=>1, 'visible'=>-1, 'position'=>48, 'searchall'=>0), + 'allowed_in_frames' =>array('type'=>'integer', 'label'=>'AllowedInFrames', 'enabled'=>1, 'visible'=>-1, 'position'=>48, 'searchall'=>0, 'default'=>0), 'htmlheader' =>array('type'=>'text', 'label'=>'HtmlHeader', 'enabled'=>1, 'visible'=>0, 'position'=>50, 'searchall'=>0), 'content' =>array('type'=>'mediumtext', 'label'=>'Content', 'enabled'=>1, 'visible'=>0, 'position'=>51, 'searchall'=>0), 'grabbed_from' =>array('type'=>'varchar(255)', 'label'=>'GrabbedFrom', 'enabled'=>1, 'visible'=>1, 'index'=>1, 'position'=>400, 'comment'=>'URL page content was grabbed from'), From a1147319d2e22450b0811c1f289d634044a83358 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 26 Jan 2021 13:11:10 +0100 Subject: [PATCH 09/37] Fix countAll --- htdocs/website/class/websitepage.class.php | 23 +++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/htdocs/website/class/websitepage.class.php b/htdocs/website/class/websitepage.class.php index d0f11a6c9cf..bacc4664791 100644 --- a/htdocs/website/class/websitepage.class.php +++ b/htdocs/website/class/websitepage.class.php @@ -400,7 +400,7 @@ class WebsitePage extends CommonObject $sql .= " t.fk_object"; $sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.' as t'; $sql .= ' WHERE t.fk_website = '.$websiteid; - // Manage filter + // Manage filter (same than into countAll) $sqlwhere = array(); if (count($filter) > 0) { foreach ($filter as $key => $value) { @@ -501,14 +501,27 @@ class WebsitePage extends CommonObject $sql = 'SELECT COUNT(t.rowid) as nb'; $sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.' as t'; $sql .= ' WHERE t.fk_website = '.$websiteid; - // Manage filter + // Manage filter (same than into fetchAll) $sqlwhere = array(); if (count($filter) > 0) { foreach ($filter as $key => $value) { - if ($key == 't.rowid' || $key == 't.fk_website') { - $sqlwhere[] = $key.'='.$value; + if ($key == 't.rowid' || $key == 't.fk_website' || $key == 'status') { + $sqlwhere[] = $key.' = '.$value; + } elseif ($key == 'type_container') { + $sqlwhere[] = $key." = '".$this->db->escape($value)."'"; } elseif ($key == 'lang' || $key == 't.lang') { - $sqlwhere[] = $key." = '".$this->db->escape(substr($value, 0, 2))."'"; + $listoflang = array(); + $foundnull = 0; + foreach (explode(',', $value) as $tmpvalue) { + if ($tmpvalue == 'null') { + $foundnull++; + continue; + } + $listoflang[] = "'".$this->db->escape(substr(str_replace("'", '', $tmpvalue), 0, 2))."'"; + } + $stringtouse = $key." IN (".join(',', $listoflang).")"; + if ($foundnull) $stringtouse = '('.$stringtouse.' OR '.$key.' IS NULL)'; + $sqlwhere[] = $stringtouse; } else { $sqlwhere[] = $key.' LIKE \'%'.$this->db->escape($value).'%\''; } From 26c22e1b28ea109f6c07c1af2d66bb2d98f28a5d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 26 Jan 2021 13:22:20 +0100 Subject: [PATCH 10/37] Fix warning --- htdocs/admin/mails.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php index 88ae8964c1b..08e7c2b5446 100644 --- a/htdocs/admin/mails.php +++ b/htdocs/admin/mails.php @@ -679,9 +679,10 @@ if ($action == 'edit') print ''.$langs->trans("OtherOptions").''; // From - print ''.$langs->trans("MAIN_MAIL_EMAIL_FROM", ini_get('sendmail_from') ?ini_get('sendmail_from') : $langs->transnoentities("Undefined")).''; + print ''.$langs->trans("MAIN_MAIL_EMAIL_FROM", ini_get('sendmail_from') ?ini_get('sendmail_from') : $langs->transnoentities("Undefined")).''; print ''.$conf->global->MAIN_MAIL_EMAIL_FROM; - if (!empty($conf->global->MAIN_MAIL_EMAIL_FROM) && !isValidEmail($conf->global->MAIN_MAIL_EMAIL_FROM)) print img_warning($langs->trans("ErrorBadEMail")); + if (empty($conf->global->MAIN_MAIL_EMAIL_FROM)) print img_warning($langs->trans("Mandatory")); + elseif (!isValidEmail($conf->global->MAIN_MAIL_EMAIL_FROM)) print img_warning($langs->trans("ErrorBadEMail")); print ''; // Default from type From aa2d581b41321fe12b96e406d210e463e25bdf4c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 26 Jan 2021 13:38:41 +0100 Subject: [PATCH 11/37] Fix rename of alias --- htdocs/core/lib/website2.lib.php | 16 ++++++++-------- htdocs/website/index.php | 11 +++++++++++ 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/htdocs/core/lib/website2.lib.php b/htdocs/core/lib/website2.lib.php index 004ac154aee..380a7c0dc12 100644 --- a/htdocs/core/lib/website2.lib.php +++ b/htdocs/core/lib/website2.lib.php @@ -86,7 +86,7 @@ function dolSavePageAlias($filealias, $object, $objectpage) if ($objectpage->lang && in_array($objectpage->lang, explode(',', $object->otherlang))) { $dirname = dirname($filealias); $filename = basename($filealias); - $filealias = $dirname.'/'.$objectpage->lang.'/'.$filename; + $filealiassub = $dirname.'/'.$objectpage->lang.'/'.$filename; $aliascontent = 'id.'.tpl.php\'; '; $aliascontent .= 'else require $dolibarr_main_data_root.\'/website/\'.$website->ref.\'/page'.$objectpage->id.'.tpl.php\';'."\n"; $aliascontent .= '?>'."\n"; - $result = file_put_contents($filealias, $aliascontent); + $result = file_put_contents($filealiassub, $aliascontent); if ($result === false) { - dol_syslog("Failed to write file ".$filealias, LOG_WARNING); + dol_syslog("Failed to write file ".$filealiassub, LOG_WARNING); } if (!empty($conf->global->MAIN_UMASK)) { - @chmod($filealias, octdec($conf->global->MAIN_UMASK)); + @chmod($filealiassub, octdec($conf->global->MAIN_UMASK)); } } // Save also alias into all language subdirectories if it is a main language @@ -108,7 +108,7 @@ function dolSavePageAlias($filealias, $object, $objectpage) $dirname = dirname($filealias); $filename = basename($filealias); foreach (explode(',', $object->otherlang) as $sublang) { - $filealias = $dirname.'/'.$sublang.'/'.$filename; + $filealiassub = $dirname.'/'.$sublang.'/'.$filename; $aliascontent = 'id.'.tpl.php\'; '; $aliascontent .= 'else require $dolibarr_main_data_root.\'/website/\'.$website->ref.\'/page'.$objectpage->id.'.tpl.php\';'."\n"; $aliascontent .= '?>'."\n"; - $result = file_put_contents($filealias, $aliascontent); + $result = file_put_contents($filealiassub, $aliascontent); if ($result === false) { - dol_syslog("Failed to write file ".$filealias, LOG_WARNING); + dol_syslog("Failed to write file ".$filealiassub, LOG_WARNING); } if (!empty($conf->global->MAIN_UMASK)) { - @chmod($filealias, octdec($conf->global->MAIN_UMASK)); + @chmod($filealiassub, octdec($conf->global->MAIN_UMASK)); } } } diff --git a/htdocs/website/index.php b/htdocs/website/index.php index 30937b74c34..05ef2f7e64d 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -2037,6 +2037,17 @@ if (($action == 'updatesource' || $action == 'updatecontent' || $action == 'conf { dol_syslog("We regenerate alias page new name=".$filealias.", old name=".$fileoldalias); dol_delete_file($fileoldalias); + + // Delete also pages into language subdirectories + if (empty($objectpage->lang) || !in_array($objectpage->lang, explode(',', $object->otherlang))) { + $dirname = dirname($fileoldalias); + $filename = basename($fileoldalias); + foreach (explode(',', $object->otherlang) as $sublang) { + $fileoldaliassub = $dirname.'/'.$sublang.'/'.$filename; + dol_delete_file($fileoldaliassub); + } + } + } // Save page alias From c0426b866f5f57442b07fc85b170bbf2b6a98e18 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 26 Jan 2021 13:40:38 +0100 Subject: [PATCH 12/37] Fix loop --- htdocs/website/index.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/website/index.php b/htdocs/website/index.php index 05ef2f7e64d..4ed4f727d17 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -2042,7 +2042,8 @@ if (($action == 'updatesource' || $action == 'updatecontent' || $action == 'conf if (empty($objectpage->lang) || !in_array($objectpage->lang, explode(',', $object->otherlang))) { $dirname = dirname($fileoldalias); $filename = basename($fileoldalias); - foreach (explode(',', $object->otherlang) as $sublang) { + $sublangs = explode(',', $object->otherlang); + foreach ($sublangs as $sublang) { $fileoldaliassub = $dirname.'/'.$sublang.'/'.$filename; dol_delete_file($fileoldaliassub); } From b3d2d50a0ce40625b3fa3913b6401f024f408ce4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 26 Jan 2021 13:57:56 +0100 Subject: [PATCH 13/37] Fix delete aliases --- htdocs/website/index.php | 34 ++++++++++++++++++++++++++-------- 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/htdocs/website/index.php b/htdocs/website/index.php index 4ed4f727d17..ebcf31ad2c5 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -1752,7 +1752,6 @@ if ($action == 'updatemeta') dol_mkdir($pathofwebsite); - // Now generate the master.inc.php page $result = dolSaveMasterFile($filemaster); if (!$result) setEventMessages('Failed to write file '.$filemaster, null, 'errors'); @@ -1762,6 +1761,17 @@ if ($action == 'updatemeta') { dol_syslog("We delete old alias page name=".$fileoldalias." to build a new alias page=".$filealias); dol_delete_file($fileoldalias); + + // Delete also pages into language subdirectories + if (empty($objectpage->lang) || !in_array($objectpage->lang, explode(',', $object->otherlang))) { + $dirname = dirname($fileoldalias); + $filename = basename($fileoldalias); + $sublangs = explode(',', $object->otherlang); + foreach ($sublangs as $sublang) { + $fileoldaliassub = $dirname.'/'.$sublang.'/'.$filename; + dol_delete_file($fileoldaliassub); + } + } } // Now delete the alternative alias.php pages if (!empty($objectpage->old_object->aliasalt)) @@ -1773,11 +1783,22 @@ if ($action == 'updatemeta') { dol_syslog("We delete old alt alias pages name=".trim($tmpaliasalt)); dol_delete_file($pathofwebsite.'/'.trim($tmpaliasalt).'.php'); + + // Delete also pages into language subdirectories + if (empty($objectpage->lang) || !in_array($objectpage->lang, explode(',', $object->otherlang))) { + $dirname = dirname($pathofwebsite.'/'.trim($tmpaliasalt).'.php'); + $filename = basename($pathofwebsite.'/'.trim($tmpaliasalt).'.php'); + $sublangs = explode(',', $object->otherlang); + foreach ($sublangs as $sublang) { + $fileoldaliassub = $dirname.'/'.$sublang.'/'.$filename; + dol_delete_file($fileoldaliassub); + } + } } } } - // Save page alias + // Save page main alias $result = dolSavePageAlias($filealias, $object, $objectpage); if (!$result) setEventMessages('Failed to write file '.$filealias, null, 'errors'); // Save alt aliases @@ -2025,15 +2046,13 @@ if (($action == 'updatesource' || $action == 'updatecontent' || $action == 'conf dol_mkdir($pathofwebsite); - // Now generate the master.inc.php page $result = dolSaveMasterFile($filemaster); if (!$result) setEventMessages('Failed to write the master file file '.$filemaster, null, 'errors'); - - // Now generate the alias.php page - if (!empty($fileoldalias)) + // Now delete the old alias.php page if we removed one + /*if (!empty($fileoldalias)) { dol_syslog("We regenerate alias page new name=".$filealias.", old name=".$fileoldalias); dol_delete_file($fileoldalias); @@ -2048,8 +2067,7 @@ if (($action == 'updatesource' || $action == 'updatecontent' || $action == 'conf dol_delete_file($fileoldaliassub); } } - - } + }*/ // Save page alias $result = dolSavePageAlias($filealias, $object, $objectpage); From 8bc639fe02b13e5bd02f10bf930e3047313e77c9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 26 Jan 2021 16:10:27 +0100 Subject: [PATCH 14/37] Fix too many logs --- htdocs/includes/odtphp/odf.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/htdocs/includes/odtphp/odf.php b/htdocs/includes/odtphp/odf.php index 88fa70c5646..e7ce32cf4b9 100644 --- a/htdocs/includes/odtphp/odf.php +++ b/htdocs/includes/odtphp/odf.php @@ -136,9 +136,8 @@ class Odf // instead of {aaa} so we should enhance this function. //print $key.'-'.$value.'-'.strpos($this->contentXml, $this->config['DELIMITER_LEFT'] . $key . $this->config['DELIMITER_RIGHT']).'
'; if (strpos($this->contentXml, $tag) === false && strpos($this->stylesXml, $tag) === false) { - //if (strpos($this->contentXml, '">'. $key . '') === false) { - throw new OdfException("var $key not found in the document"); - //} + // Add the throw only for development. In most cases, it is normal to not having the key into the document (only few keys are presents). + //throw new OdfException("var $key not found in the document"); } $this->vars[$tag] = $this->convertVarToOdf($value, $encode, $charset); From b50728d4fbf2d7a537cf7ca687ebc18c7d056002 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 27 Jan 2021 21:04:48 +0100 Subject: [PATCH 15/37] FIX #16076 --- htdocs/user/list.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/htdocs/user/list.php b/htdocs/user/list.php index 9c63dc3e664..bd12c0fbb99 100644 --- a/htdocs/user/list.php +++ b/htdocs/user/list.php @@ -301,19 +301,22 @@ $sql .= " u.salary, u.datelastlogin, u.datepreviouslogin,"; $sql .= " u.ldap_sid, u.statut, u.entity,"; $sql .= " u.tms as date_update, u.datec as date_creation,"; $sql .= " u2.rowid as id2, u2.login as login2, u2.firstname as firstname2, u2.lastname as lastname2, u2.admin as admin2, u2.fk_soc as fk_soc2, u2.email as email2, u2.gender as gender2, u2.photo as photo2, u2.entity as entity2, u2.statut as statut2,"; -$sql .= " s.nom as name, s.canvas"; +$sql .= " s.nom as name, s.canvas, "; // Add fields from extrafields if (!empty($extrafields->attributes[$object->table_element]['label'])) { - foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key.' as options_'.$key : ''); + foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { + $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? "ef.".$key.' as options_'.$key.', ' : ''); + } } // Add fields from hooks $parameters = array(); $reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook $sql .= preg_replace('/^,/', '', $hookmanager->resPrint); $sql = preg_replace('/,\s*$/', '', $sql); -$sql .= $hookmanager->resPrint; $sql .= " FROM ".MAIN_DB_PREFIX."user as u"; -if (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 (u.rowid = ef.fk_object)"; +if (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 (u.rowid = ef.fk_object)"; +} $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON u.fk_soc = s.rowid"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."user as u2 ON u.fk_user = u2.rowid"; if (!empty($search_categ) || !empty($catid)) $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_user as cu ON u.rowid = cu.fk_user"; // We'll need this table joined to the select in order to filter by categ From 2be157c91f7e978e6dba86cdfcc26c29f0597221 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 28 Jan 2021 00:18:11 +0100 Subject: [PATCH 16/37] Trans --- htdocs/commande/stats/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/commande/stats/index.php b/htdocs/commande/stats/index.php index d89559af113..e990fc31d49 100644 --- a/htdocs/commande/stats/index.php +++ b/htdocs/commande/stats/index.php @@ -289,7 +289,7 @@ if ($mode == 'customer') if ($mode == 'supplier') { $cat_type = Categorie::TYPE_SUPPLIER; - $cat_label = $langs->trans("Supplier").' '.lcfirst($langs->trans("Customer")); + $cat_label = $langs->trans("Category").' '.lcfirst($langs->trans("Supplier")); } print ''.$cat_label.''; print $formother->select_categories($cat_type, $categ_id, 'categ_id', true); From b488bca02016766462fe9042f94c374dc6038f69 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 28 Jan 2021 08:53:13 +0100 Subject: [PATCH 17/37] FIX 16084 --- htdocs/core/lib/project.lib.php | 3 ++- htdocs/projet/index.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index d7c7c53f8de..aaa1e144202 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -2183,7 +2183,8 @@ function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks $sql2 .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = p.fk_soc"; $sql2 .= " LEFT JOIN ".MAIN_DB_PREFIX."projet_task as t ON p.rowid = t.fk_projet"; $sql2 .= " WHERE p.rowid IN (".join(',', $arrayidofprojects).")"; - $sql2 .= " GROUP BY p.rowid, p.ref, p.title, p.fk_soc, s.nom, p.fk_user_creat, p.public, p.fk_statut, p.fk_opp_status, p.opp_percent, p.opp_amount, p.dateo, p.datee"; + $sql2 .= " GROUP BY p.rowid, p.ref, p.title, p.fk_soc, s.rowid, s.nom, s.name_alias, s.code_client, s.code_compta, s.client, s.code_fournisseur, s.code_compta_fournisseur, s.fournisseur,"; + $sql2 .= " s.logo, s.email, s.entity, p.fk_user_creat, p.public, p.fk_statut, p.fk_opp_status, p.opp_percent, p.opp_amount, p.dateo, p.datee"; $sql2 .= " ORDER BY p.title, p.ref"; $resql = $db->query($sql2); diff --git a/htdocs/projet/index.php b/htdocs/projet/index.php index 6c376fc35f3..f2b1820c019 100644 --- a/htdocs/projet/index.php +++ b/htdocs/projet/index.php @@ -322,7 +322,7 @@ $sql .= " WHERE p.entity IN (".getEntity('project').")"; $sql .= " AND p.fk_statut = 1"; if ($mine || empty($user->rights->projet->all->lire)) $sql .= " AND p.rowid IN (".$projectsListId.")"; // If we have this test true, it also means projectset is not 2 if ($socid) $sql .= " AND (p.fk_soc IS NULL OR p.fk_soc = 0 OR p.fk_soc = ".$socid.")"; -$sql .= " GROUP BY s.rowid, s.nom, s.email, s.client, s.fournisseur, s.code_client, s.code_fournisseur, s.canvas, s.status"; +$sql .= " GROUP BY s.rowid, s.nom, s.name_alias, s.code_client, s.code_compta, s.client, s.code_fournisseur, s.code_compta_fournisseur, s.fournisseur, s.logo, s.email, s.entity, s.canvas, s.status"; $sql .= $db->order($sortfield, $sortorder); //$sql .= $db->plimit($max + 1, 0); From f024f06df7831c4456d4ae1bac635308ba1d1d1e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 28 Jan 2021 09:23:28 +0100 Subject: [PATCH 18/37] Fix url --- build/debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/debian/control b/build/debian/control index 0ef5367072f..eed54669555 100755 --- a/build/debian/control +++ b/build/debian/control @@ -4,7 +4,7 @@ Priority: optional Maintainer: Laurent Destailleur (eldy) # Uploaders: Laurent Destailleur (eldy) # Only if differs from Maintainer Standards-Version: 3.9.6 -Homepage: http://www.dolibarr.org +Homepage: https://www.dolibarr.org Build-Depends: debhelper (>= 9), po-debconf # This package need at least debian 7 or ubuntu 13.04 or any distribution based on this version From ba3e90229214bb5cfcc5f88f2d0892a569571961 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 28 Jan 2021 09:25:58 +0100 Subject: [PATCH 19/37] FIX #16080 --- htdocs/comm/mailing/list.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/comm/mailing/list.php b/htdocs/comm/mailing/list.php index 9da825e262e..8a005d2dc82 100644 --- a/htdocs/comm/mailing/list.php +++ b/htdocs/comm/mailing/list.php @@ -119,9 +119,8 @@ llxHeader('', $langs->trans("Mailing"), 'EN:Module_EMailing|FR:Module_Mailing|ES $form = new Form($db); -if ($filteremail) -{ - $sql = "SELECT m.rowid, m.titre, m.nbemail, m.statut, m.date_creat as datec, m.date_envoi as date_envoi,"; +if ($filteremail) { + $sql = "SELECT m.rowid, m.titre as title, m.nbemail, m.statut, m.date_creat as datec, m.date_envoi as date_envoi,"; $sql .= " mc.statut as sendstatut"; $sql .= " FROM ".MAIN_DB_PREFIX."mailing as m, ".MAIN_DB_PREFIX."mailing_cibles as mc"; $sql .= " WHERE m.rowid = mc.fk_mailing AND m.entity = ".$conf->entity; @@ -131,7 +130,7 @@ if ($filteremail) if (!$sortorder) $sortorder = "ASC"; if (!$sortfield) $sortfield = "m.rowid"; } else { - $sql = "SELECT m.rowid, m.titre, m.nbemail, m.statut, m.date_creat as datec, m.date_envoi as date_envoi"; + $sql = "SELECT m.rowid, m.titre as title, m.nbemail, m.statut, m.date_creat as datec, m.date_envoi as date_envoi"; $sql .= " FROM ".MAIN_DB_PREFIX."mailing as m"; $sql .= " WHERE m.entity = ".$conf->entity; if ($search_ref) $sql .= " AND m.rowid = '".$db->escape($search_ref)."'"; @@ -238,9 +237,10 @@ if ($resql) print $email->getNomUrl(1); print ''; + // Title print ''.$obj->title.''; - // Date creation + // Date creation print ''; print dol_print_date($db->jdate($obj->datec), 'day'); print ''; From 0b393676e6816c5f4008125ac5594bb6224fdfec Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 28 Jan 2021 09:30:01 +0100 Subject: [PATCH 20/37] Fix group by --- htdocs/compta/index.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php index 5614659eac0..1d4d1a37354 100644 --- a/htdocs/compta/index.php +++ b/htdocs/compta/index.php @@ -161,8 +161,9 @@ if (!empty($conf->facture->enabled) && $user->rights->facture->lire) $sql .= $hookmanager->resPrint; $sql .= " GROUP BY f.rowid, f.ref, f.datef, f.total, f.tva, f.total_ttc, f.ref_client, f.type, f.fk_statut, f.paye,"; - $sql .= " s.email, s.nom, s.rowid, s.code_client, s.code_compta, s.code_fournisseur, s.code_compta_fournisseur,"; + $sql .= " s.nom, s.rowid, s.email, s.code_client, s.code_compta, s.code_fournisseur, s.code_compta_fournisseur,"; $sql .= " cc.rowid, cc.code"; + if (!$user->rights->societe->client->voir && !$socid) $sql.= ", sc.fk_soc, sc.fk_user"; // Add Group from hooks $parameters = array(); From f462e353e92e0c268a12220760d5b14ab83c7762 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 28 Jan 2021 09:59:13 +0100 Subject: [PATCH 21/37] FIX #16079 --- htdocs/compta/facture/class/facture.class.php | 18 +++++------ htdocs/core/lib/date.lib.php | 31 +++++++++++++------ 2 files changed, 30 insertions(+), 19 deletions(-) diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 24f5b748e52..f036145161d 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -1191,23 +1191,23 @@ class Facture extends CommonInvoice { unset($object->lines[$i]); } - // Bloc to update dates of service (month by month only if previously filled at 1d near start or end of month) + + // Bloc to update dates of service (month by month only if previously filled and similare to start and end of month) // If it's a service with start and end dates - if (!empty($line->date_start) && !empty($line->date_end)) { + if (!empty($conf->global->INVOICE_AUTO_NEXT_MONTH_ON_LINES) && !empty($line->date_start) && !empty($line->date_end)) { // Get the dates $start = dol_getdate($line->date_start); $end = dol_getdate($line->date_end); // Get the first and last day of the month $first = dol_get_first_day($start['year'], $start['mon']); - $last = dol_get_first_day($end['year'], $end['mon']); + $last = dol_get_last_day($end['year'], $end['mon']); - // Get diff betweend start/end of month and previously filled - $diffFirst = num_between_day($first, dol_mktime($start['hours'], $start['minutes'], $start['seconds'], $start['mon'], $start['mday'], $start['year'], 'user')); - $diffLast = num_between_day(dol_mktime($end['hours'], $end['minutes'], $end['seconds'], $end['mon'], $end['mday'], $end['year'], 'user'), $last); - - // If there is <= 1d (or 2?) of start/or/end of month - if ($diffFirst <= 2 && $diffLast <= 2) { + //print dol_print_date(dol_mktime(0, 0, 0, $start['mon'], $start['mday'], $start['year'], 'gmt'), 'dayhour').' '.dol_print_date($first, 'dayhour').'
'; + //print dol_mktime(23, 59, 59, $end['mon'], $end['mday'], $end['year'], 'gmt').' '.$last.'
';exit; + // If start date is first date of month and end date is last date of month + if (dol_mktime(0, 0, 0, $start['mon'], $start['mday'], $start['year'], 'gmt') == $first + && dol_mktime(23, 59, 59, $end['mon'], $end['mday'], $end['year'], 'gmt') == $last) { $nextMonth = dol_get_next_month($end['mon'], $end['year']); $newFirst = dol_get_first_day($nextMonth['year'], $nextMonth['month']); $newLast = dol_get_last_day($nextMonth['year'], $nextMonth['month']); diff --git a/htdocs/core/lib/date.lib.php b/htdocs/core/lib/date.lib.php index 3a889367dc1..74b091865ff 100644 --- a/htdocs/core/lib/date.lib.php +++ b/htdocs/core/lib/date.lib.php @@ -356,7 +356,8 @@ function dol_stringtotime($string, $gm = 1) } -/** Return previous day +/** + * Return previous day * * @param int $day Day * @param int $month Month @@ -371,7 +372,8 @@ function dol_get_prev_day($day, $month, $year) return array('year' => $tmparray['year'], 'month' => $tmparray['mon'], 'day' => $tmparray['mday']); } -/** Return next day +/** + * Return next day * * @param int $day Day * @param int $month Month @@ -386,7 +388,8 @@ function dol_get_next_day($day, $month, $year) return array('year' => $tmparray['year'], 'month' => $tmparray['mon'], 'day' => $tmparray['mday']); } -/** Return previous month +/** + * Return previous month * * @param int $month Month * @param int $year Year @@ -405,7 +408,8 @@ function dol_get_prev_month($month, $year) return array('year' => $prev_year, 'month' => $prev_month); } -/** Return next month +/** + * Return next month * * @param int $month Month * @param int $year Year @@ -424,7 +428,8 @@ function dol_get_next_month($month, $year) return array('year' => $next_year, 'month' => $next_month); } -/** Return previous week +/** + * Return previous week * * @param int $day Day * @param int $week Week @@ -442,7 +447,8 @@ function dol_get_prev_week($day, $week, $month, $year) return array('year' => $tmparray['year'], 'month' => $tmparray['mon'], 'day' => $tmparray['mday']); } -/** Return next week +/** + * Return next week * * @param int $day Day * @param int $week Week @@ -461,7 +467,8 @@ function dol_get_next_week($day, $week, $month, $year) return array('year' => $tmparray['year'], 'month' => $tmparray['mon'], 'day' => $tmparray['mday']); } -/** Return GMT time for first day of a month or year +/** + * Return GMT time for first day of a month or year * * @param int $year Year * @param int $month Month @@ -478,7 +485,9 @@ function dol_get_first_day($year, $month = 1, $gm = false) } -/** Return GMT time for last day of a month or year +/** + * Return GMT time for last day of a month or year. + * Note: The timestamp contains last day and last hours (23:59:59) * * @param int $year Year * @param int $month Month @@ -504,7 +513,8 @@ function dol_get_last_day($year, $month = 12, $gm = false) return $datelim; } -/** Return GMT time for last hour of a given GMT date (it removes hours, min and second part) +/** + * Return GMT time for last hour of a given GMT date (it removes hours, min and second part) * * @param int $date Date * @return int Date for last hour of a given date @@ -515,7 +525,8 @@ function dol_get_last_hour($date) return dol_mktime(23, 59, 59, $tmparray['mon'], $tmparray['mday'], $tmparray['year'], false); } -/** Return GMT time for first hour of a given GMT date (it removes hours, min and second part) +/** + * Return GMT time for first hour of a given GMT date (it removes hours, min and second part) * * @param int $date Date * @return int Date for last hour of a given date From 9d0945bbe2bb892b198f824391190d51c74699a7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 28 Jan 2021 10:30:09 +0100 Subject: [PATCH 22/37] FIX #16077 --- htdocs/core/lib/functions.lib.php | 2 +- htdocs/fichinter/card.php | 23 ++++++++++------------- 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 31939708663..26f62320b3b 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1984,7 +1984,7 @@ function dol_print_date($time, $format = '', $tzoutput = 'auto', $outputlangs = { global $conf, $langs; - if ($tzoutput == 'auto') { + if ($tzoutput === 'auto') { $tzoutput = (empty($conf) ? 'tzserver' : $conf->tzuserinputkey); } diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index 2805089aaf3..a4fed934936 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -217,8 +217,9 @@ if (empty($reshook)) if (!empty($origin) && !empty($originid)) { // Parse element/subelement (ex: project_task) - $element = $subelement = $_POST['origin']; - if (preg_match('/^([^_]+)_([^_]+)/i', $_POST['origin'], $regs)) + $regs = array(); + $element = $subelement = GETPOST('origin', 'alphanohtml'); + if (preg_match('/^([^_]+)_([^_]+)/i', GETPOST('origin', 'alphanohtml'), $regs)) { $element = $regs[1]; $subelement = $regs[2]; @@ -478,8 +479,7 @@ if (empty($reshook)) $desc = GETPOST('np_desc', 'restricthtml'); $date_intervention = dol_mktime(GETPOST('dihour', 'int'), GETPOST('dimin', 'int'), 0, GETPOST('dimonth', 'int'), GETPOST('diday', 'int'), GETPOST('diyear', 'int')); - $duration = empty($conf->global->FICHINTER_WITHOUT_DURATION) ?convertTime2Seconds(GETPOST('durationhour', 'int'), GETPOST('durationmin', 'int')) : 0; - + $duration = empty($conf->global->FICHINTER_WITHOUT_DURATION) ? convertTime2Seconds(GETPOST('durationhour', 'int'), GETPOST('durationmin', 'int')) : 0; // Extrafields $extrafields->fetch_name_optionals_label($object->table_element_line); @@ -1335,8 +1335,7 @@ if ($action == 'create') print '
'; print ''; print ''; - if ($action == 'editline') - { + if ($action == 'editline') { print ''; print ''; } else { @@ -1348,8 +1347,9 @@ if ($action == 'create') $sql .= ' ft.date as date_intervention'; $sql .= ' FROM '.MAIN_DB_PREFIX.'fichinterdet as ft'; $sql .= ' WHERE ft.fk_fichinter = '.$object->id; - if (!empty($conf->global->FICHINTER_HIDE_EMPTY_DURATION)) + if (!empty($conf->global->FICHINTER_HIDE_EMPTY_DURATION)) { $sql .= ' AND ft.duree <> 0'; + } $sql .= ' ORDER BY ft.rang ASC, ft.date ASC, ft.rowid'; $resql = $db->query($sql); @@ -1376,13 +1376,11 @@ if ($action == 'create') print ' '; print "\n"; } - while ($i < $num) - { + while ($i < $num) { $objp = $db->fetch_object($resql); // Ligne en mode visu - if ($action != 'editline' || GETPOST('line_id', 'int') != $objp->rowid) - { + if ($action != 'editline' || GETPOST('line_id', 'int') != $objp->rowid) { print ''; // No. @@ -1402,8 +1400,7 @@ if ($action == 'create') print "\n"; - - // Econ to edit and delete + // Icon to edit and delete if ($object->statut == 0 && $user->rights->ficheinter->creer) { print ''; From cf4a12d715bc316b9e9397b472cb21ba5a019e52 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 28 Jan 2021 12:02:16 +0100 Subject: [PATCH 23/37] FIX Missing language ico Conflicts: htdocs/core/lib/functions.lib.php --- htdocs/core/lib/functions.lib.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 26f62320b3b..a509d3bd7a6 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -7391,6 +7391,7 @@ function picto_from_langcode($codelang, $moreatt = '') 'da_DA' => 'dk', 'fr_CA' => 'mq', 'sv_SV' => 'se', + 'sw_SW' => 'unknown', 'AQ' => 'unknown', 'CW' => 'unknown', 'IM' => 'unknown', From 2f98d8035c866cd93fa559d096fd55c6fa41e947 Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Thu, 28 Jan 2021 13:37:43 +0100 Subject: [PATCH 24/37] Fix: Bad supplier price updater --- htdocs/fourn/commande/dispatch.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/htdocs/fourn/commande/dispatch.php b/htdocs/fourn/commande/dispatch.php index 2ada245ff8b..a47e544848d 100644 --- a/htdocs/fourn/commande/dispatch.php +++ b/htdocs/fourn/commande/dispatch.php @@ -3,7 +3,7 @@ * Copyright (C) 2004-2016 Laurent Destailleur * Copyright (C) 2005 Eric Seigne * Copyright (C) 2005-2009 Regis Houssin - * Copyright (C) 2010-2019 Juanjo Menent + * Copyright (C) 2010-2021 Juanjo Menent * Copyright (C) 2014 Cedric Gross * Copyright (C) 2016 Florian Henry * Copyright (C) 2017 Ferran Marcet @@ -268,12 +268,16 @@ if ($action == 'dispatch' && $user->rights->fournisseur->commande->receptionner) if (!$error && !empty($conf->global->SUPPLIER_ORDER_CAN_UPDATE_BUYINGPRICE_DURING_RECEIPT)) { if (empty($conf->multicurrency->enabled) && empty($conf->dynamicprices->enabled)) { $dto = GETPOST("dto_".$reg[1].'_'.$reg[2]); + if (empty($dto)) { + $dto = 0; + } + //update supplier price if (isset($_POST[$saveprice])) { // TODO Use class $sql = "UPDATE ".MAIN_DB_PREFIX."product_fournisseur_price"; - $sql .= " SET unitprice='".GETPOST($pu)."'"; - $sql .= ", price=".GETPOST($pu)."*quantity"; + $sql .= " SET unitprice='".price2num(GETPOST($pu),'MT')."'"; + $sql .= ", price=".price2num(GETPOST($pu),'MT')."*quantity"; $sql .= ", remise_percent='".$dto."'"; $sql .= " WHERE fk_soc=".$object->socid; $sql .= " AND fk_product=".GETPOST($prod, 'int'); From c63a124d1c3813a4400b814bcc0c4e8f5c79c8b4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 28 Jan 2021 14:13:29 +0100 Subject: [PATCH 25/37] More complete fix --- htdocs/fourn/commande/dispatch.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/htdocs/fourn/commande/dispatch.php b/htdocs/fourn/commande/dispatch.php index a47e544848d..c6813af0eba 100644 --- a/htdocs/fourn/commande/dispatch.php +++ b/htdocs/fourn/commande/dispatch.php @@ -227,6 +227,7 @@ if ($action == 'dispatch' && $user->rights->fournisseur->commande->receptionner) foreach ($_POST as $key => $value) { // without batch module enabled + $reg = array(); if (preg_match('/^product_([0-9]+)_([0-9]+)$/i', $key, $reg)) { $pos++; @@ -276,11 +277,11 @@ if ($action == 'dispatch' && $user->rights->fournisseur->commande->receptionner) if (isset($_POST[$saveprice])) { // TODO Use class $sql = "UPDATE ".MAIN_DB_PREFIX."product_fournisseur_price"; - $sql .= " SET unitprice='".price2num(GETPOST($pu),'MT')."'"; - $sql .= ", price=".price2num(GETPOST($pu),'MT')."*quantity"; + $sql .= " SET unitprice='".price2num(GETPOST($pu), 'MU')."'"; + $sql .= ", price=".price2num(GETPOST($pu), 'MU')."*quantity"; $sql .= ", remise_percent='".$dto."'"; - $sql .= " WHERE fk_soc=".$object->socid; - $sql .= " AND fk_product=".GETPOST($prod, 'int'); + $sql .= " WHERE fk_soc=".((int) $object->socid); + $sql .= " AND fk_product=".((int) GETPOST($prod, 'int')); $resql = $db->query($sql); } From f3c33be871a37a047b3b8accccfa0c89e5ac94ad Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 28 Jan 2021 15:47:32 +0100 Subject: [PATCH 26/37] Fix css --- htdocs/societe/card.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 2f51995c785..7b997fbd613 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -1199,9 +1199,8 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) print ''; // Name, firstname - print '"; if (!$i) $totalarray['nbfield']++; From 086b23f66c497e0177b658cde41ab12ed8282946 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 28 Jan 2021 23:28:33 +0100 Subject: [PATCH 36/37] Fix responsive --- htdocs/societe/list.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index 402e85d9b39..5b5e9685628 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -1259,7 +1259,7 @@ while ($i < min($num, $limit)) if (!empty($arrayfields['s.fk_prospectlevel']['checked'])) { // Prospect level - print '"; if (!$i) $totalarray['nbfield']++; @@ -1283,7 +1283,7 @@ while ($i < min($num, $limit)) // Parent company if (!empty($arrayfields['s2.nom']['checked'])) { - print '
'; - if ($object->particulier || $private) - { + print '
'; + if ($object->particulier || $private) { print ''.$langs->trans('ThirdPartyName').' / '.$langs->trans('LastName', 'name').''; } else { print ''.$form->editfieldkey('ThirdPartyName', 'name', '', $object, 0).''; From 745e2be67832e4b26f79ca0f255774af8d6de5c6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 28 Jan 2021 16:00:22 +0100 Subject: [PATCH 27/37] FIX encoding status in graph of vendor proposals --- .../class/supplier_proposal.class.php | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php index a939b95ffca..890dff34812 100644 --- a/htdocs/supplier_proposal/class/supplier_proposal.class.php +++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php @@ -2183,16 +2183,16 @@ class SupplierProposal extends CommonObject { global $langs; $langs->load("supplier_proposal"); - $this->labelStatus[self::STATUS_DRAFT] = $langs->trans("SupplierProposalStatusDraft"); - $this->labelStatus[self::STATUS_VALIDATED] = $langs->trans("SupplierProposalStatusValidated"); - $this->labelStatus[self::STATUS_SIGNED] = $langs->trans("SupplierProposalStatusSigned"); - $this->labelStatus[self::STATUS_NOTSIGNED] = $langs->trans("SupplierProposalStatusNotSigned"); - $this->labelStatus[self::STATUS_CLOSE] = $langs->trans("SupplierProposalStatusClosed"); - $this->labelStatusShort[self::STATUS_DRAFT] = $langs->trans("SupplierProposalStatusDraftShort"); - $this->labelStatusShort[self::STATUS_VALIDATED] = $langs->trans("Opened"); - $this->labelStatusShort[self::STATUS_SIGNED] = $langs->trans("SupplierProposalStatusSignedShort"); - $this->labelStatusShort[self::STATUS_NOTSIGNED] = $langs->trans("SupplierProposalStatusNotSignedShort"); - $this->labelStatusShort[self::STATUS_CLOSE] = $langs->trans("SupplierProposalStatusClosedShort"); + $this->labelStatus[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv("SupplierProposalStatusDraft"); + $this->labelStatus[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv("SupplierProposalStatusValidated"); + $this->labelStatus[self::STATUS_SIGNED] = $langs->transnoentitiesnoconv("SupplierProposalStatusSigned"); + $this->labelStatus[self::STATUS_NOTSIGNED] = $langs->transnoentitiesnoconv("SupplierProposalStatusNotSigned"); + $this->labelStatus[self::STATUS_CLOSE] = $langs->transnoentitiesnoconv("SupplierProposalStatusClosed"); + $this->labelStatusShort[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv("SupplierProposalStatusDraftShort"); + $this->labelStatusShort[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv("Opened"); + $this->labelStatusShort[self::STATUS_SIGNED] = $langs->transnoentitiesnoconv("SupplierProposalStatusSignedShort"); + $this->labelStatusShort[self::STATUS_NOTSIGNED] = $langs->transnoentitiesnoconv("SupplierProposalStatusNotSignedShort"); + $this->labelStatusShort[self::STATUS_CLOSE] = $langs->transnoentitiesnoconv("SupplierProposalStatusClosedShort"); } $statusnew = ''; From 32c33b72d6df48fa03a7cf4ce4b3b643a3d3eaa5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 28 Jan 2021 16:10:13 +0100 Subject: [PATCH 28/37] FIX Sql error in group by with postgresql --- htdocs/fourn/facture/list.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index b0c58572955..317def67098 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -497,7 +497,9 @@ if (!$search_all) $sql .= " GROUP BY f.rowid, f.ref, f.ref_supplier, f.type, f.datef, f.date_lim_reglement, f.fk_mode_reglement, f.fk_cond_reglement,"; $sql .= " f.total_ht, f.total_ttc, f.total_tva, f.paye, f.fk_statut, f.libelle, f.datec, f.tms,"; $sql .= " f.localtax1, f.localtax2,"; + $sql .= ' f.fk_multicurrency, f.multicurrency_code, f.multicurrency_tx, f.multicurrency_total_ht, f.multicurrency_total_tva, f.multicurrency_total_ttc,'; $sql .= " f.note_public, f.note_private,"; + $sql .= " f.fk_user_author,"; $sql .= ' s.rowid, s.nom, s.email, s.town, s.zip, s.fk_pays, s.client, s.fournisseur, s.code_client, s.code_fournisseur, s.code_compta, s.code_compta_fournisseur,'; $sql .= " typent.code,"; $sql .= " state.code_departement, state.nom,"; From 4c3dc6be1bdfc9f2c4b27d518f0e82a3179a031b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 28 Jan 2021 19:37:37 +0100 Subject: [PATCH 29/37] Fix can't use the link button twice. --- htdocs/admin/mails.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php index 08e7c2b5446..0d6a36e07b7 100644 --- a/htdocs/admin/mails.php +++ b/htdocs/admin/mails.php @@ -768,17 +768,17 @@ if ($action == 'edit') { if (function_exists('fsockopen') && $port && $server) { - print ''.$langs->trans("DoTestServerAvailability").''; + print ''.$langs->trans("DoTestServerAvailability").''; } } else { print ''.$langs->trans("DoTestServerAvailability").''; } - print ''.$langs->trans("DoTestSend").''; + print ''.$langs->trans("DoTestSend").''; if (!empty($conf->fckeditor->enabled)) { - print ''.$langs->trans("DoTestSendHTML").''; + print ''.$langs->trans("DoTestSendHTML").''; } } From 1764d3528bb43bb63c54d0899ea1265b3f60cc1b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 28 Jan 2021 19:45:52 +0100 Subject: [PATCH 30/37] Fix test email --- htdocs/admin/mails.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php index 0d6a36e07b7..b0b18de20dc 100644 --- a/htdocs/admin/mails.php +++ b/htdocs/admin/mails.php @@ -768,17 +768,17 @@ if ($action == 'edit') { if (function_exists('fsockopen') && $port && $server) { - print ''.$langs->trans("DoTestServerAvailability").''; + print ''.$langs->trans("DoTestServerAvailability").''; } } else { print ''.$langs->trans("DoTestServerAvailability").''; } - print ''.$langs->trans("DoTestSend").''; + print ''.$langs->trans("DoTestSend").''; if (!empty($conf->fckeditor->enabled)) { - print ''.$langs->trans("DoTestSendHTML").''; + print ''.$langs->trans("DoTestSendHTML").''; } } @@ -844,6 +844,7 @@ if ($action == 'edit') // Run the test to connect if ($action == 'testconnect') { + print '
'; print load_fiche_titre($langs->trans("DoTestServerAvailability")); include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; @@ -858,6 +859,7 @@ if ($action == 'edit') } setEventMessages($errormsg, null, 'errors'); + print $errormsg; } print '
'; } From 099fcd7e4efe2b869e6eece3c6901fe1daeefef9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 28 Jan 2021 19:45:52 +0100 Subject: [PATCH 31/37] Fix test email Conflicts: htdocs/admin/mails.php --- htdocs/admin/mails.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php index 00d954883f9..4b471263542 100644 --- a/htdocs/admin/mails.php +++ b/htdocs/admin/mails.php @@ -719,7 +719,7 @@ else { if (function_exists('fsockopen') && $port && $server) { - print ''.$langs->trans("DoTestServerAvailability").''; + print ''.$langs->trans("DoTestServerAvailability").''; } } else @@ -789,6 +789,7 @@ else // Run the test to connect if ($action == 'testconnect') { + print '
'; print load_fiche_titre($langs->trans("DoTestServerAvailability")); include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; @@ -804,6 +805,7 @@ else } setEventMessages($errormsg, null, 'errors'); + print $errormsg; } print '
'; } From 848b4db509c33ef7e0a43c8b8aca91e9726bba6a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 28 Jan 2021 23:13:43 +0100 Subject: [PATCH 32/37] Fix regression: It was not more possible to create payment offline --- htdocs/stripe/class/stripe.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/stripe/class/stripe.class.php b/htdocs/stripe/class/stripe.class.php index 4e534276c47..2198493d0fd 100644 --- a/htdocs/stripe/class/stripe.class.php +++ b/htdocs/stripe/class/stripe.class.php @@ -430,7 +430,8 @@ class Stripe extends CommonObject if ($off_session) { unset($dataforintent['setup_future_usage']); - $dataforintent["setup_future_usage"] = "off_session"; + //$dataforintent["setup_future_usage"] = "off_session"; + $dataforintent["off_session"] = true; } if (!is_null($payment_method)) { From 62622a206579ccdde1cfaf8d27d0684a4e12f63d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 28 Jan 2021 23:16:24 +0100 Subject: [PATCH 33/37] Fix: It was no more possible to create paymentintent for offline payment --- htdocs/stripe/class/stripe.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/stripe/class/stripe.class.php b/htdocs/stripe/class/stripe.class.php index a691b7bff40..9f44645d3a0 100644 --- a/htdocs/stripe/class/stripe.class.php +++ b/htdocs/stripe/class/stripe.class.php @@ -431,7 +431,8 @@ class Stripe extends CommonObject if ($off_session) { unset($dataforintent['setup_future_usage']); - $dataforintent["setup_future_usage"] = "off_session"; + //$dataforintent["setup_future_usage"] = "off_session"; + $dataforintent["off_session"] = true; } if (!is_null($payment_method)) { From 6ed3a1c227a5c60cfb4e4a17fbb6a022a9850663 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 28 Jan 2021 23:18:10 +0100 Subject: [PATCH 34/37] Fix idempotencey make stripe payment fails --- htdocs/stripe/class/stripe.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/stripe/class/stripe.class.php b/htdocs/stripe/class/stripe.class.php index 2198493d0fd..e1ee0138287 100644 --- a/htdocs/stripe/class/stripe.class.php +++ b/htdocs/stripe/class/stripe.class.php @@ -321,7 +321,7 @@ class Stripe extends CommonObject * @param string $noidempotency_key Do not use the idempotency_key when creating the PaymentIntent * @return \Stripe\PaymentIntent|null Stripe PaymentIntent or null if not found and failed to create */ - public function getPaymentIntent($amount, $currency_code, $tag, $description = '', $object = null, $customer = null, $key = null, $status = 0, $usethirdpartyemailforreceiptemail = 0, $mode = 'automatic', $confirmnow = false, $payment_method = null, $off_session = 0, $noidempotency_key = 0) + public function getPaymentIntent($amount, $currency_code, $tag, $description = '', $object = null, $customer = null, $key = null, $status = 0, $usethirdpartyemailforreceiptemail = 0, $mode = 'automatic', $confirmnow = false, $payment_method = null, $off_session = 0, $noidempotency_key = 1) { global $conf, $user; From 83dc1e8cd088313721487601a8abce3755c3eaea Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 28 Jan 2021 23:27:01 +0100 Subject: [PATCH 35/37] Fix responsive --- htdocs/societe/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index a4ad5ec590e..402e85d9b39 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -1259,7 +1259,7 @@ while ($i < min($num, $limit)) if (!empty($arrayfields['s.fk_prospectlevel']['checked'])) { // Prospect level - print '
'; + print ''; print $companystatic->getLibProspLevel(); print "'; + print ''; print $companystatic->getLibProspLevel(); print "'; + print ''; if ($companystatic->fk_parent > 0) { $companyparent->fetch($companystatic->fk_parent); From 215e36bb2ef791d148e1e014c87f9021e983314f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 29 Jan 2021 11:19:33 +0100 Subject: [PATCH 37/37] Fix typo --- htdocs/langs/en_US/errors.lang | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang index 5634905da6e..a7a7e12db14 100644 --- a/htdocs/langs/en_US/errors.lang +++ b/htdocs/langs/en_US/errors.lang @@ -59,6 +59,7 @@ ErrorDirNotFound=Directory %s not found (Bad path, wrong permissions or a ErrorFunctionNotAvailableInPHP=Function %s is required for this feature but is not available in this version/setup of PHP. ErrorDirAlreadyExists=A directory with this name already exists. ErrorFileAlreadyExists=A file with this name already exists. +ErrorDestinationAlreadyExists=Another file with the name %s already exists. ErrorPartialFile=File not received completely by server. ErrorNoTmpDir=Temporary directy %s does not exists. ErrorUploadBlockedByAddon=Upload blocked by a PHP/Apache plugin.