--- loncom/cgi/quotacheck.pl 2014/03/17 02:37:13 1.1 +++ loncom/cgi/quotacheck.pl 2014/07/31 15:45:31 1.4 @@ -6,7 +6,7 @@ $|=1; # requested domain, or current server should belong to requested # domain. # -# $Id: quotacheck.pl,v 1.1 2014/03/17 02:37:13 raeburn Exp $ +# $Id: quotacheck.pl,v 1.4 2014/07/31 15:45:31 musolffc Exp $ # # Copyright Michigan State University Board of Trustees # @@ -51,6 +51,8 @@ if (ref($perlvar) eq 'HASH') { } undef($perlvar); +my $script = "/cgi-bin/quotacheck.pl"; + print &LONCAPA::loncgi::cgi_header('text/html',1); &main($lonhost); @@ -59,7 +61,7 @@ sub main { if ($lonhost eq '') { &Apache::lonlocal::get_language_handle(); &Apache::lonhtmlcommon::add_breadcrumb - ({href=>"/cgi-bin/quotacheck.pl", + ({href=>$script, text=>"Content disk usage"}); print(&Apache::loncommon::start_page('Course/Community disk usage and quotas'). &Apache::lonhtmlcommon::breadcrumbs('Course/Community status'). @@ -121,15 +123,18 @@ sub main { &Apache::lonlocal::get_language_handle(); &Apache::lonhtmlcommon::add_breadcrumb - ({href=>"/cgi-bin/quotacheck.pl?domain=$reqdom", + ({href=>$script."?domain=$reqdom", text=>"Content disk usage"}); if ($params{'gosearch'}) { &Apache::lonhtmlcommon::add_breadcrumb - ({href=>"/cgi-bin/quotacheck.pl?domain=$reqdom", + ({href=>$script."?domain=$reqdom", text=>"Result"}); } my $domdesc = &Apache::lonnet::domain($reqdom,'description'); - print(&Apache::loncommon::start_page('Course/Community disk usage and quotas'). + my $starthash = { + add_entries => {'onload' => "javascript:courseSet(document.filterpicker.official, 'load');"}, + }; + print(&Apache::loncommon::start_page('Course/Community disk usage and quotas', undef, $starthash). &Apache::lonhtmlcommon::breadcrumbs('Course/Community status'). '

'.&Apache::lonlocal::mt('Quotas for uploaded course content').'

'. '

'.$domdesc.'

'); @@ -158,7 +163,7 @@ sub main { $Apache::lonnet::env{'form.state'} = $params{'state'}; } print(&Apache::loncommon::build_filters($filterlist,$crstype,undef,undef,$filter, - '/cgi-bin/quotacheck.pl',\$numtitles, + $script,\$numtitles, 'quotacheck',undef,undef,undef, \@codetitles,$reqdom,'quotacheck',$reqdom)); if ($params{'gosearch'}) { @@ -197,7 +202,7 @@ sub print_usage { '

'."\n". '

'. &Apache::lonlocal::mt('Show quotas for the domain being coordinated: [_1]', - ''. + ''. $otherdomdesc.''). '

'); return; @@ -280,6 +285,7 @@ sub print_usage { foreach my $subdir ('docs','supplemental') { $current_disk_usage += &Apache::lonnet::diskusage($dom,$cnum,"userfiles/$subdir",1); } + $current_disk_usage=int($current_disk_usage/1024); } my $percent; if (($quota == 0) || ($quota =~ /[^\d\.]/)) {