';
+
+ # Functionlist
+ $functions.=&Apache::lonhtmlcommon::start_funclist();
+ foreach my $item (@functionlist) {
+ $functions.=&Apache::lonhtmlcommon::add_item_funclist($item);
+ }
+ $functions .= &Apache::lonhtmlcommon::end_funclist();
+
+ # Actionlist
+ if (@actionlist) {
+ my $legendtext=&mt('Currently available actions (will open extra window)');
+ $functions.=&Apache::lonhtmlcommon::start_funclist($legendtext);
+ foreach my $item (@actionlist) {
+ $functions.=&Apache::lonhtmlcommon::add_item_funclist($item);
+ }
+ $functions.=&Apache::lonhtmlcommon::end_funclist();
+ }
+
+ $functions.='
';
+ $r->print(&Apache::loncommon::head_subbox($functions));
+
+
my ($tonum,$tolist,$cclist,$bcclist,$groupcclist,%recipients);
if ($content{'recipid'}) {
$tonum = &retrieve_recips('display',\%content,\%recipients);
@@ -2332,7 +2422,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(
@@ -2354,21 +2453,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'}
@@ -2376,10 +2468,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
@@ -2633,13 +2727,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 = '
+//
ENDJS
@@ -2736,15 +2831,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
@@ -3115,7 +3209,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).'
');
}
}
@@ -3142,7 +3236,7 @@ sub handler {
'recordftf','sortedby','block','folder','startdis','interdis',
'showcommentbaseurl','dismode','group','subject','text','ref',
'msgstatus']);
- $sqs='&sortedby='.$env{'form.sortedby'};
+ $sqs='&sortedby='.$env{'form.sortedby'};
# ------------------------------------------------------ They checked for email
unless ($env{'form.block'}) {
@@ -3163,7 +3257,7 @@ sub handler {
unless ($folder) {
$folder='';
} else {
- $sqs.='&folder='.&escape($folder);
+ $sqs.='&folder='.&escape($folder);
}
# ------------------------------------------------------------ Get Display Mode
@@ -3195,7 +3289,7 @@ sub handler {
$startdis++;
}
my $postedstartdis=$startdis+1;
- $sqs.='&startdis='.$postedstartdis;
+ $sqs.='&startdis='.$postedstartdis;
# --------------------------------------------------------------- Render Output
@@ -3259,7 +3353,7 @@ sub handler {
$total ++;
}
&printheader($r,'','Marked Messages Read');
- $r->print(&mt('Marked [_1] message(s) read',$total).'');
+ $r->print(&mt('Marked [quant,_1,message] read',$total).'
');
&Apache::loncommunicate::menu($r);
&disall($r,($folder?$folder:$dismode),$msgstatus);
} elsif ($env{'form.markedaction'} eq 'markedunread') {
@@ -3270,7 +3364,7 @@ sub handler {
$total ++;
}
&printheader($r,'','Marked Messages Unread');
- $r->print(&mt('Marked [_1] message(s) unread',$total).'
');
+ $r->print(&mt('Marked [quant,_1,message] unread',$total).'
');
&Apache::loncommunicate::menu($r);
&disall($r,($folder?$folder:$dismode),$msgstatus);
} elsif ($env{'form.markedaction'} eq 'markedmove') {
@@ -3294,14 +3388,17 @@ sub handler {
}
}
if ($failed) {
- $r->print('
- '.&mt('Failed to move [_1] message(s)',$failed).
- '
');
+ $r->print(''
+ .&mt('Failed to move [quant,_1,message]',$failed)
+ .'
');
$r->print(''.
join("
\n",@failed_msg).
"
\n");
}
- $r->print(&mt('Moved [_1] message(s)',$total).'');
+ $r->print('
'
+ .&mt('Moved [quant,_1,message]',$total)
+ .'
'
+ .'');
}
&Apache::loncommunicate::menu($r);
&disall($r,($folder?$folder:$dismode),$msgstatus);
@@ -3320,14 +3417,17 @@ sub handler {
}
&printheader($r,'','Deleted Messages');
if ($failed) {
- $r->print('
- '.&mt('Failed to delete [_1] message(s)',$failed).
- '
');
+ $r->print(''
+ .&mt('Failed to delete [quant,_1,message]',$failed)
+ .'
');
$r->print(''.
join("
\n",@failed_msg).
"
\n");
}
- $r->print(&mt('Deleted [_1] message(s)',$total).'');
+ $r->print('
'
+ .&mt('Deleted [quant,_1,message]',$total)
+ .'
'
+ .'');
&Apache::loncommunicate::menu($r);
&disall($r,($folder?$folder:$dismode),$msgstatus);
} elsif ($env{'form.markunread'}) {
@@ -3419,10 +3519,14 @@ 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);
+ $r->print(''
+ .&mt('Creation failed.').' '.$makeresult.'
'
+ .$warning
+ .'
');
$showfolder = $folder;
}
&Apache::loncommunicate::menu($r);
@@ -3434,10 +3538,14 @@ 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.'
');
+ $r->print(''
+ .&mt('Deletion failed.').' '.$delresult
+ .'
');
$showfolder = $folder;
}
&Apache::loncommunicate::menu($r);
@@ -3447,9 +3555,13 @@ 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.'
');
+ $r->print(''
+ .&mt('Renaming failed.').' '.$renresult
+ .'
');
$showfolder = $folder;
}
&Apache::loncommunicate::menu($r);