--- loncom/interface/loncreateuser.pm 2017/01/24 05:35:35 1.406.2.11 +++ loncom/interface/loncreateuser.pm 2017/01/30 18:37:34 1.406.2.12 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Create a user # -# $Id: loncreateuser.pm,v 1.406.2.11 2017/01/24 05:35:35 raeburn Exp $ +# $Id: loncreateuser.pm,v 1.406.2.12 2017/01/30 18:37:34 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -6672,20 +6672,25 @@ sub print_useraccesslogs_display { # set breadcrumbs my %breadcrumb_text = &singleuser_breadcrumb('','domain',$udom); - push (@{$brcrum}, - {href => "javascript:backPage($form)", - text => $breadcrumb_text{'search'}}); - my (@prevphases,$prevphasestr); - if ($env{'form.prevphases'}) { - @prevphases = split(/,/,$env{'form.prevphases'}); - $prevphasestr = $env{'form.prevphases'}; - } - if (($env{'form.phase'} eq 'userpicked') || (grep(/^userpicked$/,@prevphases))) { - push(@{$brcrum}, - {href => "javascript:backPage($form,'get_user_info','select')", - text => $breadcrumb_text{'userpicked'}}); - if ($env{'form.phase'} eq 'userpicked') { - $prevphasestr = 'userpicked'; + my $prevphasestr; + if ($env{'form.popup'}) { + $brcrum = []; + } else { + push (@{$brcrum}, + {href => "javascript:backPage($form)", + text => $breadcrumb_text{'search'}}); + my @prevphases; + if ($env{'form.prevphases'}) { + @prevphases = split(/,/,$env{'form.prevphases'}); + $prevphasestr = $env{'form.prevphases'}; + } + if (($env{'form.phase'} eq 'userpicked') || (grep(/^userpicked$/,@prevphases))) { + push(@{$brcrum}, + {href => "javascript:backPage($form,'get_user_info','select')", + text => $breadcrumb_text{'userpicked'}}); + if ($env{'form.phase'} eq 'userpicked') { + $prevphasestr = 'userpicked'; + } } } push(@{$brcrum}, @@ -6697,6 +6702,7 @@ sub print_useraccesslogs_display { bread_crumbs_component => 'User Management'}; if ($env{'form.popup'}) { $args->{'no_nav_bar'} = 1; + $args->{'bread_crumbs_nomenu'} = 1; } # set javascript @@ -6722,8 +6728,12 @@ ENDSCRIPT unless ($permission->{'activity'}) { $r->print('

' .&mt('You do not have rights to display user access logs.') - .'

' - .&earlyout_accesslog_form($formname,$prevphasestr,$udom)); + .'

'); + if ($env{'form.popup'}) { + $r->print('

'.&mt('Close window').'

'); + } else { + $r->print(&earlyout_accesslog_form($formname,$prevphasestr,$udom)); + } return; } @@ -6789,8 +6799,10 @@ ENDSCRIPT my ($nav_script,$nav_links); # table header - my $tableheader = - &Apache::loncommon::start_data_table_header_row() + my $tableheader = '

'. + &mt('User access logs for: [_1]', + &Apache::loncommon::aboutmewrapper(&Apache::loncommon::plainname($uname,$udom),$uname,$udom)).'

' + .&Apache::loncommon::start_data_table_header_row() .' ' .''.&mt('When').'' .''.&mt('HostID').'' @@ -6989,7 +7001,7 @@ sub activity_display_filter { # Update Display button $output .= '

' .'' - .'

'; + .'


