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

www lon-capa-cvs@mail.lon-capa.org
Tue, 17 Feb 2004 01:46:35 -0000


www		Mon Feb 16 20:46:35 2004 EDT

  Modified files:              
    /loncom/interface	lonannounce.pm 
  Log:
  Show one day around current time on Syllabus and Roles
  
  
Index: loncom/interface/lonannounce.pm
diff -u loncom/interface/lonannounce.pm:1.26 loncom/interface/lonannounce.pm:1.27
--- loncom/interface/lonannounce.pm:1.26	Mon Feb 16 20:36:14 2004
+++ loncom/interface/lonannounce.pm	Mon Feb 16 20:46:34 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Announce
 #
-# $Id: lonannounce.pm,v 1.26 2004/02/17 01:36:14 www Exp $
+# $Id: lonannounce.pm,v 1.27 2004/02/17 01:46:34 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -161,6 +161,7 @@
 	    if ($start!=$end) {
 		$fullmsg.=' - '.&Apache::lonlocal::locallocaltime($end);
 	    }
+	    $msg=~s/INTERNAL\://gs;
 	    $fullmsg.=': '.$msg;
             $fullmsg=&HTML::Entities::encode($fullmsg,'<>&"\'');
             $fullmsg=~s/&/\\&/g;
@@ -178,6 +179,7 @@
         if ($_) {
 	    my ($courseid,$start,$end,@msg)=split(/\@/,$_);
             my $msg=join('@',@msg);
+	    $msg=~s/INTERNAL\://gs;
             my $fullmsg=&Apache::lonlocal::locallocaltime($start);
 	    if ($start!=$end) {
 		$fullmsg.=&mt(' to ').
@@ -202,7 +204,11 @@
     my %th=&Apache::loncommon::timehash($tk);
     my ($nextday,$nextmonth)=&nextday(%th);
     my $outp='';
-    my $oneday=24*3600;
+    if ($mode) {
+	my $oneday=24*3600;
+	$tk-=$oneday;
+	$nextday+=$oneday;
+    }
     foreach (keys %allcal) {
 	my ($course,$startdate,$enddate)=($_=~/^(\w+)\@(\d+)\_(\d+)$/);
         if (($startdate<$nextday) && ($enddate>$tk))  {