Commit 8163b1cf authored by david.verdin's avatar david.verdin
Browse files

[feature][Submitted by J. Jourdan] Integrating the web page sender to the trunk.


git-svn-id: https://subversion.renater.fr/sympa/trunk@5686 05aa8bb8-cd2b-0410-b1d7-8918dfa770ce
parent 166a1040
......@@ -53,6 +53,8 @@ use CPAN;
'Net::Netmask' => '1.9015',
'Term::ProgressBar' => '2.09',
'Time::HiRes' => '1.9719',
'MIME::Lite' => '3.024',
'MIME::Lite::HTML' => '1.23',
);
### key:left "module" used by SYMPA,
......@@ -86,6 +88,8 @@ use CPAN;
'HTML::FormatText' => 'HTML-Format',
'Term::ProgressBar' => 'Term-ProgressBar',
'Time::HiRes' => 'Time-HiRes',
'MIME::Lite' => 'MIME-Lite',
'MIME::Lite::HTML' => 'MIME-Lite-HTML',
);
%opt_CPAN = ('DBD::Pg' => 'DBD-Pg',
......
......@@ -3079,7 +3079,9 @@ sub send_file {
$data->{'boundary'} = '----------=_'.&tools::get_message_id($robot) unless ($data->{'boundary'});
unless (&mail::mail_file($filename, $who, $data, $self->{'domain'}, $sign_mode)) {
$data->{'sign_mode'} = $sign_mode;
unless (&mail::mail_file($filename, $who, $data, $self->{'domain'})) {
&do_log('err',"List::send_file, could not send template $filename to $who");
return undef;
}
......
......@@ -109,13 +109,17 @@ sub set_send_spool {
# OUT : 1 | undef
####################################################
sub mail_file {
my ($filename, $rcpt, $data,$robot,$sign_mode) = @_;
my ($filename, $rcpt, $data, $robot) = @_;
my $header_possible = $data->{'header_possible'};
my $sign_mode = $data->{'sign_mode'};
&do_log('debug2', 'mail::mail_file(%s, %s, %s)', $filename, $rcpt, $sign_mode);
my ($to,$message);
## boolean
my $header_possible = 0; # =1 : it is possible there are some headers
$header_possible = 0 unless (defined $header_possible);
my %header_ok; # hash containing no missing headers
my $existing_headers = 0;# the message already contains headers
......@@ -146,6 +150,7 @@ sub mail_file {
## ## Does the message include headers ?
if ($header_possible) {
foreach my $line (split(/\n/,$message)) {
last if ($line=~/^\s*$/);
......
<!-- $Id$ -->
<div class="block">
<h2>[%|loc%]Sendind a message to the list[%END%] <a class="input" href="[% path_cgi %]/nomenu/help/sendmsg" title="[%|loc%]Open in a new window[%END%]" onclick="window.open('','wws_help','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=400,height=200')" target="wws_help">[%|loc%]Help[%END%]</a></h2>
<br />
[% IF !subaction %]
<h2>[%|loc%]Sendind a message to the list[%END%] <a class="input" href="[% path_cgi %]/nomenu/help/sendmsg" title="[%|loc%]Open in a new window[%END%]" onclick="window.open('','wws_help','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=400,height=200')" target="wws_help">[%|loc%]Help[%END%]</a></h3>
<br />
[% END %]
<form class="noborder" action="[% path_cgi %]" method="post" name="compose_mail">
<fieldset>
[%|loc(user.email)%]From: %1[%END%]<br />
[%|loc(mailto)%]To: %1[%END%]<br />
<label for="subject">[%|loc%]Subject:[%END%] <input id="subject" type="text" size="45" name="subject" value="[% subject %]" /></label>
<input class="MainMenuLinks" type="submit" name="action_send_mail" value="[%|loc%]Send this mail[%END%]" [%- IF topic_required -%] onclick="return checkbox_check_topic(compose_mail)" [% END %]/>
<br />
<input type="hidden" name="in_reply_to" value="[% in_reply_to %]" />
<input type="hidden" name="message_id" value="[% message_id %]" />
<input type="hidden" name="list" value="[% list %]" />
[% SET counter = 0 %]
[% SET stringto = '' %]
[% FOREACH r = recipients %]
[% IF counter == 0 %]
[% stringto = r.value.local_to _ ' ' _ r.value.domain_to %]
[% counter = 1 %]
[% ELSE %]
[% stringto = stringto _ ',' _ r.value.local_to _ ' ' _ r.value.domain_to %]
[% END %]
[% IF subaction == "html_news_letter" %]
<h2>[%|loc%]Sending an html page to the list [%END%] <a class="input" href="[% path_cgi %]/nomenu/help/sendmsg" title="[%|loc%]Open in a new window[%END%]" onclick="window.open('','wws_help','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=400,height=200')" target="wws_help">[%|loc%]Help[%END%]</a></h3>
<br />
[% END %]
<input type="hidden" name="to" value="[% stringto %]" />
[% IF request_topic %]
<br /><br />
[%|loc%]This list is configured to require topic(s).[%END%]
<br />
[%|loc%]Please select one or more topic(s) that corresponds to your message :[%END%]
<br /><br />
[% FOREACH t = available_topics %]
<input type="checkbox" name="topic_[%t.name%]" value="1"/> [% t.title %]
<br />
[% END %]
<br />
[% END %]
<textarea name="body" cols="80" rows="25">
</textarea>
</fieldset>
<fieldset>
[%|loc(user.email)%]From: %1[%END%]<br />
[%|loc(mailto)%]To: %1[%END%]<br />
<label for="subject">[%|loc%]Subject:[%END%] <input id="subject" type="text" size="45" name="subject" value="[% subject %]" /></label>
[% IF subaction == "html_news_letter" %]
<input type="hidden" name="html_news_letter" value="[% subaction %]" />
[% END %]
<input type="hidden" name="action" value="send_mail"/>
<input class="MainMenuLinks" type="submit" name="sub_action_sendmailtolist" value="Send to the list" [%- IF topic_required -%] onclick="return checkbox_check_topic(compose_mail)" [% END %]/>
<input class="MainMenuLinks" type="submit" name="sub_action_sendmailtome" value="Send to me" [%- IF topic_required -%] onclick="return checkbox_check_topic(compose_mail)" [% END %]/>
<br />
<input type="hidden" name="in_reply_to" value="[% in_reply_to %]" />
<input type="hidden" name="message_id" value="[% message_id %]" />
<input type="hidden" name="list" value="[% list %]" />
[% SET counter = 0 %]
[% SET stringto = '' %]
[% FOREACH r = recipients %]
[% IF counter == 0 %]
[% stringto = r.value.local_to _ ' ' _ r.value.domain_to %]
[% counter = 1 %]
[% ELSE %]
[% stringto = stringto _ ',' _ r.value.local_to _ ' ' _ r.value.domain_to %]
[% END %]
[% END %]
<input type="hidden" name="to" value="[% stringto %]" />
[% IF request_topic %]
<br />
[%|loc%]This list is configured to require topic(s).[%END%]
<br />
[%|loc%]Please select one or more topic(s) that corresponds to your message :[%END%]
<br />
[% FOREACH t = available_topics %]
<input type="checkbox" name="topic_[%t.name%]" value="1"/> [% t.title %]
<br />
[% END %]
<br />
[% END %]
[% IF !subaction %]
<textarea name="body" cols="80" rows="25"></textarea>
[% END %]
[% IF subaction == "html_news_letter" %]
<label for="url">[%|loc%]Url :[%END%] <input id="url" type="text" size="45" name="url" value="[% url %]" /></label>
<br /><br />
[% END %]
</fieldset>
</form>
</div>
......
......@@ -104,8 +104,17 @@
</ul>
</div>
[% END %]
[% END %]
[% IF action == 'compose_mail' %]
<div id="nav">
<ul>
[% IF subaction == '' %][% SET class = 'MainMenuLinksCurrentPage' %][% ELSE %][% SET class = 'MainMenuLinks' %][% END %]
<li class="[% class %]"><a href="[% path_cgi %]/compose_mail/[% list %]">[%|loc%]Send a message[%END%]</a></li>
[% IF subaction == 'html_news_letter' %][% SET class = 'MainMenuLinksCurrentPage' %][% ELSE %][% SET class = 'MainMenuLinks' %][% END %]
<li class="[% class %]"><a href="[% path_cgi %]/compose_mail/[% list %]/html_news_letter">[%|loc%]Send an html page[%END%]</a></li>
</ul>
</div>
[% END %]
<!-- end nav.tt2 -->
\ No newline at end of file
No preview for this file type
Supports Markdown
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