--- loncom/interface/Attic/londropadd.pm 2007/08/26 21:09:42 1.166 +++ loncom/interface/Attic/londropadd.pm 2007/10/09 17:33:57 1.171 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to drop and add students in courses # -# $Id: londropadd.pm,v 1.166 2007/08/26 21:09:42 raeburn Exp $ +# $Id: londropadd.pm,v 1.171 2007/10/09 17:33:57 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 = ''; @@ -262,8 +262,9 @@ sub print_upload_manager_header { $password_choice = 'int'; } # - my $javascript_validations=&javascript_validations('auth',$krbdefdom, - $password_choice); + my $javascript_validations = + &javascript_validations('auth',$krbdefdom,$password_choice,undef, + $env{'request.role.domain'}); my $checked=(($env{'form.noFirstLine'})?' checked="checked" ':''); $r->print('
'."\n".' '. + ''. + $clicker_options{$clickerchg}.' '.$lt{'clicker'}."\n". + ' | '."\n"); + +# Photo display on or off? if ($env{'course.'.$env{'request.course.id'}.'.internal.showphoto'}) { my %photo_options = &Apache::lonlocal::texthash( 'on' => 'Show', @@ -1462,6 +1499,9 @@ END ' '."\n"); } $r->print(" \n"); + +# Done with the HTML header line + } elsif ($mode eq 'csv') { # # Open a file @@ -1514,6 +1554,9 @@ END "active groups","email address"], $format->{'bold'}); } + +# Done with header lines in all formats + # # Sort the students my %index; @@ -1557,12 +1600,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') { @@ -1626,6 +1665,19 @@ END$active_groups | '.$clickers.' | '); + } else { + $r->print(''); + } + +# Photos + if ($env{'course.'.$env{'request.course.id'}. '.internal.showphoto'}) { if ($displayphotos eq 'on') { @@ -1715,8 +1767,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 +1822,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 +1852,8 @@ $lt{'odcc'} - |
---|
+$lt{'email'}: +
$lt{'sid'}:
END @@ -1953,7 +2050,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/) { @@ -2661,10 +2762,12 @@ sub handler { foreach my $item (@search) { $srch->{$item} = $env{'form.'.$item}; } - print STDERR "phase = $env{'form.phase'}\n"; if ($env{'form.phase'} eq 'get_user_info') { my ($currstate,$response,$forcenewuser,$results) = &Apache::loncreateuser::user_search_result($srch); + if ($env{'form.currstate'} eq 'modify') { + $currstate = $env{'form.currstate'}; + } if ($currstate eq 'select') { $r->print(&header()); &Apache::lonhtmlcommon::add_breadcrumb @@ -2732,6 +2835,7 @@ sub handler { &get_student_username_domain_form($r,$elements); } } elsif ($env{'form.action'} eq 'classlist' && $permission->{'view'}) { + $r->print(&header()); &Apache::lonhtmlcommon::add_breadcrumb ({href=>'/adm/dropadd?action=classlist', text=>"View Classlist"}); @@ -2747,6 +2851,7 @@ sub handler { &print_html_classlist($r,undef,$permission); } } elsif ($env{'form.action'} eq 'modifystudent' && $permission->{'enrl'}) { + $r->print(&header()); &Apache::lonhtmlcommon::add_breadcrumb ({href=>'/adm/dropadd?action=modifystudent', text=>"Modify Student Data"}); @@ -2766,6 +2871,7 @@ sub handler { &Apache::lonnet::logthis("Undetermined state in londropadd.pm. ". "form.action = ".$env{'form.action'}. "Someone should fix this."); + $r->print(&header()); $r->print(&Apache::lonhtmlcommon::breadcrumbs('Enrollment Manager')); &print_main_menu($r,$permission); }