version 1.50, 2008/10/01 17:47:06
|
version 1.55.4.3, 2010/04/14 07:31:21
|
Line 77 sub print_request_form {
|
Line 77 sub print_request_form {
|
$browser = $env{'browser.type'}; |
$browser = $env{'browser.type'}; |
$bversion = $env{'browser.version'}; |
$bversion = $env{'browser.version'}; |
$uhost = $env{'request.host'}; |
$uhost = $env{'request.host'}; |
$uname = $env{'user.name'}; |
my ($uname,$udom); |
$udom = $env{'user.domain'}; |
if (($env{'user.name'} ne 'public') && ($env{'user.domain'} ne 'public')) { |
|
$uname = $env{'user.name'}; |
|
$udom = $env{'user.domain'}; |
|
} |
$uhome = $env{'user.home'}; |
$uhome = $env{'user.home'}; |
$urole = $env{'request.role'}; |
$urole = $env{'request.role'}; |
$usec = $env{'request.course.sec'}; |
$usec = $env{'request.course.sec'}; |
Line 266 function initialize_codes() {
|
Line 269 function initialize_codes() {
|
&Apache::lonhtmlcommon::row_closure(); |
&Apache::lonhtmlcommon::row_closure(); |
$num ++; |
$num ++; |
$i = $num%2; |
$i = $num%2; |
if (defined($env{'user.name'})) { |
if (defined($uname)) { |
$output .= &Apache::lonhtmlcommon::row_title($lt{'emac'},undef,$css[$i]). |
$output .= &Apache::lonhtmlcommon::row_title($lt{'emac'},undef,$css[$i]). |
'<input type="text" size="50" name="cc" value="" /><br />'."\n". |
'<input type="text" size="50" name="cc" value="" /><br />'."\n". |
&Apache::lonhtmlcommon::row_closure(); |
&Apache::lonhtmlcommon::row_closure(); |
Line 428 function initialize_codes() {
|
Line 431 function initialize_codes() {
|
&Apache::lonhtmlcommon::row_closure(); |
&Apache::lonhtmlcommon::row_closure(); |
$num ++; |
$num ++; |
$i = $num%2; |
$i = $num%2; |
if (defined($env{'user.name'})) { |
if (defined($uname)) { |
$output .= &Apache::lonhtmlcommon::row_title($lt{'opfi'},undef,$css[$i]). |
$output .= &Apache::lonhtmlcommon::row_title($lt{'opfi'},undef,$css[$i]). |
' <input type="file" name="screenshot" size="20" /><br />'.$lt{'uplf'}."\n". |
' <input type="file" name="screenshot" size="20" /><br />'.$lt{'uplf'}."\n". |
&Apache::lonhtmlcommon::row_closure(); |
&Apache::lonhtmlcommon::row_closure(); |
Line 474 sub print_request_receipt {
|
Line 477 sub print_request_receipt {
|
my $to = &Apache::loncommon::build_recipient_list(undef,'helpdeskmail', |
my $to = &Apache::loncommon::build_recipient_list(undef,'helpdeskmail', |
$defdom,$origmail); |
$defdom,$origmail); |
my $from = $admin; |
my $from = $admin; |
|
my $bcc; |
|
my %domconfig = |
|
&Apache::lonnet::get_dom('configuration',['contacts'],$defdom); |
|
if (ref($domconfig{'contacts'}) eq 'HASH') { |
|
if (exists($domconfig{'contacts'}{'helpdeskmail'})) { |
|
if (ref($domconfig{'contacts'}{'helpdeskmail'}) eq 'HASH') { |
|
my $bccmail = $domconfig{'contacts'}{'helpdeskmail'}{'bcc'}; |
|
if ($bccmail ne '') { |
|
my @bccs = split(/,/,$bccmail); |
|
my @ok_bccs; |
|
foreach my $bcc (@bccs) { |
|
$bcc =~ s/^\s+//g; |
|
$bcc =~ s/\s+$//g; |
|
if ($bcc =~ m/^[^\@]+\@[^\@]+$/) { |
|
if (!(grep(/^\Q$bcc\E$/,@ok_bccs))) { |
|
push(@ok_bccs,$bcc); |
|
} |
|
} |
|
} |
|
if (@ok_bccs > 0) { |
|
$bcc = join(', ',@ok_bccs); |
|
} |
|
} |
|
} |
|
} |
|
} |
my $reporttime = &Apache::lonlocal::locallocaltime(time); |
my $reporttime = &Apache::lonlocal::locallocaltime(time); |
my @formvars = ('username','email','uname','udom','sourceurl','phone','section','coursecode','title','subject','description','screenshot'); |
my @formvars = ('username','email','uname','udom','sourceurl','phone','section','coursecode','title','subject','description','screenshot'); |
|
|
Line 495 sub print_request_receipt {
|
Line 524 sub print_request_receipt {
|
} |
} |
my %lt = &Apache::lonlocal::texthash ( |
my %lt = &Apache::lonlocal::texthash ( |
username => 'Name', |
username => 'Name', |
email => 'Email', |
email => 'E-mail', |
cc => 'Cc', |
cc => 'Cc', |
user => 'Username/domain', |
user => 'Username/domain', |
phone => 'Phone', |
phone => 'Phone', |
Line 566 END
|
Line 595 END
|
if ($env{'form.'.$item} ne '') { |
if ($env{'form.'.$item} ne '') { |
if ($item eq 'description') { |
if ($item eq 'description') { |
my $descrip = $env{'form.description'}; |
my $descrip = $env{'form.description'}; |
$descrip =~ s|\n|<br />|g; |
$descrip = &cleanup_html($descrip); |
|
$descrip =~ s|[\n\r\f]|<br />|g; |
$displaymsg .= |
$displaymsg .= |
'<span class="LC_helpform_receipt_cat">'. |
'<span class="LC_helpform_receipt_cat">'. |
"$lt{$item}</span>: $descrip<br />\n"; |
"$lt{$item}</span>: $descrip<br />\n"; |
} elsif ($item eq 'sourceurl') { |
} elsif ($item eq 'sourceurl') { |
my $showurl = $env{'form.sourceurl'}; |
my $showurl = $env{'form.sourceurl'}; |
$showurl =~ s/\?.*$//; |
$showurl =~ s/\?.*$//; |
|
$showurl = &cleanup_html($showurl); |
$displaymsg .= |
$displaymsg .= |
'<span class="LC_helpform_receipt_cat">'. |
'<span class="LC_helpform_receipt_cat">'. |
"$lt{$item}</span>: $showurl<br />\n"; |
"$lt{$item}</span>: $showurl<br />\n"; |
Line 581 END
|
Line 612 END
|
'<span class="LC_helpform_receipt_cat">'. |
'<span class="LC_helpform_receipt_cat">'. |
"$lt{$item}</span>: $okcclist<br />\n"; |
"$lt{$item}</span>: $okcclist<br />\n"; |
} else { |
} else { |
|
my $showitem = $env{'form.'.$item}; |
|
$showitem = &cleanup_html($showitem); |
$displaymsg .= |
$displaymsg .= |
'<span class="LC_helpform_receipt_cat">'. |
'<span class="LC_helpform_receipt_cat">'. |
"$lt{$item}</span>: $env{'form.'.$item}<br />\n"; |
"$lt{$item}</span>: $showitem<br />\n"; |
} |
} |
} |
} |
} |
} |
Line 665 END
|
Line 698 END
|
|
|
my $attachmentpath = ''; |
my $attachmentpath = ''; |
my $attachmentsize = ''; |
my $attachmentsize = ''; |
if (defined($env{'user.name'})) { |
if ((defined($env{'user.name'})) && ($env{'user.name'} ne 'public') |
|
&& ($env{'user.domain'} ne 'public')) { |
if ($env{'form.screenshot.filename'}) { |
if ($env{'form.screenshot.filename'}) { |
$attachmentsize = length($env{'form.screenshot'}); |
$attachmentsize = length($env{'form.screenshot'}); |
if ($attachmentsize > 131072) { |
if ($attachmentsize > 131072) { |
Line 684 END
|
Line 718 END
|
|
|
if ($attachmentpath =~ m-/([^/]+)$-) { |
if ($attachmentpath =~ m-/([^/]+)$-) { |
$fname = $1; |
$fname = $1; |
$displaymsg .= '<br />'.&mt('An uploaded screenshot file \'[_1]\' ([_2] bytes) was included in the request sent by [_3].',$fname,$attachmentsize,$env{'user.name'}.': '.$env{'user.domain'}); |
$displaymsg .= '<br />' |
|
.&mt('An uploaded screenshot file [_1] ([_2] bytes) was included in the request sent by [_3].' |
|
,'<span class="LC_filename">'.$fname.'<span>' |
|
,$attachmentsize |
|
,$env{'user.name'}.':'.$env{'user.domain'} |
|
); |
$supportmsg .= "\n"; |
$supportmsg .= "\n"; |
foreach my $var (@cookievars) { |
foreach my $var (@cookievars) { |
$supportmsg .= "$var: $cookies{$var}\n"; |
$supportmsg .= "$var: $cookies{$var}\n"; |
Line 708 END
|
Line 747 END
|
my $cc_string = join(', ',@ok_ccs); |
my $cc_string = join(', ',@ok_ccs); |
$msg->add("Cc" => $cc_string); |
$msg->add("Cc" => $cc_string); |
} |
} |
|
if ($bcc ne '') { |
|
$msg->add("Bcc" => $bcc); |
|
} |
|
|
if ($attachmentpath) { |
if ($attachmentpath) { |
my ($type, $encoding) = MIME::Types::by_suffix($attachmentpath); |
my ($type, $encoding) = MIME::Types::by_suffix($attachmentpath); |
Line 741 END
|
Line 783 END
|
unlink($attachmentpath); |
unlink($attachmentpath); |
} |
} |
$r->print('<b>'.$lt{'your'}.'</b>:<br /><br />'."\n"); |
$r->print('<b>'.$lt{'your'}.'</b>:<br /><br />'."\n"); |
$r->print(&Apache::lonhtmlcommon::start_pick_box('LC_helpform_receipt'). |
$r->print('<div style="width:620px;">'. |
|
&Apache::lonhtmlcommon::start_pick_box(). |
&Apache::lonhtmlcommon::row_title($lt{'info'},undef,'LC_oddrow_value')."\n".$displaymsg."\n". |
&Apache::lonhtmlcommon::row_title($lt{'info'},undef,'LC_oddrow_value')."\n".$displaymsg."\n". |
&Apache::lonhtmlcommon::row_closure(). |
&Apache::lonhtmlcommon::row_closure(). |
&Apache::lonhtmlcommon::row_title($lt{'adin'},undef,'LC_evenrow_value')); |
&Apache::lonhtmlcommon::row_title($lt{'adin'},undef,'LC_evenrow_value')); |
Line 767 END
|
Line 810 END
|
$envmsg =~ s/, $//; |
$envmsg =~ s/, $//; |
$r->print($envmsg."\n". |
$r->print($envmsg."\n". |
&Apache::lonhtmlcommon::row_closure(1)."\n". |
&Apache::lonhtmlcommon::row_closure(1)."\n". |
&Apache::lonhtmlcommon::end_pick_box()."\n". |
&Apache::lonhtmlcommon::end_pick_box(). |
|
"</div>\n". |
&Apache::loncommon::end_page()); |
&Apache::loncommon::end_page()); |
} |
} |
|
|
Line 796 sub print_header {
|
Line 840 sub print_header {
|
$r->print(<<END); |
$r->print(<<END); |
<table width="620" border="0" cellspacing="0" cellpadding="0" height="55"> <tr height="50"> <td width='5'> </td> |
<table width="620" border="0" cellspacing="0" cellpadding="0" height="55"> <tr height="50"> <td width='5'> </td> |
<td> |
<td> |
<fieldset><legend><img src="$location/lonIcons/minilogo.gif" height='20' width='29' valign='bottom' /> <b><font size="+1">LON-CAPA $lt{'headline'}</font></b></legend> |
<fieldset> |
|
<legend> |
|
<img src="$location/lonIcons/minilogo.gif" height="20" width="29" valign="bottom" /> |
|
<b>LON-CAPA $lt{'headline'}</b> |
|
</legend> |
<table id="LC_helpmenu_links"> |
<table id="LC_helpmenu_links"> |
<tr> |
<tr> |
<td align="center"><span class="LC_nobreak"><img src="$location/help/help.png" border="0" alt="($lt{'login'})" valign="middle" /> <b><a href="/adm/loginproblems.html">$lt{'login'}</a></b> </span></td> |
<td align="center"><span class="LC_nobreak"><img src="$location/help/help.png" border="0" alt="($lt{'login'})" valign="middle" /> <b><a href="/adm/loginproblems.html">$lt{'login'}</a></b> </span></td> |
Line 837 sub get_domain {
|
Line 885 sub get_domain {
|
} elsif ($env{'request.role.domain'}) { |
} elsif ($env{'request.role.domain'}) { |
$codedom = $env{'request.role.domain'}; |
$codedom = $env{'request.role.domain'}; |
} else { |
} else { |
$codedom = $Apache::lonnet::perlvar{'lonDefDomain'}; |
$codedom = &Apache::lonnet::default_login_domain(); |
} |
} |
return $codedom; |
return $codedom; |
} |
} |
|
|
|
sub cleanup_html { |
|
my ($incoming) = @_; |
|
my $outgoing; |
|
if ($incoming ne '') { |
|
$outgoing = $incoming; |
|
$outgoing =~ s/\#/#/g; |
|
$outgoing =~ s/\&/&/g; |
|
$outgoing =~ s/</</g; |
|
$outgoing =~ s/>/>/g; |
|
$outgoing =~ s/\(/(/g; |
|
$outgoing =~ s/\)/)/g; |
|
$outgoing =~ s/"/"/g; |
|
$outgoing =~ s/'/'/g; |
|
$outgoing =~ s/\$/$/g; |
|
} |
|
return $outgoing; |
|
} |
|
|
1; |
1; |