--- loncom/interface/londocs.pm 2005/06/29 18:36:41 1.193 +++ loncom/interface/londocs.pm 2005/07/24 19:31:00 1.194 @@ -1,7 +1,7 @@ # The LearningOnline Network # Documents # -# $Id: londocs.pm,v 1.193 2005/06/29 18:36:41 albertel Exp $ +# $Id: londocs.pm,v 1.194 2005/07/24 19:31:00 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1175,7 +1175,7 @@ FOLDERINFO } sub process_file_upload { - my ($upload_output,$coursenum,$coursedom,$allfiles,$codebase) = @_; + my ($upload_output,$coursenum,$coursedom,$allfiles,$codebase,$uploadcmd) = @_; # upload a file, if present my $parseaction; if ($env{'form.parserflag'}) { @@ -1183,10 +1183,10 @@ sub process_file_upload { } my $phase_status; my $folder=$env{'form.folder'}; - if ($folder eq '' || $folder eq 'supplemental') { + if ($folder eq '') { $folder='default'; } - if ( ($folder=~/^$1/) || ($1 eq 'default') ) { + if ( ($folder=~/^$uploadcmd/) || ($uploadcmd eq 'default') ) { my $errtext=''; my $fatal=0; my $container='sequence'; @@ -1203,10 +1203,13 @@ sub process_file_upload { return 'failed'; } my $destination = 'docs/'; - if ($folder eq 'default') { + if ($folder =~ /^supplemental/) { + $destination = 'supplemental/'; + } + if (($folder eq 'default') || ($folder eq 'supplemental')) { $destination .= 'default/'; - } elsif ($folder =~ /^default_(\d+)$/) { - $destination .= $1.'/'; + } elsif ($folder =~ /^(default|supplemental)_(\d+)$/) { + $destination .= $2.'/'; } # this is for a course, not a user, so set coursedoc flag # probably the only place in the system where this should be "1" @@ -2256,7 +2259,7 @@ ENDNEWSCRIPT # Process file upload - phase one - upload and parse primary file. $upload_result = &process_file_upload(\$upload_output,$coursenum, $coursedom,\%allfiles, - \%codebase); + \%codebase,$1); if ($upload_result eq 'phasetwo') { $r->print($upload_output); }