'; return $output; } @@ -7183,7 +7195,7 @@ sub print_helpdeskaccess_display { my $confname = $cdom.'-domainconfig'; my $crstype = &Apache::loncommon::course_type(); - my @accesstypes = ('all','none'); + my @accesstypes = ('all','dh','da','none'); my ($numstatustypes,@jsarray); my ($othertitle,$usertypes,$types) = &Apache::loncommon::sorted_inst_types($cdom); if (ref($types) eq 'ARRAY') { @@ -7194,7 +7206,7 @@ sub print_helpdeskaccess_display { } } my %customroles = &get_domain_customroles($cdom,$confname); - my %domhelpdesk = &Apache::lonnet::get_active_domroles($cdom,['dh']); + my %domhelpdesk = &Apache::lonnet::get_active_domroles($cdom,['dh','da']); if (keys(%domhelpdesk)) { push(@accesstypes,('inc','exc')); push(@jsarray,('notinc','notexc')); @@ -7392,7 +7404,9 @@ ENDJS 'rou' => 'Role usage', 'whi' => 'Which helpdesk personnel may use this role?', 'udd' => 'Use domain default', - 'all' => 'All', + 'all' => 'All with domain helpdesk or helpdesk assistant role', + 'dh' => 'All with domain helpdesk role', + 'da' => 'All with domain helpdesk assistant role', 'none' => 'None', 'status' => 'Determined based on institutional status', 'inc' => 'Include all, but exclude specific personnel', @@ -7579,7 +7593,8 @@ sub domain_adhoc_access { my $access = $domcurrent->{$role}{'access'}; if (($access eq '') || (!grep(/^\Q$access\E$/,@{$accesstypes}))) { $access = 'all'; - $domusage{$role} = &mt('Any user in domain with active [_1] role',&Apache::lonnet::plaintext('dh')); + $domusage{$role} = &mt('Any user in domain with active [_1] or [_2] role',&Apache::lonnet::plaintext('dh'), + &Apache::lonnet::plaintext('da')); } elsif ($access eq 'status') { if (ref($domcurrent->{$role}{$access}) eq 'ARRAY') { my @shown; @@ -7595,8 +7610,8 @@ sub domain_adhoc_access { } if (@shown) { my $shownstatus = join(' '.&mt('or').' ',@shown); - $domusage{$role} = &mt('Any user in domain with active [_1] role, and institutional status: [_2]', - &Apache::lonnet::plaintext('dh'),$shownstatus); + $domusage{$role} = &mt('Any user in domain with active [_1] or [_2] role, and institutional status: [_3]', + &Apache::lonnet::plaintext('dh'),&Apache::lonnet::plaintext('da'),$shownstatus); } else { $domusage{$role} = &mt('No one in the domain'); } @@ -7610,10 +7625,11 @@ sub domain_adhoc_access { } my $showninc = join(', ',@dominc); if ($showninc ne '') { - $domusage{$role} = &mt('Include any user in domain with active [_1] role, except: [_2]', - &Apache::lonnet::plaintext('dh'),$showninc); + $domusage{$role} = &mt('Include any user in domain with active [_1] or [_2] role, except: [_3]', + &Apache::lonnet::plaintext('dh'),&Apache::lonnet::plaintext('da'),$showninc); } else { - $domusage{$role} = &mt('Any user in domain with active [_1] role',&Apache::lonnet::plaintext('dh')); + $domusage{$role} = &mt('Any user in domain with active [_1] or [_2] role', + &Apache::lonnet::plaintext('dh'),&Apache::lonnet::plaintext('da')); } } } elsif ($access eq 'exc') { @@ -7626,18 +7642,24 @@ sub domain_adhoc_access { } my $shownexc = join(', ',@domexc); if ($shownexc ne '') { - $domusage{$role} = &mt('Only the following in the domain with active [_1] role: [_2]', - &Apache::lonnet::plaintext('dh'),$shownexc); + $domusage{$role} = &mt('Only the following in the domain with active [_1] or [_2] role: [_3]', + &Apache::lonnet::plaintext('dh'),&Apache::lonnet::plaintext('da'),$shownexc); } else { $domusage{$role} = &mt('No one in the domain'); } } elsif ($access eq 'none') { $domusage{$role} = &mt('No one in the domain'); - } elsif ($access eq 'all') { + } elsif ($access eq 'dh') { $domusage{$role} = &mt('Any user in domain with active [_1] role',&Apache::lonnet::plaintext('dh')); + } elsif ($access eq 'da') { + $domusage{$role} = &mt('Any user in domain with active [_1] role',&Apache::lonnet::plaintext('da')); + } elsif ($access eq 'all') { + $domusage{$role} = &mt('Any user in domain with active [_1] or [_2] role', + &Apache::lonnet::plaintext('dh'),&Apache::lonnet::plaintext('da')); } } else { - $domusage{$role} = &mt('Any user in domain with active [_1] role',&Apache::lonnet::plaintext('dh')); + $domusage{$role} = &mt('Any user in domain with active [_1] or [_2] role', + &Apache::lonnet::plaintext('dh'),&Apache::lonnet::plaintext('da')); } } return %domusage; @@ -7818,7 +7840,7 @@ sub update_helpdeskaccess { $r->print('

'.&mt('You do not have permission to change helpdesk access.').'

'); return; } - my @accesstypes = ('all','none','status','inc','exc'); + my @accesstypes = ('all','dh','da','none','status','inc','exc'); my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'}; my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'}; my $confname = $cdom.'-domainconfig'; @@ -7828,7 +7850,7 @@ sub update_helpdeskaccess { my (%settings,%overridden); &get_adhocrole_settings($env{'request.course.id'},\@accesstypes, $types,\%customroles,\%settings,\%overridden); - my %domhelpdesk = &Apache::lonnet::get_active_domroles($cdom,['dh']); + my %domhelpdesk = &Apache::lonnet::get_active_domroles($cdom,['dh','da']); my (%changed,%storehash,@todelete); if (keys(%customroles)) { @@ -8069,6 +8091,12 @@ sub update_helpdeskaccess { if ($env{'form.'.$role.'_incrs'}) { if ($newsettings{$role}{'access'} eq 'all') { $r->print(&mt('All helpdesk staff can access '.lc($crstype).' with this role.')); + } elsif ($newsettings{$role}{'access'} eq 'dh') { + $r->print(&mt('Helpdesk staff can use this role if they have an active [_1] role', + &Apache::lonnet::plaintext('dh'))); + } elsif ($newsettings{$role}{'access'} eq 'da') { + $r->print(&mt('Helpdesk staff can use this role if they have an active [_1] role', + &Apache::lonnet::plaintext('da'))); } elsif ($newsettings{$role}{'access'} eq 'none') { $r->print(&mt('No helpdesk staff can access '.lc($crstype).' with this role.')); } elsif ($newsettings{$role}{'access'} eq 'status') {