--- loncom/interface/lonwhatsnew.pm 2005/04/07 03:58:02 1.2 +++ loncom/interface/lonwhatsnew.pm 2005/04/07 04:12:31 1.3 @@ -1,5 +1,5 @@ # -# $Id: lonwhatsnew.pm,v 1.2 2005/04/07 03:58:02 albertel Exp $ +# $Id: lonwhatsnew.pm,v 1.3 2005/04/07 04:12:31 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -30,11 +30,11 @@ package Apache::lonwhatsnew; use strict; use lib qw(/home/httpd/lib/perl); use Apache::lonnet; -use Apache::loncommon; -use Apache::lonhtmlcommon; +use Apache::loncommon(); +use Apache::lonhtmlcommon(); use Apache::lonlocal; -use Apache::loncoursedata; -use Apache::lonnavmaps; +use Apache::loncoursedata(); +use Apache::lonnavmaps(); use Apache::Constants qw(:common :http); use Time::Local; @@ -177,9 +177,10 @@ sub display_nav_box { #------------------------------- sub display_header{ + my $html=&Apache::lonxml::xmlbegin(); my $bodytag=&Apache::loncommon::bodytag('Course Action Items'); return(< +$html Course Action Items @@ -256,7 +257,7 @@ END if ($feedurl=~m|^/adm/wrapper/adm/.*/bulletinboard$|) { $feedurl=~s|^/adm/wrapper||; } - my $unreadnum = keys %{$unread{$ressymb}}; + my $unreadnum = keys(%{$unread{$ressymb}}); $unreadnum = $unreadnum - 2; if ($unreadnum > 0) { if ($rowNum %2 == 1) { @@ -416,10 +417,10 @@ sub getitems { my @discussions = (); my ($classlist,$keylist) = &Apache::loncoursedata::get_classlist(); - foreach (keys %lastread) { - my $key = $_; - $key =~ s/_lastread$//; - $lastreadtime{$key} = $lastread{$_}; + foreach my $key (keys(%lastread)) { + my $newkey = $key; + $newkey =~ s/_lastread$//; + $lastreadtime{$newkey} = $lastread{$key}; } foreach my $resource (@allres) { my $result = ''; @@ -469,7 +470,7 @@ sub getitems { my ($map,$ind,$url)=&Apache::lonnet::decode_symb($symb); my ($partlist,$handgrade,$responseType) = &Apache::grades::response_type($url,$symb); foreach my $student (keys(%$classlist)) { - my ($uname,$udom) = split/:/,$student; + my ($uname,$udom) = split(/:/,$student); my %status=&Apache::grades::student_gradeStatus($url,$symb,$udom,$uname,$partlist); my $submitted = 0; my $graded = 0; @@ -510,11 +511,10 @@ sub getmail { my ($newmsgs,$critmsgs) = @_; # Check for unread mail in course my $msgcount = 0; - my @msgids = sort split(/\&/,&Apache::lonnet::reply - ('keys:'.$ENV{'user.domain'}.':'. - $ENV{'user.name'}.':nohist_email', - $ENV{'user.home'})); - foreach my $msgid (@msgids) { + + my @messages = &Apache::lonnet::getkeys('nohist_email'); + foreach my $message (@messages) { + my $msgid=&Apache::lonnet::escape($message); my ($sendtime,$shortsubj,$fromname,$fromdom,$fromcid,$status)= &Apache::lonmsg::unpackmsgid($msgid); if ($fromcid eq $ENV{'request.course.id'}) { @@ -539,7 +539,7 @@ sub getmail { my %what=&Apache::lonnet::dump('critical'); my $result = ''; my $critmsgcount = 0; - foreach my $msgid (sort keys %what) { + foreach my $msgid (sort(keys(%what))) { my ($sendtime,$shortsubj,$fromname,$fromdom,$fromcid,$status)= &Apache::lonmsg::unpackmsgid($_); if ($fromcid eq $ENV{'request.course.id'}) {