version 1.36, 2005/11/17 21:33:40
|
version 1.41, 2006/01/12 23:00:08
|
Line 53 sub editfield {
|
Line 53 sub editfield {
|
my %lt=&Apache::lonlocal::texthash('post' => 'Post Announcement', |
my %lt=&Apache::lonlocal::texthash('post' => 'Post Announcement', |
'start' => 'Starting date', |
'start' => 'Starting date', |
'end' => 'Ending date', |
'end' => 'Ending date', |
'incrss' => 'Include in course newsfeed'); |
'incrss' => 'Include in course RSS newsfeed'); |
|
|
$r->print(<<ENDFORM); |
$r->print(<<ENDFORM); |
$help |
$help |
Line 63 $help
|
Line 63 $help
|
<tr><td>$lt{'end'}:</td><td>$enddateform</td></tr></table> |
<tr><td>$lt{'end'}:</td><td>$enddateform</td></tr></table> |
<textarea name="msg" rows="4" cols="60">$text</textarea> |
<textarea name="msg" rows="4" cols="60">$text</textarea> |
<br /> |
<br /> |
<label><input type="checkbox" name="rsspost" /> $lt{'incrss'}</label> |
<!-- <label><input type="checkbox" name="rsspost" /> $lt{'incrss'}</label> --> |
<br /><input type="button" onClick="trysubmit()" value="$lt{'post'}" /><hr /> |
<br /><input type="button" onClick="trysubmit()" value="$lt{'post'}" /><hr /> |
ENDFORM |
ENDFORM |
} |
} |
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) { |