-ENDTHIS
+ return {bread_crumbs => $brcrum,
+ bread_crumbs_component => 'Automated Management'};
}
sub print_navmenu {
- my ($r,$tasksref,$tasklongref) = @_;
- my $action = "information";
- if (exists($env{'form.action'}) ) {
- $action = $env{'form.action'};
- }
- $r->print(<
-
-
-ENDONE
+ my ($r,$tasksref,$tasklongref,$action,$state) = @_;
+#LC_pick_box is used in the following. This is only a temporary solution to adapt the site to the design.
+ $r->print('
+
+
+
+
+');
foreach my $task (@{$tasksref}) {
- if ($task eq $action) {
- $r->print("
+ if (($task eq $action) && ($state eq 'choose')) {
+ $r->print('
');
}
###############################################################
sub print_main_frame {
- my ($r,$realm,$dom,$crs,$tasktitleref) = @_;
+ my ($r,$realm,$dom,$crs,$tasktitleref,$permref) = @_;
my $action = "information";
if (exists($env{'form.action'}) ) {
$action = $env{'form.action'};
}
+ my ($disabled,$readonly);
+ unless ($permref->{'edit'}) {
+ $disabled = ' disabled="disabled"';
+ $readonly = 1;
+ }
# Get course settings
my %enrollvar;
- my @bgcolors=("#eeeeee","#cccccc");
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$/) {
@@ -295,124 +316,250 @@ sub print_main_frame {
}
}
- if ($action eq "information") {
- $r->print(<
+ if ($action eq 'information') {
+ $r->print('
+
+
+
+
'.&mt('Use the menu on the left to choose an enrollment management task.').'
+
');
+ if ($permref->{'edit'}) {
+ $r->print('
+
+
+
'.&mt('Use [_1]Automated adds/drops[_2] to enable or disable automatic nightly adds or drops in your LON-CAPA course based on institutional enrollment information.','"','"').'
+
+
+
+
'.&mt('Use [_1]Change enrollment dates[_2] to change the date of first automated enrollment and/or the date of last automated enrollment for registered students.','"','"').'
+
-
Use the menu on the left to choose an enrollment management task.
+
'.&mt('Use [_1]Change access dates[_2] to change the default start and/or end dates for student roles created by automated enrollment.','"','"').'
+
+
+
+
'.&mt('Use [_1]Notification of changes[_2] to enable or disable notification of enrollment changes and to add or remove course coordinators from the recipient list.','"','"').'
+
+
+
+
'.&mt('Use [_1]Change crosslisting[_2] to include or exclude enrollment from crosslisted classes.',
+ '"','"').'
+
-
Use "Automated adds/drops" to enable or disable automatic nightly adds or drops in your LON-CAPA course based on institutional enrollment information.
+
'.&mt('Use [_1]Section settings[_2] to make changes to the choice of sections included for enrollment in your LON-CAPA course.',
+ '"','"').'
-
Use "Change enrollment dates" to change the date of first automated enrollment and/or the date of last automated enrollment for registered students.
+
'.&mt('Use [_1]Student photo settings[_2] to enable or disable automatic import of photos for registered students in your course.',
+ '"','"').'
-
Use "Change access dates" to change the default start and/or end dates for student roles created by automated enrollment.
+
'.&mt('Use [_1]Update roster now[_2] to add and/or drop students from your course based on the [_3]most current[_4] institutional classlist information.','"','"','','').'
-
Use "Notification of changes" to enable or disable notification of enrollment changes and to add or remove course coordinators from the recipient list.
+
'.&mt("Use [_1]Update student photos[_2] to import your institution's [_3]most current[_4] digital photos for registered students in your course.",'"','"','','').'
-
Use "Change crosslisting" to include or exclude enrollment from crosslisted classes.
+
'.&mt('Use [_1]View students and change type[_2] to display the current course roster, and (optionally) change enrollment type for selected students from "auto" to "manual" and vice versa.','"','"').'
+
+
'.&mt('Use [_1]Change zero enrollment failsafe[_2] to set number of existing enrollments in an institutional section above which no automated drops occur whenever section enrollment retrieved from institutional data is zero.','"','"').'
+
');
+ } else {
+ if (($permref->{'view'}) || ($permref->{'view_section'} ne '')) {
+ $r->print('
+
-
Use "Section settings" to make changes to the choice of sections included for enrollment in your LON-CAPA course.
+
'.&mt('Use [_1]Automated adds/drops[_2] to display status of automatic nightly adds or drops based on institutional enrollment information.','"','"').'
+
-
Use "Student photo settings" to enable or disable automatic import of photos for registered students in your course.
+
'.&mt('Use [_1]Enrollment dates[_2] to display the date of first automated enrollment and last automated enrollment for registered students.','"','"').'
-
Use "Update roster now" to add and/or drop students from your course based on the most current institutional classlist information.
+
'.&mt('Use [_1]Access dates[_2] to display the default start and/or end dates for student roles created by automated enrollment.','"','"').'
-
Use "Update student photos" to import your institution's most current digital photos for registered students in your course.
+
'.&mt('Use [_1]Notification of changes[_2] to display which course coordinators (if any) receive notification of enrollment changes.','"','"').'
-
Use "View students and change type" to display the current course roster, and (optionally) change enrollment type for selected students from 'auto' to 'manual' and vice versa.
+
'.&mt('Use [_1]Crosslisting[_2] to display enrollment settings for crosslisted classes.',
+ '"','"').'
-
+
+
'.&mt('Use [_1]Section settings[_2] to display sections included for enrollment.',
+ '"','"').'
+
+
+
+
'.&mt('Use [_1]Student photo settings[_2] to display settings for automatic import of photos for registered students.',
+ '"','"').'
+
+
+
+
'.&mt('Use [_1]Zero enrollment failsafe[_2] to set number of existing enrollments in an institutional section above which no automated drops occur whenever section enrollment retrieved from institutional data is zero.','"','"').'
+
');
+ }
+ if (($permref->{'show'}) || ($permref->{'show_section'} ne '')) {
+ $r->print('
+
+
+
'.&mt('Use [_1]View students and enrollment type[_2] to display the current course roster and enrollment type ("auto" or "manual").','"','"').'
+
');
+ }
+ $r->print('
+
+
-
Note: if automated adds and/or drops are enabled, the nightly enrollment update will ONLY occur once the first enrollment date has been reached.
+
'.&mt('Note: if automated adds and/or drops are enabled, the nightly enrollment update will ONLY occur once the first enrollment date has been reached.').'
');
+ }
+ } elsif ($action eq 'chgsettings') {
+ my @autosets = (&mt('OFF'),&mt('ON'));
+ $r->print('
+
- ");
- } elsif ($action eq "setdates") {
- my ($start_table,$end_table) = &date_setting_table($enrollvar{autostart},$enrollvar{autoend},$action);
+
+
+ '."\n");
+ } elsif ($action eq 'chgfailsafe') {
+ my $autofailsafe;
+ my %domconfig =
+ &Apache::lonnet::get_dom('configuration',['autoenroll'],$dom);
+ if (ref($domconfig{'autoenroll'}) eq 'HASH') {
+ $autofailsafe = $domconfig{'autoenroll'}->{'autofailsafe'};
+ if ($autofailsafe =~ /\D/) {
+ undef($autofailsafe);
+ }
+ }
+ $r->print('
+ '."\n");
+ } elsif ($action eq 'setdates') {
+ my ($start_table,$end_table) = &date_setting_table($enrollvar{autostart},$enrollvar{autoend},$action,$readonly);
my $oldstartshow = '';
my $oldendshow = '';
if ( defined($enrollvar{autostart}) ) {
@@ -421,21 +568,23 @@ Note: Any students added manually by cou
if ( defined($enrollvar{autoend}) ) {
$oldendshow = &Apache::lonlocal::locallocaltime($enrollvar{autoend});
if ($enrollvar{autoend} == 0) {
- $oldendshow = "No ending date";
+ $oldendshow = &mt("'No end date'");
}
}
my $dateshow;
if ( ($oldendshow eq '') && ($oldstartshow eq '') ) {
- $dateshow = " Warning. Currently NO first enrollment or last enrollment dates are set. You must use this menu to set a start date and an end date if you plan to utilise automated adds and/or drops in this course.\n";
+ $dateshow = ' '.&mt('Warning.').' '.&mt('Currently [_1]NO[_2] first enrollment or last enrollment dates are set.','','').' '.
+ &mt('You [_1]must[_2] use this menu to set a start date and an end date if you plan to utilise automated adds and/or drops in this course.','','')."\n";
} else {
- $dateshow = "Currently: First enrollment: $oldstartshow, Last enrollment: $oldendshow\n";
+ $dateshow = &mt('Currently: First enrollment[_1] Last enrollment[_2]',
+ " -- $oldstartshow"," -- $oldendshow")."\n";
}
- $r->print(<
+ $r->print('
+
-
If automated adds and/or drops are enabled, then your class roster will be automatically updated nightly, once the first enrollment date has been reached. Prior to this date, the class roster will only contain students you have added directly using the standard LON-CAPA enrollment tools
+
'.
+ &mt('If automated adds and/or drops are enabled, then your class roster will be automatically updated nightly, once the first enrollment date has been reached. Prior to this date, the class roster will only contain students you have added directly using the standard LON-CAPA enrollment tools.').'
-
+
- Set date of last automated enrollment for registered students
+ '.&mt('Set date of last automated enrollment for registered students').'
-
$end_table
+
'.$end_table.'
-
If automated adds and/or drops are enabled, then your class roster will be automatically updated nightly, until the last enrollment date has been reached.
+
'.&mt('If automated adds and/or drops are enabled, then your class roster will be automatically updated nightly, until the last enrollment date has been reached.').'