version 1.160.6.19, 2013/06/05 13:31:19
|
version 1.160.6.20, 2013/07/05 19:18:34
|
Line 94 about default quota sizes for portfolio
|
Line 94 about default quota sizes for portfolio
|
institutional affiliation in the domain (e.g., Faculty, Staff, Student etc.), |
institutional affiliation in the domain (e.g., Faculty, Staff, Student etc.), |
but is now also used to manage availability of user tools: |
but is now also used to manage availability of user tools: |
i.e., blogs, aboutme page, and portfolios, and the course request tool, |
i.e., blogs, aboutme page, and portfolios, and the course request tool, |
used by course owners to request creation of a course. |
used by course owners to request creation of a course, and to display/store |
|
default quota sizes for authoring spaces. |
|
|
|
|
Outputs: 1 |
Outputs: 1 |
|
|
Line 252 sub handler {
|
Line 254 sub handler {
|
col2 => 'Value'}], |
col2 => 'Value'}], |
}, |
}, |
'quotas' => |
'quotas' => |
{ text => 'Blogs, personal web pages, webDAV, portfolios', |
{ text => 'Blogs, personal web pages, webDAV/quotas, portfolios', |
help => 'Domain_Configuration_Quotas', |
help => 'Domain_Configuration_Quotas', |
header => [{col1 => 'User affiliation', |
header => [{col1 => 'User affiliation', |
col2 => 'Available tools', |
col2 => 'Available tools', |
col3 => 'Portfolio quota',}], |
col3 => 'Quotas, Mb; (Authoring requires role)',}], |
}, |
}, |
'autoenroll' => |
'autoenroll' => |
{ text => 'Auto-enrollment settings', |
{ text => 'Auto-enrollment settings', |
Line 1504 sub print_quotas {
|
Line 1506 sub print_quotas {
|
} else { |
} else { |
$context = $action; |
$context = $action; |
} |
} |
my ($datatable,$defaultquota,@usertools,@options,%validations); |
my ($datatable,$defaultquota,$authorquota,@usertools,@options,%validations); |
my ($othertitle,$usertypes,$types) = &Apache::loncommon::sorted_inst_types($dom); |
my ($othertitle,$usertypes,$types) = &Apache::loncommon::sorted_inst_types($dom); |
my $typecount = 0; |
my $typecount = 0; |
my ($css_class,%titles); |
my ($css_class,%titles); |
Line 1523 sub print_quotas {
|
Line 1525 sub print_quotas {
|
} |
} |
if (ref($types) eq 'ARRAY') { |
if (ref($types) eq 'ARRAY') { |
foreach my $type (@{$types}) { |
foreach my $type (@{$types}) { |
my $currdefquota; |
my ($currdefquota,$currauthorquota); |
unless (($context eq 'requestcourses') || |
unless (($context eq 'requestcourses') || |
($context eq 'requestauthor')) { |
($context eq 'requestauthor')) { |
if (ref($settings) eq 'HASH') { |
if (ref($settings) eq 'HASH') { |
if (ref($settings->{defaultquota}) eq 'HASH') { |
if (ref($settings->{defaultquota}) eq 'HASH') { |
$currdefquota = $settings->{defaultquota}->{$type}; |
$currdefquota = $settings->{defaultquota}->{$type}; |
} else { |
} else { |
$currdefquota = $settings->{$type}; |
$currdefquota = $settings->{$type}; |
} |
} |
|
if (ref($settings->{authorquota}) eq 'HASH') { |
|
$currauthorquota = $settings->{authorquota}->{$type}; |
|
} |
} |
} |
} |
} |
if (defined($usertypes->{$type})) { |
if (defined($usertypes->{$type})) { |
Line 1645 sub print_quotas {
|
Line 1650 sub print_quotas {
|
unless (($context eq 'requestcourses') || |
unless (($context eq 'requestcourses') || |
($context eq 'requestauthor')) { |
($context eq 'requestauthor')) { |
$datatable .= |
$datatable .= |
'<td class="LC_right_item"><span class="LC_nobreak">'. |
'<td class="LC_right_item">'. |
|
'<span class="LC_nobreak">'.&mt('Portfolio').': '. |
'<input type="text" name="quota_'.$type. |
'<input type="text" name="quota_'.$type. |
'" value="'.$currdefquota. |
'" value="'.$currdefquota. |
'" size="5" /> Mb</span></td>'; |
'" size="5" /></span>'.(' ' x 2). |
|
'<span class="LC_nobreak">'.&mt('Authoring').': '. |
|
'<input type="text" name="authorquota_'.$type. |
|
'" value="'.$currauthorquota. |
|
'" size="5" /></span></td>'; |
} |
} |
$datatable .= '</tr>'; |
$datatable .= '</tr>'; |
} |
} |
Line 1656 sub print_quotas {
|
Line 1666 sub print_quotas {
|
} |
} |
unless (($context eq 'requestcourses') || ($context eq 'requestauthor')) { |
unless (($context eq 'requestcourses') || ($context eq 'requestauthor')) { |
$defaultquota = '20'; |
$defaultquota = '20'; |
|
$authorquota = '500'; |
if (ref($settings) eq 'HASH') { |
if (ref($settings) eq 'HASH') { |
if (ref($settings->{'defaultquota'}) eq 'HASH') { |
if (ref($settings->{'defaultquota'}) eq 'HASH') { |
$defaultquota = $settings->{'defaultquota'}->{'default'}; |
$defaultquota = $settings->{'defaultquota'}->{'default'}; |
} elsif (defined($settings->{'default'})) { |
} elsif (defined($settings->{'default'})) { |
$defaultquota = $settings->{'default'}; |
$defaultquota = $settings->{'default'}; |
} |
} |
|
if (ref($settings->{'authorquota'}) eq 'HASH') { |
|
$authorquota = $settings->{'authorquota'}->{'default'}; |
|
} |
} |
} |
} |
} |
$typecount ++; |
$typecount ++; |
Line 1772 sub print_quotas {
|
Line 1786 sub print_quotas {
|
} |
} |
$datatable .= '</td>'; |
$datatable .= '</td>'; |
unless (($context eq 'requestcourses') || ($context eq 'requestauthor')) { |
unless (($context eq 'requestcourses') || ($context eq 'requestauthor')) { |
$datatable .= '<td class="LC_right_item"><span class="LC_nobreak">'. |
$datatable .= '<td class="LC_right_item">'. |
|
'<span class="LC_nobreak">'.&mt('Portfolio').': '. |
'<input type="text" name="defaultquota" value="'. |
'<input type="text" name="defaultquota" value="'. |
$defaultquota.'" size="5" /> Mb</span></td>'; |
$defaultquota.'" size="5" /></span>'.(' ' x2). |
|
'<span class="LC_nobreak">'.&mt('Authoring').': '. |
|
'<input type="text" name="authorquota" value="'. |
|
$authorquota.'" size="5" /></span></td>'; |
} |
} |
$datatable .= '</tr>'; |
$datatable .= '</tr>'; |
$typecount ++; |
$typecount ++; |
$css_class = $typecount%2?' class="LC_odd_row"':''; |
$css_class = $typecount%2?' class="LC_odd_row"':''; |
$datatable .= '<tr'.$css_class.'>'. |
$datatable .= '<tr'.$css_class.'>'. |
'<td>'.&mt('LON-CAPA Advanced Users').' '; |
'<td>'.&mt('LON-CAPA Advanced Users').'<br />'; |
if ($context eq 'requestcourses') { |
if ($context eq 'requestcourses') { |
$datatable .= &mt('(overrides affiliation, if set)'). |
$datatable .= &mt('(overrides affiliation, if set)'). |
'</td>'. |
'</td>'. |
Line 5720 sub modify_quotas {
|
Line 5738 sub modify_quotas {
|
} else { |
} else { |
if ($key =~ /^form\.quota_(.+)$/) { |
if ($key =~ /^form\.quota_(.+)$/) { |
$confhash{'defaultquota'}{$1} = $env{$key}; |
$confhash{'defaultquota'}{$1} = $env{$key}; |
} |
} elsif ($key =~ /^form\.authorquota_(.+)$/) { |
if ($key =~ /^form\.\Q$context\E_(.+)$/) { |
$confhash{'authorquota'}{$1} = $env{$key}; |
|
} elsif ($key =~ /^form\.\Q$context\E_(.+)$/) { |
@{$toolshash{$1}} = &Apache::loncommon::get_env_multiple($key); |
@{$toolshash{$1}} = &Apache::loncommon::get_env_multiple($key); |
} |
} |
} |
} |
Line 5747 sub modify_quotas {
|
Line 5766 sub modify_quotas {
|
} |
} |
} else { |
} else { |
$confhash{'defaultquota'}{'default'} = $env{'form.defaultquota'}; |
$confhash{'defaultquota'}{'default'} = $env{'form.defaultquota'}; |
|
$confhash{'authorquota'}{'default'} = $env{'form.authorquota'}; |
} |
} |
foreach my $item (@usertools) { |
foreach my $item (@usertools) { |
foreach my $type (@{$types},'default','_LC_adv') { |
foreach my $type (@{$types},'default','_LC_adv') { |
Line 5834 sub modify_quotas {
|
Line 5854 sub modify_quotas {
|
} |
} |
} |
} |
} |
} |
|
if (ref($domconfig{'quotas'}{'authorquota'}) eq 'HASH') { |
|
foreach my $key (keys(%{$domconfig{'quotas'}{'authorquota'}})) { |
|
if (exists($confhash{'authorquota'}{$key})) { |
|
if ($confhash{'authorquota'}{$key} ne $domconfig{'quotas'}{'authorquota'}{$key}) { |
|
$changes{'authorquota'}{$key} = 1; |
|
} |
|
} else { |
|
$confhash{'authorquota'}{$key} = $domconfig{'quotas'}{'authorquota'}{$key}; |
|
} |
|
} |
|
} |
} |
} |
if (ref($confhash{'defaultquota'}) eq 'HASH') { |
if (ref($confhash{'defaultquota'}) eq 'HASH') { |
foreach my $key (keys(%{$confhash{'defaultquota'}})) { |
foreach my $key (keys(%{$confhash{'defaultquota'}})) { |
Line 5852 sub modify_quotas {
|
Line 5883 sub modify_quotas {
|
} |
} |
} |
} |
} |
} |
|
if (ref($confhash{'authorquota'}) eq 'HASH') { |
|
foreach my $key (keys(%{$confhash{'authorquota'}})) { |
|
if (ref($domconfig{'quotas'}) eq 'HASH') { |
|
if (ref($domconfig{'quotas'}{'authorquota'}) eq 'HASH') { |
|
if (!exists($domconfig{'quotas'}{'authorquota'}{$key})) { |
|
$changes{'authorquota'}{$key} = 1; |
|
} |
|
} else { |
|
$changes{'authorquota'}{$key} = 1; |
|
} |
|
} else { |
|
$changes{'authorquota'}{$key} = 1; |
|
} |
|
} |
|
} |
} |
} |
|
|
if ($context eq 'requestauthor') { |
if ($context eq 'requestauthor') { |
Line 5887 sub modify_quotas {
|
Line 5933 sub modify_quotas {
|
} |
} |
} |
} |
$resulttext .= '</ul></li>'; |
$resulttext .= '</ul></li>'; |
|
} |
|
if (ref($changes{'authorquota'}) eq 'HASH') { |
|
$resulttext .= '<li>'.&mt('Authoring space default quotas').'<ul>'; |
|
foreach my $type (@{$types},'default') { |
|
if (defined($changes{'authorquota'}{$type})) { |
|
my $typetitle = $usertypes->{$type}; |
|
if ($type eq 'default') { |
|
$typetitle = $othertitle; |
|
} |
|
$resulttext .= '<li>'.&mt('[_1] set to [_2] Mb',$typetitle,$confhash{'authorquota'}{$type}).'</li>'; |
|
} |
|
} |
|
$resulttext .= '</ul></li>'; |
} |
} |
} |
} |
my %newenv; |
my %newenv; |