--- loncom/interface/lonpopulate.pm 2008/01/02 07:53:47 1.52 +++ loncom/interface/lonpopulate.pm 2008/03/06 21:42:51 1.53 @@ -1,5 +1,5 @@ # automated enrollment configuration handler -# $Id: lonpopulate.pm,v 1.52 2008/01/02 07:53:47 raeburn Exp $ +# $Id: lonpopulate.pm,v 1.53 2008/03/06 21:42:51 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -2505,7 +2505,7 @@ sub print_photoupdate_response { my %LC_code; my %affiliates; my $outcome; - &get_institutional_codes(\%settings,,\@allcourses,\%LC_code); + &Apache::loncommon::get_institutional_codes(\%settings,\@allcourses,\%LC_code); if (@allcourses > 0) { @{$affiliates{$crs}} = @allcourses; $outcome = &Apache::lonnet::auto_photoupdate(\%affiliates,$dom,$crs,\%changes); @@ -2609,7 +2609,7 @@ sub print_update_result () { } elsif ($coursecode eq '') { $response = "There was a problem retrieving the course code for this LON-CAPA course. An update of the class roster has not been carried out, and enrollment remains unchanged"; } else { - &get_institutional_codes(\%settings,\@allcourses,\%LC_code); + &Apache::loncommon::get_institutional_codes(\%settings,\@allcourses,\%LC_code); if (@allcourses > 0) { @{$affiliates{$crs}} = @allcourses; my $outcome = &Apache::lonnet::fetch_enrollment_query('updatenow',\%affiliates,\%reply,$dom,$crs); @@ -2643,48 +2643,6 @@ sub print_update_result () { return; } -sub get_institutional_codes { - my ($settings,$allcourses,$LC_code) = @_; -# Get complete list of course sections to update - my @currsections = (); - my @currxlists = (); - my $coursecode = $$settings{'internal.coursecode'}; - - if ($$settings{'internal.sectionnums'} ne '') { - @currsections = split(/,/,$$settings{'internal.sectionnums'}); - } - - if ($$settings{'internal.crosslistings'} ne '') { - @currxlists = split(/,/,$$settings{'internal.crosslistings'}); - } - - if (@currxlists > 0) { - foreach (@currxlists) { - if (m/^([^:]+):(\w*)$/) { - unless (grep/^$1$/,@{$allcourses}) { - push @{$allcourses},$1; - $$LC_code{$1} = $2; - } - } - } - } - - if (@currsections > 0) { - foreach (@currsections) { - if (m/^(\w+):(\w*)$/) { - my $sec = $coursecode.$1; - my $lc_sec = $2; - unless (grep/^$sec$/,@{$allcourses}) { - push @{$allcourses},$sec; - $$LC_code{$sec} = $lc_sec; - } - } - } - } - return; -} - - sub print_viewclass_response { my ($r,$realm,$dom,$crs,$action,$tasktitleref) = @_; my $response;