--- loncom/interface/lonsupportreq.pm 2010/12/02 22:05:17 1.60 +++ loncom/interface/lonsupportreq.pm 2011/03/03 17:29:29 1.66 @@ -1,5 +1,5 @@ # -# $Id: lonsupportreq.pm,v 1.60 2010/12/02 22:05:17 raeburn Exp $ +# $Id: lonsupportreq.pm,v 1.66 2011/03/03 17:29:29 bisitz Exp $ # # Copyright Michigan State University Board of Trustees # @@ -70,14 +70,15 @@ sub handler { sub print_request_form { 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,$public); $function = &Apache::loncommon::get_users_function() if (!$function); $ccode = ''; $os = $env{'browser.os'}; $browser = $env{'browser.type'}; $bversion = $env{'browser.version'}; $uhost = $env{'request.host'}; - my ($uname,$udom,$public); if (($env{'user.name'} eq 'public') && ($env{'user.domain'} eq 'public')) { $public = 1; } else { @@ -243,7 +244,7 @@ function initialize_codes() { } my $js = ''; + $loaditems.''; my %add_entries = (topmargin => "0", marginheight => "0", onLoad =>"initialize_codes()",); @@ -531,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) { @@ -556,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', @@ -687,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+$//; @@ -742,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'} ); @@ -772,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);