Diff for /loncom/interface/Attic/londropadd.pm between versions 1.166 and 1.169

version 1.166, 2007/08/26 21:09:42 version 1.169, 2007/08/31 03:22:51
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 1557  END Line 1558  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 1715  sub print_modify_student_form { Line 1712  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 1767  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 1797  $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 1810  $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 1855  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 1871  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 1896  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 1995  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/) {
Line 2661  sub handler { Line 2707  sub handler {
             foreach my $item (@search) {              foreach my $item (@search) {
                 $srch->{$item} = $env{'form.'.$item};                  $srch->{$item} = $env{'form.'.$item};
             }              }
             print STDERR "phase = $env{'form.phase'}\n";  
             if ($env{'form.phase'} eq 'get_user_info') {              if ($env{'form.phase'} eq 'get_user_info') {
                 my ($currstate,$response,$forcenewuser,$results) =                  my ($currstate,$response,$forcenewuser,$results) =
                     &Apache::loncreateuser::user_search_result($srch);                      &Apache::loncreateuser::user_search_result($srch);
Line 2732  sub handler { Line 2777  sub handler {
             &get_student_username_domain_form($r,$elements);              &get_student_username_domain_form($r,$elements);
         }          }
     } elsif ($env{'form.action'} eq 'classlist' && $permission->{'view'}) {      } elsif ($env{'form.action'} eq 'classlist' && $permission->{'view'}) {
           $r->print(&header());
         &Apache::lonhtmlcommon::add_breadcrumb          &Apache::lonhtmlcommon::add_breadcrumb
             ({href=>'/adm/dropadd?action=classlist',              ({href=>'/adm/dropadd?action=classlist',
               text=>"View Classlist"});                text=>"View Classlist"});
Line 2747  sub handler { Line 2793  sub handler {
             &print_html_classlist($r,undef,$permission);              &print_html_classlist($r,undef,$permission);
         }          }
     } elsif ($env{'form.action'} eq 'modifystudent' && $permission->{'enrl'}) {      } elsif ($env{'form.action'} eq 'modifystudent' && $permission->{'enrl'}) {
           $r->print(&header());
         &Apache::lonhtmlcommon::add_breadcrumb          &Apache::lonhtmlcommon::add_breadcrumb
             ({href=>'/adm/dropadd?action=modifystudent',              ({href=>'/adm/dropadd?action=modifystudent',
               text=>"Modify Student Data"});                text=>"Modify Student Data"});
Line 2766  sub handler { Line 2813  sub handler {
         &Apache::lonnet::logthis("Undetermined state in londropadd.pm.  ".          &Apache::lonnet::logthis("Undetermined state in londropadd.pm.  ".
                                  "form.action = ".$env{'form.action'}.                                   "form.action = ".$env{'form.action'}.
                                  "Someone should fix this.");                                   "Someone should fix this.");
           $r->print(&header());
         $r->print(&Apache::lonhtmlcommon::breadcrumbs('Enrollment Manager'));          $r->print(&Apache::lonhtmlcommon::breadcrumbs('Enrollment Manager'));
         &print_main_menu($r,$permission);          &print_main_menu($r,$permission);
     }      }

Removed from v.1.166  
changed lines
  Added in v.1.169


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