version 1.48, 2010/03/19 13:23:05
|
version 1.51, 2010/03/31 18:58:34
|
Line 128 sub handler {
|
Line 128 sub handler {
|
} |
} |
|
|
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}, |
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}, |
['action','showdom','cnum','state','crstype']); |
['action','showdom','cnum','state','crstype','queue']); |
&Apache::lonhtmlcommon::clear_breadcrumbs(); |
&Apache::lonhtmlcommon::clear_breadcrumbs(); |
my $dom = &get_course_dom(); |
my $dom = &get_course_dom(); |
my $action = $env{'form.action'}; |
my $action = $env{'form.action'}; |
Line 179 sub handler {
|
Line 179 sub handler {
|
if (($dom eq $env{'request.role.domain'}) && (&Apache::lonnet::allowed('ccc',$dom))) { |
if (($dom eq $env{'request.role.domain'}) && (&Apache::lonnet::allowed('ccc',$dom))) { |
if ($env{'form.cnum'} ne '') { |
if ($env{'form.cnum'} ne '') { |
my $cnum = $env{'form.cnum'}; |
my $cnum = $env{'form.cnum'}; |
my $reqkey = $cnum.'_approval'; |
my $queue = $env{'form.queue'}; |
|
my $reqkey = $cnum.'_'.$queue; |
my $namespace = 'courserequestqueue'; |
my $namespace = 'courserequestqueue'; |
my $domconfig = &Apache::lonnet::get_domainconfiguser($dom); |
my $domconfig = &Apache::lonnet::get_domainconfiguser($dom); |
my %queued = |
my %queued = |
Line 317 sub handler {
|
Line 318 sub handler {
|
} elsif ($action eq 'display') { |
} elsif ($action eq 'display') { |
if ($warning ne '') { |
if ($warning ne '') { |
my $args = { only_body => 1 }; |
my $args = { only_body => 1 }; |
$r->print(&header('Course/Community Requests','','',$args).$crumb. |
$r->print(&header('Course/Community Requests','','' ,'',$args).$crumb. |
'<h3>'.&mt('Course/Community Request Details').'</h3>'. |
'<h3>'.&mt('Course/Community Request Details').'</h3>'. |
'<div class="LC_warning">'.$warning.'</div>'. |
'<div class="LC_warning">'.$warning.'</div>'. |
&close_popup_form()); |
&close_popup_form()); |
Line 699 END
|
Line 700 END
|
official => 'You are not permitted to request creation of an official course in this domain.', |
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.', |
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.', |
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 .= <<END; |
$js .= <<END; |
if (crschoice == 'official') { |
if (crschoice == 'official') { |
Line 1861 sub current_lc_sections {
|
Line 1862 sub current_lc_sections {
|
} |
} |
|
|
sub sorted_request_history { |
sub sorted_request_history { |
my ($dom,$action,$after,$before) = @_; |
my ($dom,$action,$curr_req) = @_; |
|
my ($after,$before,$statusfilter,$crstypefilter); |
|
if ($env{'form.status'} ne '') { |
|
$statusfilter = $env{'form.status'}; |
|
} |
|
if ($env{'form.crstype'} ne '') { |
|
$crstypefilter = $env{'form.crstype'}; |
|
} |
|
if (ref($curr_req) eq 'HASH') { |
|
$after = $curr_req->{'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'}, |
my %statusinfo = &Apache::lonnet::dump('courserequests',$env{'user.domain'}, |
$env{'user.name'},'^status:'.$dom); |
$env{'user.name'},'^status:'.$dom); |
my %queue_by_date; |
my %queue_by_date; |
Line 1870 sub sorted_request_history {
|
Line 1884 sub sorted_request_history {
|
if ($action eq 'view') { |
if ($action eq 'view') { |
next unless (($statusinfo{$key} eq 'approval') || ($statusinfo{$key} eq 'pending')); |
next unless (($statusinfo{$key} eq 'approval') || ($statusinfo{$key} eq 'pending')); |
} else { |
} else { |
next unless (($env{'form.status'} eq 'any') || |
next unless (($statusfilter eq 'any') || |
($env{'form.status'} eq $statusinfo{$key})); |
($statusfilter eq $statusinfo{$key})); |
} |
} |
(undef,my($cdom,$cnum)) = split(':',$key); |
(undef,my($cdom,$cnum)) = split(':',$key); |
next if ($cdom ne $dom); |
next if ($cdom ne $dom); |
Line 1890 sub sorted_request_history {
|
Line 1904 sub sorted_request_history {
|
} else { |
} else { |
next if (($reqtime < $after) || ($reqtime > $before)); |
next if (($reqtime < $after) || ($reqtime > $before)); |
} |
} |
next unless (($env{'form.crstype'} eq 'any') || |
next unless (($crstypefilter eq 'any') || |
($env{'form.crstype'} eq $crstype)); |
($crstypefilter eq $crstype)); |
if ($action eq 'view') { |
if ($action eq 'view') { |
next unless (($disposition eq 'approval') || |
next unless (($disposition eq 'approval') || |
($disposition eq 'pending')); |
($disposition eq 'pending')); |
Line 2154 sub print_request_logs {
|
Line 2168 sub print_request_logs {
|
my ($statuses,$statusnames) = &reqstatus_names($curr{'crstype'}); |
my ($statuses,$statusnames) = &reqstatus_names($curr{'crstype'}); |
$r->print('<input type="hidden" name="page" value="'.$curr{'page'}.'" />'. |
$r->print('<input type="hidden" name="page" value="'.$curr{'page'}.'" />'. |
&requestlog_display_filter($formname,\%curr)); |
&requestlog_display_filter($formname,\%curr)); |
my %queue_by_date = &sorted_request_history($dom,$env{'form.action'}, |
my %queue_by_date = &sorted_request_history($dom,$env{'form.action'},\%curr); |
$curr{'requested_after_date'}, |
|
$curr{'requested_before_date'}); |
|
my @sortedtimes = sort {$a <=> $b} (keys(%queue_by_date)); |
my @sortedtimes = sort {$a <=> $b} (keys(%queue_by_date)); |
my $showntablehdr = 0; |
my $showntablehdr = 0; |
my $tablehdr = &Apache::loncommon::start_data_table(). |
my $tablehdr = &Apache::loncommon::start_data_table(). |
Line 2302 sub reqstatus_names {
|
Line 2314 sub reqstatus_names {
|
my @statuses = qw(created approval pending rejected cancelled); |
my @statuses = qw(created approval pending rejected cancelled); |
my %statusnames = |
my %statusnames = |
&Apache::lonlocal::texthash ( |
&Apache::lonlocal::texthash ( |
created => 'Course/Community created', |
created => 'Created', |
approval => 'Queued pending approval', |
approval => 'Queued pending approval', |
pending => 'Queued pending validation', |
pending => 'Queued pending validation', |
rejected => 'Request rejected', |
rejected => 'Request rejected', |
Line 2756 ENDJS
|
Line 2768 ENDJS
|
'<label><input type="radio" name="cloning" value="1" '. |
'<label><input type="radio" name="cloning" value="1" '. |
'onclick="javascript:toggleCloning()" />'. |
'onclick="javascript:toggleCloning()" />'. |
&mt('Yes').(' 'x2).'</label><label>'. |
&mt('Yes').(' 'x2).'</label><label>'. |
'<input type="radio" name="cloning" value="0" '. |
'<input type="radio" name="cloning" value="0" checked="checked" '. |
'onclick="javascript:toggleCloning()" />'.&mt('No').'</label>'. |
'onclick="javascript:toggleCloning()" />'.&mt('No').'</label>'. |
'</h3>'. |
'</h3>'. |
&Apache::lonhtmlcommon::row_closure(1). |
&Apache::lonhtmlcommon::row_closure(1). |
Line 3286 sub print_request_outcome {
|
Line 3298 sub print_request_outcome {
|
description => $env{'form.cdescr'}, |
description => $env{'form.cdescr'}, |
}, |
}, |
}; |
}; |
|
if ($crstype eq 'official') { |
|
$request->{$requestid}->{'instcode'} = $instcode; |
|
} |
my $statuskey = 'status:'.$dom.':'.$cnum; |
my $statuskey = 'status:'.$dom.':'.$cnum; |
my %userreqhash = &Apache::lonnet::get('courserequests',[$statuskey], |
my %userreqhash = &Apache::lonnet::get('courserequests',[$statuskey], |
$env{'user.domain'},$env{'user.name'}); |
$env{'user.domain'},$env{'user.name'}); |