--- loncom/interface/lonmsgdisplay.pm 2008/11/04 06:22:53 1.95
+++ loncom/interface/lonmsgdisplay.pm 2009/01/06 21:38:43 1.108
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Routines for messaging display
#
-# $Id: lonmsgdisplay.pm,v 1.95 2008/11/04 06:22:53 raeburn Exp $
+# $Id: lonmsgdisplay.pm,v 1.108 2009/01/06 21:38:43 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -243,9 +243,9 @@ function folder_choice(targetform,caller
-
'.
- '
'.&mt('New Folder').' '.
+ '
'.&mt('Name').' '.
'
@@ -353,7 +353,7 @@ sub makefolder {
}
} else {
$outcome =
- &mt('Error - could not obtain lock on email folders record.');
+ &mt('Error - could not obtain lock on message folders record.');
}
return ($outcome,$warning);
}
@@ -555,16 +555,16 @@ sub discourse {
}
sub disgroup {
- my ($cdom,$cnum,$group,$access_status) = @_;
- my $result;
+ my ($r,$cdom,$cnum,$group,$access_status) = @_;
+ my $hasfloat;
# Needs to be in a course
if (!($env{'request.course.fn'})) {
- $result = &mt('Error: you must have a course role selected to be able to send a broadcast message to a group in the course.');
- return $result;
+ $r->print(''.&mt('Error: you must have a course role selected to be able to send a broadcast message to a group in the course.').'');
+ return;
}
if ($cdom eq '' || $cnum eq '') {
- $result = &mt('Error: could not determine domain or number of course');
- return $result;
+ $r->print(''.&mt('Error: could not determine domain or number of course').'');
+ return;
}
my ($memberinfo,$numitems) =
&Apache::longroup::group_memberlist($cdom,$cnum,$group,{},[]);
@@ -577,10 +577,13 @@ sub disgroup {
push(@statustypes,('future','previous'));
}
if (keys(%{$memberinfo}) == 0) {
- $result = &mt('As this group has no members, there are no '.
- 'recipients to select.');
- return $result;
+ $r->print(''.
+ &mt('As this group has no members, there are no recipients to select').
+ '');
+ return;
} else {
+ $hasfloat = 1;
+ $r->print('
');
my %Sortby = (
active => {},
previous => {},
@@ -606,7 +609,7 @@ sub disgroup {
push(@{$Sortby{$status}{$$memberinfo{$user}{fullname}}},$user);
}
}
- $result .= &group_check_uncheck();
+ $r->print(&group_check_uncheck());
foreach my $status (@statustypes) {
if (ref($numitems) eq 'HASH') {
if ((defined($$numitems{$status})) && ($$numitems{$status})) {
@@ -614,46 +617,46 @@ sub disgroup {
if (ref($access_status) eq 'HASH') {
$access_status->{$status} = $$numitems{$status};
}
- $result.='
');
}
}
}
}
- return $result;
+ return $hasfloat;
}
sub group_check_uncheck {
@@ -717,13 +720,13 @@ sub groupmail_header {
{href=>"/adm/email?compose=group&group=".
"$env{'form.group'}&$refarg",
text=>"Send a Message in a Group",
- title=>"Compose Group Email Message"},);
+ title=>"Compose Group Message"},);
if ($action eq 'sending') {
&Apache::lonhtmlcommon::add_breadcrumb
({text=>"Messages being sent.",
- title=>"Messages sent"},);
+ title=>"E-mails sent"},);
}
- my $groupheader = &Apache::loncommon::start_page('Group Email');
+ my $groupheader = &Apache::loncommon::start_page('Group Message');
$groupheader .= &Apache::lonhtmlcommon::breadcrumbs
('Group - '.$env{'form.group'}.' Email');
return $groupheader;
@@ -737,7 +740,7 @@ sub groupmail_sent {
}
my $output .= '
|;
@@ -1812,7 +1813,7 @@ $content{'sendername'}.':'.
}
# Check to see if there were any messages.
if ($result eq '') {
- my $lctype = lc(&Apache::loncommon::course_type());
+ my $lctype = &mt(lc(&Apache::loncommon::course_type()));
if ($target ne 'tex') {
$r->print("
".&mt('No notes, face-to-face discussion records, critical messages, or broadcast messages in this [_1].',$lctype)."
");
} else {
@@ -2261,29 +2262,66 @@ sub displaymessage {
# start output
&printheader($r,'/adm/email?display='.&escape($msgid),'Display a Message','',$content{'baseurl'});
my %courseinfo=&Apache::lonnet::coursedescription($content{'courseid'});
-# Functions
- $r->print('
'.&mt('Functions').':
');
+
+# Functions and Actions
+ my $li_start='• ';
+ my $li_end=' ';
+
+# Prepare available functions
+ my $functionlist='';
if (!$content{'noreplies'}) {
- $r->print('
'
+ );
+
+# Prepare available actions
my $symb;
if (defined($content{'symb'})) {
$symb = $content{'symb'};
@@ -2292,33 +2330,40 @@ sub displaymessage {
}
if ($env{'user.adv'}) {
my $actionlist='';
+
if (&Apache::lonnet::allowed('vgr',$env{'request.course.id'})) {
- $actionlist.='