@@ -1801,10 +1816,17 @@ sub check_for_upload {
sub upload {
my ($r,$url,$group)=@_;
my $fname=&Apache::lonnet::clean_filename($env{'form.uploaddoc.filename'});
-
- my ($state,$msg) = &check_for_upload($env{'form.currentpath'},
- $fname,$group,'uploaddoc');
-
+ my $disk_quota = &get_quota($group);
+ my $portfolio_root = &get_portfolio_root();
+ my $port_path = &get_port_path();
+ my ($uname,$udom) = &get_name_dom($group);
+ my $getpropath = 1;
+ my $current_disk_usage = &Apache::lonnet::diskusage($udom,$uname,$portfolio_root,$getpropath);
+ my ($state,$msg) =
+ &Apache::loncommon::check_for_upload($env{'form.currentpath'},$fname,
+ $group,'uploaddoc',$portfolio_root,
+ $port_path,$disk_quota,
+ $current_disk_usage,$uname,$udom);
if ($state eq 'will_exceed_quota'
|| $state eq 'file_locked'
|| $state eq 'file_exists' ) {
@@ -1812,11 +1834,11 @@ sub upload {
return;
}
- my $port_path = &get_port_path();
my (%allfiles,%codebase,$mode);
if ($env{'form.uploaddoc.filename'} =~ m/(\.htm|\.html|\.shtml)$/i) {
- $mode = 'parse';
-
+ if ($env{'form.parserflag'}) {
+ $mode = 'parse';
+ }
}
my $result=
&Apache::lonnet::userfileupload('uploaddoc','',
@@ -1828,73 +1850,27 @@ sub upload {
$r->print(&done('Back',$url));
} else {
if (%allfiles) {
- my $state = <
STATE
- $r->print("
".&mt("Reference Warning")."
");
- $r->print("
".&mt("Completed upload of the file. This file contained references to other files. You must upload the referenced files or else the uploaded file may not work properly.")."
");
- $r->print("
".&mt("Please select the locations from which the referenced files are to be uploaded.")."
".&mt("Completed upload of the file. This file contained references to other files. You must upload the referenced files or else the uploaded file may not work properly.")."
");
+ $r->print("
".&mt("Please select the locations from which the referenced files are to be uploaded.")."