version 1.29, 2006/02/07 16:20:49
|
version 1.32, 2006/08/11 21:55:15
|
Line 27 package LONCAPA::Enrollment;
|
Line 27 package LONCAPA::Enrollment;
|
|
|
use Apache::loncoursedata; |
use Apache::loncoursedata; |
use Apache::lonnet; |
use Apache::lonnet; |
|
use Apache::loncommon(); |
use Apache::lonmsg; |
use Apache::lonmsg; |
use Apache::lonlocal; |
use Apache::lonlocal; |
use HTML::Entities; |
use HTML::Entities; |
Line 326 sub update_LC {
|
Line 327 sub update_LC {
|
} else { |
} else { |
&execute_add($context,'newstudent',$uname,$dom,$auth,$authparam,$first,$middle,$last,$gene,$pid,$usec,$end,$start,$emailenc,$cid,\$addresult,\$enrollcount,$linefeed,$logmsg); |
&execute_add($context,'newstudent',$uname,$dom,$auth,$authparam,$first,$middle,$last,$gene,$pid,$usec,$end,$start,$emailenc,$cid,\$addresult,\$enrollcount,$linefeed,$logmsg); |
} |
} |
if ($courseinfo{'showphotos'}) { |
if ($courseinfo{'showphoto'}) { |
my ($result,$resulttype) = |
my ($result,$resulttype) = |
&Apache::lonnet::auto_checkphotos($uname,$dom,$pid); |
&Apache::lonnet::auto_checkphotos($uname,$dom,$pid); |
if ($resulttype) { |
if ($resulttype) { |
Line 337 sub update_LC {
|
Line 338 sub update_LC {
|
} |
} |
} |
} |
} |
} |
if ($courseinfo{'showphotos'}) { |
if ($courseinfo{'showphoto'}) { |
if (keys(%{$phototypes})>0) { |
if (keys(%{$phototypes})>0) { |
my %lt = &photo_response_types(); |
my %lt = &photo_response_types(); |
foreach my $type (sort(keys(%{$phototypes}))) { |
foreach my $type (sort(keys(%{$phototypes}))) { |
Line 404 sub update_LC {
|
Line 405 sub update_LC {
|
if ($context eq "updatenow") { |
if ($context eq "updatenow") { |
$addresult = substr($addresult,0,rindex($addresult,"<li>")); |
$addresult = substr($addresult,0,rindex($addresult,"<li>")); |
$addresult = "The following $enrollcount student(s) was/were added to this LON-CAPA course:<br/><ul><li>".$addresult."</ul><br/><br/>"; |
$addresult = "The following $enrollcount student(s) was/were added to this LON-CAPA course:<br/><ul><li>".$addresult."</ul><br/><br/>"; |
if ($courseinfo{'showphotos'}) { |
|
|
|
} |
|
} else { |
} else { |
$addresult = "The following $enrollcount student(s) was/were added to this LON-CAPA course:\n\n".$addresult."\n\n"; |
$addresult = "The following $enrollcount student(s) was/were added to this LON-CAPA course:\n\n".$addresult."\n\n"; |
} |
} |
Line 505 sub create_newuser {
|
Line 503 sub create_newuser {
|
if ($context eq 'createowner' || $context eq 'createcourse') { |
if ($context eq 'createowner' || $context eq 'createcourse') { |
my $result = &Apache::lonnet::modifyuser($udom,$uname,$pid,$auth,$authparam,$first,$middle,$last,$gene,'1',undef,$emailaddr); |
my $result = &Apache::lonnet::modifyuser($udom,$uname,$pid,$auth,$authparam,$first,$middle,$last,$gene,'1',undef,$emailaddr); |
if ($result eq 'ok' && $context eq 'createcourse') { |
if ($result eq 'ok' && $context eq 'createcourse') { |
$outcome = &Apache::loncreateuser::commit_standardrole($udom,$uname,$userurl,$role,$start,$end,$cdom,$crs,$usec); |
$outcome = &Apache::loncommon::commit_standardrole($udom,$uname,$userurl,$role,$start,$end,$cdom,$crs,$usec); |
unless ($outcome =~ /^Error:/) { |
unless ($outcome =~ /^Error:/) { |
$outcome = 'ok'; |
$outcome = 'ok'; |
} |
} |
Line 829 sub get_courseinfo {
|
Line 827 sub get_courseinfo {
|
my ($dom,$crs,$courseinfo) = @_; |
my ($dom,$crs,$courseinfo) = @_; |
my $owner; |
my $owner; |
if (defined($dom) && defined($crs)) { |
if (defined($dom) && defined($crs)) { |
my %settings = &Apache::lonnet::get('environment',['internal.coursecode','internal.showphotos','description'],$dom,$crs); |
my %settings = &Apache::lonnet::get('environment',['internal.coursecode','internal.showphoto','description'],$dom,$crs); |
if ( defined($settings{'internal.coursecode'}) ) { |
if ( defined($settings{'internal.coursecode'}) ) { |
$$courseinfo{'inst_code'} = $settings{'internal.coursecode'}; |
$$courseinfo{'inst_code'} = $settings{'internal.coursecode'}; |
} |
} |
if ( defined($settings{'description'}) ) { |
if ( defined($settings{'description'}) ) { |
$$courseinfo{'description'} = $settings{'description'}; |
$$courseinfo{'description'} = $settings{'description'}; |
} |
} |
if ( defined($settings{'internal.showphotos'}) ) { |
if ( defined($settings{'internal.showphoto'}) ) { |
$$courseinfo{'showphotos'} = $settings{'internal.showphotos'}; |
$$courseinfo{'showphoto'} = $settings{'internal.showphoto'}; |
} |
} |
} |
} |
return; |
return; |