--- loncom/interface/lonpopulate.pm 2013/03/01 05:21:17 1.76 +++ loncom/interface/lonpopulate.pm 2015/06/09 21:22:57 1.83 @@ -1,5 +1,5 @@ # automated enrollment configuration handler -# $Id: lonpopulate.pm,v 1.76 2013/03/01 05:21:17 raeburn Exp $ +# $Id: lonpopulate.pm,v 1.83 2015/06/09 21:22:57 damieng Exp $ # # Copyright Michigan State University Board of Trustees # @@ -51,7 +51,7 @@ sub header { sub choose_header { my ($action) = @_; my $notify_check = '/^note_[0-9]+$/'; - my %lt = + my %js_lt = &Apache::lonlocal::texthash( adds => 'You must select either "Enable" or "Disable" for nightly additions based on classlist changes', drop => 'You must select either "Enable" or "Disable" for nightly removals based on classlist changes', @@ -61,8 +61,9 @@ sub choose_header { ynot => 'You have indicated that you want notification of roster changes messages to be sent, but you have not selected any recipients.', atle => 'You must check at least one checkbox, before proceeding to the next page', ); - $lt{'both'} = &mt('You have selected "No" for both addition and removal of students[_1] in the institutional classlist but not in your LON-CAPA course.[_1]','\\n'); - $lt{'nnot'} = &mt('You have indicated that you do not want notification of roster changes messages to be sent, but [_1] have been checked as recipients.[_2]',"'+totalnote+'",'\\n'); + $js_lt{'both'} = &mt('You have selected "No" for both addition and removal of students[_1] in the institutional classlist but not in your LON-CAPA course.[_1]',"\n"); + $js_lt{'nnot'} = &mt('You have indicated that you do not want notification of roster changes messages to be sent, but [_1] have been checked as recipients.[_2]',"'+totalnote+'","\n"); + &js_escape(\%js_lt); my $scripttag = < @@ -88,11 +89,11 @@ function process(calling,numauto,nummanu } } if (rad1 == 0) { - alert('$lt{'adds'}'); + alert('$js_lt{'adds'}'); checker = 0 } if (rad2 == 0) { - alert('$lt{'drop'}'); + alert('$js_lt{'drop'}'); checker = 0 } } @@ -116,15 +117,15 @@ function process(calling,numauto,nummanu } } if (rad1 == 0) { - alert('$lt{'drop'}'); + alert('$js_lt{'drop'}'); checker = 0; } if (rad2 == 0) { - alert('$lt{'ysno'}'); + alert('$js_lt{'ysno'}'); checker = 0; } if (formName.updatedrops[unenrolldis].checked && formName.updateadds[enrolldis].checked ) { - alert('$lt{'both'}$lt{'noup'}'); + alert('$js_lt{'both'}$js_lt{'noup'}'); checker = 0; } } @@ -141,7 +142,7 @@ function process(calling,numauto,nummanu } if (totalnote > 0) { if (formName.notify[1].checked == true) { - if (confirm('$lt{'nnot'}$lt{'eras'}')) { + if (confirm('$js_lt{'nnot'}$js_lt{'eras'}')) { checker = 1; } else { checker = 0; @@ -149,7 +150,7 @@ function process(calling,numauto,nummanu } } else { if (formName.notify[0].checked == true) { - alert('$lt{'ynot'}'); + alert('$js_lt{'ynot'}'); checker = 0; } } @@ -177,7 +178,7 @@ function process(calling,numauto,nummanu document.forms.studentform.state.value = "process"; } if (totcheck == 0) { - alert('$lt{'atle'}') + alert('$js_lt{'atle'}') checker = 0; } } @@ -290,7 +291,7 @@ sub print_main_frame { # Get course settings my %enrollvar; my %settings = &Apache::lonnet::dump('environment',$dom,$crs); - foreach my $item (keys %settings) { + foreach my $item (keys(%settings)) { if ($item =~ m/^internal\.(.+)$/) { $enrollvar{$1} = $settings{$item}; } elsif ($item =~ /^default_enrollment_(start|end)_date$/) { @@ -749,7 +750,7 @@ sub print_main_frame { $r->print( &mt('Currently, this LON-CAPA course is crosslisted with [quant,_1,course section,course sections].',$cross_str).' '. &mt('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.').' '. - &mt('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: [_1; otherwise uncheck it.',"$realm ($enrollvar{coursecode})").' '. + &mt('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: [_1]; otherwise uncheck it.',"$realm ($enrollvar{coursecode})").' '. &mt('If you wish to change the section ID assigned in your LON-CAPA course for a crosslisted course, enter the new section ID in the appropriate textbox.').' '. &mt('The LON-CAPA section ID can be left (or set to) empty, if you do not wish to tie a section ID to this crosslisting.').' '. &mt('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.').' '. @@ -1356,7 +1357,7 @@ sub print_accessdate_table { 'fnew' => 'for new students added when you update the class roster', 'ifad' => 'If automated adds are enabled, then when students are added their student roles will become active on the date set here for first access, and their roles will become inactive on the date set here for last access. These default access dates will be overridden for specific students if the institutional classlist data supplied to the automatic enrollment process includes entries for the startdate and enddate fields for those students.', ); - $lt{'ncds'} = &mt('changing default start and end access dates will affect [_1]future enrollments[_2] and also [_1]currently inactive[_2] students (i.e., those for whom access will begin in the future).','',''); + $lt{'ncds'} = &mt('Changing default start and end access dates will affect [_1]future enrollments[_2] and also [_1]currently inactive[_2] students (i.e., those for whom access will begin in the future).','',''); $lt{'tcha'} = &mt('To change access dates for [_1]currently active[_2] students, use User Management -> "Manage Course Users" to display currently active students, then use the dropdown menu for "Action to take for selected users:" to choose "Change starting/ending dates", select the students to change, and click "Proceed".','',''); my $dateshow; if ( ($oldendshow eq '') && ($oldstartshow eq '') ) { @@ -1706,7 +1707,7 @@ sub print_setaccess_response { '
'. &mt('Any change in access dates will only apply to students who are not currently active, i.e., those who currently have access start dates in the future, and to those added by future automated enrollment.'). '

