--- loncom/interface/lonrequestcourse.pm 2009/08/20 21:15:37 1.19 +++ loncom/interface/lonrequestcourse.pm 2009/08/21 13:18:46 1.20 @@ -1,7 +1,7 @@ # The LearningOnline Network # Request a course # -# $Id: lonrequestcourse.pm,v 1.19 2009/08/20 21:15:37 raeburn Exp $ +# $Id: lonrequestcourse.pm,v 1.20 2009/08/21 13:18:46 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -116,13 +116,11 @@ use LONCAPA qw(:DEFAULT :match); sub handler { my ($r) = @_; + &Apache::loncommon::content_type($r,'text/html'); + $r->send_http_header; if ($r->header_only) { - &Apache::loncommon::content_type($r,'text/html'); - $r->send_http_header; return OK; } - &Apache::loncommon::content_type($r,'text/html'); - $r->send_http_header; &Apache::lonhtmlcommon::clear_breadcrumbs(); my $dom = &get_course_dom(); @@ -159,9 +157,10 @@ sub handler { $states{'view'} = ['pick_request','details','cancel','removal']; $states{'log'} = ['filter','display']; $states{'new'} = ['courseinfo','enrollment','personnel','review','process']; + if (($action eq 'new') && ($env{'form.crstype'} eq 'official')) { unless ($env{'form.state'} eq 'crstype') { - unshift (@{$states{'new'}},'codepick'); + unshift(@{$states{'new'}},'codepick'); } } @@ -811,12 +810,19 @@ sub print_request_form { $r->print('
'.&Apache::lonhtmlcommon::start_pick_box().$codepicker. &Apache::lonhtmlcommon::end_pick_box().'
'); } else { + $next = $states->{$action}[$page+2]; $r->print(&courseinfo_form($dom,$formname,$crstype,$next)); } } else { + if ($crstype eq 'official') { + $next = $states->{$action}[$page+2]; + } $r->print(&courseinfo_form($dom,$formname,$crstype,$next)); } } elsif ($prev eq 'codepick') { + if ($env{'form.instcode'} eq '') { + $prev = $states->{$action}[$page-2]; + } $r->print(&courseinfo_form($dom,$formname,$crstype,$next)); } elsif ($state eq 'enrollment') { if ($crstype eq 'official') { @@ -2391,7 +2397,7 @@ sub retrieve_settings { if (grep(/^\Q$sec\E/,@currsec)) { $env{'form.person_'.$i.'_sec'} = $sec; } else { - push (@newsecs,$sec); + push(@newsecs,$sec); } } }