Fix bug debian 786479

This commit is contained in:
Laurent Destailleur 2015-05-22 17:13:32 +02:00
parent e8fb89f89f
commit dcc197eb6b
2 changed files with 45 additions and 5 deletions

View File

@ -494,6 +494,27 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G
}
}
if ($_POST['sendtocc'])
{
// Le destinataire a ete fourni via le champ libre
$sendtocc = $_POST['sendtocc'];
$sendtoccid = 0;
}
elseif ($_POST['receivercc'] != '-1')
{
// Recipient was provided from combo list
if ($_POST['receivercc'] == 'thirdparty') // Id of third party
{
$sendtocc = $object->client->email;
$sendtoccid = 0;
}
else // Id du contact
{
$sendtocc = $object->client->contact_get_property($_POST['receivercc'],'email');
$sendtoccid = $_POST['receivercc'];
}
}
if (dol_strlen($sendto))
{
$langs->load("commercial");
@ -501,7 +522,6 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G
$from = $_POST['fromname'] . ' <' . $_POST['frommail'] .'>';
$replyto = $_POST['replytoname']. ' <' . $_POST['replytomail'].'>';
$message = $_POST['message'];
$sendtocc = $_POST['sendtocc'];
$deliveryreceipt = $_POST['deliveryreceipt'];
if (dol_strlen($_POST['subject'])) $subject = $_POST['subject'];

View File

@ -283,12 +283,12 @@ else if ($action == 'setinvoicedate' && $user->rights->facture->creer)
$object->fetch($id);
$old_date_lim_reglement=$object->date_lim_reglement;
$date=dol_mktime(12,0,0,$_POST['invoicedatemonth'],$_POST['invoicedateday'],$_POST['invoicedateyear']);
if (empty($date))
if (empty($date))
{
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Date")),'errors');
header('Location: '.$_SERVER["PHP_SELF"].'?facid='.$id.'&action=editinvoicedate');
exit;
}
$object->date=$date;
$new_date_lim_reglement=$object->calculate_date_lim_reglement();
@ -1712,6 +1712,27 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO
}
}
if ($_POST['sendtocc'])
{
// Le destinataire a ete fourni via le champ libre
$sendtocc = $_POST['sendtocc'];
$sendtoccid = 0;
}
elseif ($_POST['receivercc'] != '-1')
{
// Recipient was provided from combo list
if ($_POST['receivercc'] == 'thirdparty') // Id of third party
{
$sendtocc = $object->client->email;
$sendtoccid = 0;
}
else // Id du contact
{
$sendtocc = $object->client->contact_get_property($_POST['receivercc'],'email');
$sendtoccid = $_POST['receivercc'];
}
}
if (dol_strlen($sendto))
{
$langs->load("commercial");
@ -1719,7 +1740,6 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO
$from = $_POST['fromname'] . ' <' . $_POST['frommail'] .'>';
$replyto = $_POST['replytoname']. ' <' . $_POST['replytomail'].'>';
$message = $_POST['message'];
$sendtocc = $_POST['sendtocc'];
$deliveryreceipt = $_POST['deliveryreceipt'];
if ($action == 'send')
@ -3810,7 +3830,7 @@ else if ($id > 0 || ! empty($ref))
// Linked object block
$somethingshown=$object->showLinkedObjectBlock();
if (empty($somethingshown) && ! empty($conf->commande->enabled))
if (empty($somethingshown) && ! empty($conf->commande->enabled))
{
print '<br><a href="#" id="linktoorder">' . $langs->trans('LinkedOrder') . '</a>';