version 1.131, 2005/01/30 23:32:29
|
version 1.135, 2005/02/17 04:02:47
|
Line 90 also has a student role in the course, A
|
Line 90 also has a student role in the course, A
|
|
|
Users can ask LON-CAPA to forward messages to conventional e-mail |
Users can ask LON-CAPA to forward messages to conventional e-mail |
addresses on their B<PREF> screen, but generally, LON-CAPA messages |
addresses on their B<PREF> screen, but generally, LON-CAPA messages |
are much more useful then traditional email can be made to be, even |
are much more useful than traditional email can be made to be, even |
with HTML support. |
with HTML support. |
|
|
Right now, this document will cover just how to send a message, since |
Right now, this document will cover just how to send a message, since |
Line 356 sub all_url_author_res_msg {
|
Line 356 sub all_url_author_res_msg {
|
# ================================================== Critical message to a user |
# ================================================== Critical message to a user |
|
|
sub user_crit_msg_raw { |
sub user_crit_msg_raw { |
my ($user,$domain,$subject,$message,$sendback)=@_; |
my ($user,$domain,$subject,$message,$sendback,$toperm)=@_; |
# Check if allowed missing |
# Check if allowed missing |
my $status=''; |
my $status=''; |
my $msgid='undefined'; |
my $msgid='undefined'; |
Line 381 sub user_crit_msg_raw {
|
Line 381 sub user_crit_msg_raw {
|
$status='no_host'; |
$status='no_host'; |
} |
} |
# Notifications |
# Notifications |
my %userenv = &Apache::lonnet::get('environment',['critnotification'], |
my %userenv = &Apache::lonnet::get('environment',['critnotification', |
|
'permanentemail'], |
$domain,$user); |
$domain,$user); |
if ($userenv{'critnotification'}) { |
if ($userenv{'critnotification'}) { |
&sendnotification($userenv{'critnotification'},$user,$domain,$subject,1, |
&sendnotification($userenv{'critnotification'},$user,$domain,$subject,1, |
$text); |
$text); |
} |
} |
|
if ($toperm && $userenv{'permanentemail'}) { |
|
&sendnotification($userenv{'permanentemail'},$user,$domain,$subject,1, |
|
$text); |
|
} |
# Log this |
# Log this |
&Apache::lonnet::logthis( |
&Apache::lonnet::logthis( |
'Sending critical email '.$msgid. |
'Sending critical email '.$msgid. |
Line 409 sub user_crit_msg_raw {
|
Line 414 sub user_crit_msg_raw {
|
=cut |
=cut |
|
|
sub user_crit_msg { |
sub user_crit_msg { |
my ($user,$domain,$subject,$message,$sendback)=@_; |
my ($user,$domain,$subject,$message,$sendback,$toperm)=@_; |
my $status=''; |
my $status=''; |
my %userenv = &Apache::lonnet::get('environment',['msgforward'], |
my %userenv = &Apache::lonnet::get('environment',['msgforward'], |
$domain,$user); |
$domain,$user); |
Line 419 sub user_crit_msg {
|
Line 424 sub user_crit_msg {
|
my ($forwuser,$forwdomain)=split(/\:/,$_); |
my ($forwuser,$forwdomain)=split(/\:/,$_); |
$status.= |
$status.= |
&user_crit_msg_raw($forwuser,$forwdomain,$subject,$message, |
&user_crit_msg_raw($forwuser,$forwdomain,$subject,$message, |
$sendback).' '; |
$sendback,$toperm).' '; |
} |
} |
} else { |
} else { |
$status=&user_crit_msg_raw($user,$domain,$subject,$message,$sendback); |
$status=&user_crit_msg_raw($user,$domain,$subject,$message,$sendback,$toperm); |
} |
} |
return $status; |
return $status; |
} |
} |
Line 456 sub user_crit_received {
|
Line 461 sub user_crit_received {
|
# ======================================================== Normal communication |
# ======================================================== Normal communication |
|
|
sub user_normal_msg_raw { |
sub user_normal_msg_raw { |
my ($user,$domain,$subject,$message,$citation,$baseurl,$attachmenturl)=@_; |
my ($user,$domain,$subject,$message,$citation,$baseurl,$attachmenturl, |
|
$toperm)=@_; |
# Check if allowed missing |
# Check if allowed missing |
my $status=''; |
my $status=''; |
my $msgid='undefined'; |
my $msgid='undefined'; |
Line 484 sub user_normal_msg_raw {
|
Line 490 sub user_normal_msg_raw {
|
$status='no_host'; |
$status='no_host'; |
} |
} |
# Notifications |
# Notifications |
my %userenv = &Apache::lonnet::get('environment',['notification'], |
my %userenv = &Apache::lonnet::get('environment',['notification', |
|
'permanentemail'], |
$domain,$user); |
$domain,$user); |
if ($userenv{'notification'}) { |
if ($userenv{'notification'}) { |
&sendnotification($userenv{'notification'},$user,$domain,$subject,0, |
&sendnotification($userenv{'notification'},$user,$domain,$subject,0, |
$text); |
$text); |
} |
} |
|
if ($toperm && $userenv{'permanentemail'}) { |
|
&sendnotification($userenv{'permanentemail'},$user,$domain,$subject,0, |
|
$text); |
|
} |
&Apache::lonnet::log($ENV{'user.domain'},$ENV{'user.name'}, |
&Apache::lonnet::log($ENV{'user.domain'},$ENV{'user.name'}, |
$ENV{'user.home'}, |
$ENV{'user.home'}, |
'Sending '.$msgid.' to '.$user.' at '.$domain.' with status: '.$status); |
'Sending '.$msgid.' to '.$user.' at '.$domain.' with status: '.$status); |
Line 507 sub user_normal_msg_raw {
|
Line 518 sub user_normal_msg_raw {
|
=cut |
=cut |
|
|
sub user_normal_msg { |
sub user_normal_msg { |
my ($user,$domain,$subject,$message,$citation,$baseurl,$attachmenturl)=@_; |
my ($user,$domain,$subject,$message,$citation,$baseurl,$attachmenturl, |
|
$toperm)=@_; |
my $status=''; |
my $status=''; |
my %userenv = &Apache::lonnet::get('environment',['msgforward'], |
my %userenv = &Apache::lonnet::get('environment',['msgforward'], |
$domain,$user); |
$domain,$user); |
Line 517 sub user_normal_msg {
|
Line 529 sub user_normal_msg {
|
my ($forwuser,$forwdomain)=split(/\:/,$_); |
my ($forwuser,$forwdomain)=split(/\:/,$_); |
$status.= |
$status.= |
&user_normal_msg_raw($forwuser,$forwdomain,$subject,$message, |
&user_normal_msg_raw($forwuser,$forwdomain,$subject,$message, |
$citation,$baseurl,$attachmenturl).' '; |
$citation,$baseurl,$attachmenturl,$toperm).' '; |
} |
} |
} else { |
} else { |
$status=&user_normal_msg_raw($user,$domain,$subject,$message, |
$status=&user_normal_msg_raw($user,$domain,$subject,$message, |
$citation,$baseurl,$attachmenturl); |
$citation,$baseurl,$attachmenturl,$toperm); |
} |
} |
return $status; |
return $status; |
} |
} |
Line 681 ENDDISHEADER
|
Line 693 ENDDISHEADER
|
} |
} |
} |
} |
$r->print('</table><table>'); |
$r->print('</table><table>'); |
while (my ($student,$info) = each(%$classlist)) { |
my $sort = sub { |
|
my $aname=lc($classlist->{$a}[&Apache::loncoursedata::CL_FULLNAME()]); |
|
if (!$aname) { $aname=$a; } |
|
my $bname=lc($classlist->{$b}[&Apache::loncoursedata::CL_FULLNAME()]); |
|
if (!$bname) { $bname=$b; } |
|
return $aname cmp $bname; |
|
}; |
|
foreach my $student (sort $sort (keys(%{$classlist}))) { |
|
my $info=$classlist->{$student}; |
my ($sname,$sdom,$status,$fullname,$section) = |
my ($sname,$sdom,$status,$fullname,$section) = |
(@{$info}[&Apache::loncoursedata::CL_SNAME(), |
(@{$info}[&Apache::loncoursedata::CL_SNAME(), |
&Apache::loncoursedata::CL_SDOM(), |
&Apache::loncoursedata::CL_SDOM(), |
Line 967 ENDDISHEADER
|
Line 987 ENDDISHEADER
|
} |
} |
$r->print('</th><th>'); |
$r->print('</th><th>'); |
if ($ENV{'form.sortedby'} eq "revstatus") { |
if ($ENV{'form.sortedby'} eq "revstatus") { |
$r->print('<a href = "?sortedby=status'.$fsqs.'">'.&mt('Status').'</th>'); |
$r->print('<a href = "?sortedby=status'.$fsqs.'">'.&mt('Status').'</a></th>'); |
} else { |
} else { |
$r->print('<a href = "?sortedby=revstatus'.$fsqs.'">'.&mt('Status').'</th>'); |
$r->print('<a href = "?sortedby=revstatus'.$fsqs.'">'.&mt('Status').'</a></th>'); |
} |
} |
$r->print("</tr>\n"); |
$r->print("</tr>\n"); |
for (my $n=$firstdis;$n<=$lastdis;$n++) { |
for (my $n=$firstdis;$n<=$lastdis;$n++) { |
Line 984 ENDDISHEADER
|
Line 1004 ENDDISHEADER
|
} else { |
} else { |
$r->print('<tr bgcolor="#99BBBB">'); |
$r->print('<tr bgcolor="#99BBBB">'); |
} |
} |
$r->print('<td></a><input type=checkbox name="delmark_'.$origID.'" /></td><td><a href="/adm/email?display='.$origID.$sqs. |
$r->print('<td><input type=checkbox name="delmark_'.$origID.'" /></td><td><a href="/adm/email?display='.$origID.$sqs. |
'">'.&mt('Open').'</a></td><td>'. |
'">'.&mt('Open').'</a></td><td>'. |
($folder ne 'trash'?'<a href="/adm/email?markdel='.$origID.$sqs. |
($folder ne 'trash'?'<a href="/adm/email?markdel='.$origID.$sqs. |
'">'.&mt('Delete'):' ').'</td>'. |
'">'.&mt('Delete'):' ').'</a></td>'. |
'<td>'.&Apache::lonlocal::locallocaltime($sendtime).'</td><td>'. |
'<td>'.&Apache::lonlocal::locallocaltime($sendtime).'</td><td>'. |
$fromname.'</td><td>'.$fromdomain.'</td><td>'. |
$fromname.'</td><td>'.$fromdomain.'</td><td>'. |
&Apache::lonnet::unescape($shortsubj).'</td><td>'. |
&Apache::lonnet::unescape($shortsubj).'</td><td>'. |
Line 1071 sub compout {
|
Line 1091 sub compout {
|
my $crithelp = Apache::loncommon::help_open_topic("Course_Critical_Message"); |
my $crithelp = Apache::loncommon::help_open_topic("Course_Critical_Message"); |
$dispcrit= |
$dispcrit= |
'<input type="checkbox" name="critmsg" /> '.&mt('Send as critical message').' ' . $crithelp . |
'<input type="checkbox" name="critmsg" /> '.&mt('Send as critical message').' ' . $crithelp . |
'<br>'. |
'<br />'. |
'<input type="checkbox" name="sendbck" /> '.&mt('Send as critical message').' ' . |
'<input type="checkbox" name="sendbck" /> '.&mt('Send as critical message').' ' . |
&mt('and return receipt') . $crithelp . '<p>'; |
&mt('and return receipt') . $crithelp . |
|
'<br /><input type="checkbox" name="permanent" /> '. |
|
&mt('Send copy to permanent email address (if known)').'<p>'; |
} |
} |
my %message; |
my %message; |
my %content; |
my %content; |
Line 1948 sub sendoffmail {
|
Line 1970 sub sendoffmail {
|
$thismsg=&user_crit_msg($recuname,$recdomain, |
$thismsg=&user_crit_msg($recuname,$recdomain, |
&Apache::lonfeedback::clear_out_html($ENV{'form.subject'}), |
&Apache::lonfeedback::clear_out_html($ENV{'form.subject'}), |
$msgtxt, |
$msgtxt, |
$ENV{'form.sendbck'}); |
$ENV{'form.sendbck'},$ENV{'form.permanent'}); |
} else { |
} else { |
$r->print(&mt('Sending').' '.$recuname.'@'.$recdomain.': '); |
$r->print(&mt('Sending').' '.$recuname.'@'.$recdomain.': '); |
$thismsg=&user_normal_msg($recuname,$recdomain, |
$thismsg=&user_normal_msg($recuname,$recdomain, |
&Apache::lonfeedback::clear_out_html($ENV{'form.subject'}), |
&Apache::lonfeedback::clear_out_html($ENV{'form.subject'}), |
$msgtxt, |
$msgtxt, |
$content{'citation'}); |
$content{'citation'},undef,undef,$ENV{'form.permanent'}); |
if (($ENV{'request.course.id'}) && ($ENV{'form.sendmode'} eq 'group')) { |
if (($ENV{'request.course.id'}) && ($ENV{'form.sendmode'} eq 'group')) { |
&user_normal_msg_raw( |
&user_normal_msg_raw( |
$ENV{'course.'.$ENV{'request.course.id'}.'.num'}, |
$ENV{'course.'.$ENV{'request.course.id'}.'.num'}, |