version 1.10, 2009/08/12 12:40:33
|
version 1.12, 2009/08/12 14:39:23
|
Line 44 described at http://www.lon-capa.org.
|
Line 44 described at http://www.lon-capa.org.
|
|
|
=item handler() |
=item handler() |
|
|
|
=item header() |
|
|
|
=item form_elements() |
|
|
|
=item onload_action() |
|
|
|
=item check_can_request() |
|
|
|
=item course_types() |
|
|
|
=item print_main_menu() |
|
|
|
=item request_administration() |
|
|
|
=item print_request_form() |
|
|
|
=item print_enrollment_menu() |
|
|
|
=item inst_section_selector() |
|
|
|
=item date_setting_table() |
|
|
|
=item print_personnel_menu() |
|
|
|
=item print_request_status() |
|
|
|
=item print_request_logs() |
|
|
|
=item print_review() |
|
|
|
=item dates_from_form() |
|
|
|
=item courseinfo_form() |
|
|
|
=item clone_form() |
|
|
|
=item clone_text() |
|
|
|
=item coursecode_form() |
|
|
|
=item get_course_dom() |
|
|
|
=item display_navbuttons() |
|
|
|
=item print_request_outcome() |
|
|
|
=item get_processtype() |
|
|
|
=item check_autolimit() |
|
|
|
=item build_batchcreatehash() |
|
|
|
=item retrieve_settings() |
|
|
|
=item get_request_settings() |
|
|
=back |
=back |
|
|
=cut |
=cut |
Line 181 sub handler {
|
Line 237 sub handler {
|
} |
} |
} elsif ($action eq 'view') { |
} elsif ($action eq 'view') { |
if ($state eq 'crstype') { |
if ($state eq 'crstype') { |
&print_main_menu($r,\%can_request,\%states,$dom,$jscript,'',$crumb); |
&print_main_menu($r,\%can_request,\%states,$dom,$jscript,'',$crumb); |
} elsif ($state eq 'pick_request') { |
} else { |
$r->print(&print_request_status($dom,$crumb)); |
&request_administration($r,$action,$state,$page,\%states,$dom,$jscript, |
|
$loaditems,$crumb); |
} |
} |
} elsif ($action eq 'log') { |
} elsif ($action eq 'log') { |
&print_request_logs($jscript,$loaditems,$crumb); |
&print_request_logs($jscript,$loaditems,$crumb); |
Line 545 END
|
Line 602 END
|
&print_request_form($r,$action,$state,$page,$states,$dom); |
&print_request_form($r,$action,$state,$page,$states,$dom); |
} elsif ($action eq 'view') { |
} elsif ($action eq 'view') { |
$r->print(&header('Manage course requests',$js.$jscript,$loaditems).$crumb); |
$r->print(&header('Manage course requests',$js.$jscript,$loaditems).$crumb); |
|
if ($state eq 'pick_request') { |
|
$r->print(&print_request_status($dom)); |
|
} |
} elsif ($action eq 'log') { |
} elsif ($action eq 'log') { |
$r->print(&coursereq_log('View request log',$jscript,$loaditems).$crumb); |
$r->print(&coursereq_log('View request log',$jscript,$loaditems).$crumb); |
} |
} |
$r->print(&Apache::loncommon::end_page()); |
$r->print(&Apache::loncommon::end_page()); |
return; |
return; |
Line 920 sub print_personnel_menu {
|
Line 980 sub print_personnel_menu {
|
} |
} |
|
|
sub print_request_status { |
sub print_request_status { |
my ($dom,$crumb) = @_; |
my ($dom) = @_; |
my $js = <<END; |
|
|
|
function backPage(formname,prevstate) { |
|
formname.state.value = prevstate; |
|
formname.submit(); |
|
} |
|
|
|
END |
|
my $output = &header('Course Requests',$js).$crumb; |
|
my %requests = &Apache::lonnet::dumpstore('courserequests',$env{'user.domain'}, |
my %requests = &Apache::lonnet::dumpstore('courserequests',$env{'user.domain'}, |
$env{'user.name'}); |
$env{'user.name'}); |
my %queue_by_date; |
my ($output,$formname,%queue_by_date); |
foreach my $key (keys(%requests)) { |
foreach my $key (keys(%requests)) { |
if (ref($requests{$key}) eq 'HASH') { |
if (ref($requests{$key}) eq 'HASH') { |
my ($cdom,$cnum) = split('_',$key); |
my ($cdom,$cnum) = split('_',$key); |
Line 961 END
|
Line 1012 END
|
} |
} |
} |
} |
} |
} |
my $formname = 'requestcrs'; |
$formname = 'requestcrs'; |
my @sortedtimes = sort {$a <=> $b} (keys(%queue_by_date)); |
my @sortedtimes = sort {$a <=> $b} (keys(%queue_by_date)); |
$output .= '<form method="post" name="'.$formname.'" action="/adm/requestcourse" />'."\n". |
$output = '<form method="post" name="'.$formname.'" action="/adm/requestcourse" />'."\n". |
'<input type="hidden" name="action" value="'.$env{'form.action'}.'" />'."\n". |
'<input type="hidden" name="action" value="'.$env{'form.action'}.'" />'."\n". |
'<input type="hidden" name="state" value="'.$env{'form.state'}.'" />'."\n". |
'<input type="hidden" name="state" value="'.$env{'form.state'}.'" />'."\n". |
'<input type="hidden" name="crstype" value="'.$env{'form.crstype'}.'" />'."\n"; |
'<input type="hidden" name="crstype" value="'.$env{'form.crstype'}.'" />'."\n"; |
Line 1004 END
|
Line 1055 END
|
} |
} |
$output .= &Apache::loncommon::end_data_table(); |
$output .= &Apache::loncommon::end_data_table(); |
} else { |
} else { |
$output .= '<div class="LC_info">'.&mt('You have no course requests pending approval by a Domain Coordinator or held in a queue pending administrative action at your institution.').'</div>'; |
$output .= '<div>'.&mt('You have no matching course requests awaiting approval by a Domain Coordinator or held in a queue pending administrative action at your institution.').'</div>'; |
} |
} |
$output .= ' |
$output .= ' |
<input type="button" name="prev" value="'.&mt('Back').'" onclick="javascript:backPage(document.'.$formname.",'crstype'".')" /> |
<input type="button" name="prev" value="'.&mt('Back').'" onclick="javascript:backPage(document.'.$formname.",'crstype'".')" /> |
</form>'. |
</form>'; |
&Apache::loncommon::end_page(); |
|
return $output; |
return $output; |
} |
} |
|
|
Line 1426 sub print_request_outcome {
|
Line 1476 sub print_request_outcome {
|
$output = &mt('Invalid LON-CAPA course number for the new course')."\n"; |
$output = &mt('Invalid LON-CAPA course number for the new course')."\n"; |
return $output; |
return $output; |
} |
} |
|
|
%domconfig = &Apache::lonnet::get_dom('configuration',['requestcourses'],$dom); |
%domconfig = &Apache::lonnet::get_dom('configuration',['requestcourses'],$dom); |
if (ref($domconfig{'requestcourses'}) eq 'HASH') { |
if (ref($domconfig{'requestcourses'}) eq 'HASH') { |
if (ref($domconfig{'requestcourses'}{'notify'}) eq 'HASH') { |
if (ref($domconfig{'requestcourses'}{'notify'}) eq 'HASH') { |
Line 1486 sub print_request_outcome {
|
Line 1537 sub print_request_outcome {
|
owner => $env{'user.name'}, |
owner => $env{'user.name'}, |
domain => $env{'user.domain'}, |
domain => $env{'user.domain'}, |
cdom => $dom, |
cdom => $dom, |
cnum => $cnum, |
cnum => $cnum, |
cdesc => $env{'form.cdesc'}, |
cdesc => $env{'form.cdesc'}, |
crstype => $env{'form.crstype'}, |
crstype => $env{'form.crstype'}, |
instcode => $env{'form.instcode'}, |
instcode => $env{'form.instcode'}, |