--- loncom/interface/lonsupportreq.pm 2010/11/29 13:36:43 1.55.6.1
+++ loncom/interface/lonsupportreq.pm 2010/12/02 06:00:12 1.59
@@ -1,5 +1,5 @@
#
-# $Id: lonsupportreq.pm,v 1.55.6.1 2010/11/29 13:36:43 raeburn Exp $
+# $Id: lonsupportreq.pm,v 1.59 2010/12/02 06:00:12 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -77,8 +77,11 @@ sub print_request_form {
$browser = $env{'browser.type'};
$bversion = $env{'browser.version'};
$uhost = $env{'request.host'};
- $uname = $env{'user.name'};
- $udom = $env{'user.domain'};
+ my ($uname,$udom);
+ if (($env{'user.name'} ne 'public') && ($env{'user.domain'} ne 'public')) {
+ $uname = $env{'user.name'};
+ $udom = $env{'user.domain'};
+ }
$uhome = $env{'user.home'};
$urole = $env{'request.role'};
$usec = $env{'request.course.sec'};
@@ -266,7 +269,7 @@ function initialize_codes() {
&Apache::lonhtmlcommon::row_closure();
$num ++;
$i = $num%2;
- if (defined($env{'user.name'})) {
+ if (defined($uname)) {
$output .= &Apache::lonhtmlcommon::row_title($lt{'emac'},undef,$css[$i]).
'
'."\n".
&Apache::lonhtmlcommon::row_closure();
@@ -301,7 +304,7 @@ function initialize_codes() {
$udomform .= &Apache::loncommon::select_dom_form($codedom,'udom');
}
if ($unameform eq '') {
- $unameform= ''.$lt{'unme'}.': ';
+ $unameform= ''.$lt{'unme'}.': ';
}
$output .= $unameform.$udomform;
}
@@ -311,119 +314,116 @@ function initialize_codes() {
$output .= &Apache::lonhtmlcommon::row_title("$lt{'urlp'}",undef,$css[$i]).
$showserver.'&').'" />'.
+ &Apache::lonhtmlcommon::row_closure().
+ &Apache::lonhtmlcommon::row_title("$lt{'phon'}",undef,'LC_evenrow_value').
+ '
'.
&Apache::lonhtmlcommon::row_closure();
- if (&Apache::loncommon::check_for_gci_dc()) {
- $output .= &Apache::lonhtmlcommon::row_title("$lt{'phon'}",undef,
- 'LC_evenrow_value').
- '
'.
- &Apache::lonhtmlcommon::row_closure();
- $num ++;
- $i = $num%2;
- $output .= &Apache::lonhtmlcommon::row_title("$lt{'crsd'}$details_title",undef,$css[$i]);
- if ($cnum) {
- if ($coursecodes{$cnum}) {
- foreach my $item (@codetitles) {
- $output .= ''.$item.': '.$codes{$cnum}{$item}.'; ';
- }
- $output .= ' &').'" />';
- } else {
- $output .= $lt{'enin'}.':
- ';
+ $num ++;
+ $i = $num%2;
+ $output .= &Apache::lonhtmlcommon::row_title("$lt{'crsd'}$details_title",undef,$css[$i]);
+ if ($cnum) {
+ if ($coursecodes{$cnum}) {
+ foreach my $item (@codetitles) {
+ $output .= ''.$item.': '.$codes{$cnum}{$item}.'; ';
}
+ $output .= ' &').'" />';
} else {
- if ($totcodes > 0) {
- my $numtitles = @codetitles;
- if ($numtitles == 0) {
- $output .= $lt{'enin'}.':
- ';
+ $output .= $lt{'enin'}.':
+ ';
+ }
+ } else {
+ if ($totcodes > 0) {
+ my $numtitles = @codetitles;
+ if ($numtitles == 0) {
+ $output .= $lt{'enin'}.':
+ ';
+ } else {
+ my @standardnames = &Apache::loncommon::get_standard_codeitems();
+ my $lasttitle = $numtitles;
+ if ($numtitles > 4) {
+ $lasttitle = 4;
+ }
+ $output .= '
'.$codetitles[0].' '."\n".
+ ' | ';
+ for (my $i=1; $i<$numtitles; $i++) {
+ $output .= ''.$codetitles[$i].' '."\n".
+ ''."\n".
+ ''."\n".
+ ''."\n".
+ ' | '."\n";
+ }
+ $output .= '
';
+ if ($numtitles > 4) {
+ $output .= '
'.$codetitles[$numtitles].'
'."\n".
+ ''."\n".
+ ''."\n".
+ ''."\n";
}
}
- $output .= "";
} else {
- $output .= '';
+ $output .= $lt{'enin'}.':
+ ';
}
- $output .= &Apache::lonhtmlcommon::row_closure();
}
+ if ($ctitle) {
+ $output .= '
'.$lt{'titl'}.': '.$ctitle.
+ '&').'" />'."\n";
+ } else {
+ $output .= '
'.$lt{'enct'}.':
+ '."\n";
+ }
+ $output .= &Apache::lonhtmlcommon::row_closure();
$num ++;
$i = $num%2;
+ $output .= &Apache::lonhtmlcommon::row_title($lt{'secn'},undef,$css[$i]);
+ if ($sectionlist) {
+ $output .= "".
+ " \n";
+ foreach my $id (sort(keys(%groupid))) {
+ if ($id eq $groupid{$id} || $groupid{$id} eq '') {
+ $output .= " \n";
+ } else {
+ $output .= " \n";
+ }
+ }
+ $output .= "";
+ } else {
+ $output .= '';
+ }
+ $output .= &Apache::lonhtmlcommon::row_closure();
+ $num ++;
+ $i = $num%2;
$output .= &Apache::lonhtmlcommon::row_title($lt{'subj'},undef,'LC_oddrow_value').
' '."\n".
&Apache::lonhtmlcommon::row_closure().
@@ -432,7 +432,7 @@ function initialize_codes() {
&Apache::lonhtmlcommon::row_closure();
$num ++;
$i = $num%2;
- if (defined($env{'user.name'})) {
+ if (defined($uname)) {
$output .= &Apache::lonhtmlcommon::row_title($lt{'opfi'},undef,$css[$i]).
'
'.$lt{'uplf'}."\n".
&Apache::lonhtmlcommon::row_closure();
@@ -478,27 +478,51 @@ sub print_request_receipt {
my $to = &Apache::loncommon::build_recipient_list(undef,'helpdeskmail',
$defdom,$origmail);
my $from = $admin;
- my $reporttime = &Apache::lonlocal::locallocaltime(time);
- my @formvars = ('username','email','uname','udom','sourceurl');
- if (&Apache::loncommon::check_for_gci_dc()) {
- push(@formvars,('phone','section','coursecode','title'));
+ 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);
+ }
+ }
+ }
+ }
}
- push(@formvars,('subject','description','screenshot'));
+ my $reporttime = &Apache::lonlocal::locallocaltime(time);
+ my @formvars = ('username','email','uname','udom','sourceurl','phone','section','coursecode','title','subject','description','screenshot');
+
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},\@formvars);
my $coursecode = $env{'form.coursecode'};
- if (&Apache::loncommon::check_for_gci_dc()) {
+ if ($coursecode eq '') {
+ 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);
+ }
if ($coursecode eq '') {
- if (defined($env{'form.Year'})) {
- $coursecode .= $env{'form.Year'};
- }
- if (defined($env{'form.Semester'})) {
- $coursecode .= $env{'form.Semester'};
- }
- if (defined($env{'form.Department'})) {
- $coursecode .= $env{'form.Department'};
- }
- if (defined($env{'form.Number'})) {
- $coursecode .= $env{'form.Number'};
+ foreach my $item (@standardnames) {
+ if ((defined($env{'form.'.$item})) && ($env{'form.'.$item} ne '-1')) {
+ $coursecode .= $env{'form.'.$item};
+ }
}
}
}
@@ -539,7 +563,7 @@ sub print_request_receipt {
if (!(grep(/^\Q$cc\E$/,@ok_ccs))) {
push(@ok_ccs,$cc);
}
- } else {
+ } elsif ($cc ne '') {
if (!(grep(/^\Q$cc\E$/,@bad_ccs))) {
push(@bad_ccs,$cc);
}
@@ -556,22 +580,14 @@ sub print_request_receipt {
}
}
$env{'form.user'} = "'".$env{'form.uname'}.':'.$env{'form.udom'}."'";
- if (&Apache::loncommon::check_for_gci_dc()) {
- $env{'form.csri'} = $env{'form.title'}.' - '.$coursecode.' - '.$lt{'sect'}.': '.$env{'form.section'};
- }
+ $env{'form.crsi'} = $env{'form.title'}.' - '.$coursecode.' - '.$lt{'sect'}.': '.$env{'form.section'};
my $supportmsg = < 131072) {
@@ -739,6 +751,10 @@ END
my $cc_string = join(', ',@ok_ccs);
$msg->add("Cc" => $cc_string);
}
+ if ($bcc ne '') {
+ $msg->add("Bcc" => $bcc);
+ }
+ $msg->add('Content-type','text/plain; charset=UTF-8');
if ($attachmentpath) {
my ($type, $encoding) = MIME::Types::by_suffix($attachmentpath);
@@ -826,6 +842,9 @@ sub print_header {
} else {
$reviewtext = &mt('Please review the information in "Log-in help" if you are unable to log-in.');
}
+ if ($origurl eq '') {
+ $origurl = 'javascript:history.go(-1)';
+ }
$r->print(< |
|