'.
@@ -7593,7 +7605,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;
@@ -7609,8 +7622,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');
}
@@ -7624,10 +7637,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') {
@@ -7640,18 +7654,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 'anydh') {
$domusage{$role} = &mt('Any user in domain with active [_1] role',&Apache::lonnet::plaintext('dh'));
+ } elsif ($access eq 'anyda') {
+ $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;
@@ -7719,13 +7739,13 @@ sub role_priv_table {
$checked = ' checked="checked"';
}
$customstatus = '';
- $ineffect = $customstatus;
+ $ineffect = $customstatus;
} elsif ((!$levelscurrent->{'course'}{$priv}) && ($on{$priv})) {
if ($permission->{'owner'}) {
- $checked = ' checked="checked"';
+ $checked = ' checked="checked"';
}
$customstatus = '';
- $ineffect = $customstatus;
+ $ineffect = $customstatus;
}
if ($permission->{'owner'}) {
$output .= '';
@@ -7740,7 +7760,7 @@ sub role_priv_table {
}
sub get_adhocrole_settings {
- my ($cid,$accesstypes,$types,$customroles,$settings,$overridden) = @_;
+ my ($cid,$accesstypes,$types,$customroles,$settings,$overridden) = @_;
return unless ((ref($accesstypes) eq 'ARRAY') && (ref($customroles) eq 'HASH') &&
(ref($settings) eq 'HASH') && (ref($overridden) eq 'HASH'));
foreach my $role (split(/,/,$env{'course.'.$cid.'.internal.adhocaccess'})) {
@@ -7832,7 +7852,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','anydh','anyda','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';
@@ -7842,7 +7862,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)) {
@@ -7869,7 +7889,7 @@ sub update_helpdeskaccess {
push(@incrs,$role);
unless ($current{'access'} eq $access) {
$changed{$role}{'access'} = 1;
- $storehash{'internal.adhoc.'.$role} = $access;
+ $storehash{'internal.adhoc.'.$role} = $access;
}
if ($access eq 'status') {
my @statuses = &Apache::loncommon::get_env_multiple('form.'.$role.'_status');
@@ -7905,7 +7925,7 @@ sub update_helpdeskaccess {
my @currstaff;
foreach my $person (sort(@personnel)) {
if ($domhelpdesk{$person}) {
- push(@stored,$person);
+ push(@stored,$person);
}
}
if (ref($current{$access}) eq 'ARRAY') {
@@ -7951,7 +7971,7 @@ sub update_helpdeskaccess {
&Apache::lonuserutils::custom_role_privs($customroles{$role},\%full,\%levels,\%levelscurrent);
my (@updatedon,@updatedoff,@override);
@override = &Apache::loncommon::get_env_multiple('form.'.$role.'_override');
- if (@override) {
+ if (@override) {
foreach my $priv (sort(keys(%full))) {
next unless ($levels{'course'}{$priv});
if (grep(/^\Q$priv\E$/,@override)) {
@@ -7964,7 +7984,7 @@ sub update_helpdeskaccess {
}
}
if (@updatedon) {
- $newsettings{$role}{'on'} = join('
');
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 'anydh') {
+ $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 'anyda') {
+ $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') {
if ($newsettings{$role}{'status'}) {
my ($access,$rest) = split(/=/,$storehash{'internal.adhoc.'.$role});
- if (split(/,/,$rest) > 1) {
+ if (split(/,/,$rest) > 1) {
$r->print(&mt('Helpdesk staff can use this role if their institutional type is one of: [_1].',
$newsettings{$role}{'status'}));
} else {
@@ -8123,15 +8149,15 @@ sub update_helpdeskaccess {
$r->print('
'.&mt('Privileges which are available by default for this ad hoc role, but are disabled for this specific '.lc($crstype).':').
'
'.$newsettings{$role}{'off'}.'
');
} else {
- $r->print('
'.&mt('All privileges available by default for this ad hoc role are enabled.').'
');
+ $r->print('
'.&mt('All privileges available by default for this ad hoc role are enabled.').'
');
}
}
- if ($changed{$role}{'on'}) {
+ if ($changed{$role}{'on'}) {
if ($newsettings{$role}{'on'}) {
$r->print('
'.&mt('Privileges which are not available by default for this ad hoc role, but are enabled for this specific '.lc($crstype).':').
'
'.$newsettings{$role}{'on'}.'
');
} else {
- $r->print('
'.&mt('None of the privileges unavailable by default for this ad hoc role are enabled.').'
');
+ $r->print('
'.&mt('None of the privileges unavailable by default for this ad hoc role are enabled.').'