Diff for /loncom/interface/lonnavdisplay.pm between versions 1.1 and 1.6

version 1.1, 2006/10/10 20:16:26 version 1.6, 2009/02/26 16:17:30
Line 37  use Apache::lonnavmaps(); Line 37  use Apache::lonnavmaps();
 use Apache::lonhtmlcommon();  use Apache::lonhtmlcommon();
 use Apache::lonnet;  use Apache::lonnet;
 use Apache::lonlocal;  use Apache::lonlocal;
   use Time::HiRes qw( gettimeofday tv_interval );
   
 sub handler {  sub handler {
     my $r = shift;      my $r = shift;
Line 70  sub real_handler { Line 71  sub real_handler {
       "Select Action");        "Select Action");
     if ($ENV{QUERY_STRING} eq 'collapseExternal') {      if ($ENV{QUERY_STRING} eq 'collapseExternal') {
  &Apache::lonnet::put('environment',{'remotenavmap' => 'off'});   &Apache::lonnet::put('environment',{'remotenavmap' => 'off'});
  &Apache::lonnet::appenv('environment.remotenavmap' => 'off');   &Apache::lonnet::appenv({'environment.remotenavmap' => 'off'});
  my $menu=&Apache::lonmenu::reopenmenu();   my $menu=&Apache::lonmenu::reopenmenu();
  my $navstatus=&Apache::lonmenu::get_nav_status();   my $navstatus=&Apache::lonmenu::get_nav_status();
  if ($menu) {   if ($menu) {
Line 109  ENDSUBM Line 110  ENDSUBM
     }      }
     if ($ENV{QUERY_STRING} =~ /^launchExternal/) {      if ($ENV{QUERY_STRING} =~ /^launchExternal/) {
  &Apache::lonnet::put('environment',{'remotenavmap' => 'on'});   &Apache::lonnet::put('environment',{'remotenavmap' => 'on'});
  &Apache::lonnet::appenv('environment.remotenavmap' => 'on');   &Apache::lonnet::appenv({'environment.remotenavmap' => 'on'});
   my $menu=&Apache::lonmenu::reopenmenu();    my $menu=&Apache::lonmenu::reopenmenu();
  my $navstatus=&Apache::lonmenu::get_nav_status();   my $navstatus=&Apache::lonmenu::get_nav_status();
  if ($menu) {   if ($menu) {
Line 132  MENU Line 133  MENU
     if (!defined($navmap)) {      if (!defined($navmap)) {
         my $requrl = $r->uri;          my $requrl = $r->uri;
         $env{'user.error.msg'} = "$requrl:bre:0:0:Course not initialized";          $env{'user.error.msg'} = "$requrl:bre:0:0:Course not initialized";
           $env{'user.reinit'} = 1;
         return HTTP_NOT_ACCEPTABLE;          return HTTP_NOT_ACCEPTABLE;
     }      }
     $r->send_http_header;      $r->send_http_header;
Line 153  MENU Line 155  MENU
   
     # Header      # Header
     my $course_type = &Apache::loncommon::course_type();      my $course_type = &Apache::loncommon::course_type();
     $r->print(&Apache::loncommon::start_page('Navigate '.$course_type.      $r->print(&Apache::loncommon::start_page(#'Navigate '.$course_type.
      ' Contents',       'Course Contents',
      $js,       $js,
      {'only_body'       => $body_only,       {'only_body'       => $body_only,
       'force_register'  =>        'force_register'  =>
Line 224  MENU Line 226  MENU
         my $curRes;          my $curRes;
         my $foundDoableProblem = 0;          my $foundDoableProblem = 0;
         my $minimumduedate;          my $minimumduedate;
                   my $now = time();
   
         while ($curRes = $iterator->next()) {          while ($curRes = $iterator->next()) {
             if (ref($curRes) && $curRes->is_problem()) {              if (ref($curRes) && $curRes->is_problem()) {
                 my $status = $curRes->status();                  my $status = $curRes->status();
                 if ($curRes->completable()) {   my $thisduedate=$curRes->duedate();
                     my $thisduedate=$curRes->duedate();                  if ($thisduedate > $now 
                     unless ($foundDoableProblem) {      && $curRes->completable()) {
                         $minimumduedate=$thisduedate;  
     }  
                                                   
                     $foundDoableProblem = 1;                      $foundDoableProblem = 1;
   
                     if ($thisduedate<=$minimumduedate) {                      if (!defined($minimumduedate)
                           || $thisduedate<$minimumduedate) {
  # Pop open all previous maps   # Pop open all previous maps
  my $stack = $iterator->getStack();   my $stack = $iterator->getStack();
  pop @$stack; # last resource in the stack is the problem   pop @$stack; # last resource in the stack is the problem
Line 254  MENU Line 256  MENU
   
         # If we found no problems, print a note to that effect.          # If we found no problems, print a note to that effect.
         if (!$foundDoableProblem) {          if (!$foundDoableProblem) {
             $r->print("<font size='+2'>All homework assignments have been completed.</font><br /><br />");              $r->print("<font size='+2'>"
                        .&mt("All homework assignments have been completed.")
                        ."</font><br /><br />");
         }          }
     } else {      } else {
  &Apache::lonnavmaps::add_linkitem(\%toplinkitems,'firsthomework',   &Apache::lonnavmaps::add_linkitem(\%toplinkitems,'firsthomework',
Line 320  MENU Line 324  MENU
     # user knows there was no error.      # user knows there was no error.
     if ($renderArgs->{'counter'} == 0) {      if ($renderArgs->{'counter'} == 0) {
         if ($showOnlyHomework) {          if ($showOnlyHomework) {
             $r->print("<p><font size='+1'>".&mt("All homework is currently completed").".</font></p>");              $r->print("<p><font size='+1'>".&mt("All homework is currently completed.")."</font></p>");
         } else { # both jumpToFirstHomework and normal use the same: course must be empty          } else { # both jumpToFirstHomework and normal use the same: course must be empty
             $r->print("<p><font size='+1'>This course is empty.</font></p>");              $r->print("<p><font size='+1'>".&mt("This course is empty.")."</font></p>");
         }          }
     }      }
     #my $td=&tv_interval($t0);      #my $td=&tv_interval($t0);

Removed from v.1.1  
changed lines
  Added in v.1.6


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