version 1.34, 2006/02/07 05:08:32
|
version 1.38, 2006/02/09 00:40:19
|
Line 866 your changes.</td>
|
Line 866 your changes.</td>
|
<table width=\"100%\" border=\"0\" cellpadding=\"2\" cellspacing=\"2\"> |
<table width=\"100%\" border=\"0\" cellpadding=\"2\" cellspacing=\"2\"> |
<tr> |
<tr> |
<td align=\"left\"><b>$$tasktitleref{$action}</b><br/> |
<td align=\"left\"><b>$$tasktitleref{$action}</b><br/> |
Currently: Student photo import: <i>$photosets[$enrollvar{showphotos}]</i> |
Currently: Student photo import: <i>$photosets[$enrollvar{showphoto}]</i> |
</td> |
</td> |
</tr> |
</tr> |
</table> |
</table> |
Line 876 your changes.</td>
|
Line 876 your changes.</td>
|
Automatic import of student photos from institutional data repository: |
Automatic import of student photos from institutional data repository: |
|
|
"); |
"); |
if ($enrollvar{showphotos}) { |
if ($enrollvar{showphoto}) { |
$r->print(" |
$r->print(" |
<input type=\"radio\" name=\"showphotos\" value=\"1\" checked=\"true\" /> Yes |
<input type=\"radio\" name=\"showphotos\" value=\"1\" checked=\"true\" /> Yes |
<input type=\"radio\" name=\"showphotos\" value=\"0\" /> No |
<input type=\"radio\" name=\"showphotos\" value=\"0\" /> No |
Line 943 your changes.</td>
|
Line 943 your changes.</td>
|
} else { |
} else { |
my ($ownername,$owneremail) = &get_ownerinfo($dom, |
my ($ownername,$owneremail) = &get_ownerinfo($dom, |
$enrollvar{'courseowner'}); |
$enrollvar{'courseowner'}); |
|
my $emailstr; |
|
if ($owneremail) { |
|
$emailstr = "(e-mail: $owneremail)"; |
|
} |
$r->print(' |
$r->print(' |
<tr> |
<tr> |
<td>'. |
<td>'. |
&mt('The policies of your institution [_1] require that the course owner [_2] must indicate acceptance of the conditions of use of digital photos of registered students, before they may be made available for use in a course.',$institution,$ownername).'<br /><br />'.&mt('Please direct the course owner (e-mail: [_1]) to visit the "Student photos" page in the Automated Enrollment Manager to indicate acceptance of these conditions of use',$owneremail).'<br /><br /><input type="button" name=mainmenu" value="Go back" onclick="javascript:history.go(-1);" /> |
&mt('The policies of your institution [_1] require that the course owner [_2] must indicate acceptance of the conditions of use of digital photos of registered students, before they may be made available for use in a course.',$institution,$ownername).'<br /><br />'.&mt('Please direct the course owner [_1] to visit the "Student photos" page in the Automated Enrollment Manager to indicate acceptance of these conditions of use.',$emailstr).'<br /><br /><input type="button" name=mainmenu" value="Go back" onclick="javascript:history.go(-1);" /> |
</td> |
</td> |
</tr> |
</tr> |
</form> |
</form> |
Line 1021 Note: Any students previously added manu
|
Line 1025 Note: Any students previously added manu
|
<td align=\"left\"><b>$$tasktitleref{$action}</b> |
<td align=\"left\"><b>$$tasktitleref{$action}</b> |
</td> |
</td> |
</tr><tr><td>"); |
</tr><tr><td>"); |
if ($enrollvar{'showphotos'}) { |
if ($enrollvar{'showphoto'}) { |
my ($update,$commentary) = &Apache::lonnet::auto_photochoice( |
my ($update,$commentary) = &Apache::lonnet::auto_photochoice($crs, |
$crs,$dom); |
$dom); |
$r->print('<br />'.$commentary.'<br /><br /> |
$r->print('<br />'.$commentary.'<br /><br /> |
<form name="photoupdate" method="post"> |
<form name="photoupdate" method="post"> |
<input type ="button" name="retrieve" value="'.&mt('Update photo repository').'" |
<input type ="button" name="retrieve" value="'.&mt('Update photo repository').'" |
Line 2111 sub print_sections_response () {
|
Line 2115 sub print_sections_response () {
|
|
|
sub photo_permission { |
sub photo_permission { |
my ($r,$realm,$dom,$crs,$action,$tasktitleref) = @_; |
my ($r,$realm,$dom,$crs,$action,$tasktitleref) = @_; |
my %settings = &Apache::lonnet::get('environment',['internal.courseowner', |
my %settings = &Apache::lonnet::get('environment', |
'internal.photopermission','internal.showphotos'],$dom,$crs); |
['internal.courseowner', |
|
'internal.photopermission', |
|
'internal.showphoto'], |
|
$dom,$crs); |
my ($showphotos,$response); |
my ($showphotos,$response); |
if (exists($env{'form.cancel_agreement'})) { |
if (exists($env{'form.cancel_agreement'})) { |
if ($env{'user.name'} eq $settings{'internal.courseowner'}) { |
if ($env{'user.name'} eq $settings{'internal.courseowner'}) { |
Line 2143 sub photo_permission {
|
Line 2150 sub photo_permission {
|
$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"; |
$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 { |
} else { |
&print_photos_response($r,$realm,$dom,$crs,$action, |
&print_photos_response($r,$realm,$dom,$crs,$action, |
$tasktitleref,$showphotos,$env{'form.photopermission'},\%cenv); |
$tasktitleref,$showphotos, |
|
$env{'form.photopermission'},\%cenv); |
} |
} |
} else { |
} else { |
my ($result,$perm_reqd,$conditions) = |
my ($result,$perm_reqd,$conditions) = |
&Apache::lonnet::auto_photo_permission($crs,$dom); |
&Apache::lonnet::auto_photo_permission($crs,$dom); |
my $permcheck; |
my $permcheck; |
if ($result eq 'ok') { |
if ($result eq 'ok') { |
if ($perm_reqd eq 'yes') { |
if ($perm_reqd eq 'yes') { |
if ($settings{'internal.photopermission'} eq 'yes') { |
if ($settings{'internal.photopermission'} eq 'yes') { |
&print_photos_response($r,$realm,$dom,$crs,$action, |
&print_photos_response($r,$realm,$dom,$crs,$action, |
$tasktitleref,$showphotos); |
$tasktitleref,$showphotos); |
} else { |
} else { |
return(&print_photo_agreement($r,$realm,$dom,$crs, |
return(&print_photo_agreement($r,$realm,$dom,$crs, |
$action,$tasktitleref,$conditions, |
$action,$tasktitleref, |
$settings{'internal.courseowner'})); |
$conditions, |
|
$settings{'internal.courseowner'})); |
} |
} |
} elsif ($perm_reqd eq 'no') { |
} elsif ($perm_reqd eq 'no') { |
&print_photos_response($r,$realm,$dom,$crs,$action, |
&print_photos_response($r,$realm,$dom,$crs,$action, |
$tasktitleref,$showphotos); |
$tasktitleref,$showphotos); |
} else { |
} else { |
$permcheck = 'fail'; |
$permcheck = 'fail'; |
} |
} |
Line 2233 function agreement_result(caller) {
|
Line 2242 function agreement_result(caller) {
|
|
|
sub print_photos_response { |
sub print_photos_response { |
my ($r,$realm,$dom,$crs,$action,$tasktitleref,$showphotos,$photopermission, |
my ($r,$realm,$dom,$crs,$action,$tasktitleref,$showphotos,$photopermission, |
$permissionenv)=@_; |
$permissionenv)=@_; |
my %newenv; |
my %newenv; |
if (defined($permissionenv)) { |
if (defined($permissionenv)) { |
foreach my $key (keys(%{$permissionenv})) { |
foreach my $key (keys(%{$permissionenv})) { |
if (exists($env{'request.course.id'})) { |
if (exists($env{'request.course.id'})) { |
$newenv{$env{'request.course.id'}.'.'.$key} = |
$newenv{$env{'request.course.id'}.'.'.$key} = |
$$permissionenv{$key}; |
$$permissionenv{$key}; |
} |
} |
} |
} |
} |
} |
my %settings = &Apache::lonnet::get('environment',['internal.showphotos'], |
my %settings = &Apache::lonnet::get('environment',['internal.showphoto'], |
$dom,$crs); |
$dom,$crs); |
my $currphotos = $settings{'internal.showphotos'}; |
my $currphotos = $settings{'internal.showphoto'}; |
my $response = ""; |
my $response = ""; |
if (defined($photopermission)) { |
if (defined($photopermission)) { |
if ($photopermission eq 'yes') { |
if ($photopermission eq 'yes') { |
Line 2255 sub print_photos_response {
|
Line 2264 sub print_photos_response {
|
$showphotos = 0; |
$showphotos = 0; |
} |
} |
} |
} |
my %cenv = ('internal.showphotos' => $showphotos); |
my %cenv = ('internal.showphoto' => $showphotos); |
my $reply = &Apache::lonnet::put('environment',\%cenv,$dom,$crs); |
my $reply = &Apache::lonnet::put('environment',\%cenv,$dom,$crs); |
if ($reply !~ /^ok$/) { |
if ($reply !~ /^ok$/) { |
$response .= "There was a problem processing your requested change. The student photo retrieval setting for this course has been left unchanged.<br/>"; |
$response .= "There was a problem processing your requested change. The student photo retrieval setting for this course has been left unchanged.<br/>"; |
Line 2265 sub print_photos_response {
|
Line 2274 sub print_photos_response {
|
$response .= "Retrieval of student photos is still <b>enabled</b>.<br/>"; |
$response .= "Retrieval of student photos is still <b>enabled</b>.<br/>"; |
} else { |
} else { |
$response .= "Retrieval of student photos in now <b>enabled</b>.<br/>"; |
$response .= "Retrieval of student photos in now <b>enabled</b>.<br/>"; |
my ($update,$commentary) = &Apache::lonnet::auto_photochoice( |
my ($update,$commentary) = |
$crs,$dom); |
&Apache::lonnet::auto_photochoice($crs,$dom); |
if ($update) { |
if ($update) { |
$response .= '<br />'.$commentary.'<br /><br /> |
$response .= '<br />'.$commentary.'<br /><br /> |
<form name="photoupdate" method="post"> |
<form name="photoupdate" method="post"> |
Line 2287 onclick="javascript:document.photoupdate
|
Line 2296 onclick="javascript:document.photoupdate
|
foreach my $key (keys(%cenv)) { |
foreach my $key (keys(%cenv)) { |
if (exists($env{'request.course.id'})) { |
if (exists($env{'request.course.id'})) { |
$newenv{'course.'.$env{'request.course.id'}.'.'.$key} = |
$newenv{'course.'.$env{'request.course.id'}.'.'.$key} = |
$cenv{$key}; |
$cenv{$key}; |
} |
} |
} |
} |
} |
} |
Line 2303 sub print_photoupdate_response {
|
Line 2312 sub print_photoupdate_response {
|
my $response; |
my $response; |
my %changes; |
my %changes; |
my %lt = &LONCAPA::Enrollment::photo_response_types(); |
my %lt = &LONCAPA::Enrollment::photo_response_types(); |
my %settings = &Apache::lonnet::get('environment',['internal.coursecode', |
my %settings = &Apache::lonnet::get('environment', |
'internal.sectionnums','internal.crosslistings'],$dom,$crs); |
['internal.coursecode', |
|
'internal.sectionnums', |
|
'internal.crosslistings'], |
|
$dom,$crs); |
my @allcourses = (); |
my @allcourses = (); |
my %LC_code; |
my %LC_code; |
my %affiliates; |
my %affiliates; |
Line 2315 sub print_photoupdate_response {
|
Line 2327 sub print_photoupdate_response {
|
$outcome = &Apache::lonnet::auto_photoupdate(\%affiliates,$dom,$crs,\%changes); |
$outcome = &Apache::lonnet::auto_photoupdate(\%affiliates,$dom,$crs,\%changes); |
unless ($outcome eq 'ok') { |
unless ($outcome eq 'ok') { |
&Apache::lonnet::logthis("lonpopulate::print_photoupdate_response". |
&Apache::lonnet::logthis("lonpopulate::print_photoupdate_response". |
"failed to update student photos". |
"failed to update student photos". |
" for ".$crs."\@".$dom." by ". |
" for ".$crs."\@".$dom." by ". |
$env{'user.name'}." \@ ".$env{'user.domain'}. |
$env{'user.name'}." \@ ".$env{'user.domain'}. |
": ".$outcome); |
": ".$outcome); |
} |
} |
if ($outcome eq 'ok') { |
if ($outcome eq 'ok') { |
if (keys(%changes) > 0) { |
if (keys(%changes) > 0) { |
Line 2336 function photowindow(photolink) {
|
Line 2348 function photowindow(photolink) {
|
my @usernames = sort(split(/\&/,$changes{$type})); |
my @usernames = sort(split(/\&/,$changes{$type})); |
my $count = @usernames; |
my $count = @usernames; |
$response .= '<b>'.&mt('For [_1] students, photos ', |
$response .= '<b>'.&mt('For [_1] students, photos ', |
$count).$lt{$type}.'</b><ul>'; |
$count).$lt{$type}.'</b><ul>'; |
foreach my $username (@usernames) { |
foreach my $username (@usernames) { |
$response .= '<li>'.$username; |
$response .= '<li>'.$username; |
if (($type eq 'new') || ($type eq 'same') || ($type eq 'update')) { |
if (($type eq 'new') || ($type eq 'same') || ($type eq 'update')) { |
Line 2364 sub get_ownerinfo {
|
Line 2376 sub get_ownerinfo {
|
my ($ownername,$owneremail); |
my ($ownername,$owneremail); |
if ($owner) { |
if ($owner) { |
$ownername=&Apache::loncommon::plainname($owner,$dom,'firstname'); |
$ownername=&Apache::loncommon::plainname($owner,$dom,'firstname'); |
my %ownerinfo = &Apache::lonnet::get('environment','permanentemail', |
my %ownerinfo = &Apache::lonnet::get('environment',['permanentemail'], |
$dom,$owner); |
$dom,$owner); |
$owneremail = $ownerinfo{'permanentemail'}; |
$owneremail = $ownerinfo{'permanentemail'}; |
} |
} |
return ($ownername,$owneremail); |
return ($ownername,$owneremail); |
Line 2384 sub print_update_result () {
|
Line 2396 sub print_update_result () {
|
my $logmsg = ''; |
my $logmsg = ''; |
my $newusermsg = ''; |
my $newusermsg = ''; |
my %phototypes = (); |
my %phototypes = (); |
my %settings = &Apache::lonnet::get('environment',['internal.coursecode','internal.sectionnums','internal.crosslistings','internal.authtype','internal.autharg','internal.showphotos'],$dom,$crs); |
my %settings = &Apache::lonnet::get('environment',['internal.coursecode','internal.sectionnums','internal.crosslistings','internal.authtype','internal.autharg','internal.showphoto'],$dom,$crs); |
my $coursecode = $settings{'internal.coursecode'}; |
my $coursecode = $settings{'internal.coursecode'}; |
my $authtype = $settings{'internal.authtype'}; |
my $authtype = $settings{'internal.authtype'}; |
my $autharg = $settings{'internal.autharg'}; |
my $autharg = $settings{'internal.autharg'}; |
my $showphotos = $settings{'internal.showphotos'}; |
my $showphotos = $settings{'internal.showphoto'}; |
my ($startaccess,$endaccess) = &get_dates_from_form(); |
my ($startaccess,$endaccess) = &get_dates_from_form(); |
if ( exists($env{'form.updateadds'}) ) { |
if ( exists($env{'form.updateadds'}) ) { |
$updateadds = $env{'form.updateadds'}; |
$updateadds = $env{'form.updateadds'}; |