Fix: Lost field

This commit is contained in:
Laurent Destailleur 2011-03-28 08:57:54 +00:00
parent c0b5a25430
commit c4f40462d1

View File

@ -602,9 +602,9 @@ else
$formmail->withsubstit=0; $formmail->withsubstit=0;
$formmail->withfrom=1; $formmail->withfrom=1;
$formmail->witherrorsto=1; $formmail->witherrorsto=1;
$formmail->withto=(isset($_POST['sendto'])?$_POST['sendto']:$user->email?$user->email:1); $formmail->withto=(! empty($_POST['sendto'])?$_POST['sendto']:($user->email?$user->email:1));
$formmail->withtocc=(isset($_POST['sendtocc'])?$_POST['sendtocc']:1); $formmail->withtocc=(! empty($_POST['sendtocc'])?$_POST['sendtocc']:1); // ! empty to keep field if empty
$formmail->withtoccc=(isset($_POST['sendtoccc'])?$_POST['sendtoccc']:1); $formmail->withtoccc=(! empty($_POST['sendtoccc'])?$_POST['sendtoccc']:1); // ! empty to keep field if empty
$formmail->withtopic=(isset($_POST['subject'])?$_POST['subject']:$langs->trans("Test")); $formmail->withtopic=(isset($_POST['subject'])?$_POST['subject']:$langs->trans("Test"));
$formmail->withtopicreadonly=0; $formmail->withtopicreadonly=0;
$formmail->withfile=2; $formmail->withfile=2;
@ -647,9 +647,9 @@ else
$formmail->withsubstit=0; $formmail->withsubstit=0;
$formmail->withfrom=1; $formmail->withfrom=1;
$formmail->witherrorsto=1; $formmail->witherrorsto=1;
$formmail->withto=(isset($_POST['sendto'])?$_POST['sendto']:$user->email?$user->email:1); $formmail->withto=(! empty($_POST['sendto'])?$_POST['sendto']:($user->email?$user->email:1));
$formmail->withtocc=(isset($_POST['sendtocc'])?$_POST['sendtocc']:1); $formmail->withtocc=(! empty($_POST['sendtocc'])?$_POST['sendtocc']:1); // ! empty to keep field if empty
$formmail->withtoccc=(isset($_POST['sendtoccc'])?$_POST['sendtoccc']:1); $formmail->withtoccc=(! empty($_POST['sendtoccc'])?$_POST['sendtoccc']:1); // ! empty to keep field if empty
$formmail->withtopic=(isset($_POST['subject'])?$_POST['subject']:$langs->trans("Test")); $formmail->withtopic=(isset($_POST['subject'])?$_POST['subject']:$langs->trans("Test"));
$formmail->withtopicreadonly=0; $formmail->withtopicreadonly=0;
$formmail->withfile=2; $formmail->withfile=2;