Diff for /loncom/interface/Attic/londropadd.pm between versions 1.167 and 1.170

version 1.167, 2007/08/28 13:00:45 version 1.170, 2007/09/27 18:58:52
Line 179  sub print_main_menu { Line 179  sub print_main_menu {
           { text => 'Create a new group',            { text => 'Create a new group',
             help => 'Course_Create_Group',              help => 'Course_Create_Group',
             permission => $permission->{'grp_manage'},              permission => $permission->{'grp_manage'},
             url => '/adm/coursegroups?refpage=enrl&action=create',              url => '/adm/coursegroups?refpage=enrl&action=create',
             },              },
           { text => 'Modify an existing group',            { text => 'Modify an existing group',
             help => 'Course_Modify_Group',              help => 'Course_Modify_Group',
             permission => $permission->{'grp_manage'},              permission => $permission->{'grp_manage'},
             url => '/adm/coursegroups?refpage=enrl&action=modify',              url => '/adm/coursegroups?refpage=enrl&action=modify',
             },              },
           { text => 'Delete an existing group',            { text => 'Delete an existing group',
             help => 'Course_Delete_Group',              help => 'Course_Delete_Group',
             permission => $permission->{'grp_manage'},              permission => $permission->{'grp_manage'},
             url => '/adm/coursegroups?refpage=enrl&action=delete',              url => '/adm/coursegroups?refpage=enrl&action=delete',
             },              },
           { text => 'Re-enable a deleted group',            { text => 'Re-enable a deleted group',
             help => 'Course_Reenable_Group',              help => 'Course_Reenable_Group',
             permission => $permission->{'grp_manage'},              permission => $permission->{'grp_manage'},
             url => '/adm/coursegroups?refpage=enrl&action=reenable',              url => '/adm/coursegroups?refpage=enrl&action=reenable',
             },              },
           { text => 'Enter an existing group',            { text => 'Enter an existing group',
             help => 'Course_Display_Group',              help => 'Course_Display_Group',
             permission => $permission->{'grp_view'},              permission => $permission->{'grp_view'},
             url => '/adm/coursegroups?refpage=enrl&action=view',              url => '/adm/coursegroups?refpage=enrl&action=view',
             },              },
           );            );
     my $menu_html = '';      my $menu_html = '';
Line 984  sub get_student_username_domain_form { Line 984  sub get_student_username_domain_form {
 $jscript  $jscript
 <h3>$lt{'eos'}</h3>  <h3>$lt{'eos'}</h3>
 END  END
       $r->print($response);
     $r->print(&single_user_entry_form($defdom,$srch,$forcenewuser));      $r->print(&single_user_entry_form($defdom,$srch,$forcenewuser));
     return;      return;
 }  }
