--- loncom/interface/lonmsgdisplay.pm 2008/11/23 15:48:27 1.97
+++ loncom/interface/lonmsgdisplay.pm 2009/02/25 16:39:54 1.115
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Routines for messaging display
#
-# $Id: lonmsgdisplay.pm,v 1.97 2008/11/23 15:48:27 schafran Exp $
+# $Id: lonmsgdisplay.pm,v 1.115 2009/02/25 16:39:54 hauer 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,17 +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
-e-mail 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,{},[]);
@@ -578,10 +577,15 @@ e-mail to a group in the course.');
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;
+ unless($env{'environment.wysiwygeditor'} eq 'on') {
+ $r->print('
');
+ }
my %Sortby = (
active => {},
previous => {},
@@ -607,7 +611,7 @@ e-mail to a group in the course.');
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})) {
@@ -615,46 +619,49 @@ e-mail to a group in the course.');
if (ref($access_status) eq 'HASH') {
$access_status->{$status} = $$numitems{$status};
}
- $result.=' ');
}
}
}
+ unless($env{'environment.wysiwygeditor'} eq 'on') {
+ $r->print('
');
+ }
}
- return $result;
+ return $hasfloat;
}
sub group_check_uncheck {
@@ -718,13 +725,13 @@ sub groupmail_header {
{href=>"/adm/email?compose=group&group=".
"$env{'form.group'}&$refarg",
text=>"Send a Message in a Group",
- title=>"Compose Group E-mail"},);
+ title=>"Compose Group Message"},);
if ($action eq 'sending') {
&Apache::lonhtmlcommon::add_breadcrumb
- ({text=>"E-mails being sent.",
+ ({text=>"Messages being 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;
@@ -738,7 +745,7 @@ sub groupmail_sent {
}
my $output .= '
'.
- &mt('Send another group email').''.' '.
+ &mt('Send another group message').''.' '.
''. &mt('Return to group page').'';
return $output;
@@ -831,6 +838,7 @@ sub sortedmessages {
}
foreach my $msgid (@messages) {
+ next if ($msgid eq '');
my $esc_msgid=&escape($msgid);
my ($sendtime,$shortsubj,$fromname,$fromdomain,$status,$fromcid,$processid,$symb,$error) =
&Apache::lonmsg::unpackmsgid($esc_msgid,$folder,undef,
@@ -1071,11 +1079,13 @@ ENDDISHEADER
$r->print("\n");
my $suffix = &Apache::lonmsg::foldersuffix($folder);
+ my $count = 0;
for (my $n=$firstdis;$n<=$lastdis;$n++) {
my ($sendtime,$shortsubj,$fromname,$fromdomain,$status,$origID,
$description,$recv_name,$recv_domain)=
@{$temp[$n]};
if (($status ne 'deleted') && defined($sendtime) && $sendtime!~/error/) {
+ $count ++;
if ($status eq 'new') {
$r->print('
ENDADD
return $output;
}
@@ -1676,6 +1692,7 @@ ENDADD
sub submit_button_row {
my ($folder,$dismode,$sendtext,$lt,$is_crsform,$group) = @_;
my $pre=&mt("Show Preview and Check Spelling");
+ my $value=&mt('Send');
my $prevbutton = '';
my $output = qq|
@@ -1688,7 +1705,7 @@ sub submit_button_row {
}
$output .= qq|
-
+
$prevbutton
|;
@@ -1813,7 +1830,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 {
@@ -2200,7 +2217,7 @@ END
sub blocktype_text {
my %types = &Apache::lonlocal::texthash(
'com' => 'Messaging',
- 'chat' => 'Chat',
+ 'chat' => 'Chat Room',
'boards' => 'Discussion',
'port' => 'Portfolio',
'groups' => 'Groups',
@@ -2262,29 +2279,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'};
@@ -2293,33 +2347,40 @@ sub displaymessage {
}
if ($env{'user.adv'}) {
my $actionlist='';
+
if (&Apache::lonnet::allowed('vgr',$env{'request.course.id'})) {
- $actionlist.='