--- loncom/interface/lonmodifycourse.pm 2013/03/01 05:01:26 1.60
+++ loncom/interface/lonmodifycourse.pm 2014/01/15 18:47:56 1.66
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# handler for DC-only modifiable course settings
#
-# $Id: lonmodifycourse.pm,v 1.60 2013/03/01 05:01:26 raeburn Exp $
+# $Id: lonmodifycourse.pm,v 1.66 2014/01/15 18:47:56 bisitz Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -219,20 +219,22 @@ sub print_course_selection_page {
sub print_modification_menu {
my ($r,$cdesc,$domdesc,$dom,$type) = @_;
&print_header($r,$type);
- my ($ccrole,$categorytitle,$setquota_text,$setparams_text,$cat_text);
+ my ($ccrole,$categorytitle,$setquota_text,$setuploadquota_text,$setparams_text,$cat_text);
if ($type eq 'Community') {
$ccrole = 'co';
} else {
$ccrole = 'cc';
- }
+ }
if ($type eq 'Community') {
$categorytitle = 'View/Modify Community Settings';
$setquota_text = &mt('Total disk space allocated for storage of portfolio files in all groups in a community.');
+ $setuploadquota_text = &mt('Disk space allocated for storage of content uploaded directly to a community via Content Editor.');
$setparams_text = 'View/Modify community owner';
$cat_text = 'View/Modify catalog settings for community';
} else {
$categorytitle = 'View/Modify Course Settings';
$setquota_text = &mt('Total disk space allocated for storage of portfolio files in all groups in a course.');
+ $setuploadquota_text = &mt('Disk space allocated for storage of content uploaded directly to a course via Content Editor.');
if (&showcredits($dom)) {
$setparams_text = 'View/Modify course owner, institutional code, and default authentication and credits';
} else {
@@ -261,7 +263,7 @@ sub print_modification_menu {
linktitle => ''
},
{
- linktext => 'View/Modify quota for group portfolio files',
+ linktext => 'View/Modify quotas for group portfolio files, and for uploaded content.',
url => &phaseurl('setquota'),
permission => 1,
#help => '',
@@ -317,6 +319,7 @@ sub print_modification_menu {
}
}
$menu_html .= '
'.$setquota_text.'
'.
+ '
'.$setuploadquota_text.'
'.
'
'.$anon_text.'
'."\n";
foreach my $item (@additional_params) {
if ($type eq 'Community') {
@@ -420,28 +423,57 @@ sub print_settings_display {
sub print_setquota {
my ($r,$cdom,$cnum,$cdesc,$type) = @_;
+ my $lctype = lc($type);
+ my $headline = &mt("Set disk space quotas for $lctype: [_1]",
+ ''.$cdesc.'');
my %lt = &Apache::lonlocal::texthash(
- 'cquo' => 'Disk space for storage of group portfolio files for:',
- 'gpqu' => 'Course portfolio files disk space',
+ 'gpqu' => 'Disk space for storage of group portfolio files',
+ 'upqu' => 'Disk space for storage of content directly uploaded to course via Content Editor',
'modi' => 'Save',
'back' => 'Pick another action',
);
- if ($type eq 'Community') {
- $lt{'gpqu'} = &mt('Community portfolio files disk space');
- }
- my %settings = &Apache::lonnet::get('environment',['internal.coursequota'],$cdom,$cnum);
+ my %staticdefaults = (
+ coursequota => 20,
+ uploadquota => 500,
+ );
+ my %settings = &Apache::lonnet::get('environment',['internal.coursequota','internal.uploadquota','internal.instcode'],
+ $cdom,$cnum);
my $coursequota = $settings{'internal.coursequota'};
+ my $uploadquota = $settings{'internal.uploadquota'};
if ($coursequota eq '') {
- $coursequota = 20;
+ $coursequota = $staticdefaults{'coursequota'};
+ }
+ if ($uploadquota eq '') {
+ my %domdefs = &Apache::lonnet::get_domain_defaults($cdom);
+ if ($type eq 'Community') {
+ $uploadquota = $domdefs{$lctype.'quota'};
+ } elsif ($settings{'internal.instcode'}) {
+ $uploadquota = $domdefs{'officialquota'};
+ } elsif ($settings{'internal.textbook'}) {
+ $uploadquota = $domdefs{'textbookquota'};
+ } else {
+ $uploadquota = $domdefs{'unofficialquota'};
+ }
+ if ($uploadquota eq '') {
+ $uploadquota = $staticdefaults{'uploadquota'};
+ }
}
&print_header($r,$type);
my $hidden_elements = &hidden_form_elements();
- my $helpitem = &Apache::loncommon::help_open_topic('Modify_Course_Quota');
+ my $porthelpitem = &Apache::loncommon::help_open_topic('Modify_Course_Quota');
+ my $uploadhelpitem = &Apache::loncommon::help_open_topic('Modify_Course_Upload_Quota');
$r->print(<
-