version 1.416, 2022/11/11 02:30:19
|
version 1.417, 2022/11/17 13:12:40
|
Line 7714 sub print_privacy {
|
Line 7714 sub print_privacy {
|
my ($position,$dom,$settings,$rowtotal) = @_; |
my ($position,$dom,$settings,$rowtotal) = @_; |
my ($datatable,$css_class,$numinrow,@items,%names,$othertitle,$usertypes,$types); |
my ($datatable,$css_class,$numinrow,@items,%names,$othertitle,$usertypes,$types); |
my $itemcount = 0; |
my $itemcount = 0; |
unless ($position eq 'top') { |
if ($position eq 'top') { |
|
$numinrow = 2; |
|
} else { |
@items = ('domain','author','course','community'); |
@items = ('domain','author','course','community'); |
%names = &Apache::lonlocal::texthash ( |
%names = &Apache::lonlocal::texthash ( |
domain => 'Assigned domain role(s)', |
domain => 'Assigned domain role(s)', |
Line 7739 sub print_privacy {
|
Line 7741 sub print_privacy {
|
auto => 'Unrestricted', |
auto => 'Unrestricted', |
instdom => 'Other domain shares institution/provider', |
instdom => 'Other domain shares institution/provider', |
extdom => 'Other domain has different institution/provider', |
extdom => 'Other domain has different institution/provider', |
|
notify => 'Receive notification of role requests requiring DC authorization', |
); |
); |
my %names = &Apache::lonlocal::texthash ( |
my %names = &Apache::lonlocal::texthash ( |
domain => 'Domain role', |
domain => 'Domain role', |
Line 7790 sub print_privacy {
|
Line 7793 sub print_privacy {
|
$datatable .= '</td></tr>'; |
$datatable .= '</td></tr>'; |
$itemcount ++; |
$itemcount ++; |
} |
} |
|
$css_class = $itemcount%2?' class="LC_odd_row"':''; |
|
$datatable .= '<tr'.$css_class.'><td>'.$titles{'notify'}.'</td>'. |
|
'<td class="LC_left_item">'; |
|
if ((@instdoms > 1) || (keys(%by_location) > 0)) { |
|
my %curr; |
|
if (ref($settings) eq 'HASH') { |
|
if ($settings->{'notify'} ne '') { |
|
map {$curr{$_}=1;} split(/,/,$settings->{'notify'}); |
|
} |
|
} |
|
$css_class = $itemcount%2?' class="LC_odd_row"':''; |
|
my ($numdc,$table,$rows) = &active_dc_picker($dom,$numinrow,'checkbox', |
|
'privacy_notify',%curr); |
|
if ($numdc > 0) { |
|
$datatable .= $table; |
|
} else { |
|
$datatable .= &mt('There are no active Domain Coordinators'); |
|
} |
|
} else { |
|
$datatable .= &mt('Nothing to set here, as there are no other domains'); |
|
} |
|
$datatable .='</td></tr>'; |
} elsif ($position eq 'middle') { |
} elsif ($position eq 'middle') { |
if ((@instdoms > 1) || (keys(%by_location) > 0)) { |
if ((@instdoms > 1) || (keys(%by_location) > 0)) { |
if ((ref($types) eq 'ARRAY') && (ref($usertypes) eq 'HASH')) { |
if ((ref($types) eq 'ARRAY') && (ref($usertypes) eq 'HASH')) { |
Line 17969 sub modify_privacy {
|
Line 17994 sub modify_privacy {
|
user => 'User authorizes', |
user => 'User authorizes', |
domain => 'Domain Coordinator authorizes', |
domain => 'Domain Coordinator authorizes', |
auto => 'Unrestricted', |
auto => 'Unrestricted', |
|
notify => 'Receive notification of role requests requiring DC authorization', |
); |
); |
my %fieldnames = &Apache::lonlocal::texthash ( |
my %fieldnames = &Apache::lonlocal::texthash ( |
id => 'Student/Employee ID', |
id => 'Student/Employee ID', |
Line 18086 sub modify_privacy {
|
Line 18112 sub modify_privacy {
|
} |
} |
} |
} |
} |
} |
|
my %domcoords = &Apache::lonnet::get_active_domroles($dom,['dc']); |
|
my %notify; |
|
foreach my $possdc (&Apache::loncommon::get_env_multiple('form.privacy_notify')) { |
|
if (exists($domcoords{$possdc})) { |
|
$notify{$possdc} = 1; |
|
} |
|
} |
|
my $notify = join(',',sort(keys(%notify))); |
|
if ($current{'notify'} ne $notify) { |
|
$changes{'notify'} = 1; |
|
} |
|
$privacyhash{'notify'} = $notify; |
} |
} |
my %confighash = ( |
my %confighash = ( |
privacy => \%privacyhash, |
privacy => \%privacyhash, |
Line 18094 sub modify_privacy {
|
Line 18132 sub modify_privacy {
|
if ($putresult eq 'ok') { |
if ($putresult eq 'ok') { |
if (keys(%changes) > 0) { |
if (keys(%changes) > 0) { |
$resulttext = &mt('Changes made: ').'<ul>'; |
$resulttext = &mt('Changes made: ').'<ul>'; |
foreach my $key ('approval','othdom','priv','unpriv') { |
foreach my $key ('approval','notify','othdom','priv','unpriv') { |
if ($changes{$key}) { |
if ($changes{$key}) { |
$resulttext .= '<li>'.$titles{$key}.':<ul>'; |
$resulttext .= '<li>'.$titles{$key}.':<ul>'; |
if ($key eq 'approval') { |
if ($key eq 'approval') { |
Line 18112 sub modify_privacy {
|
Line 18150 sub modify_privacy {
|
} |
} |
$resulttext .= '</ul></li>'; |
$resulttext .= '</ul></li>'; |
} |
} |
|
} elsif ($key eq 'notify') { |
|
if ($privacyhash{$key}) { |
|
foreach my $dc (split(/,/,$privacyhash{$key})) { |
|
my ($dcname,$dcdom) = split(/:/,$dc); |
|
$resulttext .= '<li>'.&Apache::loncommon::plainname($dcname,$dcdom).'</li>'; |
|
} |
|
} else { |
|
$resulttext .= '<li>'.&mt('No DCs to notify').'</li>'; |
|
} |
} elsif ($key eq 'othdom') { |
} elsif ($key eq 'othdom') { |
my @statuses; |
my @statuses; |
if (ref($types) eq 'ARRAY') { |
if (ref($types) eq 'ARRAY') { |