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

version 1.1, 2006/10/10 20:16:26 version 1.4, 2008/04/11 13:17:09
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 224  MENU Line 225  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 255  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 323  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.4


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