--- loncom/interface/lonrequestcourse.pm 2010/03/19 13:23:05 1.48
+++ loncom/interface/lonrequestcourse.pm 2010/08/11 13:24:21 1.54.2.3
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Request a course
#
-# $Id: lonrequestcourse.pm,v 1.48 2010/03/19 13:23:05 raeburn Exp $
+# $Id: lonrequestcourse.pm,v 1.54.2.3 2010/08/11 13:24:21 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -128,7 +128,7 @@ sub handler {
}
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},
- ['action','showdom','cnum','state','crstype']);
+ ['action','showdom','cnum','state','crstype','queue']);
&Apache::lonhtmlcommon::clear_breadcrumbs();
my $dom = &get_course_dom();
my $action = $env{'form.action'};
@@ -179,7 +179,8 @@ sub handler {
if (($dom eq $env{'request.role.domain'}) && (&Apache::lonnet::allowed('ccc',$dom))) {
if ($env{'form.cnum'} ne '') {
my $cnum = $env{'form.cnum'};
- my $reqkey = $cnum.'_approval';
+ my $queue = $env{'form.queue'};
+ my $reqkey = $cnum.'_'.$queue;
my $namespace = 'courserequestqueue';
my $domconfig = &Apache::lonnet::get_domainconfiguser($dom);
my %queued =
@@ -317,7 +318,7 @@ sub handler {
} elsif ($action eq 'display') {
if ($warning ne '') {
my $args = { only_body => 1 };
- $r->print(&header('Course/Community Requests','','',$args).$crumb.
+ $r->print(&header('Course/Community Requests','','' ,'',$args).$crumb.
'
'.&mt('Course/Community Request Details').'
'.
'
'.$warning.'
'.
&close_popup_form());
@@ -699,7 +700,7 @@ END
official => 'You are not permitted to request creation of an official course in this domain.',
unofficial => 'You are not permitted to request creation of an unofficial course in this domain.',
community => 'You are not permitted to request creation of a community this domain.',
- all => 'You must choose a specific course type when making a new course request.\\nAll types is not allowed.',
+ all => 'You must choose a specific course type when making a new course request.\\n\"All types\" is not allowed.',
);
$js .= <{'requested_after_date'},
+ $before = $curr_req->{'requested_before_date'};
+ $statusfilter = $curr_req->{'status'};
+ $crstypefilter = $curr_req->{'crstype'};
+ }
my %statusinfo = &Apache::lonnet::dump('courserequests',$env{'user.domain'},
$env{'user.name'},'^status:'.$dom);
my %queue_by_date;
@@ -1870,8 +1884,8 @@ sub sorted_request_history {
if ($action eq 'view') {
next unless (($statusinfo{$key} eq 'approval') || ($statusinfo{$key} eq 'pending'));
} else {
- next unless (($env{'form.status'} eq 'any') ||
- ($env{'form.status'} eq $statusinfo{$key}));
+ next unless (($statusfilter eq 'any') ||
+ ($statusfilter eq $statusinfo{$key}));
}
(undef,my($cdom,$cnum)) = split(':',$key);
next if ($cdom ne $dom);
@@ -1890,8 +1904,8 @@ sub sorted_request_history {
} else {
next if (($reqtime < $after) || ($reqtime > $before));
}
- next unless (($env{'form.crstype'} eq 'any') ||
- ($env{'form.crstype'} eq $crstype));
+ next unless (($crstypefilter eq 'any') ||
+ ($crstypefilter eq $crstype));
if ($action eq 'view') {
next unless (($disposition eq 'approval') ||
($disposition eq 'pending'));
@@ -2154,9 +2168,7 @@ sub print_request_logs {
my ($statuses,$statusnames) = &reqstatus_names($curr{'crstype'});
$r->print(''.
&requestlog_display_filter($formname,\%curr));
- my %queue_by_date = &sorted_request_history($dom,$env{'form.action'},
- $curr{'requested_after_date'},
- $curr{'requested_before_date'});
+ my %queue_by_date = &sorted_request_history($dom,$env{'form.action'},\%curr);
my @sortedtimes = sort {$a <=> $b} (keys(%queue_by_date));
my $showntablehdr = 0;
my $tablehdr = &Apache::loncommon::start_data_table().
@@ -2302,7 +2314,7 @@ sub reqstatus_names {
my @statuses = qw(created approval pending rejected cancelled);
my %statusnames =
&Apache::lonlocal::texthash (
- created => 'Course/Community created',
+ created => 'Created',
approval => 'Queued pending approval',
pending => 'Queued pending validation',
rejected => 'Request rejected',
@@ -2526,8 +2538,8 @@ sub print_review {
if (($env{'form.cloning'}) &&
($env{'form.clonecrs'} =~ /^$match_name$/) &&
($env{'form.clonedom'} =~ /^$match_domain$/)) {
- my $canclone = &Apache::loncoursequeueadmin::can_clone_course($env{'user.name'},
- $env{'user.domain'},$env{'form.clonecrs'},$env{'form.clonedom'},
+ my $canclone = &Apache::loncoursequeueadmin::can_clone_course($uname,
+ $udom,$env{'form.clonecrs'},$env{'form.clonedom'},
$env{'form.crstype'});
if ($canclone) {
my %courseenv = &Apache::lonnet::userenvironment($env{'form.clonedom'},
@@ -2756,7 +2768,7 @@ ENDJS
''.
''.
&Apache::lonhtmlcommon::row_closure(1).
@@ -2775,15 +2787,16 @@ sub clone_form {
if ($crstype eq 'community') {
$type = 'Community';
}
- my $cloneform = &Apache::loncommon::select_dom_form($dom,'clonedom').' '.
- &Apache::loncommon::selectcourse_link($formname,'clonecrs','clonedom','','','',$type);
my %lt = &clone_text();
my $output .=
- &Apache::lonhtmlcommon::row_title($lt{'cid'}).''.&Apache::lonhtmlcommon::row_closure(1).
&Apache::lonhtmlcommon::row_title($lt{'dmn'}).''.&Apache::lonhtmlcommon::row_closure(1).
+ &Apache::loncommon::select_dom_form($dom,'clonedom').''.
+ &Apache::lonhtmlcommon::row_closure(1).
+ &Apache::lonhtmlcommon::row_title($lt{'cid'}).' '.
+ &Apache::loncommon::selectcourse_link($formname,'clonecrs','clonedom','','','',$type).
+ &Apache::lonhtmlcommon::row_closure(1).
&Apache::lonhtmlcommon::row_title($lt{'dsh'}).'