--- loncom/interface/lonsupportreq.pm 2007/05/07 14:02:45 1.43
+++ loncom/interface/lonsupportreq.pm 2010/07/09 14:40:20 1.57
@@ -1,5 +1,5 @@
#
-# $Id: lonsupportreq.pm,v 1.43 2007/05/07 14:02:45 raeburn Exp $
+# $Id: lonsupportreq.pm,v 1.57 2010/07/09 14:40:20 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -58,9 +58,9 @@ sub handler {
}
my $function = $env{'form.function'};
my $origurl = &unescape($env{'form.origurl'});
- my $action = $env{'form.action'};
+ my $command = $env{'form.command'};
- if ($action eq 'process') {
+ if ($command eq 'process') {
&print_request_receipt($r,$origurl,$function);
} else {
&print_request_form($r,$origurl,$function);
@@ -71,17 +71,17 @@ 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 $tablecolor = &Apache::loncommon::designparm($function.'.tabbg');
- if (($tablecolor eq '') || ($tablecolor eq '#FFFFFF')) {
- $tablecolor = '#EEEE99';
- }
+ $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'};
- $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'};
@@ -93,6 +93,8 @@ sub print_request_form {
} else {
$server = $machine.$origurl;
}
+ my $showserver = $server;
+ $showserver =~ s/\?.*$//;
my %lt = &Apache::lonlocal::texthash (
email => 'The e-mail address you entered',
notv => 'is not a valid e-mail address',
@@ -100,10 +102,13 @@ sub print_request_form {
rdes => 'You must include a description',
name => 'Name',
subm => 'Submit Request',
- emad => 'E-mail address',
+ emad => 'Your e-mail address',
+ emac => 'Cc',
unme => 'username',
doma => 'domain',
- entr => 'Enter the username you use to log-in to your LON-CAPA system, and choose your domain.',
+ entu => 'Enter the username you use to log-in to LON-CAPA',
+ chdo => 'Choose your LON-CAPA domain',
+ entr => 'Enter the username you use to log-in to LON-CAPA, and your domain.',
urlp => 'URL of page',
phon => 'Phone',
crsd => 'Course Details',
@@ -117,7 +122,7 @@ sub print_request_form {
subj => 'Subject',
detd => 'Detailed Description',
opfi => 'Optional file upload',
- uplf => 'Upload a file (e.g., a screenshot) relevant to your support request (128 KB max. size)',
+ uplf => 'Upload a file (e.g., a screenshot) relevant to your help request (128 KB max.)',
fini => 'Finish',
clfm => 'Clear Form',
);
@@ -140,8 +145,9 @@ function validate() {
END
$scripttag .= &Apache::lonhtmlcommon::javascript_valid_email();
- if ($cid =~ m/_/) {
- ($cdom,$cnum) = split(/_/,$cid);
+ if ($cid) {
+ $cdom = $env{'course.'.$cid.'.domain'};
+ $cnum = $env{'course.'.$cid.'.num'};
}
if ($cdom && $cnum) {
my %csettings = &Apache::lonnet::get('environment',['description','internal.coursecode','internal.sectionnums'],$cdom,$cnum);
@@ -149,10 +155,12 @@ END
$ccode = $csettings{'internal.coursecode'};
$sectionlist = $csettings{'internal.sectionnums'};
}
- if ($env{'environment.critnotification'}) {
+
+ if ($env{'environment.permanentemail'}) {
+ $email = $env{'environment.permanentemail'};
+ } elsif ($env{'environment.critnotification'}) {
$email = $env{'environment.critnotification'};
- }
- if (!$email && $env{'environment.notification'}) {
+ } elsif ($env{'environment.notification'}) {
$email = $env{'environment.notification'};
}
if ($env{'environment.lastname'}) {
@@ -167,11 +175,8 @@ END
my ($sec,$grp) = split(/:/,$section);
$groupid{$sec} = $grp;
}
- my $codedom = $Apache::lonnet::perlvar{'lonDefDomain'};
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['codedom']);
- if (exists($env{'form.codedom'})) {
- $codedom = $env{'form.codedom'};
- }
+ my $codedom = &get_domain();
my $details_title;
if ($codedom) {
$details_title = '
('.$codedom.')';
@@ -193,9 +198,6 @@ function initialize_codes() {
return;
}
|;
- if ($cdom) {
- $codedom = $cdom;
- }
if ($cnum) {
$coursecodes{$cnum} = $ccode;
if ($ccode eq '') {
@@ -225,118 +227,74 @@ function initialize_codes() {
}
}
- my $js = '';
my %add_entries = (topmargin => "0",
marginheight => "0",
onLoad =>"initialize_codes()",);
- my $start_page =
- &Apache::loncommon::start_page('Support Request',$js,
+
+ $r->print(&Apache::loncommon::start_page('Support Request',$js,
{ 'function' => $function,
'add_entries' => \%add_entries,
- 'only_body' => 1,});
- $r->print($start_page);
-
+ 'only_body' => 1,}));
if ($r->uri eq '/adm/helpdesk') {
&print_header($r,$origurl);
}
- $r->print(<<"END");
-