[LON-CAPA-cvs] cvs: loncom /interface lonannounce.pm
albertel
lon-capa-cvs-allow@mail.lon-capa.org
Thu, 10 May 2007 18:49:39 -0000
albertel Thu May 10 14:49:39 2007 EDT
Modified files:
/loncom/interface lonannounce.pm
Log:
- make parms show up in cal again
Index: loncom/interface/lonannounce.pm
diff -u loncom/interface/lonannounce.pm:1.67 loncom/interface/lonannounce.pm:1.68
--- loncom/interface/lonannounce.pm:1.67 Fri Mar 2 21:16:17 2007
+++ loncom/interface/lonannounce.pm Thu May 10 14:49:39 2007
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Announce
#
-# $Id: lonannounce.pm,v 1.67 2007/03/03 02:16:17 albertel Exp $
+# $Id: lonannounce.pm,v 1.68 2007/05/10 18:49:39 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -89,12 +89,14 @@
if ($courseid eq $env{'request.course.id'}) {
$navmap = Apache::lonnavmaps::navmap->new();
}
- my %resourcedata=
+
+ my $resourcedata=
&Apache::lonnet::get_courseresdata($coursenum,$coursedom);
- foreach my $thiskey (sort keys %resourcedata) {
- if ($resourcedata{$thiskey.'.type'}=~/^date/) {
+ foreach my $thiskey (keys(%$resourcedata)) {
+ if ($resourcedata->{$thiskey.'.type'}=~/^date/) {
my ($course,$middle,$part,$name)=
- ($thiskey=~/^($match_courseid)\.(?:(.+)\.)*([\w\s]+)\.(\w+)$/);
+ ($thiskey=~/^(\Q$courseid\E)\.(?:(.+)\.)*([\w\s]+)\.(\w+)$/);
+
my %data = ( 'section' => &mt('All Students'));
if ($middle=~/^\[(.*)\]\./) {
my $sec=$1;
@@ -120,7 +122,9 @@
}
if (!$can_see_hidden) {
my $res = $navmap->getResourceByUrl($map_url);
- if ($res && $res->randomout()) { next; }
+ if ($res && $res->randomout()) {
+ next;
+ }
}
$data{'realm'}=&mt('Folder/Map');
$data{'url'} = $map_url;
@@ -130,7 +134,9 @@
}
if (!$can_see_hidden) {
my $res = $navmap->getBySymb($middle);
- if ($res && $res->randomout()) { next; }
+ if ($res && $res->randomout()) {
+ next;
+ }
}
$data{'realm'} = &mt('Resource');
$data{'symb'} = $middle;
@@ -141,7 +147,7 @@
# see if accidentally answerdate is before duedate
my $answerkey=$thiskey;
$answerkey=~s/duedate$/answerdate/;
- if ($resourcedata{$thiskey}>$resourcedata{$answerkey}) {
+ if ($resourcedata->{$thiskey}>$resourcedata->{$answerkey}) {
$data{'datetype'} = &mt('Due and Answer Available');
}
}
@@ -156,15 +162,15 @@
# see if accidentally answerdate is before duedate
my $duekey=$thiskey;
$duekey=~s/answerdate$/duedate/;
- if ($resourcedata{$duekey}>$resourcedata{$thiskey}) {
+ if ($resourcedata->{$duekey}>$resourcedata->{$thiskey}) {
# forget it
next;
}
$data{'datetype'}=&mt('Answer Available');
}
$returnhash{join("\0",$courseid,
- $resourcedata{$thiskey},
- $resourcedata{$thiskey})}=\%data;
+ $resourcedata->{$thiskey},
+ $resourcedata->{$thiskey})}=\%data;
}
}
return %returnhash;