version 1.56, 2010/04/14 03:09:35
|
version 1.79.2.7, 2019/08/28 02:17:10
|
Line 1
|
Line 1
|
|
# The LearningOnline Network with CAPA |
|
# Helpdesk request form |
# |
# |
# $Id$ |
# $Id$ |
# |
# |
Line 36 use Apache::lonhtmlcommon;
|
Line 38 use Apache::lonhtmlcommon;
|
use Apache::lonnet; |
use Apache::lonnet; |
use Apache::lonlocal; |
use Apache::lonlocal; |
use Apache::lonacc(); |
use Apache::lonacc(); |
|
use Apache::lonauth(); |
use Apache::courseclassifier; |
use Apache::courseclassifier; |
use LONCAPA; |
use LONCAPA qw(:DEFAULT :match); |
|
use HTML::Entities; |
|
|
sub handler { |
sub handler { |
my ($r) = @_; |
my ($r) = @_; |
Line 56 sub handler {
|
Line 59 sub handler {
|
if ($r->uri eq '/adm/helpdesk') { |
if ($r->uri eq '/adm/helpdesk') { |
&Apache::lonacc::get_posted_cgi($r); |
&Apache::lonacc::get_posted_cgi($r); |
} |
} |
my $function = $env{'form.function'}; |
my $function; |
my $origurl = &unescape($env{'form.origurl'}); |
if ($env{'form.function'}) { |
|
if (($env{'form.function'} eq 'norole') || |
|
($env{'form.function'} eq 'student') || |
|
($env{'form.function'} eq 'admin') || |
|
($env{'form.function'} eq 'author')) { |
|
$function = $env{'form.function'}; |
|
} |
|
} |
|
my $origurl = $env{'form.origurl'}; |
|
if ($origurl =~ m{^https?://[^/]+(.*)$}) { |
|
$origurl =~ $1; |
|
} |
|
$origurl =~ s/(`)//g; |
|
$origurl =~ s/\$/\(\$\)/g; |
my $command = $env{'form.command'}; |
my $command = $env{'form.command'}; |
|
|
if ($command eq 'process') { |
if ($command eq 'process') { |
Line 67 sub handler {
|
Line 83 sub handler {
|
} |
} |
return OK; |
return OK; |
} |
} |
|
|
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,$uname,$udom,$uhome,$urole,$usec,$email,$cid, |
|
$cdom,$cnum,$ctitle,$ccode,$sectionlist,$lastname,$firstname,$server, |
|
$formname,$public,$homeserver,$knownuser,$captcha_form,$captcha_error, |
|
$captcha,$recaptcha_version,$extra_validations,%groupid); |
$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'}; |
if (($env{'user.name'} eq 'public') && ($env{'user.domain'} eq 'public')) { |
my ($uname,$udom); |
$public = 1; |
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'}; |
|
$cid = $env{'request.course.id'}; |
|
$formname = 'logproblem'; |
|
my $machine = &Apache::lonnet::absolute_url(); |
|
if ($origurl =~ m-^https?://-) { |
|
$server = $origurl; |
|
} else { |
} else { |
$server = $machine.$origurl; |
if (($env{'user.name'} ne '') && ($env{'user.domain'} ne '')) { |
|
$homeserver = &Apache::lonnet::homeserver($env{'user.name'}, |
|
$env{'user.domain'}); |
|
if ($homeserver eq 'no_host') { |
|
undef($homeserver); |
|
} else { |
|
$uname = $env{'user.name'}; |
|
$udom = $env{'user.domain'}; |
|
} |
|
} |
} |
} |
my $showserver = $server; |
if (($env{'user.name'} =~ /^$match_username$/) && |
$showserver =~ s/\?.*$//; |
($env{'user.domain'} =~ /^$match_domain$/) && (!$public)) { |
my %lt = &Apache::lonlocal::texthash ( |
$knownuser = 1; |
|
} else { |
|
my $lonhost = $r->dir_config('lonHostID'); |
|
($captcha_form,$captcha_error,$captcha,$recaptcha_version) = |
|
&Apache::loncommon::captcha_display('login',$lonhost); |
|
} |
|
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['codedom', |
|
'useremail','useraccount']); |
|
|
|
if ($homeserver) { |
|
$uhome = $env{'user.home'}; |
|
$urole = $env{'request.role'}; |
|
$usec = $env{'request.course.sec'}; |
|
$cid = $env{'request.course.id'}; |
|
} |
|
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); |
|
$ctitle = $csettings{'description'}; |
|
$ccode = $csettings{'internal.coursecode'}; |
|
$sectionlist = $csettings{'internal.sectionnums'}; |
|
my @sections = split(/,/,$sectionlist); |
|
foreach my $section (@sections) { |
|
my ($sec,$grp) = split(/:/,$section); |
|
$groupid{$sec} = $grp; |
|
} |
|
} |
|
|
|
$formname = 'logproblem'; |
|
my $codedom = &get_domain(); |
|
my %helpform; |
|
my %domconfig = |
|
&Apache::lonnet::get_dom('configuration',['contacts'],$codedom); |
|
if (ref($domconfig{'contacts'}) eq 'HASH') { |
|
if (ref($domconfig{'contacts'}{'helpform'}) eq 'HASH') { |
|
%helpform = %{$domconfig{'contacts'}{'helpform'}}; |
|
} |
|
} |
|
|
|
my %codes; |
|
my @codetitles; |
|
my %cat_titles; |
|
my %cat_order; |
|
my %idlist; |
|
my %idnums; |
|
my %idlist_titles; |
|
my $totcodes = 0; |
|
my $jscript = ''; |
|
my $loaditems = qq| |
|
function initialize_codes() { |
|
return; |
|
} |
|
|; |
|
unless ($helpform{'course'} eq 'no') { |
|
my $instcats = &Apache::lonnet::get_dom_instcats($codedom); |
|
if (ref($instcats) eq 'HASH') { |
|
if ((ref($instcats->{'codetitles'}) eq 'ARRAY') && (ref($instcats->{'codes'}) eq 'HASH') && |
|
(ref($instcats->{'cat_titles'}) eq 'HASH') && (ref($instcats->{'cat_order'}) eq 'HASH')) { |
|
%codes = %{$instcats->{'codes'}}; |
|
@codetitles = @{$instcats->{'codetitles'}}; |
|
%cat_titles = %{$instcats->{'cat_titles'}}; |
|
%cat_order = %{$instcats->{'cat_order'}}; |
|
$totcodes = scalar(keys(%codes)); |
|
} |
|
if ($totcodes > 0) { |
|
my $numtypes = @codetitles; |
|
&Apache::courseclassifier::build_code_selections(\%codes,\@codetitles,\%cat_titles,\%cat_order,\%idlist,\%idnums,\%idlist_titles); |
|
my ($scripttext,$longtitles) = &Apache::courseclassifier::javascript_definitions(\@codetitles,\%idlist,\%idlist_titles,\%idnums,\%cat_titles); |
|
my $longtitles_str = join('","',@{$longtitles}); |
|
my $allidlist = $idlist{$codetitles[0]}; |
|
my $knowncodes; |
|
if (($ccode ne '') && ($cnum ne '')) { |
|
my (%singlecodes,@singlecodetitles,%singlecat_titles,%singlecat_order); |
|
my $crscode_reply = &Apache::lonnet::auto_instcode_format($cnum,$codedom,{ $cnum => $ccode },\%singlecodes, |
|
\@singlecodetitles,\%singlecat_titles,\%singlecat_order); |
|
if (ref($singlecodes{$cnum}) eq 'HASH') { |
|
$knowncodes = $singlecodes{$cnum}; |
|
} |
|
} |
|
$jscript .= &Apache::courseclassifier::courseset_js_start($formname,$longtitles_str,$allidlist); |
|
$jscript .= $scripttext; |
|
$jscript .= &Apache::courseclassifier::javascript_code_selections($formname,\@codetitles,$knowncodes,$sectionlist); |
|
$loaditems = ''; |
|
} |
|
} |
|
} |
|
my %missing = &Apache::lonlocal::texthash( |
|
username => 'You must include a name.', |
|
phone => 'You must include a phone.', |
|
); |
|
&js_escape(\%missing); |
|
if (keys(%helpform)) { |
|
foreach my $key (keys(%helpform)) { |
|
if (($helpform{$key} eq 'req') && ($missing{$key} ne '')) { |
|
next if (($key eq 'username') && (($knownuser) || |
|
(($env{'user.name'} =~ /^$match_username$/) && (!$public)))); |
|
$extra_validations .= <<"END"; |
|
|
|
if (document.$formname.$key.value == '') { |
|
alert("$missing{$key}"); |
|
return; |
|
} |
|
|
|
END |
|
} |
|
} |
|
} |
|
my $machine = &Apache::lonnet::absolute_url(); |
|
my $sourceurl = $machine.$origurl; |
|
$server = $machine.&Apache::loncommon::cleanup_html($origurl); |
|
$server =~ s/\?.*$//; |
|
my %js_lt = &Apache::lonlocal::texthash ( |
email => 'The e-mail address you entered', |
email => 'The e-mail address you entered', |
notv => 'is not a valid e-mail address', |
notv => 'is not a valid e-mail address', |
rsub => 'You must include a subject', |
rsub => 'You must include a subject', |
rdes => 'You must include a description', |
rdes => 'You must include a description', |
|
); |
|
my %html_lt = &Apache::lonlocal::texthash ( |
name => 'Name', |
name => 'Name', |
subm => 'Submit Request', |
subm => 'Submit Request', |
emad => 'Your e-mail address', |
emad => 'Your e-mail address', |
emac => 'Cc', |
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 122 sub print_request_form {
|
Line 254 sub print_request_form {
|
subj => 'Subject', |
subj => 'Subject', |
detd => 'Detailed Description', |
detd => 'Detailed Description', |
opfi => 'Optional file upload', |
opfi => 'Optional file upload', |
uplf => 'Upload a file (e.g., a screenshot) relevant to your help request (128 KB max.)', |
uplf => 'Upload a file (e.g., a screenshot) relevant to your help request', |
fini => 'Finish', |
fini => 'Finish', |
clfm => 'Clear Form', |
clfm => 'Clear Form', |
); |
); |
|
&js_escape(\%js_lt); |
|
&html_escape(\%html_lt); |
my $scripttag = (<<"END"); |
my $scripttag = (<<"END"); |
function validate() { |
function validate() { |
if (validmail(document.logproblem.email) == false) { |
if (validmail(document.logproblem.email) == false) { |
alert("$lt{'email'}: "+document.logproblem.email.value+" $lt{'notv'}."); |
alert("$js_lt{'email'}: "+document.logproblem.email.value+" $js_lt{'notv'}."); |
return; |
return; |
} |
} |
if (document.logproblem.subject.value == '') { |
if (document.logproblem.subject.value == '') { |
alert("$lt{'rsub'}."); |
alert("$js_lt{'rsub'}."); |
return; |
return; |
} |
} |
if (document.logproblem.description.value == '') { |
if (document.logproblem.description.value == '') { |
alert("$lt{'rdes'}."); |
alert("$js_lt{'rdes'}."); |
return; |
return; |
} |
} |
|
$extra_validations |
document.logproblem.submit(); |
document.logproblem.submit(); |
} |
} |
|
|
END |
END |
$scripttag .= &Apache::lonhtmlcommon::javascript_valid_email(); |
$scripttag .= &Apache::lonhtmlcommon::javascript_valid_email(); |
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); |
|
$ctitle = $csettings{'description'}; |
|
$ccode = $csettings{'internal.coursecode'}; |
|
$sectionlist = $csettings{'internal.sectionnums'}; |
|
} |
|
|
|
if ($env{'environment.permanentemail'}) { |
if ($homeserver) { |
$email = $env{'environment.permanentemail'}; |
if ($env{'environment.permanentemail'}) { |
} elsif ($env{'environment.critnotification'}) { |
$email = $env{'environment.permanentemail'}; |
$email = $env{'environment.critnotification'}; |
} elsif ($env{'environment.critnotification'}) { |
} elsif ($env{'environment.notification'}) { |
$email = $env{'environment.critnotification'}; |
$email = $env{'environment.notification'}; |
} elsif ($env{'environment.notification'}) { |
} |
$email = $env{'environment.notification'}; |
if ($env{'environment.lastname'}) { |
} |
$lastname = $env{'environment.lastname'}; |
if ($env{'environment.lastname'}) { |
} |
$lastname = $env{'environment.lastname'}; |
if ($env{'environment.firstname'}) { |
} |
$firstname = $env{'environment.firstname'}; |
if ($env{'environment.firstname'}) { |
} |
$firstname = $env{'environment.firstname'}; |
my @sections = split(/,/,$sectionlist); |
} |
my %groupid; |
} |
foreach my $section (@sections) { |
if ($env{'form.origurl'} eq '/adm/createaccount') { |
my ($sec,$grp) = split(/:/,$section); |
if ($email eq '') { |
$groupid{$sec} = $grp; |
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'},'"<>&'); |
|
} |
|
} |
} |
} |
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['codedom']); |
|
my $codedom = &get_domain(); |
|
my $details_title; |
my $details_title; |
if ($codedom) { |
if ($codedom) { |
$details_title = '<br />('.$codedom.')'; |
$details_title = '<br />('.$codedom.')'; |
} |
} |
my %coursecodes; |
|
my %codes; |
my $js = <<"ENDJS"; |
my @codetitles; |
<script type="text/javascript"> |
my %cat_titles; |
// <![CDATA[ |
my %cat_order; |
$scripttag |
my %idlist; |
$jscript |
my %idnums; |
$loaditems |
my %idlist_titles; |
// ]]> |
my $caller = 'global'; |
</script> |
my $totcodes = 0; |
ENDJS |
my $format_reply; |
if ($knownuser) { |
my $jscript = ''; |
$js .="\n".'<script type="text/javascript" src="/res/adm/includes/file_upload.js"></script>'; |
my $loaditems = qq| |
} elsif ($recaptcha_version >=2) { |
function initialize_codes() { |
$js.= "\n".'<script src="https://www.google.com/recaptcha/api.js"></script>'."\n"; |
return; |
} |
} |
my %add_entries = ( |
|; |
style => "margin-top:0px;margin-bottom:0px;", |
if ($cnum) { |
onload => "initialize_codes();", |
$coursecodes{$cnum} = $ccode; |
); |
if ($ccode eq '') { |
|
$totcodes = &Apache::courseclassifier::retrieve_instcodes(\%coursecodes,$codedom,$totcodes); |
|
} else { |
|
$coursecodes{$cnum} = $ccode; |
|
$caller = $cnum; |
|
$totcodes ++; |
|
} |
|
} else { |
|
$totcodes = &Apache::courseclassifier::retrieve_instcodes(\%coursecodes,$codedom,$totcodes); |
|
} |
|
if ($totcodes > 0) { |
|
if ($ccode eq '') { |
|
$format_reply = &Apache::lonnet::auto_instcode_format($caller,$codedom,\%coursecodes,\%codes,\@codetitles,\%cat_titles,\%cat_order); |
|
if ($format_reply eq 'ok') { |
|
my $numtypes = @codetitles; |
|
&Apache::courseclassifier::build_code_selections(\%codes,\@codetitles,\%cat_titles,\%cat_order,\%idlist,\%idnums,\%idlist_titles); |
|
my ($scripttext,$longtitles) = &Apache::courseclassifier::javascript_definitions(\@codetitles,\%idlist,\%idlist_titles,\%idnums,\%cat_titles); |
|
my $longtitles_str = join('","',@{$longtitles}); |
|
my $allidlist = $idlist{$codetitles[0]}; |
|
$jscript .= &Apache::courseclassifier::courseset_js_start($formname,$longtitles_str,$allidlist); |
|
$jscript .= $scripttext; |
|
$jscript .= &Apache::courseclassifier::javascript_code_selections($formname,@codetitles); |
|
$loaditems = ''; |
|
} |
|
} |
|
} |
|
|
|
my $js = '<script type="text/javascript">'."\n$scripttag\n$jscript\n". |
|
'</script>'; |
|
my %add_entries = (topmargin => "0", |
|
marginheight => "0", |
|
onLoad =>"initialize_codes()",); |
|
|
|
|
|
$r->print(&Apache::loncommon::start_page('Support Request',$js, |
$r->print(&Apache::loncommon::start_page('Support Request',$js, |
Line 244 function initialize_codes() {
|
Line 343 function initialize_codes() {
|
my @css = ('LC_evenrow_value','LC_oddrow_value'); |
my @css = ('LC_evenrow_value','LC_oddrow_value'); |
my $num = 1; |
my $num = 1; |
my $i = $num%2; |
my $i = $num%2; |
$r->print('<form method="post" name="logproblem" enctype="multipart/form-data">'."\n"); |
my $formtype; |
|
if ($homeserver) { |
|
$formtype = ' enctype="multipart/form-data"'; |
|
} |
|
my $topsubmit = ' <input type="button" value="'.$html_lt{'subm'}.'" onclick="validate()" /> '; |
|
my $shownsubmit; |
|
$r->print('<form method="post" action="" name="logproblem"'.$formtype.'>'."\n"); |
my $output = &Apache::lonhtmlcommon::start_pick_box(). |
my $output = &Apache::lonhtmlcommon::start_pick_box(). |
&Apache::lonhtmlcommon::row_title($lt{'name'},undef,$css[$num])."\n"; |
&Apache::lonhtmlcommon::row_headline(). |
my $fullname = ''; |
'<span class="LC_info">'. |
if ((defined($lastname) && $lastname ne '') && (defined($firstname) && $firstname ne '')) { |
&mt('(All fields marked with * are required.)'). |
$fullname = "$firstname $lastname"; |
'</span>'. |
$output .= $fullname.'<input type="hidden" name="username" value="'.&HTML::Entities::encode($fullname,'"<>&').'" />'; |
&Apache::lonhtmlcommon::row_closure(); |
} else { |
unless ($helpform{'username'} eq 'no') { |
if (defined($firstname) && $firstname ne '') { |
my ($reqd,$namefield,$fullname); |
$fullname = $firstname; |
if ((defined($lastname) && $lastname ne '') && (defined($firstname) && $firstname ne '')) { |
} elsif (defined($lastname) && $lastname ne '') { |
$fullname = "$firstname $lastname"; |
$fullname = " $lastname"; |
$namefield = $fullname.'<input type="hidden" name="username" value="'.&HTML::Entities::encode($fullname,'"<>&').'" />'."\n"; |
|
} else { |
|
if (defined($firstname) && $firstname ne '') { |
|
$fullname = $firstname; |
|
} elsif (defined($lastname) && $lastname ne '') { |
|
$fullname = " $lastname"; |
|
} |
|
$namefield = '<input type="text" size="20" name="username" value="'.&HTML::Entities::encode($fullname,'"<>&').'" />'."\n"; |
|
if ($helpform{'username'} eq 'req') { |
|
$reqd = '<span class="LC_info">*</span>'; |
|
} |
} |
} |
$output .= '<input type="text" size="20" name="username" value="'.&HTML::Entities::encode($fullname,'"<>&').'" />'; |
$output .= &Apache::lonhtmlcommon::row_title($html_lt{'name'}.$reqd,undef,$css[$num])."\n".$namefield. |
|
$topsubmit. |
|
&Apache::lonhtmlcommon::row_closure()."\n"; |
|
$shownsubmit = 1; |
|
$num ++; |
|
$i = $num%2; |
} |
} |
$output .= ' <input type="button" value="'.$lt{'subm'}.'" onclick="validate()" /> '. |
$output .= &Apache::lonhtmlcommon::row_title( |
&Apache::lonhtmlcommon::row_closure()."\n"; |
'<span title="'.&mt('required').'">'. |
$num ++; |
$html_lt{'emad'}.' <span class="LC_info">*</span></span>' |
$i = $num%2; |
,undef,$css[$i]). |
$output .= &Apache::lonhtmlcommon::row_title($lt{'emad'},undef,$css[$i]). |
|
'<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,'"<>&').'" />'."\n"; |
&Apache::lonhtmlcommon::row_closure(); |
unless ($shownsubmit) { |
|
$output .= $topsubmit; |
|
} |
|
$output .= &Apache::lonhtmlcommon::row_closure(); |
$num ++; |
$num ++; |
$i = $num%2; |
$i = $num%2; |
if (defined($uname)) { |
if ($knownuser) { |
$output .= &Apache::lonhtmlcommon::row_title($lt{'emac'},undef,$css[$i]). |
if ($homeserver) { |
'<input type="text" size="50" name="cc" value="" /><br />'."\n". |
unless ($helpform{'cc'} eq 'no') { |
&Apache::lonhtmlcommon::row_closure(); |
$output .= &Apache::lonhtmlcommon::row_title($html_lt{'emac'},undef,$css[$i]). |
$num ++; |
'<input type="text" size="50" name="cc" value="" /><br />'."\n". |
$i = $num%2; |
&Apache::lonhtmlcommon::row_closure(); |
|
$num ++; |
|
$i = $num%2; |
|
} |
|
} |
} |
} |
$output .= &Apache::lonhtmlcommon::row_title("$lt{'unme'}/$lt{'doma'}",undef,$css[$i]); |
unless ($helpform{'user'} eq 'no') { |
my $udom_input = '<input type="hidden" name="udom" value="'. |
$output .= &Apache::lonhtmlcommon::row_title("$html_lt{'unme'}/$html_lt{'doma'}",undef,$css[$i]); |
&HTML::Entities::encode($udom,'"<>&').'" />'; |
my $udom_input = '<input type="hidden" name="udom" value="'. |
my $uname_input = '<input type="hidden" name="uname" value="'. |
&HTML::Entities::encode($udom,'"<>&').'" />'."\n"; |
&HTML::Entities::encode($uname,'"<>&').'" />'; |
my $uname_input = '<input type="hidden" name="uname" value="'. |
if (defined($uname) && defined($udom)) { |
&HTML::Entities::encode($uname,'"<>&').'" />'."\n"; |
$output .= '<i>'.$lt{'unme'}.'</i>: '.$uname.' <i>'.$lt{'doma'}.'</i>: '.$udom.$udom_input.$uname_input; |
if ($knownuser) { |
} else { |
$output .= '<i>'.$html_lt{'unme'}.'</i>: '.$uname.' <i>'.$html_lt{'doma'}.'</i>: '.$udom.$udom_input.$uname_input; |
my $udomform = ''; |
|
my $unameform = ''; |
|
if (defined($udom)) { |
|
$output .= $lt{'entu'}; |
|
} elsif (defined($uname)) { |
|
$output .= $lt{'chdo'}; |
|
} else { |
} else { |
$output .= $lt{'entr'}; |
my $udomform = ''; |
} |
my $unameform = ''; |
$output .= '<br />'; |
if (($env{'user.domain'} =~ /^$match_domain$/) && (!$public)) { |
if (defined($udom)) { |
$output .= $html_lt{'entu'}; |
$udomform = '<i>'.$lt{'doma'}.'</i>: '.$udom.$udom_input; |
} elsif (($env{'user.name'} =~ /^$match_username$/) && (!$public)) { |
} elsif (defined($uname)) { |
$output .= $html_lt{'chdo'}; |
$unameform = '<i>'.$lt{'unme'}.'</i>: '.$uname.' '.$uname_input; |
} else { |
} |
$output .= $html_lt{'entr'}; |
if ($udomform eq '') { |
} |
$udomform = '<i>'.$lt{'doma'}.'</i>: '; |
$output .= '<br />'."\n"; |
$udomform .= &Apache::loncommon::select_dom_form($codedom,'udom'); |
if (!$public) { |
} |
if ($env{'user.domain'} =~ /^$match_domain$/) { |
if ($unameform eq '') { |
$udomform = '<i>'.$html_lt{'doma'}.'</i>: '.$udom.$udom_input; |
$unameform= '<i>'.$lt{'unme'}.'</i>: <input type="text" size="12" name="uname" value="'.$uname.'" /> '; |
} elsif ($env{'user.name'} =~ /^$match_username$/) { |
|
$unameform = '<i>'.$html_lt{'unme'}.'</i>: '.$uname.' '.$uname_input; |
|
} |
|
} |
|
if ($udomform eq '') { |
|
$udomform = '<i>'.$html_lt{'doma'}.'</i>: '; |
|
$udomform .= &Apache::loncommon::select_dom_form($codedom,'udom')."\n"; |
|
} |
|
if ($unameform eq '') { |
|
$unameform= '<i>'.$html_lt{'unme'}.'</i>: <input type="text" size="20" name="uname" value="'.$uname.'" /> '; |
|
} |
|
$output .= $unameform.$udomform; |
} |
} |
$output .= $unameform.$udomform; |
$output .= &Apache::lonhtmlcommon::row_closure(); |
|
$num ++; |
} |
} |
$output .= &Apache::lonhtmlcommon::row_closure(); |
|
$num ++; |
|
$i = $num%2; |
$i = $num%2; |
$output .= &Apache::lonhtmlcommon::row_title("$lt{'urlp'}",undef,$css[$i]). |
$output .= &Apache::lonhtmlcommon::row_title("$html_lt{'urlp'}",undef,$css[$i]). |
$showserver.'<input type="hidden" name="sourceurl" value="'. |
$server."\n".'<input type="hidden" name="sourceurl" value="'. |
&HTML::Entities::encode($server,'"<>&').'" />'. |
&HTML::Entities::encode($sourceurl,'"<>&').'" />'."\n". |
&Apache::lonhtmlcommon::row_closure(). |
|
&Apache::lonhtmlcommon::row_title("$lt{'phon'}",undef,'LC_evenrow_value'). |
|
'<input type="text" size="15" name="phone" /><br />'. |
|
&Apache::lonhtmlcommon::row_closure(); |
&Apache::lonhtmlcommon::row_closure(); |
$num ++; |
unless ($helpform{'phone'} eq 'no') { |
$i = $num%2; |
my $reqd; |
$output .= &Apache::lonhtmlcommon::row_title("$lt{'crsd'}$details_title",undef,$css[$i]); |
if ($helpform{'phone'} eq 'req') { |
if ($cnum) { |
$reqd = '<span class="LC_info">*</span>'; |
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="" />'; |
|
} |
} |
} else { |
$output .= &Apache::lonhtmlcommon::row_title($html_lt{'phon'}.$reqd,undef,'LC_evenrow_value'). |
|
'<input type="text" size="15" name="phone" /><br />'."\n". |
|
&Apache::lonhtmlcommon::row_closure(); |
|
$num ++; |
|
$i = $num%2; |
|
} |
|
unless ($helpform{'course'} eq 'no') { |
|
$output .= &Apache::lonhtmlcommon::row_title("$html_lt{'crsd'}$details_title",undef,$css[$i]); |
if ($totcodes > 0) { |
if ($totcodes > 0) { |
my $numtitles = @codetitles; |
my $numtitles = @codetitles; |
if ($numtitles == 0) { |
if ($numtitles == 0) { |
$output .= $lt{'enin'}.': |
$output .= $html_lt{'enin'}.': |
<input type="text" name="coursecode" size="15" value="" />'; |
<input type="text" name="coursecode" size="15" value="" />'."\n"; |
} else { |
} else { |
|
my @standardnames = &Apache::loncommon::get_standard_codeitems(); |
my $lasttitle = $numtitles; |
my $lasttitle = $numtitles; |
if ($numtitles > 4) { |
if ($numtitles > 4) { |
$lasttitle = 4; |
$lasttitle = 4; |
} |
} |
|
my $onchange; |
|
if ($sectionlist) { |
|
$onchange = 'toggleSecVis()'; |
|
} |
$output .= '<table><tr><td>'.$codetitles[0].'<br />'."\n". |
$output .= '<table><tr><td>'.$codetitles[0].'<br />'."\n". |
'<select name="'.$codetitles[0].'" onchange="courseSet('."'$codetitles[0]'".')">'."\n". |
'<select name="'.$standardnames[0].'" onchange="courseSet('."'$codetitles[0]'".');'.$onchange.'">'."\n". |
' <option value="-1" />'.$lt{'sele'}."\n"; |
' <option value="-1">'.$html_lt{'sele'}."</option>\n"; |
my @items = (); |
my @items = (); |
my @longitems = (); |
my @longitems = (); |
if ($idlist{$codetitles[0]} =~ /","/) { |
if ($idlist{$codetitles[0]} =~ /","/) { |
Line 372 function initialize_codes() {
|
Line 503 function initialize_codes() {
|
$output .= '</select></td>'; |
$output .= '</select></td>'; |
for (my $i=1; $i<$numtitles; $i++) { |
for (my $i=1; $i<$numtitles; $i++) { |
$output .= '<td>'.$codetitles[$i].'<br />'."\n". |
$output .= '<td>'.$codetitles[$i].'<br />'."\n". |
'<select name="'.$codetitles[$i].'" onchange="courseSet('."'$codetitles[$i]'".')">'."\n". |
'<select name="'.$standardnames[$i].'" onchange="courseSet('."'$codetitles[$i]'".');'.$onchange.'">'."\n". |
'<option value="-1"><-'.$lt{'pick'}.' '.$codetitles[$i-1].'</option>'."\n". |
'<option value="-1"><-'.$html_lt{'pick'}.' '.$codetitles[$i-1].'</option>'."\n". |
'</select>'."\n". |
'</select>'."\n". |
'</td>'."\n"; |
'</td>'."\n"; |
} |
} |
$output .= '</tr></table>'; |
$output .= '</tr></table>'; |
if ($numtitles > 4) { |
if ($numtitles > 4) { |
$output .= '<br /><br />'.$codetitles[$numtitles].'<br />'."\n". |
$output .= '<br /><br />'.$codetitles[$numtitles].'<br />'."\n". |
'<select name="'.$codetitles[$numtitles].'" onchange="courseSet('."'$codetitles[$numtitles]'".')">'."\n". |
'<select name="'.$standardnames[$numtitles].'" onchange="courseSet('."'$codetitles[$numtitles]'".');'.$onchange.'">'."\n". |
'<option value="-1"><-'.$lt{'pick'}.' '.$codetitles[$numtitles-1].'</option>'."\n". |
'<option value="-1"><-'.$html_lt{'pick'}.' '.$codetitles[$numtitles-1].'</option>'."\n". |
'</select>'."\n"; |
'</select>'."\n"; |
} |
} |
} |
} |
} else { |
} else { |
$output .= $lt{'enin'}.': |
$output .= $html_lt{'enin'}.': |
<input type="text" name="coursecode" size="15" value="" />'; |
<input type="text" name="coursecode" size="15" value="" />'."\n"; |
} |
} |
} |
my $reqd; |
if ($ctitle) { |
if ($helpform{'course'} eq 'req') { |
$output .= '<br /><i>'.$lt{'titl'}.'</i>: '.$ctitle. |
$reqd = '<span class="LC_info">*</span>'; |
'<input type="hidden" name="title" value="'. |
} |
|
$output .= '<br />'.$html_lt{'enct'}.$reqd.': |
|
<input type="text" name="title" size="25" value="'. |
&HTML::Entities::encode($ctitle,'"<>&').'" />'."\n"; |
&HTML::Entities::encode($ctitle,'"<>&').'" />'."\n"; |
} else { |
$output .= &Apache::lonhtmlcommon::row_closure(); |
$output .= '<br />'.$lt{'enct'}.': |
$num ++; |
<input type="text" name="title" size="25" value="" />'."\n"; |
$i = $num%2; |
} |
} |
$output .= &Apache::lonhtmlcommon::row_closure(); |
unless ($helpform{'section'} eq 'no') { |
$num ++; |
$output .= &Apache::lonhtmlcommon::row_title($html_lt{'secn'},undef,$css[$i]); |
$i = $num%2; |
if ($sectionlist) { |
$output .= &Apache::lonhtmlcommon::row_title($lt{'secn'},undef,$css[$i]); |
$output .= "<div id=\"LC_helpdesk_sectionlist\"><select name=\"sectionsel\">\n". |
if ($sectionlist) { |
" <option value=\"\" selected=\"selected\">$html_lt{'sele'}</option>\n"; |
$output .= "<select name=\"section\"\n>". |
foreach my $id (sort(keys(%groupid))) { |
" <option value=\"\" selected=\"selected\">$lt{'sele'}</option>\n"; |
if ($id eq $groupid{$id} || $groupid{$id} eq '') { |
foreach my $id (sort(keys(%groupid))) { |
$output .= " <option value=". |
if ($id eq $groupid{$id} || $groupid{$id} eq '') { |
&HTML::Entities::encode($id,'"<>&'). |
$output .= " <option value=". |
" >$id</option>\n"; |
&HTML::Entities::encode($id,'"<>&'). |
} else { |
" >$id</option>\n"; |
$output .= " <option value=". |
} else { |
&HTML::Entities::encode($id,'"<>&'). |
$output .= " <option value=". |
" >$id - ($html_lt{'lsec'}: $groupid{$id})</option>\n"; |
&HTML::Entities::encode($id,'"<>&'). |
} |
" >$id - ($lt{'lsec'}: $groupid{$id})</option>\n"; |
|
} |
} |
|
$output .= '</select></div>'."\n". |
|
'<div id="LC_helpdesk_section" style="display:none">'. |
|
'<input type="text" name="sectiontxt" size="10" /></div>'."\n"; |
|
} else { |
|
$output .= '<input type="text" name="section" size="10" />'."\n"; |
} |
} |
$output .= "</select>"; |
$output .= &Apache::lonhtmlcommon::row_closure(); |
} else { |
$num ++; |
$output .= '<input type="text" name="section" size="10" />'; |
$i = $num%2; |
} |
} |
$output .= &Apache::lonhtmlcommon::row_closure(); |
$output .= &Apache::lonhtmlcommon::row_title( |
$num ++; |
'<span title="'.&mt('required').'">'. |
$i = $num%2; |
$html_lt{'subj'}.' <span class="LC_info">*</span></span>' |
$output .= &Apache::lonhtmlcommon::row_title($lt{'subj'},undef,'LC_oddrow_value'). |
,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( |
' <textarea rows="10" cols="45" name="description" wrap="virtual"></textarea>'. |
'<span title="'.&mt('required').'">'. |
|
$html_lt{'detd'}.' <span class="LC_info">*</span></span>' |
|
,undef,'LC_evenrow_value'). |
|
'<textarea rows="10" cols="45" name="description" style="word-wrap:normal;">'. |
|
'</textarea>'."\n". |
&Apache::lonhtmlcommon::row_closure(); |
&Apache::lonhtmlcommon::row_closure(); |
$num ++; |
$num ++; |
$i = $num%2; |
$i = $num%2; |
if (defined($uname)) { |
if ($knownuser) { |
$output .= &Apache::lonhtmlcommon::row_title($lt{'opfi'},undef,$css[$i]). |
if ($homeserver) { |
' <input type="file" name="screenshot" size="20" /><br />'.$lt{'uplf'}."\n". |
unless ($helpform{'screenshot'} eq 'no') { |
&Apache::lonhtmlcommon::row_closure(); |
my $max = 1048576; |
$num ++; |
my $showmax = 1.00; |
$i = $num%2; |
if ($helpform{'maxsize'} =~ /^\d+\.\d*$/) { |
|
$max *= $helpform{'maxsize'}; |
|
$showmax = $helpform{'maxsize'}; |
|
} |
|
$showmax = ' ('.sprintf("%.2f",$showmax).' '.&mt('MB max.').')'; |
|
$output .= &Apache::lonhtmlcommon::row_title($html_lt{'opfi'},undef,$css[$i]) |
|
.' <input type="file" name="screenshot" class="LC_flUpload" size="20" />' |
|
.'<input type="hidden" id="LC_free_space" value="'.$max.'" />' |
|
.'<br />'."\n".$html_lt{'uplf'}.$showmax."\n" |
|
.&Apache::lonhtmlcommon::row_closure(); |
|
$num ++; |
|
$i = $num%2; |
|
} |
|
} |
|
} else { |
|
if ($captcha_form) { |
|
$output .= &Apache::lonhtmlcommon::row_title( |
|
'<span title="'.&mt('required').'">'. |
|
&mt('Validation'). |
|
' <span class="LC_info">*</span></span>' |
|
,undef,$css[$i]). |
|
$captcha_form."\n". |
|
&Apache::lonhtmlcommon::row_closure(); |
|
$num ++; |
|
$i = $num%2; |
|
} |
} |
} |
$output .= &Apache::lonhtmlcommon::row_title($lt{'fini'},undef,$css[$i]); |
$output .= &Apache::lonhtmlcommon::row_title($html_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> |
<td> |
<td> |
<input type="hidden" name="command" value="process" /> |
<input type="hidden" name="command" value="process" /> |
<input type="button" value="$lt{'subm'}" onclick="validate()" /> |
<input type="button" value="$html_lt{'subm'}" onclick="validate()" /> |
</td> |
</td> |
<td> </td> |
<td> </td> |
<td> |
<td> |
<input type="reset" value="$lt{'clfm'}" /> |
<input type="reset" value="$html_lt{'clfm'}" /> |
</td> |
</td> |
</tr> |
</tr> |
</table> |
</table> |
Line 466 END
|
Line 632 END
|
|
|
sub print_request_receipt { |
sub print_request_receipt { |
my ($r,$url,$function) = @_; |
my ($r,$url,$function) = @_; |
|
my $public; |
|
if (($env{'user.name'} eq 'public') && ($env{'user.domain'} eq 'public')) { |
|
$public = 1; |
|
} |
|
my $lonhost = $r->dir_config('lonHostID'); |
|
unless (($env{'user.name'} =~ /^$match_username$/) && (!$public)) { |
|
my ($captcha_chk,$captcha_error) = |
|
&Apache::loncommon::captcha_response('login',$lonhost); |
|
if ($captcha_chk != 1) { |
|
$r->print(&Apache::loncommon::start_page('Support request failed',undef, |
|
{'function' => $function, |
|
'add_entries' => { |
|
topmargin => "0", |
|
marginheight => "0", |
|
}, |
|
'only_body' => 1,})); |
|
if ($r->uri eq '/adm/helpdesk') { |
|
&print_header($r,$url,'process'); |
|
} |
|
$r->print( |
|
'<h2>'.&mt('Support request failed').'</h2>'. |
|
&Apache::lonhtmlcommon::confirm_success( |
|
&mt('Validation of the code you entered failed.'),1). |
|
'<br /><br />'. |
|
&Apache::lonhtmlcommon::actionbox([ |
|
&mt('[_1]Go back[_2] and try again', |
|
'<a href="javascript:history.go(-1)">','</a>')]). |
|
&Apache::loncommon::end_page()); |
|
return; |
|
} |
|
} |
my @ENVvars = ('HTTP_HOST','HTTP_USER_AGENT','REMOTE_ADDR','SERVER_ADDR','SERVER_NAME'); |
my @ENVvars = ('HTTP_HOST','HTTP_USER_AGENT','REMOTE_ADDR','SERVER_ADDR','SERVER_NAME'); |
my @envvars = ('browser.os','browser.type','browser.version','user.home','request.role'); |
my @envvars = ('browser.os','browser.type','browser.version','user.home','request.role'); |
my @loncvars = ('user.name','user.domain','request.course.sec','request.course.id'); |
my @loncvars = ('user.name','user.domain','request.course.sec','request.course.id'); |
my @cookievars = ('lonID'); |
my @cookievars; |
|
if ($ENV{'SERVER_PORT'} == 443) { |
|
@cookievars = ('lonLinkID'); |
|
} else { |
|
@cookievars = ('lonID'); |
|
} |
|
|
my $admin = $Apache::lonnet::perlvar{'lonAdminMail'}; |
my $admin = $Apache::lonnet::perlvar{'lonAdminMail'}; |
my $origmail = $Apache::lonnet::perlvar{'lonSupportEMail'}; |
my $origmail = $Apache::lonnet::perlvar{'lonSupportEMail'}; |
my $defdom = &get_domain(); |
my $defdom = &get_domain(); |
my $to = &Apache::loncommon::build_recipient_list(undef,'helpdeskmail', |
|
$defdom,$origmail); |
|
my $from = $admin; |
my $from = $admin; |
my $bcc; |
my %helpform; |
my %domconfig = |
my %domconfig = |
&Apache::lonnet::get_dom('configuration',['contacts'],$defdom); |
&Apache::lonnet::get_dom('configuration',['contacts'],$defdom); |
if (ref($domconfig{'contacts'}) eq 'HASH') { |
if (ref($domconfig{'contacts'}) eq 'HASH') { |
if (exists($domconfig{'contacts'}{'helpdeskmail'})) { |
if (ref($domconfig{'contacts'}{'helpform'}) eq 'HASH') { |
if (ref($domconfig{'contacts'}{'helpdeskmail'}) eq 'HASH') { |
%helpform = %{$domconfig{'contacts'}{'helpform'}}; |
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); |
|
} |
|
} |
|
} |
|
} |
} |
} |
} |
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 = ( |
|
email => 1, |
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},\@formvars); |
sourceurl => 1, |
my $coursecode = $env{'form.coursecode'}; |
subject => 1, |
if ($coursecode eq '') { |
description => 1, |
if (defined($env{'form.Year'})) { |
); |
$coursecode .= $env{'form.Year'}; |
unless ($helpform{'username'} eq 'no') { |
} |
$formvars{'username'} = 1; |
if (defined($env{'form.Semester'})) { |
} |
$coursecode .= $env{'form.Semester'}; |
unless ($helpform{'user'} eq 'no') { |
} |
$formvars{'uname'} = 1; |
if (defined($env{'form.Department'})) { |
$formvars{'udom'} = 1; |
$coursecode .= $env{'form.Department'}; |
} |
} |
unless ($helpform{'phone'} eq 'no') { |
if (defined($env{'form.Number'})) { |
$formvars{'phone'} = 1; |
$coursecode .= $env{'form.Number'}; |
} |
|
unless ($helpform{'section'} eq 'no') { |
|
$formvars{'section'} = 1; |
|
} |
|
unless ($helpform{'course'} eq 'no') { |
|
$formvars{'course'} = 1; |
|
} |
|
unless ($helpform{'cc'} eq 'no') { |
|
$formvars{'cc'} = 1; |
|
} |
|
unless ($helpform{'screenshot'} eq 'no') { |
|
$formvars{'screenshot'} = 1; |
|
} |
|
my $coursecode; |
|
if ($formvars{'course'}) { |
|
$coursecode = $env{'form.coursecode'}; |
|
if ($coursecode eq '') { |
|
my $totcodes = 0; |
|
my $instcats = &Apache::lonnet::get_dom_instcats($defdom); |
|
if (ref($instcats) eq 'HASH') { |
|
if (ref($instcats->{'codes'}) eq 'HASH') { |
|
$totcodes = scalar(keys(%{$instcats->{'codes'}})); |
|
} |
|
} |
|
my @standardnames = &Apache::loncommon::get_standard_codeitems(); |
|
if ($totcodes > 0) { |
|
my $noregexps = 1; |
|
$coursecode = |
|
&Apache::courseclassifier::instcode_from_selectors($defdom,$noregexps); |
|
} |
|
if ($coursecode eq '') { |
|
foreach my $item (@standardnames) { |
|
if ((defined($env{'form.'.$item})) && ($env{'form.'.$item} ne '-1')) { |
|
$coursecode .= $env{'form.'.$item}; |
|
} |
|
} |
|
} |
} |
} |
} |
} |
my %lt = &Apache::lonlocal::texthash ( |
my %lt = &Apache::lonlocal::texthash ( |
Line 534 sub print_request_receipt {
|
Line 752 sub print_request_receipt {
|
sourceurl => 'URL', |
sourceurl => 'URL', |
date => 'Date/Time', |
date => 'Date/Time', |
secn => 'Section', |
secn => 'Section', |
asup => 'A support request has been sent to', |
|
warn => 'Warning: Problem with support e-mail address', |
warn => 'Warning: Problem with support e-mail address', |
your => 'Your support request contained the following information', |
your => 'Your support request contained the following information', |
sect => 'section', |
sect => 'section', |
Line 542 sub print_request_receipt {
|
Line 759 sub print_request_receipt {
|
adin => 'Additional information recorded', |
adin => 'Additional information recorded', |
); |
); |
|
|
my (@ok_ccs,@bad_ccs,$badccmsg,$okcclist); |
my (@ok_ccs,@bad_ccs,$badccmsg,$okcclist,$homeserver); |
if ((defined($env{'user.name'})) && (defined($env{'form.cc'}))) { |
unless ($public) { |
|
if (($env{'user.name'} ne '') && ($env{'user.domain'} ne '')) { |
|
$homeserver = &Apache::lonnet::homeserver($env{'user.name'}, |
|
$env{'user.domain'}); |
|
} |
|
} |
|
my ($cid,$cdom,$cnum,$sectionlist,$ccode); |
|
if ($homeserver) { |
|
$cid = $env{'request.course.id'}; |
|
} |
|
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); |
|
$ccode = $csettings{'internal.coursecode'}; |
|
$sectionlist = $csettings{'internal.sectionnums'}; |
|
} |
|
if (($homeserver) && (defined($env{'form.cc'})) && ($formvars{'cc'})) { |
my @ccs; |
my @ccs; |
if ($env{'form.cc'} =~ /,/) { |
if ($env{'form.cc'} =~ /,/) { |
@ccs = split(/,/,$env{'form.cc'}); |
@ccs = split(/,/,$env{'form.cc'}); |
Line 559 sub print_request_receipt {
|
Line 795 sub print_request_receipt {
|
if (!(grep(/^\Q$cc\E$/,@ok_ccs))) { |
if (!(grep(/^\Q$cc\E$/,@ok_ccs))) { |
push(@ok_ccs,$cc); |
push(@ok_ccs,$cc); |
} |
} |
} else { |
} elsif ($cc ne '') { |
if (!(grep(/^\Q$cc\E$/,@bad_ccs))) { |
if (!(grep(/^\Q$cc\E$/,@bad_ccs))) { |
push(@bad_ccs,$cc); |
push(@bad_ccs,$cc); |
} |
} |
Line 569 sub print_request_receipt {
|
Line 805 sub print_request_receipt {
|
$okcclist = join(', ',@ok_ccs); |
$okcclist = join(', ',@ok_ccs); |
} |
} |
if (@bad_ccs == 1) { |
if (@bad_ccs == 1) { |
$badccmsg .= '<br />'.&mt('The following Cc e-mail address is invalid: ').$bad_ccs[0]; |
if ($bad_ccs[0] ne '') { |
|
$badccmsg .= '<br />'.&mt('The following Cc e-mail address is invalid: ').&Apache::loncommon::cleanup_html($bad_ccs[0]); |
|
} |
} elsif (@bad_ccs > 1) { |
} elsif (@bad_ccs > 1) { |
my $bad_cc_string = join(', ',@bad_ccs); |
$badccmsg .= '<br />'.&mt('The following Cc e-mail addresses are invalid: '). &Apache::loncommon::cleanup_html(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'}; |
if ($formvars{'course'}) { |
my $supportmsg = <<END; |
$env{'form.crsi'} = $env{'form.title'}; |
$lt{'username'}: $env{'form.username'} |
if ($coursecode ne '') { |
$lt{'email'}: $env{'form.email'} |
$env{'form.crsi'} .= ' - '.$coursecode; |
$lt{'cc'}: $okcclist |
} |
$lt{'user'}: $env{'form.user'} |
} |
$lt{'phone'}: $env{'form.phone'} |
if ($formvars{'section'}) { |
$lt{'crsi'}: $env{'form.csri'} |
my $section; |
$lt{'subject'}: $env{'form.subject'} |
if ($sectionlist) { |
|
if ($coursecode eq $ccode) { |
|
$section = $env{'form.sectionsel'} |
|
} else { |
|
$section = $env{'form.sectiontxt'}; |
|
} |
|
} else { |
|
$section = $env{'form.section'}; |
|
} |
|
$env{'form.crsi'} .= ' - '.$lt{'sect'}.': '.$section; |
|
} |
|
my $supportmsg; |
|
if ($formvars{'username'}) { |
|
$supportmsg .= "$lt{'username'}: $env{'form.username'}\n"; |
|
} |
|
$supportmsg .= "$lt{'email'}: $env{'form.email'}\n"; |
|
if (($homeserver) && (defined($env{'form.cc'})) && ($formvars{'cc'})) { |
|
$supportmsg .= "$lt{'cc'}: $okcclist\n"; |
|
} |
|
if ($formvars{'user'}) { |
|
$supportmsg .= "$lt{'user'}: $env{'form.user'}\n"; |
|
} |
|
if ($formvars{'phone'}) { |
|
$supportmsg .= "$lt{'phone'}: $env{'form.phone'}\n"; |
|
} |
|
if ($formvars{'course'}) { |
|
$supportmsg .= "$lt{'crsi'}: $env{'form.crsi'}\n"; |
|
} |
|
$supportmsg .= "$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'} |
$lt{'date'}: $reporttime |
$lt{'date'}: $reporttime |
|
"; |
|
|
END |
|
my $displaymsg; |
my $displaymsg; |
foreach my $item ('username','email','cc','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'}; |
$descrip = &cleanup_html($descrip); |
$descrip = &Apache::loncommon::cleanup_html($descrip); |
$descrip =~ s|[\n\r\f]|<br />|g; |
$descrip =~ s|[\n\r\f]|<br />|g; |
$displaymsg .= |
$displaymsg .= |
'<span class="LC_helpform_receipt_cat">'. |
'<span class="LC_helpform_receipt_cat">'. |
Line 603 END
|
Line 868 END
|
} 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); |
$showurl = &Apache::loncommon::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"; |
} elsif ($item eq 'cc') { |
} elsif ($item eq 'cc') { |
$displaymsg .= |
next if ($helpform{'cc'} eq 'no'); |
'<span class="LC_helpform_receipt_cat">'. |
if ($okcclist) { |
"$lt{$item}</span>: $okcclist<br />\n"; |
my $showcclist = &Apache::loncommon::cleanup_html($okcclist); |
|
$displaymsg .= |
|
'<span class="LC_helpform_receipt_cat">'. |
|
"$lt{$item}</span>: $showcclist<br />\n"; |
|
} |
} else { |
} else { |
|
if (($item eq 'username') || ($item eq 'user') || ($item eq 'phone')) { |
|
next if ($helpform{$item} eq 'no'); |
|
} |
|
next if (($item eq 'crsi') && ($helpform{'course'} eq 'no')); |
my $showitem = $env{'form.'.$item}; |
my $showitem = $env{'form.'.$item}; |
$showitem = &cleanup_html($showitem); |
$showitem = &Apache::loncommon::cleanup_html($showitem); |
$displaymsg .= |
$displaymsg .= |
'<span class="LC_helpform_receipt_cat">'. |
'<span class="LC_helpform_receipt_cat">'. |
"$lt{$item}</span>: $showitem<br />\n"; |
"$lt{$item}</span>: $showitem<br />\n"; |
} |
} |
} |
} |
} |
} |
|
|
|
my ($requname,$requdom,$reqemail); |
|
foreach my $field ('uname','udom','email') { |
|
$env{'form.'.$field} =~ s/^\s+//; |
|
$env{'form.'.$field} =~ s/\s+$//; |
|
} |
|
if ($env{'form.uname'} =~ /^$match_username$/) { |
|
$requname = $env{'form.uname'}; |
|
} |
|
if ($env{'form.udom'} =~ /^$match_domain$/) { |
|
$requdom = $env{'form.udom'}; |
|
} |
|
if ($env{'form.email'} =~ m/^[^\@]+\@[^\@]+$/) { |
|
$reqemail = $env{'form.email'}; |
|
} |
|
|
|
my $dom_in_effect; |
|
unless ($env{'user.domain'} eq 'public') { |
|
$dom_in_effect = $env{'user.domain'}; |
|
} |
|
if ($dom_in_effect eq '') { |
|
$dom_in_effect = $requdom; |
|
} |
|
if ($dom_in_effect eq '') { |
|
$dom_in_effect = $defdom; |
|
} |
|
|
$displaymsg .= '<span class="LC_helpform_receipt_cat">'. |
$displaymsg .= '<span class="LC_helpform_receipt_cat">'. |
$lt{'date'}.'</span>: '.$reporttime.'<br />'."\n"; |
$lt{'date'}.'</span>: '.$reporttime.'<br />'."\n"; |
|
|
Line 634 END
|
Line 934 END
|
|
|
$r->print(<<"END"); |
$r->print(<<"END"); |
$start_page |
$start_page |
<form name="logproblem"> |
<form name="logproblem" action=""> |
<input type="hidden" name="command" value="result" /> |
<input type="hidden" name="command" value="result" /> |
</form> |
</form> |
END |
END |
Line 642 END
|
Line 942 END
|
&print_header($r,$url,'process'); |
&print_header($r,$url,'process'); |
} |
} |
my $bad_email = 0; |
my $bad_email = 0; |
|
my ($to,$bcc,$addtext) = |
|
&Apache::loncommon::build_recipient_list(undef,'helpdeskmail', |
|
$dom_in_effect,$origmail, |
|
$requname,$requdom, |
|
$reqemail); |
if ($to =~ /,/) { |
if ($to =~ /,/) { |
my @ok_email; |
my @ok_email; |
foreach my $email (split(/,/,$to)) { |
foreach my $email (split(/,/,$to)) { |
Line 665 END
|
Line 970 END
|
$bad_email = 1; |
$bad_email = 1; |
} |
} |
} |
} |
if ($bad_email) { |
|
$r->print(' |
my $message; |
<h3>'.$lt{'warn'}.'</h3>'. |
if (!$bad_email) { |
&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.')); |
$message = &Apache::lonhtmlcommon::confirm_success( |
$to = 'helpdesk@lon-capa.org'; |
&mt('A support request has been sent to [_1]','<tt>'.$to.'</tt>')); |
} else { |
} else { |
$r->print('<h3>'.$lt{'asup'}.' '.$to.'</h3>'); |
$message = &Apache::lonhtmlcommon::confirm_success( |
|
$lt{'warn'}.'<br />' |
|
.&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.','<tt>'.$to.'</tt>','<b>','</b>') |
|
.' '.&mt('Instead a copy has been sent to the LON-CAPA support team at Michigan State University.'),1); |
|
$to = 'helpdesk@lon-capa.org'; |
} |
} |
if (defined($env{'form.email'})) { |
$r->print(&Apache::loncommon::confirmwrapper($message)); |
$env{'form.email'} =~ s/^\s+//; |
|
$env{'form.email'} =~ s/\s+$//; |
if ($reqemail ne '') { |
if ($env{'form.email'} =~ m/^[^\@]+\@[^\@]+$/) { |
$from = $reqemail; |
$from = $env{'form.email'}; |
|
} |
|
} |
} |
|
|
if (defined($env{'form.cc'})) { |
if (defined($env{'form.cc'})) { |
Line 697 END
|
Line 1004 END
|
my $fname; |
my $fname; |
|
|
my $attachmentpath = ''; |
my $attachmentpath = ''; |
my $attachmentsize = ''; |
my $showsize = ''; |
if ((defined($env{'user.name'})) && ($env{'user.name'} ne 'public') |
|
&& ($env{'user.domain'} ne 'public')) { |
if ((defined($env{'user.name'})) && (!$public)) { |
if ($env{'form.screenshot.filename'}) { |
if ($homeserver && $env{'form.screenshot.filename'}) { |
$attachmentsize = length($env{'form.screenshot'}); |
unless ($helpform{'screenshot'} eq 'no') { |
if ($attachmentsize > 131072) { |
my $attachmentsize = length($env{'form.screenshot'}); |
$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); |
my $max = 1048576; |
} else { |
my $showmax = 1.00; |
$attachmentpath=&Apache::lonnet::userfileupload('screenshot',undef,'helprequests'); |
if ($helpform{'maxsize'} =~ /^\d+\.\d*$/) { |
|
$max *= $helpform{'maxsize'}; |
|
$showmax = $helpform{'maxsize'}; |
|
} |
|
$showmax = '('.sprintf("%.2f",$showmax).' MB)'; |
|
$showsize = $attachmentsize/1048576; |
|
$showsize = '('.sprintf("%.2f",$showsize).' MB)'; |
|
if ($attachmentsize > $max) { |
|
$displaymsg .= '<br /><span class="LC_warning">'. |
|
&mt('The uploaded screenshot file [_1] included with your request exceeded the maximum allowed size [_2], and has therefore been discarded.',$showsize,$showmax).'</span>'; |
|
} else { |
|
$attachmentpath=&Apache::lonnet::userfileupload('screenshot',undef,'helprequests'); |
|
} |
} |
} |
} |
} |
} |
} |
Line 715 END
|
Line 1034 END
|
if ($$cookie{'lonID'} =~ /lonID=($LONCAPA::handle_re);/) { |
if ($$cookie{'lonID'} =~ /lonID=($LONCAPA::handle_re);/) { |
$cookies{'lonID'} = $1; |
$cookies{'lonID'} = $1; |
} |
} |
|
if ($$cookie{'lonLinkID'} =~ /lonLinkID=([a-f0-9]+_linked);/) { |
|
$cookies{'lonLinkID'} = $1; |
|
} |
if ($attachmentpath =~ m-/([^/]+)$-) { |
if ($attachmentpath =~ m-/([^/]+)$-) { |
$fname = $1; |
$fname = $1; |
$displaymsg .= '<br />' |
$displaymsg .= '<br />' |
.&mt('An uploaded screenshot file [_1] ([_2] bytes) was included in the request sent by [_3].' |
.&mt('An uploaded screenshot file [_1] was included in the request sent by [_2].' |
,'<span class="LC_filename">'.$fname.'<span>' |
,'<span class="LC_filename">'.$fname.'</span> '.$showsize, |
,$attachmentsize |
|
,$env{'user.name'}.':'.$env{'user.domain'} |
,$env{'user.name'}.':'.$env{'user.domain'} |
); |
); |
$supportmsg .= "\n"; |
$supportmsg .= "\n"; |
Line 735 END
|
Line 1055 END
|
$supportmsg .= "$var: $env{$var}\n"; |
$supportmsg .= "$var: $env{$var}\n"; |
} |
} |
} |
} |
|
|
|
my $cc_string; |
|
if ($homeserver) { |
|
if (@ok_ccs > 0) { |
|
$cc_string = join(', ',@ok_ccs); |
|
} |
|
} |
|
|
|
my $attachment_text = ''; |
|
unless ($homeserver && $attachmentpath) { |
|
foreach my $var (@cookievars) { |
|
$attachment_text .= "$var: $cookies{$var}\n"; |
|
} |
|
foreach my $var (@ENVvars) { |
|
$attachment_text .= "$var: $ENV{$var}\n"; |
|
} |
|
foreach my $var (@envvars) { |
|
$attachment_text .= "$var: $env{$var}\n"; |
|
} |
|
foreach my $var (@loncvars) { |
|
$attachment_text .= "$var: $env{$var}\n"; |
|
} |
|
} |
|
|
|
if ($addtext) { |
|
my ($addloc,$addstr) = split(/:/,$addtext,2); |
|
$addstr = &unescape($addstr); |
|
if ($addloc eq 's') { |
|
$subject = $addstr.' '.$subject; |
|
} elsif ($addloc eq 'b') { |
|
$supportmsg = $addstr."\n".$supportmsg; |
|
} |
|
} |
|
|
my $msg = MIME::Lite->new( |
my $msg = MIME::Lite->new( |
From => $from, |
From => $from, |
To => $to, |
To => $to, |
Line 743 END
|
Line 1096 END
|
Type =>'TEXT', |
Type =>'TEXT', |
Data => $supportmsg, |
Data => $supportmsg, |
); |
); |
if (@ok_ccs > 0) { |
if ($homeserver) { |
my $cc_string = join(', ',@ok_ccs); |
if (@ok_ccs > 0) { |
$msg->add("Cc" => $cc_string); |
my $cc_string = join(', ',@ok_ccs); |
|
$msg->add("Cc" => $cc_string); |
|
} |
} |
} |
if ($bcc ne '') { |
if ($bcc ne '') { |
$msg->add("Bcc" => $bcc); |
$msg->add("Bcc" => $bcc); |
} |
} |
|
$msg->attr("content-type" => "text/plain"); |
|
$msg->attr("content-type.charset" => "UTF-8"); |
|
|
if ($attachmentpath) { |
if ($homeserver && $attachmentpath) { |
my ($type, $encoding) = MIME::Types::by_suffix($attachmentpath); |
my ($type, $encoding) = MIME::Types::by_suffix($attachmentpath); |
$msg->attach(Type => $type, |
$msg->attach(Type => $type, |
Path => $attachmentpath, |
Path => $attachmentpath, |
Filename => $fname |
Filename => $fname |
); |
); |
|
|
} else { |
} elsif ($attachment_text ne '') { |
my $envdata = ''; |
|
foreach my $var (@cookievars) { |
|
$envdata .= "$var: $cookies{$var}\n"; |
|
} |
|
foreach my $var (@ENVvars) { |
|
$envdata .= "$var: $ENV{$var}\n"; |
|
} |
|
foreach my $var (@envvars) { |
|
$envdata .= "$var: $env{$var}\n"; |
|
} |
|
foreach my $var (@loncvars) { |
|
$envdata .= "$var: $env{$var}\n"; |
|
} |
|
$msg->attach(Type => 'TEXT', |
$msg->attach(Type => 'TEXT', |
Data => $envdata); |
Data => $attachment_text); |
} |
} |
|
|
### Send it: |
### Send it: |
Line 824 sub print_header {
|
Line 1168 sub print_header {
|
$helpdesk_link = '<a href="/adm/helpdesk">'; |
$helpdesk_link = '<a href="/adm/helpdesk">'; |
} |
} |
my %lt = &Apache::lonlocal::texthash ( |
my %lt = &Apache::lonlocal::texthash ( |
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', |
headline => 'help/support', |
|
stud => 'Students', |
|
ifyo => 'If your problem is still unresolved, the form below can be used to send a question to the LON-CAPA helpdesk.', |
|
cont => 'Contact your instructor instead.', |
); |
); |
my ($getstartlink,$reviewtext); |
my ($getstartlink,$reviewtext); |
if (-e $Apache::lonnet::perlvar{'lonDocRoot'}.'/adm/gettingstarted.html') { |
if (-e $Apache::lonnet::perlvar{'lonDocRoot'}.'/adm/gettingstarted.html') { |
Line 837 sub print_header {
|
Line 1184 sub print_header {
|
} else { |
} else { |
$reviewtext = &mt('Please review the information in "Log-in help" if you are unable to log-in.'); |
$reviewtext = &mt('Please review the information in "Log-in help" if you are unable to log-in.'); |
} |
} |
$r->print(<<END); |
my $linkback; |
<table width="620" border="0" cellspacing="0" cellpadding="0" height="55"> <tr height="50"> <td width='5'> </td> |
if ($origurl eq '') { |
<td> |
$linkback = 'javascript:history.go(-1)'; |
|
} else { |
|
$linkback = &HTML::Entities::encode($origurl,'"<>&'); |
|
} |
|
my $loginhelp = &Apache::lonauth::loginhelpdisplay(); |
|
if ($loginhelp eq '') { |
|
$loginhelp = '/adm/loginproblems.html'; |
|
} |
|
$r->print(<<"END"); |
|
<table width="620" border="0" cellspacing="0" cellpadding="0" style="height: 55px;"> |
|
<tr> |
|
<td width="5" height="50"> </td> |
|
<td height="50"> |
<fieldset> |
<fieldset> |
<legend> |
<legend> |
<img src="$location/lonIcons/minilogo.gif" height="20" width="29" valign="bottom" /> |
<img src="$location/lonIcons/minilogo.gif" height="20" width="29" alt="logo" style="vertical-align:bottom" /> |
LON-CAPA $lt{'headline'} |
LON-CAPA $lt{'headline'} |
</legend> |
</legend> |
<table id="LC_helpmenu_links"> |
<table id="LC_helpmenu_links"> |
<tr> |
<tr> |
<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"><img src="$location/help/help.png" border="0" alt="($lt{'login'})" style="vertical-align:middle" /> <b><a href="$loginhelp">$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'})" style="vertical-align: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="$linkback" target="_top"><img src="$location/lonIcons/move_up.gif" border="0" alt="($lt{'back'})" style="vertical-align:middle" /> $lt{'back'}</a></b> </span></td> |
</tr> |
</tr> |
</table> |
</table> |
</fieldset> |
</fieldset> |
</td> |
</td> |
<td width='5'> </td> |
<td width="5"> </td> |
</tr> |
</tr> |
<tr height='5'> |
<tr> |
<td colspan='3' height='5'> </td> |
<td colspan="3" height="5"> </td> |
</tr> |
</tr> |
END |
END |
if ($command ne 'process') { |
if ($command ne 'process') { |
$r->print(' |
my $stuwarn = &mt('Do [_1]not[_2] use this form to ask about course content.', |
|
'<b>','</b>'); |
|
$r->print(<<"END"); |
<tr> |
<tr> |
<td colspan="3">'.$reviewtext.' ' |
<td colspan="3">$reviewtext |
.&mt('If your problem is still unresolved, the form below can be used to send a question to the LON-CAPA helpdesk.').'<br />' |
$lt{'ifyo'} |
.'<font size="-1"><b>'.&mt('Students').'</b>: '.&mt('Do <b>not</b> use this form to ask questions about course content.').' ' |
<p class="LC_info"> |
.&mt('Contact your instructor instead.') |
<b>$lt{'stud'}:</b> |
.'</font><br /><br /> |
$stuwarn $lt{'cont'} |
|
</p><br /> |
</td> |
</td> |
</tr>'); |
</tr> |
|
END |
} |
} |
$r->print(' |
$r->print(' |
</table>'); |
</table>'); |
Line 879 END
|
Line 1242 END
|
sub get_domain { |
sub get_domain { |
my $codedom; |
my $codedom; |
if (exists($env{'form.codedom'})) { |
if (exists($env{'form.codedom'})) { |
$codedom = $env{'form.codedom'}; |
if (&Apache::lonnet::domain($env{'form.codedom'}) ne '') { |
} elsif ($env{'request.course.id'}) { |
return $env{'form.codedom'}; |
|
} |
|
} |
|
if ($env{'request.course.id'}) { |
$codedom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
$codedom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
} elsif ($env{'request.role.domain'}) { |
} elsif ($env{'request.role.domain'}) { |
$codedom = $env{'request.role.domain'}; |
$codedom = $env{'request.role.domain'}; |
Line 890 sub get_domain {
|
Line 1256 sub get_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; |