Diff for /loncom/interface/lonannounce.pm between versions 1.41 and 1.42

version 1.41, 2006/01/12 23:00:08 version 1.42, 2006/01/12 23:03:41
Line 74  sub readcalendar { Line 74  sub readcalendar {
     my $coursedom=$env{'course.'.$courseid.'.domain'};      my $coursedom=$env{'course.'.$courseid.'.domain'};
     my %thiscal=&Apache::lonnet::dump('calendar',$coursedom,$coursenum);      my %thiscal=&Apache::lonnet::dump('calendar',$coursedom,$coursenum);
     my %returnhash=();      my %returnhash=();
     foreach (keys %thiscal) {      foreach my $item (keys(%thiscal)) {
         unless (($_=~/^error\:/) || ($thiscal{$_}=~/^error\:/)) {          unless (($item=~/^error\:/) || ($thiscal{$item}=~/^error\:/)) {
    $returnhash{$courseid.'@'.$_}=$thiscal{$_};     $returnhash{$courseid.'@'.$item}=$thiscal{$item};
         }          }
     }      }
     if ($courseid eq $env{'request.course.id'}) {      if ($courseid eq $env{'request.course.id'}) {
Line 395  ENDDOCUMENT Line 395  ENDDOCUMENT
 # ------------------------------------------------------------ Process commands  # ------------------------------------------------------------ Process commands
     if ($serverpost) {      if ($serverpost) {
  if ($env{'form.serveraction'}) {   if ($env{'form.serveraction'}) {
     foreach (keys %env) {      foreach my $key (keys(%env)) {
  if ($_=~/^form\.postto\_(\w+)/) {   if ($key=~/^form\.postto\_(\w+)/) {
     $r->print(       $r->print( 
  '<br />Posting '.$1.': '.&Apache::lonnet::postannounce   '<br />Posting '.$1.': '.&Apache::lonnet::postannounce
  ($1,$env{'form.serverannnounce'}));   ($1,$env{'form.serverannnounce'}));
Line 412  Post announcements to the system login a Line 412  Post announcements to the system login a
 Check machines:<br />  Check machines:<br />
 SERVERANNOUNCE  SERVERANNOUNCE
 # list servers  # list servers
     foreach (sort keys %Apache::lonnet::hostname) {      foreach my $host (sort(keys(%Apache::lonnet::hostname))) {
  if (&Apache::lonnet::allowed('psa',$Apache::lonnet::hostdom{$_})) {   if (&Apache::lonnet::allowed('psa',$Apache::lonnet::hostdom{$host})) {
     $r->print ('<br /><input type="checkbox" name="postto_'.$_.'" /> '.      $r->print ('<br /><input type="checkbox" name="postto_'.$host.'" /> '.
        $_.' <tt>'.$Apache::lonnet::hostname{$_}.'</tt> '.         $host.' <tt>'.$Apache::lonnet::hostname{$host}.'</tt> '.
        '<a href="http://'.$Apache::lonnet::hostname{$_}.         '<a href="http://'.$Apache::lonnet::hostname{$host}.
        '/announcement.txt" target="annowin">current</a>');         '/announcement.txt" target="annowin">current</a>');
  }   }
     }      }
Line 453  SERVERANNOUNCE Line 453  SERVERANNOUNCE
 # ---------------------------------------------------------------- Remove items  # ---------------------------------------------------------------- Remove items
         if ($env{'form.action'} eq 'del') {          if ($env{'form.action'} eq 'del') {
     my @delwhich=();      my @delwhich=();
             foreach (keys %env) {              foreach my $key (keys(%env)) {
  if ($_=~/^form\.remove\_(.+)$/) {   if ($key=~/^form\.remove\_(.+)$/) {
     push(@delwhich,$1);      push(@delwhich,$1);
                 }                  }
             }              }
Line 469  SERVERANNOUNCE Line 469  SERVERANNOUNCE
     }      }
 # ----------------------------------------------------- Summarize all calendars  # ----------------------------------------------------- Summarize all calendars
     my %allcal=();      my %allcal=();
     foreach (&Apache::loncommon::findallcourses()) {      foreach my $course (&Apache::loncommon::findallcourses()) {
  %allcal=(%allcal,&readcalendar($_));   %allcal=(%allcal,&readcalendar($course));
     }      }
   
 # ------------------------------- Initialize table and forward backward buttons  # ------------------------------- Initialize table and forward backward buttons

Removed from v.1.41  
changed lines
  Added in v.1.42


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