--- loncom/interface/lonpopulate.pm 2003/12/08 16:16:03 1.1 +++ loncom/interface/lonpopulate.pm 2003/12/11 02:54:51 1.5 @@ -1,3 +1,28 @@ +# automated enrollment configuration handler +# $Id: lonpopulate.pm,v 1.5 2003/12/11 02:54:51 raeburn Exp $ +# +# Copyright Michigan State University Board of Trustees +# +# This file is part of the LearningOnline Network with CAPA (LON-CAPA). +# +# LON-CAPA is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# LON-CAPA is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with LON-CAPA; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# /home/httpd/html/adm/gpl.txt +# +# http://www.lon-capa.org/ +# package Apache::lonpopulate; use strict; @@ -5,6 +30,7 @@ use lib qw(/home/httpd/lib/perl); use Apache::lonnet (); use Apache::loncommon (); use Apache::lonhtmlcommon (); +use Apache::lonlocal; use Apache::Constants qw(:common :http REDIRECT); use Time::Local; use LONCAPA::Enrollment (); @@ -199,7 +225,7 @@ sub print_main_frame { if ($action eq "information") { $r->print(< +
@@ -224,7 +250,7 @@ sub print_main_frame { - + @@ -419,7 +445,7 @@ ENDTWO my %coursepersonnel=&Apache::lonnet::get_course_adv_roles($dom.'/'.$crs); foreach (sort keys %coursepersonnel) { - if ($_ eq "Course Coordinator") + if ($_ eq &mt("Course Coordinator") ) { my @ccs = (); if ($coursepersonnel{$_} =~ m/,/) { @@ -500,7 +526,7 @@ As you are the only user with the role o "); if ($cross_str > 0) { $r->print(" - Currently, LON-CAPA course: $realm ($enrollvar{coursecode}) is crosslisted with $cross_str course section(s). Students enrolling in these course sections will be automatically added to the class roster for the course, if you have chosen to enable a nightly automated enrollment update. For each crosslisting, leave the checkbox checked if you want registered students in that course to be included in the student roster for LON-CAPA course: $realm ($enrollvar{coursecode}); otherwise uncheck it. If you wish to change the section/group ID assigned in your LON-CAPA course for a crosslisted course, enter the new section/group ID in the appropriate textbox. The LON-CAPA section/group ID can be left (or set to) empty, if you do not wish to tie a section/group ID to this crosslisting. Click 'Go' to store your changes. + Currently, LON-CAPA course: $realm ($enrollvar{coursecode}) is crosslisted with $cross_str course section(s). Students enrolling in these course sections will be automatically added to the class roster for the course, if you have chosen to enable a nightly automated enrollment update. For each crosslisting, leave the checkbox checked if you want registered students in that course to be included in the student roster for LON-CAPA course: $realm ($enrollvar{coursecode}); otherwise uncheck it. If you wish to change the section/group ID assigned in your LON-CAPA course for a crosslisted course, enter the new section/group ID in the appropriate textbox. The LON-CAPA section/group ID can be left (or set to) empty, if you do not wish to tie a section/group ID to this crosslisting. If you wish to add new crosslisted courses, enter the number of new courses to add in the textbox at the bottom of the page. You will provide information about each of the new crosslistings on a subsequent page. Click 'Go' to store your changes.
  Use the menu on the left to choose an enrollment management task.

Use "Section settings" to make changes to the choice of sections included for enrollment in your LON-CAPA course.
 Use "Student photos" to enable or disable the use of student photos in your course.Use "Student photos" to enable or disable automatic upload of student photos to your course.
 
@@ -596,7 +622,8 @@ As you are the only user with the role o - For each section, check the checkbox if you want registered students in that section to be included in the student roster for LON-CAPA course: $realm ($enrollvar{coursecode}); otherwise uncheck it. If you want to change the section/group designation used for this section in LON-CAPA, delete the currecnt value in the LON-CAPA section/group textbox and enter the new value. Click 'Go' to store your changes. + For each section, check the checkbox if you want registered students in that section to be included in the student roster for LON-CAPA course: $realm ($enrollvar{coursecode}); otherwise uncheck it. If you want to change the section/group designation used for this section in LON-CAPA, delete the current value in the LON-CAPA section/group textbox and enter the new value. The LON-CAPA section/group ID can be left (or set to) empty, if you do not wish to tie a section/group ID to this section. To add a new section, check the 'Enrollment in this course?' checkbox, and enter the desired LON-CAPA section/groupID in the appropriate textbox. Click 'Go' to store +your changes.
@@ -605,7 +632,7 @@ As you are the only user with the role o - @@ -614,8 +641,8 @@ As you are the only user with the role o for (my $i=0; $i<@sections; $i++) { my $colflag = $i%2; my $shrflag = 0; - $r->print(" - +
Course code/td> + Section Current status LON-CAPA section/group ID Enrollment in this course?
$sections[$i]/td> + $r->print("
$sections[$i] "); if (grep/^$sections[$i]$/,@currsections) { @@ -675,7 +702,7 @@ As you are the only user with the role o if (@currsections) { my $secshow = @currsections; $r->print(" - Currently, LON-CAPA course: $realm ($enrollvar{coursecode}) incorporates enrollment from $secshow sections. Students enrolling in any of these course sections will be automatically added to the class roster for the course, if you have chosen to enable a nightly automated enrollment update. For each section, uncheck the checkbox if you want registered students in that section to cease being included in the student roster for LON-CAPA course: $realm ($enrollvar{coursecode}); otherwise leave it checked. If you want to change the section/group designation used for this section in LON-CAPA, delete the current value in the LON-CAPA section/groupID textbox and enter the new value. Click 'Go' to store your changes. + Currently, LON-CAPA course: $realm ($enrollvar{coursecode}) incorporates enrollment from $secshow sections. Students enrolling in any of these course sections will be automatically added to the class roster for the course, if you have chosen to enable a nightly automated enrollment update. For each section, uncheck the checkbox if you want registered students in that section to cease being included in the student roster for LON-CAPA course: $realm ($enrollvar{coursecode}); otherwise leave it checked. If you want to change the section/group designation used for this section in LON-CAPA, delete the current value in the LON-CAPA section/groupID textbox and enter the new value. If you wish to add new course section, enter the number of new sections to add in the textbox at the bottom of the page. You will provide information about each of the new sections on a subsequent page. Click 'Go' to store your changes.
@@ -1084,7 +1111,7 @@ sub print_crosslistings_menu () { $response = "There was a problem processing your requested changes. The automated enrollment settings for this course have been left unchanged.
"; } else { if ($removecount > 0) { - $response = "A total of $removecount courses are no longer crosslisted with LON-CAPA course: $realm ($coursecode).
/
"; + $response = "A total of $removecount courses are no longer crosslisted with LON-CAPA course: $realm ($coursecode).

"; } if ($crosscount > 0) { $response .= "The $crosscount courses listed below remain crosslisted with this LON-CAPA course, and students enrolling in these course sections will be automatically added to the class roster for the course, if you have chosen to enable a nightly automated enrollment update.

\n"; + $response .= "

\n"; + + if (@badxlists > 0) { + $response .= "The courses listed below could not be included in the crosslistings for this LON-CAPA course, because they are not valid courses according to your institution's official schedule of classes and sections.


\n"; + } + + if (@badowner > 0) { + $response .= "The courses listed below could not be included in the crosslistings for this LON-CAPA course, because the owner of this course - $owner - does not have rights to view enrollment in those classes as determined by your instititution's policies on access to official classlists.


\n"; + } &print_reply($r,$response,$$tasktitleref{$action}); return; @@ -1404,6 +1462,7 @@ sub print_update_result () { my @allcourses = (); my %LC_code = (); my $logmsg = ''; + my $newusermsg = ''; my %settings = &Apache::lonnet::get('environment',['internal.coursecode','internal.sectionnums','internal.crosslistings','internal.authtype','internal.autharg','internal.autostart','internal.autoend'],$dom,$crs); my $coursecode = $settings{'internal.coursecode'}; @@ -1467,11 +1526,7 @@ sub print_update_result () { @{$affiliates{$crs}} = @allcourses; &localenroll::fetch_enrollment($dom,\%affiliates,\%reply); if ($reply{$crs} > 0) { - ($changecount,$response) = &LONCAPA::Enrollment::update_LC($dom,$crs,$updateadds,$updatedrops,$autostart,$autoend,$authtype,$autharg,\@allcourses,\%LC_code,\$logmsg,"updatenow"); - unless ($changecount == 0) { - my $responselength = length($response); - $response = substr($response,0,$responselength-4); - } + ($changecount,$response) = &LONCAPA::Enrollment::update_LC($dom,$crs,$updateadds,$updatedrops,$autostart,$autoend,$authtype,$autharg,\@allcourses,\%LC_code,\$logmsg,\$newusermsg,"updatenow"); } else { $response = "There was a problem retrieving institutional class list data for the course sections and crosslisted courses which contribute enrollment to this course. No updates have been carried out, and the roster remains unchanged."; } @@ -1484,7 +1539,11 @@ sub print_update_result () { $logmsg = substr($logmsg,0,$loglength-4); $logmsg = "

The following messages were generated by the roster update process:

"; } - $response .= $logmsg; + unless ($newusermsg eq '') { + $newusermsg = substr( $newusermsg,0,rindex($newusermsg,'
  • ') ); + $newusermsg = "

    The following new system user(s) who was/were created will be using internal authentication with an initial randomly generated password. A valid e-mail address was not available for this/these user(s) so LON-CAPA account credentials could not be sent via e-mail.

    "; + } + $response .= $logmsg.$newusermsg; &print_reply($r,$response,$$tasktitleref{$action}); return; }