version 1.4, 2005/04/07 04:22:03
|
version 1.5, 2005/04/07 06:56:23
|
Line 47 sub handler {
|
Line 47 sub handler {
|
my $r = shift; |
my $r = shift; |
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['command']); |
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['command']); |
|
|
my $command = $ENV{'form.command'}; |
my $command = $env{'form.command'}; |
|
|
if ($command eq '') { |
if ($command eq '') { |
$command = "info"; |
$command = "info"; |
} |
} |
|
|
$r->print(&display_header()); |
$r->print(&display_header()); |
if (! (($ENV{'request.course.fn'}) && (&Apache::lonnet::allowed('vsa',$ENV{'request.course.id'})))) { |
if (! (($env{'request.course.fn'}) && (&Apache::lonnet::allowed('vsa',$env{'request.course.id'})))) { |
# Not in a course, or not allowed to modify parms |
# Not in a course, or not allowed to modify parms |
$ENV{'user.error.msg'}="/adm/whatsnew:vsa:0:0:Cannot display student activity"; |
$env{'user.error.msg'}="/adm/whatsnew:vsa:0:0:Cannot display student activity"; |
return HTTP_NOT_ACCEPTABLE; |
return HTTP_NOT_ACCEPTABLE; |
} |
} |
|
|
Line 213 sub display_actions_box() {
|
Line 213 sub display_actions_box() {
|
|
|
my $domain=&Apache::loncommon::determinedomain(); |
my $domain=&Apache::loncommon::determinedomain(); |
my $function; |
my $function; |
if ($ENV{'request.role'}=~/^(cc|in|ta|ep)/) { |
if ($env{'request.role'}=~/^(cc|in|ta|ep)/) { |
$function='coordinator'; |
$function='coordinator'; |
} |
} |
if ($ENV{'request.role'}=~/^(su|dc|ad|li)/) { |
if ($env{'request.role'}=~/^(su|dc|ad|li)/) { |
$function='admin'; |
$function='admin'; |
} |
} |
|
|
Line 226 sub display_actions_box() {
|
Line 226 sub display_actions_box() {
|
&getitems(\%unread,\%ungraded,\%bombed,\@newdiscussions,\@tograde,\@bombs); |
&getitems(\%unread,\%ungraded,\%bombed,\@newdiscussions,\@tograde,\@bombs); |
my ($msgcount,$critmsgcount) = &getmail(\@newmsgs,\@critmsgs); |
my ($msgcount,$critmsgcount) = &getmail(\@newmsgs,\@critmsgs); |
|
|
unless ($ENV{'request.course.id'}) { |
unless ($env{'request.course.id'}) { |
$r->print('<br /><b><center>You are accessing an invalid course</center></b><br /><br />'); |
$r->print('<br /><b><center>You are accessing an invalid course</center></b><br /><br />'); |
return; |
return; |
} |
} |
Line 405 sub getitems {
|
Line 405 sub getitems {
|
my $navmap = Apache::lonnavmaps::navmap->new(); |
my $navmap = Apache::lonnavmaps::navmap->new(); |
my @allres=$navmap->retrieveResources(); |
my @allres=$navmap->retrieveResources(); |
my %discussiontime = &Apache::lonnet::dump('discussiontimes', |
my %discussiontime = &Apache::lonnet::dump('discussiontimes', |
$ENV{'course.'.$ENV{'request.course.id'}.'.domain'}, |
$env{'course.'.$env{'request.course.id'}.'.domain'}, |
$ENV{'course.'.$ENV{'request.course.id'}.'.num'}); |
$env{'course.'.$env{'request.course.id'}.'.num'}); |
my %lastread = &Apache::lonnet::dump('nohist_'.$ENV{'request.course.id'}.'_discuss',$ENV{'user.domain'},$ENV{'user.name'},'lastread'); |
my %lastread = &Apache::lonnet::dump('nohist_'.$env{'request.course.id'}.'_discuss',$env{'user.domain'},$env{'user.name'},'lastread'); |
my %lastreadtime = (); |
my %lastreadtime = (); |
my @discussions = (); |
my @discussions = (); |
my ($classlist,$keylist) = &Apache::loncoursedata::get_classlist(); |
my ($classlist,$keylist) = &Apache::loncoursedata::get_classlist(); |
Line 441 sub getitems {
|
Line 441 sub getitems {
|
if (defined($lastreadtime{$ressymb})) { |
if (defined($lastreadtime{$ressymb})) { |
$prevread = $lastreadtime{$ressymb}; |
$prevread = $lastreadtime{$ressymb}; |
} |
} |
my %contrib = &Apache::lonnet::restore($ressymb,$ENV{'request.course.id'}, |
my %contrib = &Apache::lonnet::restore($ressymb,$env{'request.course.id'}, |
$ENV{'course.'.$ENV{'request.course.id'}.'.domain'}, |
$env{'course.'.$env{'request.course.id'}.'.domain'}, |
$ENV{'course.'.$ENV{'request.course.id'}.'.num'}); |
$env{'course.'.$env{'request.course.id'}.'.num'}); |
if ($contrib{'version'}) { |
if ($contrib{'version'}) { |
for (my $id=1;$id<=$contrib{'version'};$id++) { |
for (my $id=1;$id<=$contrib{'version'};$id++) { |
unless (($contrib{'hidden'}=~/\.$id\./) || ($contrib{'deleted'}=~/\.$id\./)) { |
unless (($contrib{'hidden'}=~/\.$id\./) || ($contrib{'deleted'}=~/\.$id\./)) { |
Line 510 sub getmail {
|
Line 510 sub getmail {
|
my $msgid=&Apache::lonnet::escape($message); |
my $msgid=&Apache::lonnet::escape($message); |
my ($sendtime,$shortsubj,$fromname,$fromdom,$fromcid,$status)= |
my ($sendtime,$shortsubj,$fromname,$fromdom,$fromcid,$status)= |
&Apache::lonmsg::unpackmsgid($msgid); |
&Apache::lonmsg::unpackmsgid($msgid); |
if ($fromcid eq $ENV{'request.course.id'}) { |
if ($fromcid eq $env{'request.course.id'}) { |
if (defined($sendtime) && $sendtime!~/error/) { |
if (defined($sendtime) && $sendtime!~/error/) { |
my $numsendtime = $sendtime; |
my $numsendtime = $sendtime; |
$sendtime = &Apache::lonlocal::locallocaltime($sendtime); |
$sendtime = &Apache::lonlocal::locallocaltime($sendtime); |
Line 535 sub getmail {
|
Line 535 sub getmail {
|
foreach my $msgid (sort(keys(%what))) { |
foreach my $msgid (sort(keys(%what))) { |
my ($sendtime,$shortsubj,$fromname,$fromdom,$fromcid,$status)= |
my ($sendtime,$shortsubj,$fromname,$fromdom,$fromcid,$status)= |
&Apache::lonmsg::unpackmsgid($_); |
&Apache::lonmsg::unpackmsgid($_); |
if ($fromcid eq $ENV{'request.course.id'}) { |
if ($fromcid eq $env{'request.course.id'}) { |
if (defined($sendtime) && $sendtime!~/error/) { |
if (defined($sendtime) && $sendtime!~/error/) { |
my $numsendtime = $sendtime; |
my $numsendtime = $sendtime; |
$sendtime = &Apache::lonlocal::locallocaltime($sendtime); |
$sendtime = &Apache::lonlocal::locallocaltime($sendtime); |