version 1.57, 2006/12/23 07:21:00
|
version 1.64, 2007/01/17 18:05:57
|
Line 774 sub sortedmessages {
|
Line 774 sub sortedmessages {
|
my ($blocked,$startblock,$endblock,$numblocked,$folder,$msgstatus) = @_; |
my ($blocked,$startblock,$endblock,$numblocked,$folder,$msgstatus) = @_; |
my $suffix=&Apache::lonmsg::foldersuffix($folder); |
my $suffix=&Apache::lonmsg::foldersuffix($folder); |
my @messages = &Apache::lonnet::getkeys('nohist_email'.$suffix); |
my @messages = &Apache::lonnet::getkeys('nohist_email'.$suffix); |
|
|
#unpack the varibles and repack into temp for sorting |
#unpack the varibles and repack into temp for sorting |
my @temp; |
my @temp; |
my %descriptions; |
my %descriptions; |
Line 789 sub sortedmessages {
|
Line 788 sub sortedmessages {
|
|
|
foreach my $msgid (@messages) { |
foreach my $msgid (@messages) { |
my $esc_msgid=&escape($msgid); |
my $esc_msgid=&escape($msgid); |
my ($sendtime,$shortsubj,$fromname,$fromdomain,$status,$fromcid)= |
my ($sendtime,$shortsubj,$fromname,$fromdomain,$status,$fromcid,$processid,$symb,$error) = |
&Apache::lonmsg::unpackmsgid($esc_msgid,$folder,undef, |
&Apache::lonmsg::unpackmsgid($esc_msgid,$folder,undef, |
\%status_cache); |
\%status_cache); |
next if ($msgstatus ne '' && $msgstatus ne $status); |
next if ($msgstatus ne '' && $msgstatus ne $status); |
Line 925 sub disfolder {
|
Line 924 sub disfolder {
|
nome => 'No messages have been selected to apply ths action to.', |
nome => 'No messages have been selected to apply ths action to.', |
chec => 'Check the checkbox for at least one message.', |
chec => 'Check the checkbox for at least one message.', |
); |
); |
|
my $jscript = &Apache::loncommon::check_uncheck_jscript(); |
$r->print(<<ENDDISHEADER); |
$r->print(<<ENDDISHEADER); |
<script type="text/javascript"> |
<script type="text/javascript"> |
function checkall() { |
$jscript |
for (i=0; i<document.forms.disall.delmark.length; i++) { |
|
document.forms.disall.delmark[i].checked=true; |
|
} |
|
} |
|
|
|
function uncheckall() { |
|
for (i=0; i<document.forms.disall.delmark.length; i++) { |
|
document.forms.disall.delmark[i].checked=false; |
|
} |
|
} |
|
function checkfoldermove() { |
function checkfoldermove() { |
if (document.disall.checkedaction.options[document.disall.checkedaction.selectedIndex].value == 'markedmove') { |
if (document.disall.checkedaction.options[document.disall.checkedaction.selectedIndex].value == 'markedmove') { |
if (document.disall.movetofolder.options[document.disall.movetofolder.selectedIndex].value == "") { |
if (document.disall.movetofolder.options[document.disall.movetofolder.selectedIndex].value == "") { |
Line 957 sub disfolder {
|
Line 948 sub disfolder {
|
} |
} |
} |
} |
var checktotal = 0; |
var checktotal = 0; |
for (var i=0; i<document.forms.disall.delmark.length; i++) { |
if (document.forms.disall.delmark.length > 0) { |
if (document.forms.disall.delmark[i].checked) { |
for (var i=0; i<document.forms.disall.delmark.length; i++) { |
|
if (document.forms.disall.delmark[i].checked) { |
|
checktotal ++; |
|
} |
|
} |
|
} else { |
|
if (document.forms.disall.delmark.checked) { |
checktotal ++; |
checktotal ++; |
} |
} |
} |
} |
if (checktotal == 0) { |
if (checktotal == 0) { |
alert("$lt{'nome'}\\n$lt{'chec'}"); |
alert("$lt{'nome'}\\n$lt{'chec'}"); |
return; |
return; |
Line 1098 ENDDISHEADER
|
Line 1095 ENDDISHEADER
|
$r->print('<table border="0" cellspacing="2" cellpadding="2"> |
$r->print('<table border="0" cellspacing="2" cellpadding="2"> |
<tr> |
<tr> |
<td>'. |
<td>'. |
'<input type="button" onclick="javascript:checkall()" value="'.&mt('Check All').'" /><br />'."\n". |
'<input type="button" onclick="javascript:checkAll(document.disall.delmark)" value="'.&mt('Check All').'" /><br />'."\n". |
'<input type="button" onclick="javascript:uncheckall()" value="'.&mt('Uncheck All').'" />'."\n". |
'<input type="button" onclick="javascript:uncheckAll(document.disall.delmark)" value="'.&mt('Uncheck All').'" />'."\n". |
'<input type="hidden" name="sortedby" value="'.$env{'form.sortedby'}.'" /></td><td> </td>'."\n". |
'<input type="hidden" name="sortedby" value="'.$env{'form.sortedby'}.'" /></td><td> </td>'."\n". |
'<td align="center"><b>'.&mt('Action').'</b><br />'."\n". |
'<td align="center"><b>'.&mt('Action').'</b><br />'."\n". |
' <select name="checkedaction" onchange="javascript:checkfoldermove()">'."\n"); |
' <select name="checkedaction" onchange="javascript:checkfoldermove()">'."\n"); |
Line 1950 sub displaymessage {
|
Line 1947 sub displaymessage {
|
&build_block_table($r,$startblock,$endblock,\%setters); |
&build_block_table($r,$startblock,$endblock,\%setters); |
return; |
return; |
} |
} |
&statuschange($msgid,'read',$folder); |
if ($msgstatus eq '') { |
|
&statuschange($msgid,'read',$folder); |
|
} |
my %message=&Apache::lonnet::get('nohist_email'.$suffix,[$msgid]); |
my %message=&Apache::lonnet::get('nohist_email'.$suffix,[$msgid]); |
my %content=&Apache::lonmsg::unpackagemsg($message{$msgid}); |
my %content=&Apache::lonmsg::unpackagemsg($message{$msgid}); |
|
|
Line 1989 sub displaymessage {
|
Line 1988 sub displaymessage {
|
'"><b>'.&mt('Next').'</b></a></td>'); |
'"><b>'.&mt('Next').'</b></a></td>'); |
} |
} |
$r->print('</tr></table>'); |
$r->print('</tr></table>'); |
|
my $symb; |
|
if (defined($content{'symb'})) { |
|
$symb = $content{'symb'}; |
|
} elsif (defined($content{'baseurl'})) { |
|
$symb=&Apache::lonnet::symbread($content{'baseurl'}); |
|
} |
if ($env{'user.adv'}) { |
if ($env{'user.adv'}) { |
$r->print('<table border="2" width="100%"><tr bgcolor="#FFAAAA"><td>'.&mt('Currently available actions (will open extra window)').':</td>'); |
$r->print('<table border="2" width="100%"><tr bgcolor="#FFAAAA"><td>'.&mt('Currently available actions (will open extra window)').':</td>'); |
my $symb=&Apache::lonnet::symbread($content{'baseurl'}); |
|
if (&Apache::lonnet::allowed('vgr',$env{'request.course.id'})) { |
if (&Apache::lonnet::allowed('vgr',$env{'request.course.id'})) { |
$r->print('<td><b>'.&Apache::loncommon::track_student_link(&mt('View recent activity'),$content{'sendername'},$content{'senderdomain'},'check').'</b></td>'); |
$r->print('<td><b>'.&Apache::loncommon::track_student_link(&mt('View recent activity'),$content{'sendername'},$content{'senderdomain'},'check').'</b></td>'); |
} |
} |
Line 2013 sub displaymessage {
|
Line 2017 sub displaymessage {
|
' ('.$content{'recuser'}[$i].' at '.$content{'recdomain'}[$i].') '; |
' ('.$content{'recuser'}[$i].' at '.$content{'recdomain'}[$i].') '; |
} |
} |
$tolist = join(', ',@recipients); |
$tolist = join(', ',@recipients); |
|
my ($restitle,$baseurl,$refers_to); |
|
if (defined($content{'resource_title'})) { |
|
$restitle = $content{'resource_title'}; |
|
} else { |
|
if (defined($content{'baseurl'})) { |
|
$restitle = &Apache::lonnet::gettitle($content{'baseurl'}); |
|
} |
|
} |
|
if (defined($content{'baseurl'})) { |
|
$baseurl = &Apache::lonenc::check_encrypt($content{'baseurl'}); |
|
} |
$r->print('<br /><b>'.&mt('Subject').':</b> '.$content{'subject'}. |
$r->print('<br /><b>'.&mt('Subject').':</b> '.$content{'subject'}. |
($folder ne 'sent'?'<br /><b>'.&mt('From').':</b> '. |
($folder ne 'sent'?'<br /><b>'.&mt('From').':</b> '. |
&Apache::loncommon::aboutmewrapper( |
&Apache::loncommon::aboutmewrapper( |
Line 2023 sub displaymessage {
|
Line 2038 sub displaymessage {
|
$tolist). |
$tolist). |
($content{'courseid'}?'<br /><b>'.&mt($crstype).':</b> '.$courseinfo{'description'}. |
($content{'courseid'}?'<br /><b>'.&mt($crstype).':</b> '.$courseinfo{'description'}. |
($content{'coursesec'}?' ('.&mt('Section').': '.$content{'coursesec'}.')':''):''). |
($content{'coursesec'}?' ('.&mt('Section').': '.$content{'coursesec'}.')':''):''). |
'<br /><b>'.&mt('Time').':</b> '.$content{'time'}. |
'<br /><b>'.&mt('Time').':</b> '.$content{'time'}); |
($content{'baseurl'}?'<br /><b>'.&mt('Refers to').':</b> <a href="'.$content{'baseurl'}.'">'. |
if ($baseurl) { |
$content{'baseurl'}.' ('.&Apache::lonnet::gettitle($content{'baseurl'}).')</a>':''). |
if (defined($content{'courseid'}) && defined($env{'request.course.id'})) { |
'<p><pre>'. |
if ($content{'courseid'} eq $env{'request.course.id'}) { |
|
my $symblink; |
|
my $showsymb = &Apache::lonenc::check_decrypt($symb); |
|
my $showurl = &Apache::lonenc::check_decrypt($baseurl); |
|
my $encrypturl = &Apache::lonnet::EXT('resource.0.encrypturl', |
|
$showsymb,$env{'user.domain'},$env{'user.name'}); |
|
if ($symb) { |
|
if ($encrypturl =~ /^yes$/i && !$env{'request.role.adv'}) { |
|
$showsymb = &Apache::lonenc::check_encrypt($symb); |
|
} |
|
$symblink = '?symb='.$showsymb; |
|
} |
|
if ($encrypturl =~ /^yes$/i && !$env{'request.role.adv'}) { |
|
$showurl = $baseurl; |
|
} |
|
$r->print('<br /><b>'.&mt('Refers to').':</b> <a href="'.$showurl.$symblink.'">'.$restitle.'</a>'); |
|
$refers_to = 1; |
|
} |
|
} |
|
if (!$refers_to) { |
|
if ($baseurl =~ m-^/enc/-) { |
|
if (defined($content{'courseid'})) { |
|
if (!$env{'request.course.id'}) { |
|
my $unencurl = |
|
&Apache::lonenc::unencrypted($baseurl, |
|
$content{'courseid'}); |
|
if ($unencurl ne '') { |
|
if (&Apache::lonnet::allowed('bre',$unencurl)) { |
|
$r->print('<br /><b>'.&mt('Refers to'). |
|
':</b> <a href="'.$unencurl.'">'. |
|
$restitle.'</a>'); |
|
} |
|
} |
|
} |
|
} |
|
} else { |
|
if (&Apache::lonnet::allowed('bre',$baseurl)) { |
|
$r->print('<br /><b>'.&mt('Refers to'). |
|
':</b> <a href="'.$baseurl. |
|
'">'.$restitle.'</a>'); |
|
} |
|
} |
|
} |
|
} |
|
$r->print('<p><pre>'. |
&Apache::lontexconvert::msgtexconverted($content{'message'},1). |
&Apache::lontexconvert::msgtexconverted($content{'message'},1). |
'</pre><hr />'.&displayresource(%content).'</p>'); |
'</pre><hr />'.&displayresource(%content).'</p>'); |
return; |
return; |
} |
} |
|
|
# =========================================================== Show the citation |
# =========================================================== Show the citation |
Line 2042 sub displayresource {
|
Line 2101 sub displayresource {
|
# |
# |
if (($env{'request.course.id'} eq $content{'courseid'}) |
if (($env{'request.course.id'} eq $content{'courseid'}) |
&& (&Apache::lonnet::allowed('vgr',$content{'courseid'}))) { |
&& (&Apache::lonnet::allowed('vgr',$content{'courseid'}))) { |
my $symb=&Apache::lonnet::symbread($content{'baseurl'}); |
my $symb; |
|
if (defined($content{'symb'})) { |
|
$symb = $content{'symb'}; |
|
} else { |
|
$symb=&Apache::lonnet::symbread($content{'baseurl'}); |
|
} |
# Could not get a symb, give up |
# Could not get a symb, give up |
unless ($symb) { return $content{'citation'}; } |
unless ($symb) { return $content{'citation'}; } |
# Have a symb, can render |
# Have a symb, can render |
Line 2234 sub sendoffmail {
|
Line 2298 sub sendoffmail {
|
my $msgtxt = $savemsg; |
my $msgtxt = $savemsg; |
if ($toaddr{$address}) { $msgtxt.='<hr />'.$toaddr{$address}; } |
if ($toaddr{$address}) { $msgtxt.='<hr />'.$toaddr{$address}; } |
my @thismsg; |
my @thismsg; |
if ((($env{'form.critmsg'}) || ($env{'form.sendbck'})) && |
if ($msgtype eq 'critical') { |
(&Apache::lonnet::allowed('srm',$env{'request.course.id'}) |
$r->print(&mt('Sending critical message').' '. |
|| &Apache::lonnet::allowed('srm',$env{'request.course.id'}. |
$recuname.':'.$recdomain.': '); |
'/'.$env{'request.course.sec'}))) { |
|
$r->print(&mt('Sending critical message').' '.$recuname.':'.$recdomain.': '); |
|
@thismsg= |
@thismsg= |
&Apache::lonmsg::user_crit_msg($recuname,$recdomain, |
&Apache::lonmsg::user_crit_msg($recuname,$recdomain, |
$msgsubj,$msgtxt, |
$msgsubj,$msgtxt, |
Line 2260 sub sendoffmail {
|
Line 2322 sub sendoffmail {
|
$specialmsg_status{$recuname.':'.$recdomain} = |
$specialmsg_status{$recuname.':'.$recdomain} = |
join(' ',@thismsg); |
join(' ',@thismsg); |
foreach my $result (@thismsg) { |
foreach my $result (@thismsg) { |
if ($result eq 'ok') { |
if ($result eq 'ok' || $result eq 'con_delayed') { |
$numspecial++; |
$numspecial++; |
} |
} |
} |
} |