Commit 026808ed authored by marclaporte's avatar marclaporte

[MRG] Automatic merge, branches/7.x 35940 to 35996

parent 8d3ab80d
......@@ -81,16 +81,18 @@ class Messu extends TikiLib
}
$mail_data = $smarty->fetchLang($lg, 'mail/messu_message_notification.tpl');
$mail->setText($mail_data);
$from_email = $userlib->get_user_email($from);
if ($bcc_sender === 'y' && !empty($from_email)) {
$mail->setHeader("Bcc", $from_email);
}
if ($replyto_email !== 'y' && $userlib->get_user_preference($from,'email is public','n') == 'n') {
$from_email = ''; // empty $from_email if not to be used - saves getting it twice
}
if (!empty($from_email)) {
$mail->setHeader("Reply-To", $from_email);
if ($userlib->user_exists($from)) {
$from_email = $userlib->get_user_email($from);
if ($bcc_sender === 'y' && !empty($from_email)) {
$mail->setHeader("Bcc", $from_email);
}
if ($replyto_email !== 'y' && $userlib->get_user_preference($from,'email is public','n') == 'n') {
$from_email = ''; // empty $from_email if not to be used - saves getting it twice
}
if (!empty($from_email)) {
$mail->setHeader("Reply-To", $from_email);
}
}
if (!empty($prefs['sender_email'])) {
$mail->setHeader("From", $prefs['sender_email']);
......@@ -98,8 +100,9 @@ class Messu extends TikiLib
$mail->setHeader("From", $from_email);
}
if (!$mail->send(array($email), 'mail'))
if (!$mail->send(array($email), 'mail')) {
return false; //TODO echo $mail->errors;
}
}
}
return true;
......
{* $Id$ *}
{if $prefs.feature_canonical_url eq 'y'}
{if $mid eq 'tiki-show_page.tpl'}
{if $mid eq 'tiki-show_page.tpl' or 'tiki-index_p.tpl'}
<link rel="canonical" href="{$base_url}{$page|sefurl}" />
{elseif $mid eq 'tiki-view_tracker_item.tpl'}
<link rel="canonical" href="{$base_url}{$itemId|sefurl:trackeritem}" />
......
{$mail_body}
{tr}A new message was posted to you at {$mail_machine}{/tr}
{tr}Date:{/tr} {$mail_date|tiki_short_datetime}
......@@ -40,7 +40,7 @@
<tr>
<td>{tr}Message:{/tr}</td>
<td>
{textarea rows="20" name="body" cols="80" _simple='y'}{$body}{/textarea}
{textarea rows="20" name="body" cols="80" _simple='y' _toolbars='n' }{$body}{/textarea}
</td>
</tr>
{if $prefs.feature_antibot eq 'y' && $user eq ''}
......
......@@ -15,6 +15,8 @@ $access->check_feature(array('feature_contact', 'feature_messages'));
$auto_query_args = array();
$smarty->assign('mid', 'tiki-contact.tpl');
if ($user == '') {
$access->check_feature('contact_anon');
......@@ -28,12 +30,12 @@ if ($user == '') {
if (empty($_REQUEST['subject']) && empty($_REQUEST['body']) || empty($_REQUEST['from'])) {
$smarty->assign('message', tra('ERROR: you must include a subject or a message. You must also make sure to have a valid e-mail in the FROM field'));
$smarty->assign('priority', $_REQUEST['priority']);
if (!empty($_REQUEST['from'])) $smarty->assign_by_ref('from', $_REQUEST['from']);
if (!empty($_REQUEST['subject'])) $smarty->assign_by_ref('subject', $_REQUEST['subject']);
if (!empty($_REQUEST['body'])) $smarty->assign_by_ref('body', $_REQUEST['body']);
if (!empty($_REQUEST['priority'])) $smarty->assign_by_ref('priority', $_REQUEST['priority']);
$smarty->display("tiki.tpl");
die;
}
......@@ -50,8 +52,9 @@ if ($user == '') {
}
}
$smarty->assign('sent', 1);
$body = tr("%0 sent you a message:", $_REQUEST['from']) . "\n" . $_REQUEST['body'];
$messulib->post_message($prefs['contact_user'], $_REQUEST['from'], $_REQUEST['to'],
'', $_REQUEST['subject'], $_REQUEST['body'], $_REQUEST['priority']);
'', $_REQUEST['subject'], $body, $_REQUEST['priority']);
$message = tra('Message sent to'). ': ' . $prefs['contact_user'] . '<br />';
$smarty->assign('message', $message);
}
......@@ -75,8 +78,9 @@ if ($user == '') {
}
$smarty->assign('sent', 1);
$message = tra('Message sent to'). ': ' . $prefs['contact_user'] . '<br />';
$body = tra("{$user} sent you a message:") . "\n" . $_REQUEST['body'];
$messulib->post_message($prefs['contact_user'], $user, $_REQUEST['to'],
'', $_REQUEST['subject'], $_REQUEST['body'], $_REQUEST['priority']);
'', $_REQUEST['subject'], $body, $_REQUEST['priority']);
$smarty->assign('message', $message);
}
......@@ -91,5 +95,4 @@ $smarty->assign('email', $email);
$smarty->assign('priority', 3);
ask_ticket('contact');
$smarty->assign('mid', 'tiki-contact.tpl');
$smarty->display("tiki.tpl");
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment