Diff for /loncom/interface/Attic/londropadd.pm between versions 1.114 and 1.115

version 1.114, 2004/06/17 18:31:24 version 1.115, 2004/06/29 04:30:00
Line 1231  END Line 1231  END
                                            'sec'    => "section",                                             'sec'    => "section",
                                            'start'  => "start date",                                             'start'  => "start date",
                                            'end'    => "end date",                                             'end'    => "end date",
                                            'type'   => "enroll type",                                             'type'   => "enroll type/action"
                                            'chan'   => "change"  
    );     );
         unless ($mode eq 'autoenroll') {          unless ($mode eq 'autoenroll') {
             $r->print(<<END);              $r->print(<<END);
Line 1240  END Line 1239  END
 <input type="hidden" name="sdom"   value="" />  <input type="hidden" name="sdom"   value="" />
 END  END
         }          }
         $r->print(<<END);          $r->print("
 <p>  <p>
 <table border=2>  <table border=2>
 <tr><th>Count  <tr>
     </th><th>          ");
           if ($mode eq 'autoenroll') {
               $r->print("
    <th><a href=\"javascript:document.studentform.sortby.value='type';document.studentform.submit();\">$lt{'type'}</a></th>
               ");
           } else {
               $r->print("
   <th>Count</th>
               ");
           }
           $r->print(<<END);
       <th>
        <a href="javascript:document.studentform.sortby.value='username';document.studentform.submit();">$lt{'usrn'}</a>         <a href="javascript:document.studentform.sortby.value='username';document.studentform.submit();">$lt{'usrn'}</a>
     </th><th>      </th><th>
        <a href="javascript:document.studentform.sortby.value='domain';document.studentform.submit();">$lt{'dom'}</a>         <a href="javascript:document.studentform.sortby.value='domain';document.studentform.submit();">$lt{'dom'}</a>
Line 1259  END Line 1269  END
     </th><th>      </th><th>
        <a href="javascript:document.studentform.sortby.value='end';document.studentform.submit();">$lt{'end'}</a>         <a href="javascript:document.studentform.sortby.value='end';document.studentform.submit();">$lt{'end'}</a>
     </th>      </th>
     </tr>
 END  END
         if ($mode eq 'autoenroll') {  
             $r->print("   <th>  
        <a href=\"javascript:document.studentform.sortby.value='type';document.studentform.submit();\">$lt{'type'}</a>  
     </th><th>  
          $lt{'chan'}?</th>");  
         }  
         $r->print("  
    </tr>  
         ");  
     } elsif ($mode eq 'csv') {      } elsif ($mode eq 'csv') {
  #   #
  # Open a file   # Open a file
Line 1337  END Line 1339  END
         lc($classlist->{$a}->[$third]) cmp lc($classlist->{$b}->[$third])          lc($classlist->{$a}->[$third]) cmp lc($classlist->{$b}->[$third])
         } (keys(%$classlist));          } (keys(%$classlist));
     my $studentcount = 0;      my $studentcount = 0;
       my $autocount = 0;
       my $manualcount = 0;
       my $unlockcount = 0;
       my $lockcount = 0;
     foreach my $student (@Sorted_Students) {      foreach my $student (@Sorted_Students) {
         my $sdata = $classlist->{$student};          my $sdata = $classlist->{$student};
         my $username = $sdata->[$index{'username'}];          my $username = $sdata->[$index{'username'}];
Line 1347  END Line 1353  END
         my $status   = $sdata->[$index{'status'}];          my $status   = $sdata->[$index{'status'}];
         my $start    = $sdata->[$index{'start'}];          my $start    = $sdata->[$index{'start'}];
         my $end      = $sdata->[$index{'end'}];          my $end      = $sdata->[$index{'end'}];
         my $type     = $sdata->[$index{'type'}];           my $type     = $sdata->[$index{'type'}];
         next if (($statusmode ne 'Any') && ($status ne $statusmode));          next if (($statusmode ne 'Any') && ($status ne $statusmode));
         if ($mode eq 'view' || $mode eq 'html' || $mode eq 'autoenroll') {          if ($mode eq 'view' || $mode eq 'html' || $mode eq 'autoenroll') {
             if (! defined($start) || $start == 0) {              if (! defined($start) || $start == 0) {
Line 1360  END Line 1366  END
             } else {              } else {
                 $end = &Apache::lonlocal::locallocaltime($end);                  $end = &Apache::lonlocal::locallocaltime($end);
             }              }
             $r->print("<tr>\n    <td>".(++$studentcount)."</td><td>\n    ");              $r->print("<tr>\n    ");
               if ($mode eq 'autoenroll') {
                   my $lockedtype = $sdata->[$index{'lockedtype'}];
                   $studentcount++;
                   my $cellentry;
                   if ($type eq 'auto') {
                       $cellentry = '<b>'.&mt('auto').'</b>&nbsp;<input type="checkbox" name="chgauto" value="'.$username.':'.$domain.'" />&nbsp;Change';
                       $autocount ++;
                   } else {
                       $cellentry = '<table border="0" cellspacing="0"><tr><td rowspan="2"><b>'.&mt('manual').'</b></td><td><input type="checkbox" name="chgmanual" value="'.$username.':'.$domain.'" />&nbsp;Change</td></tr><tr><td>';
                       $manualcount ++;
                       if ($lockedtype) {
                           $cellentry .= '<input type="checkbox" name="unlockchg" value="'.$username.':'.$domain.'" />&nbsp;'.&mt('Unlock');
                           $unlockcount ++;
                       } else {
                           $cellentry .= '<input type="checkbox" name="lockchg" value="'.$username.':'.$domain.'" />&nbsp;'.&mt('Lock');
                           $lockcount ++;
                       }
                       $cellentry .= '</td></tr></table>';
                   }
                   $r->print("<td>$cellentry<td>\n    ");
               } else {
                   $r->print("<td>".(++$studentcount)."</td><td>\n    ");
               }
             if ($linkto eq 'nothing') {              if ($linkto eq 'nothing') {
                 $r->print($username);                  $r->print($username);
             } elsif ($linkto eq 'aboutme') {              } elsif ($linkto eq 'aboutme') {
Line 1384  END Line 1413  END
     <td>$section</td>      <td>$section</td>
     <td>$start</td>      <td>$start</td>
     <td>$end</td>      <td>$end</td>
      </tr>
 END  END
             if ($mode eq 'autoenroll') {  
                 my $longtype = &mt('manual').'&nbsp';  
                 if ($type eq 'auto') {  
                     $longtype = &mt('auto').'&nbsp';  
                 }  
                 $r->print("<td><b>$longtype</b></td><td><input type=\"checkbox\" name=\"switch:$username:$domain\" /></td>");  
             }  
             $r->print("  
 </tr>  
             ");  
         } elsif ($mode eq 'csv') {          } elsif ($mode eq 'csv') {
             next if (! defined($CSVfile));              next if (! defined($CSVfile));
             # no need to bother with $linkto              # no need to bother with $linkto
Line 1443  END Line 1463  END
         $r->rflush();          $r->rflush();
     }      }
     if ($mode eq 'autoenroll') {      if ($mode eq 'autoenroll') {
         return $studentcount;          return ($studentcount,$autocount,$manualcount,$lockcount,$unlockcount);
     }      }
       return;
 }  }
   
   

Removed from v.1.114  
changed lines
  Added in v.1.115


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