[LON-CAPA-cvs] cvs: loncom /interface lonwhatsnew.pm

albertel lon-capa-cvs@mail.lon-capa.org
Thu, 07 Apr 2005 04:12:31 -0000


albertel		Thu Apr  7 00:12:31 2005 EDT

  Modified files:              
    /loncom/interface	lonwhatsnew.pm 
  Log:
  - style police
  
  
Index: loncom/interface/lonwhatsnew.pm
diff -u loncom/interface/lonwhatsnew.pm:1.2 loncom/interface/lonwhatsnew.pm:1.3
--- loncom/interface/lonwhatsnew.pm:1.2	Wed Apr  6 23:58:02 2005
+++ loncom/interface/lonwhatsnew.pm	Thu Apr  7 00:12:31 2005
@@ -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 @@
 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_header{
+    my $html=&Apache::lonxml::xmlbegin();
     my $bodytag=&Apache::loncommon::bodytag('Course Action Items');
     return(<<ENDHEAD);
-<html>
+$html
 <head>
 <title>Course Action Items</title>
 </head>
@@ -256,7 +257,7 @@
             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 @@
     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 @@
             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 @@
     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 @@
     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'}) {