--- loncom/interface/lonannounce.pm 2004/02/17 01:36:14 1.26 +++ loncom/interface/lonannounce.pm 2004/08/17 15:38:58 1.30 @@ -1,7 +1,7 @@ # The LearningOnline Network # Announce # -# $Id: lonannounce.pm,v 1.26 2004/02/17 01:36:14 www Exp $ +# $Id: lonannounce.pm,v 1.30 2004/08/17 15:38:58 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -47,9 +47,7 @@ sub editfield { my $enddateform = &Apache::lonhtmlcommon::date_setter('anno', 'enddate', $end); - my $help=&Apache::loncommon::help_open_topic('Calendar_Add_Announcement'). - &Apache::loncommon::help_open_faq(274). - &Apache::loncommon::help_open_bug('Communication Tools'); + my $help=&Apache::loncommon::help_open_menu('','Calendar Add Announcement','Calendar_Add_Announcement','',274,'Communication Tools'); $r->print(< @@ -92,9 +90,26 @@ sub readcalendar { $realm=&mt('Resource').': '.&Apache::lonnet::gettitle($middle); } my $datetype=''; - if ($name eq 'duedate') { $datetype=&mt('Due'); } + if ($name eq 'duedate') { + $datetype=&mt('Due'); +# see if accidentally answerdate is before duedate + my $answerkey=$thiskey; + $answerkey=~s/duedate$/answerdate/; + if ($resourcedata{$thiskey}>$resourcedata{$answerkey}) { + $datetype='Due and Answer Available'; + } + } if ($name eq 'opendate') { $datetype=&mt('Opening'); } - if ($name eq 'answerdate') { $datetype=&mt('Answer Available'); } + if ($name eq 'answerdate') { +# see if accidentally answerdate is before duedate + my $duekey=$thiskey; + $duekey=~s/answerdate$/duedate/; + if ($resourcedata{$duekey}>$resourcedata{$thiskey}) { +# forget it + next; + } + $datetype=&mt('Answer Available'); + } $returnhash{$courseid.'@'.$resourcedata{$thiskey}.'_'. $resourcedata{$thiskey}}= 'INTERNAL:'.$datetype.': '.$realm.' ('.$section.')'; @@ -142,11 +157,11 @@ sub normalcell { substr($msg,0,20).'...
'; } } - return ''.&tfont(''.&picklink($day,$day,$month,$year).'
'.$output).''; + '>'.&tfont(''.&picklink($day,$day,$month,$year).'
'.$output).''; } sub plaincell { @@ -161,6 +176,7 @@ sub plaincell { if ($start!=$end) { $fullmsg.=' - '.&Apache::lonlocal::locallocaltime($end); } + $msg=~s/INTERNAL\://gs; $fullmsg.=': '.$msg; $fullmsg=&HTML::Entities::encode($fullmsg,'<>&"\''); $fullmsg=~s/&/\\&/g; @@ -178,6 +194,7 @@ sub listcell { if ($_) { my ($courseid,$start,$end,@msg)=split(/\@/,$_); my $msg=join('@',@msg); + $msg=~s/INTERNAL\://gs; my $fullmsg=&Apache::lonlocal::locallocaltime($start); if ($start!=$end) { $fullmsg.=&mt(' to '). @@ -202,7 +219,11 @@ sub showday { my %th=&Apache::loncommon::timehash($tk); my ($nextday,$nextmonth)=&nextday(%th); my $outp=''; - my $oneday=24*3600; + if ($mode) { + my $oneday=24*3600; + $tk-=$oneday; + $nextday+=$oneday; + } foreach (keys %allcal) { my ($course,$startdate,$enddate)=($_=~/^(\w+)\@(\d+)\_(\d+)$/); if (($startdate<$nextday) && ($enddate>$tk)) { @@ -292,7 +313,7 @@ sub handler { &Apache::loncommon::maketime( 'day' => 1, 'month'=> $month, 'year' => $year, 'hours' => 0, 'minutes' => 0, 'seconds' => 0, - 'dlsav' => $todayhash{'dlsav'} )); + 'dlsav' => -1 )); my $weekday=$firstday{'weekday'}; # ------------------------------------------------------------ Print the screen