Diff for /loncom/interface/lonannounce.pm between versions 1.76 and 1.80

version 1.76, 2008/12/15 16:37:44 version 1.80, 2009/11/04 20:01:24
Line 45  my %todayhash; Line 45  my %todayhash;
 my %showedcheck;  my %showedcheck;
   
 sub editfield {  sub editfield {
     my ($r,$start,$end,$text)=@_;      my ($r,$start,$end,$text,$crstype)=@_;
     # Deal with date forms      # Deal with date forms
     my $startdateform = &Apache::lonhtmlcommon::date_setter('anno',      my $startdateform = &Apache::lonhtmlcommon::date_setter('anno',
                                                             'startdate',                                                              'startdate',
Line 61  sub editfield { Line 61  sub editfield {
        'start' => 'Starting date',         'start' => 'Starting date',
        'end' => 'Ending date',         'end' => 'Ending date',
        'incrss' => 'Include in course RSS newsfeed');         'incrss' => 'Include in course RSS newsfeed');
       if ($crstype eq 'Community') {
           $lt{'anon'} = &mt('Community Announcements');
           $lt{'incrss'} = &mt('Include in community RSS newsfeed');
       }
   
     $r->print(<<ENDFORM);      $r->print(<<ENDFORM);
 <h2>$lt{'annon'} $help</h2>  <h2>$lt{'annon'} $help</h2>
Line 415  sub picklink { Line 419  sub picklink {
   
 sub dialscript {  sub dialscript {
     return (<<ENDDIA);      return (<<ENDDIA);
 <script language="Javascript">  <script type="text/javascript" language="JavaScript">
 function dialin(day,month,year) {  function dialin(day,month,year) {
  opener.document.$env{'form.formname'}.$env{'form.element'}\_year.value=year;   opener.document.$env{'form.formname'}.$env{'form.element'}\_year.value=year;
     var slct=opener.document.$env{'form.formname'}.$env{'form.element'}\_month;      var slct=opener.document.$env{'form.formname'}.$env{'form.element'}\_month;
Line 517  sub handler { Line 521  sub handler {
   
 # ------------------------------------------------------------ Print the screen  # ------------------------------------------------------------ Print the screen
     my $js = <<ENDDOCUMENT;      my $js = <<ENDDOCUMENT;
 <script type="text/javascript">  <script type="text/javascript" language="JavaScript">
   
     function trysubmit() {      function trysubmit() {
         document.anno.action.value="new";          document.anno.action.value="new";
Line 539  ENDDOCUMENT Line 543  ENDDOCUMENT
   '<font size="1">');    '<font size="1">');
     } else {      } else {
         my $brcrum = [{href=>"/adm/announcements",text=>"Announcements and Calendar"}];          my $brcrum = [{href=>"/adm/announcements",text=>"Announcements and Calendar"}];
         $r->print(&Apache::loncommon::start_page("Announcements and Calendar",$js,{'bread_crumbs' => $brcrum}));          $r->print(&Apache::loncommon::start_page("Communication",$js,{'bread_crumbs' => $brcrum}));
     }      }
 # does this user have privileges to post, etc?  # does this user have privileges to post, etc?
     my $allowed=0;      my $allowed=0;
Line 590  ENDDOCUMENT Line 594  ENDDOCUMENT
  }   }
     }      }
     $r->print(      $r->print(
   '<br /><input type="submit" name="serveraction" value="'.&mt('Post').'"></form><hr />');    '<br /><input type="submit" name="serveraction" value="'.&mt('Post').'" /></form><hr />');
     }      }
     if ($allowed) {      if ($allowed) {
         my $coursenum=$env{'course.'.$env{'request.course.id'}.'.num'};          my $coursenum=$env{'course.'.$env{'request.course.id'}.'.num'};
         my $coursedom=$env{'course.'.$env{'request.course.id'}.'.domain'};          my $coursedom=$env{'course.'.$env{'request.course.id'}.'.domain'};
           my $crstype = &Apache::loncommon::course_type();
 # ----------------------------------------------------- Store new submitted one  # ----------------------------------------------------- Store new submitted one
         if ($env{'form.action'} eq 'new') {          if ($env{'form.action'} eq 'new') {
     my $startdate =       my $startdate = 
Line 612  ENDDOCUMENT Line 617  ENDDOCUMENT
  $startdate.'_'.$enddate =>    $startdate.'_'.$enddate => 
     $env{'form.msg'} },$coursedom,$coursenum);      $env{'form.msg'} },$coursedom,$coursenum);
     if ($env{'form.rsspost'}) {      if ($env{'form.rsspost'}) {
                &Apache::lonrss::addentry($coursenum,$coursedom,'Course_Announcements',                 my $feed;
                  if ($crstype eq 'Community') {
                      $feed = 'Community_Announcements';
                  } else {
                      $feed = 'Course_Announcements';
                  }
                  &Apache::lonrss::addentry($coursenum,$coursedom,$feed,
  &mt('Event from [_1] to [_2]',   &mt('Event from [_1] to [_2]',
      &Apache::lonlocal::locallocaltime($startdate),       &Apache::lonlocal::locallocaltime($startdate),
      &Apache::lonlocal::locallocaltime($enddate)),       &Apache::lonlocal::locallocaltime($enddate)),
Line 634  ENDDOCUMENT Line 645  ENDDOCUMENT
         $tomorrowhash{'day'}++;          $tomorrowhash{'day'}++;
         my $tomorrow=&Apache::loncommon::maketime(%tomorrowhash);          my $tomorrow=&Apache::loncommon::maketime(%tomorrowhash);
                   
         &editfield($r,$today,$tomorrow,'');          &editfield($r,$today,$tomorrow,'',$crstype);
     }      }
 # ----------------------------------------------------- Summarize all calendars  # ----------------------------------------------------- Summarize all calendars
     my %allcal=&get_all_calendars();      my %allcal=&get_all_calendars();

Removed from v.1.76  
changed lines
  Added in v.1.80


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>