version 1.20, 2004/12/30 21:16:38
|
version 1.23, 2005/02/17 08:29:43
|
Line 36 sub handler {
|
Line 36 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); |
my ($os,$browser,$bversion,$uhost,$uname,$udom,$uhome,$urole,$usec,$email,$cid,$cdom,$cnum,$ctitle,$ccode,$sectionlist,$lastname,$firstname,$server); |
my $bodytag = &Apache::loncommon::bodytag('',$function,'topmargin="0",marginheight="0"',1); |
my $bodytag = &Apache::loncommon::bodytag('',$function,'topmargin="0" marginheight="0" onLoad="initialize_codes()"',1); |
my $tablecolor = &Apache::loncommon::designparm($function.'.tabbg'); |
my $tablecolor = &Apache::loncommon::designparm($function.'.tabbg'); |
if (($tablecolor eq '') || ($tablecolor eq '#FFFFFF')) { |
if (($tablecolor eq '') || ($tablecolor eq '#FFFFFF')) { |
$tablecolor = '#EEEE99'; |
$tablecolor = '#EEEE99'; |
Line 52 sub print_request_form {
|
Line 52 sub print_request_form {
|
$urole = $ENV{'request.role'}; |
$urole = $ENV{'request.role'}; |
$usec = $ENV{'request.course.sec'}; |
$usec = $ENV{'request.course.sec'}; |
$cid = $ENV{'request.course.id'}; |
$cid = $ENV{'request.course.id'}; |
$server = $ENV{'SERVER_NAME'}; |
if ($origurl =~ m-^http://-) { |
|
$server = $origurl; |
|
} else { |
|
$server = 'http://'.$ENV{'SERVER_NAME'}.$origurl; |
|
} |
my $scripttag = (<<'END'); |
my $scripttag = (<<'END'); |
function validate() { |
function validate() { |
if (validmail(document.logproblem.email) == false) { |
if (validmail(document.logproblem.email) == false) { |
Line 115 END
|
Line 119 END
|
if (exists($ENV{'form.codedom'})) { |
if (exists($ENV{'form.codedom'})) { |
$codedom = $ENV{'form.codedom'}; |
$codedom = $ENV{'form.codedom'}; |
} |
} |
|
my $details_title; |
|
if ($codedom) { |
|
$details_title = '<br />('.$codedom.')'; |
|
} |
my %coursecodes = (); |
my %coursecodes = (); |
my %codes = (); |
my %codes = (); |
my @codetitles = (); |
my @codetitles = (); |
Line 127 END
|
Line 135 END
|
my $totcodes = 0; |
my $totcodes = 0; |
my $format_reply; |
my $format_reply; |
my $jscript = ''; |
my $jscript = ''; |
|
my $loaditems = qq| |
|
function initialize_codes() { |
|
return; |
|
} |
|
|; |
if ($cdom) { |
if ($cdom) { |
$codedom = $cdom; |
$codedom = $cdom; |
} |
} |
Line 144 END
|
Line 156 END
|
$totcodes = &retrieve_instcodes(\%coursecodes,$codedom,$totcodes); |
$totcodes = &retrieve_instcodes(\%coursecodes,$codedom,$totcodes); |
} |
} |
if ($totcodes > 0) { |
if ($totcodes > 0) { |
$format_reply = &Apache::lonnet::auto_instcode_format($caller,$codedom,\%coursecodes,\%codes,\@codetitles,\%cat_titles,\%cat_order); |
|
if ($ccode eq '') { |
if ($ccode eq '') { |
my $numtypes = @codetitles; |
$format_reply = &Apache::lonnet::auto_instcode_format($caller,$codedom,\%coursecodes,\%codes,\@codetitles,\%cat_titles,\%cat_order); |
&build_code_selections(\%codes,\@codetitles,\%cat_titles,\%cat_order,\%idlist,\%idnums,\%idlist_titles); |
if ($format_reply eq 'ok') { |
&javascript_code_selections($numtypes,\%cat_titles,\$jscript,\%idlist,\%idnums,\%idlist_titles,\@codetitles); |
my $numtypes = @codetitles; |
|
&build_code_selections(\%codes,\@codetitles,\%cat_titles,\%cat_order,\%idlist,\%idnums,\%idlist_titles); |
|
&javascript_code_selections($numtypes,\%cat_titles,\$jscript,\%idlist,\%idnums,\%idlist_titles,\@codetitles); |
|
$loaditems = ''; |
|
} |
} |
} |
} |
} |
|
my $html=&Apache::lonxml::xmlbegin(); |
$r->print(<<ENDHEAD); |
$r->print(<<ENDHEAD); |
<html> |
$html |
<head> |
<head> |
<title>LON-CAPA support request</title> |
<title>LON-CAPA support request</title> |
<script type"text/javascript"> |
<script type"text/javascript"> |
Line 298 END
|
Line 314 END
|
<table width="100%" border="0" cellpadding="8" cellspacing="0"> |
<table width="100%" border="0" cellpadding="8" cellspacing="0"> |
<tr> |
<tr> |
<td> |
<td> |
http://$server$origurl<input type="hidden" name="sourceurl" value="http://$server$origurl" /> |
$server<input type="hidden" name="sourceurl" value="$server" /> |
</td> |
</td> |
</tr> |
</tr> |
</table> |
</table> |
Line 337 END
|
Line 353 END
|
<td width="140" bgcolor="$tablecolor"> |
<td width="140" bgcolor="$tablecolor"> |
<table width="140" border="0" cellpadding="8" cellspacing="0"> |
<table width="140" border="0" cellpadding="8" cellspacing="0"> |
<tr> |
<tr> |
<td align="right"><b>Course Details:</b> |
<td align="right"><b>Course Details:</b>$details_title |
</td> |
</td> |
</tr> |
</tr> |
</table> |
</table> |
Line 384 END
|
Line 400 END
|
} else { |
} else { |
$longitems[0] = $idlist_titles{$codetitles[0]}; |
$longitems[0] = $idlist_titles{$codetitles[0]}; |
} |
} |
|
for (my $i=0; $i<@longitems; $i++) { |
|
if ($longitems[$i] eq '') { |
|
$longitems[$i] = $items[$i]; |
|
} |
|
} |
} else { |
} else { |
@longitems = @items; |
@longitems = @items; |
} |
} |
Line 444 END
|
Line 465 END
|
<td> |
<td> |
END |
END |
if ($sectionlist) { |
if ($sectionlist) { |
$r->print("<select name=\"section\">"); |
$r->print("<select name=\"section\"\n>". |
|
" <option value=\"\" selected=\"selected\">Select</option>\n"); |
foreach (sort keys %groupid) { |
foreach (sort keys %groupid) { |
if ($_ eq $groupid{$_} || $groupid{$_} eq '') { |
if ($_ eq $groupid{$_} || $groupid{$_} eq '') { |
$r->print("<option value=\"$_\" />$_"); |
$r->print(" <option value=\"$_\" >$_</option>\n"); |
} else { |
} else { |
$r->print("<option value=\"$_\" />$_ - (LON-CAPA sec: $groupid{$_})"); |
$r->print(" <option value=\"$_\" >$_ - (LON-CAPA sec: $groupid{$_})</option>\n"); |
} |
} |
} |
} |
$r->print("</select>"); |
$r->print("</select>"); |
Line 642 Date/Time: $reporttime
|
Line 664 Date/Time: $reporttime
|
<font color="$fontcolor">URL: </font><font color="$vlinkcolor">$ENV{'form.sourceurl'}</font><br /> |
<font color="$fontcolor">URL: </font><font color="$vlinkcolor">$ENV{'form.sourceurl'}</font><br /> |
<font color="$fontcolor">Date/Time: </font><font color="$vlinkcolor">$reporttime</font><br /> |
<font color="$fontcolor">Date/Time: </font><font color="$vlinkcolor">$reporttime</font><br /> |
|; |
|; |
|
my $html=&Apache::lonxml::xmlbegin(); |
$r->print(<<"END"); |
$r->print(<<"END"); |
<html> |
$html |
<head> |
<head> |
<title>LON-CAPA support request recorded</title> |
<title>LON-CAPA support request recorded</title> |
</head> |
</head> |
Line 834 sub print_header {
|
Line 857 sub print_header {
|
ask => 'Ask helpdesk', |
ask => 'Ask helpdesk', |
getst => 'Getting started guide', |
getst => 'Getting started guide', |
back => 'Back to last location' |
back => 'Back to last location' |
); |
); |
|
my ($getstartlink,$getstarttext); |
|
if (-e $Apache::lonnet::perlvar{'lonDocRoot'}.'/adm/gettingstarted.html') { |
|
$getstartlink = qq|<td align="center"> <b><a href="/adm/gettingstarted.html">$lt{'getst'}</a></td>|; |
|
$getstarttext = ' '.&mt('and the "Getting started" guide').' '; |
|
} |
$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> |
Line 851 sub print_header {
|
Line 879 sub print_header {
|
<table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#ffffff"> |
<table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#ffffff"> |
<tr bgcolor="$tablecolor"> |
<tr bgcolor="$tablecolor"> |
<td align="center"><img src="$location/help/gif/smallHelp.gif" border="0" alt="(Login help)" valign="middle" /> <b><a href="/adm/loginproblems.html">$lt{'login'}</a></td> |
<td align="center"><img src="$location/help/gif/smallHelp.gif" border="0" alt="(Login help)" valign="middle" /> <b><a href="/adm/loginproblems.html">$lt{'login'}</a></td> |
<td align="center"> <b>$helpdesk_link<img src="$location/lonIcons/helpdesk.gif" border="0" alt="(Ask helpdesk)" valign="middle" /> $lt{'ask'}</a></b> </td> |
<td align="center"> <b>$helpdesk_link<img src="$location/lonIcons/helpdesk.gif" border="0" alt="(Ask helpdesk)" valign="middle" /> $lt{'ask'}</a></b> </td>$getstartlink |
<td align="center"> <b><a href="/adm/gettingstarted.html">$lt{'getst'}</a></td> |
|
<td align="center"> <b><a href="$origurl" target="_top"><img src="$location/lonIcons/move_up.gif" border="0" alt="(Back to last location)" valign="middle" /> $lt{'back'}</a></b> </td> |
<td align="center"> <b><a href="$origurl" target="_top"><img src="$location/lonIcons/move_up.gif" border="0" alt="(Back to last location)" valign="middle" /> $lt{'back'}</a></b> </td> |
</tr> |
</tr> |
</table> |
</table> |
Line 877 END
|
Line 904 END
|
$r->print(' |
$r->print(' |
<tr> |
<tr> |
<td colspan="3">'.&mt(' |
<td colspan="3">'.&mt(' |
Please read the "Log-in help" and "Getting started guide" if you can not 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('Note').':</b> '.&mt('Student questions about course content should be directed to the course instructor').'.</font><br /><br /> |
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('Note').':</b> '.&mt('Student questions about course content should be directed to the course instructor').'.</font><br /><br /> |
</td> |
</td> |
</tr>'); |
</tr>'); |
} |
} |
Line 1194 END
|
Line 1221 END
|
} |
} |
} |
} |
$$script_tag .= (<<END_OF_BLOCK); |
$$script_tag .= (<<END_OF_BLOCK); |
|
var display = new Array($numtitles) |
|
if (caller == "") { |
|
document.logproblem.Year.length = 0 |
|
document.logproblem.Year.options[0] = new Option("Select","-1",true,true) |
|
display[0] = new Array(idyears.length) |
|
for (var i=0; i<idyears.length; i++) { |
|
display[0][i] = idyears[i] |
|
if (longtitles[0] == 1) { |
|
if (idyearslongs[i] != "") { |
|
display[0][i] = idyearslongs[i] |
|
} |
|
} |
|
document.logproblem.Year.options[i+1] = new Option(display[0][i],idyears[i],false,false) |
|
} |
|
document.logproblem.Year.selectedIndex = 0; |
|
} |
if (caller == "$$codetitles[0]") { |
if (caller == "$$codetitles[0]") { |
document.logproblem.Department.length = 0 |
document.logproblem.Department.length = 0 |
document.logproblem.Number.length = 0 |
document.logproblem.Number.length = 0 |
Line 1206 END
|
Line 1249 END
|
else { |
else { |
document.logproblem.Semester.length = 0 |
document.logproblem.Semester.length = 0 |
document.logproblem.Semester.options[0] = new Option("Select","-1",true,true) |
document.logproblem.Semester.options[0] = new Option("Select","-1",true,true) |
|
display[1] = new Array(idsems[idyr-1].length) |
for (var i=0; i<idsems[idyr-1].length; i++) { |
for (var i=0; i<idsems[idyr-1].length; i++) { |
|
display[1][i] = idsems[idyr-1][i] |
if (longtitles[1] == 1) { |
if (longtitles[1] == 1) { |
document.logproblem.Semester.options[i+1] = new Option(idsemslongs[idyr-1][i],idsems[idyr-1][i],false,false) |
if (idsemslongs[idyr-1][i] != "") { |
} |
display[1][i] = idsemslongs[idyr-1][i] |
else { |
} |
document.logproblem.Semester.options[i+1] = new Option(idsems[idyr-1][i],idsems[idyr-1][i],false,false) |
|
} |
} |
|
document.logproblem.Semester.options[i+1] = new Option(display[1][i],idsems[idyr-1][i],false,false) |
} |
} |
} |
} |
document.logproblem.Semester.selectedIndex = 0; |
document.logproblem.Semester.selectedIndex = 0; |
Line 1226 END
|
Line 1271 END
|
} |
} |
else { |
else { |
document.logproblem.Department.options[0] = new Option("Select","-1",true,true) |
document.logproblem.Department.options[0] = new Option("Select","-1",true,true) |
|
display[2] = new Array(idcodes[idyr-1][idsem-1].length) |
for (var i=0; i<idcodes[idyr-1][idsem-1].length; i++) { |
for (var i=0; i<idcodes[idyr-1][idsem-1].length; i++) { |
|
display[2][i] = idcodes[idyr-1][idsem-1][i] |
if (longtitles[2] == 1) { |
if (longtitles[2] == 1) { |
document.logproblem.Department.options[i+1] = new Option(idcodeslongs[idyr-1][idsem-1][i],idcodes[idyr-1][idsem-1][i],false,false) |
if (idcodeslongs[idyr-1][idsem-1][i] != "") { |
} |
display[2][i] = idcodeslongs[idyr-1][idsem-1][i] |
else { |
} |
document.logproblem.Department.options[i+1] = new Option(idcodes[idyr-1][idsem-1][i],idcodes[idyr-1][idsem-1][i],false,false) |
|
} |
} |
|
document.logproblem.Department.options[i+1] = new Option(display[2][i],idcodes[idyr-1][idsem-1][i],false,false) |
} |
} |
} |
} |
document.logproblem.Department.selectedIndex = 0 |
document.logproblem.Department.selectedIndex = 0 |
Line 1244 END
|
Line 1291 END
|
} |
} |
else { |
else { |
document.logproblem.Number.options[0] = new Option("Select","-1",true,true) |
document.logproblem.Number.options[0] = new Option("Select","-1",true,true) |
|
display[3] = new Array (idcourses[idyr-1][idsem-1][iddept-1].length) |
for (var i=0; i<idcourses[idyr-1][idsem-1][iddept-1].length; i++) { |
for (var i=0; i<idcourses[idyr-1][idsem-1][iddept-1].length; i++) { |
|
display[3][i] = idcourses[idyr-1][idsem-1][iddept-1][i] |
if (longtitles[3] == 1) { |
if (longtitles[3] == 1) { |
document.logproblem.Number.options[i+1] = new Option(idcourseslongs[idyr-1][idsem-1][iddept-1][i],idcourses[idyr-1][idsem-1][iddept-1][i],false,false) |
if (idcourseslongs[idyr-1][idsem-1][iddept-1][i] != "") { |
} |
display[3][i] = idcourseslongs[idyr-1][idsem-1][iddept-1][i] |
else { |
} |
document.logproblem.Number.options[i+1] = new Option(idcourses[idyr-1][idsem-1][iddept-1][i],idcourses[idyr-1][idsem-1][iddept-1][i],false,false) |
|
} |
} |
|
document.logproblem.Number.options[i+1] = new Option(display[3][i],idcourses[idyr-1][idsem-1][iddept-1][i],false,false) |
} |
} |
} |
} |
document.logproblem.Number.selectedIndex = 0 |
document.logproblem.Number.selectedIndex = 0 |
} |
} |
} |
} |
|
|
|
function initialize_codes() { |
|
courseSet(); |
|
return; |
|
} |
END_OF_BLOCK |
END_OF_BLOCK |
} |
} |
|
|