diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php
index 0e36a668e80..caea7e64f4c 100644
--- a/htdocs/admin/mails.php
+++ b/htdocs/admin/mails.php
@@ -67,7 +67,7 @@ if (isset($_POST["action"]) && $_POST["action"] == 'update')
if ($_POST['addfile'] || $_POST['addfilehtml'])
{
// Set tmp user directory
- $vardir=$conf->users->dir_output."/".$user->id;
+ $vardir=$conf->user->dir_output."/".$user->id;
$upload_dir = $vardir.'/temp/';
if (! empty($_FILES['addedfile']['tmp_name']))
diff --git a/htdocs/comm/mailing/fiche.php b/htdocs/comm/mailing/fiche.php
index 19ab524faec..853bd789033 100644
--- a/htdocs/comm/mailing/fiche.php
+++ b/htdocs/comm/mailing/fiche.php
@@ -599,7 +599,7 @@ else
// Status
print '
';
print $langs->trans("TotalNbOfDistinctRecipients");
@@ -716,6 +716,7 @@ else
$formmail->withfrom=0;
$formmail->withto=$user->email?$user->email:1;
$formmail->withtocc=0;
+ $formmail->withtoccc=$conf->global->MAIN_EMAIL_USECCC;
$formmail->withtopic=0;
$formmail->withtopicreadonly=1;
$formmail->withfile=0;
diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php
index caea6c52d2a..1945596a615 100644
--- a/htdocs/comm/propal.php
+++ b/htdocs/comm/propal.php
@@ -366,7 +366,7 @@ if ($_REQUEST['action'] == 'setstatut' && $user->rights->propale->cloturer)
if ($_POST['addfile'])
{
// Set tmp user directory
- $vardir=$conf->users->dir_output."/".$user->id;
+ $vardir=$conf->user->dir_output."/".$user->id;
$upload_dir = $vardir.'/temp/';
if (! empty($_FILES['addedfile']['tmp_name']))
@@ -809,7 +809,7 @@ if ($_REQUEST['action'] == 'builddoc' && $user->rights->propale->creer)
}
else
{
- Header ('Location: '.$_SERVER["PHP_SELF"].'?propalid='.$propal->id.'#builddoc');
+ Header ('Location: '.$_SERVER["PHP_SELF"].'?propalid='.$propal->id.(empty($conf->global->MAIN_JUMP_TAG)?'':'#builddoc'));
exit;
}
}
@@ -1897,12 +1897,6 @@ if ($id > 0 || ! empty($ref))
print ' ';
print_titre($langs->trans('SendPropalByMail'));
- $liste[0]=" ";
- foreach ($societe->thirdparty_and_contact_email_array() as $key=>$value)
- {
- $liste[$key]=$value;
- }
-
// Create form object
include_once('../html.formmail.class.php');
$formmail = new FormMail($db);
@@ -1911,8 +1905,12 @@ if ($id > 0 || ! empty($ref))
$formmail->fromname = $user->fullname;
$formmail->frommail = $user->email;
$formmail->withfrom=1;
- $formmail->withto=$liste;
+ $formmail->withto=empty($_POST["sendto"])?1:$_POST["sendto"];
+ $formmail->withtosocid=$societe->id;
$formmail->withtocc=1;
+ $formmail->withtoccsocid=0;
+ $formmail->withtoccc=$conf->global->MAIN_EMAIL_USECCC;
+ $formmail->withtocccsocid=0;
$formmail->withtopic=$langs->trans('SendPropalRef','__PROPREF__');
$formmail->withfile=2;
$formmail->withbody=1;
diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php
index 5b9a0544f54..a12bf89bdcf 100644
--- a/htdocs/commande/fiche.php
+++ b/htdocs/commande/fiche.php
@@ -668,7 +668,7 @@ if ($_REQUEST['action'] == 'builddoc') // In get or post
}
else
{
- Header ('Location: '.$_SERVER["PHP_SELF"].'?id='.$commande->id.'#builddoc');
+ Header ('Location: '.$_SERVER["PHP_SELF"].'?id='.$commande->id.(empty($conf->global->MAIN_JUMP_TAG)?'':'#builddoc'));
exit;
}
}
@@ -693,7 +693,7 @@ if ($_REQUEST['action'] == 'remove_file')
if ($_POST['addfile'])
{
// Set tmp user directory
- $vardir=$conf->users->dir_output."/".$user->id;
+ $vardir=$conf->user->dir_output."/".$user->id;
$upload_dir = $vardir.'/temp/';
if (! empty($_FILES['addedfile']['tmp_name']))
@@ -2103,15 +2103,6 @@ else
print ' ';
print_titre($langs->trans('SendOrderByMail'));
- $soc = new Societe($db);
- $soc->fetch($commande->socid);
-
- $liste[0]=" ";
- foreach ($soc->thirdparty_and_contact_email_array() as $key=>$value)
- {
- $liste[$key]=$value;
- }
-
// Cree l'objet formulaire mail
include_once(DOL_DOCUMENT_ROOT.'/html.formmail.class.php');
$formmail = new FormMail($db);
@@ -2120,8 +2111,12 @@ else
$formmail->fromname = $user->fullname;
$formmail->frommail = $user->email;
$formmail->withfrom=1;
- $formmail->withto=$liste;
+ $formmail->withto=empty($_POST["sendto"])?1:$_POST["sendto"];
+ $formmail->withtosocid=$soc->id;
$formmail->withtocc=1;
+ $formmail->withtoccsocid=0;
+ $formmail->withtoccc=$conf->global->MAIN_EMAIL_USECCC;
+ $formmail->withtocccsocid=0;
$formmail->withtopic=$langs->trans('SendOrderRef','__ORDERREF__');
$formmail->withfile=2;
$formmail->withbody=1;
diff --git a/htdocs/compta/dons/fiche.php b/htdocs/compta/dons/fiche.php
index cbb4738101f..bbfe116ee81 100644
--- a/htdocs/compta/dons/fiche.php
+++ b/htdocs/compta/dons/fiche.php
@@ -183,7 +183,7 @@ if ($_REQUEST['action'] == 'builddoc')
}
else
{
- Header ('Location: '.$_SERVER["PHP_SELF"].'?rowid='.$donation->id.'#builddoc');
+ Header ('Location: '.$_SERVER["PHP_SELF"].'?rowid='.$donation->id.(empty($conf->global->MAIN_JUMP_TAG)?'':'#builddoc'));
exit;
}
}
diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php
index c708d0ab8cc..d09f6a360fa 100644
--- a/htdocs/compta/facture.php
+++ b/htdocs/compta/facture.php
@@ -1117,7 +1117,7 @@ if ($_GET['action'] == 'down' && $user->rights->facture->creer)
if ($_POST['addfile'])
{
// Set tmp user directory
- $vardir=$conf->users->dir_output."/".$user->id;
+ $vardir=$conf->user->dir_output."/".$user->id;
$upload_dir = $vardir.'/temp/';
if (! empty($_FILES['addedfile']['tmp_name']))
@@ -1342,7 +1342,7 @@ if ($_REQUEST['action'] == 'builddoc') // En get ou en post
}
else
{
- Header ('Location: '.$_SERVER["PHP_SELF"].'?facid='.$fac->id.'#builddoc');
+ Header ('Location: '.$_SERVER["PHP_SELF"].'?facid='.$fac->id.(empty($conf->global->MAIN_JUMP_TAG)?'':'#builddoc'));
exit;
}
}
@@ -3510,12 +3510,6 @@ else
print ' ';
print_titre($langs->trans('SendBillByMail'));
- $liste[0]=' ';
- foreach ($soc->thirdparty_and_contact_email_array() as $key=>$value)
- {
- $liste[$key]=$value;
- }
-
// Cree l'objet formulaire mail
include_once(DOL_DOCUMENT_ROOT.'/html.formmail.class.php');
$formmail = new FormMail($db);
@@ -3524,9 +3518,12 @@ else
$formmail->fromname = $user->fullname;
$formmail->frommail = $user->email;
$formmail->withfrom=1;
- $formmail->withto=$liste;
+ $formmail->withto=empty($_POST["sendto"])?1:$_POST["sendto"];
+ $formmail->withtosocid=$soc->id;
$formmail->withtocc=1;
- $formmail->withtoccc=$conf->global->FACTURE_EMAIL_USECCC;
+ $formmail->withtoccsocid=0;
+ $formmail->withtoccc=$conf->global->MAIN_EMAIL_USECCC;
+ $formmail->withtocccsocid=0;
$formmail->withtopic=$langs->transnoentities('SendBillRef','__FACREF__');
$formmail->withfile=2;
$formmail->withbody=1;
@@ -3534,7 +3531,7 @@ else
$formmail->withcancel=1;
// Tableau des substitutions
$formmail->substit['__FACREF__']=$fac->ref;
- // Tableau des param�tres compl�mentaires du post
+ // Tableau des parametres complementaires du post
$formmail->param['action']='send';
$formmail->param['models']='facture_send';
$formmail->param['facid']=$fac->id;
diff --git a/htdocs/compta/paiement/cheque/fiche.php b/htdocs/compta/paiement/cheque/fiche.php
index 679d43c74fc..124b36c3b62 100644
--- a/htdocs/compta/paiement/cheque/fiche.php
+++ b/htdocs/compta/paiement/cheque/fiche.php
@@ -149,7 +149,7 @@ if ($_POST['action'] == 'builddoc' && $user->rights->banque->cheque)
}
else
{
- Header ('Location: '.$_SERVER["PHP_SELF"].'?id='.$remisecheque->id.'#builddoc');
+ Header ('Location: '.$_SERVER["PHP_SELF"].'?id='.$remisecheque->id.(empty($conf->global->MAIN_JUMP_TAG)?'':'#builddoc'));
exit;
}
}
diff --git a/htdocs/fourn/commande/fiche.php b/htdocs/fourn/commande/fiche.php
index 9762e5ffaac..961c1696012 100644
--- a/htdocs/fourn/commande/fiche.php
+++ b/htdocs/fourn/commande/fiche.php
@@ -417,7 +417,7 @@ if ($_REQUEST['action'] == 'builddoc') // En get ou en post
}
else
{
- Header ('Location: '.$_SERVER["PHP_SELF"].'?id='.$commande->id.'#builddoc');
+ Header ('Location: '.$_SERVER["PHP_SELF"].'?id='.$commande->id.(empty($conf->global->MAIN_JUMP_TAG)?'':'#builddoc'));
exit;
}
}
diff --git a/htdocs/html.formfile.class.php b/htdocs/html.formfile.class.php
index 43bdb11974b..59f6a776bcf 100644
--- a/htdocs/html.formfile.class.php
+++ b/htdocs/html.formfile.class.php
@@ -291,7 +291,7 @@ class FormFile
$buttonlabeltoshow=$buttonlabel;
if (empty($buttonlabel)) $buttonlabel=$langs->trans('Generate');
- if (empty($noform)) print ' |
\n";
@@ -308,10 +317,18 @@ class FormMail
else
{
print "