Diff for /loncom/interface/Attic/londropadd.pm between versions 1.161 and 1.163

version 1.161, 2007/06/04 11:36:46 version 1.163, 2007/07/17 21:24:17
Line 752  sub enroll_single_student { Line 752  sub enroll_single_student {
     }      }
   
     $r->print('<h3>'.&mt('Enrolling Student').'</h3>');      $r->print('<h3>'.&mt('Enrolling Student').'</h3>');
     $r->print('<p>'.&mt('Enrolling').' '.$env{'form.cuname'}." \@ ".      $r->print('<p>'.&mt('Enrolling [_1] : [_2]',$env{'form.cuname'},
               $env{'form.lcdomain'}.'</p>');   $env{'form.lcdomain'}).'</p>');
     if (($env{'form.cuname'})      if (($env{'form.cuname'})
  && ($env{'form.cuname'}    && ($env{'form.cuname'} 
     eq &LONCAPA::clean_username($env{'form.cuname'}))      eq &LONCAPA::clean_username($env{'form.cuname'}))
Line 1296  END Line 1296  END
                                            'start'  => "start date",                                             'start'  => "start date",
                                            'end'    => "end date",                                             'end'    => "end date",
                                            'type'   => "enroll type/action",                                             'type'   => "enroll type/action",
      'email'  => "email address",
                                            'photo'  => "photo",                                             'photo'  => "photo",
    );     );
         unless ($mode eq 'autoenroll') {          unless ($mode eq 'autoenroll') {
Line 1348  function photowindow(photolink) { Line 1349  function photowindow(photolink) {
        <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>      </th><th>
        <a href="javascript:document.studentform.sortby.value='groups';document.studentform.submit();">$lt{'grp'}</a>         <a href="javascript:document.studentform.sortby.value='groups';document.studentform.submit();">$lt{'grp'}</a>
       </th><th>
          <a href="javascript:document.studentform.sortby.value='email';document.studentform.submit();">$lt{'email'}</a>
     </th>      </th>
 END  END
         if ($env{'course.'.$env{'request.course.id'}.'.internal.showphoto'}) {          if ($env{'course.'.$env{'request.course.id'}.'.internal.showphoto'}) {
Line 1391  END Line 1394  END
             print $CSVfile '"'.join('","',map {              print $CSVfile '"'.join('","',map {
  &Apache::loncommon::csv_translate(&mt($_))   &Apache::loncommon::csv_translate(&mt($_))
                 } ("username","domain","ID","student name",                  } ("username","domain","ID","student name",
                    "section","start date","end date","status","active groups"))                     "section","start date","end date","status",
      "active groups","email address"))
                   .'"'."\n";                    .'"'."\n";
         } else {          } else {
             print $CSVfile '"'.join('","',map {              print $CSVfile '"'.join('","',map {
  &Apache::loncommon::csv_translate(&mt($_))   &Apache::loncommon::csv_translate(&mt($_))
                 } ("username","domain","ID","student name",                  } ("username","domain","ID","student name",
                    "section","start date","end date","active groups")).'"'."\n";                     "section","start date","end date",
      "active groups","email address")).'"'."\n";
         }          }
     } elsif ($mode eq 'excel') {      } elsif ($mode eq 'excel') {
         # Create the excel spreadsheet          # Create the excel spreadsheet
Line 1413  END Line 1418  END
         $excel_sheet->write($row++,0,["username","domain","ID",          $excel_sheet->write($row++,0,["username","domain","ID",
                                       "student name","section",                                        "student name","section",
                                       "start date","end date","status",                                        "start date","end date","status",
                                       "active groups"],                                        "active groups","email address"],
                             $format->{'bold'});                              $format->{'bold'});
     }      }
     #      #
Line 1452  END Line 1457  END
         my $name     = $sdata->[$index{'fullname'}];          my $name     = $sdata->[$index{'fullname'}];
         my $id       = $sdata->[$index{'id'}];          my $id       = $sdata->[$index{'id'}];
         my $status   = $sdata->[$index{'status'}];          my $status   = $sdata->[$index{'status'}];
           next if (($statusmode ne 'Any') && ($status ne $statusmode));
         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));  
    my %emails   = &Apache::loncommon::getemails($username,$domain);
    my $email;
    foreach my $type ('critnotification', 'permanentemail',
     'notification') {
       if ($emails{$type} =~ /\S/) {
    $email = $emails{$type};
    last;
       }
    }
   
         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) {
                 $start = &mt('none');                  $start = &mt('none');
Line 1515  END Line 1531  END
     <td>$start</td>      <td>$start</td>
     <td>$end</td>      <td>$end</td>
     <td>$active_groups</td>      <td>$active_groups</td>
       <td>$email</td>
 END  END
             if ($env{'course.'.$env{'request.course.id'}.              if ($env{'course.'.$env{'request.course.id'}.
  '.internal.showphoto'}) {   '.internal.showphoto'}) {
Line 1551  END Line 1568  END
                 push @line,&Apache::loncommon::csv_translate($status);                  push @line,&Apache::loncommon::csv_translate($status);
             }              }
             push @line,&Apache::loncommon::csv_translate($active_groups);              push @line,&Apache::loncommon::csv_translate($active_groups);
               push @line,&Apache::loncommon::csv_translate($email);
             print $CSVfile '"'.join('","',@line).'"'."\n";              print $CSVfile '"'.join('","',@line).'"'."\n";
         } elsif ($mode eq 'excel') {          } elsif ($mode eq 'excel') {
             $excel_sheet->write($row,0,[$username,$domain,$id,              $excel_sheet->write($row,0,[$username,$domain,$id,
Line 1567  END Line 1585  END
             }              }
             $excel_sheet->write($row,$col++,$status);              $excel_sheet->write($row,$col++,$status);
             $excel_sheet->write($row,$col++,$active_groups);              $excel_sheet->write($row,$col++,$active_groups);
               $excel_sheet->write($row,$col++,$email);
             $row++;              $row++;
         }          }
     }      }
