--- loncom/interface/lonmodifycourse.pm 2003/12/26 16:30:17 1.1 +++ loncom/interface/lonmodifycourse.pm 2003/12/28 01:37:02 1.2 @@ -14,9 +14,11 @@ sub print_course_selection_page { my ($r,$tasklongref) = @_; my $dom = $ENV{'user.domain'}; my %lt=&Apache::lonlocal::texthash( - 'incs' => "Internal course settings", - 'stat' => "Although the majority of course settings for LON-CAPA courses may be modified by a Course Coordinator, there are a small number of settings which may only be modified by a Domain Coordinator. These particular course parameters control automated student enrollment in LON-CAPA courses based on classlist data available from your institution's student information system.", - 'chcs' => "Once you have chosen the course for which you wish to view/modify internal settings, click 'Go' to proceed", + 'csae' => "Course settings for automated enrollment", + 'unst' => "Unlike standard LON-CAPA course parameters, such as course description, feedback addresses, and top level map, which are displayed and/or modified using the 'Course Environment Parameters' screen, settings that control automated enrollment based on classlist data available from your institution's student information system are handled differently. Automated enrollment settings fall into two groups: (a) settings that can be modified by a Course Coordinator using the Automated Enrollment Manager and (b) settings that may only be modified by a Domain Coordinator via the 'View/Modify Course settings' menu accessed from this page.", + 'chcs' => "Choose the course for which you wish to view/modify automated enrollment settings from the select box below and click 'Go' to proceed.", + 'eaen' => "Each entry in the select box contains: course code -- course title ------- course owner, and entries are ordered alphabetically by course code.", + 'psac' => "Please select a course", 'ccrs' => "Choose a course", 'gobt' => "Go" ); @@ -25,14 +27,15 @@ sub print_course_selection_page { my %courseIDs = &Apache::lonnet::courseiddump($dom,'.',1); &print_header($r,$tasklongref); $r->print(< -

$lt{'incs'}

-

$lt{'stat'} +

+

$lt{'csae'}

+

$lt{'unst'}

$lt{'chcs'} -

+
$lt{'eaen'} +

$lt{'ccrs'}: $local_ccs[$i] - $cc_status{$local_ccs[$i]} Course Coordinator"; + $cc_status{$local_ccs[$i]} $lt{'ccor'}"; } $ownertable .= " @@ -302,30 +330,34 @@ $disp_table

- +
+ + + @@ -351,7 +383,7 @@ sub modify_course { my ($r,$tasklongref,$typeref) = @_; my $dom = $ENV{'user.domain'}; my $crs = $ENV{'form.course'}; - my %settings = &Apache::lonnet::get('environment',['internal.courseowner','internal.coursecode','internal.authtype','internal.autharg','internal.sectionnums','internal.crosslistngs','description'],$dom,$crs); + my %settings = &Apache::lonnet::get('environment',['internal.courseowner','internal.coursecode','internal.authtype','internal.autharg','internal.sectionnums','internal.crosslistings','description'],$dom,$crs); my %currattr = (); my %newattr = (); my %cenv = (); @@ -394,6 +426,7 @@ sub modify_course { $newattr{'authtype'} = $ENV{'form.login'}; $newattr{'authtype'} .= $ENV{'form.krbver'}; $newattr{'autharg'} = $ENV{'form.krbarg'}; + $newattr{'autharg'} =~ tr/a-z/A-Z/; } elsif ($ENV{'form.login'} eq 'int') { $newattr{'authtype'} ='internal'; if ((defined($ENV{'form.intarg'})) && ($ENV{'form.intarg'})) { @@ -407,8 +440,8 @@ sub modify_course { } if ( $newattr{'authtype'}=~ /^krb/) { if ($newattr{'autharg'} eq '') { - $warning = qq(''. - &mt('As you did not include the default Kerberos domain to be used for authentication in this class, the institutional data used by the automated enrollment process must include the Kerberos domain for each new student').'

'); + $warning = qq(). + &mt("As you did not include the default Kerberos domain to be used for authentication in this class, the institutional data used by the automated enrollment process must include the Kerberos domain for each new student").qq(

); } } @@ -440,50 +473,50 @@ sub modify_course { } if (@changes > 0) { - $chgresponse = "The following automated enrollment parameters have been changed:
    "; + $chgresponse = &mt("The following automated enrollment parameters have been changed:
      "); } if (@nochanges > 0) { - $nochgresponse = "The following automated enrollment parameters remain unchanged:
        "; + $nochgresponse = &mt("The following automated enrollment parameters remain unchanged:
          "); } if (@changes > 0) { my $putreply = &Apache::lonnet::put('environment',\%cenv,$dom,$crs); if ($putreply !~ /^ok$/) { - $response = "There was a problem processing your requested changes. The automated enrollment settings for this course have been left unchanged.
          "; + $response = &mt("There was a problem processing your requested changes. The automated enrollment settings for this course have been left unchanged.
          "); } else { foreach my $attr (@params) { if (grep/^$attr$/,@changes) { - $chgresponse .= "
        • $$typeref{$attr} now set to $newattr{$attr}.
        • "; + $chgresponse .= "
        • $$typeref{$attr} ".&mt("now set to \"").$newattr{$attr}."\".
        • "; } else { - $nochgresponse .= "
        • $$typeref{$attr} still set to $currattr{$attr}.
        • "; + $nochgresponse .= "
        • $$typeref{$attr} ".&mt("still set to \"").$currattr{$attr}."\".
        • "; } } if ($changecode || $changeowner) { if ( $newattr{'courseowner'} eq '') { - $warning .= "There is no owner associated with this LON-CAPA course. If automated enrollment in LON-CAPA courses at your institution requires validation of course owners, automated enrollment will fail for this course.
          "; + $warning .= &mt("There is no owner associated with this LON-CAPA course. If automated enrollment in LON-CAPA courses at your institution requires validation of course owners, automated enrollment will fail for this course.
          "); } else { if (@sections > 0) { - foreach my $sec (@sections) { - if ($sec =~ m/^(.+):/) { - my $course_id = $newattr{'coursecode'}.$1; - if ($changecode) { + if ($changecode) { + foreach my $sec (@sections) { + if ($sec =~ m/^(.+):/) { + my $course_id = $newattr{'coursecode'}.$1; # my $course_check = &localenroll::validate_courseID($course_id); my $course_check = 'ok'; if ($course_check eq 'ok') { # my $outcome = &localenroll::new_course($course_id,$newattr{'courseowner'}); my $outcome = 'ok'; unless ($outcome eq 'ok') { - $warning .= "If automatic enrollment is enabled for LON-CAPA course: $description, automated enrollment may fail for $newattr{'coursecode'} - section $1 for the following reason: $outcome.
          "; + $warning .= &mt("If automatic enrollment is enabled for LON-CAPA course: ").$description.&mt(", automated enrollment may fail for ").$newattr{'coursecode'}.&mt(" - section $1 for the following reason: $outcome.
          "); } } else { - $warning .= "If automatic enrollment is enabled for LON-CAPA course: $description, automated enrollment may fail for $newattr{'coursecode'} - section $1 for the following reason: $course_check.
          "; + $warning .= &mt("If automatic enrollment is enabled for LON-CAPA course: ").$description.&mt(", automated enrollment may fail for ").$newattr{'coursecode'}.&mt(" - section $1 for the following reason: $course_check.
          "); } } else { - $warning .= "If automatic enrollment is enabled for LON-CAPA course: $description, automated enrollment may fail for $newattr{'coursecode'} - section $sec because this is not a valid section entry.
          "; + $warning .= &mt("If automatic enrollment is enabled for LON-CAPA course: ").$description.&mt(", automated enrollment may fail for ").$newattr{'coursecode'}.&mt(" - section $sec because this is not a valid section entry.
          "); } } } } else { - $warning .= "As no section numbers are currently listed for LON-CAPA course: $description, automated enrollment will not occur for any sections of coursecode: $newattr{'coursecode'}.
          "; + $warning .= &mt("As no section numbers are currently listed for LON-CAPA course: ").$description.&mt(", automated enrollment will not occur for any sections of coursecode: ").$newattr{'coursecode'}."
          "; } if ( (@xlists > 0) && ($changeowner) ) { foreach my $xlist (@xlists) { @@ -491,7 +524,7 @@ sub modify_course { # my $outcome = &localenroll::new_course($1,$newattr{'courseowner'}); my $outcome = 'ok'; unless ($outcome eq 'ok') { - $warning .= "If automatic enrollment is enabled for LON-CAPA course: $description, automated enrollment may fail for crosslisted class: $1 for the following reason: $outcome.
          "; + $warning .= &mt("If automatic enrollment is enabled for LON-CAPA course: ").$description.&mt(", automated enrollment may fail for crosslisted class: ").$1.&mt(" for the following reason: $outcome.
          "); } } } @@ -499,8 +532,13 @@ sub modify_course { } } } + } else { + foreach my $attr (@params) { + $nochgresponse .= "
        • $$typeref{$attr} ".&mt("still set to \"").$currattr{$attr}."\".
        • "; + } } + if (@changes > 0) { $chgresponse .= "


        "; } @@ -508,7 +546,7 @@ sub modify_course { $nochgresponse .= "


      "; } unless ($warning eq '') { - $warning = "The following warning messages were generated as a result of applying the changes you specified to course settings that can affect the automated enrollment process:

      ".$warning; + $warning = &mt("The following warning messages were generated as a result of applying the changes you specified to course settings that can affect the automated enrollment process:

      ").$warning; } if ($response eq '') { $reply = $chgresponse.$nochgresponse.$warning; @@ -523,7 +561,7 @@ sub modify_course { sub print_header { my ($r,$tasklongref,$description,$javascriptref) = @_; - my %lt = ( + my %lt =&Apache::lonlocal::texthash( 'vmcs' => 'View/Modify Course Settings', 'chco' => 'Choose a course', 'main' => 'Main Menu', @@ -599,7 +637,7 @@ sub handler { &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['action','course']); my $dom = $ENV{'user.domain'}; - my %longtype = ( + my %longtype=&Apache::lonlocal::texthash( 'authtype' => 'Default authentication method', 'autharg' => 'Default authentication parameter', 'autoadds' => 'Automated adds', @@ -613,7 +651,7 @@ sub handler { 'crosslistings' => 'Crosslisted class(:groupID)', ); - my %tasklong = ( + my %tasklong = &Apache::lonlocal::texthash( 'display' => 'View/modify settings', 'process' => 'Results of changes', ); @@ -627,7 +665,7 @@ sub handler { } } else { $ENV{'user.error.msg'}= - "/adm/createcourse:ccc:0:0:Cannot modify course settings"; + "/adm/modifycourse:ccc:0:0:Cannot modify course settings"; return HTTP_NOT_ACCEPTABLE; } return OK;
Use the appropriate text boxes and radio buttons below to change some or all of the four automated enrollment settings that may only be changed by a Domain Coordinator. Click the "$lt{'gobt'}" button to save your changes.
- $lt{'ccod'} + $lt{'ccod'}:  

$lt{'ccus'}
- $lt{'cown'}

- $lt{'cous'} -

+ $lt{'cown'}:

$ownertable +

+ $lt{'cous'}
- $lt{'deam'}.

+ $lt{'deam'}:

+ $krbform +
+ $intform +
+ $locform +
+
$lt{'deus'}. -

-$krbform -
-$intform -
-$locform