Line 1364  sub show_class_list { Line 1365  sub show_class_list {
     }      }
     my $displayphotos = $env{'form.displayphotos'};      my $displayphotos = $env{'form.displayphotos'};
   
       if (! exists($env{'form.displayclickers'})) {
           $env{'form.displayclickers'} = 'off';
       }
       my $displayclickers = $env{'form.displayclickers'};
   
     # Print out header       # Print out header 
     unless ($mode eq 'autoenroll') {      unless ($mode eq 'autoenroll') {
         $r->print(<<END);          $r->print(<<END);
Line 1373  END Line 1379  END
     $r->print(<<END);      $r->print(<<END);
 <input type="hidden" name="sortby" value="$sortby" />  <input type="hidden" name="sortby" value="$sortby" />
 <input type="hidden" name="displayphotos" value="$displayphotos" />  <input type="hidden" name="displayphotos" value="$displayphotos" />
   <input type="hidden" name="displayclickers" value="$displayclickers" />
 END  END
     if ($mode eq 'html' || $mode eq 'view' || $mode eq 'autoenroll') {      if ($mode eq 'html' || $mode eq 'view' || $mode eq 'autoenroll') {
         if ($linkto eq 'aboutme') {          if ($linkto eq 'aboutme') {
Line 1390  END Line 1397  END
                                            'end'    => "end date",                                             'end'    => "end date",
                                            'type'   => "enroll type/action",                                             'type'   => "enroll type/action",
    'email'  => "email address",     'email'  => "email address",
                                              'clicker'=> "clicker id",
                                            'photo'  => "photo",                                             'photo'  => "photo",
    );     );
         unless ($mode eq 'autoenroll') {          unless ($mode eq 'autoenroll') {
Line 1446  function photowindow(photolink) { Line 1454  function photowindow(photolink) {
        <a href="javascript:document.studentform.sortby.value='email';document.studentform.submit();">$lt{'email'}</a>         <a href="javascript:document.studentform.sortby.value='email';document.studentform.submit();">$lt{'email'}</a>
     </th>      </th>
 END  END
   
   # Clicker display on or off?
   
           my %clicker_options = &Apache::lonlocal::texthash(
                                                             'on' => 'Show',
                                                             'off' => 'Hide',
                                                            );
           my $clickerchg = 'on';
           if ($displayclickers eq 'on') {
               $clickerchg = 'off';
           }
           $r->print('    <th>'."\n".'     '.
               '<a href="javascript:document.studentform.displayclickers.value='.
                         "'".$clickerchg."'".';document.studentform.submit();">'.
                         $clicker_options{$clickerchg}.'</a>&nbsp;'.$lt{'clicker'}."\n".
                         '    </th>'."\n");
   
   # Photo display on or off?
         if ($env{'course.'.$env{'request.course.id'}.'.internal.showphoto'}) {          if ($env{'course.'.$env{'request.course.id'}.'.internal.showphoto'}) {
             my %photo_options = &Apache::lonlocal::texthash(              my %photo_options = &Apache::lonlocal::texthash(
                                                             'on' => 'Show',                                                              'on' => 'Show',
Line 1462  END Line 1488  END
                       '    </th>'."\n");                        '    </th>'."\n");
         }          }
         $r->print("  </tr>\n");          $r->print("  </tr>\n");
   
   # Done with the HTML header line
   
     } elsif ($mode eq 'csv') {      } elsif ($mode eq 'csv') {
  #   #
  # Open a file   # Open a file
Line 1514  END Line 1543  END
                                       "active groups","email address"],                                        "active groups","email address"],
                             $format->{'bold'});                              $format->{'bold'});
     }      }
   
   # Done with header lines in all formats
   
     #      #
     # Sort the students      # Sort the students
     my %index;      my %index;
Line 1557  END Line 1589  END
   
  my %emails   = &Apache::loncommon::getemails($username,$domain);   my %emails   = &Apache::loncommon::getemails($username,$domain);
  my $email;   my $email;
  foreach my $type ('critnotification', 'permanentemail',   if ($emails{'permanentemail'} =~ /\S/) {
   'notification') {      $email = $emails{'permanentemail'};
     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') {
Line 1626  END Line 1654  END
     <td>$active_groups</td>      <td>$active_groups</td>
     <td>$email</td>      <td>$email</td>
 END  END
   
   # Clickers
               if ($displayclickers eq 'on') {
                  my $clickers =
                  (&Apache::lonnet::userenvironment($domain,$username,'clickers'))[1];
                  if ($clickers!~/\w/) { $clickers='-'; }
                  $r->print('<td>'.$clickers.'</td>');
               } else {
                   $r->print('    <td>&nbsp;</td>  ');
               }
   
   # Photos
   
             if ($env{'course.'.$env{'request.course.id'}.              if ($env{'course.'.$env{'request.course.id'}.
  '.internal.showphoto'}) {   '.internal.showphoto'}) {
                 if ($displayphotos eq 'on') {                  if ($displayphotos eq 'on') {
Line 1715  sub print_modify_student_form { Line 1756  sub print_modify_student_form {
     # determine the students name information      # determine the students name information
     my %info=&Apache::lonnet::get('environment',      my %info=&Apache::lonnet::get('environment',
                                   ['firstname','middlename',                                    ['firstname','middlename',
                                    'lastname','generation','id'],                                     'lastname','generation','id',
                                   $sdom, $sname);                                     'permanentemail'], $sdom, $sname);
     my ($tmp) = keys(%info);      my ($tmp) = keys(%info);
     if ($tmp =~ /^(con_lost|error|no_such_host)/i) {      if ($tmp =~ /^(con_lost|error|no_such_host)/i) {
         $r->print('<font color="#ff0000" size="+2">'.&mt('Error').'</font>'.          $r->print('<font color="#ff0000" size="+2">'.&mt('Error').'</font>'.
Line 1770  sub print_modify_student_form { Line 1811  sub print_modify_student_form {
                    'mn'    => "Middle",                     'mn'    => "Middle",
                    'ln'    => "Last",                     'ln'    => "Last",
                    'gen'   => "Generation",                     'gen'   => "Generation",
                      'email' => "E-mail address",
                    'sid'   => "Student ID",                     'sid'   => "Student ID",
                    'disn'  => "Disable ID/Student Number Safeguard and Force Change of Conflicting IDs (only do if you know what you are doing)",                     'disn'  => "Disable ID/Student Number Safeguard and Force Change of Conflicting IDs (only do if you know what you are doing)",
                    'sec'   => "Section",                     'sec'   => "Section",
Line 1799  $lt{'odcc'} Line 1841  $lt{'odcc'}
 <input type="hidden" name="state"   value="done" />  <input type="hidden" name="state"   value="done" />
 <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'}   <h3>$lt{'mef'} $info{'firstname'} $info{'middlename'} 
 $info{'lastname'} $info{'generation'}, $sname:$sdom</h2>  $info{'lastname'} $info{'generation'}, $sname:$sdom</h3>
 <p>  <p>
 <b>$lt{'sn'}</b>  <b>$lt{'sn'}</b>
 <table>  <table>
Line 1812  $info{'lastname'} $info{'generation'}, $ Line 1854  $info{'lastname'} $info{'generation'}, $
 <input type="text" name="generation" value="$info{'generation'}" /></td></tr>  <input type="text" name="generation" value="$info{'generation'}" /></td></tr>
 </table>  </table>
 </p><p>  </p><p>
   <b>$lt{'email'}</b>: <input type="text" name="permanentemail" value="$info{'permanentemail'}" size="30" />
   </p><p>
 <b>$lt{'sid'}</b>: <input type="text" name="id" value="$info{'id'}" size="12" />  <b>$lt{'sid'}</b>: <input type="text" name="id" value="$info{'id'}" size="12" />
 </p><p>  </p><p>
 <label>  <label>
Line 1855  sub modify_single_student { Line 1899  sub modify_single_student {
     # Get the old data      # Get the old data
     my %old=&Apache::lonnet::get('environment',      my %old=&Apache::lonnet::get('environment',
                                  ['firstname','middlename',                                   ['firstname','middlename',
                                   'lastname','generation','id'],                                    'lastname','generation','id',
                                  $sdom, $slogin);                                    'permanentemail'],$sdom, $slogin);
     $old{'section'} = &Apache::lonnet::getsection($sdom,$slogin,      $old{'section'} = &Apache::lonnet::getsection($sdom,$slogin,
                                                   $env{'request.course.id'});                                                    $env{'request.course.id'});
     my ($tmp) = keys(%old);      my ($tmp) = keys(%old);
Line 1871  sub modify_single_student { Line 1915  sub modify_single_student {
     my $middlename = $env{'form.middlename'};      my $middlename = $env{'form.middlename'};
     my $lastname   = $env{'form.lastname'};      my $lastname   = $env{'form.lastname'};
     my $generation = $env{'form.generation'};      my $generation = $env{'form.generation'};
       my $permanentemail = $env{'form.permanentemail'};
     my $section    = $env{'form.section'};      my $section    = $env{'form.section'};
     my $courseid   = $env{'request.course.id'};      my $courseid   = $env{'request.course.id'};
     my $sid        = $env{'form.id'};      my $sid        = $env{'form.id'};
Line 1895  sub modify_single_student { Line 1940  sub modify_single_student {
                    'mn'    => "Middle name",                     'mn'    => "Middle name",
                    'ln'    => "Last name",                     'ln'    => "Last name",
                    'gen'   => "Generation",                     'gen'   => "Generation",
                      'em'    => "E-mail address",
                    'sec'   => "Section",                     'sec'   => "Section",
                    'ri'    => "Role Information",                     'ri'    => "Role Information",
                    'st'    => "Start Time",                     'st'    => "Start Time",
                    'et'    => "End Time",                     'et'    => "End Time",
        );         );
     $r->print(<<END);      $r->print(<<END);
     <h2>$lt{'mdu'} $slogin : $sdom </h2>      <h3>$lt{'mdu'} $slogin:$sdom </h3>
 <h3>$lt{'si'}</h3>  END
 <table rules="rows" border="1" cellpadding="3" >      $r->print(<<END);
 <tr>  
     <th> $lt{'fd'} </th>  
     <th> $lt{'ov'} </th>  
     <th> $lt{'nv'} </th>  
 </tr>  
 <tr>  
     <td> <b>$lt{'fn'}</b> </td>  
     <td> $old{'firstname'} </td>  
     <td> $firstname </td>  
 </tr><tr>  
     <td> <b>$lt{'mn'}</b> </td>  
     <td> $old{'middlename'} </td>  
     <td> $middlename </td>  
 </tr><tr>  
     <td> <b>$lt{'ln'}</b> </td>  
     <td> $old{'lastname'} </td>  
     <td> $lastname </td>  
 </tr><tr>  
     <td> <b>$lt{'gen'}</b> </td>  
     <td> $old{'generation'} </td>  
     <td> $generation </td>  
 </tr><tr>  
     <td> <b>ID</b> </td>  
     <td> $old{'id'} </td>  
     <td> $sid </td>  
 </tr><tr>  
     <td> <b>$lt{'sec'}</b> </td>  
     <td> $old{'section'} </td>  
     <td> $section</td>  
 </tr>  
 </table>  
 <h3>$lt{'ri'}</h3>  
 <table>  <table>
 <tr><td align="right"><b>$lt{'st'}:</b></td><td> $displayable_starttime </td></tr>   <tr>
 <tr><td align="right"><b>$lt{'et'}:</b></td><td> $displayable_endtime   </td></tr>    <td>
       <table class="LC_nested_outer">
        <tr>
         <th>$lt{si}</th>
        </tr>
        <tr>
         <td>
          <table class="LC_nested">
           <tr class="LC_info_row">
            <td class="LC_left_item"> $lt{'fd'} </td>
            <td class="LC_left_item"> $lt{'ov'} </td>
            <td class="LC_left_item"> $lt{'nv'} </td>
           </tr>
           <tr class="LC_odd_row">
            <td class="LC_left_item"> <b>$lt{'fn'}</b> </td>
            <td class="LC_left_item"> $old{'firstname'} </td>
            <td class="LC_left_item"> $firstname </td>
           </tr>
           <tr>
            <td class="LC_left_item"> <b>$lt{'mn'}</b> </td>
            <td class="LC_left_item"> $old{'middlename'} </td>
            <td class="LC_left_item"> $middlename </td>
           </tr>
           <tr class="LC_odd_row">
            <td class="LC_left_item"> <b>$lt{'ln'}</b> </td>
            <td class="LC_left_item"> $old{'lastname'} </td>
            <td class="LC_left_item"> $lastname </td>
           </tr>
           <tr>
            <td class="LC_left_item"> <b>$lt{'gen'}</b> </td>
            <td class="LC_left_item"> $old{'generation'} </td>
            <td class="LC_left_item"> $generation </td>
           </tr>
           <tr class="LC_odd_row">
            <td class="LC_left_item"> <b>ID</b> </td>
            <td class="LC_left_item"> $old{'id'} </td>
            <td class="LC_left_item"> $sid </td>
           </tr>
           <tr>
            <td class="LC_left_item"> <b>$lt{'em'}</b> </td>
            <td class="LC_left_item"> $old{'permanentemail'} </td>
            <td class="LC_left_item"> $permanentemail </td>
           <tr class="LC_odd_row">
            <td> <b>$lt{'sec'}</b> </td>
            <td> $old{'section'} </td>
            <td> $section</td>
           </tr>
          </table>
         </td>
        </tr>
      </table>
      <br />
      <table class="LC_nested_outer">
        <tr>
         <th>$lt{'ri'}</th>
        </tr>
        <tr>
         <td>
          <table class="LC_nested">
           <tr class="LC_odd_row">
            <td class="LC_left_item"><b>$lt{'st'}:</b></td>
            <td class="LC_right_item"> $displayable_starttime </td>
           </tr>
           <tr>
            <td class="LC_left_item"><b>$lt{'et'}:</b></td>
            <td class="LC_right_item"> $displayable_endtime   </td>
           </tr>
          </table>
         </td>
        </tr>
       </table>
     </td>
    </tr>
 </table>  </table>
 <p>  <p>
 END  END
Line 1953  END Line 2039  END
     }      }
     my $roleresults = &Apache::lonnet::modifystudent      my $roleresults = &Apache::lonnet::modifystudent
         ($sdom,$slogin,$sid,undef,undef,$firstname,$middlename,$lastname,          ($sdom,$slogin,$sid,undef,undef,$firstname,$middlename,$lastname,
          $generation,$section,$endtime,$starttime,$env{'form.forceid'});           $generation,$section,$endtime,$starttime,$env{'form.forceid'},
            undef,$permanentemail);
       if ($old{'permanentemail'} ne $permanentemail) {
           &Apache::loncommon::flush_email_cache($slogin,$sdom);
       }
     if ($roleresults eq 'refused' ) {      if ($roleresults eq 'refused' ) {
         $r->print(&mt('Your request to change the role information for this student was refused. You do not appear to have sufficient authority to change student information.'));          $r->print(&mt('Your request to change the role information for this student was refused. You do not appear to have sufficient authority to change student information.'));
     } elsif ($roleresults !~ /ok/) {      } elsif ($roleresults !~ /ok/) {

Removed from v.1.167  
changed lines
  Added in v.1.170


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