version 1.74, 2007/05/02 20:26:08
|
version 1.78, 2007/05/05 03:14:21
|
Line 737 $content{'sendername'}.':'.
|
Line 737 $content{'sendername'}.':'.
|
'<br />'.&mt('Subject').': '.$content{'subject'}. |
'<br />'.&mt('Subject').': '.$content{'subject'}. |
'<br /><pre>'. |
'<br /><pre>'. |
&Apache::lontexconvert::msgtexconverted($content{'message'}). |
&Apache::lontexconvert::msgtexconverted($content{'message'}). |
'</pre><small>'. |
'</pre><small>'; |
&mt('You have to confirm that you received this message. After confirmation, this message will be moved to your regular inbox'). |
my ($rec_button,$reprec_button); |
'</small><br />'. |
$rec_button = &mt('Move to Inbox'); |
'<input type="submit" name="rec_'.$key.'" value="'.&mt('Confirm Receipt').'" />'. |
if (!$content{'noreplies'}) { |
'<input type="submit" name="reprec_'.$key.'" '. |
$reprec_button = &mt('Move to Inbox/Compose reply'); |
'value="'.&mt('Confirm Receipt and Reply').'" />'; |
} |
|
if ($content{'sendback'}) { |
|
$rec_button = &mt('Confirm Receipt'); |
|
if (!$content{'noreplies'}) { |
|
$reprec_button = &mt('Confirm Receipt and Reply'); |
|
} |
|
$result .= &mt('You have to confirm that you have received this message before you can view other pages. After confirmation, this message will be moved to your regular inbox'); |
|
} else { |
|
$result .= &mt('Access to other pages will be prevented until you have moved the message to your inbox.'); |
|
} |
|
$result .= '</small><br />'. |
|
'<input type="submit" name="rec_'.$key.'" value="'.$rec_button.'" />'; |
|
if (!$content{'noreplies'}) { |
|
$result .= '<input type="submit" name="reprec_'.$key.'" '. |
|
'value="'.$reprec_button.'" />'; |
|
} |
} |
} |
# Check to see if there were any messages. |
# Check to see if there were any messages. |
if ($result eq '') { |
if ($result eq '') { |
Line 1209 will be forwarded to the recipient(s) yo
|
Line 1224 will be forwarded to the recipient(s) yo
|
my %lt=&Apache::lonlocal::texthash('us' => 'Username', |
my %lt=&Apache::lonlocal::texthash('us' => 'Username', |
'do' => 'Domain', |
'do' => 'Domain', |
'ad' => 'Additional Recipients', |
'ad' => 'Additional Recipients', |
|
'rt' => 'Reply to', |
|
'ar' => 'Allow replies', |
'sb' => 'Subject', |
'sb' => 'Subject', |
'ca' => 'Cancel', |
'ca' => 'Cancel', |
'ma' => 'Mail', |
'ma' => 'Mail', |
Line 1319 ENDREPSCRIPT
|
Line 1336 ENDREPSCRIPT
|
} |
} |
if (($broadcast ne 'group') && ($broadcast ne 'upload')) { |
if (($broadcast ne 'group') && ($broadcast ne 'upload')) { |
if ($replying) { |
if ($replying) { |
$r->print('<tr><td colspan="2">'.&mt('Replying to').' '. |
if ($content{'noreplies'}) { |
&Apache::loncommon::aboutmewrapper( |
$r->print('<tr><td>'.&mt('This message was designated by the sender not to allow replies.').'</td></tr></table></form>'); |
|
return; |
|
} |
|
$r->print('<tr><td colspan="2">'.&mt('Replying to').' '); |
|
if ($content{'replytoaddr'}) { |
|
my ($replytoname,$replytodom) = split(/:/,$content{'replytoaddr'}); |
|
if ($replytoname ne '' && $replytodom ne '') { |
|
$r->print(&Apache::loncommon::plainname($replytoname, |
|
$replytodom).' ('.$replytoname.':'. |
|
$replytodom.')'); |
|
$r->print('<input type="hidden" name="recuname" value="'. |
|
$replytoname.'" />'. |
|
'<input type="hidden" name="recdomain" value="'. |
|
$replytodom.'" /></td></tr>'); |
|
|
|
} else { |
|
$r->print(&mt('The sender did not designate a reply to address for this message.').'</td></tr></table>'); |
|
return; |
|
} |
|
} else { |
|
$r->print(&Apache::loncommon::aboutmewrapper( |
&Apache::loncommon::plainname($content{'sendername'},$content{'senderdomain'}),$content{'sendername'},$content{'senderdomain'}).' ('. |
&Apache::loncommon::plainname($content{'sendername'},$content{'senderdomain'}),$content{'sendername'},$content{'senderdomain'}).' ('. |
$content{'sendername'}.':'. |
$content{'sendername'}.':'. |
$content{'senderdomain'}.')'. |
$content{'senderdomain'}.')'); |
'<input type="hidden" name="recuname" value="'.$content{'sendername'}.'" />'. |
$r->print('<input type="hidden" name="recuname" value="'. |
'<input type="hidden" name="recdomain" value="'.$content{'senderdomain'}.'" />'. |
$content{'sendername'}.'" />'. |
'</td></tr>'); |
'<input type="hidden" name="recdomain" value="'. |
|
$content{'senderdomain'}.'" /></td></tr>'); |
|
} |
if ($content{'recipid'}) { |
if ($content{'recipid'}) { |
my @ccs = &retrieve_cc_recips('replying',%content); |
my @ccs = &retrieve_cc_recips('replying',%content); |
if (@ccs > 0) { |
if (@ccs > 0) { |
Line 1379 $latexHelp.
|
Line 1418 $latexHelp.
|
} elsif ($broadcast ne 'upload') { |
} elsif ($broadcast ne 'upload') { |
$subj_size = '50'; |
$subj_size = '50'; |
$r->print(&additional_rec_row(\%lt)); |
$r->print(&additional_rec_row(\%lt)); |
|
if (&Apache::lonnet::allowed('srm',$env{'request.course.id'}) |
|
|| &Apache::lonnet::allowed('srm',$env{'request.course.id'}. |
|
'/'.$env{'request.course.sec'})) { |
|
$r->print(&reply_to_row(\%lt)); |
|
} |
$r->print(&msg_subject_row($dissub,\%lt,$subj_size)); |
$r->print(&msg_subject_row($dissub,\%lt,$subj_size)); |
$r->print(<<"ENDCOMP"); |
$r->print(<<"ENDCOMP"); |
</table> |
</table> |
Line 1453 sub recipient_input_row {
|
Line 1497 sub recipient_input_row {
|
&Apache::loncommon::selectstudent_link('compemail','recuname', |
&Apache::loncommon::selectstudent_link('compemail','recuname', |
'recdomain'); |
'recdomain'); |
my $output = <<"ENDREC"; |
my $output = <<"ENDREC"; |
<tr><td>$lt{'us'}:</td><td><input type="text" size="12" name="recuname" value="$env{'form.recname'}" /></td><td rowspan="2">$selectlink</td></tr> |
<tr><td colspan="2"><span class="LC_nobreak">$lt{'us'}: <input type="text" size="12" name="recuname" value="$env{'form.recname'}" /> $lt{'do'}: $domform $selectlink</span></td></tr> |
<tr><td>$lt{'do'}:</td> |
|
<td>$domform</td></tr> |
|
ENDREC |
ENDREC |
return $output; |
return $output; |
} |
} |
|
|
|
sub reply_to_row { |
|
my ($lt) = @_; |
|
my $radioyes = &mt('Yes'); |
|
my $radiono = &mt('No'); |
|
my $output = <<"ENDREP"; |
|
<tr><td colspan="2"><span class="LC_nobreak">$lt->{'ar'}:<label><input type="radio" name="can_reply" value="Y" checked="checked" />$radioyes</label> <label><input type="radio" name="can_reply" value="N" />$radiono</label></span> <span class="LC_nobreak">$lt->{'rt'}: <input type="text" size="25" name="reply_to_addr" value="$env{'user.name'}:$env{'user.domain'}" /></span></td></tr> |
|
ENDREP |
|
return $output; |
|
} |
|
|
sub additional_rec_row { |
sub additional_rec_row { |
my ($lt) = @_; |
my ($lt) = @_; |
my $cc = &mt('Cc:'); |
my $cc = &mt('Cc:'); |
Line 1467 sub additional_rec_row {
|
Line 1519 sub additional_rec_row {
|
my $output = <<"ENDADD"; |
my $output = <<"ENDADD"; |
<tr><td>$lt->{'ad'} :<br /><tt>username:domain,username:domain, ... |
<tr><td>$lt->{'ad'} :<br /><tt>username:domain,username:domain, ... |
</tt></td><td> <span class="span.LC_nobreak">$cc |
</tt></td><td> <span class="span.LC_nobreak">$cc |
<input type="text" size="50" name="additionalrec_cc" /></nospan><br /> |
<input type="text" size="50" name="additionalrec_cc" /></span><br /> |
<span class="span.LC_nobreak">$bcc <input type="text" size="50" name="additionalrec_bcc" /></nospan></td></tr> |
<span class="span.LC_nobreak">$bcc <input type="text" size="50" name="additionalrec_bcc" /></span></td></tr> |
ENDADD |
ENDADD |
return $output; |
return $output; |
} |
} |
Line 1486 sub submit_button_row {
|
Line 1538 sub submit_button_row {
|
|
|
sub msg_subject_row { |
sub msg_subject_row { |
my ($dissub,$lt,$subj_size,$extra) = @_; |
my ($dissub,$lt,$subj_size,$extra) = @_; |
my $output = '<tr><td>'.$lt->{'sb'}.':</td><td><input type="text" size="'. |
my $output = '<tr><td colspan="2">'.$lt->{'sb'}.': <input type="text" size="'. |
$subj_size.'" name="subject" value="'.$dissub.'" />'.$extra. |
$subj_size.'" name="subject" value="'.$dissub.'" />'.$extra. |
'</td></tr>'; |
'</td></tr>'; |
return $output; |
return $output; |
Line 2027 sub displaymessage {
|
Line 2079 sub displaymessage {
|
&printheader($r,'/adm/email?display='.&escape($msgid),'Display a Message','',$content{'baseurl'}); |
&printheader($r,'/adm/email?display='.&escape($msgid),'Display a Message','',$content{'baseurl'}); |
my %courseinfo=&Apache::lonnet::coursedescription($content{'courseid'}); |
my %courseinfo=&Apache::lonnet::coursedescription($content{'courseid'}); |
# Functions |
# Functions |
$r->print('<table border="2" width="100%"><tr bgcolor="#FFFFAA"><td>'.&mt('Functions').':</td>'. |
$r->print('<table border="2" width="100%"><tr bgcolor="#FFFFAA"><td>'.&mt('Functions').':</td>'); |
'<td><a href="/adm/email?replyto='.&escape($msgid).$sqs. |
if (!$content{'noreplies'}) { |
'"><b>'.&mt('Reply').'</b></a></td>'. |
$r->print('<td><a href="/adm/email?replyto='.&escape($msgid).$sqs. |
'<td><a href="/adm/email?forward='.&escape($msgid).$sqs. |
'"><b>'.&mt('Reply').'</b></a></td>'); |
|
} |
|
$r->print('<td><a href="/adm/email?forward='.&escape($msgid).$sqs. |
'"><b>'.&mt('Forward').'</b></a></td>'. |
'"><b>'.&mt('Forward').'</b></a></td>'. |
'<td><a href="/adm/email?markunread='.&escape($msgid).$sqs. |
'<td><a href="/adm/email?markunread='.&escape($msgid).$sqs. |
'"><b>'.&mt('Mark Unread').'</b></a></td>'. |
'"><b>'.&mt('Mark Unread').'</b></a></td>'. |
Line 2074 sub displaymessage {
|
Line 2128 sub displaymessage {
|
&Apache::loncommon::plainname($content{'recuser'}[$i], |
&Apache::loncommon::plainname($content{'recuser'}[$i], |
$content{'recdomain'}[$i]), |
$content{'recdomain'}[$i]), |
$content{'recuser'}[$i],$content{'recdomain'}[$i]). |
$content{'recuser'}[$i],$content{'recdomain'}[$i]). |
' ('.$content{'recuser'}[$i].' at '.$content{'recdomain'}[$i].') '; |
' ('.$content{'recuser'}[$i].' '.&mt('at').' '.$content{'recdomain'}[$i].') '; |
} |
} |
} |
} |
$tolist = join(', ',@recipients); |
$tolist = join(', ',@recipients); |
Line 2097 sub displaymessage {
|
Line 2151 sub displaymessage {
|
$r->print('<br /><b>'.&mt('Subject').':</b> '.$content{'subject'}); |
$r->print('<br /><b>'.&mt('Subject').':</b> '.$content{'subject'}); |
if ($folder eq 'sent') { |
if ($folder eq 'sent') { |
$r->print('<br /><b>'.&mt('To').':</b> '.$tolist); |
$r->print('<br /><b>'.&mt('To').':</b> '.$tolist); |
|
if ($content{'replytoaddr'}) { |
|
my ($replytoname,$replytodom) = split(/:/,$content{'replytoaddr'}); |
|
if ($replytoname ne '' && $replytodom ne '') { |
|
$r->print('<br /><b>'.&mt('Reply To').':</b> '. |
|
$replytoname.' '.&mt('at').' '.$replytodom); |
|
} |
|
} |
} else { |
} else { |
$r->print('<br /><b>'.&mt('From').':</b> '. |
$r->print('<br /><b>'.&mt('From').':</b> '. |
&Apache::loncommon::aboutmewrapper( |
&Apache::loncommon::aboutmewrapper( |
&Apache::loncommon::plainname($content{'sendername'},$content{'senderdomain'}), |
&Apache::loncommon::plainname($content{'sendername'},$content{'senderdomain'}), |
$content{'sendername'},$content{'senderdomain'}).' ('. |
$content{'sendername'},$content{'senderdomain'})); |
$content{'sendername'}.' at '. |
if ($content{'noreplies'}) { |
$content{'senderdomain'}.') '); |
$r->print(' ('.&mt('No replies to sender').')'); |
if ($cclist) { |
} else { |
$r->print('<br /><b>'.&mt('Cc').':</b> '.$cclist); |
if ($content{'replytoaddr'}) { |
} |
my ($replytoname,$replytodom) = split(/:/,$content{'replytoaddr'}); |
|
if ($replytoname ne '' && $replytodom ne '') { |
|
$r->print('<br /><b>'.&mt('Reply To').':</b> '. |
|
$replytoname.' '.&mt('at').' '.$replytodom); |
|
} |
|
} else { |
|
$r->print(' ('.$content{'sendername'}.' '&mt('at').' '. |
|
$content{'senderdomain'}.') '); |
|
} |
|
if ($cclist) { |
|
$r->print('<br /><b>'.&mt('Cc').':</b> '.$cclist); |
|
} |
|
} |
} |
} |
if ($content{'courseid'}) { |
if ($content{'courseid'}) { |
$r->print('<br /><b>'.&mt($crstype).':</b> '.$courseinfo{'description'}); |
$r->print('<br /><b>'.&mt($crstype).':</b> '.$courseinfo{'description'}); |
Line 2519 sub sendoffmail {
|
Line 2592 sub sendoffmail {
|
\@recudoms); |
\@recudoms); |
} |
} |
} else { |
} else { |
&Apache::lonnet::logthis('Failed to create record of critical, broadcast or archived message in '.$env{'course.'.$env{'request.course.id'}.'.num'}.' at '.$env{'course.'.$env{'request.course.id'}.'.domain'}.' - no msgid generated'); |
&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'); |
} |
} |
} else { |
} else { |
my $stamp = time; |
my $stamp = time; |
Line 2636 sub handler {
|
Line 2709 sub handler {
|
&printheader($r,'','Confirmed Receipt'); |
&printheader($r,'','Confirmed Receipt'); |
my $replying = 0; |
my $replying = 0; |
foreach my $envkey (keys(%env)) { |
foreach my $envkey (keys(%env)) { |
if ($envkey=~/^form\.rec\_(.*)$/) { |
if ($envkey=~/^form\.(rep)?rec\_(.*)$/) { |
$r->print('<b>'.&mt('Confirming Receipt').':</b> '. |
my $repchk = $1; |
&Apache::lonmsg::user_crit_received($1).'<br>'); |
my $msgid = $2; |
} |
$r->print('<b>'.&mt('Confirming Receipt').':</b> '); |
if ($envkey=~/^form\.reprec\_(.*)$/) { |
my $result = &Apache::lonmsg::user_crit_received($msgid); |
my $msgid=$1; |
if ($result =~ /trans:\s+ok/) { |
$r->print('<b>'.&mt('Confirming Receipt').':</b> '. |
&statuschange($msgid,'read'); |
&Apache::lonmsg::user_crit_received($msgid).'<br>'); |
} |
&compout($r,'','','',$msgid); |
$r->print($result.'<br />'); |
$replying = 1; |
if ($repchk eq 'rep') { |
|
&compout($r,'','','',$msgid); |
|
$replying = 1; |
|
} |
} |
} |
} |
} |
if (!$replying) { |
if (!$replying) { |