'. - &mt('To change access dates for any currently active students, use User Management -> "Manage Users" to display currently active students, then use the dropdown menu for "Action to take for selected users:" to choose "Change starting/ending dates", select the students to change, and click "Proceed".'). + &mt('To change access dates for [_1]currently active[_2] students, use User Management -> "Manage course users" to display currently active students, then use the dropdown menu for "Action to take for selected users:" to choose "Change starting/ending dates", select the students to change, and click "Proceed".','',''). '
'; # Generate message in case where old first access date was later than today, but new first access date is now today or earlier. @@ -1920,7 +1921,7 @@ sub print_crosslistings_menu { if ($numcross) { $response .= &mt('You indicated that you wish to add an additional [quant,_1,crosslisting].',$numcross).' '. - &mt('For each new crosslisting enter the insititutional course section code (e.g., fs03zol101001, for section 001 of zol101 for fs03 semester), and the LON-CAPA section ID you wish to assign to students who will be enrolled in your LON-CAPA class as a result of their registration in the crosslisted course section.').' '. + &mt('For each new crosslisting enter the institutional course section code (e.g., fs03zol101001, for section 001 of zol101 for fs03 semester), and the LON-CAPA section ID you wish to assign to students who will be enrolled in your LON-CAPA class as a result of their registration in the crosslisted course section.').' '. &mt('The LON-CAPA section ID can be left blank, if you do not wish to tie a section ID to this crosslisting.').' '. &mt("The institutional course section code should only contain letters and/or numbers, and must be consistent with the scheme adopted by your Domain Coordinator to map course codes (and section numbers) to your institution's student information system."). '

@@ -2250,7 +2251,7 @@ sub print_sections_menu { if ($numsec > 0) { $response .= &mt('You indicated that you wish to incorporate student enrollment in your LON-CAPA course from an additional [quant,_1,section].',$numsec).' '. - &mt('For each new section enter the insititutional section code (e.g., 004), and the LON-CAPA section ID you wish to assign to students who will be enrolled in your LON-CAPA class as a result of their registration in this particular section.').' '. + &mt('For each new section enter the institutional section code (e.g., 004), and the LON-CAPA section ID you wish to assign to students who will be enrolled in your LON-CAPA class as a result of their registration in this particular section.').' '. &mt('The LON-CAPA section ID can be left blank, if you do not wish to designate a section ID for this course section.').' '. &mt("The institutional section code should only contain letters and/or numbers, and must be consistent with the scheme adopted by your Domain Coordinator to map course section numbers to your institution's student information system.").'

@@ -2356,7 +2357,7 @@ sub print_sections_response { } } - if ($putreply ne 'ok') { + if ($putreply eq 'ok') { $response = &mt('Students enrolling in the sections listed below will be automatically added to the class roster for LON-CAPA course [_1], if you have chosen to enable a nightly automated enrollment update.', "$realm ($coursecode)").'