version 1.52, 2008/01/02 07:53:47
|
version 1.55, 2008/04/30 23:54:59
|
Line 2485 onclick="javascript:document.photoupdate
|
Line 2485 onclick="javascript:document.photoupdate
|
} |
} |
} |
} |
if (keys(%newenv) > 0) { |
if (keys(%newenv) > 0) { |
&Apache::lonnet::appenv(%newenv); |
&Apache::lonnet::appenv(\%newenv); |
} |
} |
&print_reply($r,$response,$$tasktitleref{$action}); |
&print_reply($r,$response,$$tasktitleref{$action}); |
return; |
return; |
Line 2505 sub print_photoupdate_response {
|
Line 2505 sub print_photoupdate_response {
|
my %LC_code; |
my %LC_code; |
my %affiliates; |
my %affiliates; |
my $outcome; |
my $outcome; |
&get_institutional_codes(\%settings,,\@allcourses,\%LC_code); |
&Apache::loncommon::get_institutional_codes(\%settings,\@allcourses,\%LC_code); |
if (@allcourses > 0) { |
if (@allcourses > 0) { |
@{$affiliates{$crs}} = @allcourses; |
@{$affiliates{$crs}} = @allcourses; |
$outcome = &Apache::lonnet::auto_photoupdate(\%affiliates,$dom,$crs,\%changes); |
$outcome = &Apache::lonnet::auto_photoupdate(\%affiliates,$dom,$crs,\%changes); |
Line 2609 sub print_update_result () {
|
Line 2609 sub print_update_result () {
|
} elsif ($coursecode eq '') { |
} 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"; |
$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 { |
} else { |
&get_institutional_codes(\%settings,\@allcourses,\%LC_code); |
&Apache::loncommon::get_institutional_codes(\%settings,\@allcourses,\%LC_code); |
if (@allcourses > 0) { |
if (@allcourses > 0) { |
@{$affiliates{$crs}} = @allcourses; |
@{$affiliates{$crs}} = @allcourses; |
my $outcome = &Apache::lonnet::fetch_enrollment_query('updatenow',\%affiliates,\%reply,$dom,$crs); |
my $outcome = &Apache::lonnet::fetch_enrollment_query('updatenow',\%affiliates,\%reply,$dom,$crs); |
Line 2643 sub print_update_result () {
|
Line 2643 sub print_update_result () {
|
return; |
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 { |
sub print_viewclass_response { |
my ($r,$realm,$dom,$crs,$action,$tasktitleref) = @_; |
my ($r,$realm,$dom,$crs,$action,$tasktitleref) = @_; |
my $response; |
my $response; |
Line 2739 sub print_viewclass_response {
|
Line 2697 sub print_viewclass_response {
|
} elsif ($newtype eq '') { |
} elsif ($newtype eq '') { |
$newlock = '1'; |
$newlock = '1'; |
} |
} |
my $modreply = &Apache::lonnet::modify_student_enrollment($udom,$uname,$uid,'','','','',$section,$end,$start,$newtype,$newlock,$cid); |
my $modreply = &Apache::lonnet::modify_student_enrollment($udom,$uname,$uid,'','','','',$section,$end,$start,$newtype,$newlock,$cid,'','chgtype'); |
if ($modreply eq 'ok') { |
if ($modreply eq 'ok') { |
$chgok ++; |
$chgok ++; |
$chg{$student} = "Changed to $change"; |
$chg{$student} = "Changed to $change"; |
Line 2771 sub print_viewclass_response {
|
Line 2729 sub print_viewclass_response {
|
$newlockname = &mt('unlocked'); |
$newlockname = &mt('unlocked'); |
$oldlockname = &mt('locked'); |
$oldlockname = &mt('locked'); |
} |
} |
my $lockreply = &Apache::lonnet::modify_student_enrollment($udom,$uname,$uid,'','','','',$section,$end,$start,$type,$newlock,$cid); |
my $lockreply = &Apache::lonnet::modify_student_enrollment($udom,$uname,$uid,'','','','',$section,$end,$start,$type,$newlock,$cid,'','chgtype'); |
if ($lockreply eq 'ok') { |
if ($lockreply eq 'ok') { |
$lockok ++; |
$lockok ++; |
$lockchg{$student} = 'Changed to '.$newlockname; |
$lockchg{$student} = 'Changed to '.$newlockname; |