[LON-CAPA-cvs] cvs: loncom / lond lonsql /enrollment Enrollment.pm /interface londropadd.pm lonpopulate.pm /lonnet/perl lonnet.pm
albertel
lon-capa-cvs@mail.lon-capa.org
Tue, 07 Feb 2006 16:21:27 -0000
This is a MIME encoded message
--albertel1139329287
Content-Type: text/plain
albertel Tue Feb 7 11:21:27 2006 EDT
Modified files:
/loncom lond lonsql
/loncom/enrollment Enrollment.pm
/loncom/lonnet/perl lonnet.pm
/loncom/interface lonpopulate.pm londropadd.pm
Log:
- style police
--albertel1139329287
Content-Type: text/plain
Content-Disposition: attachment; filename="albertel-20060207112127.txt"
Index: loncom/lond
diff -u loncom/lond:1.317 loncom/lond:1.318
--- loncom/lond:1.317 Tue Feb 7 00:08:27 2006
+++ loncom/lond Tue Feb 7 11:20:39 2006
@@ -2,7 +2,7 @@
# The LearningOnline Network
# lond "LON Daemon" Server (port "LOND" 5663)
#
-# $Id: lond,v 1.317 2006/02/07 05:08:27 raeburn Exp $
+# $Id: lond,v 1.318 2006/02/07 16:20:39 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -61,7 +61,7 @@
my $lastlog='';
my $lond_max_wait_time = 13;
-my $VERSION='$Revision: 1.317 $'; #' stupid emacs
+my $VERSION='$Revision: 1.318 $'; #' stupid emacs
my $remoteVERSION;
my $currenthostid="default";
my $currentdomainid;
@@ -4349,9 +4349,9 @@
my $cdom = $tail;
my ($perm_reqd,$conditions);
my $outcome = &localenroll::photo_permission($cdom,\$perm_reqd,
- \$conditions);
+ \$conditions);
&Reply($client, &escape($outcome.':'.$perm_reqd.':'. $conditions)."\n",
- $userinput);
+ $userinput);
}
®ister_handler("autophotopermission",\&photo_permission_handler,0,1,0);
Index: loncom/lonsql
diff -u loncom/lonsql:1.70 loncom/lonsql:1.71
--- loncom/lonsql:1.70 Tue Feb 7 00:08:27 2006
+++ loncom/lonsql Tue Feb 7 11:20:39 2006
@@ -3,7 +3,7 @@
# The LearningOnline Network
# lonsql - LON TCP-MySQL-Server Daemon for handling database requests.
#
-# $Id: lonsql,v 1.70 2006/02/07 05:08:27 raeburn Exp $
+# $Id: lonsql,v 1.71 2006/02/07 16:20:39 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -424,7 +424,7 @@
}
# end of log query
} elsif (($query eq 'fetchenrollment') ||
- ($query eq 'institutionalphotos')) {
+ ($query eq 'institutionalphotos')) {
# retrieve institutional class lists
my $dom = &unescape($arg1);
my %affiliates = ();
Index: loncom/enrollment/Enrollment.pm
diff -u loncom/enrollment/Enrollment.pm:1.28 loncom/enrollment/Enrollment.pm:1.29
--- loncom/enrollment/Enrollment.pm:1.28 Tue Feb 7 00:08:21 2006
+++ loncom/enrollment/Enrollment.pm Tue Feb 7 11:20:49 2006
@@ -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.29 2006/02/07 16:20:49 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -345,18 +345,18 @@
if ($numphoto > 0) {
if ($context eq 'updatenow') {
$photoresult .= '<br /><b>'.
- &mt('For [_1] students, photos ',$numphoto).
- $lt{$type}.'</b><ul><li>';
+ &mt('For [_1] students, photos ',$numphoto).
+ $lt{$type}.'</b><ul><li>';
} 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,"<li>"));
+ rindex($photoresult,"<li>"));
$photoresult .= '</ul><br />';
} else {
$photoresult .= "\n";
@@ -856,7 +856,7 @@
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 +864,7 @@
'error' => 'were not imported because an error occurred',
'nouser' => 'were for users without accounts',
'noid' => 'were for users without student IDs',
- );
+ );
return %lt;
}
Index: loncom/lonnet/perl/lonnet.pm
diff -u loncom/lonnet/perl/lonnet.pm:1.706 loncom/lonnet/perl/lonnet.pm:1.707
--- loncom/lonnet/perl/lonnet.pm:1.706 Tue Feb 7 00:08:29 2006
+++ loncom/lonnet/perl/lonnet.pm Tue Feb 7 11:21:05 2006
@@ -1,7 +1,7 @@
# The LearningOnline Network
# TCP networking package
#
-# $Id: lonnet.pm,v 1.706 2006/02/07 05:08:29 raeburn Exp $
+# $Id: lonnet.pm,v 1.707 2006/02/07 16:21:05 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -953,7 +953,7 @@
return(&retrievestudentphoto($udom,$unam,$ext));
} else {
my ($result,$perm_reqd)=
- &Apache::lonnet::auto_photo_permission($unam,$udom);
+ &Apache::lonnet::auto_photo_permission($unam,$udom);
if ($result eq 'ok') {
if (!($perm_reqd eq 'yes')) {
return(&retrievestudentphoto($udom,$unam,$ext));
@@ -963,7 +963,7 @@
}
} else {
my ($result,$perm_reqd) =
- &Apache::lonnet::auto_photo_permission($unam,$udom);
+ &Apache::lonnet::auto_photo_permission($unam,$udom);
if ($result eq 'ok') {
if (!($perm_reqd eq 'yes')) {
return(&retrievestudentphoto($udom,$unam,$ext));
@@ -3735,8 +3735,8 @@
sub auto_photo_permission {
my ($cnum,$cdom,$students) = @_;
my $homeserver = &homeserver($cnum,$cdom);
- my ($outcome,$perm_reqd,$conditions) = split(/:/,&unescape(
- &reply('autophotopermission:'.$cdom,$homeserver)),3);
+ my ($outcome,$perm_reqd,$conditions) =
+ split(/:/,&unescape(&reply('autophotopermission:'.$cdom,$homeserver)),3);
return ($outcome,$perm_reqd,$conditions);
}
@@ -3745,7 +3745,8 @@
my $homeserver = &homeserver($uname,$udom);
my ($result,$resulttype);
my $outcome = &unescape(&reply('autophotocheck:'.&escape($udom).':'.
- &escape($uname).':'.&escape($pid),$homeserver));
+ &escape($uname).':'.&escape($pid),
+ $homeserver));
if ($outcome) {
($result,$resulttype) = split(/:/,$outcome);
}
@@ -3756,7 +3757,8 @@
my ($cnum,$cdom) = @_;
my $homeserver = &homeserver($cnum,$cdom);
my ($update,$comment) = split(/:/,&unescape(&reply('autophotochoice:'.
- &escape($cdom),$homeserver)));
+ &escape($cdom),
+ $homeserver)));
return ($update,$comment);
}
Index: loncom/interface/lonpopulate.pm
diff -u loncom/interface/lonpopulate.pm:1.34 loncom/interface/lonpopulate.pm:1.35
--- loncom/interface/lonpopulate.pm:1.34 Tue Feb 7 00:08:32 2006
+++ loncom/interface/lonpopulate.pm Tue Feb 7 11:21:26 2006
@@ -1,5 +1,5 @@
# automated enrollment configuration handler
-# $Id: lonpopulate.pm,v 1.34 2006/02/07 05:08:32 raeburn Exp $
+# $Id: lonpopulate.pm,v 1.35 2006/02/07 16:21:26 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1022,8 +1022,8 @@
</td>
</tr><tr><td>");
if ($enrollvar{'showphotos'}) {
- my ($update,$commentary) = &Apache::lonnet::auto_photochoice(
- $crs,$dom);
+ my ($update,$commentary) = &Apache::lonnet::auto_photochoice($crs,
+ $dom);
$r->print('<br />'.$commentary.'<br /><br />
<form name="photoupdate" method="post">
<input type ="button" name="retrieve" value="'.&mt('Update photo repository').'"
@@ -2111,8 +2111,11 @@
sub photo_permission {
my ($r,$realm,$dom,$crs,$action,$tasktitleref) = @_;
- my %settings = &Apache::lonnet::get('environment',['internal.courseowner',
- 'internal.photopermission','internal.showphotos'],$dom,$crs);
+ my %settings = &Apache::lonnet::get('environment',
+ ['internal.courseowner',
+ 'internal.photopermission',
+ 'internal.showphotos'],
+ $dom,$crs);
my ($showphotos,$response);
if (exists($env{'form.cancel_agreement'})) {
if ($env{'user.name'} eq $settings{'internal.courseowner'}) {
@@ -2143,25 +2146,27 @@
$response = &mt('There was a problem processing the record of your agreement to the conditions of use. Settings for this course have been left unchanged.').'<br/>'."\n";
} else {
&print_photos_response($r,$realm,$dom,$crs,$action,
- $tasktitleref,$showphotos,$env{'form.photopermission'},\%cenv);
+ $tasktitleref,$showphotos,
+ $env{'form.photopermission'},\%cenv);
}
} else {
my ($result,$perm_reqd,$conditions) =
- &Apache::lonnet::auto_photo_permission($crs,$dom);
+ &Apache::lonnet::auto_photo_permission($crs,$dom);
my $permcheck;
if ($result eq 'ok') {
if ($perm_reqd eq 'yes') {
if ($settings{'internal.photopermission'} eq 'yes') {
&print_photos_response($r,$realm,$dom,$crs,$action,
- $tasktitleref,$showphotos);
+ $tasktitleref,$showphotos);
} else {
return(&print_photo_agreement($r,$realm,$dom,$crs,
- $action,$tasktitleref,$conditions,
- $settings{'internal.courseowner'}));
+ $action,$tasktitleref,
+ $conditions,
+ $settings{'internal.courseowner'}));
}
} elsif ($perm_reqd eq 'no') {
&print_photos_response($r,$realm,$dom,$crs,$action,
- $tasktitleref,$showphotos);
+ $tasktitleref,$showphotos);
} else {
$permcheck = 'fail';
}
@@ -2233,18 +2238,18 @@
sub print_photos_response {
my ($r,$realm,$dom,$crs,$action,$tasktitleref,$showphotos,$photopermission,
- $permissionenv)=@_;
+ $permissionenv)=@_;
my %newenv;
if (defined($permissionenv)) {
foreach my $key (keys(%{$permissionenv})) {
if (exists($env{'request.course.id'})) {
$newenv{$env{'request.course.id'}.'.'.$key} =
- $$permissionenv{$key};
+ $$permissionenv{$key};
}
}
}
my %settings = &Apache::lonnet::get('environment',['internal.showphotos'],
- $dom,$crs);
+ $dom,$crs);
my $currphotos = $settings{'internal.showphotos'};
my $response = "";
if (defined($photopermission)) {
@@ -2265,8 +2270,8 @@
$response .= "Retrieval of student photos is still <b>enabled</b>.<br/>";
} else {
$response .= "Retrieval of student photos in now <b>enabled</b>.<br/>";
- my ($update,$commentary) = &Apache::lonnet::auto_photochoice(
- $crs,$dom);
+ my ($update,$commentary) =
+ &Apache::lonnet::auto_photochoice($crs,$dom);
if ($update) {
$response .= '<br />'.$commentary.'<br /><br />
<form name="photoupdate" method="post">
@@ -2287,7 +2292,7 @@
foreach my $key (keys(%cenv)) {
if (exists($env{'request.course.id'})) {
$newenv{'course.'.$env{'request.course.id'}.'.'.$key} =
- $cenv{$key};
+ $cenv{$key};
}
}
}
@@ -2303,8 +2308,11 @@
my $response;
my %changes;
my %lt = &LONCAPA::Enrollment::photo_response_types();
- my %settings = &Apache::lonnet::get('environment',['internal.coursecode',
- 'internal.sectionnums','internal.crosslistings'],$dom,$crs);
+ my %settings = &Apache::lonnet::get('environment',
+ ['internal.coursecode',
+ 'internal.sectionnums',
+ 'internal.crosslistings'],
+ $dom,$crs);
my @allcourses = ();
my %LC_code;
my %affiliates;
@@ -2315,10 +2323,10 @@
$outcome = &Apache::lonnet::auto_photoupdate(\%affiliates,$dom,$crs,\%changes);
unless ($outcome eq 'ok') {
&Apache::lonnet::logthis("lonpopulate::print_photoupdate_response".
- "failed to update student photos".
- " for ".$crs."\@".$dom." by ".
- $env{'user.name'}." \@ ".$env{'user.domain'}.
- ": ".$outcome);
+ "failed to update student photos".
+ " for ".$crs."\@".$dom." by ".
+ $env{'user.name'}." \@ ".$env{'user.domain'}.
+ ": ".$outcome);
}
if ($outcome eq 'ok') {
if (keys(%changes) > 0) {
@@ -2336,7 +2344,7 @@
my @usernames = sort(split(/\&/,$changes{$type}));
my $count = @usernames;
$response .= '<b>'.&mt('For [_1] students, photos ',
- $count).$lt{$type}.'</b><ul>';
+ $count).$lt{$type}.'</b><ul>';
foreach my $username (@usernames) {
$response .= '<li>'.$username;
if (($type eq 'new') || ($type eq 'same') || ($type eq 'update')) {
@@ -2365,7 +2373,7 @@
if ($owner) {
$ownername=&Apache::loncommon::plainname($owner,$dom,'firstname');
my %ownerinfo = &Apache::lonnet::get('environment','permanentemail',
- $dom,$owner);
+ $dom,$owner);
$owneremail = $ownerinfo{'permanentemail'};
}
return ($ownername,$owneremail);
Index: loncom/interface/londropadd.pm
diff -u loncom/interface/londropadd.pm:1.134 loncom/interface/londropadd.pm:1.135
--- loncom/interface/londropadd.pm:1.134 Tue Feb 7 00:08:32 2006
+++ loncom/interface/londropadd.pm Tue Feb 7 11:21:26 2006
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Handler to drop and add students in courses
#
-# $Id: londropadd.pm,v 1.134 2006/02/07 05:08:32 raeburn Exp $
+# $Id: londropadd.pm,v 1.135 2006/02/07 16:21:26 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1340,7 +1340,7 @@
</th>
END
if ($env{'course.'.$env{'request.course.id'}.'.internal.showphotos'}) {
- my %photo_options = &Apache::lonlocal::texthash (
+ my %photo_options = &Apache::lonlocal::texthash(
'on' => 'Show',
'off' => 'Hide',
);
@@ -1494,10 +1494,12 @@
<td>$end</td>
END
if ($env{'course.'.$env{'request.course.id'}.
- '.internal.showphotos'}) {
+ '.internal.showphotos'}) {
if ($displayphotos eq 'on') {
- my $imgurl = &Apache::lonnet::retrievestudentphoto($domain,
- $username,'gif','thumbnail');
+ my $imgurl =
+ &Apache::lonnet::retrievestudentphoto($domain,
+ $username,'gif',
+ 'thumbnail');
$r->print(' <td align="right"><a href="javascript:photowindow('."'".&Apache::lonnet::studentphoto($domain,$username,'jpg')."'".')"><img src="'.$imgurl.'" border="1"></a></td>');
} else {
--albertel1139329287--