'.$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 +451,7 @@ function initialize_codes() {
&Apache::lonhtmlcommon::row_closure();
$num ++;
$i = $num%2;
- if (defined($env{'user.name'})) {
+ if (($env{'user.name'} =~ /^$match_username$/) && (!$public)) {
$output .= &Apache::lonhtmlcommon::row_title($lt{'opfi'},undef,$css[$i]).
' '.$lt{'uplf'}."\n".
&Apache::lonhtmlcommon::row_closure();
@@ -478,27 +497,52 @@ 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 @standardnames = &Apache::loncommon::get_standard_codeitems();
+ if ($totcodes > 0) {
+ my $noregexps = 1;
+ $coursecode =
+ &Apache::courseclassifier::instcode_from_selectors($defdom,$noregexps);
+ }
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};
+ }
}
}
}
@@ -514,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',
@@ -539,7 +582,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 +599,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 = <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+$//;
@@ -691,7 +727,8 @@ END
my $attachmentpath = '';
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'}) {
$attachmentsize = length($env{'form.screenshot'});
if ($attachmentsize > 131072) {
@@ -712,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'}
);
@@ -739,6 +776,11 @@ END
my $cc_string = join(', ',@ok_ccs);
$msg->add("Cc" => $cc_string);
}
+ if ($bcc ne '') {
+ $msg->add("Bcc" => $bcc);
+ }
+ $msg->attr("content-type" => "text/plain");
+ $msg->attr("content-type.charset" => "UTF-8");
if ($attachmentpath) {
my ($type, $encoding) = MIME::Types::by_suffix($attachmentpath);
@@ -826,6 +868,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(<