From c266681379762dc853c6ba568418f598a384b5a0 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Fri, 24 Feb 2023 11:32:56 +0100 Subject: [PATCH 1/8] fix : Warning: Constant DOL_URL_ROOT already defined in /home/httpd/vhosts/aflac.fr/domains/dev.aflac.fr/httpdocs/core/filemanagerdol/connectors/php/config.inc.php on line 40 --- htdocs/core/filemanagerdol/connectors/php/config.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/filemanagerdol/connectors/php/config.inc.php b/htdocs/core/filemanagerdol/connectors/php/config.inc.php index 848153d84fc..368b82c42e7 100644 --- a/htdocs/core/filemanagerdol/connectors/php/config.inc.php +++ b/htdocs/core/filemanagerdol/connectors/php/config.inc.php @@ -37,7 +37,7 @@ $pos = strstr($uri, '/'); // $pos contient alors url sans nom domaine if ($pos == '/') { $pos = ''; // si $pos vaut /, on le met a '' } -define('DOL_URL_ROOT', $pos); +//define('DOL_URL_ROOT', $pos); $entity = ((!empty($_SESSION['dol_entity']) && $_SESSION['dol_entity'] > 1) ? $_SESSION['dol_entity'] : null); // SECURITY: You must explicitly enable this "connector". (Set it to "true"). From 2a16db0e860fe5aa5705f4532630c969f2fbc81b Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Fri, 24 Feb 2023 11:35:07 +0100 Subject: [PATCH 2/8] fix : Warning: Undefined variable in /home/httpd/vhosts/aflac.fr/domains/dev.aflac.fr/httpdocs/core/filemanagerdol/browser/default/browser.php on line 52 --- htdocs/core/filemanagerdol/browser/default/browser.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/filemanagerdol/browser/default/browser.php b/htdocs/core/filemanagerdol/browser/default/browser.php index 0c1b29d12b2..1cf6d8612c2 100644 --- a/htdocs/core/filemanagerdol/browser/default/browser.php +++ b/htdocs/core/filemanagerdol/browser/default/browser.php @@ -49,6 +49,7 @@ if (!empty($conf->modules_parts['theme'])) { // This slow down } //print 'themepath='.$themepath.' themeparam='.$themeparam;exit; +$themeparam = ''; print ''."\n"; ?> From 904babed3ecb0cd78b8918a2ca768ba0e7f1ff14 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 24 Feb 2023 13:28:19 +0100 Subject: [PATCH 3/8] Fix filter on warehouse must not be visible on stock at date in future --- htdocs/product/stock/stockatdate.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/htdocs/product/stock/stockatdate.php b/htdocs/product/stock/stockatdate.php index 69893559dfa..1f9b82a4392 100644 --- a/htdocs/product/stock/stockatdate.php +++ b/htdocs/product/stock/stockatdate.php @@ -361,10 +361,14 @@ print img_picto('', 'product', 'class="pictofiwedwidth"').' '; print ' '; print $form->select_produits($productid, 'productid', '', 0, 0, -1, 2, '', 0, array(), 0, $langs->trans('Product'), 0, 'maxwidth300', 0, '', null, 1); -print '   '; -print img_picto('', 'stock', 'class="pictofiwedwidth"'); -print ' '; -print $formproduct->selectWarehouses((GETPOSTISSET('fk_warehouse') ? $fk_warehouse : 'ifonenodefault'), 'fk_warehouse', '', 1, 0, 0, $langs->trans('Warehouse'), 0, 0, null, '', null, 1, false, 'e.ref'); +if ($mode != 'future') { + // A virtual stock in future has no sense on a per warehouse view, so no filter on warehouse is available for stock at date in future + print '   '; + print img_picto('', 'stock', 'class="pictofiwedwidth"'); + print ' '; + print $formproduct->selectWarehouses((GETPOSTISSET('fk_warehouse') ? $fk_warehouse : 'ifonenodefault'), 'fk_warehouse', '', 1, 0, 0, $langs->trans('Warehouse'), 0, 0, null, '', null, 1, false, 'e.ref'); +} + print ''; $parameters = array(); From ad84346cae11869e3594ab5efa1b4075071a1deb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 24 Feb 2023 11:31:46 +0100 Subject: [PATCH 4/8] Fix sql error --- htdocs/product/stock/stockatdate.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/product/stock/stockatdate.php b/htdocs/product/stock/stockatdate.php index 1f9b82a4392..4138841b3bb 100644 --- a/htdocs/product/stock/stockatdate.php +++ b/htdocs/product/stock/stockatdate.php @@ -276,10 +276,10 @@ if (!empty($canvas)) { $sql .= " AND p.canvas = '".$db->escape($canvas)."'"; } if ($fk_warehouse > 0) { - $sql .= ' GROUP BY p.rowid, p.ref, p.label, p.description, p.price, p.price_ttc, p.price_base_type, p.fk_product_type, p.desiredstock, p.seuil_stock_alerte,'; + $sql .= ' GROUP BY p.rowid, p.ref, p.label, p.description, p.price, p.pmp, p.price_ttc, p.price_base_type, p.fk_product_type, p.desiredstock, p.seuil_stock_alerte,'; $sql .= ' p.tms, p.duration, p.tobuy, p.stock'; } else { - $sql .= ' GROUP BY p.rowid, p.ref, p.label, p.description, p.price, p.price_ttc, p.price_base_type, p.fk_product_type, p.desiredstock, p.seuil_stock_alerte,'; + $sql .= ' GROUP BY p.rowid, p.ref, p.label, p.description, p.price, p.pmp, p.price_ttc, p.price_base_type, p.fk_product_type, p.desiredstock, p.seuil_stock_alerte,'; $sql .= ' p.tms, p.duration, p.tobuy, p.stock'; } // Add where from hooks From a3a9d6e6a28448fde9650eff54fb4a729bf44d1c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 24 Feb 2023 11:27:14 +0100 Subject: [PATCH 5/8] CSS --- htdocs/product/reassort.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/product/reassort.php b/htdocs/product/reassort.php index f3c354b88a4..b0f6f4b3283 100644 --- a/htdocs/product/reassort.php +++ b/htdocs/product/reassort.php @@ -464,7 +464,7 @@ if ($resql) { print $product->getNomUrl(1, '', 16); //if ($objp->stock_theorique < $objp->seuil_stock_alerte) print ' '.img_warning($langs->trans("StockTooLow")); print ''; - print ''.$product->label.''; + print ''.dol_escape_htmltag($product->label).''; if (isModEnabled("service") && $type == 1) { print ''; @@ -495,7 +495,7 @@ if ($resql) { if ($nb_warehouse > 1) { foreach ($warehouses_list as &$wh) { print ''; - print price(empty($product->stock_warehouse[$wh['id']]->real) ? 0 : $product->stock_warehouse[$wh['id']]->real, 0, $langs, 1, 0); + print price(empty($product->stock_warehouse[$wh['id']]->real) ? 0 : price2num($product->stock_warehouse[$wh['id']]->real, 'MS'), 0, $langs, 1, 0); print ''; } } @@ -514,7 +514,7 @@ if ($resql) { if (!empty($conf->global->PRODUCT_USE_UNITS)) { print ''.$objp->unit_short.''; } - print ''; + print ''; print img_picto($langs->trans("StockMovement"), 'movement', 'class="pictofixedwidth"'); print ''.$langs->trans("Movements").''; print ''; From 468d05b08e3c3031b388ae6568b884de985f828a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 24 Feb 2023 18:42:53 +0100 Subject: [PATCH 6/8] Fix css --- htdocs/compta/facture/prelevement.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/compta/facture/prelevement.php b/htdocs/compta/facture/prelevement.php index 829d3b0b482..319b93c4dcb 100644 --- a/htdocs/compta/facture/prelevement.php +++ b/htdocs/compta/facture/prelevement.php @@ -935,7 +935,8 @@ if ($object->id > 0) { print $tmpuser->getNomUrl(1, '', 0, 0, 0, 0, 'login'); print ''; - print ''.price($obj->amount).''; + // Amount + print ''.price($obj->amount).''; print ''; if ($obj->fk_prelevement_bons > 0) { From 3354a27a6f085a11d6ca3e98a7e17e3bd3a3baed Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 25 Feb 2023 00:48:50 +0100 Subject: [PATCH 7/8] css --- htdocs/admin/system/security.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/admin/system/security.php b/htdocs/admin/system/security.php index 9fdc6e886b6..91de4341b49 100644 --- a/htdocs/admin/system/security.php +++ b/htdocs/admin/system/security.php @@ -553,12 +553,12 @@ if (empty($conf->global->MAIN_EXEC_USE_POPEN)) { print $conf->global->MAIN_EXEC_USE_POPEN; } if ($execmethod == 1) { - print ', "exec" PHP method will be used for shell commands'; + print '     "exec" PHP method will be used for shell commands'; print '   ('.$langs->trans("Recommended").': '.$langs->trans("Undefined").' '.$langs->trans("or").' 1)'; print ''; } if ($execmethod == 2) { - print ', "popen" PHP method will be used for shell commands'; + print '     "popen" PHP method will be used for shell commands'; print '   ('.$langs->trans("Recommended").': '.$langs->trans("Undefined").' '.$langs->trans("or").' 1)'; print ''; } From c94df95c233a55224a67d77e957653846e73e856 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 25 Feb 2023 01:54:36 +0100 Subject: [PATCH 8/8] Fix filter on email selector for thirdparties --- .../modules/mailings/thirdparties.modules.php | 98 ++++++++++--------- 1 file changed, 51 insertions(+), 47 deletions(-) diff --git a/htdocs/core/modules/mailings/thirdparties.modules.php b/htdocs/core/modules/mailings/thirdparties.modules.php index 2f8040d4b75..289433d4dc3 100644 --- a/htdocs/core/modules/mailings/thirdparties.modules.php +++ b/htdocs/core/modules/mailings/thirdparties.modules.php @@ -73,55 +73,53 @@ class mailing_thirdparties extends MailingTargets $cibles = array(); $addDescription = ""; + $addFilter = ""; + if (GETPOSTISSET("filter_client_thirdparties") && GETPOST("filter_client_thirdparties") <> '-1') { + $addFilter .= " AND s.client=".((int) GETPOST("filter_client_thirdparties", 'int')); + $addDescription = $langs->trans('ProspectCustomer')."="; + if (GETPOST("filter_client_thirdparties") == 0) { + $addDescription .= $langs->trans('NorProspectNorCustomer'); + } elseif (GETPOST("filter_client_thirdparties") == 1) { + $addDescription .= $langs->trans('Customer'); + } elseif (GETPOST("filter_client_thirdparties") == 2) { + $addDescription .= $langs->trans('Prospect'); + } elseif (GETPOST("filter_client_thirdparties") == 3) { + $addDescription .= $langs->trans('ProspectCustomer'); + } else { + $addDescription .= "Unknown status ".GETPOST("filter_client_thirdparties"); + } + } + if (GETPOSTISSET("filter_status")) { + if (strlen($addDescription) > 0) { + $addDescription .= ";"; + } + $addDescription .= $langs->trans("Status")."="; + if (GETPOST("filter_status") == '1') { + $addFilter .= " AND s.status=1"; + $addDescription .= $langs->trans("Enabled"); + } else { + $addFilter .= " AND s.status=0"; + $addDescription .= $langs->trans("Disabled"); + } + } + if (GETPOST('default_lang', 'alpha')) { + $addFilter .= " AND s.default_lang LIKE '".$this->db->escape(GETPOST('default_lang', 'alpha'))."%'"; + $addDescription = $langs->trans('DefaultLang')."="; + } + if (GETPOST('filter_lang_thirdparties', 'alpha')) { + $addFilter .= " AND s.default_lang LIKE '".$this->db->escape(GETPOST('filter_lang_thirdparties', 'alpha'))."%'"; + $addDescription = $langs->trans('DefaultLang')."="; + } + // Select the third parties from category - if (!GETPOST('filter')) { + if (!GETPOST('filter_thirdparties') || GETPOST('filter_thirdparties') == '-1') { $sql = "SELECT s.rowid as id, s.email as email, s.nom as name, null as fk_contact, null as firstname, null as label"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql .= " WHERE s.email <> ''"; $sql .= " AND s.entity IN (".getEntity('societe').")"; $sql .= " AND s.email NOT IN (SELECT email FROM ".MAIN_DB_PREFIX."mailing_cibles WHERE fk_mailing=".((int) $mailing_id).")"; - if (GETPOST('default_lang', 'alpha')) { - $sql .= " AND s.default_lang LIKE '".$this->db->escape(GETPOST('default_lang', 'alpha'))."%'"; - } + $sql .= $addFilter; } else { - $addFilter = ""; - if (GETPOSTISSET("filter_client") && GETPOST("filter_client") <> '-1') { - $addFilter .= " AND s.client=".((int) GETPOST("filter_client", 'int')); - $addDescription = $langs->trans('ProspectCustomer')."="; - if (GETPOST("filter_client") == 0) { - $addDescription .= $langs->trans('NorProspectNorCustomer'); - } elseif (GETPOST("filter_client") == 1) { - $addDescription .= $langs->trans('Customer'); - } elseif (GETPOST("filter_client") == 2) { - $addDescription .= $langs->trans('Prospect'); - } elseif (GETPOST("filter_client") == 3) { - $addDescription .= $langs->trans('ProspectCustomer'); - } else { - $addDescription .= "Unknown status ".GETPOST("filter_client"); - } - } - if (GETPOSTISSET("filter_status")) { - if (strlen($addDescription) > 0) { - $addDescription .= ";"; - } - $addDescription .= $langs->trans("Status")."="; - if (GETPOST("filter_status") == '1') { - $addFilter .= " AND s.status=1"; - $addDescription .= $langs->trans("Enabled"); - } else { - $addFilter .= " AND s.status=0"; - $addDescription .= $langs->trans("Disabled"); - } - } - if (GETPOST('default_lang', 'alpha')) { - $addFilter .= " AND s.default_lang LIKE '".$this->db->escape(GETPOST('default_lang', 'alpha'))."%'"; - $addDescription = $langs->trans('DefaultLang')."="; - } - if (GETPOST('filter_lang_thirdparties', 'alpha')) { - $addFilter .= " AND s.default_lang LIKE '".$this->db->escape(GETPOST('filter_lang_thirdparties', 'alpha'))."%'"; - $addDescription = $langs->trans('DefaultLang')."="; - } - $sql = "SELECT s.rowid as id, s.email as email, s.nom as name, null as fk_contact, null as firstname, c.label as label"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."categorie_societe as cs, ".MAIN_DB_PREFIX."categorie as c"; $sql .= " WHERE s.email <> ''"; @@ -129,8 +127,8 @@ class mailing_thirdparties extends MailingTargets $sql .= " AND s.email NOT IN (SELECT email FROM ".MAIN_DB_PREFIX."mailing_cibles WHERE fk_mailing=".((int) $mailing_id).")"; $sql .= " AND cs.fk_soc = s.rowid"; $sql .= " AND c.rowid = cs.fk_categorie"; - if (GETPOST('filter', 'int') > 0) { - $sql .= " AND c.rowid=".((int) GETPOST('filter', 'int')); + if (GETPOST('filter_thirdparties', 'int') > 0) { + $sql .= " AND c.rowid=".((int) GETPOST('filter_thirdparties', 'int')); } $sql .= $addFilter; $sql .= " UNION "; @@ -141,13 +139,15 @@ class mailing_thirdparties extends MailingTargets $sql .= " AND s.email NOT IN (SELECT email FROM ".MAIN_DB_PREFIX."mailing_cibles WHERE fk_mailing=".((int) $mailing_id).")"; $sql .= " AND cs.fk_soc = s.rowid"; $sql .= " AND c.rowid = cs.fk_categorie"; - if (GETPOST('filter', 'int') > 0) { - $sql .= " AND c.rowid=".((int) GETPOST('filter', 'int')); + if (GETPOST('filter_thirdparties', 'int') > 0) { + $sql .= " AND c.rowid=".((int) GETPOST('filter_thirdparties', 'int')); } $sql .= $addFilter; } $sql .= " ORDER BY email"; + //print $sql;exit; + // Stock recipients emails into targets table $result = $this->db->query($sql); if ($result) { @@ -243,7 +243,8 @@ class mailing_thirdparties extends MailingTargets $langs->load("companies"); - $s = ''; // Show categories $sql = "SELECT rowid, label, type, visible"; @@ -293,6 +294,7 @@ class mailing_thirdparties extends MailingTargets $s .= ' '; + // filter_client_thirdparties $s .= ' '; $s .= ajax_combobox("filter_client_thirdparties"); + // filter_status $s .= ' '; $s .= ajax_combobox("filter_status_thirdparties"); + // filter_lang_thirdparties if (getDolGlobalInt('MAIN_MULTILANGS')) { // Choose language require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';