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";
?>
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").
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 = '