version 1.45, 2007/12/04 04:43:21
|
version 1.47, 2008/01/29 17:36:56
|
Line 99 sub print_request_form {
|
Line 99 sub print_request_form {
|
rdes => 'You must include a description', |
rdes => 'You must include a description', |
name => 'Name', |
name => 'Name', |
subm => 'Submit Request', |
subm => 'Submit Request', |
emad => 'E-mail address', |
emad => 'Your e-mail address', |
|
emac => 'Cc', |
unme => 'username', |
unme => 'username', |
doma => 'domain', |
doma => 'domain', |
entu => 'Enter the username you use to log-in to LON-CAPA', |
entu => 'Enter the username you use to log-in to LON-CAPA', |
Line 258 function initialize_codes() {
|
Line 259 function initialize_codes() {
|
'<input type="text" size="20" name="email" value="'. |
'<input type="text" size="20" name="email" value="'. |
&HTML::Entities::encode($email,'"<>&').'" /><br />'."\n". |
&HTML::Entities::encode($email,'"<>&').'" /><br />'."\n". |
&Apache::lonhtmlcommon::row_closure(). |
&Apache::lonhtmlcommon::row_closure(). |
&Apache::lonhtmlcommon::row_title("$lt{'unme'}/$lt{'doma'}",undef,'LC_oddrow_value'); |
&Apache::lonhtmlcommon::row_title($lt{'emac'},undef,'LC_oddrow_value'). |
|
'<input type="text" size="50" name="cc" value="" /><br />'."\n". |
|
&Apache::lonhtmlcommon::row_closure(). |
|
&Apache::lonhtmlcommon::row_title("$lt{'unme'}/$lt{'doma'}",undef,'LC_evenrow_value'); |
my $udom_input = '<input type="hidden" name="udom" value="'. |
my $udom_input = '<input type="hidden" name="udom" value="'. |
&HTML::Entities::encode($udom,'"<>&').'" />'; |
&HTML::Entities::encode($udom,'"<>&').'" />'; |
my $uname_input = '<input type="hidden" name="uname" value="'. |
my $uname_input = '<input type="hidden" name="uname" value="'. |
Line 291 function initialize_codes() {
|
Line 295 function initialize_codes() {
|
$output .= $unameform.$udomform; |
$output .= $unameform.$udomform; |
} |
} |
$output .= &Apache::lonhtmlcommon::row_closure(). |
$output .= &Apache::lonhtmlcommon::row_closure(). |
&Apache::lonhtmlcommon::row_title("$lt{'urlp'}",undef,'LC_evenrow_value'). |
&Apache::lonhtmlcommon::row_title("$lt{'urlp'}",undef,'LC_oddrow_value'). |
$showserver.'<input type="hidden" name="sourceurl" value="'. |
$showserver.'<input type="hidden" name="sourceurl" value="'. |
&HTML::Entities::encode($server,'"<>&').'" />'. |
&HTML::Entities::encode($server,'"<>&').'" />'. |
&Apache::lonhtmlcommon::row_closure(). |
&Apache::lonhtmlcommon::row_closure(). |
&Apache::lonhtmlcommon::row_title("$lt{'phon'}",undef,'LC_oddrow_value'). |
&Apache::lonhtmlcommon::row_title("$lt{'phon'}",undef,'LC_evenrow_value'). |
'<input type="text" size="15" name="phone" /><br />'. |
'<input type="text" size="15" name="phone" /><br />'. |
&Apache::lonhtmlcommon::row_closure(). |
&Apache::lonhtmlcommon::row_closure(). |
&Apache::lonhtmlcommon::row_title("$lt{'crsd'}$details_title",undef,'LC_evenrow_value'); |
&Apache::lonhtmlcommon::row_title("$lt{'crsd'}$details_title",undef,'LC_oddrow_value'); |
if ($cnum) { |
if ($cnum) { |
if ($coursecodes{$cnum}) { |
if ($coursecodes{$cnum}) { |
foreach my $item (@codetitles) { |
foreach my $item (@codetitles) { |
$output .= '<i>'.$item.'</i>: '.$codes{$cnum}{$item}.'; '; |
$output .= '<i>'.$item.'</i>: '.$codes{$cnum}{$item}.'; '; |
Line 377 function initialize_codes() {
|
Line 381 function initialize_codes() {
|
<input type="text" name="title" size="25" value="" />'."\n"; |
<input type="text" name="title" size="25" value="" />'."\n"; |
} |
} |
$output .= &Apache::lonhtmlcommon::row_closure(). |
$output .= &Apache::lonhtmlcommon::row_closure(). |
&Apache::lonhtmlcommon::row_title($lt{'secn'},undef,'LC_oddrow_value'); |
&Apache::lonhtmlcommon::row_title($lt{'secn'},undef,'LC_evenrow_value'); |
if ($sectionlist) { |
if ($sectionlist) { |
$output .= "<select name=\"section\"\n>". |
$output .= "<select name=\"section\"\n>". |
" <option value=\"\" selected=\"selected\">$lt{'sele'}</option>\n"; |
" <option value=\"\" selected=\"selected\">$lt{'sele'}</option>\n"; |
Line 397 function initialize_codes() {
|
Line 401 function initialize_codes() {
|
$output .= '<input type="text" name="section" size="10" />'; |
$output .= '<input type="text" name="section" size="10" />'; |
} |
} |
$output .= &Apache::lonhtmlcommon::row_closure(). |
$output .= &Apache::lonhtmlcommon::row_closure(). |
&Apache::lonhtmlcommon::row_title($lt{'subj'},undef,'LC_evenrow_value'). |
&Apache::lonhtmlcommon::row_title($lt{'subj'},undef,'LC_oddrow_value'). |
' <input type="text" size="40" name="subject" />'."\n". |
' <input type="text" size="40" name="subject" />'."\n". |
&Apache::lonhtmlcommon::row_closure(). |
&Apache::lonhtmlcommon::row_closure(). |
&Apache::lonhtmlcommon::row_title($lt{'detd'},undef,'LC_oddrow_value'). |
&Apache::lonhtmlcommon::row_title($lt{'detd'},undef,'LC_evenrow_value'). |
' <textarea rows="10" cols="45" name="description" wrap="virtual"></textarea>'. |
' <textarea rows="10" cols="45" name="description" wrap="virtual"></textarea>'. |
&Apache::lonhtmlcommon::row_closure(); |
&Apache::lonhtmlcommon::row_closure(); |
my $lastrow = 'LC_evenrow_value'; |
my $lastrow = 'LC_evenrow_value'; |
if (defined($env{'user.name'})) { |
if (defined($env{'user.name'})) { |
$output .= &Apache::lonhtmlcommon::row_title($lt{'opfi'},undef,'LC_evenrow_value'). |
$output .= &Apache::lonhtmlcommon::row_title($lt{'opfi'},undef,'LC_oddrow_value'). |
' <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(); |
$lastrow = 'LC_oddrow_value'; |
$lastrow = 'LC_oddrow_value'; |
Line 471 sub print_request_receipt {
|
Line 475 sub print_request_receipt {
|
my %lt = &Apache::lonlocal::texthash ( |
my %lt = &Apache::lonlocal::texthash ( |
username => 'Name', |
username => 'Name', |
email => 'Email', |
email => 'Email', |
|
cc => 'Cc', |
user => 'Username/domain', |
user => 'Username/domain', |
phone => 'Phone', |
phone => 'Phone', |
crsi => 'Course Information', |
crsi => 'Course Information', |
Line 486 sub print_request_receipt {
|
Line 491 sub print_request_receipt {
|
info => 'Information supplied', |
info => 'Information supplied', |
adin => 'Additional information recorded', |
adin => 'Additional information recorded', |
); |
); |
|
|
|
my (@ok_ccs,@bad_ccs,$badccmsg,$okcclist); |
|
if (defined($env{'form.cc'})) { |
|
my @ccs; |
|
if ($env{'form.cc'} =~ /,/) { |
|
@ccs = split(/,/,$env{'form.cc'}); |
|
} else { |
|
$env{'form.cc'} =~ s/^\s+//; |
|
$env{'form.cc'} =~ s/\s+$//; |
|
@ccs = $env{'form.cc'}; |
|
} |
|
foreach my $cc (@ccs) { |
|
$cc =~ s/^\s+//g; |
|
$cc =~ s/\s+$//g; |
|
if ($cc =~ m/^[^\@]+\@[^\@]+$/) { |
|
if (!(grep(/^\Q$cc\E$/,@ok_ccs))) { |
|
push(@ok_ccs,$cc); |
|
} |
|
} else { |
|
if (!(grep(/^\Q$cc\E$/,@bad_ccs))) { |
|
push(@bad_ccs,$cc); |
|
} |
|
} |
|
} |
|
if (@ok_ccs > 0) { |
|
$okcclist = join(', ',@ok_ccs); |
|
} |
|
if (@bad_ccs == 1) { |
|
$badccmsg .= '<br />'.&mt('The following Cc e-mail address is invalid: ').$bad_ccs[0]; |
|
} elsif (@bad_ccs > 1) { |
|
my $bad_cc_string = join(', ',@bad_ccs); |
|
$badccmsg .= '<br />'.&mt('The following Cc e-mail addresses are invalid: ').$bad_cc_string; |
|
} |
|
} |
$env{'form.user'} = "'".$env{'form.uname'}.':'.$env{'form.udom'}."'"; |
$env{'form.user'} = "'".$env{'form.uname'}.':'.$env{'form.udom'}."'"; |
$env{'form.csri'} = $env{'form.title'}.' - '.$coursecode.' - '.$lt{'sect'}.': '.$env{'form.section'}; |
$env{'form.csri'} = $env{'form.title'}.' - '.$coursecode.' - '.$lt{'sect'}.': '.$env{'form.section'}; |
my $supportmsg = <<END; |
my $supportmsg = <<END; |
$lt{'username'}: $env{'form.username'} |
$lt{'username'}: $env{'form.username'} |
$lt{'email'}: $env{'form.email'} |
$lt{'email'}: $env{'form.email'} |
|
$lt{'cc'}: $okcclist |
$lt{'user'}: $env{'form.user'} |
$lt{'user'}: $env{'form.user'} |
$lt{'phone'}: $env{'form.phone'} |
$lt{'phone'}: $env{'form.phone'} |
$lt{'crsi'}: $env{'form.csri'} |
$lt{'crsi'}: $env{'form.csri'} |
Line 502 $lt{'date'}: $reporttime
|
Line 541 $lt{'date'}: $reporttime
|
|
|
END |
END |
my $displaymsg; |
my $displaymsg; |
foreach my $item ('username','email','user','phone','crsi','subject','description','sourceurl') { |
foreach my $item ('username','email','cc','user','phone','crsi','subject','description','sourceurl') { |
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'}; |
Line 516 END
|
Line 555 END
|
$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"; |
|
} elsif ($item eq 'cc') { |
|
$displaymsg .= |
|
'<span class="LC_helpform_receipt_cat">'. |
|
"$lt{$item}</span>: $okcclist<br />\n"; |
} else { |
} else { |
$displaymsg .= |
$displaymsg .= |
'<span class="LC_helpform_receipt_cat">'. |
'<span class="LC_helpform_receipt_cat">'. |
Line 549 END
|
Line 592 END
|
my @ok_email; |
my @ok_email; |
foreach my $email (split(/,/,$to)) { |
foreach my $email (split(/,/,$to)) { |
if ($email =~ m/^[^\@]+\@[^\@]+$/) { |
if ($email =~ m/^[^\@]+\@[^\@]+$/) { |
push(@ok_email,$email); |
if (!grep(/^\Q$email\E$/,@ok_email)) { |
|
push(@ok_email,$email); |
|
} |
} |
} |
} |
} |
if (@ok_email > 0) { |
if (@ok_email > 0) { |
Line 575 END
|
Line 620 END
|
$r->print('<h3>'.$lt{'asup'}.' '.$to.'</h3>'); |
$r->print('<h3>'.$lt{'asup'}.' '.$to.'</h3>'); |
} |
} |
if (defined($env{'form.email'})) { |
if (defined($env{'form.email'})) { |
|
$env{'form.email'} =~ s/^\s+//; |
|
$env{'form.email'} =~ s/\s+$//; |
if ($env{'form.email'} =~ m/^[^\@]+\@[^\@]+$/) { |
if ($env{'form.email'} =~ m/^[^\@]+\@[^\@]+$/) { |
$from = $env{'form.email'}; |
$from = $env{'form.email'}; |
} |
} |
} |
} |
|
|
|
if (defined($env{'form.cc'})) { |
|
if ($badccmsg) { |
|
$displaymsg .= $badccmsg; |
|
} |
|
} |
|
|
my $subject = $env{'form.subject'}; |
my $subject = $env{'form.subject'}; |
$subject =~ s/(`)/'/g; |
$subject =~ s/(`)/'/g; |
$subject =~ s/\$/\(\$\)/g; |
$subject =~ s/\$/\(\$\)/g; |
Line 630 END
|
Line 683 END
|
Type =>'TEXT', |
Type =>'TEXT', |
Data => $supportmsg, |
Data => $supportmsg, |
); |
); |
|
if (@ok_ccs > 0) { |
|
my $cc_string = join(', ',@ok_ccs); |
|
$msg->add("Cc" => $cc_string); |
|
} |
|
|
if ($attachmentpath) { |
if ($attachmentpath) { |
my ($type, $encoding) = MIME::Types::by_suffix($attachmentpath); |
my ($type, $encoding) = MIME::Types::by_suffix($attachmentpath); |
Line 705 sub print_header {
|
Line 762 sub print_header {
|
login => 'Log-in help', |
login => 'Log-in help', |
ask => 'Ask helpdesk', |
ask => 'Ask helpdesk', |
getst => 'Getting started guide', |
getst => 'Getting started guide', |
back => 'Back to last location' |
back => 'Back to last location', |
|
headline => 'help/support', |
); |
); |
my ($getstartlink,$getstarttext); |
my ($getstartlink,$reviewtext); |
if (-e $Apache::lonnet::perlvar{'lonDocRoot'}.'/adm/gettingstarted.html') { |
if (-e $Apache::lonnet::perlvar{'lonDocRoot'}.'/adm/gettingstarted.html') { |
$getstartlink = qq|<td align="center"> <b><a href="/adm/gettingstarted.html">$lt{'getst'}</a></td>|; |
$getstartlink = qq|<td align="center"> <b><a href="/adm/gettingstarted.html">$lt{'getst'}</a></td>|; |
$getstarttext = ' '.&mt('and the "Getting started" guide').' '; |
$reviewtext = &mt('Please review the information in "Log-in help" and the "Getting started" guide if you are unable to log-in.'); |
|
} else { |
|
$reviewtext = &mt('Please review the information in "Log-in help" if you are unable to log-in.'); |
} |
} |
$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 help/support</font></b></legend> |
<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> |
<table id="LC_helpmenu_links"> |
<table id="LC_helpmenu_links"> |
<tr> |
<tr> |
<td align="center"><span class="LC_nobreak"><img src="$location/help/gif/smallHelp.gif" 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/gif/smallHelp.gif" border="0" alt="($lt{'login'})" valign="middle" /> <b><a href="/adm/loginproblems.html">$lt{'login'}</a></b> </span></td> |
Line 734 END
|
Line 794 END
|
if ($command ne 'process') { |
if ($command ne 'process') { |
$r->print(' |
$r->print(' |
<tr> |
<tr> |
<td colspan="3">'.&mt(' |
<td colspan="3">'.$reviewtext.' ' |
Please review the information in "Log-in help"').$getstarttext.' '.&mt('if you are unable to log-in').'. '.&mt('If your problem is still unresolved, the form below can be used to send a question to the LON-CAPA helpdesk').'.<br /><font size="-1"><b>'.&mt('Students').'</b>: '.&mt('Do <b>not</b> use this form to ask questions about course content.').' '.&mt('Contact your instructor instead.').'</font><br /><br /> |
.&mt('If your problem is still unresolved, the form below can be used to send a question to the LON-CAPA helpdesk.').'<br />' |
|
.'<font size="-1"><b>'.&mt('Students').'</b>: '.&mt('Do <b>not</b> use this form to ask questions about course content.').' ' |
|
.&mt('Contact your instructor instead.') |
|
.'</font><br /><br /> |
</td> |
</td> |
</tr>'); |
</tr>'); |
} |
} |