version 1.4, 2002/08/09 20:15:16
|
version 1.6, 2002/08/21 17:18:08
|
Line 55 sub normalcell {
|
Line 55 sub normalcell {
|
my $output=''; |
my $output=''; |
foreach (split(/\_\_\_\&\&\&\_\_\_/,$text)) { |
foreach (split(/\_\_\_\&\&\&\_\_\_/,$text)) { |
if ($_) { |
if ($_) { |
my ($courseid,$msg)=split(/\@/,$_); |
my ($courseid,$start,$end,@msg)=split(/\@/,$_); |
|
my $msg=join('@',@msg); |
my $fullmsg=$ENV{'course.'.$courseid.'.description'}.': '.$msg; |
my $fullmsg=$ENV{'course.'.$courseid.'.description'}.': '.$msg; |
$output.='<a href="javascript:alert('."'$fullmsg'".')">'. |
if ($courseid eq $ENV{'request.course.id'}) { |
|
if (&Apache::lonnet::allowed('srm',$ENV{'request.course.id'})) { |
|
$output.='<input type="checkbox" name="remove_'.$start.'_'. |
|
$end.'">'; |
|
} |
|
} |
|
$output.='<a href="javascript:alert('."'$fullmsg'".')">'. |
substr($msg,0,20).'...</a><br>'; |
substr($msg,0,20).'...</a><br>'; |
} |
} |
} |
} |
Line 79 sub showday {
|
Line 86 sub showday {
|
foreach (keys %allcal) { |
foreach (keys %allcal) { |
my ($course,$startdate,$enddate)=($_=~/^(\w+)\@(\d+)\_(\d+)$/); |
my ($course,$startdate,$enddate)=($_=~/^(\w+)\@(\d+)\_(\d+)$/); |
if (($startdate<$nextday) && ($enddate>$tk)) { |
if (($startdate<$nextday) && ($enddate>$tk)) { |
$outp.='___&&&___'.$course.'@'.$allcal{$_}; |
$outp.='___&&&___'.$course.'@'.$startdate.'@'.$enddate.'@'. |
|
$allcal{$_}; |
} |
} |
} |
} |
return ($nextday,$nextmonth,&normalcell($th{'day'},$outp)); |
return ($nextday,$nextmonth,&normalcell($th{'day'},$outp)); |
Line 98 sub handler {
|
Line 106 sub handler {
|
# ---------------------------------------------------------- Get month and year |
# ---------------------------------------------------------- Get month and year |
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}, |
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}, |
['month','year']); |
['month','year']); |
# ----------------------------------------------------- Summarize all calendars |
|
my %allcal=(); |
|
foreach (&Apache::loncommon::findallcourses()) { |
|
%allcal=(%allcal,&readcalendar($_)); |
|
} |
|
# --------------------------------------------------- Decide what month to show |
# --------------------------------------------------- Decide what month to show |
my $year=$todayhash{'year'}; |
my $year=$todayhash{'year'}; |
if ($ENV{'form.year'}) { $year=$ENV{'form.year'}; } |
if ($ENV{'form.year'}) { $year=$ENV{'form.year'}; } |
Line 172 sub handler {
|
Line 175 sub handler {
|
} |
} |
</script> |
</script> |
</head> |
</head> |
<body bgcolor="#FFFFFF"> |
|
<h1>Announcements</h1> |
|
ENDDOCUMENT |
ENDDOCUMENT |
|
$r->print(&Apache::loncommon::bodytag("Announcements and Calendar")); |
# does this user have privileges to post, etc? |
# does this user have privileges to post, etc? |
my $allowed=0; |
my $allowed=0; |
if ($ENV{'request.course.id'}) { |
if ($ENV{'request.course.id'}) { |
Line 226 ENDDOCUMENT
|
Line 227 ENDDOCUMENT
|
<input type="button" onClick="removesub()" value="Remove Marked"><hr> |
<input type="button" onClick="removesub()" value="Remove Marked"><hr> |
ENDFORM |
ENDFORM |
} |
} |
|
# ----------------------------------------------------- Summarize all calendars |
|
my %allcal=(); |
|
foreach (&Apache::loncommon::findallcourses()) { |
|
%allcal=(%allcal,&readcalendar($_)); |
|
} |
|
|
|
# ------------------------------- Initialize table and forward backward buttons |
my ($pm,$py,$fm,$fy)=($month-1,$year,$month+1,$year); |
my ($pm,$py,$fm,$fy)=($month-1,$year,$month+1,$year); |
if ($pm<1) { ($pm,$py)=(12,$year-1); } |
if ($pm<1) { ($pm,$py)=(12,$year-1); } |
if ($fm>12){ ($fm,$fy)=(1,$year+1); } |
if ($fm>12){ ($fm,$fy)=(1,$year+1); } |