[LON-CAPA-cvs] cvs: loncom /interface lonwhatsnew.pm
raeburn
lon-capa-cvs@mail.lon-capa.org
Mon, 05 Dec 2005 19:27:53 -0000
raeburn Mon Dec 5 14:27:53 2005 EDT
Modified files:
/loncom/interface lonwhatsnew.pm
Log:
Default time interval for versions checking now 1 week. Name of "users_in_queue" subroutine in bridgetasks.pm had been changed. Sanity check for resources returned from navmap->getResourceByUrl(). Remove debugging and fix some typos.
Index: loncom/interface/lonwhatsnew.pm
diff -u loncom/interface/lonwhatsnew.pm:1.34 loncom/interface/lonwhatsnew.pm:1.35
--- loncom/interface/lonwhatsnew.pm:1.34 Mon Dec 5 11:42:26 2005
+++ loncom/interface/lonwhatsnew.pm Mon Dec 5 14:27:53 2005
@@ -1,5 +1,5 @@
#
-# $Id: lonwhatsnew.pm,v 1.34 2005/12/05 16:42:26 raeburn Exp $
+# $Id: lonwhatsnew.pm,v 1.35 2005/12/05 19:27:53 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -208,16 +208,20 @@
coursecritmail => 1,
);
+ my $timediff = 604800;
my %display_settings = &get_display_settings();
- my $starttime = 86400;
+ my $now = time;
my %intervals = (
- all => 'since resource creation',
-1 => 'since start of course',
2592000 => 'since last month',
604800 => 'since last week',
86400 => 'since yesterday',
);
- my $interval = $intervals{$starttime};
+ my $interval = $intervals{$timediff};
+ if ($timediff == -1) {
+ $timediff = time;
+ }
+ my $starttime = $now - $timediff;
my %headings = &Apache::lonlocal::texthash(
coursediscussion => 'Unread course discussion posts',
@@ -527,7 +531,7 @@
}
}
if ($handgradeable) {
- my @ungraded = &Apache::bridgetask::get_users_in_queue(
+ my @ungraded = &Apache::bridgetask::get_queue_symb_status(
'gradingqueue',$symb,$cdom,$cnum);
if (@ungraded > 0) {
$$ungraded{$symb}{count} = scalar(@ungraded);
@@ -598,7 +602,7 @@
}
}
if ($warning) {
- if ($$warningnum %2 == 1) {
+ if ($warningnum %2 == 1) {
$rowColor = $rowColor1;
} else {
$rowColor = $rowColor2;
@@ -629,7 +633,7 @@
}
}
push(@{$warnings},$symb);
- $$warningnum ++;
+ $warningnum ++;
}
}
@@ -797,7 +801,6 @@
my $revdate =
&Apache::lonnet::metadata($root.'.'.$extension,
'lastrevisiondate');
- print STDERR "revdate for $root and $extension is $revdate\n";
$revdate = &Apache::lonlocal::locallocaltime($revdate);
my $linkurl=&Apache::lonnet::clutter($key);
my $usedversion=$navmap->usedVersion('version_'.$linkurl);
@@ -808,12 +811,14 @@
$version = $currentversion;
}
foreach my $res (@resources) {
- my $symb = $res->symb();
- %{$$changed{$symb}} = (
+ if (ref($res) eq 'Apache::lonnavmaps::resource') {
+ my $symb = $res->symb();
+ %{$$changed{$symb}} = (
current => $currentversion,
version => $version,
revdate => $revdate,
- );
+ );
+ }
}
}
}
@@ -914,7 +919,7 @@
$r->print('<tr bgcolor="'.$rowColor.'"><td '.$rowspan.'><a href="'.$linkurl.'"><small>'.$$triggered{$res}{title}.'</small></a></td>'.$$triggered{$res}{text});
$warningnum ++;
}
- $r->print('<tr bgcolor="#cccccc"><td colspan="7" align="right"><br /><b><small><input type="submit" name="counters" value="'.$lt{'rese'}.'/></form>');
+ $r->print('<tr bgcolor="#cccccc"><td colspan="7" align="right"><br /><b><small><input type="submit" name="counters" value="'.$lt{'rese'}.'" /></form>');
} else {
$r->print('<tr><td bgcolor="#ffffff"><br /><center><b><i><small>'.$lt{'nopr'}.'</small></i></b></center><br /></td></tr>');
}