Diff for /loncom/interface/lonannounce.pm between versions 1.17 and 1.18

version 1.17, 2003/08/12 19:46:04 version 1.18, 2003/09/02 21:15:59
Line 185  sub handler { Line 185  sub handler {
     undef %showedcheck;      undef %showedcheck;
 # ---------------------------------------------------------- Get month and year  # ---------------------------------------------------------- Get month and year
     &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},      &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},
                                             ['month','year']);                                              ['month','year','pickdate']);
 # --------------------------------------------------- Decide what month to show  # --------------------------------------------------- Decide what month to show
     my $year=$todayhash{'year'};      my $year=$todayhash{'year'};
     if ($ENV{'form.year'}) { $year=$ENV{'form.year'}; }      if ($ENV{'form.year'}) { $year=$ENV{'form.year'}; }
     my $month=$todayhash{'month'};      my $month=$todayhash{'month'};
     if ($ENV{'form.month'}) { $month=$ENV{'form.month'}; }      if ($ENV{'form.month'}) { $month=$ENV{'form.month'}; }
   
   # ---------------------------------------------- See if we are in pickdate mode
       my $pickdatemode=($ENV{'form.pickdate'} eq 'yes');
   
 # --------------------------------------------- Find out first day of the month  # --------------------------------------------- Find out first day of the month
   
     my %firstday=&Apache::loncommon::timehash(      my %firstday=&Apache::loncommon::timehash(
Line 219  sub handler { Line 223  sub handler {
 </script>  </script>
 </head>  </head>
 ENDDOCUMENT  ENDDOCUMENT
     $r->print(&Apache::loncommon::bodytag("Announcements and Calendar"));      if ($pickdatemode) {
   # no big header in pickdate mode
    $r->print(&Apache::loncommon::bodytag("Pick a Date",'','',1).
     '<font size="1">');
       } else {
          $r->print(&Apache::loncommon::bodytag("Announcements and Calendar"));
       }
 # does this user have privileges to post, etc?  # does this user have privileges to post, etc?
     my $allowed=0;      my $allowed=0;
     if ($ENV{'request.course.id'}) {      if ($ENV{'request.course.id'}) {
Line 233  ENDDOCUMENT Line 243  ENDDOCUMENT
     } else {      } else {
  $serverpost=&Apache::lonnet::allowed('psa','/');   $serverpost=&Apache::lonnet::allowed('psa','/');
     }      }
   # -------------------------------- BUT: do no fancy stuff when in pickdate mode
       if ($pickdatemode) { 
    $serverpost=0; 
    $allowed=0;
       }
 # ------------------------------------------------------------ Process commands  # ------------------------------------------------------------ Process commands
     if ($serverpost) {      if ($serverpost) {
  if ($ENV{'form.serveraction'}) {   if ($ENV{'form.serveraction'}) {
Line 323  SERVERANNOUNCE Line 338  SERVERANNOUNCE
  return OK;   return OK;
     }      }
     $r->print(      $r->print(
  '<a href="/adm/announcements?month='.$pm.'&year='.$py.'">Previous Month</a> '.   '<a href="/adm/announcements?month='.$pm.'&year='.$py.
  '<a href="/adm/announcements?month='.$fm.'&year='.$fy.'">Next Month</a>'.   ($pickdatemode?'&pickdate=yes':'').'">Previous Month</a> '.
    '<a href="/adm/announcements?month='.$fm.'&year='.$fy.
    ($pickdatemode?'&pickdate=yes':'').'">Next Month</a>'.
  '&nbsp;&nbsp;&nbsp;<a href="/adm/announcements?month='.$todayhash{'month'}.   '&nbsp;&nbsp;&nbsp;<a href="/adm/announcements?month='.$todayhash{'month'}.
  '&year='.$todayhash{'year'}.'">Current Month</a><p>'.   '&year='.$todayhash{'year'}.
    ($pickdatemode?'&pickdate=yes':'').'">Current Month</a><p>'.
         '<table border="2" cols="7" rows="5"><tr><th>Sun</th><th>Mon</th>'.          '<table border="2" cols="7" rows="5"><tr><th>Sun</th><th>Mon</th>'.
         '<th>Tue</th><th>Wed</th><th>Thu</th><th>Fri</th><th>Sat</th></tr>');          '<th>Tue</th><th>Wed</th><th>Thu</th><th>Fri</th><th>Sat</th></tr>');
   
Line 360  SERVERANNOUNCE Line 378  SERVERANNOUNCE
 # --------------------------------------------------------------- Remove button  # --------------------------------------------------------------- Remove button
     if ($allowed) { $r->print('<input type="button" onClick="removesub()" value="Remove Checked Entries"></form>'); }      if ($allowed) { $r->print('<input type="button" onClick="removesub()" value="Remove Checked Entries"></form>'); }
     $r->print('<p>'.      $r->print('<p>'.
  '<a href="/adm/announcements?month='.$pm.'&year='.$py.'">Previous Month</a> '.   '<a href="/adm/announcements?month='.$pm.'&year='.$py.
  '<a href="/adm/announcements?month='.$fm.'&year='.$fy.'">Next Month</a>'.   ($pickdatemode?'&pickdate=yes':'').'">Previous Month</a> '.
    '<a href="/adm/announcements?month='.$fm.'&year='.$fy.
    ($pickdatemode?'&pickdate=yes':'').'">Next Month</a>'.
  '&nbsp;&nbsp;&nbsp;<a href="/adm/announcements?month='.$todayhash{'month'}.   '&nbsp;&nbsp;&nbsp;<a href="/adm/announcements?month='.$todayhash{'month'}.
  '&year='.$todayhash{'year'}.'">Current Month</a></p>'.   '&year='.$todayhash{'year'}.
    ($pickdatemode?'&pickdate=yes':'').'">Current Month</a></p>'.
    ($pickdatemode?'</font>':'').
  '</body></html>');   '</body></html>');
     return OK;      return OK;
 }   } 

Removed from v.1.17  
changed lines
  Added in v.1.18


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