--- loncom/interface/lonsupportreq.pm 2004/12/30 21:16:38 1.20 +++ loncom/interface/lonsupportreq.pm 2004/12/31 20:29:27 1.22 @@ -36,7 +36,7 @@ sub handler { sub print_request_form { my ($r,$origurl,$function) = @_; my ($os,$browser,$bversion,$uhost,$uname,$udom,$uhome,$urole,$usec,$email,$cid,$cdom,$cnum,$ctitle,$ccode,$sectionlist,$lastname,$firstname,$server); - my $bodytag = &Apache::loncommon::bodytag('',$function,'topmargin="0",marginheight="0"',1); + my $bodytag = &Apache::loncommon::bodytag('',$function,'topmargin="0" marginheight="0" onLoad="initialize_codes()"',1); my $tablecolor = &Apache::loncommon::designparm($function.'.tabbg'); if (($tablecolor eq '') || ($tablecolor eq '#FFFFFF')) { $tablecolor = '#EEEE99'; @@ -52,7 +52,11 @@ sub print_request_form { $urole = $ENV{'request.role'}; $usec = $ENV{'request.course.sec'}; $cid = $ENV{'request.course.id'}; - $server = $ENV{'SERVER_NAME'}; + if ($origurl =~ m-^http://-) { + $server = $origurl; + } else { + $server = 'http://'.$ENV{'SERVER_NAME'}.$origurl; + } my $scripttag = (<<'END'); function validate() { if (validmail(document.logproblem.email) == false) { @@ -115,6 +119,10 @@ END if (exists($ENV{'form.codedom'})) { $codedom = $ENV{'form.codedom'}; } + my $details_title; + if ($codedom) { + $details_title = '
('.$codedom.')'; + } my %coursecodes = (); my %codes = (); my @codetitles = (); @@ -127,7 +135,11 @@ END my $totcodes = 0; my $format_reply; my $jscript = ''; - + my $loaditems = qq| +function initialize_codes() { + return; +} + |; if ($cdom) { $codedom = $cdom; } @@ -144,11 +156,14 @@ END $totcodes = &retrieve_instcodes(\%coursecodes,$codedom,$totcodes); } if ($totcodes > 0) { - $format_reply = &Apache::lonnet::auto_instcode_format($caller,$codedom,\%coursecodes,\%codes,\@codetitles,\%cat_titles,\%cat_order); if ($ccode eq '') { - my $numtypes = @codetitles; - &build_code_selections(\%codes,\@codetitles,\%cat_titles,\%cat_order,\%idlist,\%idnums,\%idlist_titles); - &javascript_code_selections($numtypes,\%cat_titles,\$jscript,\%idlist,\%idnums,\%idlist_titles,\@codetitles); + $format_reply = &Apache::lonnet::auto_instcode_format($caller,$codedom,\%coursecodes,\%codes,\@codetitles,\%cat_titles,\%cat_order); + if ($format_reply eq 'ok') { + my $numtypes = @codetitles; + &build_code_selections(\%codes,\@codetitles,\%cat_titles,\%cat_order,\%idlist,\%idnums,\%idlist_titles); + &javascript_code_selections($numtypes,\%cat_titles,\$jscript,\%idlist,\%idnums,\%idlist_titles,\@codetitles); + $loaditems = ''; + } } } $r->print(< - http://$server$origurl + $server @@ -337,7 +352,7 @@ END -
Course Details: + Course Details:$details_title
@@ -384,6 +399,11 @@ END } else { $longitems[0] = $idlist_titles{$codetitles[0]}; } + for (my $i=0; $i<@longitems; $i++) { + if ($longitems[$i] eq '') { + $longitems[$i] = $items[$i]; + } + } } else { @longitems = @items; } @@ -444,12 +464,13 @@ END END if ($sectionlist) { - $r->print("". + " \n"); foreach (sort keys %groupid) { if ($_ eq $groupid{$_} || $groupid{$_} eq '') { - $r->print("\n"); } else { - $r->print("\n"); } } $r->print(""); @@ -834,7 +855,12 @@ sub print_header { ask => 'Ask helpdesk', getst => 'Getting started guide', back => 'Back to last location' - ); + ); + my ($getstartlink,$getstarttext); + if (-e $Apache::lonnet::perlvar{'lonDocRoot'}.'/adm/gettingstarted.html') { + $getstartlink = qq| $lt{'getst'}|; + $getstarttext = ' '.&mt('and the "Getting started" guide').' '; + } $r->print(<   @@ -851,8 +877,7 @@ sub print_header { - - + $getstartlink
(Login help) $lt{'login'} $helpdesk_link(Ask helpdesk) $lt{'ask'}  $lt{'getst'} $helpdesk_link(Ask helpdesk) $lt{'ask'}  (Back to last location) $lt{'back'} 
@@ -877,7 +902,7 @@ END $r->print(' '.&mt(' -Please read the "Log-in help" and "Getting started guide" if you can not log-in').'. '.&mt('If your problem is still unresolved, the form below can be used to send a question to the LON-CAPA helpdesk').'.
'.&mt('Note').': '.&mt('Student questions about course content should be directed to the course instructor').'.

+Please review the information in "Log-in help"').$getstarttext.' '.&mt('if you are unable to log-in').'. '.&mt('If your problem is still unresolved, the form below can be used to send a question to the LON-CAPA helpdesk').'.
'.&mt('Note').': '.&mt('Student questions about course content should be directed to the course instructor').'.

'); } @@ -1194,6 +1219,22 @@ END } } $$script_tag .= (<