version 1.130, 2010/03/11 21:18:24
|
version 1.131, 2010/03/12 15:01:36
|
Line 253 sub handler {
|
Line 253 sub handler {
|
help => 'Domain_Configuration_Auto_Updates', |
help => 'Domain_Configuration_Auto_Updates', |
header => [{col1 => 'Setting', |
header => [{col1 => 'Setting', |
col2 => 'Value',}, |
col2 => 'Value',}, |
|
{col1 => 'Setting', |
|
col2 => 'Affiliation'}, |
{col1 => 'User population', |
{col1 => 'User population', |
col2 => 'Updataeable user data'}], |
col2 => 'Updateable user data'}], |
}, |
}, |
'autocreate' => |
'autocreate' => |
{ text => 'Auto-course creation settings', |
{ text => 'Auto-course creation settings', |
Line 518 sub print_config_box {
|
Line 520 sub print_config_box {
|
</tr>'; |
</tr>'; |
$rowtotal ++; |
$rowtotal ++; |
if ($action eq 'autoupdate') { |
if ($action eq 'autoupdate') { |
$output .= &print_autoupdate('bottom',$dom,$settings,\$rowtotal); |
$output .= &print_autoupdate('middle',$dom,$settings,\$rowtotal).' |
|
</table> |
|
</td> |
|
</tr> |
|
<tr> |
|
<td> |
|
<table class="LC_nested"> |
|
<tr class="LC_info_row"> |
|
<td class="LC_left_item"'.$colspan.'>'.&mt($item->{'header'}->[2]->{'col1'}).'</td> |
|
<td class="LC_right_item">'.&mt($item->{'header'}->[2]->{'col2'}).'</td> </tr>'. |
|
&print_autoupdate('bottom',$dom,$settings,\$rowtotal); |
|
$rowtotal ++; |
} elsif ($action eq 'usercreation') { |
} elsif ($action eq 'usercreation') { |
$output .= &print_usercreation('middle',$dom,$settings,\$rowtotal).' |
$output .= &print_usercreation('middle',$dom,$settings,\$rowtotal).' |
</table> |
</table> |
Line 543 sub print_config_box {
|
Line 556 sub print_config_box {
|
<tr class="LC_info_row"> |
<tr class="LC_info_row"> |
<td class="LC_left_item"'.$colspan.'>'.&mt($item->{'header'}->[2]->{'col1'}).'</td> |
<td class="LC_left_item"'.$colspan.'>'.&mt($item->{'header'}->[2]->{'col1'}).'</td> |
<td class="LC_right_item">'.&mt($item->{'header'}->[2]->{'col2'}).'</td> </tr>'. |
<td class="LC_right_item">'.&mt($item->{'header'}->[2]->{'col2'}).'</td> </tr>'. |
|
|
&print_usermodification('bottom',$dom,$settings,\$rowtotal); |
&print_usermodification('bottom',$dom,$settings,\$rowtotal); |
$rowtotal ++; |
$rowtotal ++; |
} elsif ($action eq 'coursecategories') { |
} elsif ($action eq 'coursecategories') { |
Line 1803 sub print_autoupdate {
|
Line 1815 sub print_autoupdate {
|
$classlistsoff.'value="0" />'.&mt('No').'</label></span></td>'. |
$classlistsoff.'value="0" />'.&mt('No').'</label></span></td>'. |
'</tr>'; |
'</tr>'; |
$$rowtotal += 2; |
$$rowtotal += 2; |
|
} elsif ($position eq 'middle') { |
|
my ($othertitle,$usertypes,$types) = &Apache::loncommon::sorted_inst_types($dom); |
|
my $numinrow = 3; |
|
my $locknamesettings; |
|
$datatable .= &insttypes_row($settings,$types,$usertypes, |
|
$dom,$numinrow,$othertitle, |
|
'lockablenames'); |
|
$$rowtotal ++; |
} else { |
} else { |
my ($othertitle,$usertypes,$types) = &Apache::loncommon::sorted_inst_types($dom); |
my ($othertitle,$usertypes,$types) = &Apache::loncommon::sorted_inst_types($dom); |
my @fields = ('lastname','firstname','middlename','gen', |
my @fields = ('lastname','firstname','middlename','gen', |
Line 3397 sub insttypes_row {
|
Line 3417 sub insttypes_row {
|
my %lt = &Apache::lonlocal::texthash ( |
my %lt = &Apache::lonlocal::texthash ( |
cansearch => 'Users allowed to search', |
cansearch => 'Users allowed to search', |
statustocreate => 'Institutional affiliation(s) able to create own account (login/SSO)', |
statustocreate => 'Institutional affiliation(s) able to create own account (login/SSO)', |
|
lockablenames => 'User preference to lock name', |
); |
); |
my $showdom; |
my $showdom; |
if ($context eq 'cansearch') { |
if ($context eq 'cansearch') { |
Line 3433 sub insttypes_row {
|
Line 3454 sub insttypes_row {
|
$usertypes->{$types->[$i]}.'</label></span></td>'; |
$usertypes->{$types->[$i]}.'</label></span></td>'; |
} |
} |
} |
} |
|
|
$rem = @{$types}%($numinrow); |
$rem = @{$types}%($numinrow); |
} |
} |
my $colsleft = $numinrow - $rem; |
my $colsleft = $numinrow - $rem; |
|
if (($rem == 0) && (@{$types} > 0)) { |
|
$output .= '<tr>'; |
|
} |
if ($colsleft > 1) { |
if ($colsleft > 1) { |
$output .= '<td colspan="'.$colsleft.'" class="LC_left_item">'; |
$output .= '<td colspan="'.$colsleft.'" class="LC_left_item">'; |
} else { |
} else { |
Line 4755 sub modify_autoupdate {
|
Line 4778 sub modify_autoupdate {
|
push(@{$fields{$1}},$2); |
push(@{$fields{$1}},$2); |
} |
} |
} |
} |
|
my @lockablenames = &Apache::loncommon::get_env_multiple('form.lockablenames'); |
|
@lockablenames = sort(@lockablenames); |
|
if (ref($currautoupdate{'lockablenames'}) eq 'ARRAY') { |
|
my @changed = &Apache::loncommon::compare_arrays($currautoupdate{'lockablenames'},\@lockablenames); |
|
if (@changed) { |
|
$changes{'lockablenames'} = 1; |
|
} |
|
} else { |
|
if (@lockablenames) { |
|
$changes{'lockablenames'} = 1; |
|
} |
|
} |
my %updatehash = ( |
my %updatehash = ( |
autoupdate => { run => $env{'form.autoupdate_run'}, |
autoupdate => { run => $env{'form.autoupdate_run'}, |
classlists => $env{'form.classlists'}, |
classlists => $env{'form.classlists'}, |
fields => {%fields}, |
fields => {%fields}, |
|
lockablenames => \@lockablenames, |
} |
} |
); |
); |
foreach my $key (keys(%currautoupdate)) { |
foreach my $key (keys(%currautoupdate)) { |
Line 4788 sub modify_autoupdate {
|
Line 4824 sub modify_autoupdate {
|
} |
} |
} |
} |
} |
} |
|
} elsif ($key eq 'lockablenames') { |
|
if (ref($currautoupdate{$key}) eq 'ARRAY') { |
|
my @changed = &Apache::loncommon::compare_arrays($currautoupdate{'lockablenames'},\@lockablenames); |
|
if (@changed) { |
|
$changes{'lockablenames'} = 1; |
|
} |
|
} else { |
|
if (@lockablenames) { |
|
$changes{'lockablenames'} = 1; |
|
} |
|
} |
|
} |
|
} |
|
unless (grep(/^\Qlockablenames\E$/,keys(%currautoupdate))) { |
|
if (@lockablenames) { |
|
$changes{'lockablenames'} = 1; |
} |
} |
} |
} |
foreach my $item (@{$types},'default') { |
foreach my $item (@{$types},'default') { |
Line 4807 sub modify_autoupdate {
|
Line 4859 sub modify_autoupdate {
|
if (keys(%changes) > 0) { |
if (keys(%changes) > 0) { |
$resulttext = &mt('Changes made:').'<ul>'; |
$resulttext = &mt('Changes made:').'<ul>'; |
foreach my $key (sort(keys(%changes))) { |
foreach my $key (sort(keys(%changes))) { |
if (ref($changes{$key}) eq 'ARRAY') { |
if ($key eq 'lockablenames') { |
|
$resulttext .= '<li>'; |
|
if (@lockablenames) { |
|
$usertypes->{'default'} = $othertitle; |
|
$resulttext .= &mt("User preference to disable replacement of user's name with institutional data (by auto-update), available for the following affiliations:").' '. |
|
join(', ', map { $usertypes->{$_}; } @lockablenames).'</li>'; |
|
} else { |
|
$resulttext .= &mt("User preference to disable replacement of user's name with institutional data (by auto-update) is unavailable."); |
|
} |
|
$resulttext .= '</li>'; |
|
} elsif (ref($changes{$key}) eq 'ARRAY') { |
foreach my $item (@{$changes{$key}}) { |
foreach my $item (@{$changes{$key}}) { |
my @newvalues; |
my @newvalues; |
foreach my $type (@{$fields{$item}}) { |
foreach my $type (@{$fields{$item}}) { |