Line 1688  $lt{'odcc'} Line 1707  $lt{'odcc'}
 <input type="hidden" name="sortby"  value="$sortby" />  <input type="hidden" name="sortby"  value="$sortby" />
 <input type="hidden" name="Status"  value="$env{'form.Status'}" />  <input type="hidden" name="Status"  value="$env{'form.Status'}" />
 <h2>$lt{'mef'} $info{'firstname'} $info{'middlename'}   <h2>$lt{'mef'} $info{'firstname'} $info{'middlename'} 
 $info{'lastname'} $info{'generation'}, $sname\@$sdom</h2>  $info{'lastname'} $info{'generation'}, $sname:$sdom</h2>
 <p>  <p>
 <b>$lt{'sn'}</b>  <b>$lt{'sn'}</b>
 <table>  <table>
Line 1749  sub modify_single_student { Line 1768  sub modify_single_student {
                                                   $env{'request.course.id'});                                                    $env{'request.course.id'});
     my ($tmp) = keys(%old);      my ($tmp) = keys(%old);
     if ($tmp =~ /^(con_lost|error|no_such_host)/i) {      if ($tmp =~ /^(con_lost|error|no_such_host)/i) {
         $r->print(&mt('There was an error determining the environment values for')." $slogin \@ $sdom.");          $r->print(&mt('There was an error determining the environment values for')." $slogin : $sdom.");
         return;          return;
     }      }
     undef $tmp;      undef $tmp;
Line 1789  sub modify_single_student { Line 1808  sub modify_single_student {
                    'et'    => "End Time",                     'et'    => "End Time",
        );         );
     $r->print(<<END);      $r->print(<<END);
     <h2>$lt{'mdu'} $slogin \@ $sdom </h2>      <h2>$lt{'mdu'} $slogin : $sdom </h2>
 <h3>$lt{'si'}</h3>  <h3>$lt{'si'}</h3>
 <table rules="rows" border="1" cellpadding="3" >  <table rules="rows" border="1" cellpadding="3" >
 <tr>  <tr>
Line 1849  END Line 1868  END
                   &mt('The error reported was')." ".                    &mt('The error reported was')." ".
                   $roleresults);                    $roleresults);
         &Apache::lonnet::logthis("londropadd:failed attempt to modify student".          &Apache::lonnet::logthis("londropadd:failed attempt to modify student".
                                  " data for ".$slogin." \@ ".$sdom." by ".                                   " data for ".$slogin." : ".$sdom." by ".
                                  $env{'user.name'}." \@ ".$env{'user.domain'}.                                   $env{'user.name'}." : ".$env{'user.domain'}.
                                  ":".$roleresults);                                   ":".$roleresults);
     } else { # everything is okay!      } else { # everything is okay!
         $r->print(&mt('Student information updated successfully.')." <br />".          $r->print(&mt('Student information updated successfully.')." <br />".

Removed from v.1.161  
changed lines
  Added in v.1.163


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