version 1.38, 2006/10/12 22:47:31
|
version 1.40, 2006/12/12 16:04:40
|
Line 37 use Apache::lonnet;
|
Line 37 use Apache::lonnet;
|
use Apache::lonlocal; |
use Apache::lonlocal; |
use Apache::lonacc(); |
use Apache::lonacc(); |
use Apache::courseclassifier; |
use Apache::courseclassifier; |
use lib '/home/httpd/lib/perl/'; |
|
use LONCAPA; |
use LONCAPA; |
|
|
|
|
Line 84 sub print_request_form {
|
Line 83 sub print_request_form {
|
$usec = $env{'request.course.sec'}; |
$usec = $env{'request.course.sec'}; |
$cid = $env{'request.course.id'}; |
$cid = $env{'request.course.id'}; |
$formname = 'logproblem'; |
$formname = 'logproblem'; |
if ($origurl =~ m-^http://-) { |
my $machine = &Apache::lonnet::absolute_url(); |
|
if ($origurl =~ m-^https?://-) { |
$server = $origurl; |
$server = $origurl; |
} else { |
} else { |
$server = 'http://'.$ENV{'SERVER_NAME'}.$origurl; |
$server = $machine.$origurl; |
} |
} |
my $scripttag = (<<'END'); |
my %lt = &Apache::lonlocal::texthash ( |
|
email => 'The e-mail address you entered', |
|
notv => 'is not a valid e-mail address', |
|
rsub => 'You must include a subject', |
|
rdes => 'You must include a description', |
|
name => 'Name', |
|
subm => 'Submit Request', |
|
emad => 'E-mail address', |
|
unme => 'username', |
|
doma => 'domain', |
|
entr => 'Enter the username you use to log-in to your LON-CAPA system, and choose your domain.', |
|
urlp => 'URL of page', |
|
phon => 'Phone', |
|
crsd => 'Course Details', |
|
enin => 'Enter institutional course code', |
|
pick => 'Pick', |
|
enct => 'Enter course title', |
|
secn => 'Section Number', |
|
sele => 'Select', |
|
titl => 'Title', |
|
lsec => 'LON-CAPA sec', |
|
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)', |
|
fini => 'Finish', |
|
clfm => 'Clear Form', |
|
); |
|
my $scripttag = (<<"END"); |
function validate() { |
function validate() { |
if (validmail(document.logproblem.email) == false) { |
if (validmail(document.logproblem.email) == false) { |
alert("The e-mail address you entered: "+document.logproblem.email.value+" is not a valid e-mail address."); |
alert("$lt{'email'}: "+document.logproblem.email.value+" $lt{'notv'}."); |
|
return; |
|
} |
|
if (document.logproblem.subject.value == '') { |
|
alert("$lt{'rsub'}."); |
|
return; |
|
} |
|
if (document.logproblem.description.value == '') { |
|
alert("$lt{'rdes'}."); |
return; |
return; |
} |
} |
document.logproblem.submit(); |
document.logproblem.submit(); |
} |
} |
|
|
|
END |
|
$scripttag .= <<'END'; |
function validmail(field) { |
function validmail(field) { |
var str = field.value; |
var str = field.value; |
if (window.RegExp) { |
if (window.RegExp) { |
Line 121 function validmail(field) {
|
Line 159 function validmail(field) {
|
END |
END |
|
|
if ($cid =~ m/_/) { |
if ($cid =~ m/_/) { |
($cdom,$cnum) = split/_/,$cid; |
($cdom,$cnum) = split(/_/,$cid); |
} |
} |
if ($cdom && $cnum) { |
if ($cdom && $cnum) { |
my %csettings = &Apache::lonnet::get('environment',['description','internal.coursecode','internal.sectionnums'],$cdom,$cnum); |
my %csettings = &Apache::lonnet::get('environment',['description','internal.coursecode','internal.sectionnums'],$cdom,$cnum); |
Line 141 END
|
Line 179 END
|
if ($env{'environment.firstname'}) { |
if ($env{'environment.firstname'}) { |
$firstname = $env{'environment.firstname'}; |
$firstname = $env{'environment.firstname'}; |
} |
} |
my @sections = split/,/,$sectionlist; |
my @sections = split(/,/,$sectionlist); |
my %groupid = (); |
my %groupid; |
foreach (@sections) { |
foreach my $section (@sections) { |
my ($sec,$grp) = split/:/,$_; |
my ($sec,$grp) = split(/:/,$section); |
$groupid{$sec} = $grp; |
$groupid{$sec} = $grp; |
} |
} |
my $codedom = $Apache::lonnet::perlvar{'lonDefDomain'}; |
my $codedom = $Apache::lonnet::perlvar{'lonDefDomain'}; |
Line 156 END
|
Line 194 END
|
if ($codedom) { |
if ($codedom) { |
$details_title = '<br />('.$codedom.')'; |
$details_title = '<br />('.$codedom.')'; |
} |
} |
my %coursecodes = (); |
my %coursecodes; |
my %codes = (); |
my %codes; |
my @codetitles = (); |
my @codetitles; |
my %cat_titles = (); |
my %cat_titles; |
my %cat_order = (); |
my %cat_order; |
my %idlist = (); |
my %idlist; |
my %idnums = (); |
my %idnums; |
my %idlist_titles = (); |
my %idlist_titles; |
my $caller = 'global'; |
my $caller = 'global'; |
my $totcodes = 0; |
my $totcodes = 0; |
my $format_reply; |
my $format_reply; |
Line 237 function initialize_codes() {
|
Line 275 function initialize_codes() {
|
<td width="140" bgcolor="$tablecolor"> |
<td width="140" bgcolor="$tablecolor"> |
<table width="140" border="0" cellpadding="8" cellspacing="0"> |
<table width="140" border="0" cellpadding="8" cellspacing="0"> |
<tr> |
<tr> |
<td align="right"><b>Name:</b> |
<td align="right"><b>$lt{'name'}:</b> |
</td> |
</td> |
</tr> |
</tr> |
</table> |
</table> |
Line 260 END
|
Line 298 END
|
$r->print('<input type="text" size="20" name="username" value="'.$fullname.'" />'); |
$r->print('<input type="text" size="20" name="username" value="'.$fullname.'" />'); |
} |
} |
$r->print(<<END); |
$r->print(<<END); |
<input type="button" value="Submit Request" onClick="validate()" /> |
<input type="button" value="$lt{'subm'}" onClick="validate()" /> |
</td> |
</td> |
</tr> |
</tr> |
</table> |
</table> |
Line 275 END
|
Line 313 END
|
<td width="140" bgcolor="$tablecolor"> |
<td width="140" bgcolor="$tablecolor"> |
<table width="140" border="0" cellpadding="8" cellspacing="0"> |
<table width="140" border="0" cellpadding="8" cellspacing="0"> |
<tr> |
<tr> |
<td align="right"><b>E-mail address:</b> |
<td align="right"><b>$lt{'emad'}:</b> |
</td> |
</td> |
</tr> |
</tr> |
</table> |
</table> |
Line 299 END
|
Line 337 END
|
<td width="140" bgcolor="$tablecolor"> |
<td width="140" bgcolor="$tablecolor"> |
<table width="140" border="0" cellpadding="8" cellspacing="0"> |
<table width="140" border="0" cellpadding="8" cellspacing="0"> |
<tr> |
<tr> |
<td align="right"><b>username/domain:</b> |
<td align="right"><b>$lt{'unme'}/$lt{'doma'}:</b> |
</td> |
</td> |
</tr> |
</tr> |
</table> |
</table> |
Line 312 END
|
Line 350 END
|
my $udom_input = '<input type="hidden" name="udom" value="'.$udom.'" />'; |
my $udom_input = '<input type="hidden" name="udom" value="'.$udom.'" />'; |
my $uname_input = '<input type="hidden" name="uname" value="'.$uname.'" />'; |
my $uname_input = '<input type="hidden" name="uname" value="'.$uname.'" />'; |
if (defined($uname) && defined($udom)) { |
if (defined($uname) && defined($udom)) { |
$r->print('<i>username</i>: '.$uname.' <i>domain</i>: '.$udom.$udom_input.$uname_input); |
$r->print('<i>'.$lt{'unme'}.'</i>: '.$uname.' <i>'.$lt{'doma'}.'</i>: '.$udom.$udom_input.$uname_input); |
} else { |
} else { |
my $udomform = ''; |
my $udomform = ''; |
my $unameform = ''; |
my $unameform = ''; |
if (defined($udom)) { |
if (defined($udom)) { |
$udomform = '<i>domain</i>: '.$udom.$udom_input; |
$udomform = '<i>'.$lt{'doma'}.'</i>: '.$udom.$udom_input; |
} elsif (defined($uname)) { |
} elsif (defined($uname)) { |
$unameform = '<i>username</i>: '.$uname.' '.$uname_input; |
$unameform = '<i>'.$lt{'unme'}.'</i>: '.$uname.' '.$uname_input; |
} |
} |
if ($udomform eq '') { |
if ($udomform eq '') { |
$udomform = '<i>domain</i>: '; |
$udomform = '<i>'.$lt{'doma'}.'</i>: '; |
$udomform .= &Apache::loncommon::select_dom_form($codedom,'udom'); |
$udomform .= &Apache::loncommon::select_dom_form($codedom,'udom'); |
} |
} |
if ($unameform eq '') { |
if ($unameform eq '') { |
$unameform= '<i>username</i>: <input type="text" size="12" name="uname" value="'.$uname.'" /> '; |
$unameform= '<i>'.$lt{'unme'}.'</i>: <input type="text" size="12" name="uname" value="'.$uname.'" /> '; |
} |
} |
$r->print($unameform.$udomform.'<br />Enter the username you use to log-in to your LON-CAPA system, and choose your domain.'); |
$r->print($unameform.$udomform.'<br />'.$lt{'entr'}); |
} |
} |
$r->print(<<END); |
$r->print(<<END); |
</td> |
</td> |
Line 345 END
|
Line 383 END
|
<td width="140" bgcolor="$tablecolor"> |
<td width="140" bgcolor="$tablecolor"> |
<table width="140" border="0" cellpadding="8" cellspacing="0"> |
<table width="140" border="0" cellpadding="8" cellspacing="0"> |
<tr> |
<tr> |
<td align="right"><b>URL of page:</b> |
<td align="right"><b>$lt{'urlp'}:</b> |
</td> |
</td> |
</tr> |
</tr> |
</table> |
</table> |
Line 369 END
|
Line 407 END
|
<td width="140" bgcolor="$tablecolor"> |
<td width="140" bgcolor="$tablecolor"> |
<table width="140" border="0" cellpadding="8" cellspacing="0"> |
<table width="140" border="0" cellpadding="8" cellspacing="0"> |
<tr> |
<tr> |
<td align="right"><b>Phone #:</b> |
<td align="right"><b>$lt{'phon'} #:</b> |
</td> |
</td> |
</tr> |
</tr> |
</table> |
</table> |
Line 393 END
|
Line 431 END
|
<td width="140" bgcolor="$tablecolor"> |
<td width="140" bgcolor="$tablecolor"> |
<table width="140" border="0" cellpadding="8" cellspacing="0"> |
<table width="140" border="0" cellpadding="8" cellspacing="0"> |
<tr> |
<tr> |
<td align="right"><b>Course Details:</b>$details_title |
<td align="right"><b>$lt{'crsd'}:</b>$details_title |
</td> |
</td> |
</tr> |
</tr> |
</table> |
</table> |
Line 405 END
|
Line 443 END
|
END |
END |
if ($cnum) { |
if ($cnum) { |
if ($coursecodes{$cnum}) { |
if ($coursecodes{$cnum}) { |
foreach (@codetitles) { |
foreach my $item (@codetitles) { |
$r->print('<i>'.$_.'</i>: '.$codes{$cnum}{$_}.'; '); |
$r->print('<i>'.$item.'</i>: '.$codes{$cnum}{$item}.'; '); |
} |
} |
$r->print(' <input type="hidden" name="coursecode" value="'.$coursecodes{$cnum}.'" />'); |
$r->print(' <input type="hidden" name="coursecode" value="'.$coursecodes{$cnum}.'" />'); |
} else { |
} else { |
$r->print('Enter institutional course code: |
$r->print($lt{'enin'}.': |
<input type="text" name="coursecode" size="15" value="" />'); |
<input type="text" name="coursecode" size="15" value="" />'); |
} |
} |
} else { |
} else { |
if ($totcodes > 0) { |
if ($totcodes > 0) { |
my $numtitles = @codetitles; |
my $numtitles = @codetitles; |
if ($numtitles == 0) { |
if ($numtitles == 0) { |
$r->print('Enter institutional course code: |
$r->print($lt{'enin'}.': |
<input type="text" name="coursecode" size="15" value="" />'); |
<input type="text" name="coursecode" size="15" value="" />'); |
} else { |
} else { |
my $lasttitle = $numtitles; |
my $lasttitle = $numtitles; |
Line 426 END
|
Line 464 END
|
} |
} |
$r->print('<table><tr><td>'.$codetitles[0].'<br />'."\n". |
$r->print('<table><tr><td>'.$codetitles[0].'<br />'."\n". |
'<select name="'.$codetitles[0].'" onChange="courseSet('."'$codetitles[0]'".')">'."\n". |
'<select name="'.$codetitles[0].'" onChange="courseSet('."'$codetitles[0]'".')">'."\n". |
' <option value="-1" />Select'."\n"); |
' <option value="-1" />'.$lt{'sele'}."\n"); |
my @items = (); |
my @items = (); |
my @longitems = (); |
my @longitems = (); |
if ($idlist{$codetitles[0]} =~ /","/) { |
if ($idlist{$codetitles[0]} =~ /","/) { |
@items = split/","/,$idlist{$codetitles[0]}; |
@items = split(/","/,$idlist{$codetitles[0]}); |
} else { |
} else { |
$items[0] = $idlist{$codetitles[0]}; |
$items[0] = $idlist{$codetitles[0]}; |
} |
} |
if (defined($idlist_titles{$codetitles[0]})) { |
if (defined($idlist_titles{$codetitles[0]})) { |
if ($idlist_titles{$codetitles[0]} =~ /","/) { |
if ($idlist_titles{$codetitles[0]} =~ /","/) { |
@longitems = split/","/,$idlist_titles{$codetitles[0]}; |
@longitems = split(/","/,$idlist_titles{$codetitles[0]}); |
} else { |
} else { |
$longitems[0] = $idlist_titles{$codetitles[0]}; |
$longitems[0] = $idlist_titles{$codetitles[0]}; |
} |
} |
Line 455 END
|
Line 493 END
|
for (my $i=1; $i<$numtitles; $i++) { |
for (my $i=1; $i<$numtitles; $i++) { |
$r->print('<td>'.$codetitles[$i].'<br />'."\n". |
$r->print('<td>'.$codetitles[$i].'<br />'."\n". |
'<select name="'.$codetitles[$i].'" onChange="courseSet('."'$codetitles[$i]'".')">'."\n". |
'<select name="'.$codetitles[$i].'" onChange="courseSet('."'$codetitles[$i]'".')">'."\n". |
'<option value="-1"><-Pick '.$codetitles[$i-1].'</option>'."\n". |
'<option value="-1"><-'.$lt{'pick'}.' '.$codetitles[$i-1].'</option>'."\n". |
'</select>'."\n". |
'</select>'."\n". |
'</td>' |
'</td>' |
); |
); |
Line 464 END
|
Line 502 END
|
if ($numtitles > 4) { |
if ($numtitles > 4) { |
$r->print('<br /><br />'.$codetitles[$numtitles].'<br />'."\n". |
$r->print('<br /><br />'.$codetitles[$numtitles].'<br />'."\n". |
'<select name="'.$codetitles[$numtitles].'" onChange="courseSet('."'$codetitles[$numtitles]'".')">'."\n". |
'<select name="'.$codetitles[$numtitles].'" onChange="courseSet('."'$codetitles[$numtitles]'".')">'."\n". |
'<option value="-1"><-Pick '.$codetitles[$numtitles-1].'</option>'."\n". |
'<option value="-1"><-'.$lt{'pick'}.' '.$codetitles[$numtitles-1].'</option>'."\n". |
'</select>'."\n"); |
'</select>'."\n"); |
} |
} |
} |
} |
} else { |
} else { |
$r->print('Enter institutional course code: |
$r->print($lt{'enin'}.': |
<input type="text" name="coursecode" size="15" value="" />'); |
<input type="text" name="coursecode" size="15" value="" />'); |
} |
} |
} |
} |
if ($ctitle) { |
if ($ctitle) { |
$r->print('<br /><i>Title</i>: '.$ctitle.'<input type="hidden" name="title" value="'.$ctitle.'" />'); |
$r->print('<br /><i>'.$lt{'titl'}.'</i>: '.$ctitle.'<input type="hidden" name="title" value="'.$ctitle.'" />'); |
} else { |
} else { |
$r->print('<br />Enter course title: |
$r->print('<br />'.$lt{'enct'}.': |
<input type="text" name="title" size="25" value="" />'); |
<input type="text" name="title" size="25" value="" />'); |
} |
} |
$r->print(<<END); |
$r->print(<<END); |
Line 494 END
|
Line 532 END
|
<td width="140" bgcolor="$tablecolor"> |
<td width="140" bgcolor="$tablecolor"> |
<table width="140" border="0" cellpadding="8" cellspacing="0"> |
<table width="140" border="0" cellpadding="8" cellspacing="0"> |
<tr> |
<tr> |
<td align="right"><b>Section Number: </b> |
<td align="right"><b>$lt{'secn'}: </b> |
</td> |
</td> |
</tr> |
</tr> |
</table> |
</table> |
Line 506 END
|
Line 544 END
|
END |
END |
if ($sectionlist) { |
if ($sectionlist) { |
$r->print("<select name=\"section\"\n>". |
$r->print("<select name=\"section\"\n>". |
" <option value=\"\" selected=\"selected\">Select</option>\n"); |
" <option value=\"\" selected=\"selected\">$lt{'sele'}</option>\n"); |
foreach (sort keys %groupid) { |
foreach my $id (sort(keys(%groupid))) { |
if ($_ eq $groupid{$_} || $groupid{$_} eq '') { |
if ($id eq $groupid{$id} || $groupid{$id} eq '') { |
$r->print(" <option value=\"$_\" >$_</option>\n"); |
$r->print(" <option value=\"$id\" >$id</option>\n"); |
} else { |
} else { |
$r->print(" <option value=\"$_\" >$_ - (LON-CAPA sec: $groupid{$_})</option>\n"); |
$r->print(" <option value=\"$id\" >$id - ($lt{'lsec'}: $groupid{$id})</option>\n"); |
} |
} |
} |
} |
$r->print("</select>"); |
$r->print("</select>"); |
Line 533 END
|
Line 571 END
|
<td width="140" bgcolor="$tablecolor"> |
<td width="140" bgcolor="$tablecolor"> |
<table width="140" border="0" cellpadding="8" cellspacing="0"> |
<table width="140" border="0" cellpadding="8" cellspacing="0"> |
<tr> |
<tr> |
<td align="right"><b>Subject</b> |
<td align="right"><b>$lt{'subj'}</b> |
</td> |
</td> |
</tr> |
</tr> |
</table> |
</table> |
Line 557 END
|
Line 595 END
|
<td width="140" bgcolor="$tablecolor"> |
<td width="140" bgcolor="$tablecolor"> |
<table width="140" border="0" cellpadding="8" cellspacing="0"> |
<table width="140" border="0" cellpadding="8" cellspacing="0"> |
<tr> |
<tr> |
<td align="right"><b>Detailed description:</b> |
<td align="right"><b>$lt{'detd'}:</b> |
</td> |
</td> |
</tr> |
</tr> |
</table> |
</table> |
Line 584 END
|
Line 622 END
|
<td width="140" bgcolor="$tablecolor"> |
<td width="140" bgcolor="$tablecolor"> |
<table width="140" border="0" cellpadding="8" cellspacing="0"> |
<table width="140" border="0" cellpadding="8" cellspacing="0"> |
<tr> |
<tr> |
<td align="right"><b>Optional file upload:</b> |
<td align="right"><b>$lt{'opfi'}:</b> |
</td> |
</td> |
</tr> |
</tr> |
</table> |
</table> |
Line 593 END
|
Line 631 END
|
<table width="100%" border="0" cellpadding="8" cellspacing="0"> |
<table width="100%" border="0" cellpadding="8" cellspacing="0"> |
<tr> |
<tr> |
<td> |
<td> |
<input type="file" name="screenshot" size="20" /><br />Upload a file (e.g., a screenshot) relevant to your support request (128 KB max. size). |
<input type="file" name="screenshot" size="20" /><br />$lt{'uplf'} |
</td> |
</td> |
</tr> |
</tr> |
</table> |
</table> |
Line 612 END
|
Line 650 END
|
<td width="140" bgcolor="$tablecolor"> |
<td width="140" bgcolor="$tablecolor"> |
<table width="140" border="0" cellpadding="8" cellspacing="0"> |
<table width="140" border="0" cellpadding="8" cellspacing="0"> |
<tr> |
<tr> |
<td align="right"><b>Finish:</b> |
<td align="right"><b>$lt{'fini'}:</b> |
</td> |
</td> |
</tr> |
</tr> |
</table> |
</table> |
Line 622 END
|
Line 660 END
|
<tr> |
<tr> |
<td> |
<td> |
<input type="hidden" name="action" value="process" /> |
<input type="hidden" name="action" value="process" /> |
<input type="button" value="Submit Request" onClick="validate()"/> |
<input type="button" value="$lt{'subm'}" onClick="validate()"/> |
</td> |
</td> |
<td> </td> |
<td> </td> |
<td> |
<td> |
<input type="reset" value="Clear Form"> |
<input type="reset" value="$lt{'clfm'}"> |
</td> |
</td> |
</tr> |
</tr> |
</table> |
</table> |
Line 680 sub print_request_receipt {
|
Line 718 sub print_request_receipt {
|
$coursecode .= $env{'form.Number'}; |
$coursecode .= $env{'form.Number'}; |
} |
} |
} |
} |
|
my %lt = &Apache::lonlocal::texthash ( |
|
name => 'Name', |
|
email => 'Email', |
|
unme => 'Username/domain', |
|
tel => 'Tel', |
|
crsi => 'Course Information', |
|
subj => 'Subject', |
|
desc => 'Description', |
|
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', |
|
info => 'Information supplied', |
|
adin => 'Additional information recorded', |
|
); |
|
|
my $supportmsg = qq| |
my $supportmsg = qq| |
Name: $env{'form.username'} |
$lt{'name'}: $env{'form.username'} |
Email: $env{'form.email'} |
$lt{'email'}: $env{'form.email'} |
Username/domain: $env{'form.uname'} - $env{'form.udom'} |
$lt{'unme'}: $env{'form.uname'} - $env{'form.udom'} |
Tel: $env{'form.phone'} |
$lt{'tel'}: $env{'form.phone'} |
Course Information: $env{'form.title'} - $coursecode - section: $env{'form.section'} |
$lt{'crsi'}: env{'form.title'} - $coursecode - $lt{'secn'}: $env{'form.section'} |
Subject: $env{'form.subject'} |
$lt{'subj'}: $env{'form.subject'} |
Description: $env{'form.description'} |
$lt{'desc'}: $env{'form.description'} |
URL: $env{'form.sourceurl'} |
URL: $env{'form.sourceurl'} |
Date/Time: $reporttime |
$lt{'date'}: $reporttime |
|
|
|; |
|; |
my $descrip = $env{'form.description'}; |
my $descrip = $env{'form.description'}; |
$descrip =~ s#\n#<br />#g; |
$descrip =~ s#\n#<br />#g; |
my $displaymsg = qq| |
my $displaymsg = qq| |
<font color="$fontcolor">Name:</font><font color="$vlinkcolor"> $env{'form.username'}</font><br /> |
<font color="$fontcolor">$lt{'name'}:</font><font color="$vlinkcolor"> $env{'form.username'}</font><br /> |
<font color="$fontcolor">Email: </font><font color="$vlinkcolor">$env{'form.email'}</font><br /> |
<font color="$fontcolor">$lt{'email'}: </font><font color="$vlinkcolor">$env{'form.email'}</font><br /> |
<font color="$fontcolor">Username/domain: </font><font color="$vlinkcolor">$env{'form.uname'} - $env{'form.udom'}</font><br /> |
<font color="$fontcolor">$lt{'unme'}: </font><font color="$vlinkcolor">$env{'form.uname'} - $env{'form.udom'}</font><br /> |
<font color="$fontcolor">Tel: </font><font color="$vlinkcolor">$env{'form.phone'}</font><br /> |
<font color="$fontcolor">$lt{'tel'}: </font><font color="$vlinkcolor">$env{'form.phone'}</font><br /> |
<font color="$fontcolor">Course Information: </font><font color="$vlinkcolor">$env{'form.title'} - $coursecode - section: $env{'form.section'}</font><br /> |
<font color="$fontcolor">$lt{'crsi'}: </font><font color="$vlinkcolor">$env{'form.title'} - $coursecode - $lt{'sect'}: $env{'form.section'}</font><br /> |
<font color="$fontcolor">Subject: </font><font color="$vlinkcolor">$env{'form.subject'}</font><br /> |
<font color="$fontcolor">$lt{'subj'}: </font><font color="$vlinkcolor">$env{'form.subject'}</font><br /> |
<font color="$fontcolor">Description: </font><font color="$vlinkcolor">$descrip</font><br /> |
<font color="$fontcolor">$lt{'desc'}: </font><font color="$vlinkcolor">$descrip</font><br /> |
<font color="$fontcolor">URL: </font><font color="$vlinkcolor">$env{'form.sourceurl'}</font><br /> |
<font color="$fontcolor">URL: </font><font color="$vlinkcolor">$env{'form.sourceurl'}</font><br /> |
<font color="$fontcolor">Date/Time: </font><font color="$vlinkcolor">$reporttime</font><br /> |
<font color="$fontcolor">$lt{'date'}: </font><font color="$vlinkcolor">$reporttime</font><br /> |
|; |
|; |
|
|
my $start_page = |
my $start_page = |
Line 725 END
|
Line 781 END
|
&print_header($r,$url,'process'); |
&print_header($r,$url,'process'); |
} |
} |
if ($to =~ m/^[^\@]+\@[^\@]+$/) { |
if ($to =~ m/^[^\@]+\@[^\@]+$/) { |
$r->print("<h3>A support request has been sent to $to</h3>"); |
$r->print('<h3>'.$lt{'asup'}.' '.$to.'</h3>'); |
} else { |
} else { |
$to = $admin; |
$to = $admin; |
if ($to =~ m/^[^\@]+\@[^\@]+$/) { |
if ($to =~ m/^[^\@]+\@[^\@]+$/) { |
$r->print("<h3>A support request has been sent to $to</h3>"); |
$r->print('<h3>'.$lt{'asup'}.' '.$to.'</h3>'); |
END |
|
} else { |
} else { |
$r->print(<<END); |
$r->print(' |
<h3>Warning: Problem with support e-mail address</h3> |
<h3>'.$lt{'warn'}.'</h3>'. |
As the e-mail address provided for this LON-CAPA server ($to) does not appear to be a valid e-mail address, your support request has <b>not</b> been sent to the LON-CAPA support staff or administrator at your institution. Instead a copy has been sent to the LON-CAPA support team at Michigan State University. |
&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 <b>not</b> 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.')); |
END |
|
$to = 'helpdesk@lon-capa.org'; |
$to = 'helpdesk@lon-capa.org'; |
} |
} |
} |
} |
Line 760 END
|
Line 814 END
|
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) { |
$displaymsg .= "<br />The uploaded screenshot file ($attachmentsize bytes) included with your request exceeded the maximum allowed size - 128 KB, and has therefore been discarded."; |
$displaymsg .= '<br />'.&mt('The uploaded screenshot file ([_1] bytes) included with your request exceeded the maximum allowed size - 128 KB, and has therefore been discarded.',$attachmentsize); |
} else { |
} else { |
$attachmentpath=&Apache::lonnet::userfileupload('screenshot',undef,'helprequests'); |
$attachmentpath=&Apache::lonnet::userfileupload('screenshot',undef,'helprequests'); |
} |
} |
} |
} |
} |
} |
|
|
my %cookies = (); |
my %cookies; |
my $cookie=CGI::Cookie->parse($r->header_in('Cookie')); |
my $cookie=CGI::Cookie->parse($r->header_in('Cookie')); |
if ($$cookie{'lonID'} =~ /lonID=(\w+);/) { |
if ($$cookie{'lonID'} =~ /lonID=($LONCAPA::handle_re);/) { |
$cookies{'lonID'} = $1; |
$cookies{'lonID'} = $1; |
} |
} |
|
|
if ($attachmentpath =~ m-/([^/]+)$-) { |
if ($attachmentpath =~ m-/([^/]+)$-) { |
$fname = $1; |
$fname = $1; |
$displaymsg .= "<br />An uploaded screenshot file - $fname ($attachmentsize bytes) was included in the request sent by $env{'user.name'} from LON-CAPA domain: $env{'user.domain'}"; |
$displaymsg .= '<br />'.&mt('An uploaded screenshot file - [_1] ([_2] bytes) was included in the request sent by [_3] from LON-CAPA domain',$fname,$attachmentsize,$env{'user.name'}.': '.$env{'user.domain'}); |
$supportmsg .= "\n"; |
$supportmsg .= "\n"; |
foreach (@cookievars) { |
foreach my $var (@cookievars) { |
$supportmsg .= "$_: $cookies{$_}\n"; |
$supportmsg .= "$var: $cookies{$var}\n"; |
} |
} |
foreach (@ENVvars) { |
foreach my $var(@ENVvars) { |
$supportmsg .= "$_: $ENV{$_}\n"; |
$supportmsg .= "$var: $ENV{$var}\n"; |
} |
} |
foreach (@envvars) { |
foreach my $var (@envvars) { |
$supportmsg .= "$_: $env{$_}\n"; |
$supportmsg .= "$var: $env{$var}\n"; |
} |
} |
} |
} |
|
|
Line 805 END
|
Line 859 END
|
|
|
} else { |
} else { |
my $envdata = ''; |
my $envdata = ''; |
foreach (@cookievars) { |
foreach my $var (@cookievars) { |
$envdata .= "$_: $cookies{$_}\n"; |
$envdata .= "$var: $cookies{$var}\n"; |
} |
} |
foreach (@ENVvars) { |
foreach my $var (@ENVvars) { |
$envdata .= "$_: $ENV{$_}\n"; |
$envdata .= "$var: $ENV{$var}\n"; |
} |
} |
foreach (@envvars) { |
foreach my $var (@envvars) { |
$envdata .= "$_: $env{$_}\n"; |
$envdata .= "$var: $env{$var}\n"; |
} |
} |
foreach (@loncvars) { |
foreach my $var (@loncvars) { |
$envdata .= "$_: $env{$_}\n"; |
$envdata .= "$var: $env{$var}\n"; |
} |
} |
$msg->attach(Type => 'TEXT', |
$msg->attach(Type => 'TEXT', |
Data => $envdata); |
Data => $envdata); |
Line 828 END
|
Line 882 END
|
unlink($attachmentpath); |
unlink($attachmentpath); |
} |
} |
$r->print(qq| |
$r->print(qq| |
<b>Your support request contained the following information</b>:<br /><br /> |
<b>$lt{'your'}</b>:<br /><br /> |
<table width="580" border="0" cellpadding="0" cellspacing="0" bgcolor="#000000"> |
<table width="580" border="0" cellpadding="0" cellspacing="0" bgcolor="#000000"> |
<tr> |
<tr> |
<td> |
<td> |
Line 843 END
|
Line 897 END
|
<td width="140" bgcolor="$tablecolor"> |
<td width="140" bgcolor="$tablecolor"> |
<table width="140" border="0" cellpadding="8" cellspacing="0"> |
<table width="140" border="0" cellpadding="8" cellspacing="0"> |
<tr> |
<tr> |
<td align="right"><b>Information supplied</b> |
<td align="right"><b>$lt{'info'}</b> |
</td> |
</td> |
</tr> |
</tr> |
</table> |
</table> |
Line 865 END
|
Line 919 END
|
<td width="140" bgcolor="$tablecolor"> |
<td width="140" bgcolor="$tablecolor"> |
<table width="140" border="0" cellpadding="8" cellspacing="0"> |
<table width="140" border="0" cellpadding="8" cellspacing="0"> |
<tr> |
<tr> |
<td align="right"><b>Additional information recorded</b> |
<td align="right"><b>$lt{'adin'}</b> |
</td> |
</td> |
</tr> |
</tr> |
</table> |
</table> |
Line 875 END
|
Line 929 END
|
<tr> |
<tr> |
<td> |
<td> |
|); |
|); |
foreach (@cookievars) { |
foreach my $var (@cookievars) { |
unless($cookies{$_} eq '') { |
unless($cookies{$var} eq '') { |
$r->print("$_: <font color='$vlinkcolor'>$cookies{$_}</font>, "); |
$r->print("$var: <font color='$vlinkcolor'>$cookies{$var}</font>, "); |
} |
} |
} |
} |
foreach (@ENVvars) { |
foreach my $var (@ENVvars) { |
unless($ENV{$_} eq '') { |
unless($ENV{$var} eq '') { |
$r->print("$_: <font color='$vlinkcolor'>$ENV{$_}</font>, "); |
$r->print("$var: <font color='$vlinkcolor'>$ENV{$var}</font>, "); |
} |
} |
} |
} |
foreach (@envvars) { |
foreach my $var (@envvars) { |
unless($env{$_} eq '') { |
unless($env{$var} eq '') { |
$r->print("$_: <font color='$vlinkcolor'>$env{$_}</font>, "); |
$r->print("$var: <font color='$vlinkcolor'>$env{$var}</font>, "); |
} |
} |
} |
} |
$r->print(" |
$r->print(" |
Line 945 sub print_header {
|
Line 999 sub print_header {
|
<td> |
<td> |
<table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#ffffff"> |
<table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#ffffff"> |
<tr bgcolor="$tablecolor"> |
<tr bgcolor="$tablecolor"> |
<td align="center"><img src="$location/help/gif/smallHelp.gif" border="0" alt="(Login help)" valign="middle" /> <b><a href="/adm/loginproblems.html">$lt{'login'}</a></td> |
<td align="center"><img src="$location/help/gif/smallHelp.gif" border="0" alt="($lt{'login'})" valign="middle" /> <b><a href="/adm/loginproblems.html">$lt{'login'}</a></td> |
<td align="center"> <b>$helpdesk_link<img src="$location/lonIcons/helpdesk.gif" border="0" alt="(Ask helpdesk)" valign="middle" /> $lt{'ask'}</a></b> </td>$getstartlink |
<td align="center"> <b>$helpdesk_link<img src="$location/lonIcons/helpdesk.gif" border="0" alt="($lt{'ask'})" valign="middle" /> $lt{'ask'}</a></b> </td>$getstartlink |
<td align="center"> <b><a href="$origurl" target="_top"><img src="$location/lonIcons/move_up.gif" border="0" alt="(Back to last location)" valign="middle" /> $lt{'back'}</a></b> </td> |
<td align="center"> <b><a href="$origurl" target="_top"><img src="$location/lonIcons/move_up.gif" border="0" alt="($lt{'back'})" valign="middle" /> $lt{'back'}</a></b> </td> |
</tr> |
</tr> |
</table> |
</table> |
</td> |
</td> |