--- loncom/interface/lonsupportreq.pm 2014/01/17 17:08:04 1.76
+++ loncom/interface/lonsupportreq.pm 2015/06/23 02:42:34 1.81
@@ -1,5 +1,5 @@
#
-# $Id: lonsupportreq.pm,v 1.76 2014/01/17 17:08:04 bisitz Exp $
+# $Id: lonsupportreq.pm,v 1.81 2015/06/23 02:42:34 musolffc Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -27,8 +27,6 @@
package Apache::lonsupportreq;
use strict;
-use MIME::Types;
-use MIME::Lite;
use CGI::Cookie();
use Apache::Constants qw(:common);
use Apache::loncommon();
@@ -116,11 +114,13 @@ sub print_request_form {
my $sourceurl = $machine.$origurl;
$server = $machine.&Apache::loncommon::cleanup_html($origurl);
$server =~ s/\?.*$//;
- my %lt = &Apache::lonlocal::texthash (
+ my %js_lt = &Apache::lonlocal::texthash (
email => 'The e-mail address you entered',
notv => 'is not a valid e-mail address',
rsub => 'You must include a subject',
rdes => 'You must include a description',
+ );
+ my %html_lt = &Apache::lonlocal::texthash (
name => 'Name',
subm => 'Submit Request',
emad => 'Your e-mail address',
@@ -143,22 +143,24 @@ sub print_request_form {
subj => 'Subject',
detd => 'Detailed Description',
opfi => 'Optional file upload',
- uplf => 'Upload a file (e.g., a screenshot) relevant to your help request (128 KB max.)',
+ uplf => 'Upload a file (e.g., a screenshot) relevant to your help request (1 MB max.)',
fini => 'Finish',
clfm => 'Clear Form',
);
+ &js_escape(\%js_lt);
+ &html_escape(\%html_lt);
my $scripttag = (<<"END");
function validate() {
if (validmail(document.logproblem.email) == false) {
- alert("$lt{'email'}: "+document.logproblem.email.value+" $lt{'notv'}.");
+ alert("$js_lt{'email'}: "+document.logproblem.email.value+" $js_lt{'notv'}.");
return;
}
if (document.logproblem.subject.value == '') {
- alert("$lt{'rsub'}.");
+ alert("$js_lt{'rsub'}.");
return;
}
if (document.logproblem.description.value == '') {
- alert("$lt{'rdes'}.");
+ alert("$js_lt{'rdes'}.");
return;
}
document.logproblem.submit();
@@ -271,6 +273,7 @@ $jscript
$loaditems
// ]]>
+
ENDJS
my %add_entries = (
style => "margin-top:0px;margin-bottom:0px;",
@@ -299,7 +302,7 @@ ENDJS
&mt('(All fields marked with * are required.)').
''.
&Apache::lonhtmlcommon::row_closure().
- &Apache::lonhtmlcommon::row_title($lt{'name'},undef,$css[$num])."\n";
+ &Apache::lonhtmlcommon::row_title($html_lt{'name'},undef,$css[$num])."\n";
my $fullname = '';
if ((defined($lastname) && $lastname ne '') && (defined($firstname) && $firstname ne '')) {
$fullname = "$firstname $lastname";
@@ -312,11 +315,14 @@ ENDJS
}
$output .= '&').'" />'."\n";
}
- $output .= ' '.
+ $output .= ' '.
&Apache::lonhtmlcommon::row_closure()."\n";
$num ++;
$i = $num%2;
- $output .= &Apache::lonhtmlcommon::row_title($lt{'emad'},undef,$css[$i]).
+ $output .= &Apache::lonhtmlcommon::row_title(
+ ''.
+ $html_lt{'emad'}.' *'
+ ,undef,$css[$i]).
'&').'" />
'."\n".
&Apache::lonhtmlcommon::row_closure();
@@ -324,61 +330,61 @@ ENDJS
$i = $num%2;
if (($env{'user.name'} =~ /^$match_username$/) && (!$public)) {
if ($homeserver) {
- $output .= &Apache::lonhtmlcommon::row_title($lt{'emac'},undef,$css[$i]).
+ $output .= &Apache::lonhtmlcommon::row_title($html_lt{'emac'},undef,$css[$i]).
'
'."\n".
&Apache::lonhtmlcommon::row_closure();
$num ++;
$i = $num%2;
}
}
- $output .= &Apache::lonhtmlcommon::row_title("$lt{'unme'}/$lt{'doma'}",undef,$css[$i]);
+ $output .= &Apache::lonhtmlcommon::row_title("$html_lt{'unme'}/$html_lt{'doma'}",undef,$css[$i]);
my $udom_input = '&').'" />'."\n";
my $uname_input = '&').'" />'."\n";
if (($env{'user.name'} =~ /^$match_username$/) &&
($env{'user.domain'} =~ /^$match_domain$/) && (!$public)) {
- $output .= ''.$lt{'unme'}.': '.$uname.' '.$lt{'doma'}.': '.$udom.$udom_input.$uname_input;
+ $output .= ''.$html_lt{'unme'}.': '.$uname.' '.$html_lt{'doma'}.': '.$udom.$udom_input.$uname_input;
} else {
my $udomform = '';
my $unameform = '';
if (($env{'user.domain'} =~ /^$match_domain$/) && (!$public)) {
- $output .= $lt{'entu'};
+ $output .= $html_lt{'entu'};
} elsif (($env{'user.name'} =~ /^$match_username$/) && (!$public)) {
- $output .= $lt{'chdo'};
+ $output .= $html_lt{'chdo'};
} else {
- $output .= $lt{'entr'};
+ $output .= $html_lt{'entr'};
}
$output .= '
'."\n";
if (!$public) {
if ($env{'user.domain'} =~ /^$match_domain$/) {
- $udomform = ''.$lt{'doma'}.': '.$udom.$udom_input;
+ $udomform = ''.$html_lt{'doma'}.': '.$udom.$udom_input;
} elsif ($env{'user.name'} =~ /^$match_username$/) {
- $unameform = ''.$lt{'unme'}.': '.$uname.' '.$uname_input;
+ $unameform = ''.$html_lt{'unme'}.': '.$uname.' '.$uname_input;
}
}
if ($udomform eq '') {
- $udomform = ''.$lt{'doma'}.': ';
+ $udomform = ''.$html_lt{'doma'}.': ';
$udomform .= &Apache::loncommon::select_dom_form($codedom,'udom')."\n";
}
if ($unameform eq '') {
- $unameform= ''.$lt{'unme'}.': ';
+ $unameform= ''.$html_lt{'unme'}.': ';
}
$output .= $unameform.$udomform;
}
$output .= &Apache::lonhtmlcommon::row_closure();
$num ++;
$i = $num%2;
- $output .= &Apache::lonhtmlcommon::row_title("$lt{'urlp'}",undef,$css[$i]).
+ $output .= &Apache::lonhtmlcommon::row_title("$html_lt{'urlp'}",undef,$css[$i]).
$server."\n".'&').'" />'."\n".
&Apache::lonhtmlcommon::row_closure().
- &Apache::lonhtmlcommon::row_title("$lt{'phon'}",undef,'LC_evenrow_value').
+ &Apache::lonhtmlcommon::row_title("$html_lt{'phon'}",undef,'LC_evenrow_value').
'
'."\n".
&Apache::lonhtmlcommon::row_closure();
$num ++;
$i = $num%2;
- $output .= &Apache::lonhtmlcommon::row_title("$lt{'crsd'}$details_title",undef,$css[$i]);
+ $output .= &Apache::lonhtmlcommon::row_title("$html_lt{'crsd'}$details_title",undef,$css[$i]);
if ($cnum) {
if ($coursecodes{$cnum}) {
foreach my $item (@codetitles) {
@@ -386,14 +392,14 @@ ENDJS
}
$output .= ' &').'" />'."\n";
} else {
- $output .= $lt{'enin'}.':
+ $output .= $html_lt{'enin'}.':
'."\n";
}
} else {
if ($totcodes > 0) {
my $numtitles = @codetitles;
if ($numtitles == 0) {
- $output .= $lt{'enin'}.':
+ $output .= $html_lt{'enin'}.':
'."\n";
} else {
my @standardnames = &Apache::loncommon::get_standard_codeitems();
@@ -403,7 +409,7 @@ ENDJS
}
$output .= '
'.$codetitles[0].' '."\n". ' |