--- loncom/interface/Attic/londropadd.pm 2006/05/18 01:08:51 1.143 +++ loncom/interface/Attic/londropadd.pm 2006/12/10 23:48:44 1.151 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to drop and add students in courses # -# $Id: londropadd.pm,v 1.143 2006/05/18 01:08:51 raeburn Exp $ +# $Id: londropadd.pm,v 1.151 2006/12/10 23:48:44 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -60,8 +60,8 @@ sub modifystudent { # if $csec is undefined, drop the student from all the courses matching # this one. If $csec is defined, drop them from all other sections of # this course and add them to section $csec - $courseid=~s/\_/\//g; - $courseid=~s/^(\w)/\/$1/; + my $cdom = $env{'course.'.$courseid.'.domain'}; + my $cnum = $env{'course.'.$courseid.'.num'}; my %roles = &Apache::lonnet::dump('roles',$udom,$unam); my ($tmp) = keys(%roles); # Bail out if we were unable to get the students roles @@ -69,10 +69,10 @@ sub modifystudent { # Go through the roles looking for enrollment in this course my $result = ''; foreach my $course (keys(%roles)) { - if ($course=~/^$courseid(?:\/)*(?:\s+)*(\w+)*\_st$/) { + if ($course=~m{^/\Q$cdom\E/\Q$cnum\E(?:\/)*(?:\s+)*(\w+)*\_st$}) { # We are in this course my $section=$1; - $section='' if ($course eq $courseid.'_st'); + $section='' if ($course eq "/$cdom/$cnum".'_st'); if (defined($csec) && $section eq $csec) { $result .= 'ok:'; } elsif ( ((!$section) && (!$csec)) || ($section ne $csec) ) { @@ -135,7 +135,9 @@ sub print_main_menu { my ($r,$enrl_permission,$view_permission,$grp_manage_permission, $grp_view_permission)=@_; # - my ($cdom,$cnum) = split/_/,$env{'request.course.id'}; + my $cid =$env{'request.course.id'}; + my $cdom=$env{'course.'.$cid.'.domain'}; + my $cnum=$env{'course.'.$cid.'.num'}; my @menu = ( { text => 'Upload a class list', @@ -177,11 +179,11 @@ sub print_main_menu { permission => $grp_manage_permission, url => '/adm/coursegroups?refpage=enrl&action=modify', }, - { text => 'Delete an existing group', - help => 'Course_Delete_Group', - permission => $grp_manage_permission, - url => '/adm/coursegroups?refpage=enrl&action=delete', - }, +# { text => 'Delete an existing group', +# help => 'Course_Delete_Group', +# permission => $grp_manage_permission, +# url => '/adm/coursegroups?refpage=enrl&action=delete', +# }, { text => 'Enter an existing group', help => 'Course_Display_Group', permission => $grp_view_permission, @@ -250,7 +252,7 @@ sub print_upload_manager_header { # my $javascript_validations=&javascript_validations('auth',$krbdefdom, $password_choice); - my $checked=(($env{'form.noFirstLine'})?' checked="1"':''); + my $checked=(($env{'form.noFirstLine'})?' checked="checked" ':''); $r->print('

'.&mt('Uploading Class List')."

\n". "
\n". '

'.&mt('Identify fields')."

\n"); @@ -269,7 +271,7 @@ sub print_upload_manager_header { $r->print(''); - $r->print('