--- loncom/interface/lonsupportreq.pm 2004/12/18 22:21:52 1.12 +++ loncom/interface/lonsupportreq.pm 2004/12/20 19:58:41 1.16 @@ -39,7 +39,7 @@ sub print_request_form { my $bodytag = &Apache::loncommon::bodytag('',$function,'topmargin="0",marginheight="0"',1); my $tablecolor = &Apache::loncommon::designparm($function.'.tabbg'); if (($tablecolor eq '') || ($tablecolor eq '#FFFFFF')) { - $tablecolor = '#CCCCFF'; + $tablecolor = '#EEEE99'; } $ccode = ''; $os = $ENV{'browser.os'}; @@ -53,14 +53,35 @@ sub print_request_form { $usec = $ENV{'request.course.sec'}; $cid = $ENV{'request.course.id'}; $server = $ENV{'SERVER_NAME'}; - my $scripttag = (<= 0) { + return true; + } + return false; + } +} END if ($cid =~ m/_/) { ($cdom,$cnum) = split/_/,$cid; @@ -127,7 +148,7 @@ END &javascript_code_selections($numtypes,\$jscript,\%idlist,\%idnums,\%idlist_titles,\@codetitles); } } - $r->print(<print(< LON-CAPA support request @@ -137,6 +158,12 @@ $jscript $bodytag +ENDHEAD + if ($r->uri eq '/adm/helpdesk') { + &print_header($r,$origurl); + } + $r->print(<<"END"); +
@@ -147,7 +174,6 @@ $bodytag
-
@@ -175,6 +201,7 @@ END $r->print('
'); } $r->print(< 
@@ -237,7 +264,7 @@ END } if ($udomform eq '') { $udomform = 'domain: '; - $udomform .= &Apache::loncommon::select_dom_form('','udom'); + $udomform .= &Apache::loncommon::select_dom_form($defdom,'udom'); } if ($unameform eq '') { $unameform= 'username  '; @@ -268,7 +295,7 @@ END
- http://$server$origurl + http://$server$origurl
@@ -519,7 +546,7 @@ END
-   +     @@ -539,6 +566,9 @@ END
+ + + END return; } @@ -556,7 +586,7 @@ sub print_request_receipt { my $fontcolor = &Apache::loncommon::designparm($function.'.font'); my $vlinkcolor = &Apache::loncommon::designparm($function.'.vlink'); my $tablecolor = &Apache::loncommon::designparm($function.'.tabbg'); - my @formvars = ('username','email','uname','udom','origurl','phone','section','coursecode','title','subject','description','screenshot'); + my @formvars = ('username','email','uname','udom','sourceurl','phone','section','coursecode','title','subject','description','screenshot'); &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},\@formvars); my $supportmsg = qq| @@ -567,7 +597,7 @@ Tel: $ENV{'form.phone'} Course Information: $ENV{'form.title'} - $ENV{'form.coursecode'} - section: $ENV{'form.section'} Subject: $ENV{'form.subject'} Description: $ENV{'form.description'} -URL: $ENV{'form.origurl'} +URL: $ENV{'form.sourceurl'} Date/Time: $reporttime |; @@ -581,37 +611,31 @@ Date/Time: $reporttime Course Information: $ENV{'form.title'} - $ENV{'form.coursecode'} - section: $ENV{'form.section'}
Subject: $ENV{'form.subject'}
Description: $descrip
-URL: $ENV{'form.origurl'}
+URL: $ENV{'form.sourceurl'}
Date/Time: $reporttime
|; - - if ($to =~ m/^[^\@]+\@[^\@]+$/) { - $r->print(<print(<<"END"); LON-CAPA support request recorded $bodytag -

A support request has been sent to $to

+
+ +
END + if ($r->uri eq '/adm/helpdesk') { + &print_header($r,$url,'process'); + } + if ($to =~ m/^[^\@]+\@[^\@]+$/) { + $r->print("

A support request has been sent to $to

"); } else { $to = $admin; if ($to =~ m/^[^\@]+\@[^\@]+$/) { - $r->print(< - - LON-CAPA support request recorded - -$bodytag -

A support request has been sent to $to

+ $r->print("

A support request has been sent to $to

"); END } else { $r->print(< - - LON-CAPA support request recorded - -$bodytag

Warning: Problem with support e-mail address

As the e-mail address provided for this LON-CAPA server ($to) does not appear to be a valid e-mail address, your support request has not been sent to the LON-CAPA support staff or administrator at your institution. Instead a copy has been sent to the LON-CAPA support team at Michigan State University. END @@ -763,9 +787,77 @@ END
+ + "); } +sub print_header { + my ($r,$origurl,$action) = @_; + my $location=&Apache::loncommon::lonhttpdurl("/adm"); + my $tablecolor = '#EEEE99'; + my ($component_url); + my $helpdesk_link = ''; + if ($action eq 'process') { + $helpdesk_link = ''; + } + my %lt = &Apache::lonlocal::texthash ( + login => 'Log-in help', + ask => 'Ask helpdesk', + getst => 'Getting started guide', + back => 'Back to last location' + ); + $r->print(<   + +
  LON-CAPA help/support + + + + +
+ + + + +
+ + + + +
+ + + + + + + +
(Login help) $lt{'login'} $helpdesk_link(Ask helpdesk) $lt{'ask'}  $lt{'getst'} (Back to last location) $lt{'back'} 
+
+
+
+
+ +   + + +   + +END + unless ($action eq 'process') { + $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').'.

+ + '); + } + $r->print(' +'); + return; +} + sub retrieve_instcodes { my ($coursecodes,$codedom,$totcodes) = @_; my %courses = &Apache::lonnet::courseiddump($codedom,'.',1,'.','.'); @@ -983,10 +1075,10 @@ sub javascript_code_selections { function courseSet(caller) { var ids = new Array ("$seltitle_str"); var formitems = new Array ($numtitles); - var idyr = document.forms.logproblem.Year.selectedIndex - var idsem = document.forms.logproblem.Semester.selectedIndex - var iddept = document.forms.logproblem.Department.selectedIndex - var idclass = document.forms.logproblem.Number.selectedIndex + var idyr = document.logproblem.Year.selectedIndex + var idsem = document.logproblem.Semester.selectedIndex + var iddept = document.logproblem.Department.selectedIndex + var idclass = document.logproblem.Number.selectedIndex var idyears = new Array("$$idlist{$$codetitles[0]}"); var idsems = new Array ($$idnums{$$codetitles[0]}); var idsemlongs = new Array ($$idnums{$$codetitles[0]}); @@ -1013,51 +1105,51 @@ END } $$script_tag .= (<