--- loncom/interface/lonsupportreq.pm 2010/12/03 04:28:36 1.62
+++ loncom/interface/lonsupportreq.pm 2011/03/03 17:29:29 1.66
@@ -1,5 +1,5 @@
#
-# $Id: lonsupportreq.pm,v 1.62 2010/12/03 04:28:36 raeburn Exp $
+# $Id: lonsupportreq.pm,v 1.66 2011/03/03 17:29:29 bisitz Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -532,10 +532,11 @@ sub print_request_receipt {
my $totcodes = 0;
my %coursecodes;
$totcodes = &Apache::courseclassifier::retrieve_instcodes(\%coursecodes,$defdom,$totcodes);
- my $coursecode;
my @standardnames = &Apache::loncommon::get_standard_codeitems();
if ($totcodes > 0) {
- $coursecode = &Apache::courseclassifier::instcode_from_selectors($defdom);
+ my $noregexps = 1;
+ $coursecode =
+ &Apache::courseclassifier::instcode_from_selectors($defdom,$noregexps);
}
if ($coursecode eq '') {
foreach my $item (@standardnames) {
@@ -557,7 +558,6 @@ sub print_request_receipt {
sourceurl => 'URL',
date => 'Date/Time',
secn => 'Section',
- asup => 'A support request has been sent to',
warn => 'Warning: Problem with support e-mail address',
your => 'Your support request contained the following information',
sect => 'section',
@@ -688,14 +688,20 @@ END
$bad_email = 1;
}
}
- if ($bad_email) {
- $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';
+
+ my $message;
+ if (!$bad_email) {
+ $message = &Apache::lonhtmlcommon::confirm_success(
+ &mt('A support request has been sent to [_1]',''.$to.''));
} else {
- $r->print(''.$lt{'asup'}.' '.$to.'
');
+ $message = &Apache::lonhtmlcommon::confirm_success(
+ $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 [_2]not[_3] 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.'),1);
+ $to = 'helpdesk@lon-capa.org';
}
+ $r->print(&Apache::loncommon::confirmwrapper($message));
+
if (defined($env{'form.email'})) {
$env{'form.email'} =~ s/^\s+//;
$env{'form.email'} =~ s/\s+$//;
@@ -743,7 +749,7 @@ END
$fname = $1;
$displaymsg .= '
'
.&mt('An uploaded screenshot file [_1] ([_2] bytes) was included in the request sent by [_3].'
- ,''.$fname.''
+ ,''.$fname.''
,$attachmentsize
,$env{'user.name'}.':'.$env{'user.domain'}
);
@@ -773,7 +779,8 @@ END
if ($bcc ne '') {
$msg->add("Bcc" => $bcc);
}
- $msg->add('Content-type','text/plain; charset=UTF-8');
+ $msg->attr("content-type" => "text/plain");
+ $msg->attr("content-type.charset" => "UTF-8");
if ($attachmentpath) {
my ($type, $encoding) = MIME::Types::by_suffix($attachmentpath);