END
+ if ($r->uri eq '/adm/helpdesk') {
+ &print_header($r,$url,'process');
+ }
+ if ($to =~ m/^[^\@]+\@[^\@]+$/) {
+ $r->print('
'.$lt{'asup'}.' '.$to.'
');
} else {
$to = $admin;
if ($to =~ m/^[^\@]+\@[^\@]+$/) {
- $r->print(<
-
- LON-CAPA support request recorded
-
-$bodytag
-
A support request has been sent to $to
-END
+ $r->print('
'.$lt{'asup'}.' '.$to.'
');
} 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
+ $r->print('
+
'.$lt{'warn'}.'
'.
+&mt('As the e-mail address provided for this LON-CAPA server ([_1]) 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.',$to).' '.&mt('Instead a copy has been sent to the LON-CAPA support team at Michigan State University.'));
$to = 'helpdesk@lon-capa.org';
}
}
- if (defined($ENV{'form.email'})) {
- if ($ENV{'form.email'} =~ m/^[^\@]+\@[^\@]+$/) {
- $from = $ENV{'form.email'};
+ if (defined($env{'form.email'})) {
+ if ($env{'form.email'} =~ m/^[^\@]+\@[^\@]+$/) {
+ $from = $env{'form.email'};
}
}
- my $subject = $ENV{'form.subject'};
+ my $subject = $env{'form.subject'};
$subject =~ s#(`)#'#g;
$subject =~ s#\$#\(\$\)#g;
$supportmsg =~ s#(`)#'#g;
@@ -656,23 +810,35 @@ END
my $attachmentpath = '';
my $attachmentsize = '';
- if (defined($ENV{'user.name'})) {
- if ($ENV{'form.screenshot.filename'}) {
- $attachmentsize = length($ENV{'form.screenshot'});
+ if (defined($env{'user.name'})) {
+ if ($env{'form.screenshot.filename'}) {
+ $attachmentsize = length($env{'form.screenshot'});
if ($attachmentsize > 131072) {
- $displaymsg .= " The uploaded screenshot file ($attachmentsize bytes) included with your request exceeded the maximum allowed size - 128 KB, and has therefore been discarded.";
+ $displaymsg .= ' '.&mt('The uploaded screenshot file ([_1] bytes) included with your request exceeded the maximum allowed size - 128 KB, and has therefore been discarded.',$attachmentsize);
} else {
$attachmentpath=&Apache::lonnet::userfileupload('screenshot',undef,'helprequests');
}
}
}
+ my %cookies;
+ my $cookie=CGI::Cookie->parse($r->header_in('Cookie'));
+ if ($$cookie{'lonID'} =~ /lonID=($LONCAPA::handle_re);/) {
+ $cookies{'lonID'} = $1;
+ }
+
if ($attachmentpath =~ m-/([^/]+)$-) {
$fname = $1;
- $displaymsg .= " An uploaded screenshot file - $fname ($attachmentsize bytes) was included in the request sent by $ENV{'user.name'} from LON-CAPA domain: $ENV{'user.domain'}";
+ $displaymsg .= ' '.&mt('An uploaded screenshot file - [_1] ([_2] bytes) was included in the request sent by [_3] from LON-CAPA domain',$fname,$attachmentsize,$env{'user.name'}.': '.$env{'user.domain'});
$supportmsg .= "\n";
- foreach (@envvars) {
- $supportmsg .= "$_: $ENV{$_}\n";
+ foreach my $var (@cookievars) {
+ $supportmsg .= "$var: $cookies{$var}\n";
+ }
+ foreach my $var(@ENVvars) {
+ $supportmsg .= "$var: $ENV{$var}\n";
+ }
+ foreach my $var (@envvars) {
+ $supportmsg .= "$var: $env{$var}\n";
}
}
@@ -693,30 +859,30 @@ END
} else {
my $envdata = '';
- foreach (@envvars) {
- $envdata .= "$_: $ENV{$_}\n";
+ foreach my $var (@cookievars) {
+ $envdata .= "$var: $cookies{$var}\n";
}
- foreach (@loncvars) {
- $envdata .= "$_: $ENV{$_}\n";
+ foreach my $var (@ENVvars) {
+ $envdata .= "$var: $ENV{$var}\n";
+ }
+ foreach my $var (@envvars) {
+ $envdata .= "$var: $env{$var}\n";
+ }
+ foreach my $var (@loncvars) {
+ $envdata .= "$var: $env{$var}\n";
}
$msg->attach(Type => 'TEXT',
Data => $envdata);
}
### Send it:
- # ->send can cause an sh launch which can pass all of %ENV along
- # which can be to large for /bin/sh's little mind
- my %oldENV=%ENV;
- undef(%ENV);
$msg->send('sendmail');
- %ENV=%oldENV;
- undef(%oldENV);
if ($attachmentpath =~ m#$Apache::lonnet::perlvar{'lonDaemons'}/tmp/helprequests/(\d+)/[^/]+#) {
unlink($attachmentpath);
}
$r->print(qq|
- Your support request contained the following information:
|;
+ $getstarttext = ' '.&mt('and the "Getting started" guide').' ';
}
-}
-
-sub javascript_code_selections {
- my ($numcats,$script_tag,$idlist,$idnums,$idlist_titles,$codetitles) = @_;
- my $numtitles = @{$codetitles};
- my @seltitles = ();
- for (my $j=0; $j<$numtitles; $j++) {
- $seltitles[$j] = 'id'.$$codetitles[$j];
- }
- my $seltitle_str = join('","',@seltitles);
- $$script_tag .= <print(<
+
+
+
+
+
+
+
+
END
- my @sort_a = split/","/,$$idlist{$$codetitles[0]};
- for (my $j=0; $j<@sort_a; $j++) {
- $$script_tag .= qq| idsems[$j] = new Array("$$idlist{$$codetitles[1]}{$sort_a[$j]}")\n|;
- $$script_tag .= qq| idsemlongs[$j] = new Array("$$idlist_titles{$$codetitles[1]}{$sort_a[$j]}")\n|;
- $$script_tag .= qq| idcodes[$j] = new Array($$idnums{$$codetitles[1]}{$sort_a[$j]})\n|;
- $$script_tag .= qq| idcourses[$j] = new Array($$idnums{$$codetitles[1]}{$sort_a[$j]})\n|;
- my @sort_b = split/","/,$$idlist{$$codetitles[1]}{$sort_a[$j]};
- for (my $k=0; $k<@sort_b; $k++) {
- my $idcode_entry = $$idlist{$$codetitles[2]}{$sort_a[$j]}{$sort_b[$k]};
- $$script_tag .= qq| idcodes[$j][$k] = new Array("$idcode_entry")\n|;
- $$script_tag .= qq| idcourses[$j][$k] = new Array($$idnums{$$codetitles[2]}{$sort_a[$j]}{$sort_b[$k]})\n|;
- my @sort_c = split/","/,$$idlist{$$codetitles[2]}{$sort_a[$j]}{$sort_b[$k]};
- for (my $l=0; $l<@sort_c; $l++) {
- my $idcourse_entry = $$idlist{$$codetitles[3]}{$sort_a[$j]}{$sort_b[$k]}{$sort_c[$l]};
- $$script_tag .= qq| idcourses[$j][$k][$l] = new Array("$idcourse_entry")\n|;
- }
- }
+ unless ($action eq 'process') {
+ $r->print('
+
+
'.&mt('
+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').'.