--- loncom/interface/lonannounce.pm 2004/07/03 20:45:23 1.29
+++ loncom/interface/lonannounce.pm 2005/02/17 08:29:42 1.33
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Announce
#
-# $Id: lonannounce.pm,v 1.29 2004/07/03 20:45:23 albertel Exp $
+# $Id: lonannounce.pm,v 1.33 2005/02/17 08:29:42 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -79,6 +79,13 @@ sub readcalendar {
($thiskey=~/^(\w+)\.(?:(.+)\.)*([\w\s]+)\.(\w+)$/);
my $section=&mt('All Students');
if ($middle=~/^\[(.*)\]\./) {
+ my $sec=$1;
+ # if we have a section don't show ones that aren't ours
+ if ($ENV{'request.course.sec'} &&
+ $ENV{'request.course.sec'} ne $sec) { next; }
+ # if a student without a section don't show any section ones
+ if (!$ENV{'request.role.adv'} &&
+ !$ENV{'request.course.sec'}) { next; }
$section=&mt('Group/Section').': '.$1;
$middle=~s/^\[(.*)\]\.//;
}
@@ -135,12 +142,12 @@ sub normalcell {
$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})
@@ -151,17 +158,18 @@ sub normalcell {
$showedcheck{$start.'_'.$end}=1;
}
}
+ $fullmsg=~s/[\n\r]/\\n/gs;
$fullmsg=&HTML::Entities::encode($fullmsg,'<>&"\'');
$fullmsg=~s/&/\\&/g;
$output.=''.
substr($msg,0,20).'...
';
}
}
- return '