--- loncom/interface/lonmsgdisplay.pm 2006/04/25 20:02:30 1.14
+++ loncom/interface/lonmsgdisplay.pm 2006/06/12 22:55:23 1.31
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Routines for messaging display
#
-# $Id: lonmsgdisplay.pm,v 1.14 2006/04/25 20:02:30 albertel Exp $
+# $Id: lonmsgdisplay.pm,v 1.31 2006/06/12 22:55:23 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -125,6 +125,9 @@ use Apache::lonlocal;
use Apache::loncommunicate;
use Apache::lonfeedback;
use Apache::lonrss();
+use Apache::lonselstudent();
+use lib '/home/httpd/lib/perl/';
+use LONCAPA;
# Querystring component with sorting type
my $sqs;
@@ -259,89 +262,32 @@ 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('
');
+ my $result;
+ my ($course_personnel,
+ $current_members,
+ $expired_members,
+ $future_members) =
+ &Apache::lonselstudent::get_people_in_class($env{'request.course.sec'});
+ unshift @$current_members, (@$course_personnel);
+ my %defaultUsers;
+
+ $result = &Apache::lonselstudent::render_student_list($current_members,
+ "compemail",
+ "current",
+ \%defaultUsers,
+ 1,"selectedusers",1);
+
+ $result .= &Apache::lonselstudent::render_student_list($expired_members,
+ "compemail",
+ "expired",
+ \%defaultUsers,
+ 1, "selectedusers",0);
+ $result .= &Apache::lonselstudent::render_student_list($future_members,
+ "compemail",
+ "future",
+ \%defaultUsers,
+ 1, "selectedusers", 0);
+ return $result;
}
# ==================================================== Display Critical Message
@@ -374,7 +320,7 @@ $content{'sendername'}.':'.
# Check to see if there were any messages.
if ($result eq '') {
$result = "".&mt('You have no critical messages.')."
".
- ''.&mt('Select a course').'
'.
+ ''.&mt('Select a course or group').'
'.
''.&mt('Communicate').'';
} else {
$r->print($header);
@@ -400,7 +346,7 @@ sub sortedmessages {
}
foreach my $msgid (@messages) {
- my $esc_msgid=&Apache::lonnet::escape($msgid);
+ my $esc_msgid=&escape($msgid);
my ($sendtime,$shortsubj,$fromname,$fromdomain,$status,$fromcid)=
&Apache::lonmsg::unpackmsgid($esc_msgid,$folder,undef,
\%status_cache);
@@ -507,7 +453,7 @@ sub disnew {
my %lt=&Apache::lonlocal::texthash(
'nm' => 'New Messages',
'su' => 'Subject',
- 'co' => 'Course',
+ 'co' => 'Course/Group',
'da' => 'Date',
'us' => 'Username',
'op' => 'Open',
@@ -526,7 +472,7 @@ sub disnew {
&Apache::lonnet::get('email_status',\@msgids);
my %descriptions;
foreach (@msgids) {
- my $msgid=&Apache::lonnet::escape($_);
+ my $msgid=&escape($_);
my ($sendtime,$shortsubj,$fromname,$fromdom,$status,$fromcid)=
&Apache::lonmsg::unpackmsgid($msgid,undef,undef,\%status_cache);
if (defined($sendtime) && $sendtime!~/error/) {
@@ -612,7 +558,7 @@ sub disfolder {
my $numblocked = 0;
&blockcheck(\%setters,\$startblock,\$endblock);
$r->print(<
+