version 1.38, 2005/11/22 16:16:53
|
version 1.41, 2006/01/12 23:00:08
|
Line 142 sub emptycell {
|
Line 142 sub emptycell {
|
sub normalcell { |
sub normalcell { |
my ($day,$month,$year,$text)=@_; |
my ($day,$month,$year,$text)=@_; |
my $output=''; |
my $output=''; |
foreach (split(/\_\_\_\&\&\&\_\_\_/,$text)) { |
my @items=&order($text); |
if ($_) { |
foreach my $item (@items) { |
|
if ($item) { |
my $internalflag=0; |
my $internalflag=0; |
my ($courseid,$start,$end,@msg)=split(/\@/,$_); |
my ($courseid,$start,$end,$msg)=split(/\@/,$item,4); |
my $msg=join('@',@msg); |
|
if ($msg=~/INTERNAL\:/) { |
if ($msg=~/INTERNAL\:/) { |
$msg=~s/INTERNAL\://gs; |
$msg=~s/INTERNAL\://gs; |
$internalflag=1; |
$internalflag=1; |
Line 184 sub normalcell {
|
Line 184 sub normalcell {
|
sub plaincell { |
sub plaincell { |
my ($text)=@_; |
my ($text)=@_; |
my $output=''; |
my $output=''; |
foreach (split(/\_\_\_\&\&\&\_\_\_/,$text)) { |
my @items=&order($text); |
if ($_) { |
foreach my $item (@items) { |
my ($courseid,$start,$end,@msg)=split(/\@/,$_); |
if ($item) { |
my $msg=join('@',@msg); |
my ($courseid,$start,$end,$msg)=split(/\@/,$item,4); |
my $fullmsg=&mt('Calendar Announcement for ').$env{'course.'.$courseid.'.description'}. |
my $fullmsg=&mt('Calendar Announcement for ').$env{'course.'.$courseid.'.description'}. |
'\n'.&Apache::lonlocal::locallocaltime($start); |
'\n'.&Apache::lonlocal::locallocaltime($start); |
if ($start!=$end) { |
if ($start!=$end) { |
Line 208 sub plaincell {
|
Line 208 sub plaincell {
|
sub listcell { |
sub listcell { |
my ($text)=@_; |
my ($text)=@_; |
my $output=''; |
my $output=''; |
foreach (split(/\_\_\_\&\&\&\_\_\_/,$text)) { |
my @items=&order($text); |
if ($_) { |
foreach my $item (@items) { |
my ($courseid,$start,$end,@msg)=split(/\@/,$_); |
if ($item) { |
my $msg=join('@',@msg); |
my ($courseid,$start,$end,$msg)=split(/\@/,$item,4); |
$msg=~s/INTERNAL\://gs; |
$msg=~s/INTERNAL\://gs; |
my $fullmsg=&Apache::lonlocal::locallocaltime($start); |
my $fullmsg=&Apache::lonlocal::locallocaltime($start); |
if ($start!=$end) { |
if ($start!=$end) { |
Line 226 sub listcell {
|
Line 226 sub listcell {
|
return $output; |
return $output; |
} |
} |
|
|
|
sub order { |
|
my ($text)=@_; |
|
my @items = split(/___&&&___/,$text); |
|
sort { |
|
my (undef,$astart,$aend)=split(/\@/,$a); |
|
my (undef,$bstart,$bend)=split(/\@/,$b); |
|
if ($astart != $bstart) { |
|
return $astart <=> $bstart; |
|
} |
|
return $aend <=> $bend; |
|
} @items; |
|
} |
|
|
sub nextday { |
sub nextday { |
my %th=@_; |
my %th=@_; |
$th{'day'}++; |
$th{'day'}++; |
Line 242 sub showday {
|
Line 255 sub showday {
|
$tk-=$oneday; |
$tk-=$oneday; |
$nextday+=$oneday; |
$nextday+=$oneday; |
} |
} |
foreach (keys %allcal) { |
foreach my $item (keys(%allcal)) { |
my ($course,$startdate,$enddate)=($_=~/^(\w+)\@(\d+)\_(\d+)$/); |
my ($course,$startdate,$enddate)=($item=~/^(\w+)\@(\d+)\_(\d+)$/); |
if (($startdate<$nextday) && ($enddate>$tk)) { |
if (($startdate<$nextday) && ($enddate>=$tk)) { |
$outp.='___&&&___'.$course.'@'.$startdate.'@'.$enddate.'@'. |
$outp.='___&&&___'.$course.'@'.$startdate.'@'.$enddate.'@'. |
$allcal{$_}; |
$allcal{$item}; |
} |
} |
} |
} |
unless ($mode) { |
unless ($mode) { |