version 1.9, 2001/07/26 21:40:27
|
version 1.11, 2001/07/28 04:16:29
|
Line 12
|
Line 12
|
# |
# |
# 10/19,10/20,10/30, |
# 10/19,10/20,10/30, |
# 02/06/01 Gerd Kortemeyer |
# 02/06/01 Gerd Kortemeyer |
|
# 07/27 Guy Albertelli |
|
# 07/27 Gerd Kortemeyer |
|
|
package Apache::lonmsg; |
package Apache::lonmsg; |
|
|
Line 151 sub user_crit_received {
|
Line 153 sub user_crit_received {
|
$contents{'subject'}.'" dated '.$contents{'time'}.".\n\n" |
$contents{'subject'}.'" dated '.$contents{'time'}.".\n\n" |
.'Message ID: '.$contents{'msgid'}); |
.'Message ID: '.$contents{'msgid'}); |
$status.=' trans: '. |
$status.=' trans: '. |
&Apache::lonnet::put('nohist_email',$contents{'msgid'} => $message); |
&Apache::lonnet::put('nohist_email',{$contents{'msgid'} => $message}); |
$status.=' del: '. |
$status.=' del: '. |
&Apache::lonnet::del('critical',[$contents{'msgid'}]); |
&Apache::lonnet::del('critical',[$contents{'msgid'}]); |
&Apache::lonnet::log($ENV{'user.domain'},$ENV{'user.name'}, |
&Apache::lonnet::log($ENV{'user.domain'},$ENV{'user.name'}, |
Line 194 sub statuschange {
|
Line 196 sub statuschange {
|
unless ($status{$msgid}) { $status{$msgid}='new'; } |
unless ($status{$msgid}) { $status{$msgid}='new'; } |
unless (($status{$msgid} eq 'replied') || |
unless (($status{$msgid} eq 'replied') || |
($status{$msgid} eq 'forwarded')) { |
($status{$msgid} eq 'forwarded')) { |
&Apache::lonnet::put('email_status',($msgid => $newstatus)); |
&Apache::lonnet::put('email_status',{$msgid => $newstatus}); |
} |
} |
} |
} |
# ===================================================================== Handler |
# ===================================================================== Handler |
Line 217 sub handler {
|
Line 219 sub handler {
|
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C",hex($1))/eg; |
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C",hex($1))/eg; |
if (($name eq 'display') || ($name eq 'replyto') || |
if (($name eq 'display') || ($name eq 'replyto') || |
($name eq 'forward') || ($name eq 'mark') || |
($name eq 'forward') || ($name eq 'mark') || |
($name eq 'sendreply')) { |
($name eq 'sendreply') || ($name eq 'compose')) { |
unless ($ENV{'form.'.$name}) { |
unless ($ENV{'form.'.$name}) { |
$ENV{'form.'.$name}=$value; |
$ENV{'form.'.$name}=$value; |
} |
} |
Line 251 sub handler {
|
Line 253 sub handler {
|
$quotemsg=~s/\f/\n/g; |
$quotemsg=~s/\f/\n/g; |
$quotemsg=~s/\n+/\n\> /g; |
$quotemsg=~s/\n+/\n\> /g; |
my $subject='Re: '.$content{'subject'}; |
my $subject='Re: '.$content{'subject'}; |
|
my $dispcrit=''; |
|
if (&Apache::lonnet::allowed('srm',$ENV{'request.course.id'})) { |
|
$dispcrit= |
|
'<input type=checkbox name=critmsg> Send as critical message<p>'; |
|
} |
$r->print(<<"ENDREPLY"); |
$r->print(<<"ENDREPLY"); |
<form action="/adm/email" method=post> |
<form action="/adm/email" method=post> |
<input type=hidden name=sendreply value="$msgid"> |
<input type=hidden name=sendreply value="$msgid"> |
Line 258 Subject: <input type=text size=50 name=s
|
Line 265 Subject: <input type=text size=50 name=s
|
<textarea name=message cols=60 rows=10> |
<textarea name=message cols=60 rows=10> |
$quotemsg |
$quotemsg |
</textarea><p> |
</textarea><p> |
|
$dispcrit |
<input type=submit value="Send Reply"> |
<input type=submit value="Send Reply"> |
</form> |
</form> |
ENDREPLY |
ENDREPLY |
Line 272 ENDREPLY
|
Line 280 ENDREPLY
|
$ENV{'form.message'})); |
$ENV{'form.message'})); |
} elsif ($ENV{'form.forward'}) { |
} elsif ($ENV{'form.forward'}) { |
} elsif ($ENV{'form.mark'}) { |
} elsif ($ENV{'form.mark'}) { |
|
} elsif ($ENV{'form.compose'}) { |
|
my $dispcrit=''; |
|
if (&Apache::lonnet::allowed('srm',$ENV{'request.course.id'})) { |
|
$dispcrit= |
|
'<input type=checkbox name=critmsg> Send as critical message<p>'; |
|
} |
|
$r->print(<<"ENDCOMP"); |
|
<form action="/adm/email" method=post> |
|
<input type=hidden name=sendmail value=on> |
|
Subject: <input type=text size=50 name=subject value=""><p> |
|
<textarea name=message cols=60 rows=10> |
|
</textarea><p> |
|
$dispcrit |
|
<input type=submit value="Send Mail"> |
|
</form> |
|
ENDCOMP |
|
} elsif ($ENV{'form.sendmail'}) { |
} else { |
} else { |
$r->print('<table border=2><tr><th> </th><th>Date</th>'. |
$r->print('<table border=2><tr><th> </th><th>Date</th>'. |
'<th>Username</th><th>Domain</th><th>Subject</th><th>Status</th></tr>'); |
'<th>Username</th><th>Domain</th><th>Subject</th><th>Status</th></tr>'); |