--- loncom/imspackages/imsimportdocs.pm 2004/03/16 19:20:58 1.3 +++ loncom/imspackages/imsimportdocs.pm 2004/04/08 09:19:39 1.6 @@ -44,8 +44,8 @@ function setOptions(caller,itemnum) { if (caller == "board") { opForm.elements[menu].options[0] = new Option("Select","-1",true,true) opForm.elements[menu].options[1] = new Option("Import topics only","topics",true,true) - opForm.elements[menu].options[2] = new Option("Import topics & posts (with author)","allpost",true,true) - opForm.elements[menu].options[3] = new Option("Import topics & posts (no author)","allanon",true,true) + opForm.elements[menu].options[2] = new Option("Import topics + posts (with author)","allpost",true,true) + opForm.elements[menu].options[3] = new Option("Import topics + posts (no author)","allanon",true,true) } else { if (caller == "users") { @@ -505,7 +505,6 @@ sub display_three { my $timenow = time; my $destdir = $Apache::lonnet::perlvar{'lonDocRoot'}.'/userfiles/'.$cdom.'/'.$crs.'/'.$timenow; - my $dirname = $cdom.'/'.$crs.'/'.$timenow; my $seqstem = "/uploaded/$cdom/$crs/$timenow"; my $db_handling = ''; my $user_handling = ''; @@ -539,6 +538,20 @@ sub display_three { my $manifest_result = &Apache::imsprocessor::process_manifest($cms,$tempdir,\%resources,\%items,\%hrefs,\%resinfo); if ($manifest_result eq 'ok') { + my @path = ($cdom,$crs,$timenow); + my $fullpath = $Apache::lonnet::perlvar{'lonDocRoot'}.'/userfiles'; + foreach my $item (@path) { + $fullpath .= '/'.$item; + if (!-e "$fullpath") { + mkdir("$fullpath",0770); + } + } + my @namedirs = ("resfiles","sequences","pages","problems"); + foreach my $name (@namedirs) { + if (!-e "$fullpath/$name") { + mkdir("$fullpath/$name",0770); + } + } &Apache::imsprocessor::target_resources(\%resources,\%imports,\@targets); my $copy_result = &Apache::imsprocessor::copy_resources('DOCS',$cms,\%hrefs,$tempdir,\@targets,\%urls,$crs,$cdom,$chome,$destdir,$timenow); @@ -553,7 +566,7 @@ sub display_three { my @topurls = (); my @topnames = (); - &Apache::imsprocessor::process_resinfo($cms,$tempdir,$destdir,\%items,\%resources,\@boards,\@announcements,\@quizzes,\@surveys,\@groups,\%messages,\@timestamp,\%boardnum,\%resinfo,$udom,$uname,$cdom,$crs,$db_handling,$user_handling,\%total,$dirname,$seqstem,\@resrcfiles); + &Apache::imsprocessor::process_resinfo($cms,'DOCS',$tempdir,$destdir,\%items,\%resources,\@boards,\@announcements,\@quizzes,\@surveys,\@groups,\%messages,\@timestamp,\%boardnum,\%resinfo,$udom,$uname,$cdom,$crs,$db_handling,$user_handling,\%total,$seqstem,$seqstem,\@resrcfiles); &Apache::imsprocessor::build_structure($cms,'DOCS',$destdir,\%items,\%resinfo,\%resources,\%hrefs,$udom,$uname,'',$timenow,$cdom,$crs,\@timestamp,\%total,\@boards,\@announcements,\@quizzes,\@surveys,\%boardnum,\@pages,\@sequences,\@topurls,\@topnames);