version 1.46, 2008/01/13 16:53:46
|
version 1.55.6.4, 2010/12/03 04:56:56
|
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 LONCAPA; |
use LONCAPA qw(:DEFAULT :match); |
|
|
|
|
sub handler { |
sub handler { |
my ($r) = @_; |
my ($r) = @_; |
Line 57 sub handler {
|
Line 56 sub handler {
|
&Apache::lonacc::get_posted_cgi($r); |
&Apache::lonacc::get_posted_cgi($r); |
} |
} |
my $function = $env{'form.function'}; |
my $function = $env{'form.function'}; |
my $origurl = &unescape($env{'form.origurl'}); |
my $origurl = $env{'form.origurl'}; |
my $command = $env{'form.command'}; |
my $command = $env{'form.command'}; |
|
|
if ($command eq 'process') { |
if ($command eq 'process') { |
Line 70 sub handler {
|
Line 69 sub handler {
|
|
|
sub print_request_form { |
sub print_request_form { |
my ($r,$origurl,$function) = @_; |
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 ($os,$browser,$bversion,$uhost,$uname,$udom,$uhome,$urole,$usec,$email,$cid, |
|
$cdom,$cnum,$ctitle,$ccode,$sectionlist,$lastname,$firstname,$server, |
|
$formname,$public); |
$function = &Apache::loncommon::get_users_function() if (!$function); |
$function = &Apache::loncommon::get_users_function() if (!$function); |
$ccode = ''; |
$ccode = ''; |
$os = $env{'browser.os'}; |
$os = $env{'browser.os'}; |
$browser = $env{'browser.type'}; |
$browser = $env{'browser.type'}; |
$bversion = $env{'browser.version'}; |
$bversion = $env{'browser.version'}; |
$uhost = $env{'request.host'}; |
$uhost = $env{'request.host'}; |
$uname = $env{'user.name'}; |
if (($env{'user.name'} eq 'public') && ($env{'user.domain'} eq 'public')) { |
$udom = $env{'user.domain'}; |
$public = 1; |
|
} else { |
|
$uname = $env{'user.name'}; |
|
$udom = $env{'user.domain'}; |
|
} |
$uhome = $env{'user.home'}; |
$uhome = $env{'user.home'}; |
$urole = $env{'request.role'}; |
$urole = $env{'request.role'}; |
$usec = $env{'request.course.sec'}; |
$usec = $env{'request.course.sec'}; |
Line 172 END
|
Line 177 END
|
my ($sec,$grp) = split(/:/,$section); |
my ($sec,$grp) = split(/:/,$section); |
$groupid{$sec} = $grp; |
$groupid{$sec} = $grp; |
} |
} |
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['codedom']); |
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['codedom', |
|
'useremail','useraccount']); |
|
if ($env{'form.origurl'} eq '/adm/createaccount') { |
|
if ($email eq '') { |
|
if ($env{'form.useremail'} =~ /^[^\@]+\@[^\@]+$/) { |
|
$email = &HTML::Entities::encode($env{'form.useremail'},'"<>&'); |
|
} |
|
} |
|
if ($uname eq '') { |
|
if ($env{'form.useraccount'} =~ /^$match_username$/) { |
|
$uname = &HTML::Entities::encode($env{'form.useraccount'},'"<>&'); |
|
} |
|
} |
|
} |
my $codedom = &get_domain(); |
my $codedom = &get_domain(); |
my $details_title; |
my $details_title; |
if ($codedom) { |
if ($codedom) { |
Line 225 function initialize_codes() {
|
Line 243 function initialize_codes() {
|
} |
} |
|
|
my $js = '<script type="text/javascript">'."\n$scripttag\n$jscript\n". |
my $js = '<script type="text/javascript">'."\n$scripttag\n$jscript\n". |
'</script>'; |
$loaditems.'</script>'; |
my %add_entries = (topmargin => "0", |
my %add_entries = (topmargin => "0", |
marginheight => "0", |
marginheight => "0", |
onLoad =>"initialize_codes()",); |
onLoad =>"initialize_codes()",); |
Line 238 function initialize_codes() {
|
Line 256 function initialize_codes() {
|
if ($r->uri eq '/adm/helpdesk') { |
if ($r->uri eq '/adm/helpdesk') { |
&print_header($r,$origurl); |
&print_header($r,$origurl); |
} |
} |
|
my @css = ('LC_evenrow_value','LC_oddrow_value'); |
|
my $num = 1; |
|
my $i = $num%2; |
$r->print('<form method="post" name="logproblem" enctype="multipart/form-data">'."\n"); |
$r->print('<form method="post" name="logproblem" enctype="multipart/form-data">'."\n"); |
my $output = &Apache::lonhtmlcommon::start_pick_box(). |
my $output = &Apache::lonhtmlcommon::start_pick_box(). |
&Apache::lonhtmlcommon::row_title($lt{'name'},undef,'LC_oddrow_value')."\n"; |
&Apache::lonhtmlcommon::row_title($lt{'name'},undef,$css[$num])."\n"; |
my $fullname = ''; |
my $fullname = ''; |
if ((defined($lastname) && $lastname ne '') && (defined($firstname) && $firstname ne '')) { |
if ((defined($lastname) && $lastname ne '') && (defined($firstname) && $firstname ne '')) { |
$fullname = "$firstname $lastname"; |
$fullname = "$firstname $lastname"; |
Line 254 function initialize_codes() {
|
Line 275 function initialize_codes() {
|
$output .= '<input type="text" size="20" name="username" value="'.&HTML::Entities::encode($fullname,'"<>&').'" />'; |
$output .= '<input type="text" size="20" name="username" value="'.&HTML::Entities::encode($fullname,'"<>&').'" />'; |
} |
} |
$output .= ' <input type="button" value="'.$lt{'subm'}.'" onclick="validate()" /> '. |
$output .= ' <input type="button" value="'.$lt{'subm'}.'" onclick="validate()" /> '. |
&Apache::lonhtmlcommon::row_closure()."\n". |
&Apache::lonhtmlcommon::row_closure()."\n"; |
&Apache::lonhtmlcommon::row_title($lt{'emad'},undef,'LC_evenrow_value'). |
$num ++; |
'<input type="text" size="20" name="email" value="'. |
$i = $num%2; |
&HTML::Entities::encode($email,'"<>&').'" /><br />'."\n". |
$output .= &Apache::lonhtmlcommon::row_title($lt{'emad'},undef,$css[$i]). |
&Apache::lonhtmlcommon::row_closure(). |
'<input type="text" size="20" name="email" value="'. |
&Apache::lonhtmlcommon::row_title($lt{'emac'},undef,'LC_oddrow_value'). |
&HTML::Entities::encode($email,'"<>&').'" /><br />'."\n". |
'<input type="text" size="50" name="cc" value="" /><br />'."\n". |
&Apache::lonhtmlcommon::row_closure(); |
&Apache::lonhtmlcommon::row_closure(). |
$num ++; |
&Apache::lonhtmlcommon::row_title("$lt{'unme'}/$lt{'doma'}",undef,'LC_evenrow_value'); |
$i = $num%2; |
|
if (($env{'user.name'} =~ /^$match_username$/) && (!$public)) { |
|
$output .= &Apache::lonhtmlcommon::row_title($lt{'emac'},undef,$css[$i]). |
|
'<input type="text" size="50" name="cc" value="" /><br />'."\n". |
|
&Apache::lonhtmlcommon::row_closure(); |
|
$num ++; |
|
$i = $num%2; |
|
} |
|
$output .= &Apache::lonhtmlcommon::row_title("$lt{'unme'}/$lt{'doma'}",undef,$css[$i]); |
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="'. |
&HTML::Entities::encode($uname,'"<>&').'" />'; |
&HTML::Entities::encode($uname,'"<>&').'" />'; |
if (defined($uname) && defined($udom)) { |
if (($env{'user.name'} =~ /^$match_username$/) && |
|
($env{'user.domain'} =~ /^$match_domain$/) && (!$public)) { |
$output .= '<i>'.$lt{'unme'}.'</i>: '.$uname.' <i>'.$lt{'doma'}.'</i>: '.$udom.$udom_input.$uname_input; |
$output .= '<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 (($env{'user.domain'} =~ /^$match_domain$/) && (!$public)) { |
$output .= $lt{'entu'}; |
$output .= $lt{'entu'}; |
} elsif (defined($uname)) { |
} elsif (($env{'user.name'} =~ /^$match_username$/) && (!$public)) { |
$output .= $lt{'chdo'}; |
$output .= $lt{'chdo'}; |
} else { |
} else { |
$output .= $lt{'entr'}; |
$output .= $lt{'entr'}; |
} |
} |
$output .= '<br />'; |
$output .= '<br />'; |
if (defined($udom)) { |
if (!$public) { |
$udomform = '<i>'.$lt{'doma'}.'</i>: '.$udom.$udom_input; |
if ($env{'user.domain'} =~ /^$match_domain$/) { |
} elsif (defined($uname)) { |
$udomform = '<i>'.$lt{'doma'}.'</i>: '.$udom.$udom_input; |
$unameform = '<i>'.$lt{'unme'}.'</i>: '.$uname.' '.$uname_input; |
} elsif ($env{'user.name'} =~ /^$match_username$/) { |
|
$unameform = '<i>'.$lt{'unme'}.'</i>: '.$uname.' '.$uname_input; |
|
} |
} |
} |
if ($udomform eq '') { |
if ($udomform eq '') { |
$udomform = '<i>'.$lt{'doma'}.'</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>'.$lt{'unme'}.'</i>: <input type="text" size="12" name="uname" value="'.$uname.'" /> '; |
$unameform= '<i>'.$lt{'unme'}.'</i>: <input type="text" size="20" name="uname" value="'.$uname.'" /> '; |
} |
} |
$output .= $unameform.$udomform; |
$output .= $unameform.$udomform; |
} |
} |
$output .= &Apache::lonhtmlcommon::row_closure(). |
$output .= &Apache::lonhtmlcommon::row_closure(); |
&Apache::lonhtmlcommon::row_title("$lt{'urlp'}",undef,'LC_oddrow_value'). |
$num ++; |
|
$i = $num%2; |
|
$output .= &Apache::lonhtmlcommon::row_title("$lt{'urlp'}",undef,$css[$i]). |
$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_evenrow_value'). |
if (&Apache::loncommon::check_for_gci_dc()) { |
'<input type="text" size="15" name="phone" /><br />'. |
$output .= &Apache::lonhtmlcommon::row_title("$lt{'phon'}",undef, |
&Apache::lonhtmlcommon::row_closure(). |
'LC_evenrow_value'). |
&Apache::lonhtmlcommon::row_title("$lt{'crsd'}$details_title",undef,'LC_oddrow_value'); |
'<input type="text" size="15" name="phone" /><br />'. |
if ($cnum) { |
&Apache::lonhtmlcommon::row_closure(); |
if ($coursecodes{$cnum}) { |
$num ++; |
foreach my $item (@codetitles) { |
$i = $num%2; |
$output .= '<i>'.$item.'</i>: '.$codes{$cnum}{$item}.'; '; |
$output .= &Apache::lonhtmlcommon::row_title("$lt{'crsd'}$details_title",undef,$css[$i]); |
|
if ($cnum) { |
|
if ($coursecodes{$cnum}) { |
|
foreach my $item (@codetitles) { |
|
$output .= '<i>'.$item.'</i>: '.$codes{$cnum}{$item}.'; '; |
|
} |
|
$output .= ' <input type="hidden" name="coursecode" value="'.&HTML::Entities::encode($coursecodes{$cnum},'"<>&').'" />'; |
|
} else { |
|
$output .= $lt{'enin'}.': |
|
<input type="text" name="coursecode" size="15" value="" />'; |
} |
} |
$output .= ' <input type="hidden" name="coursecode" value="'.&HTML::Entities::encode($coursecodes{$cnum},'"<>&').'" />'; |
|
} else { |
} else { |
$output .= $lt{'enin'}.': |
if ($totcodes > 0) { |
<input type="text" name="coursecode" size="15" value="" />'; |
my $numtitles = @codetitles; |
} |
if ($numtitles == 0) { |
} else { |
$output .= $lt{'enin'}.': |
if ($totcodes > 0) { |
<input type="text" name="coursecode" size="15" value="" />'; |
my $numtitles = @codetitles; |
|
if ($numtitles == 0) { |
|
$output .= $lt{'enin'}.': |
|
<input type="text" name="coursecode" size="15" value="" />'; |
|
} else { |
|
my $lasttitle = $numtitles; |
|
if ($numtitles > 4) { |
|
$lasttitle = 4; |
|
} |
|
$output .= '<table><tr><td>'.$codetitles[0].'<br />'."\n". |
|
'<select name="'.$codetitles[0].'" onchange="courseSet('."'$codetitles[0]'".')">'."\n". |
|
' <option value="-1" />'.$lt{'sele'}."\n"; |
|
my @items = (); |
|
my @longitems = (); |
|
if ($idlist{$codetitles[0]} =~ /","/) { |
|
@items = split(/","/,$idlist{$codetitles[0]}); |
|
} else { |
} else { |
$items[0] = $idlist{$codetitles[0]}; |
my $lasttitle = $numtitles; |
} |
if ($numtitles > 4) { |
if (defined($idlist_titles{$codetitles[0]})) { |
$lasttitle = 4; |
if ($idlist_titles{$codetitles[0]} =~ /","/) { |
} |
@longitems = split(/","/,$idlist_titles{$codetitles[0]}); |
$output .= '<table><tr><td>'.$codetitles[0].'<br />'."\n". |
|
'<select name="'.$codetitles[0].'" onchange="courseSet('."'$codetitles[0]'".')">'."\n". |
|
' <option value="-1" />'.$lt{'sele'}."\n"; |
|
my @items = (); |
|
my @longitems = (); |
|
if ($idlist{$codetitles[0]} =~ /","/) { |
|
@items = split(/","/,$idlist{$codetitles[0]}); |
} else { |
} else { |
$longitems[0] = $idlist_titles{$codetitles[0]}; |
$items[0] = $idlist{$codetitles[0]}; |
} |
} |
for (my $i=0; $i<@longitems; $i++) { |
if (defined($idlist_titles{$codetitles[0]})) { |
if ($longitems[$i] eq '') { |
if ($idlist_titles{$codetitles[0]} =~ /","/) { |
$longitems[$i] = $items[$i]; |
@longitems = split(/","/,$idlist_titles{$codetitles[0]}); |
|
} else { |
|
$longitems[0] = $idlist_titles{$codetitles[0]}; |
} |
} |
|
for (my $i=0; $i<@longitems; $i++) { |
|
if ($longitems[$i] eq '') { |
|
$longitems[$i] = $items[$i]; |
|
} |
|
} |
|
} else { |
|
@longitems = @items; |
|
} |
|
for (my $i=0; $i<@items; $i++) { |
|
$output .= ' <option value="'.$items[$i].'">'.$longitems[$i].'</option>'."\n"; |
|
} |
|
$output .= '</select></td>'; |
|
for (my $i=1; $i<$numtitles; $i++) { |
|
$output .= '<td>'.$codetitles[$i].'<br />'."\n". |
|
'<select name="'.$codetitles[$i].'" onchange="courseSet('."'$codetitles[$i]'".')">'."\n". |
|
'<option value="-1"><-'.$lt{'pick'}.' '.$codetitles[$i-1].'</option>'."\n". |
|
'</select>'."\n". |
|
'</td>'."\n"; |
|
} |
|
$output .= '</tr></table>'; |
|
if ($numtitles > 4) { |
|
$output .= '<br /><br />'.$codetitles[$numtitles].'<br />'."\n". |
|
'<select name="'.$codetitles[$numtitles].'" onchange="courseSet('."'$codetitles[$numtitles]'".')">'."\n". |
|
'<option value="-1"><-'.$lt{'pick'}.' '.$codetitles[$numtitles-1].'</option>'."\n". |
|
'</select>'."\n"; |
} |
} |
} else { |
|
@longitems = @items; |
|
} |
|
for (my $i=0; $i<@items; $i++) { |
|
$output .= ' <option value="'.$items[$i].'">'.$longitems[$i].'</option>'."\n"; |
|
} |
|
$output .= '</select></td>'; |
|
for (my $i=1; $i<$numtitles; $i++) { |
|
$output .= '<td>'.$codetitles[$i].'<br />'."\n". |
|
'<select name="'.$codetitles[$i].'" onchange="courseSet('."'$codetitles[$i]'".')">'."\n". |
|
'<option value="-1"><-'.$lt{'pick'}.' '.$codetitles[$i-1].'</option>'."\n". |
|
'</select>'."\n". |
|
'</td>'."\n"; |
|
} |
|
$output .= '</tr></table>'; |
|
if ($numtitles > 4) { |
|
$output .= '<br /><br />'.$codetitles[$numtitles].'<br />'."\n". |
|
'<select name="'.$codetitles[$numtitles].'" onchange="courseSet('."'$codetitles[$numtitles]'".')">'."\n". |
|
'<option value="-1"><-'.$lt{'pick'}.' '.$codetitles[$numtitles-1].'</option>'."\n". |
|
'</select>'."\n"; |
|
} |
} |
|
} else { |
|
$output .= $lt{'enin'}.': |
|
<input type="text" name="coursecode" size="15" value="" />'; |
} |
} |
|
} |
|
$output .= '<br />'; |
|
if ($ctitle) { |
|
$output .= '<i>'.$lt{'titl'}.'</i>: '.$ctitle. |
|
'<input type="hidden" name="title" value="'. |
|
&HTML::Entities::encode($ctitle,'"<>&').'" />'."\n"; |
} else { |
} else { |
$output .= $lt{'enin'}.': |
$output .= $lt{'enct'}.': |
<input type="text" name="coursecode" size="15" value="" />'; |
<input type="text" name="title" size="25" value="" />'."\n"; |
} |
} |
} |
$output .= &Apache::lonhtmlcommon::row_closure(); |
if ($ctitle) { |
$num ++; |
$output .= '<br /><i>'.$lt{'titl'}.'</i>: '.$ctitle. |
$i = $num%2; |
'<input type="hidden" name="title" value="'. |
$output .= &Apache::lonhtmlcommon::row_title($lt{'secn'},undef,$css[$i]); |
&HTML::Entities::encode($ctitle,'"<>&').'" />'."\n"; |
if ($sectionlist) { |
} else { |
$output .= "<select name=\"section\"\n>". |
$output .= '<br />'.$lt{'enct'}.': |
" <option value=\"\" selected=\"selected\">$lt{'sele'}</option>\n"; |
<input type="text" name="title" size="25" value="" />'."\n"; |
foreach my $id (sort(keys(%groupid))) { |
} |
if ($id eq $groupid{$id} || $groupid{$id} eq '') { |
$output .= &Apache::lonhtmlcommon::row_closure(). |
$output .= " <option value=". |
&Apache::lonhtmlcommon::row_title($lt{'secn'},undef,'LC_evenrow_value'); |
&HTML::Entities::encode($id,'"<>&'). |
if ($sectionlist) { |
" >$id</option>\n"; |
$output .= "<select name=\"section\"\n>". |
} else { |
" <option value=\"\" selected=\"selected\">$lt{'sele'}</option>\n"; |
$output .= " <option value=". |
foreach my $id (sort(keys(%groupid))) { |
&HTML::Entities::encode($id,'"<>&'). |
if ($id eq $groupid{$id} || $groupid{$id} eq '') { |
" >$id - ($lt{'lsec'}: $groupid{$id})</option>\n"; |
$output .= " <option value=". |
} |
&HTML::Entities::encode($id,'"<>&'). |
|
" >$id</option>\n"; |
|
} else { |
|
$output .= " <option value=". |
|
&HTML::Entities::encode($id,'"<>&'). |
|
" >$id - ($lt{'lsec'}: $groupid{$id})</option>\n"; |
|
} |
} |
|
$output .= "</select>"; |
|
} else { |
|
$output .= '<input type="text" name="section" size="10" />'; |
} |
} |
$output .= "</select>"; |
$output .= &Apache::lonhtmlcommon::row_closure(); |
} else { |
|
$output .= '<input type="text" name="section" size="10" />'; |
|
} |
} |
$output .= &Apache::lonhtmlcommon::row_closure(). |
$num ++; |
&Apache::lonhtmlcommon::row_title($lt{'subj'},undef,'LC_oddrow_value'). |
$i = $num%2; |
|
$output .= &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_evenrow_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'; |
$num ++; |
if (defined($env{'user.name'})) { |
$i = $num%2; |
$output .= &Apache::lonhtmlcommon::row_title($lt{'opfi'},undef,'LC_oddrow_value'). |
if (($env{'user.name'} =~ /^$match_username$/) && (!$public)) { |
|
$output .= &Apache::lonhtmlcommon::row_title($lt{'opfi'},undef,$css[$i]). |
' <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'; |
$num ++; |
|
$i = $num%2; |
} |
} |
$output .= &Apache::lonhtmlcommon::row_title($lt{'fini'},undef,$lastrow); |
$output .= &Apache::lonhtmlcommon::row_title($lt{'fini'},undef,$css[$i]); |
$output .= <<END; |
$output .= <<END; |
<table border="0" cellpadding="8" cellspacing="0"> |
<table border="0" cellpadding="8" cellspacing="0"> |
<tr> |
<tr> |
Line 454 sub print_request_receipt {
|
Line 500 sub print_request_receipt {
|
$defdom,$origmail); |
$defdom,$origmail); |
my $from = $admin; |
my $from = $admin; |
my $reporttime = &Apache::lonlocal::locallocaltime(time); |
my $reporttime = &Apache::lonlocal::locallocaltime(time); |
my @formvars = ('username','email','uname','udom','sourceurl','phone','section','coursecode','title','subject','description','screenshot'); |
my @formvars = ('username','email','uname','udom','sourceurl'); |
|
if (&Apache::loncommon::check_for_gci_dc()) { |
|
push(@formvars,('phone','section','coursecode','title')); |
|
} |
|
push(@formvars,('subject','description','screenshot')); |
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},\@formvars); |
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},\@formvars); |
my $coursecode = $env{'form.coursecode'}; |
my $coursecode = $env{'form.coursecode'}; |
if ($coursecode eq '') { |
if (&Apache::loncommon::check_for_gci_dc()) { |
if (defined($env{'form.Year'})) { |
if ($coursecode eq '') { |
$coursecode .= $env{'form.Year'}; |
if (defined($env{'form.Year'})) { |
} |
$coursecode .= $env{'form.Year'}; |
if (defined($env{'form.Semester'})) { |
} |
$coursecode .= $env{'form.Semester'}; |
if (defined($env{'form.Semester'})) { |
} |
$coursecode .= $env{'form.Semester'}; |
if (defined($env{'form.Department'})) { |
} |
$coursecode .= $env{'form.Department'}; |
if (defined($env{'form.Department'})) { |
} |
$coursecode .= $env{'form.Department'}; |
if (defined($env{'form.Number'})) { |
} |
$coursecode .= $env{'form.Number'}; |
if (defined($env{'form.Number'})) { |
|
$coursecode .= $env{'form.Number'}; |
|
} |
} |
} |
} |
} |
my %lt = &Apache::lonlocal::texthash ( |
my %lt = &Apache::lonlocal::texthash ( |
username => 'Name', |
username => 'Name', |
email => 'Email', |
email => 'E-mail', |
cc => 'Cc', |
cc => 'Cc', |
user => 'Username/domain', |
user => 'Username/domain', |
phone => 'Phone', |
phone => 'Phone', |
Line 493 sub print_request_receipt {
|
Line 544 sub print_request_receipt {
|
); |
); |
|
|
my (@ok_ccs,@bad_ccs,$badccmsg,$okcclist); |
my (@ok_ccs,@bad_ccs,$badccmsg,$okcclist); |
if (defined($env{'form.cc'})) { |
if ((defined($env{'user.name'})) && (defined($env{'form.cc'}))) { |
my @ccs; |
my @ccs; |
if ($env{'form.cc'} =~ /,/) { |
if ($env{'form.cc'} =~ /,/) { |
@ccs = split(/,/,$env{'form.cc'}); |
@ccs = split(/,/,$env{'form.cc'}); |
Line 526 sub print_request_receipt {
|
Line 577 sub print_request_receipt {
|
} |
} |
} |
} |
$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'}; |
if (&Apache::loncommon::check_for_gci_dc()) { |
|
$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{'cc'}: $okcclist |
$lt{'user'}: $env{'form.user'} |
$lt{'user'}: $env{'form.user'} |
|
END |
|
if (&Apache::loncommon::check_for_gci_dc()) { |
|
$supportmsg .= <<END |
$lt{'phone'}: $env{'form.phone'} |
$lt{'phone'}: $env{'form.phone'} |
$lt{'crsi'}: $env{'form.csri'} |
$lt{'crsi'}: $env{'form.csri'} |
|
END |
|
} |
|
$supportmsg = <<END; |
$lt{'subject'}: $env{'form.subject'} |
$lt{'subject'}: $env{'form.subject'} |
$lt{'description'}: $env{'form.description'} |
$lt{'description'}: $env{'form.description'} |
$lt{'sourceurl'}: $env{'form.sourceurl'} |
$lt{'sourceurl'}: $env{'form.sourceurl'} |
Line 541 $lt{'date'}: $reporttime
|
Line 600 $lt{'date'}: $reporttime
|
|
|
END |
END |
my $displaymsg; |
my $displaymsg; |
foreach my $item ('username','email','cc','user','phone','crsi','subject','description','sourceurl') { |
my @items = ('username','email','cc','user'); |
|
if (&Apache::loncommon::check_for_gci_dc()) { |
|
push(@items,'phone','crsi'); |
|
} |
|
push(@items,('subject','description','sourceurl')); |
|
foreach my $item (@items) { |
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'}; |
$descrip =~ s|\n|<br />|g; |
$descrip = &cleanup_html($descrip); |
|
$descrip =~ s|[\n\r\f]|<br />|g; |
$displaymsg .= |
$displaymsg .= |
'<span class="LC_helpform_receipt_cat">'. |
'<span class="LC_helpform_receipt_cat">'. |
"$lt{$item}</span>: $descrip<br />\n"; |
"$lt{$item}</span>: $descrip<br />\n"; |
} elsif ($item eq 'sourceurl') { |
} elsif ($item eq 'sourceurl') { |
my $showurl = $env{'form.sourceurl'}; |
my $showurl = $env{'form.sourceurl'}; |
$showurl =~ s/\?.*$//; |
$showurl =~ s/\?.*$//; |
|
$showurl = &cleanup_html($showurl); |
$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"; |
Line 560 END
|
Line 626 END
|
'<span class="LC_helpform_receipt_cat">'. |
'<span class="LC_helpform_receipt_cat">'. |
"$lt{$item}</span>: $okcclist<br />\n"; |
"$lt{$item}</span>: $okcclist<br />\n"; |
} else { |
} else { |
|
my $showitem = $env{'form.'.$item}; |
|
$showitem = &cleanup_html($showitem); |
$displaymsg .= |
$displaymsg .= |
'<span class="LC_helpform_receipt_cat">'. |
'<span class="LC_helpform_receipt_cat">'. |
"$lt{$item}</span>: $env{'form.'.$item}<br />\n"; |
"$lt{$item}</span>: $showitem<br />\n"; |
} |
} |
} |
} |
} |
} |
Line 663 END
|
Line 731 END
|
|
|
if ($attachmentpath =~ m-/([^/]+)$-) { |
if ($attachmentpath =~ m-/([^/]+)$-) { |
$fname = $1; |
$fname = $1; |
$displaymsg .= '<br />'.&mt('An uploaded screenshot file \'[_1]\' ([_2] bytes) was included in the request sent by [_3].',$fname,$attachmentsize,$env{'user.name'}.': '.$env{'user.domain'}); |
$displaymsg .= '<br />' |
|
.&mt('An uploaded screenshot file [_1] ([_2] bytes) was included in the request sent by [_3].' |
|
,'<span class="LC_filename">'.$fname.'<span>' |
|
,$attachmentsize |
|
,$env{'user.name'}.':'.$env{'user.domain'} |
|
); |
$supportmsg .= "\n"; |
$supportmsg .= "\n"; |
foreach my $var (@cookievars) { |
foreach my $var (@cookievars) { |
$supportmsg .= "$var: $cookies{$var}\n"; |
$supportmsg .= "$var: $cookies{$var}\n"; |
Line 720 END
|
Line 793 END
|
unlink($attachmentpath); |
unlink($attachmentpath); |
} |
} |
$r->print('<b>'.$lt{'your'}.'</b>:<br /><br />'."\n"); |
$r->print('<b>'.$lt{'your'}.'</b>:<br /><br />'."\n"); |
$r->print(&Apache::lonhtmlcommon::start_pick_box('LC_helpform_receipt'). |
$r->print('<div style="width:620px;">'. |
|
&Apache::lonhtmlcommon::start_pick_box(). |
&Apache::lonhtmlcommon::row_title($lt{'info'},undef,'LC_oddrow_value')."\n".$displaymsg."\n". |
&Apache::lonhtmlcommon::row_title($lt{'info'},undef,'LC_oddrow_value')."\n".$displaymsg."\n". |
&Apache::lonhtmlcommon::row_closure(). |
&Apache::lonhtmlcommon::row_closure(). |
&Apache::lonhtmlcommon::row_title($lt{'adin'},undef,'LC_evenrow_value')); |
&Apache::lonhtmlcommon::row_title($lt{'adin'},undef,'LC_evenrow_value')); |
Line 746 END
|
Line 820 END
|
$envmsg =~ s/, $//; |
$envmsg =~ s/, $//; |
$r->print($envmsg."\n". |
$r->print($envmsg."\n". |
&Apache::lonhtmlcommon::row_closure(1)."\n". |
&Apache::lonhtmlcommon::row_closure(1)."\n". |
&Apache::lonhtmlcommon::end_pick_box()."\n". |
&Apache::lonhtmlcommon::end_pick_box(). |
|
"</div>\n". |
&Apache::loncommon::end_page()); |
&Apache::loncommon::end_page()); |
} |
} |
|
|
Line 762 sub print_header {
|
Line 837 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.'); |
|
} |
|
if ($origurl eq '') { |
|
$origurl = 'javascript:history.go(-1)'; |
} |
} |
$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" /> |
|
LON-CAPA $lt{'headline'} |
|
</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/help.png" 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"> <b>$helpdesk_link<img src="$location/lonIcons/helpdesk.gif" border="0" alt="($lt{'ask'})" valign="middle" /> $lt{'ask'}</a></b> </span></td>$getstartlink |
<td align="center"><span class="LC_nobreak"> <b>$helpdesk_link<img src="$location/lonIcons/helpdesk.gif" border="0" alt="($lt{'ask'})" valign="middle" /> $lt{'ask'}</a></b> </span></td>$getstartlink |
<td align="center"><span class="LC_nobreak"> <b><a href="$origurl" target="_top"><img src="$location/lonIcons/move_up.gif" border="0" alt="($lt{'back'})" valign="middle" /> $lt{'back'}</a></b> </span></td> |
<td align="center"><span class="LC_nobreak"> <b><a href="$origurl" target="_top"><img src="$location/lonIcons/move_up.gif" border="0" alt="($lt{'back'})" valign="middle" /> $lt{'back'}</a></b> </span></td> |
</tr> |
</tr> |
Line 791 END
|
Line 876 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>'); |
} |
} |
Line 810 sub get_domain {
|
Line 898 sub get_domain {
|
} elsif ($env{'request.role.domain'}) { |
} elsif ($env{'request.role.domain'}) { |
$codedom = $env{'request.role.domain'}; |
$codedom = $env{'request.role.domain'}; |
} else { |
} else { |
$codedom = $Apache::lonnet::perlvar{'lonDefDomain'}; |
$codedom = &Apache::lonnet::default_login_domain(); |
} |
} |
return $codedom; |
return $codedom; |
} |
} |
|
|
|
sub cleanup_html { |
|
my ($incoming) = @_; |
|
my $outgoing; |
|
if ($incoming ne '') { |
|
$outgoing = $incoming; |
|
$outgoing =~ s/\#/#/g; |
|
$outgoing =~ s/\&/&/g; |
|
$outgoing =~ s/</</g; |
|
$outgoing =~ s/>/>/g; |
|
$outgoing =~ s/\(/(/g; |
|
$outgoing =~ s/\)/)/g; |
|
$outgoing =~ s/"/"/g; |
|
$outgoing =~ s/'/'/g; |
|
$outgoing =~ s/\$/$/g; |
|
} |
|
return $outgoing; |
|
} |
|
|
1; |
1; |