--- loncom/enrollment/Enrollment.pm 2006/02/07 05:08:21 1.28
+++ loncom/enrollment/Enrollment.pm 2006/08/11 21:55:15 1.32
@@ -1,5 +1,5 @@
# Automated Enrollment manager
-# $Id: Enrollment.pm,v 1.28 2006/02/07 05:08:21 raeburn Exp $
+# $Id: Enrollment.pm,v 1.32 2006/08/11 21:55:15 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -27,6 +27,7 @@ package LONCAPA::Enrollment;
use Apache::loncoursedata;
use Apache::lonnet;
+use Apache::loncommon();
use Apache::lonmsg;
use Apache::lonlocal;
use HTML::Entities;
@@ -326,7 +327,7 @@ sub update_LC {
} else {
&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) =
&Apache::lonnet::auto_checkphotos($uname,$dom,$pid);
if ($resulttype) {
@@ -337,7 +338,7 @@ sub update_LC {
}
}
}
- if ($courseinfo{'showphotos'}) {
+ if ($courseinfo{'showphoto'}) {
if (keys(%{$phototypes})>0) {
my %lt = &photo_response_types();
foreach my $type (sort(keys(%{$phototypes}))) {
@@ -345,18 +346,18 @@ sub update_LC {
if ($numphoto > 0) {
if ($context eq 'updatenow') {
$photoresult .= '
'.
- &mt('For [_1] students, photos ',$numphoto).
- $lt{$type}.'
- ';
+ &mt('For [_1] students, photos ',$numphoto).
+ $lt{$type}.'
- ';
} else {
$photoresult .= "\nFor $numphoto students, photos ".
- $lt{$type}."\n";
+ $lt{$type}."\n";
}
foreach my $user (@{$$phototypes{$type}}) {
$photoresult .= $user.$linefeed;
}
if ($context eq 'updatenow') {
$photoresult = substr($photoresult,0,
- rindex($photoresult,"
- "));
+ rindex($photoresult,"
- "));
$photoresult .= '
';
} else {
$photoresult .= "\n";
@@ -404,9 +405,6 @@ sub update_LC {
if ($context eq "updatenow") {
$addresult = substr($addresult,0,rindex($addresult," - "));
$addresult = "The following $enrollcount student(s) was/were added to this LON-CAPA course:
";
- if ($courseinfo{'showphotos'}) {
-
- }
} else {
$addresult = "The following $enrollcount student(s) was/were added to this LON-CAPA course:\n\n".$addresult."\n\n";
}
@@ -505,7 +503,7 @@ sub create_newuser {
if ($context eq 'createowner' || $context eq 'createcourse') {
my $result = &Apache::lonnet::modifyuser($udom,$uname,$pid,$auth,$authparam,$first,$middle,$last,$gene,'1',undef,$emailaddr);
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:/) {
$outcome = 'ok';
}
@@ -829,15 +827,15 @@ sub get_courseinfo {
my ($dom,$crs,$courseinfo) = @_;
my $owner;
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'}) ) {
$$courseinfo{'inst_code'} = $settings{'internal.coursecode'};
}
if ( defined($settings{'description'}) ) {
$$courseinfo{'description'} = $settings{'description'};
}
- if ( defined($settings{'internal.showphotos'}) ) {
- $$courseinfo{'showphotos'} = $settings{'internal.showphotos'};
+ if ( defined($settings{'internal.showphoto'}) ) {
+ $$courseinfo{'showphoto'} = $settings{'internal.showphoto'};
}
}
return;
@@ -856,7 +854,7 @@ sub CL_startdate { return 9; }
sub CL_studentID { return 10; }
sub photo_response_types {
- my %lt = &Apache::lonlocal::texthash (
+ my %lt = &Apache::lonlocal::texthash(
'same' => 'remained unchanged',
'update' => 'were updated',
'new' => 'were added',
@@ -864,7 +862,7 @@ sub photo_response_types {
'error' => 'were not imported because an error occurred',
'nouser' => 'were for users without accounts',
'noid' => 'were for users without student IDs',
- );
+ );
return %lt;
}