Diff for /loncom/interface/lonannounce.pm between versions 1.72 and 1.73

version 1.72, 2008/09/25 01:39:29 version 1.73, 2008/10/13 15:33:02
Line 54  sub editfield { Line 54  sub editfield {
                                                           'enddate',                                                            'enddate',
                                                           $end);                                                            $end);
     my $help=&Apache::loncommon::help_open_menu('Calendar Add Announcement','Calendar_Add_Announcement',274,'Communication Tools');      my $help=&Apache::loncommon::help_open_menu('Calendar Add Announcement','Calendar_Add_Announcement',274,'Communication Tools');
     my %lt=&Apache::lonlocal::texthash('post' => 'Post Announcement',      my %lt=&Apache::lonlocal::texthash('annon' => 'Course Announcements',
                                          'post' => 'Post Announcement',
        'start' => 'Starting date',         'start' => 'Starting date',
        'end' => 'Ending date',         'end' => 'Ending date',
        'incrss' => 'Include in course RSS newsfeed');         'incrss' => 'Include in course RSS newsfeed');
   
     $r->print(<<ENDFORM);      $r->print(<<ENDFORM);
 $help  <h2>$lt{'annon'} $help</h2>
 <form name="anno" method="post">  <form name="anno" method="post">
 <input type="hidden" value='' name="action" />  <input type="hidden" value='' name="action" />
 <table><tr><td>$lt{'start'}:</td><td>$startdateform</td></tr>  <table><tr><td>$lt{'start'}:</td><td>$startdateform</td></tr>
Line 567  ENDDOCUMENT Line 568  ENDDOCUMENT
  }   }
     }      }
  }   }
  $r->print(<<SERVERANNOUNCE);   $r->print('<form name="serveranno" method="post">'
 <form name="serveranno" method="post">                   .'<h2>'.&mt('Post Server Announcements').'</h2>'
 <h3>Post Server Announcements</h3>                   .&mt('Post announcements to the system login and roles screen').'<br />'
 Post announcements to the system login and roles screen<br />                   .'<i>'.&mt('(leave blank to delete announcement)').'</i><br />'
 <i>(leave blank to delete announcement)</i><br />                   .'<textarea name="serverannnounce" cols="60" rows="5"></textarea><br />'
 <textarea name="serverannnounce" cols="60" rows="5"></textarea><br />                   .&mt('Check machines:').'<br />'
 Check machines:<br />          );
 SERVERANNOUNCE  
 # list servers  # list servers
     my %hostname = &Apache::lonnet::all_hostnames();      my %hostname = &Apache::lonnet::all_hostnames();
     foreach my $host (sort(keys(%hostname))) {      foreach my $host (sort(keys(%hostname))) {
  if (&Apache::lonnet::allowed('psa',   if (&Apache::lonnet::allowed('psa',
      &Apache::lonnet::host_domain($host))) {       &Apache::lonnet::host_domain($host))) {
     $r->print ('<br /><label><input type="checkbox" name="postto_'.$host.'" /> '.      $r->print ('<label><input type="checkbox" name="postto_'.$host.'" /> '.
        $host.' <tt>'.$hostname{$host}.'</tt> '.         $host.' <tt>'.$hostname{$host}.'</tt> '.
        '</label><a href="http://'.$hostname{$host}.         '</label><a href="http://'.$hostname{$host}.
        '/announcement.txt?time='.time.'" target="annowin">current</a>');         '/announcement.txt?time='.time.'" target="annowin">'.
                          &mt('Current Announcement').'</a><br />');
  }   }
     }      }
     $r->print(      $r->print(
   '<br /><input type="submit" name="serveraction" value="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'};
Line 640  SERVERANNOUNCE Line 641  SERVERANNOUNCE
     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); }
   
     $r->print('<h1>'.('',&mt('January'),&mt('February'),&mt('March'),      $r->print('<h2>'.&mt('Calendar').'</h2>'
                .'<h3>'.('',&mt('January'),&mt('February'),&mt('March'),
       &mt('April'),&mt('May'),        &mt('April'),&mt('May'),
       &mt('June'),&mt('July'),&mt('August'),        &mt('June'),&mt('July'),&mt('August'),
                       &mt('September'),&mt('October'),                        &mt('September'),&mt('October'),
                       &mt('November'),&mt('December'))[$month].' '.                        &mt('November'),&mt('December'))[$month].' '.
               $year.' '.&show_timezone().'</h1>');                $year.' '.&show_timezone().'</h3>');
 # Reached the end of times, give up  # Reached the end of times, give up
     if (($year<1970) || ($year>2037)) {      if (($year<1970) || ($year>2037)) {
  $r->print('<h3>No calendar available for this date.</h3>'.   $r->print('<p class="LC_warning">'
  '<a href="/adm/announcements?month='.$todayhash{'month'}.                   .&mt('No calendar available for this date.')
  '&year='.$todayhash{'year'}.'">Current Month</a>'.                   .'</p>'
   &Apache::loncommon::end_page());                   .'<a href="/adm/announcements?month='.$todayhash{'month'}
                    .'&year='.$todayhash{'year'}.'">'.&mt('Current Month').'</a>'
    .&Apache::loncommon::end_page());
  return OK;   return OK;
     }      }
   
Line 740  SERVERANNOUNCE Line 744  SERVERANNOUNCE
 # ----------------------------------------------------------------- Check marks  # ----------------------------------------------------------------- Check marks
     undef(%showedcheck);      undef(%showedcheck);
 # --------------------------------------------------------------- Remove button  # --------------------------------------------------------------- Remove button
     if ($allowed) { $r->print('<input type="button" onClick="removesub()" value="Remove Checked Entries">'.      if ($allowed) { $r->print('<br /><input type="button" onClick="removesub()" value="'.&mt('Remove Checked Entries').'">'.
       &Apache::loncommon::help_open_topic('Calendar_Remove_Announcement').'</form>'); }        &Apache::loncommon::help_open_topic('Calendar_Remove_Announcement').'</form>'); }
     $r->print('<p>'.      $r->print('<p>'.
  '<a href="/adm/announcements?month='.$pm.'&year='.$py.   '<a href="/adm/announcements?month='.$pm.'&year='.$py.

Removed from v.1.72  
changed lines
  Added in v.1.73


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