--- loncom/interface/lonpopulate.pm 2016/07/24 14:34:59 1.84 +++ loncom/interface/lonpopulate.pm 2016/11/09 00:48:52 1.85 @@ -1,5 +1,5 @@ # automated enrollment configuration handler -# $Id: lonpopulate.pm,v 1.84 2016/07/24 14:34:59 raeburn Exp $ +# $Id: lonpopulate.pm,v 1.85 2016/11/09 00:48:52 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -40,8 +40,8 @@ use LONCAPA::Enrollment; ############################################################### sub header { - my ($action) = @_; - my $args = &make_crumbs($action); + my ($action,$permref) = @_; + my $args = &make_crumbs($action,$permref); return &Apache::loncommon::start_page('Classlist Manager',undef,$args); } @@ -49,7 +49,7 @@ sub header { ############################################################### sub choose_header { - my ($action) = @_; + my ($action,$permref) = @_; my $notify_check = '/^note_[0-9]+$/'; my %js_lt = &Apache::lonlocal::texthash( @@ -60,14 +60,25 @@ sub choose_header { eras => 'Click "OK" to erase all recipients, or "Cancel".', 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', + noed => 'You do not have rights to modify automated enrollment settings', ); $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 = <{'edit'})) { + $scripttag .= < ENDJS - my $args = &make_crumbs($action); + my $args = &make_crumbs($action,$permref); return &Apache::loncommon::start_page('Classlist Manager', $scripttag,$args); } sub make_crumbs { - my ($action) = @_; - my ($tasklong,$tasktitle) = &get_task_text(); + my ($action,$permref) = @_; + my ($tasklong,$tasktitle) = &get_task_text($permref); my $brcrum = [{href=>"/adm/createuser", text=>"User Management",}, {href=>"/adm/populate", @@ -231,7 +243,6 @@ sub make_crumbs { } elsif ($action eq 'newsections') { $action = 'sections'; } - my ($tasklong,$tasktitle) = &get_task_text(); my $text; if (ref($tasklong) eq 'HASH') { $text = $tasklong->{$action}; @@ -282,11 +293,16 @@ sub print_navmenu { ############################################################### 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; @@ -305,7 +321,9 @@ sub print_main_frame {   '.&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.','"','"').' @@ -352,8 +370,55 @@ sub print_main_frame {   '.&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(' + +   + '.&mt('Use [_1]Automated adds/drops[_2] to display status of automatic nightly adds or drops based on institutional enrollment information.','"','"').' + + +   + '.&mt('Use [_1]Enrollment dates[_2] to display the date of first automated enrollment and last automated enrollment for registered students.','"','"').' + + +   + '.&mt('Use [_1]Access dates[_2] to display the default start and/or end dates for student roles created by automated enrollment.','"','"').' + + +   + '.&mt('Use [_1]Notification of changes[_2] to display which course coordinators (if any) receive notification of enrollment changes.','"','"').' + + +   + '.&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(' +   @@ -361,6 +426,7 @@ sub print_main_frame { '.&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(' @@ -378,15 +444,15 @@ sub print_main_frame { '.&mt('Additions based on classlist changes:').'  '); if ($enrollvar{autoadds}) { $r->print(' -