--- loncom/interface/lonsupportreq.pm 2004/09/13 13:31:52 1.9
+++ loncom/interface/lonsupportreq.pm 2004/12/18 22:21:52 1.12
@@ -17,11 +17,14 @@ sub handler {
if ($r->header_only) {
return OK;
}
-
- &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['action','origurl','function']);
- my $action = $ENV{'form.action'};
+ &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['origurl','function']);
+ if ($r->uri eq '/adm/helpdesk') {
+ &Apache::loncommon::get_posted_cgi($r);
+ }
my $function = $ENV{'form.function'};
my $origurl = &Apache::lonnet::unescape($ENV{'form.origurl'});
+ my $action = $ENV{'form.action'};
+
if ($action eq 'process') {
&print_request_receipt($r,$origurl,$function);
} else {
@@ -38,6 +41,7 @@ sub print_request_form {
if (($tablecolor eq '') || ($tablecolor eq '#FFFFFF')) {
$tablecolor = '#CCCCFF';
}
+ $ccode = '';
$os = $ENV{'browser.os'};
$browser = $ENV{'browser.type'};
$bversion = $ENV{'browser.version'};
@@ -313,20 +317,66 @@ END
END
- if ($coursecodes{$cnum}) {
- foreach (@codetitles) {
- $r->print(''.$_.': '.$codes{$cnum}{$_}.'; ');
+ if ($cnum) {
+ if ($coursecodes{$cnum}) {
+ foreach (@codetitles) {
+ $r->print(''.$_.': '.$codes{$cnum}{$_}.'; ');
+ }
+ $r->print(' ');
+ } else {
+ $r->print('Enter institutional course code:
+ ');
}
- $r->print(' ');
} else {
- $r->print('Enter institutional course code:
+ if ($totcodes > 0) {
+ my $numtitles = @codetitles;
+ if ($numtitles == 0) {
+ $r->print('Enter institutional course code:
+ ');
+ } else {
+ my $lasttitle = $numtitles;
+ if ($numtitles > 4) {
+ $lasttitle = 4;
+ }
+ $r->print(''.$codetitles[0].' '."\n".
+ ' | ');
+ for (my $i=1; $i<$numtitles; $i++) {
+ $r->print(''.$codetitles[$i].' '."\n".
+ ''."\n".
+ ' | '
+ );
+ }
+ $r->print(' ');
+ if ($numtitles > 4) {
+ $r->print('
'.$codetitles[$numtitles].' '."\n".
+ ''."\n");
+ }
+ }
+ } else {
+ $r->print('Enter institutional course code:
');
+ }
}
if ($ctitle) {
$r->print(' Title: '.$ctitle.'');
} else {
$r->print(' Enter course title:
- ');
+ ');
}
$r->print(<
@@ -718,9 +768,9 @@ END
sub retrieve_instcodes {
my ($coursecodes,$codedom,$totcodes) = @_;
- my %courses = &Apache::lonnet::courseiddump($codedom,'.',1);
+ my %courses = &Apache::lonnet::courseiddump($codedom,'.',1,'.','.');
foreach my $course (keys %courses) {
- if ($courses{$course} =~ m/^[^:]*:([^:]+)$/) {
+ if ($courses{$course} =~ m/^[^:]*:([^:]+)/) {
$$coursecodes{$course} = &Apache::lonnet::unescape($1);
$totcodes ++;
}
@@ -923,18 +973,25 @@ sub recurse_list {
sub javascript_code_selections {
my ($numcats,$script_tag,$idlist,$idnums,$idlist_titles,$codetitles) = @_;
+ my $numtitles = @{$codetitles};
+ my @seltitles = ();
+ for (my $j=0; $j<$numtitles; $j++) {
+ $seltitles[$j] = 'id'.$$codetitles[$j];
+ }
+ my $seltitle_str = join('","',@seltitles);
$$script_tag .= < |