Diff for /loncom/interface/lonwhatsnew.pm between versions 1.105.2.2 and 1.105.2.6

version 1.105.2.2, 2012/08/27 15:27:58 version 1.105.2.6, 2013/08/08 03:27:23
Line 285  END Line 285  END
         $scripttag.='document.visible.submit();          $scripttag.='document.visible.submit();
 }  }
   
   function thresholdreset() {
       document.visible.command.value="reset";
       document.visible.submit();
   }
   
 function togglelogins() {  function togglelogins() {
     var total = document.visible.logincount.value;      var total = document.visible.logincount.value;
     var sumrow = document.visible.loginrow.value;      var sumrow = document.visible.loginrow.value;
Line 527  sub display_actions_box { Line 532  sub display_actions_box {
         $headings{'crslogin'} = &mt('Last login for users in last 24 hours');          $headings{'crslogin'} = &mt('Last login for users in last 24 hours');
     }      }
   
     my $now = time;      my ($now,$starttime,$activatedstart,$expiredstart,$crsloginstart);
       $now = time;
   
     if ($timediff{'versions'} == -1) {      if ($timediff{'versions'} == -1) {
         $timediff{'versions'} = time;          $starttime = 0;
       } else {
           $starttime = $now - $timediff{'versions'};
     }      }
     my $starttime = $now - $timediff{'versions'};  
   
     if ($timediff{'newroles'} == -1) {      if ($timediff{'newroles'} == -1) {
         $timediff{'newroles'} = time;          $activatedstart = 0;
       } else {
           $activatedstart = $now - $timediff{'newroles'};
     }      }
     my $activatedstart = $now - $timediff{'newroles'};  
   
     if ($timediff{'oldroles'} == -1) {      if ($timediff{'oldroles'} == -1) {
         $timediff{'oldroles'} = time;          $expiredstart = 0;
       } else {
           $expiredstart = $now - $timediff{'oldroles'};
     }      }
     my $expiredstart = $now - $timediff{'oldroles'};  
   
     if ($timediff{'crslogin'} == -1) {      if ($timediff{'crslogin'} == -1) {
         $timediff{'crslogin'} = time;          $crsloginstart = 0;
       } else {
           $crsloginstart = $now - $timediff{'crslogin'};
     }      }
   
     my $crsloginstart = $now - $timediff{'crslogin'};  
   
     my $countunread = $display_settings{$cid.':countunread'};      my $countunread = $display_settings{$cid.':countunread'};
     unless (defined($countunread)) {      unless (defined($countunread)) {
         $countunread = 'on';          $countunread = 'on';
Line 678  sub display_threshold_config { Line 688  sub display_threshold_config {
     foreach my $type (@thresholditems) {      foreach my $type (@thresholditems) {
         my $parameter = $env{'request.course.id'}.':threshold_'.$type;          my $parameter = $env{'request.course.id'}.':threshold_'.$type;
 # onchange is javascript to automatically check the 'Set' button.  # onchange is javascript to automatically check the 'Set' button.
         my $onchange = 'onFocus="javascript:window.document.forms'.          my $onchange = 'onfocus="javascript:window.document.forms'.
               "['thresholdform'].elements['".$parameter."_setparmval']".                "['thresholdform'].elements['".$parameter."_setparmval']".
               '.checked=true;"';                '.checked=true;"';
         $r->print(&Apache::loncommon::start_data_table_row()."\n".          $r->print(&Apache::loncommon::start_data_table_row()."\n".
Line 1335  sub getactivated { Line 1345  sub getactivated {
     my (%stucounted,%advcounted);      my (%stucounted,%advcounted);
     my $activatedcount = 0;      my $activatedcount = 0;
     if (keys(%changes) > 0) {      if (keys(%changes) > 0) {
         foreach my $chg (sort { $b <=> $a } (keys(%changes))) {          foreach my $chg (keys(%changes)) {
             if (ref($changes{$chg}) eq 'HASH') {              if (ref($changes{$chg}) eq 'HASH') {
                 my $timestamp = $changes{$chg}{'exe_time'};                  next if ($changes{$chg}{'delflag'});
                 if ($timestamp) {                  if ($rolechgtime > 0) {
                     if ($rolechgtime > 0) {                      next if ($changes{$chg}{'exe_time'} < $rolechgtime);
                         if ($timestamp < $rolechgtime) {                  }
                             last;                  if ($changes{$chg}{'exe_time'}) {
                         }                      my $timestamp = $changes{$chg}{'exe_time'};
                     }  
                     if (ref($changes{$chg}{'logentry'}) eq 'HASH') {                      if (ref($changes{$chg}{'logentry'}) eq 'HASH') {
                         next if ($changes{$chg}{'delflag'});  
                         my $start = $changes{$chg}{'logentry'}{'start'};  
                         my $end = $changes{$chg}{'logentry'}{'end'};                          my $end = $changes{$chg}{'logentry'}{'end'};
                         my $section = $changes{$chg}{'logentry'}{'section'};  
                         my $role = $changes{$chg}{'logentry'}{'role'};  
                         my $uname = $changes{$chg}{'uname'};  
                         my $udom = $changes{$chg}{'udom'};  
                         next if ($end && $end <= $now);                          next if ($end && $end <= $now);
                           my $start = $changes{$chg}{'logentry'}{'start'};
                           next if ($start >= $timestamp);
                           my $section = $changes{$chg}{'logentry'}{'section'};
                         if (($viewablesec ne '') && ($section ne '')) {                          if (($viewablesec ne '') && ($section ne '')) {
                             next if ($viewablesec ne $section);                              next if ($viewablesec ne $section);
                         }                          }
                         next if ($start >= $timestamp);                          my $role = $changes{$chg}{'logentry'}{'role'};
                           my $uname = $changes{$chg}{'uname'};
                           my $udom = $changes{$chg}{'udom'};
                         if ($role eq 'st') {                          if ($role eq 'st') {
                             $stucounted{$uname.':'.$udom.':'.$section} = $start.':'.$end;                              $stucounted{$uname.':'.$udom.':'.$section} = $start.':'.$end;
                         } else {                          } else {
Line 1663  sub display_abovethreshold { Line 1671  sub display_abovethreshold {
     );      );
     if (@{$warnings} > 0) {      if (@{$warnings} > 0) {
         @{$warnings} = sort { &cmp_title($a,$b,$res_title) } @{$warnings};          @{$warnings} = sort { &cmp_title($a,$b,$res_title) } @{$warnings};
         $r->print('<form name="reset_tracking" method="post" action="/adm/whatsnew">'.  
                 ' <input type="hidden" name="command" value="reset" />'."\n".  
                 ' <input type="hidden" name="refpage" value="'.$refpage.'" />'.  
                 "\n");  
         $r->print('<tr class="LC_info_row">'.          $r->print('<tr class="LC_info_row">'.
   '<td class="LC_left_item">'.$lt{'reso'}.'</td>'.    '<td class="LC_left_item">'.$lt{'reso'}.
                     '<input type="hidden" name="command" value="" /></td>'.
   '<td>'.$lt{'part'}.'</td><td>'.$lt{'nust'}.'</td>'.    '<td>'.$lt{'part'}.'</td><td>'.$lt{'nust'}.'</td>'.
   '<td>'.$lt{'avat'}.'</td><td>'.$lt{'dedi'}.'</td>'.    '<td>'.$lt{'avat'}.'</td><td>'.$lt{'dedi'}.'</td>'.
   '<td>'.$lt{'lare'}.'</td><td  class="LC_right_item">'.    '<td>'.$lt{'lare'}.'</td><td  class="LC_right_item">'.
Line 1698  sub display_abovethreshold { Line 1703  sub display_abovethreshold {
             if (ref($$triggered{$res}{text}) eq 'ARRAY') {              if (ref($$triggered{$res}{text}) eq 'ARRAY') {
                 if (@{$$triggered{$res}{text}} > 1) {                  if (@{$$triggered{$res}{text}} > 1) {
                     for (my $i=1; $i<@{$$triggered{$res}{text}}; $i++) {                      for (my $i=1; $i<@{$$triggered{$res}{text}}; $i++) {
                         $r->print('<tr class="'.$css_class.'">'.                          $r->print('<tr '.$css_class.'>'.
                                   $$triggered{$res}{text}[$i].'</tr>');                                    $$triggered{$res}{text}[$i].'</tr>');
                     }                      }
                 }                  }
             }              }
         }          }
         $r->print('<tr class="LC_info_row"><td colspan="7" class="LC_right_item"><br /><input type="submit" name="counters" value="'.$lt{'rese'}.'" /></td></tr></form>');          $r->print('<tr class="LC_info_row"><td colspan="7" class="LC_right_item"><br /><input type="button" name="counters" value="'.$lt{'rese'}.'" onclick="javascript:thresholdreset();" /></td></tr>');
     } elsif ($itemserror) {      } elsif ($itemserror) {
         $r->print('<tr class="LC_empty_row"><td>'.$itemserror.'</td></tr>');          $r->print('<tr class="LC_empty_row"><td>'.$itemserror.'</td></tr>');
     } else {      } else {
Line 1921  sub display_coursediscussion { Line 1926  sub display_coursediscussion {
             my $forum_title = $$unread{$ressymb}{'title'};              my $forum_title = $$unread{$ressymb}{'title'};
             my $type = 'Resource';              my $type = 'Resource';
             my $feedurl=&Apache::lonfeedback::get_feedurl($ressymb);              my $feedurl=&Apache::lonfeedback::get_feedurl($ressymb);
             my $disclink = $feedurl.'?symb='.$$unread{$ressymb}{symb};              my $disclink = $feedurl.'?symb='.&escape($$unread{$ressymb}{symb});
             if ($feedurl =~ /bulletinboard/) {              if ($feedurl =~ /bulletinboard/) {
                 $type = 'Discussion Board';                  $type = 'Discussion Board';
             }              }

Removed from v.1.105.2.2  
changed lines
  Added in v.1.105.2.6


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