version 1.34, 2009/09/10 03:00:31
|
version 1.35, 2009/09/11 12:53:10
|
Line 631 sub course_types {
|
Line 631 sub course_types {
|
official => 'Official course', |
official => 'Official course', |
unofficial => 'Unofficial course', |
unofficial => 'Unofficial course', |
community => 'Community', |
community => 'Community', |
); |
); |
return (\@types,\%typename); |
return (\@types,\%typename); |
} |
} |
|
|
Line 725 END
|
Line 725 END
|
END |
END |
|
|
$r->print(&header('Course Requests',$js.$jscript,$loaditems).$crumb. |
$r->print(&header('Course Requests',$js.$jscript,$loaditems).$crumb. |
'<p>'.&mt('Request creation of a new course, or manage pending course requests.').'</p>'. |
'<p>'.&mt('Request creation of a new course, or review your pending course requests.').'</p>'. |
'<div>'. |
'<div>'. |
&Apache::lonhtmlcommon::start_pick_box(). |
&Apache::lonhtmlcommon::start_pick_box(). |
&Apache::lonhtmlcommon::row_title(&mt('Course Domain')). |
&Apache::lonhtmlcommon::row_title(&mt('Course Domain')). |
Line 757 END
|
Line 757 END
|
if ($type eq 'official') { |
if ($type eq 'official') { |
$selected = ' selected="selected"'; |
$selected = ' selected="selected"'; |
} |
} |
$r->print('<option value="'.$type.'"'.$selected.'>'.$typename->{$type}. |
$r->print('<option value="'.$type.'"'.$selected.'>'.&mt($typename->{$type}). |
'</option>'."\n"); |
'</option>'."\n"); |
} |
} |
} |
} |
Line 1748 sub print_request_status {
|
Line 1748 sub print_request_status {
|
my ($dom) = @_; |
my ($dom) = @_; |
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 ($output,$formname,%queue_by_date,%typenames); |
my ($output,$formname,%queue_by_date); |
if ($env{'form.crstype'} eq 'any') { |
my ($types,$typenames) = &course_types(); |
%typenames = &Apache::lonlocal::texthash ( |
|
official => 'Official course', |
|
unofficial => 'Unofficial course', |
|
community => 'Community', |
|
); |
|
} |
|
foreach my $key (keys(%statusinfo)) { |
foreach my $key (keys(%statusinfo)) { |
if (($statusinfo{$key} eq 'approval') || ($statusinfo{$key} eq 'pending')) { |
if (($statusinfo{$key} eq 'approval') || ($statusinfo{$key} eq 'pending')) { |
(undef,my($cdom,$cnum)) = split(':',$key); |
(undef,my($cdom,$cnum)) = split(':',$key); |
Line 1826 sub print_request_status {
|
Line 1820 sub print_request_status {
|
'<td>'.&unescape($desc).'</td>'. |
'<td>'.&unescape($desc).'</td>'. |
'<td>'.$cdom.'</td>'; |
'<td>'.$cdom.'</td>'; |
if ($env{'form.crstype'} eq 'any') { |
if ($env{'form.crstype'} eq 'any') { |
my $typename = $typenames{$type}; |
my $typename; |
|
if (ref($typenames) eq 'HASH') { |
|
$typename = &mt($typenames->{$type}); |
|
} |
if ($typename eq '') { |
if ($typename eq '') { |
$typename = &mt('Unknown type'); |
$typename = &mt('Unknown type'); |
} |
} |
Line 1979 sub print_review {
|
Line 1976 sub print_review {
|
$crstypename = $env{'form.crstype'}; |
$crstypename = $env{'form.crstype'}; |
if (ref($typename) eq 'HASH') { |
if (ref($typename) eq 'HASH') { |
unless ($typename->{$env{'form.crstype'}} eq '') { |
unless ($typename->{$env{'form.crstype'}} eq '') { |
$crstypename = $typename->{$env{'form.crstype'}}; |
$crstypename = &mt($typename->{$env{'form.crstype'}}); |
} |
} |
} |
} |
my $category = 'Course'; |
my $category = 'Course'; |
Line 2295 sub clone_form {
|
Line 2292 sub clone_form {
|
if ($crstype eq 'community') { |
if ($crstype eq 'community') { |
$type = 'Community'; |
$type = 'Community'; |
} |
} |
my $cloneform = &Apache::loncommon::select_dom_form($dom,'clonedom'). |
my $cloneform = &Apache::loncommon::select_dom_form($dom,'clonedom').' '. |
&Apache::loncommon::selectcourse_link($formname,'clonecrs','clonedom','','','',$type); |
&Apache::loncommon::selectcourse_link($formname,'clonecrs','clonedom','','','',$type); |
my %lt = &clone_text(); |
my %lt = &clone_text(); |
my $output .= |
my $output .= |
&Apache::lonhtmlcommon::row_title($lt{'cid'}).'<label>'. |
&Apache::lonhtmlcommon::row_title($lt{'cid'}).'<label>'. |
'<input type="text" size="25" name="clonecrs" value="" />'. |
'<input type="text" size="25" name="clonecrs" value="" />'. |
'</label>'.&Apache::lonhtmlcommon::row_closure(1).'<label>'. |
'</label>'.&Apache::lonhtmlcommon::row_closure(1). |
&Apache::lonhtmlcommon::row_title($lt{'dmn'}).'</label>'. |
&Apache::lonhtmlcommon::row_title($lt{'dmn'}).'<label>'. |
$cloneform.'</label>'.&Apache::lonhtmlcommon::row_closure(1). |
$cloneform.'</label>'.&Apache::lonhtmlcommon::row_closure(1). |
&Apache::lonhtmlcommon::row_title($lt{'dsh'}).'<label>'. |
&Apache::lonhtmlcommon::row_title($lt{'dsh'}).'<label>'. |
'<input type="radio" name="datemode" value="delete" /> '.$lt{'ncd'}. |
'<input type="radio" name="datemode" value="delete" /> '.$lt{'ncd'}. |
Line 2857 sub update_requestors_roles {
|
Line 2854 sub update_requestors_roles {
|
my $owner = $env{'user.name'}.':'.$env{'user.domain'}; |
my $owner = $env{'user.name'}.':'.$env{'user.domain'}; |
if (ref($details) eq 'HASH') { |
if (ref($details) eq 'HASH') { |
if (ref($details->{'personnel'}) eq 'HASH') { |
if (ref($details->{'personnel'}) eq 'HASH') { |
if (ref($details->{'personnel'}{$owner}) eq 'HASH') { |
unless (ref($details->{'personnel'}{$owner}) eq 'HASH') { |
my @roles; |
$details->{'personnel'}{$owner} = { |
if (ref($details->{'personnel'}{$owner}{'roles'}) eq 'ARRAY') { |
'roles' => ['cc'], |
@roles = sort(@{$details->{'personnel'}{$owner}{'roles'}}); |
'cc' => { 'usec' => [] }, |
unless (grep(/^cc$/,@roles)) { |
}; |
push(@roles,'cc'); |
} |
} |
my @roles; |
} else { |
if (ref($details->{'personnel'}{$owner}{'roles'}) eq 'ARRAY') { |
@roles = ('cc'); |
@roles = sort(@{$details->{'personnel'}{$owner}{'roles'}}); |
|
unless (grep(/^cc$/,@roles)) { |
|
push(@roles,'cc'); |
} |
} |
foreach my $role (@roles) { |
} else { |
my $start = $now; |
@roles = ('cc'); |
my $end = '0'; |
} |
if ($role eq 'st') { |
foreach my $role (@roles) { |
if ($details->{'accessstart'} ne '') { |
my $start = $now; |
$start = $details->{'accessstart'}; |
my $end = '0'; |
} |
if ($role eq 'st') { |
if ($details->{'accessend'} ne '') { |
if ($details->{'accessstart'} ne '') { |
$end = $details->{'accessend'}; |
$start = $details->{'accessstart'}; |
} |
} |
} |
if ($details->{'accessend'} ne '') { |
my @usecs; |
$end = $details->{'accessend'}; |
if ($role ne 'cc') { |
} |
if (ref($details->{'personnel'}{$owner}{$role}{'usec'}) eq 'ARRAY') { |
} |
@usecs = @{$details->{'personnel'}{$owner}{$role}{'usec'}}; |
my @usecs; |
} |
if ($role ne 'cc') { |
} |
if (ref($details->{'personnel'}{$owner}{$role}{'usec'}) eq 'ARRAY') { |
if ($role eq 'st') { |
@usecs = @{$details->{'personnel'}{$owner}{$role}{'usec'}}; |
if (@usecs > 1) { |
} |
my $firstsec = $usecs[0]; |
} |
@usecs = ($firstsec); |
if ($role eq 'st') { |
} |
if (@usecs > 1) { |
} |
my $firstsec = $usecs[0]; |
if (@usecs == 0) { |
@usecs = ($firstsec); |
push(@usecs,''); |
} |
} |
} |
foreach my $usec (@usecs) { |
if (@usecs == 0) { |
my (%userroles,%newrole,%newgroups,$spec,$area); |
push(@usecs,''); |
my $area = '/'.$dom.'/'.$cnum; |
} |
my $spec = $role.'.'.$area; |
foreach my $usec (@usecs) { |
if ($usec ne '') { |
my (%userroles,%newrole,%newgroups,$spec,$area); |
$spec .= '/'.$usec; |
my $area = '/'.$dom.'/'.$cnum; |
$area .= '/'.$usec; |
my $spec = $role.'.'.$area; |
} |
if ($usec ne '') { |
|
$spec .= '/'.$usec; |
|
$area .= '/'.$usec; |
|
} |
|
if ($role =~ /^cr\//) { |
|
&Apache::lonnet::custom_roleprivs(\%newrole,$role,$dom, |
|
$cnum,$spec,$area); |
|
} else { |
|
&Apache::lonnet::standard_roleprivs(\%newrole,$role,$dom, |
|
$spec,$cnum,$area); |
|
} |
|
&Apache::lonnet::set_userprivs(\%userroles,\%newrole, |
|
\%newgroups); |
|
$userroles{'user.role.'.$spec} = $start.'.'.$end; |
|
&Apache::lonnet::appenv(\%userroles,[$role,'cm']); |
|
if (($end == 0) || ($end > $now)) { |
|
my $showrole = $role; |
if ($role =~ /^cr\//) { |
if ($role =~ /^cr\//) { |
&Apache::lonnet::custom_roleprivs(\%newrole,$role,$dom, |
$showrole = &Apache::lonnet::plaintext($role,$crstype); |
$cnum,$spec,$area); |
} elsif (ref($longroles) eq 'HASH') { |
} else { |
if ($longroles->{$role} ne '') { |
&Apache::lonnet::standard_roleprivs(\%newrole,$role,$dom, |
$showrole = $longroles->{$role}; |
$spec,$cnum,$area); |
} |
} |
} |
&Apache::lonnet::set_userprivs(\%userroles,\%newrole, |
if ($start <= $now) { |
\%newgroups); |
$active .= '<li><a href="/adm/roles?selectrole=1&'. |
$userroles{'user.role.'.$spec} = $start.'.'.$end; |
$spec.'=1">'.$showrole; |
&Apache::lonnet::appenv(\%userroles,[$role,'cm']); |
if ($usec ne '') { |
if (($end == 0) || ($end > $now)) { |
$active .= ' - '.&mt('section:').' '.$usec; |
my $showrole = $role; |
|
if ($role =~ /^cr\//) { |
|
$showrole = &Apache::lonnet::plaintext($role,$crstype); |
|
} elsif (ref($longroles) eq 'HASH') { |
|
if ($longroles->{$role} ne '') { |
|
$showrole = $longroles->{$role}; |
|
} |
|
} |
} |
if ($start <= $now) { |
$active .= '</a></li>'; |
$active .= '<li><a href="/adm/roles?selectrole=1&'. $spec.'=1">'.$showrole; |
$numactive ++; |
if ($usec ne '') { |
} else { |
$active .= ' - '.&mt('section:').' '.$usec; |
$future .= '<li>'.$showrole; |
} |
if ($usec ne '') { |
$active .= '</a></li>'; |
$future .= ' - '.&mt('section:').' '.$usec; |
$numactive ++; |
|
} else { |
|
$future .= '<li>'.$showrole; |
|
if ($usec ne '') { |
|
$future .= ' - '.&mt('section:').' '.$usec; |
|
} |
|
$future .= '</li>'; |
|
$numfuture ++; |
|
} |
} |
|
$future .= '</li>'; |
|
$numfuture ++; |
} |
} |
} |
} |
} |
} |