version 1.102.2.11, 2010/03/11 02:51:44
|
version 1.102.2.12, 2010/03/23 20:06:04
|
Line 234 sub handler {
|
Line 234 sub handler {
|
col2 => 'Value'}], |
col2 => 'Value'}], |
}, |
}, |
'quotas' => |
'quotas' => |
{ text => 'User blogs, personal information pages and portfolios', |
{ text => 'User blogs, personal information pages, portfolios', |
help => 'Domain_Configuration_Quotas', |
help => 'Domain_Configuration_Quotas', |
header => [{col1 => 'User affiliation', |
header => [{col1 => 'User affiliation', |
col2 => 'Available tools', |
col2 => 'Available tools', |
Line 251 sub handler {
|
Line 251 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 346 sub handler {
|
Line 348 sub handler {
|
my @actions = &Apache::loncommon::get_env_multiple('form.actions'); |
my @actions = &Apache::loncommon::get_env_multiple('form.actions'); |
&Apache::lonhtmlcommon::add_breadcrumb |
&Apache::lonhtmlcommon::add_breadcrumb |
({href=>"javascript:changePage(document.$phase,'pickactions')", |
({href=>"javascript:changePage(document.$phase,'pickactions')", |
text=>"Pick functionality"}); |
text=>"Settings to display/modify"}); |
my $confname = $dom.'-domainconfig'; |
my $confname = $dom.'-domainconfig'; |
if ($phase eq 'process') { |
if ($phase eq 'process') { |
&Apache::lonconfigsettings::make_changes($r,$dom,$phase,$context,\@prefs_order,\%prefs,\%domconfig,$confname,\@roles); |
&Apache::lonconfigsettings::make_changes($r,$dom,$phase,$context,\@prefs_order,\%prefs,\%domconfig,$confname,\@roles); |
Line 498 sub print_config_box {
|
Line 500 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 522 sub print_config_box {
|
Line 535 sub print_config_box {
|
<table class="LC_nested"> |
<table class="LC_nested"> |
<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 1754 sub print_autoupdate {
|
Line 1766 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','generation', |
'permanentemail','id'); |
'permanentemail','id'); |
my %fieldtitles = &Apache::loncommon::personal_data_fieldtitles(); |
my %fieldtitles = &Apache::loncommon::personal_data_fieldtitles(); |
my $numrows = 0; |
my $numrows = 0; |
Line 2618 sub print_scantronformat {
|
Line 2638 sub print_scantronformat {
|
'<span class="LC_nobreak">'; |
'<span class="LC_nobreak">'; |
if ($scantronurl) { |
if ($scantronurl) { |
$datatable .= '<a href="'.$scantronurl.'" target="_blank">'. |
$datatable .= '<a href="'.$scantronurl.'" target="_blank">'. |
&mt('Default scantron format file').'</a>'; |
&mt('Default bubblesheet format file').'</a>'; |
} else { |
} else { |
$datatable = &mt('File unavailable for display'); |
$datatable = &mt('File unavailable for display'); |
} |
} |
Line 2645 sub print_scantronformat {
|
Line 2665 sub print_scantronformat {
|
} elsif ($scantronurl) { |
} elsif ($scantronurl) { |
$datatable .= '<td><span class="LC_nobreak">'. |
$datatable .= '<td><span class="LC_nobreak">'. |
'<a href="'.$scantronurl.'" target="_blank">'. |
'<a href="'.$scantronurl.'" target="_blank">'. |
&mt('Custom scantron format file').'</a><label>'. |
&mt('Custom bubblesheet format file').'</a><label>'. |
'<input type="checkbox" name="scantronformat_del"'. |
'<input type="checkbox" name="scantronformat_del"'. |
'" value="1" />'.&mt('Delete?').'</label></span></td>'. |
'" value="1" />'.&mt('Delete?').'</label></span></td>'. |
'<td><span class="LC_nobreak"> '. |
'<td><span class="LC_nobreak"> '. |
Line 2674 sub legacy_scantronformat {
|
Line 2694 sub legacy_scantronformat {
|
&publishlogo($r,'copy',$legacyfile,$dom,$confname,'scantron', |
&publishlogo($r,'copy',$legacyfile,$dom,$confname,'scantron', |
'','',$newfile); |
'','',$newfile); |
if ($result ne 'ok') { |
if ($result ne 'ok') { |
$error = &mt("An error occurred publishing the [_1] scantron format file in RES space. Error was: [_2].",$newfile,$result); |
$error = &mt("An error occurred publishing the [_1] bubblesheet format file in RES space. Error was: [_2].",$newfile,$result); |
} |
} |
} |
} |
return ($url,$error); |
return ($url,$error); |
Line 3254 sub insttypes_row {
|
Line 3274 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 3290 sub insttypes_row {
|
Line 3311 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 4588 sub modify_autoupdate {
|
Line 4611 sub modify_autoupdate {
|
lastname => 'Last Name', |
lastname => 'Last Name', |
firstname => 'First Name', |
firstname => 'First Name', |
middlename => 'Middle Name', |
middlename => 'Middle Name', |
gen => 'Generation', |
generation => 'Generation', |
); |
); |
my $othertitle = &mt('All users'); |
my $othertitle = &mt('All users'); |
if (keys(%{$usertypes}) > 0) { |
if (keys(%{$usertypes}) > 0) { |
Line 4596 sub modify_autoupdate {
|
Line 4619 sub modify_autoupdate {
|
} |
} |
foreach my $key (keys(%env)) { |
foreach my $key (keys(%env)) { |
if ($key =~ /^form\.updateable_(.+)_([^_]+)$/) { |
if ($key =~ /^form\.updateable_(.+)_([^_]+)$/) { |
push(@{$fields{$1}},$2); |
my ($usertype,$item) = ($1,$2); |
|
if (grep(/^\Q$item\E$/,keys(%fieldtitles))) { |
|
if ($usertype eq 'default') { |
|
push(@{$fields{$1}},$2); |
|
} elsif (ref($types) eq 'ARRAY') { |
|
if (grep(/^\Q$usertype\E$/,@{$types})) { |
|
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 4620 sub modify_autoupdate {
|
Line 4665 sub modify_autoupdate {
|
foreach my $type (@{$currautoupdate{$key}{$item}}) { |
foreach my $type (@{$currautoupdate{$key}{$item}}) { |
if (!exists($fields{$item})) { |
if (!exists($fields{$item})) { |
$change = 1; |
$change = 1; |
|
last; |
} elsif (ref($fields{$item}) eq 'ARRAY') { |
} elsif (ref($fields{$item}) eq 'ARRAY') { |
if (!grep(/^\Q$type\E$/,@{$fields{$item}})) { |
if (!grep(/^\Q$type\E$/,@{$fields{$item}})) { |
$change = 1; |
$change = 1; |
|
last; |
} |
} |
} |
} |
} |
} |
Line 4632 sub modify_autoupdate {
|
Line 4679 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') { |
if (defined($fields{$item})) { |
if (defined($fields{$item})) { |
if (ref($currautoupdate{'fields'}) eq 'HASH') { |
if (ref($currautoupdate{'fields'}) eq 'HASH') { |
if (!exists($currautoupdate{'fields'}{$item})) { |
if (ref($currautoupdate{'fields'}{$item}) eq 'ARRAY') { |
|
my $change = 0; |
|
if (ref($fields{$item}) eq 'ARRAY') { |
|
foreach my $type (@{$fields{$item}}) { |
|
if (!grep(/^\Q$type\E$/,@{$currautoupdate{'fields'}{$item}})) { |
|
$change = 1; |
|
last; |
|
} |
|
} |
|
} |
|
if ($change) { |
|
push(@{$changes{'fields'}},$item); |
|
} |
|
} else { |
push(@{$changes{'fields'}},$item); |
push(@{$changes{'fields'}},$item); |
} |
} |
} else { |
} else { |
Line 4651 sub modify_autoupdate {
|
Line 4727 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}}) { |
Line 5660 sub modify_scantron {
|
Line 5746 sub modify_scantron {
|
my $error; |
my $error; |
if ($configuserok eq 'ok') { |
if ($configuserok eq 'ok') { |
if ($switchserver) { |
if ($switchserver) { |
$error = &mt("Upload of scantron format file is not permitted to this server: [_1]",$switchserver); |
$error = &mt("Upload of bubblesheet format file is not permitted to this server: [_1]",$switchserver); |
} else { |
} else { |
if ($author_ok eq 'ok') { |
if ($author_ok eq 'ok') { |
my ($result,$scantronurl) = |
my ($result,$scantronurl) = |
Line 5700 sub modify_scantron {
|
Line 5786 sub modify_scantron {
|
if (ref($confhash{'scantron'}) eq 'HASH') { |
if (ref($confhash{'scantron'}) eq 'HASH') { |
$resulttext = &mt('Changes made:').'<ul>'; |
$resulttext = &mt('Changes made:').'<ul>'; |
if ($confhash{'scantron'}{'scantronformat'} eq '') { |
if ($confhash{'scantron'}{'scantronformat'} eq '') { |
$resulttext .= '<li>'.&mt('[_1] scantron format file removed; [_2] file will be used for courses in this domain.',$custom,$default).'</li>'; |
$resulttext .= '<li>'.&mt('[_1] bubblesheet format file removed; [_2] file will be used for courses in this domain.',$custom,$default).'</li>'; |
} else { |
} else { |
$resulttext .= '<li>'.&mt('Custom scantron format file ([_1]) uploaded for use with courses in this domain.',$custom).'</li>'; |
$resulttext .= '<li>'.&mt('Custom bubblesheet format file ([_1]) uploaded for use with courses in this domain.',$custom).'</li>'; |
} |
} |
$resulttext .= '</ul>'; |
$resulttext .= '</ul>'; |
} else { |
} else { |
$resulttext = &mt('Changes made to scantron format file.'); |
$resulttext = &mt('Changes made to bubblesheet format file.'); |
} |
} |
$resulttext .= '</ul>'; |
$resulttext .= '</ul>'; |
&Apache::loncommon::devalidate_domconfig_cache($dom); |
&Apache::loncommon::devalidate_domconfig_cache($dom); |
} else { |
} else { |
$resulttext = &mt('No changes made to scantron format file'); |
$resulttext = &mt('No changes made to bubblesheet format file'); |
} |
} |
} else { |
} else { |
$resulttext = '<span class="LC_error">'. |
$resulttext = '<span class="LC_error">'. |
&mt('An error occurred: [_1]',$putresult).'</span>'; |
&mt('An error occurred: [_1]',$putresult).'</span>'; |
} |
} |
} else { |
} else { |
$resulttext = &mt('No changes made to scantron format file'); |
$resulttext = &mt('No changes made to bubblesheet format file'); |
} |
} |
if ($errors) { |
if ($errors) { |
$resulttext .= &mt('The following errors occurred: ').'<ul>'. |
$resulttext .= &mt('The following errors occurred: ').'<ul>'. |