version 1.64, 2022/12/01 01:28:26
|
version 1.65, 2022/12/03 00:34:38
|
Line 411 sub send_selfserve_notification {
|
Line 411 sub send_selfserve_notification {
|
|
|
sub display_queued_requests { |
sub display_queued_requests { |
my ($context,$dom,$cnum,$secondary) = @_; |
my ($context,$dom,$cnum,$secondary) = @_; |
my ($namespace,$formaction,$nextelement,%requesthash); |
my ($namespace,$formaction,$nextelement,%requesthash,%reqstatus); |
if ($context eq 'course') { |
if ($context eq 'course') { |
$formaction = '/adm/createuser'; |
$formaction = '/adm/createuser'; |
$namespace = 'selfenrollrequests'; |
$namespace = 'selfenrollrequests'; |
Line 484 sub display_queued_requests {
|
Line 484 sub display_queued_requests {
|
($entry) = (&unescape($item) =~ /^($match_username)_approval$/); |
($entry) = (&unescape($item) =~ /^($match_username)_approval$/); |
} elsif ($context eq 'othdomqueue') { |
} elsif ($context eq 'othdomqueue') { |
if (ref($requesthash{$item}) eq 'HASH') { |
if (ref($requesthash{$item}) eq 'HASH') { |
next unless ($requesthash{'status&'.$item} eq 'pending'); |
|
my ($puname,$pudom,$prole,$psec) = split(/:/,$item); |
my ($puname,$pudom,$prole,$psec) = split(/:/,$item); |
$timestamp = $requesthash{$item}{'timestamp'}; |
$timestamp = $requesthash{$item}{'timestamp'}; |
my $adj = $requesthash{$item}{'adj'}; |
my $adj = $requesthash{$item}{'adj'}; |
$entry = join(':',$puname,$pudom,$prole,$adj, |
$entry = join(':',$puname,$pudom,$prole,$adj, |
&escape($requesthash{$item}{'requester'}), |
&escape($requesthash{$item}{'requester'}), |
$psec); |
$psec); |
|
} elsif ($item =~ /^status&/) { |
|
my ($dummy,$key) = split(/&/,$item,2); |
|
$reqstatus{$key} = $requesthash{$item}; |
} |
} |
} elsif ($context eq 'othdomaction') { |
} elsif ($context eq 'othdomaction') { |
next unless ($item =~ /^pending:/); |
next unless ($item =~ /^pending:/); |
Line 539 sub display_queued_requests {
|
Line 541 sub display_queued_requests {
|
$output .= '<h3>'.&mt('Requests for LON-CAPA accounts queued pending approval by a Domain Coordinator').'</h3>'; |
$output .= '<h3>'.&mt('Requests for LON-CAPA accounts queued pending approval by a Domain Coordinator').'</h3>'; |
} elsif ($context eq 'othdomqueue') { |
} elsif ($context eq 'othdomqueue') { |
if ($secondary eq 'domain') { |
if ($secondary eq 'domain') { |
$output .= '<h3>'.&mt('Domain role assignments for users from another domain, queued pending approval').'</h3>'; |
$output .= '<h3>'.&mt('Domain role assignments for users from another domain which were/are queued for approval').'</h3>'; |
} elsif ($secondary eq 'author') { |
} elsif ($secondary eq 'author') { |
$output .= '<h3>'.&mt('Co-author role assignments for users from another domain, queued pending approval').'</h3>'; |
$output .= '<h3>'.&mt('Co-author role assignments for users from another domain which were/are queued for approval').'</h3>'; |
} elsif ($secondary eq 'course') { |
} elsif ($secondary eq 'course') { |
$output .= '<h3>'.&mt('Course role assignments for users from another domain, queued pending approval').'</h3>'; |
$output .= '<h3>'.&mt('Course role assignments for users from another domain which were/are queued for approval').'</h3>'; |
} elsif ($secondary eq 'community') { |
} elsif ($secondary eq 'community') { |
$output .= '<h3>'.&mt('Community role assignments for users from another domain, queued pending approval').'</h3>'; |
$output .= '<h3>'.&mt('Community role assignments for users from another domain which were/are queued for approval').'</h3>'; |
} |
} |
} elsif ($context eq 'othdomaction') { |
} elsif ($context eq 'othdomaction') { |
if ($secondary eq 'user') { |
if ($secondary eq 'user') { |
Line 555 sub display_queued_requests {
|
Line 557 sub display_queued_requests {
|
} |
} |
} else { |
} else { |
$output .= '<h3>'.&mt('Course/Community requests queued pending approval by a Domain Coordinator').'</h3>'; |
$output .= '<h3>'.&mt('Course/Community requests queued pending approval by a Domain Coordinator').'</h3>'; |
} |
} |
$output .= &build_queue_display($dom,$context,\%queue_by_date,$secondary). |
if ($context eq 'othdomqueue') { |
'<input type="hidden" name="queue" value="approval" />'; |
$output .= &queued_role_display($secondary,\%queue_by_date,\%reqstatus); |
|
} else { |
|
$output .= &build_queue_display($dom,$context,\%queue_by_date,$secondary). |
|
'<input type="hidden" name="queue" value="approval" />'; |
|
} |
if ($context eq 'pending') { |
if ($context eq 'pending') { |
$output .= '<br /><input type="submit" name="validationcheck" value="'. |
$output .= '<br /><input type="submit" name="validationcheck" value="'. |
&mt('Validate').'" /><br />'."\n". |
&mt('Validate').'" /><br />'."\n". |
Line 579 sub display_queued_requests {
|
Line 585 sub display_queued_requests {
|
$output .= &mt('There are currently no requests for LON-CAPA accounts awaiting approval.'); |
$output .= &mt('There are currently no requests for LON-CAPA accounts awaiting approval.'); |
} elsif ($context eq 'othdomqueue') { |
} elsif ($context eq 'othdomqueue') { |
if ($secondary eq 'domain') { |
if ($secondary eq 'domain') { |
$output .= &mt('There are currently no domain role assignment(s) for user(s) from another domain queued pending approval'); |
$output .= &mt('There are currently no domain role assignment(s) for user(s) from another domain which were/are queued for approval'); |
} elsif ($secondary eq 'author') { |
} elsif ($secondary eq 'author') { |
$output .= &mt('There are currently no co-author role assignment(s) for user(s) from another domain queued pending approval'); |
$output .= &mt('There are currently no co-author role assignment(s) for user(s) from another domain which were/are queued for approval'); |
} elsif ($secondary eq 'course') { |
} elsif ($secondary eq 'course') { |
$output .= &mt('There are currently no course role assignment(s) for user(s) from another domain queued pending approval'); |
$output .= &mt('There are currently no course role assignment(s) for user(s) from another domain which were/are queued for approval'); |
} elsif ($secondary eq 'community') { |
} elsif ($secondary eq 'community') { |
$output .= &mt('There are currently no community role assignment(s) for user(s) from another domain queued pending approval'); |
$output .= &mt('There are currently no community role assignment(s) for user(s) from another domain which were/are queued for approval'); |
} |
} |
} elsif ($context eq 'othdomaction') { |
} elsif ($context eq 'othdomaction') { |
if ($secondary eq 'user') { |
if ($secondary eq 'user') { |
Line 605 sub build_queue_display {
|
Line 611 sub build_queue_display {
|
my ($dom,$context,$queue,$secondary) = @_; |
my ($dom,$context,$queue,$secondary) = @_; |
return unless (ref($queue) eq 'HASH'); |
return unless (ref($queue) eq 'HASH'); |
my (%crstypes,%roles_by_context,$output); |
my (%crstypes,%roles_by_context,$output); |
if ($context eq 'othdomqueue') { |
|
$output = &print_filter_menu($context); |
|
} |
|
$output .= &Apache::loncommon::start_data_table(). |
$output .= &Apache::loncommon::start_data_table(). |
&Apache::loncommon::start_data_table_header_row(); |
&Apache::loncommon::start_data_table_header_row(); |
unless (($context eq 'pending') || ($context eq 'displaypending') || |
unless (($context eq 'pending') || ($context eq 'displaypending') || |
($context eq 'helpdesk') || ($context eq 'othdomqueue')) { |
($context eq 'helpdesk')) { |
$output .= '<th>'.&mt('Action').'</th>'; |
$output .= '<th>'.&mt('Action').'</th>'; |
} |
} |
unless (($context eq 'othdomqueue') || (($context eq 'othdomaction') && ($secondary eq 'user'))) { |
unless (($context eq 'othdomaction') && ($secondary eq 'user')) { |
$output .= '<th>'.&mt('Requestor').'</th>'; |
$output .= '<th>'.&mt('Requestor').'</th>'; |
} |
} |
if ($context eq 'course') { |
if ($context eq 'course') { |
Line 625 sub build_queue_display {
|
Line 628 sub build_queue_display {
|
} elsif ($context eq 'requestusername') { |
} elsif ($context eq 'requestusername') { |
$output .= '<th>'.&mt('Date requested').'</th>'. |
$output .= '<th>'.&mt('Date requested').'</th>'. |
'<th>'.&mt('Details').'</th>'; |
'<th>'.&mt('Details').'</th>'; |
} elsif ($context eq 'othdomqueue') { |
|
$output .= '<th>'.&mt('Date requested').'</th>'. |
|
'<th>'.&mt('Role').'</th>'; |
|
if ($secondary eq 'course') { |
|
$output .= '<th>'.&mt('Section').'</th>'; |
|
} |
|
$output .= '<th>'.&mt('Requested for').'</th>'. |
|
'<th>'.&mt('Approval needed from').'</th>'; |
|
} elsif ($context eq 'othdomaction') { |
} elsif ($context eq 'othdomaction') { |
$output .= '<th>'.&mt('Date requested').'</th>'. |
$output .= '<th>'.&mt('Date requested').'</th>'. |
'<th>'.&mt('Role type').'</th>'. |
'<th>'.&mt('Role type').'</th>'. |
Line 698 sub build_queue_display {
|
Line 693 sub build_queue_display {
|
"'$dom','$request','$queued'".');">'.$request.'</a>'; |
"'$dom','$request','$queued'".');">'.$request.'</a>'; |
$namelink = $request; |
$namelink = $request; |
} |
} |
} elsif ($context eq 'othdomqueue') { |
|
my ($uname,$udom,$role,$adj,$requester,$sec) = split(/:/,$request); |
|
if ($adj eq 'user') { |
|
$adjudicator = &mt('Role Assignee'); |
|
} elsif ($adj eq 'domain') { |
|
$adjudicator = &mt("[_1] in user's domain", |
|
&Apache::lonnet::plaintext('dc')); |
|
} |
|
my $crstype; |
|
$showrole = &Apache::lonnet::plaintext($role,$crstype); |
|
unless (&Apache::lonnet::homeserver($uname,$udom) eq 'no_host') { |
|
$namelink = &Apache::loncommon::plainname($uname,$udom)." ($uname:$udom)"; |
|
} |
|
if ($secondary eq 'course') { |
|
$showsec = $sec; |
|
if ($showsec eq '') { |
|
$showsec = &mt('none'); |
|
} |
|
} |
|
} elsif ($context eq 'othdomaction') { |
} elsif ($context eq 'othdomaction') { |
my ($status,$extent,$role,$crstype); |
my ($status,$extent,$role,$crstype); |
my ($info,$requester) = map { &unescape($_); } split(/:/,$request); |
my ($info,$requester) = map { &unescape($_); } split(/:/,$request); |
Line 816 sub build_queue_display {
|
Line 792 sub build_queue_display {
|
$ownername,$ownerdom); |
$ownername,$ownerdom); |
} |
} |
unless (($context eq 'pending') || ($context eq 'displaypending') || |
unless (($context eq 'pending') || ($context eq 'displaypending') || |
($context eq 'helpdesk') || ($context eq 'othdomqueue')) { |
($context eq 'helpdesk')) { |
$row = '<td><span class="LC_nobreak"><label>'. |
$row = '<td><span class="LC_nobreak"><label>'. |
'<input type="radio" value="'.$approve.'" name="'.$count.'radioreq" />'.&mt('Approve').'</label>'. |
'<input type="radio" value="'.$approve.'" name="'.$count.'radioreq" />'.&mt('Approve').'</label>'. |
'<label>'.(' 'x2). |
'<label>'.(' 'x2). |
Line 825 sub build_queue_display {
|
Line 801 sub build_queue_display {
|
'<input type="radio" value="'."later:".$reject.'" name="'.$count.'radioreq" checked />'.&mt('Decide Later'). |
'<input type="radio" value="'."later:".$reject.'" name="'.$count.'radioreq" checked />'.&mt('Decide Later'). |
'</label></span><br /></td>'; |
'</label></span><br /></td>'; |
} |
} |
unless (($context eq 'othdomqueue') || ($context eq 'othdomaction')) { |
unless ($context eq 'othdomaction') { |
$row .= '<td>'.$namelink.'</td>'."\n"; |
$row .= '<td>'.$namelink.'</td>'."\n"; |
} |
} |
if ($context eq 'course') { |
if ($context eq 'course') { |
Line 836 sub build_queue_display {
|
Line 812 sub build_queue_display {
|
} elsif ($context eq 'requestusername') { |
} elsif ($context eq 'requestusername') { |
$row .= '<td>'.$showtime.'</td>'."\n". |
$row .= '<td>'.$showtime.'</td>'."\n". |
'<td>'.$detailslink.'</td>'."\n"; |
'<td>'.$detailslink.'</td>'."\n"; |
} elsif ($context eq 'othdomqueue') { |
|
$row .= '<td>'.$showtime.'</td>'."\n". |
|
'<td>'.$showrole.'</td>'."\n"; |
|
if ($secondary eq 'course') { |
|
$row .= '<td>'.$showsec.'</td>'."\n"; |
|
} |
|
$row .= '<td>'.$namelink.'</td>'."\n". |
|
'<td>'.$adjudicator.'</td>'."\n"; |
|
} elsif ($context eq 'othdomaction') { |
} elsif ($context eq 'othdomaction') { |
if ($secondary eq 'domain') { |
if ($secondary eq 'domain') { |
$row .= '<td>'.$showrequester.'</td>'."\n"; |
$row .= '<td>'.$showrequester.'</td>'."\n"; |
Line 874 sub build_queue_display {
|
Line 842 sub build_queue_display {
|
return $output; |
return $output; |
} |
} |
|
|
sub print_filter_menu { |
sub queued_role_display { |
my ($context) = @_; |
my ($context,$queue,$status) = @_; |
|
return unless ((ref($queue) eq 'HASH') && (ref($status) eq 'HASH')); |
|
my (%curr,$minshown,$maxshown,$more_records,$crstype,$viewablesec,$output); |
|
my $formname = 'changequeue'; |
|
if ($context eq 'course') { |
|
$crstype = &Apache::loncommon::course_type(); |
|
my ($permission,$allowed) = |
|
&Apache::lonuserutils::get_permission($context,$crstype); |
|
$viewablesec = &Apache::lonuserutils::viewable_section($permission); |
|
my %saveable_parameters = ('show' => 'scalar',); |
|
&Apache::loncommon::store_course_settings('roles_req', |
|
\%saveable_parameters); |
|
&Apache::loncommon::restore_course_settings('roles_req', |
|
\%saveable_parameters); |
|
} |
|
|
|
# Create navigation javascript |
|
my $jsnav = &queued_log_js($formname); |
|
|
|
$output = (<<ENDSCRIPT); |
|
<script type="text/javascript"> |
|
// <![CDATA[ |
|
$jsnav |
|
// ]]> |
|
</script> |
|
ENDSCRIPT |
|
|
|
my $now = time(); |
|
my $defstart = $now - (7*24*3600); #7 days ago |
|
my %defaults = ( |
|
page => '1', |
|
show => '10', |
|
role => 'any', |
|
chgstatus => 'any', |
|
chgadj => 'any', |
|
rolereq_start_date => $defstart, |
|
rolereq_end_date => $now, |
|
); |
|
$more_records = 0; |
|
my %lt = &othdomrole_contexts(); |
|
|
|
foreach my $item ('show','page','role','chgstatus','chgadj') { |
|
$curr{$item} = $env{'form.'.$item}; |
|
} |
|
($curr{'rolereq_start_date'},$curr{'rolereq_end_date'}) = |
|
&Apache::lonuserutils::get_dates_from_form('rolereq_start_date','rolereq_end_date'); |
|
foreach my $key (keys(%defaults)) { |
|
if ($curr{$key} eq '') { |
|
$curr{$key} = $defaults{$key}; |
|
} |
|
} |
|
$minshown = 1; |
|
my $count = 0; |
|
if ($curr{'show'} =~ /\D/) { |
|
$curr{'page'} = 1; |
|
} else { |
|
$maxshown = $curr{'page'} * $curr{'show'}; |
|
if ($curr{'page'} > 1) { |
|
$minshown = 1 + ($curr{'page'} - 1) * $curr{'show'}; |
|
} |
|
} |
|
$output .= &print_filter_menu($context,'changequeue',\%curr,$crstype); |
|
|
|
my $showntableheader = 0; |
|
|
|
# Table Header |
|
my $tableheader = |
|
&Apache::loncommon::start_data_table(). |
|
&Apache::loncommon::start_data_table_header_row(). |
|
'<th>'.&mt('Date requested').'</th>'. |
|
'<th>'.&mt('Role').'</th>'; |
|
if ($context eq 'course') { |
|
$tableheader .= '<th>'.&mt('Section').'</th>'; |
|
} |
|
$tableheader .= '<th>'.&mt('Requested for').'</th>'. |
|
'<th>'.&mt('Request status').'</th>'. |
|
'<th>'.&mt('Adjudicator').'</th>'. |
|
&Apache::loncommon::end_data_table_header_row(); |
|
|
|
my @sortedtimes = sort {$a <=> $b} (keys(%{$queue})); |
|
my $count = 0; |
|
foreach my $item (@sortedtimes) { |
|
next if (($item < $curr{'rolereq_start_date'}) || |
|
($item > $curr{'rolereq_end_date'})); |
|
if (ref($queue->{$item}) eq 'ARRAY') { |
|
foreach my $request (sort(@{$queue->{$item}})) { |
|
if ($curr{'show'} !~ /\D/) { |
|
if ($count >= $curr{'page'} * $curr{'show'}) { |
|
$more_records = 1; |
|
last; |
|
} |
|
} |
|
my ($showtime,$showsec,$namelink,$showrole,$showadj, |
|
$showstatus,$id); |
|
$showtime = &Apache::lonlocal::locallocaltime($item); |
|
my ($uname,$udom,$role,$adj,$requester,$sec) = split(/:/,$request); |
|
$id = join(':',($uname,$udom,$role)); |
|
if ($context eq 'course') { |
|
$id .= ':'.$sec; |
|
} |
|
if ($curr{'role'} ne 'any') { |
|
if ($curr{'role'} eq 'cr') { |
|
next unless ($role =~ m{^cr/}); |
|
} else { |
|
next unless ($role eq $curr{'role'}); |
|
} |
|
} |
|
if ($curr{'chgstatus'} ne 'any') { |
|
next if ($status->{$id} ne $curr{'chgstatus'}); |
|
} |
|
if ($curr{'chgadj'} ne 'any') { |
|
next if ($adj ne $curr{'chgadj'}); |
|
} |
|
if (($context eq 'course') && ($viewablesec ne '')) { |
|
next if ($sec ne $viewablesec); |
|
} |
|
$count ++; |
|
next if ($count < $minshown); |
|
unless ($showntableheader) { |
|
$output .= $tableheader; |
|
$showntableheader = 1; |
|
} |
|
$showrole = &Apache::lonnet::plaintext($role,$crstype); |
|
$showstatus = $lt{$status->{$id}}; |
|
$showadj = $lt{$adj}; |
|
unless (&Apache::lonnet::homeserver($uname,$udom) eq 'no_host') { |
|
$namelink = &Apache::loncommon::plainname($uname,$udom)." ($uname:$udom)"; |
|
} |
|
if ($context eq 'course') { |
|
$showsec = $sec; |
|
if ($showsec eq '') { |
|
$showsec = &mt('none'); |
|
} |
|
} |
|
$output .= &Apache::loncommon::start_data_table_row()."\n". |
|
'<td>'.$showtime.'</td>'."\n". |
|
'<td>'.$showrole.'</td>'."\n"; |
|
if ($context eq 'course') { |
|
$output .= '<td>'.$showsec.'</td>'."\n"; |
|
} |
|
$output .= '<td>'.$namelink.'</td>'."\n". |
|
'<td>'.$showstatus.'</td>'."\n". |
|
'<td>'.$showadj.'</td>'."\n". |
|
&Apache::loncommon::end_data_table_row()."\n"; |
|
} |
|
} |
|
} |
|
|
|
if ($showntableheader) { # Table footer, if content displayed above |
|
$output .= &Apache::loncommon::end_data_table(). |
|
&queued_role_navlinks(\%curr,$more_records); |
|
} else { # No content displayed above |
|
$output .= '<p class="LC_info">'. |
|
&mt('There are no records to display.'). |
|
'</p>'; |
|
} |
|
$output .= '<input type="hidden" name="page" value="'.$curr{'page'}.'" />'; |
|
return $output; |
|
} |
|
|
|
sub queued_log_js { |
|
my ($formname) = @_; |
|
return <<"ENDSCRIPT"; |
|
|
|
function chgPage(caller) { |
|
if (caller == 'previous') { |
|
document.$formname.page.value --; |
|
} |
|
if (caller == 'next') { |
|
document.$formname.page.value ++; |
|
} |
|
document.$formname.submit(); |
return; |
return; |
} |
} |
|
ENDSCRIPT |
|
} |
|
|
|
sub queued_role_navlinks { |
|
my ($curr,$more_records) = @_; |
|
return unless(ref($curr) eq 'HASH'); |
|
# Navigation Buttons |
|
my $nav_links; |
|
if (($curr->{'page'} > 1) || ($more_records)) { |
|
$nav_links = '<p>'; |
|
if (($curr->{'page'} > 1) && ($curr->{'show'} !~ /\D/)) { |
|
$nav_links .= '<input type="button"' |
|
.' onclick="javascript:chgPage('."'previous'".');"' |
|
.' value="'.&mt('Previous [_1] changes',$curr->{'show'}) |
|
.'" /> '; |
|
} |
|
if ($more_records) { |
|
$nav_links .= '<input type="button"' |
|
.' onclick="javascript:chgPage('."'next'".');"' |
|
.' value="'.&mt('Next [_1] changes',$curr->{'show'}) |
|
.'" />'; |
|
} |
|
$nav_links .= '</p>'; |
|
} |
|
return $nav_links; |
|
} |
|
|
|
sub print_filter_menu { |
|
my ($context,$formname,$curr,$crstype) = @_; |
|
|
|
my $nolink = 1; |
|
my $output = '<table><tr><td valign="top">'. |
|
'<span class="LC_nobreak"><b>'.&mt('Changes/page:').'</b></span><br />'. |
|
&Apache::lonmeta::selectbox('show',$curr->{'show'},undef, |
|
(&mt('all'),5,10,20,50,100,1000,10000)). |
|
'</td><td> </td>'; |
|
my $startform = |
|
&Apache::lonhtmlcommon::date_setter($formname,'rolereq_start_date', |
|
$curr->{'rolereq_start_date'},undef, |
|
undef,undef,undef,undef,undef,undef,$nolink); |
|
my $endform = |
|
&Apache::lonhtmlcommon::date_setter($formname,'rolereq_end_date', |
|
$curr->{'rolereq_end_date'},undef, |
|
undef,undef,undef,undef,undef,undef,$nolink); |
|
my %lt = &othdomrole_contexts(); |
|
$output .= '<td valign="top"><b>'.&mt('Time window in which role was requested').':</b><br />'. |
|
'<table><tr><td>'.&mt('After:'). |
|
'</td><td>'.$startform.'</td></tr>'. |
|
'<tr><td>'.&mt('Before:').'</td>'. |
|
'<td>'.$endform.'</td></tr></table>'. |
|
'</td>'. |
|
'<td> </td>'. |
|
'<td valign="top"><b>'.&mt('Requested role').':</b><br />'. |
|
'<select name="role"><option value="any"'; |
|
if ($curr->{'role'} eq 'any') { |
|
$output .= ' selected="selected"'; |
|
} |
|
$output .= '>'.&mt('Any').'</option>'."\n"; |
|
my @roles = &Apache::lonuserutils::roles_by_context($context,1,$crstype); |
|
foreach my $role (@roles) { |
|
my $plrole; |
|
if ($role eq 'cr') { |
|
$plrole = &mt('Custom Role'); |
|
} else { |
|
$plrole=&Apache::lonnet::plaintext($role,$crstype); |
|
} |
|
my $selstr = ''; |
|
if ($role eq $curr->{'role'}) { |
|
$selstr = ' selected="selected"'; |
|
} |
|
$output .= ' <option value="'.$role.'"'.$selstr.'>'.$plrole.'</option>'; |
|
} |
|
$output .= '</select></td>'. |
|
'<td> </td>'. |
|
'<td valign="top"><b>'. |
|
&mt('Request status').':</b><br />'. |
|
'<select name="chgstatus">'. |
|
'<option value="any"'; |
|
if ($curr->{'chgstatus'} eq 'any') { |
|
$output .= ' selected="selected"'; |
|
} |
|
$output .= '>'.&mt('Any').'</option>'."\n"; |
|
my @possstatus = ('pending','approved','rejected'); |
|
foreach my $statustype (@possstatus) { |
|
my $selstr = ''; |
|
if ($curr->{'chgstatus'} eq $statustype) { |
|
$selstr = ' selected="selected"'; |
|
} |
|
$output .= '<option value="'.$statustype.'"'.$selstr.'>'.$lt{$statustype}.'</option>'."\n"; |
|
} |
|
$output .= '</select></td>'. |
|
'<td> </td>'. |
|
'<td valign="top"><b>'. |
|
&mt('Adjudicator').':</b><br />'. |
|
'<select name="chgadj">'. |
|
'<option value="any"'; |
|
if ($curr->{'adj'} eq 'any') { |
|
$output .= ' selected="selected"'; |
|
} |
|
$output .= '>'.&mt('Any').'</option>'."\n"; |
|
my @possadj = ('domain','user'); |
|
foreach my $adjtype (@possadj) { |
|
my $selstr = ''; |
|
if ($curr->{'chgadj'} eq $adjtype) { |
|
$selstr = ' selected="selected"'; |
|
} |
|
$output .= '<option value="'.$adjtype.'"'.$selstr.'>'.$lt{$adjtype}.'</option>'."\n"; |
|
} |
|
$output .= '</select></td>' |
|
.'</tr></table>'; |
|
|
|
# Update Display button |
|
$output .= '<p>'. |
|
'<input type="submit" value="'.&mt('Update Display').'" />'. |
|
'</p>'. |
|
'<hr />'; |
|
return $output; |
|
} |
|
|
|
sub othdomrole_contexts { |
|
my %lt = &Apache::lonlocal::texthash( |
|
pending => 'Queued', |
|
approved => 'Approved', |
|
rejected => 'Rejected', |
|
user => 'User who acquires role', |
|
); |
|
$lt{'domain'} = &mt("[_1] in user's domain", |
|
&Apache::lonnet::plaintext('dc')); |
|
return %lt; |
|
} |
|
|
sub update_request_queue { |
sub update_request_queue { |
my ($context,$cdom,$cnum,$coursedesc) = @_; |
my ($context,$cdom,$cnum,$coursedesc) = @_; |