version 1.58, 2006/12/23 18:27:28
|
version 1.59, 2006/12/24 22:13:19
|
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 1950 sub displaymessage {
|
Line 1949 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 1990 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 2019 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 2040 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; |
|
if ($symb) { |
|
&Apache::lonenc::check_decrypt(\$symb); |
|
$symblink = '?symb='.$symb; |
|
} |
|
&Apache::lonenc::check_decrypt(\$baseurl); |
|
$r->print('<br /><b>'.&mt('Refers to').':</b> <a href="'.$baseurl.$symblink.'">'.$restitle.'</a>'); |
|
$refers_to = 1; |
|
} |
|
} |
|
if (!$refers_to) { |
|
if ($baseurl =~ m-^/enc/-) { |
|
if (defined($content{'courseid'})) { |
|
my $unencurl = |
|
&Apache::lonenc::unencrypted($baseurl, |
|
$content{'courseid'}); |
|
if (defined($unencurl)) { |
|
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 2092 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 |