version 1.101, 2004/05/17 19:00:45
|
version 1.105, 2004/09/09 08:00:12
|
Line 219 sub sendemail {
|
Line 219 sub sendemail {
|
my $msg = new Mail::Send; |
my $msg = new Mail::Send; |
$msg->to($to); |
$msg->to($to); |
$msg->subject('[LON-CAPA] '.$subject); |
$msg->subject('[LON-CAPA] '.$subject); |
|
my %oldENV=%ENV; |
|
undef(%ENV); |
if (my $fh = $msg->open()) { |
if (my $fh = $msg->open()) { |
print $fh $body; |
print $fh $body; |
$fh->close; |
$fh->close; |
} |
} |
|
%ENV=%oldENV; |
|
undef(%oldENV); |
} |
} |
|
|
# ==================================================== Send notification emails |
# ==================================================== Send notification emails |
Line 857 sub compout {
|
Line 861 sub compout {
|
if ($replying) { |
if ($replying) { |
%message=&Apache::lonnet::get('nohist_email',[$replying]); |
%message=&Apache::lonnet::get('nohist_email',[$replying]); |
%content=&unpackagemsg($message{$replying}); |
%content=&unpackagemsg($message{$replying}); |
$dispcrit.='<input type="hidden" name="forwid" value="'. |
$dispcrit.='<input type="hidden" name="replyid" value="'. |
$forwarding.'" />'; |
$replying.'" />'; |
$func=&mt('Replying to'); |
$func=&mt('Replying to'); |
|
|
$dissub=&mt('Reply').': '.$content{'subject'}; |
$dissub=&mt('Reply').': '.$content{'subject'}; |
Line 945 ENDUPLOAD
|
Line 949 ENDUPLOAD
|
|
|
# ---------------------------------------------------- Display all face to face |
# ---------------------------------------------------- Display all face to face |
|
|
|
sub retrieve_instructor_comments { |
|
my ($user,$domain)=@_; |
|
my $target=$ENV{'form.grade_target'}; |
|
if (! $ENV{'request.course.id'}) { return; } |
|
if (! &Apache::lonnet::allowed('srm',$ENV{'request.course.id'})) { |
|
return; |
|
} |
|
my %records=&Apache::lonnet::dump('nohist_email', |
|
$ENV{'course.'.$ENV{'request.course.id'}.'.domain'}, |
|
$ENV{'course.'.$ENV{'request.course.id'}.'.num'}, |
|
'%255b'.$user.'%253a'.$domain.'%255d'); |
|
my $result=''; |
|
foreach (sort(keys(%records))) { |
|
my %content=&unpackagemsg($records{$_}); |
|
next if ($content{'senderdomain'} eq ''); |
|
next if ($content{'subject'} !~ /^Record/); |
|
# $content{'message'}=~s/\n/\<br\>/g; |
|
$result.='Recorded by '. |
|
$content{'sendername'}.'@'.$content{'senderdomain'}."\n"; |
|
$result.= |
|
&Apache::lontexconvert::msgtexconverted($content{'message'})."\n"; |
|
} |
|
return $result; |
|
} |
|
|
sub disfacetoface { |
sub disfacetoface { |
my ($r,$user,$domain)=@_; |
my ($r,$user,$domain)=@_; |
my $target=$ENV{'form.grade_target'}; |
my $target=$ENV{'form.grade_target'}; |
Line 963 sub disfacetoface {
|
Line 992 sub disfacetoface {
|
$content{'message'}=~s/\n/\<br\>/g; |
$content{'message'}=~s/\n/\<br\>/g; |
if ($content{'subject'}=~/^Record/) { |
if ($content{'subject'}=~/^Record/) { |
$result.='<h3>'.&mt('Record').'</h3>'; |
$result.='<h3>'.&mt('Record').'</h3>'; |
|
} elsif ($content{'subject'}=~/^Broadcast/) { |
|
$result .='<h3>'.&mt('Broadcast Message').'</h3>'; |
} else { |
} else { |
$result.='<h3>'.&mt('Sent Message').'</h3>'; |
$result.='<h3>'.&mt('Critical Message').'</h3>'; |
%content=&unpackagemsg($content{'message'}); |
%content=&unpackagemsg($content{'message'}); |
$content{'message'}= |
$content{'message'}= |
'<b>'.&mt('Subject').': '.$content{'subject'}.'</b><br />'. |
'<b>'.&mt('Subject').': '.$content{'subject'}.'</b><br />'. |
Line 982 $content{'sendername'}.'@'.
|
Line 1013 $content{'sendername'}.'@'.
|
# Check to see if there were any messages. |
# Check to see if there were any messages. |
if ($result eq '') { |
if ($result eq '') { |
if ($target ne 'tex') { |
if ($target ne 'tex') { |
$r->print("<p><b>".&mt("No notes, face-to-face discussion records, or critical messages in this course.")."</b></p>"); |
$r->print("<p><b>".&mt("No notes, face-to-face discussion records, critical messages, or broadcast messages in this course.")."</b></p>"); |
} else { |
} else { |
$r->print('\textbf{'.&mt("No notes, face-to-face discussion records, or critical messages in this course.").'}\\\\'); |
$r->print('\textbf{'.&mt("No notes, face-to-face discussion records, critical messages or broadcast messages in this course.").'}\\\\'); |
} |
} |
} else { |
} else { |
$r->print($result); |
$r->print($result); |
Line 1000 sub facetoface {
|
Line 1031 sub facetoface {
|
} |
} |
&printheader($r, |
&printheader($r, |
'/adm/email?recordftf=query', |
'/adm/email?recordftf=query', |
"User Notes, Face-to-Face, Critical Messages"); |
"User Notes, Face-to-Face, Critical Messages, Broadcast Messages"); |
# from query string |
# from query string |
|
|
if ($ENV{'form.recname'}) { $ENV{'form.recuname'}=$ENV{'form.recname'}; } |
if ($ENV{'form.recname'}) { $ENV{'form.recuname'}=$ENV{'form.recname'}; } |
Line 1015 sub facetoface {
|
Line 1046 sub facetoface {
|
('stdselect','recuname','recdomain'); |
('stdselect','recuname','recdomain'); |
my %lt=&Apache::lonlocal::texthash('user' => 'Username', |
my %lt=&Apache::lonlocal::texthash('user' => 'Username', |
'dom' => 'Domain', |
'dom' => 'Domain', |
'head' => 'User Notes, Records of Face-To-Face Discussions, and Critical Messages in Course', |
'head' => 'User Notes, Records of Face-To-Face Discussions, Critical Messages, and Broadcast Messages in Course', |
'subm' => 'Retrieve discussion and message records', |
'subm' => 'Retrieve discussion and message records', |
'newr' => 'New Record (record is visible to course faculty and staff)', |
'newr' => 'New Record (record is visible to course faculty and staff)', |
'post' => 'Post this Record'); |
'post' => 'Post this Record'); |
Line 1623 sub handler {
|
Line 1654 sub handler {
|
$ENV{'form.message'}.="\n\n-- Forwarded message --\n\n". |
$ENV{'form.message'}.="\n\n-- Forwarded message --\n\n". |
$content{'message'}; |
$content{'message'}; |
} |
} |
|
if ($ENV{'form.replyid'}) { |
|
my $msgid=$ENV{'form.replyid'}; |
|
my %message=&Apache::lonnet::get('nohist_email',[$msgid]); |
|
%content=&unpackagemsg($message{$msgid},1); |
|
&statuschange($msgid,'replied'); |
|
} |
my %toaddr=(); |
my %toaddr=(); |
undef %toaddr; |
undef %toaddr; |
if ($ENV{'form.sendmode'} eq 'group') { |
if ($ENV{'form.sendmode'} eq 'group') { |
Line 1667 sub handler {
|
Line 1704 sub handler {
|
&Apache::lonfeedback::clear_out_html($ENV{'form.subject'}), |
&Apache::lonfeedback::clear_out_html($ENV{'form.subject'}), |
$msgtxt, |
$msgtxt, |
$content{'citation'}); |
$content{'citation'}); |
|
if (($ENV{'request.course.id'}) && ($ENV{'form.sendmode'} eq 'group')) { |
|
&user_normal_msg_raw( |
|
$ENV{'course.'.$ENV{'request.course.id'}.'.num'}, |
|
$ENV{'course.'.$ENV{'request.course.id'}.'.domain'}, |
|
'Broadcast ['.$recuname.':'.$recdomain.']', |
|
$msgtxt); |
|
} |
} |
} |
$r->print($thismsg.'<br />'); |
$r->print($thismsg.'<br />'); |
$sendstatus.=' '.$thismsg; |
$sendstatus.=' '.$thismsg; |