--- loncom/interface/Attic/londropadd.pm 2007/08/28 13:00:45 1.167 +++ loncom/interface/Attic/londropadd.pm 2007/08/29 04:12:33 1.168 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to drop and add students in courses # -# $Id: londropadd.pm,v 1.167 2007/08/28 13:00:45 raeburn Exp $ +# $Id: londropadd.pm,v 1.168 2007/08/29 04:12:33 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -179,27 +179,27 @@ sub print_main_menu { { text => 'Create a new group', help => 'Course_Create_Group', permission => $permission->{'grp_manage'}, - url => '/adm/coursegroups?refpage=enrl&action=create', + url => '/adm/coursegroups?refpage=enrl&action=create', }, { text => 'Modify an existing group', help => 'Course_Modify_Group', permission => $permission->{'grp_manage'}, - url => '/adm/coursegroups?refpage=enrl&action=modify', + url => '/adm/coursegroups?refpage=enrl&action=modify', }, { text => 'Delete an existing group', help => 'Course_Delete_Group', permission => $permission->{'grp_manage'}, - url => '/adm/coursegroups?refpage=enrl&action=delete', + url => '/adm/coursegroups?refpage=enrl&action=delete', }, { text => 'Re-enable a deleted group', help => 'Course_Reenable_Group', permission => $permission->{'grp_manage'}, - url => '/adm/coursegroups?refpage=enrl&action=reenable', + url => '/adm/coursegroups?refpage=enrl&action=reenable', }, { text => 'Enter an existing group', help => 'Course_Display_Group', permission => $permission->{'grp_view'}, - url => '/adm/coursegroups?refpage=enrl&action=view', + url => '/adm/coursegroups?refpage=enrl&action=view', }, ); my $menu_html = ''; @@ -1557,12 +1557,8 @@ END my %emails = &Apache::loncommon::getemails($username,$domain); my $email; - foreach my $type ('critnotification', 'permanentemail', - 'notification') { - if ($emails{$type} =~ /\S/) { - $email = $emails{$type}; - last; - } + if ($emails{'permanentemail'} =~ /\S/) { + $email = $emails{'permanentemail'}; } if ($mode eq 'view' || $mode eq 'html' || $mode eq 'autoenroll') { @@ -1715,8 +1711,8 @@ sub print_modify_student_form { # determine the students name information my %info=&Apache::lonnet::get('environment', ['firstname','middlename', - 'lastname','generation','id'], - $sdom, $sname); + 'lastname','generation','id', + 'permanentemail'], $sdom, $sname); my ($tmp) = keys(%info); if ($tmp =~ /^(con_lost|error|no_such_host)/i) { $r->print(''.&mt('Error').''. @@ -1770,6 +1766,7 @@ sub print_modify_student_form { 'mn' => "Middle", 'ln' => "Last", 'gen' => "Generation", + 'email' => "E-mail address", 'sid' => "Student ID", 'disn' => "Disable ID/Student Number Safeguard and Force Change of Conflicting IDs (only do if you know what you are doing)", 'sec' => "Section", @@ -1799,8 +1796,8 @@ $lt{'odcc'} -

$lt{'mef'} $info{'firstname'} $info{'middlename'} -$info{'lastname'} $info{'generation'}, $sname:$sdom

+

$lt{'mef'} $info{'firstname'} $info{'middlename'} +$info{'lastname'} $info{'generation'}, $sname:$sdom

$lt{'sn'} @@ -1812,6 +1809,8 @@ $info{'lastname'} $info{'generation'}, $

+$lt{'email'}: +

$lt{'sid'}:

$lt{'si'}

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
$lt{'fd'} $lt{'ov'} $lt{'nv'}
$lt{'fn'} $old{'firstname'} $firstname
$lt{'mn'} $old{'middlename'} $middlename
$lt{'ln'} $old{'lastname'} $lastname
$lt{'gen'} $old{'generation'} $generation
ID $old{'id'} $sid
$lt{'sec'} $old{'section'} $section
-

$lt{'ri'}

+

$lt{'mdu'} $slogin:$sdom

+END + $r->print(< -$lt{'st'}: $displayable_starttime -$lt{'et'}: $displayable_endtime + + + + + + + + + +
$lt{si}
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
$lt{'fd'} $lt{'ov'} $lt{'nv'}
$lt{'fn'} $old{'firstname'} $firstname
$lt{'mn'} $old{'middlename'} $middlename
$lt{'ln'} $old{'lastname'} $lastname
$lt{'gen'} $old{'generation'} $generation
ID $old{'id'} $sid
$lt{'em'} $old{'permanentemail'} $permanentemail
$lt{'sec'} $old{'section'} $section
+
+
+ + + + + + + +
$lt{'ri'}
+ + + + + + + + + +
$lt{'st'}: $displayable_starttime
$lt{'et'}: $displayable_endtime
+
+ +

END @@ -1953,7 +1994,11 @@ END } my $roleresults = &Apache::lonnet::modifystudent ($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' ) { $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/) {