';
+ $result .= &Apache::lonhtmlcommon::start_pick_box()
+ .&Apache::lonhtmlcommon::row_title(&mt('From'),undef,'LC_oddrow_value')
+ .'
'.&Apache::loncommon::aboutmewrapper(
+ &Apache::loncommon::plainname($content{'sendername'},$content{'senderdomain'}),$content{'sendername'},$content{'senderdomain'}).' '
+ .' ('.$content{'sendername'}.':'.$content{'senderdomain'}.')'
+ .&Apache::lonhtmlcommon::row_closure(1)
+ .&Apache::lonhtmlcommon::row_title(&mt('Date'),undef,'LC_evenrow_value')
+ .$content{'time'}
+ .&Apache::lonhtmlcommon::row_closure(1)
+ .&Apache::lonhtmlcommon::row_title(&mt('Subject'),undef,'LC_oddrow_value')
+ .$content{'subject'}
+ .&Apache::lonhtmlcommon::row_closure(1)
+ .&Apache::lonhtmlcommon::row_title(&mt('Message'),undef,'LC_evenrow_value')
+ .'
'.&Apache::lontexconvert::msgtexconverted($content{'message'}).' '
+ .&Apache::lonhtmlcommon::row_closure()
+ .&Apache::lonhtmlcommon::row_title('',undef,'LC_oddrow_value')
+ .'
';
my ($rec_button,$reprec_button);
$rec_button = &mt('Move to Inbox');
if (!$content{'noreplies'}) {
@@ -752,12 +775,17 @@ $content{'sendername'}.':'.
} else {
$result .= &mt('Access to other pages will be prevented until you have moved the message to your inbox.');
}
- $result .= '
'.
- '
';
+ $result .= '
'
+ .&Apache::lonhtmlcommon::row_closure(1)
+ .&Apache::lonhtmlcommon::row_title('',undef,'LC_evenrow_value')
+ .'$lt->{'ad'} :username:domain,username:domain, ...
+$lt->{'ad'} :($exmpl)
$cc
$bcc
@@ -2113,18 +2155,33 @@ sub displaymessage {
$symb=&Apache::lonnet::symbread($content{'baseurl'});
}
if ($env{'user.adv'}) {
- my $adv_actions;
- $r->print(''.&mt('Currently available actions (will open extra window)').': ');
+ my $actionlist='';
if (&Apache::lonnet::allowed('vgr',$env{'request.course.id'})) {
- $r->print(''.&Apache::loncommon::track_student_link(&mt('View recent activity'),$content{'sendername'},$content{'senderdomain'},'check').' ');
- }
+ $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) {
- $r->print(''.&Apache::loncommon::pprmlink(&mt('Set/Change parameters'),$content{'sendername'},$content{'senderdomain'},$symb,'check').' ');
+ $actionlist.=''
+ .&Apache::loncommon::pprmlink(
+ &mt('Set/Change parameters'),$content{'sendername'},$content{'senderdomain'},$symb,'check')
+ .' ';
}
if (&Apache::lonnet::allowed('mgr',$env{'request.course.id'}) && $symb) {
- $r->print(''.&Apache::loncommon::pgrdlink(&mt('Set/Change grades'),$content{'sendername'},$content{'senderdomain'},$symb,'check').' ');
- }
- $r->print('
');
+ $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
+ .'
');
+ }
}
my ($tolist,$cclist);
my (@recipients,@ccs);
@@ -2390,6 +2447,8 @@ sub sendoffmail {
my %msg_status;
my $numsent = 0;
my $nosentstore = 1;
+ my $attachmenturl;
+ my $now = time;
my ($cdom,$cnum,$group);
if (exists($env{'form.group'})) {
$group = $env{'form.group'};
@@ -2412,10 +2471,13 @@ sub sendoffmail {
if ($env{'form.forwid'}) {
my $msgid=$env{'form.forwid'};
my %message=&Apache::lonnet::get('nohist_email'.$suffix,[$msgid]);
- %content=&Apache::lonmsg::unpackagemsg($message{$msgid},1);
+ %content=&Apache::lonmsg::unpackagemsg($message{$msgid},1,1);
&statuschange($msgid,'forwarded',$folder);
- $env{'form.message'}.="\n\n-- Forwarded message --\n\n".
- $content{'message'};
+ if ($content{'attachmenturl'} ne '') {
+ $attachmenturl = $content{'attachmenturl'};
+ }
+ $env{'form.message'} .= "\n\n-- Forwarded message --\n\n".
+ $content{'message'};
}
if ($env{'form.replyid'}) {
my $msgid=$env{'form.replyid'};
@@ -2514,7 +2576,18 @@ sub sendoffmail {
$env{'user.domain'},\%reciphash);
if ($recipstatus ne 'ok') {
&Apache::lonnet::logthis('Failed to store Bcc and Cc recipients for '.$env{'user.name'}.':'.$env{'user.domain'});
- }
+ }
+ if ($env{'form.attachment'}) {
+ if (length($env{'form.attachment'})<131072) {
+ $attachmenturl=&Apache::lonnet::userfileupload('attachment',undef,'feedback/'.$now);
+ } else {
+ $r->print(' '.&mt('Attachment not included - exceeded permitted length').'
');
+ }
+ } elsif ($env{'form.multiforward'}) {
+ if ($env{'form.attachmenturl'} ne '') {
+ $attachmenturl = $env{'form.attachmenturl'};
+ }
+ }
my @recusers;
my @recudoms;
foreach my $address (sort(keys(%toaddr))) {
@@ -2540,7 +2613,7 @@ sub sendoffmail {
&Apache::lonmsg::user_normal_msg($recuname,$recdomain,
$msgsubj,$msgtxt,
$content{'citation'},
- undef,undef,
+ undef,$attachmenturl,
$env{'form.permanent'},
\$sentmessage{$address},
undef,undef,undef,
@@ -2573,7 +2646,7 @@ sub sendoffmail {
$specialresult =
&Apache::lonmsg::user_normal_msg_raw($cnum,$cdom,
$subj_prefix.' '.$course_str,$savemsg,undef,undef,
- undef,undef,undef,\$specialmsgid,undef,undef,undef,
+ $attachmenturl,undef,undef,\$specialmsgid,undef,undef,undef,
undef,undef,1);
$specialmsgid = &unescape($specialmsgid);
if ($specialresult eq 'ok') {
@@ -2590,7 +2663,7 @@ sub sendoffmail {
$pid);
&Apache::lonmsg::user_normal_msg_raw($cnum,$cdom,
$subj_prefix.' ['.$recipient.']',$msgsubj,
- undef,undef,undef,undef,$usermsgid,undef,
+ undef,undef,$attachmenturl,undef,$usermsgid,undef,
undef,$specialmsgid,undef,undef,undef,1);
}
}
@@ -2598,7 +2671,7 @@ sub sendoffmail {
&Apache::lonmsg::process_sent_mail($msgsubj,
$subj_prefix,$numsent,$stamp,$msgname,$msgdom,
$msgcount,$context,$pid,$savemsg,\@recusers,
- \@recudoms);
+ \@recudoms,undef,$attachmenturl);
}
} else {
&Apache::lonnet::logthis('Failed to create record of critical, broadcast or archived message in '.$env{'course.'.$env{'request.course.id'}.'.num'}.' '&mt('at').' '.$env{'course.'.$env{'request.course.id'}.'.domain'}.' - no msgid generated');
@@ -2610,7 +2683,7 @@ sub sendoffmail {
&Apache::lonmsg::process_sent_mail($msgsubj,$subj_prefix,
$numsent,$stamp,$env{'user.name'},
$env{'user.domain'},$msgcount,$context,
- $$,$savemsg,\@recusers,\@recudoms);
+ $$,$savemsg,\@recusers,\@recudoms,undef,$attachmenturl);
}
}
if (!$env{'form.multiforward'}) {
@@ -2627,7 +2700,7 @@ sub sendoffmail {
}
} else {
$r->print(''.&mt('Could not deliver message').' '.
- &mt('Please use the browser "Back" button and correct the recipient addresses '."($sendstatus)").'
');
+ &mt('Please use the browser "Back" button and correct the recipient addresses ([_1]).',$sendstatus).'');
}
}
}
@@ -2862,7 +2935,7 @@ sub handler {
foreach my $item (@to_forward) {
my $msgid=&unescape($item);
my %message=&Apache::lonnet::get('nohist_email'.$suffix,[$msgid]);
- my %content=&Apache::lonmsg::unpackagemsg($message{$msgid},1);
+ my %content=&Apache::lonmsg::unpackagemsg($message{$msgid},1,1);
if ($env{'form.showorigsubj'}) {
$env{'form.subject'} = $fixed_subj.$content{'subject'};
} else {
@@ -2876,8 +2949,10 @@ sub handler {
&Apache::loncommon::plainname($uname,$udom).' ('.
$uname.':'.$udom.')';
}
- $env{'form.message'} .= "\n\n-- Forwarded message --\n\n".
- $content{'message'};
+ $env{'form.message'}.="\n\n-- Forwarded message --\n\n".
+ $content{'message'};
+ $env{'form.attachmenturl'} = $content{'attachmenturl'};
+ $env{'form.multiforwid'} = $item;
$fwdcount ++;
$r->print($fwdcount.': ');
$sendresult{$msgid} = &sendoffmail($r,$folder);