version 1.29, 2005/10/13 17:18:14
|
version 1.36, 2006/07/11 15:37:59
|
Line 35 use Apache::Constants qw(:common);
|
Line 35 use Apache::Constants qw(:common);
|
use Apache::loncommon(); |
use Apache::loncommon(); |
use Apache::lonnet; |
use Apache::lonnet; |
use Apache::lonlocal; |
use Apache::lonlocal; |
|
use Apache::lonacc(); |
|
use lib '/home/httpd/lib/perl/'; |
|
use LONCAPA; |
|
|
|
|
sub handler { |
sub handler { |
my ($r) = @_; |
my ($r) = @_; |
Line 46 sub handler {
|
Line 50 sub handler {
|
} |
} |
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['origurl','function']); |
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['origurl','function']); |
if ($r->uri eq '/adm/helpdesk') { |
if ($r->uri eq '/adm/helpdesk') { |
&Apache::loncommon::get_posted_cgi($r); |
&Apache::lonacc::get_posted_cgi($r); |
} |
} |
my $function = $env{'form.function'}; |
my $function = $env{'form.function'}; |
my $origurl = &Apache::lonnet::unescape($env{'form.origurl'}); |
my $origurl = &unescape($env{'form.origurl'}); |
my $action = $env{'form.action'}; |
my $action = $env{'form.action'}; |
|
|
if ($action eq 'process') { |
if ($action eq 'process') { |
Line 63 sub handler {
|
Line 67 sub handler {
|
sub print_request_form { |
sub print_request_form { |
my ($r,$origurl,$function) = @_; |
my ($r,$origurl,$function) = @_; |
my ($os,$browser,$bversion,$uhost,$uname,$udom,$uhome,$urole,$usec,$email,$cid,$cdom,$cnum,$ctitle,$ccode,$sectionlist,$lastname,$firstname,$server,$formname); |
my ($os,$browser,$bversion,$uhost,$uname,$udom,$uhome,$urole,$usec,$email,$cid,$cdom,$cnum,$ctitle,$ccode,$sectionlist,$lastname,$firstname,$server,$formname); |
my $bodytag = &Apache::loncommon::bodytag('',$function,'topmargin="0" marginheight="0" onLoad="initialize_codes()"',1); |
|
my $tablecolor = &Apache::loncommon::designparm($function.'.tabbg'); |
my $tablecolor = &Apache::loncommon::designparm($function.'.tabbg'); |
if (($tablecolor eq '') || ($tablecolor eq '#FFFFFF')) { |
if (($tablecolor eq '') || ($tablecolor eq '#FFFFFF')) { |
$tablecolor = '#EEEE99'; |
$tablecolor = '#EEEE99'; |
Line 98 function validmail(field) {
|
Line 101 function validmail(field) {
|
var str = field.value; |
var str = field.value; |
if (window.RegExp) { |
if (window.RegExp) { |
var reg1str = "(@.*@)|(\\.\\.)|(@\\.)|(\\.@)|(^\\.)"; |
var reg1str = "(@.*@)|(\\.\\.)|(@\\.)|(\\.@)|(^\\.)"; |
var reg2str = "^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$"; |
var reg2str = "^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$"; //" |
var reg1 = new RegExp(reg1str); |
var reg1 = new RegExp(reg1str); |
var reg2 = new RegExp(reg2str); |
var reg2 = new RegExp(reg2str); |
if (!reg1.test(str) && reg2.test(str)) { |
if (!reg1.test(str) && reg2.test(str)) { |
Line 115 function validmail(field) {
|
Line 118 function validmail(field) {
|
} |
} |
} |
} |
END |
END |
#" stupid emacs |
|
if ($cid =~ m/_/) { |
if ($cid =~ m/_/) { |
($cdom,$cnum) = split/_/,$cid; |
($cdom,$cnum) = split/_/,$cid; |
} |
} |
Line 195 function initialize_codes() {
|
Line 198 function initialize_codes() {
|
} |
} |
} |
} |
} |
} |
my $html=&Apache::lonxml::xmlbegin(); |
|
$r->print(<<ENDHEAD); |
my $js = '<script type"text/javascript">'."\n$scripttag\n$jscript\n". |
$html |
'</script>'; |
<head> |
my %add_entries = (topmargin => "0", |
<title>LON-CAPA support request</title> |
marginheight => "0", |
<script type"text/javascript"> |
onLoad =>"initialize_codes()",); |
$scripttag |
|
$jscript |
my $start_page = |
</script> |
&Apache::loncommon::start_page('Support Request',$js, |
</head> |
{ 'function' => $function, |
$bodytag |
'add_entries' => \%add_entries, |
ENDHEAD |
'only_body' => 1,}); |
|
$r->print($start_page); |
|
|
if ($r->uri eq '/adm/helpdesk') { |
if ($r->uri eq '/adm/helpdesk') { |
&print_header($r,$origurl); |
&print_header($r,$origurl); |
} |
} |
Line 595 END
|
Line 600 END
|
</tr> |
</tr> |
END |
END |
} |
} |
|
|
$r->print(<<END); |
$r->print(<<END); |
<tr> |
<tr> |
<td width="140" bgcolor="$tablecolor"> |
<td width="140" bgcolor="$tablecolor"> |
Line 631 END
|
Line 637 END
|
</tr> |
</tr> |
</table> |
</table> |
</form> |
</form> |
</body> |
|
</html> |
|
END |
END |
|
$r->print(&Apache::loncommon::end_page()); |
return; |
return; |
} |
} |
|
|
Line 644 sub print_request_receipt {
|
Line 649 sub print_request_receipt {
|
my @loncvars = ('user.name','user.domain','request.course.sec','request.course.id'); |
my @loncvars = ('user.name','user.domain','request.course.sec','request.course.id'); |
my @cookievars = ('lonID'); |
my @cookievars = ('lonID'); |
|
|
my $bodytag = &Apache::loncommon::bodytag('',$function,'topmargin="0" marginheight="0"',1); |
|
my $admin = $Apache::lonnet::perlvar{'lonAdminMail'}; |
my $admin = $Apache::lonnet::perlvar{'lonAdminMail'}; |
my $to = $Apache::lonnet::perlvar{'lonSupportEMail'}; |
my $to = $Apache::lonnet::perlvar{'lonSupportEMail'}; |
my $from = $admin; |
my $from = $admin; |
Line 695 Date/Time: $reporttime
|
Line 699 Date/Time: $reporttime
|
<font color="$fontcolor">URL: </font><font color="$vlinkcolor">$env{'form.sourceurl'}</font><br /> |
<font color="$fontcolor">URL: </font><font color="$vlinkcolor">$env{'form.sourceurl'}</font><br /> |
<font color="$fontcolor">Date/Time: </font><font color="$vlinkcolor">$reporttime</font><br /> |
<font color="$fontcolor">Date/Time: </font><font color="$vlinkcolor">$reporttime</font><br /> |
|; |
|; |
my $html=&Apache::lonxml::xmlbegin(); |
|
|
my $start_page = |
|
&Apache::loncommon::start_page('Support request recorded',undef, |
|
{'function' => $function, |
|
'add_entries' => { |
|
topmargin => "0", |
|
marginheight => "0", |
|
}, |
|
'only_body' => 1,}); |
|
|
$r->print(<<"END"); |
$r->print(<<"END"); |
$html |
$start_page |
<head> |
|
<title>LON-CAPA support request recorded</title> |
|
</head> |
|
$bodytag |
|
<form name="logproblem"> |
<form name="logproblem"> |
<input type="hidden" name="action" value="result" /> |
<input type="hidden" name="action" value="result" /> |
</form> |
</form> |
Line 891 END
|
Line 900 END
|
</td> |
</td> |
</tr> |
</tr> |
</table> |
</table> |
</body> |
|
</html> |
|
"); |
"); |
|
$r->print(&Apache::loncommon::end_page()); |
} |
} |
|
|
sub print_header { |
sub print_header { |
Line 968 Please review the information in "Log-in
|
Line 976 Please review the information in "Log-in
|
|
|
sub retrieve_instcodes { |
sub retrieve_instcodes { |
my ($coursecodes,$codedom,$totcodes) = @_; |
my ($coursecodes,$codedom,$totcodes) = @_; |
my %courses = &Apache::lonnet::courseiddump($codedom,'.',1,'.','.','.'); |
my %courses = &Apache::lonnet::courseiddump($codedom,'.',1,'.','.','.', |
|
undef,undef,'Course'); |
foreach my $course (keys %courses) { |
foreach my $course (keys %courses) { |
if ($courses{$course} =~ m/^[^:]*:([^:]+)/) { |
if ($courses{$course} =~ m/^[^:]*:([^:]+)/) { |
$$coursecodes{$course} = &Apache::lonnet::unescape($1); |
$$coursecodes{$course} = &unescape($1); |
$totcodes ++; |
$totcodes ++; |
} |
} |
} |
} |