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

www lon-capa-cvs@mail.lon-capa.org
Thu, 02 Sep 2004 13:15:08 -0000


www		Thu Sep  2 09:15:08 2004 EDT

  Modified files:              
    /loncom/interface	lonannounce.pm 
  Log:
  Bug #3419: Better explanation and formatting of announcement links
  
  
Index: loncom/interface/lonannounce.pm
diff -u loncom/interface/lonannounce.pm:1.31 loncom/interface/lonannounce.pm:1.32
--- loncom/interface/lonannounce.pm:1.31	Fri Aug 27 17:41:39 2004
+++ loncom/interface/lonannounce.pm	Thu Sep  2 09:15:07 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Announce
 #
-# $Id: lonannounce.pm,v 1.31 2004/08/27 21:41:39 albertel Exp $
+# $Id: lonannounce.pm,v 1.32 2004/09/02 13:15:07 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -142,12 +142,12 @@
 		$msg=~s/INTERNAL\://gs;
 		$internalflag=1;
 	    }
-            my $fullmsg=$ENV{'course.'.$courseid.'.description'}.
-		', '.&Apache::lonlocal::locallocaltime($start);
+            my $fullmsg=&mt('Calendar Announcement for ').$ENV{'course.'.$courseid.'.description'}.
+		'\n'.&Apache::lonlocal::locallocaltime($start);
 	    if ($start!=$end) {
 		$fullmsg.=' - '.&Apache::lonlocal::locallocaltime($end);
 	    }
-	    $fullmsg.=': '.$msg;
+	    $fullmsg.=':\n'.$msg;
             if ($courseid eq $ENV{'request.course.id'}) {
               if ((&Apache::lonnet::allowed('srm',$ENV{'request.course.id'}))
                && (!$showedcheck{$start.'_'.$end})
@@ -158,6 +158,7 @@
                $showedcheck{$start.'_'.$end}=1;
 	      }
 	    }
+	    $fullmsg=~s/[\n\r]/\\n/gs;
             $fullmsg=&HTML::Entities::encode($fullmsg,'<>&"\'');
             $fullmsg=~s/&/\\&/g;
             $output.='<a href="javascript:alert('."'$fullmsg'".')">'.
@@ -178,13 +179,14 @@
         if ($_) {
 	    my ($courseid,$start,$end,@msg)=split(/\@/,$_);
             my $msg=join('@',@msg);
-            my $fullmsg=$ENV{'course.'.$courseid.'.description'}.
-		', '.&Apache::lonlocal::locallocaltime($start);
+            my $fullmsg=&mt('Calendar Announcement for ').$ENV{'course.'.$courseid.'.description'}.
+		'\n'.&Apache::lonlocal::locallocaltime($start);
 	    if ($start!=$end) {
 		$fullmsg.=' - '.&Apache::lonlocal::locallocaltime($end);
 	    }
 	    $msg=~s/INTERNAL\://gs;
-	    $fullmsg.=': '.$msg;
+	    $fullmsg.=':\n'.$msg;
+ 	    $fullmsg=~s/[\n\r]/\\n/gs;
             $fullmsg=&HTML::Entities::encode($fullmsg,'<>&"\'');
             $fullmsg=~s/&/\\&/g;
             $output.='<a href="javascript:alert('."'$fullmsg'".')">'.