--- loncom/interface/lonmsgdisplay.pm 2006/04/26 14:43:03 1.19
+++ loncom/interface/lonmsgdisplay.pm 2006/05/17 09:51:26 1.26
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Routines for messaging display
#
-# $Id: lonmsgdisplay.pm,v 1.19 2006/04/26 14:43:03 albertel Exp $
+# $Id: lonmsgdisplay.pm,v 1.26 2006/05/17 09:51:26 foxr Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -28,6 +28,7 @@
package Apache::lonmsgdisplay;
+use Apache::lonselstudent;
=pod
@@ -259,89 +260,21 @@ sub movemsg {
# ======================================================= Display a course list
sub discourse {
- my $r=shift;
- my $classlist = &Apache::loncoursedata::get_classlist();
- my $now=time;
- my %lt=&Apache::lonlocal::texthash('cfa' => 'Check All',
- 'cfs' => 'Check Section/Group',
- 'cfn' => 'Uncheck All');
- $r->print(<
-
-
-
-
-
-
-ENDDISHEADER
- my %coursepersonnel=&Apache::lonnet::get_course_adv_roles();
- $r->print('
');
+ return $result;
}
# ==================================================== Display Critical Message
@@ -857,7 +790,9 @@ sub compout {
}
my $citation=&displayresource(%content);
if ($env{'form.recdom'}) { $defdom=$env{'form.recdom'}; }
- $r->print(
+ if ($env{'form.text'}) { $dismsg=$env{'form.text'}; }
+ if ($env{'form.subject'}) { $dissub=$env{'form.subject'}; }
+ $r->print(
''.
&Apache::lonfeedback::generate_preview_button('compemail','message').
@@ -1310,7 +1247,7 @@ END
my ($setuname,$setudom,$title) =
&parse_block_record($$records{$record});
- $title = &HTML::Entities::encode($title,'"<>');
+ $title = &HTML::Entities::encode($title,'"<>&');
my $settername = &Apache::loncommon::plainname($setuname,$setudom);
$r->print(&Apache::loncommon::start_data_table_row());
$r->print(<<"END");
@@ -1610,7 +1547,7 @@ sub header {
$r->print(&Apache::loncommon::start_page('Communication and Messages',
$extra));
$r->print(&Apache::lonhtmlcommon::breadcrumbs
- (undef,($title?$title:'Communication and Messages')));
+ (($title?$title:'Communication and Messages')));
}
@@ -1687,13 +1624,26 @@ sub sendoffmail {
&statuschange($msgid,'replied',$folder);
}
+ my $to = $env{'form.selectedusers.forminput'};
+ my $mode = $env{'form.sendmode'};
+
my %toaddr;
- if ($env{'form.sendmode'} eq 'group') {
- foreach my $address (keys(%env)) {
- if ($address=~/^form\.send\_to\_\&\&\&[^\&]*\&\&\&\_(.+)$/) {
- $toaddr{$1}='';
+ if ($to) {
+ foreach my $dest (@$to) {
+ my ($user,$domain) = split /:/, $dest;
+ if (($user ne '') && ($domain ne '')) {
+ my $address = $user.":".$domain; # How the code below expects it.
+ $toaddr{$address} = '';
}
}
+ }
+
+ if ($env{'form.sendmode'} eq 'group') {
+ foreach my $address (keys(%env)) {
+ if ($address=~/^form\.send\_to\_\&\&\&[^\&]*\&\&\&\_(.+)$/) {
+ $toaddr{$1}='';
+ }
+ }
} elsif ($env{'form.sendmode'} eq 'upload') {
foreach my $line (split(/[\n\r\f]+/,$env{'form.upfile'})) {
my ($rec,$txt)=split(/\s*\:\s*/,$line);
@@ -1703,12 +1653,16 @@ sub sendoffmail {
}
}
} else {
- $toaddr{$env{'form.recuname'}.':'.$env{'form.recdomain'}}='';
+ if (($env{'form.recuname'} ne '') && ($env{'form.recdomain'} ne '')) {
+ $toaddr{$env{'form.recuname'}.':'.$env{'form.recdomain'}}='';
+ }
}
if ($env{'form.additionalrec'}) {
foreach (split(/\,/,$env{'form.additionalrec'})) {
my ($auname,$audom)=split(/\@/,$_);
- $toaddr{$auname.':'.$audom}='';
+ if (($auname ne "") && ($audom ne "")) {
+ $toaddr{$auname.':'.$audom}='';
+ }
}
}
@@ -1837,7 +1791,7 @@ sub sendoffmail {
}
} else {
$r->print(''.&mt('Could not deliver message').' '.
- &mt('Please use the browser "Back" button and correct the recipient addresses').'
');
+ &mt('Please use the browser "Back" button and correct the recipient addresses '."($sendstatus)").'');
}
}
@@ -1858,7 +1812,7 @@ sub handler {
['display','replyto','forward','markread','markdel','markunread',
'sendreply','compose','sendmail','critical','recname','recdom',
'recordftf','sortedby','block','folder','startdis','interdis',
- 'showcommentbaseurl','dismode']);
+ 'showcommentbaseurl','dismode','group','subject','text']);
$sqs='&sortedby='.$env{'form.sortedby'};
# ------------------------------------------------------ They checked for email