@@ -2134,7 +2174,7 @@ END
foreach my $block (@{$typeorder}) {
my $blockstatus = '';
if ($blocks->{$block} eq 'on') {
- $blockstatus = 'checked="true"';
+ $blockstatus = 'checked="checked"';
}
$r->print('
');
}
@@ -2201,7 +2241,7 @@ END
sub blocktype_text {
my %types = &Apache::lonlocal::texthash(
'com' => 'Messaging',
- 'chat' => 'Chat',
+ 'chat' => 'Chat Room',
'boards' => 'Discussion',
'port' => 'Portfolio',
'groups' => 'Groups',
@@ -2263,29 +2303,51 @@ 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('');
+ $r->print(&Apache::lontemplate::end_functionslist()
+ .''
+ );
+
+# Prepare available actions
my $symb;
if (defined($content{'symb'})) {
$symb = $content{'symb'};
@@ -2293,34 +2355,48 @@ sub displaymessage {
$symb=&Apache::lonnet::symbread($content{'baseurl'});
}
if ($env{'user.adv'}) {
- my $actionlist='';
+ my @actionlist;
+
if (&Apache::lonnet::allowed('vgr',$env{'request.course.id'})) {
- $actionlist.=''
- .&Apache::loncommon::track_student_link(
- &mt('View recent activity'),$content{'sendername'},$content{'senderdomain'},'check')
- .' | ';
+ push(@actionlist,&Apache::loncommon::track_student_link(
+ &mt('View recent activity')
+ ,$content{'sendername'}
+ ,$content{'senderdomain'}
+ ,'check'));
}
if (&Apache::lonnet::allowed('opa',$env{'request.course.id'}) && $symb) {
- $actionlist.=''
- .&Apache::loncommon::pprmlink(
- &mt('Set/Change parameters'),$content{'sendername'},$content{'senderdomain'},$symb,'check')
- .' | ';
+ push(@actionlist,&Apache::loncommon::pprmlink(
+ &mt('Set/Change parameters')
+ ,$content{'sendername'}
+ ,$content{'senderdomain'}
+ ,$symb
+ ,'check'));
}
if (&Apache::lonnet::allowed('mgr',$env{'request.course.id'}) && $symb) {
- $actionlist.=''
- .&Apache::loncommon::pgrdlink(
- &mt('Set/Change grades'),$content{'sendername'},$content{'senderdomain'},$symb,'check')
- .' | ';
- }
- if ($actionlist) {
- $r->print(''
- .''
- .&mt('Currently available actions (will open extra window):')
- .' | '
- .$actionlist
- .'
');
+ push(@actionlist,&Apache::loncommon::pgrdlink(
+ &mt('Set/Change grades')
+ ,$content{'sendername'}
+ ,$content{'senderdomain'}
+ ,$symb
+ ,'check'));
+ }
+
+# Print actions
+ if (@actionlist) {
+ $legendtext=&mt('[_1]Currently available actions[_2] (will open extra window):'
+ ,'','');
+ $r->print(''
+ .&Apache::lontemplate::start_functionslist($legendtext)
+ );
+ foreach my $item (@actionlist) {
+ $r->print(&Apache::lontemplate::item_functionslist($item));
+ }
+ $r->print(&Apache::lontemplate::end_functionslist()
+ .'
'
+ );
}
}
+
my ($tonum,$tolist,$cclist,$bcclist,$groupcclist,%recipients);
if ($content{'recipid'}) {
$tonum = &retrieve_recips('display',\%content,\%recipients);
@@ -2334,7 +2410,16 @@ sub displaymessage {
$bcclist = join(', ',@{$recipients{'bcc'}});
}
}
- if (!$tolist && ref($content{'recuser'}) eq 'ARRAY') {
+
+ my $broadcast_link;
+ if (($content{'courseid'}) && ($content{'recipid'} &&
+ (ref($recipients{'course_broadcast'}) eq 'ARRAY') ||
+ (ref($recipients{'group_cc_broadcast'}) eq 'ARRAY') ||
+ (ref($recipients{'group_bcc_broadcast'}) eq 'ARRAY'))) {
+ $broadcast_link = &recipients_link($r,\%content,\%recipients);
+ }
+
+ if (((!$tolist) && (!$broadcast_link)) && ref($content{'recuser'}) eq 'ARRAY') {
my @recipients;
for (my $i=0; $i<@{$content{'recuser'}}; $i++) {
$recipients[$i] = &Apache::loncommon::aboutmewrapper(
@@ -2356,21 +2441,14 @@ sub displaymessage {
if (defined($content{'baseurl'})) {
$baseurl = &Apache::lonenc::check_encrypt($content{'baseurl'});
}
+ $r->print(''
.&Apache::lonhtmlcommon::start_pick_box()
.&Apache::lonhtmlcommon::row_title(&mt('Subject'))
.$content{'subject'}
@@ -2378,10 +2456,12 @@ sub displaymessage {
);
if ($folder eq 'sent') {
# To
- $r->print(&Apache::lonhtmlcommon::row_title(&mt('To'))
- .$tolist
- .&Apache::lonhtmlcommon::row_closure()
- );
+ if ($tolist) {
+ $r->print(&Apache::lonhtmlcommon::row_title(&mt('To'))
+ .$tolist
+ .&Apache::lonhtmlcommon::row_closure()
+ );
+ }
if ($cclist) {
$r->print(&Apache::lonhtmlcommon::row_title(&mt('Cc'))
.$cclist
@@ -2635,13 +2715,13 @@ sub recipients_link {
$nothing=&Apache::lonhtmlcommon::javascript_nothing();
$height = 400;
$width = 600;
- my $start_page =
- &Apache::loncommon::start_page('Broadcast List', undef,
- {only_body => 1,
- js_ready => 1,});
- my $end_page = &Apache::loncommon::end_page({js_ready => 1,});
- my $body = ''.&mt("Recipients of broadcast message").'
'.
- &Apache::loncommon::start_data_table();
+ $start_page =
+ &Apache::loncommon::start_page('Broadcast List', undef,
+ {only_body => 1,
+ js_ready => 1,});
+ $end_page = &Apache::loncommon::end_page({js_ready => 1,});
+ $body = ''.&mt("Recipients of broadcast message").'
'.
+ &Apache::loncommon::start_data_table();
my $cell = 0;
$body .= &Apache::loncommon::start_data_table_row();
foreach my $item (@{$recipients->{$show.'_broadcast'}}) {
@@ -2738,15 +2818,14 @@ sub displayresource {
sub header {
my ($r,$title,$baseurl)=@_;
-
my $extra = &Apache::loncommon::studentbrowser_javascript();
if ($baseurl) {
$extra .= "";
}
- $r->print(&Apache::loncommon::start_page('Communication and Messages',
+ $r->print(&Apache::loncommon::start_page('Communication',
$extra));
$r->print(&Apache::lonhtmlcommon::breadcrumbs
- (($title?$title:'Communication and Messages')));
+ (($title?$title:'Send and Receive Messages')));
}
# ---------------------------------------------------------------- Print header
@@ -3117,7 +3196,7 @@ sub sendoffmail {
&Apache::loncommunicate::menu($r);
}
} else {
- $r->print(''.&mt('Could not deliver message').' '.
+ $r->print('
'.&Apache::lonhtmlcommon::confirm_success(&mt('Could not deliver message'),1).'
'.
&mt('Please use the browser "Back" button and correct the recipient addresses ([_1]).',$sendstatus).'
');
}
}
@@ -3421,7 +3500,7 @@ sub handler {
my $showfolder = $env{'form.newfolder'};
my ($makeresult,$warning) = &makefolder($env{'form.newfolder'});
if ($makeresult eq 'ok') {
- $r->print(&mt('Mail folder "[_1]" created.',$showfolder).'
');
+ $r->print(&mt('Folder "[_1]" created.',$showfolder).'
');
} else {
$r->print(&mt('Creation failed.').' '.$makeresult.'
'.
$warning);
@@ -3436,7 +3515,7 @@ sub handler {
my $showfolder = '';
my $delresult = &deletefolder($folder);
if ($delresult eq 'ok') {
- $r->print(&mt('Mail folder "[_1]" deleted.',$folder).'
');
+ $r->print(&mt('Folder "[_1]" deleted.',$folder).'
');
$env{'form.folder'} = '';
} else {
$r->print(&mt('Deletion failed.').' '.$delresult.'
');
@@ -3449,7 +3528,7 @@ sub handler {
my $showfolder = $env{'form.renamed'};
my $renresult = &renamefolder($folder);
if ($renresult eq 'ok') {
- $r->print(&mt('Mail folder "[_1]" renamed "[_2]".',$folder,$showfolder).'
');
+ $r->print(&mt('Folder "[_1]" renamed to "[_2]".',$folder,$showfolder).'
');
} else {
$r->print(&mt('Renaming failed.').' '.$renresult.'
');
$showfolder = $folder;