version 1.313, 2009/09/05 20:17:35
|
version 1.314, 2009/09/10 23:04:52
|
Line 261 sub build_tools_display {
|
Line 261 sub build_tools_display {
|
} |
} |
if ($context eq 'requestcourses') { |
if ($context eq 'requestcourses') { |
if ($userenv{$context.'.'.$item} eq '') { |
if ($userenv{$context.'.'.$item} eq '') { |
$custom_access = &mt('Currently from default setting.'); |
$custom_access = &mt('Currently from default setting.'); |
} else { |
} else { |
$custom_access = &mt('Currently from custom setting.'); |
$custom_access = &mt('Currently from custom setting.'); |
} |
} |
} else { |
} else { |
if ($userenv{$context.'.'.$item} eq '') { |
if ($userenv{$context.'.'.$item} eq '') { |
$custom_access = |
$custom_access = |
&mt('Availability determined currently from default setting.'); |
&mt('Availability determined currently from default setting.'); |
if (!$curr_access) { |
if (!$curr_access) { |
$tool_off = 'checked="checked" '; |
$tool_off = 'checked="checked" '; |
$tool_on = ''; |
$tool_on = ''; |
} |
} |
} else { |
} else { |
$custom_access = |
$custom_access = |
&mt('Availability determined currently from custom setting.'); |
&mt('Availability determined currently from custom setting.'); |
if ($userenv{$context.'.'.$item} == 0) { |
if ($userenv{$context.'.'.$item} == 0) { |
$tool_off = 'checked="checked" '; |
$tool_off = 'checked="checked" '; |
Line 294 sub build_tools_display {
|
Line 294 sub build_tools_display {
|
} |
} |
if ($curroption =~ /^autolimit=(\d*)$/) { |
if ($curroption =~ /^autolimit=(\d*)$/) { |
$currlimit = $1; |
$currlimit = $1; |
$currdisp = &mt('Yes, up to [quant,_1,request]/user',$currlimit); |
if ($currlimit eq '') { |
|
$currdisp = &mt('Yes, automatic creation'); |
|
} else { |
|
$currdisp = &mt('Yes, up to [quant,_1,request]/user',$currlimit); |
|
} |
} else { |
} else { |
$currdisp = $reqdisplay{$curroption}; |
$currdisp = $reqdisplay{$curroption}; |
} |
} |
Line 328 sub build_tools_display {
|
Line 332 sub build_tools_display {
|
if ($option eq 'autolimit') { |
if ($option eq 'autolimit') { |
$custdisp .= '<input type="text" name="crsreq_'. |
$custdisp .= '<input type="text" name="crsreq_'. |
$item.'_limit" size="1" '. |
$item.'_limit" size="1" '. |
'value="'.$currlimit.'" />'; |
'value="'.$currlimit.'" /></span><br />'. |
|
$reqtitles{'unlimited'}; |
|
} else { |
|
$custdisp .= '</span>'; |
} |
} |
$custdisp .= '</span></td></tr>'; |
$custdisp .= '</td></tr>'; |
} |
} |
$custdisp .= '</table>'; |
$custdisp .= '</table>'; |
$custradio = '</span></td><td>'.&mt('Custom setting').'<br />'.$custdisp; |
$custradio = '</span></td><td>'.&mt('Custom setting').'<br />'.$custdisp; |
} else { |
} else { |
$currdisp = ($curr_access?&mt('Yes'):&mt('No')); |
$currdisp = ($curr_access?&mt('Yes'):&mt('No')); |
$custdisp = '<span class="LC_nobreak"><label>'. |
$custdisp = '<span class="LC_nobreak"><label>'. |
'<input type="radio" name="'.$context.'_'.$item.'"'. |
'<input type="radio" name="'.$context.'_'.$item.'"'. |
' value="1"'. $tool_on.'/>'.&mt('On').'</label> <label>'. |
' value="1"'. $tool_on.'/>'.&mt('On').'</label> <label>'. |
'<input type="radio" name="'.$context.'_'.$item.'" value="0" '. |
'<input type="radio" name="'.$context.'_'.$item.'" value="0" '. |
$tool_off.'/>'.&mt('Off').'</label></span>'; |
$tool_off.'/>'.&mt('Off').'</label></span>'; |
Line 380 sub coursereq_externaluser {
|
Line 387 sub coursereq_externaluser {
|
my ($curroption,$currlimit,$tooloff); |
my ($curroption,$currlimit,$tooloff); |
if ($userenv{'reqcrsotherdom.'.$item} ne '') { |
if ($userenv{'reqcrsotherdom.'.$item} ne '') { |
my @curr = split(',',$userenv{'reqcrsotherdom.'.$item}); |
my @curr = split(',',$userenv{'reqcrsotherdom.'.$item}); |
if (grep(/^\Q$cdom\E:($optregex)=?(\d*)$/,@curr)) { |
foreach my $req (@curr) { |
$curroption = $1; |
if ($req =~ /^\Q$cdom\E\:($optregex)=?(\d*)$/) { |
$currlimit = $2; |
$curroption = $1; |
if (!$curroption) { |
$currlimit = $2; |
$curroption = 'norequest'; |
last; |
} |
} |
} |
} |
|
if (!$curroption) { |
|
$curroption = 'norequest'; |
|
$tooloff = ' checked="checked"'; |
|
} |
} else { |
} else { |
$curroption = 'norequest'; |
$curroption = 'norequest'; |
$tooloff = ' checked="checked"'; |
$tooloff = ' checked="checked"'; |
} |
} |
$output.= &Apache::loncommon::start_data_table_row()."\n". |
$output.= &Apache::loncommon::start_data_table_row()."\n". |
' <td><span class="LC_nobreak">'.$lt{$item}.': '. |
' <td><span class="LC_nobreak">'.$lt{$item}.': </span></td><td>'. |
|
'<table><tr><td valign="top">'."\n". |
'<label><input type="radio" name="reqcrsotherdom_'.$item. |
'<label><input type="radio" name="reqcrsotherdom_'.$item. |
'" value="0"'.$tooloff.' />'.$reqtitles{'norequest'}. |
'" value=""'.$tooloff.' />'.$reqtitles{'norequest'}. |
'</label> '; |
'</label></td>'; |
foreach my $option (@options) { |
foreach my $option (@options) { |
if ($option eq 'validate') { |
if ($option eq 'validate') { |
my $canvalidate = 0; |
my $canvalidate = 0; |
Line 410 sub coursereq_externaluser {
|
Line 422 sub coursereq_externaluser {
|
if ($option eq $curroption) { |
if ($option eq $curroption) { |
$checked = ' checked="checked"'; |
$checked = ' checked="checked"'; |
} |
} |
$output .= '<span class="LC_nobreak"><label>'. |
$output .= '<td valign="top"><span class="LC_nobreak"><label>'. |
'<input type="radio" name="reqcrsotherdom_'.$item. |
'<input type="radio" name="reqcrsotherdom_'.$item. |
'" value="'.$option.'"'.$checked.' />'. |
'" value="'.$option.'"'.$checked.' />'. |
$reqtitles{$option}.'</label> '; |
$reqtitles{$option}.'</label>'; |
if ($option eq 'autolimit') { |
if ($option eq 'autolimit') { |
$output .= '<input type="text" name="reqcrsotherdom_'. |
$output .= ' <input type="text" name="reqcrsotherdom_'. |
$item.'_limit" size="1" '. |
$item.'_limit" size="1" '. |
'value="'.$currlimit.'" />'; |
'value="'.$currlimit.'" /></span>'. |
|
'<br />'.$reqtitles{'unlimited'}; |
|
} else { |
|
$output .= '</span>'; |
} |
} |
$output .= ' ' |
$output .= '</td>'; |
} |
} |
$output .= '</span></td>'."\n". |
$output .= '</td></tr></table></td>'."\n". |
&Apache::loncommon::end_data_table_row()."\n"; |
&Apache::loncommon::end_data_table_row()."\n"; |
} |
} |
return $output; |
return $output; |
Line 436 sub courserequest_titles {
|
Line 451 sub courserequest_titles {
|
approval => 'Approval by Dom. Coord.', |
approval => 'Approval by Dom. Coord.', |
validate => 'With validation', |
validate => 'With validation', |
autolimit => 'Numerical limit', |
autolimit => 'Numerical limit', |
|
unlimited => '(blank for unlimited)', |
); |
); |
return %titles; |
return %titles; |
} |
} |
Line 636 sub user_modification_js {
|
Line 652 sub user_modification_js {
|
return <<END; |
return <<END; |
<script type="text/javascript" language="Javascript"> |
<script type="text/javascript" language="Javascript"> |
// <![CDATA[ |
// <![CDATA[ |
|
|
function pclose() { |
function pclose() { |
parmwin=window.open("/adm/rat/empty.html","LONCAPAparms", |
parmwin=window.open("/adm/rat/empty.html","LONCAPAparms", |
"height=350,width=350,scrollbars=no,menubar=no"); |
"height=350,width=350,scrollbars=no,menubar=no"); |
Line 747 ENDSCRIPT
|
Line 764 ENDSCRIPT
|
my ($uname,$udom) = split(/:/,$user); |
my ($uname,$udom) = split(/:/,$user); |
my $onclick; |
my $onclick; |
if ($context eq 'requestcrs') { |
if ($context eq 'requestcrs') { |
$onclick = |
$onclick = |
'onclick="javascript:gochoose('."'$uname','$udom',". |
'onclick="javascript:gochoose('."'$uname','$udom',". |
"'$srch_results->{$user}->{firstname}',". |
"'$srch_results->{$user}->{firstname}',". |
"'$srch_results->{$user}->{lastname}',". |
"'$srch_results->{$user}->{lastname}',". |
"'$srch_results->{$user}->{permanentemail}'".');"'; |
"'$srch_results->{$user}->{permanentemail}'".');"'; |
} else { |
} else { |
$onclick = |
$onclick = |
' onclick="javascript:pickuser('."'".$uname."'".','."'".$udom."'".');"'; |
' onclick="javascript:pickuser('."'".$uname."'".','."'".$udom."'".');"'; |
} |
} |
$r->print(&Apache::loncommon::start_data_table_row(). |
$r->print(&Apache::loncommon::start_data_table_row(). |
Line 964 ENDTITLE
|
Line 981 ENDTITLE
|
&personal_data_display($ccuname,$ccdomain,$newuser,$context, |
&personal_data_display($ccuname,$ccdomain,$newuser,$context, |
$inst_results{$ccuname.':'.$ccdomain}); |
$inst_results{$ccuname.':'.$ccdomain}); |
$r->print($personal_table); |
$r->print($personal_table); |
#FIXME |
|
my ($home_server_pick,$numlib) = |
my ($home_server_pick,$numlib) = |
&Apache::loncommon::home_server_form_item($ccdomain,'hserver', |
&Apache::loncommon::home_server_form_item($ccdomain,'hserver', |
'default','hide'); |
'default','hide'); |
Line 1076 ENDCHANGEUSER
|
Line 1092 ENDCHANGEUSER
|
if (&Apache::lonnet::allowed('ccc',$env{'request.role.domain'})) { |
if (&Apache::lonnet::allowed('ccc',$env{'request.role.domain'})) { |
$r->print('<h3>'.&mt('User Can Request Creation of Courses in this Domain?').'</h3>'. |
$r->print('<h3>'.&mt('User Can Request Creation of Courses in this Domain?').'</h3>'. |
&Apache::loncommon::start_data_table()); |
&Apache::loncommon::start_data_table()); |
if ($env{'request.role.domain'} eq $ccdomain) { |
if ($env{'request.role.domain'} eq $ccdomain) { |
$r->print(&build_tools_display($ccuname,$ccdomain,'requestcourses')); |
$r->print(&build_tools_display($ccuname,$ccdomain,'requestcourses')); |
} else { |
} else { |
$r->print(&coursereq_externaluser($ccuname,$ccdomain, |
$r->print(&coursereq_externaluser($ccuname,$ccdomain, |
Line 2453 sub update_user_data {
|
Line 2469 sub update_user_data {
|
\%userenv,\%changeHash,\%changed,\%newaccess,\%newaccesstext); |
\%userenv,\%changeHash,\%changed,\%newaccess,\%newaccesstext); |
} else { |
} else { |
&tool_changes('reqcrsotherdom',\@requestcourses,\%oldaccess,\%oldaccesstext, |
&tool_changes('reqcrsotherdom',\@requestcourses,\%oldaccess,\%oldaccesstext, |
\%userenv, |
\%userenv,\%changeHash,\%changed,\%newaccess,\%newaccesstext); |
\%changeHash,\%changed,\%newaccess,\%newaccesstext); |
|
} |
} |
if ($env{'form.cfirstname'} ne $userenv{'firstname'} || |
if ($env{'form.cfirstname'} ne $userenv{'firstname'} || |
$env{'form.cmiddlename'} ne $userenv{'middlename'} || |
$env{'form.cmiddlename'} ne $userenv{'middlename'} || |
Line 2818 sub tool_changes {
|
Line 2833 sub tool_changes {
|
my %reqdisplay = &courserequest_display(); |
my %reqdisplay = &courserequest_display(); |
my $cdom = $env{'request.role.domain'}; |
my $cdom = $env{'request.role.domain'}; |
foreach my $tool (@{$usertools}) { |
foreach my $tool (@{$usertools}) { |
$oldaccesstext->{$tool} = &mt('no'); |
$oldaccesstext->{$tool} = &mt('No'); |
|
$newaccesstext->{$tool} = $oldaccesstext->{$tool}; |
$changeHash->{$context.'.'.$tool} = $userenv->{$context.'.'.$tool}; |
$changeHash->{$context.'.'.$tool} = $userenv->{$context.'.'.$tool}; |
|
my $newop; |
|
if ($env{'form.'.$context.'_'.$tool}) { |
|
$newop = $env{'form.'.$context.'_'.$tool}; |
|
if ($newop eq 'autolimit') { |
|
my $limit = $env{'form.'.$context.'_'.$tool.'_limit'}; |
|
$limit =~ s/\D+//g; |
|
$newop .= '='.$limit; |
|
} |
|
} |
if ($userenv->{$context.'.'.$tool} eq '') { |
if ($userenv->{$context.'.'.$tool} eq '') { |
if ($env{'form.'.$context.'_'.$tool}) { |
if ($newop) { |
$changed->{$tool}=&tool_admin($tool,$cdom, |
$changed->{$tool}=&tool_admin($tool,$cdom.':'.$newop, |
$changeHash,$context); |
$changeHash,$context); |
if ($changed->{$tool}) { |
if ($changed->{$tool}) { |
$newaccesstext->{$tool} = &mt('yes'); |
$newaccesstext->{$tool} = &mt('Yes'); |
} else { |
} else { |
$newaccesstext->{$tool} = $oldaccesstext->{$tool}; |
$newaccesstext->{$tool} = $oldaccesstext->{$tool}; |
} |
} |
Line 2834 sub tool_changes {
|
Line 2859 sub tool_changes {
|
my @curr = split(',',$userenv->{$context.'.'.$tool}); |
my @curr = split(',',$userenv->{$context.'.'.$tool}); |
my @new; |
my @new; |
my $changedoms; |
my $changedoms; |
my $newop = $env{'form.'.$context.'_'.$tool}; |
foreach my $req (@curr) { |
if ($newop eq 'autolimit') { |
if ($req =~ /^\Q$cdom\E\:($optregex\=?\d*)$/) { |
$newop .= '='; |
$oldaccesstext->{$tool} = &mt('Yes'); |
unless ($env{'form.'.$context.'_'.$tool.'_limit'} =~ /\D/) { |
my $oldop = $1; |
$newop .= $env{'form.'.$context.'_'.$tool.'_limit'}; |
if ($oldop ne $newop) { |
} |
$changedoms = 1; |
} |
foreach my $item (@curr) { |
if (grep(/^\Q$cdom:($optregex\=?\d*)\E$/,@curr)) { |
my ($reqdom,$option) = split(':',$item); |
$oldaccesstext->{$tool} = &mt('yes'); |
unless ($reqdom eq $cdom) { |
my $oldop = $1; |
push(@new,$item); |
if ($oldop ne $newop) { |
} |
$changedoms = 1; |
|
foreach my $dom (@curr) { |
|
unless ($dom eq $cdom) { |
|
push(@new,$dom); |
|
} |
} |
|
if ($newop) { |
|
push(@new,$cdom.':'.$newop); |
|
} |
|
@new = sort(@new); |
} |
} |
if ($newop) { |
last; |
push(@new,$cdom.':'.$newop); |
|
} |
|
@new = sort(@new); |
|
} |
} |
} elsif ($env{'form.'.$context.'_'.$tool}) { |
} |
|
if ((!$changedoms) && ($newop)) { |
$changedoms = 1; |
$changedoms = 1; |
@new = sort(@curr,$cdom.':'.$newop); |
@new = sort(@curr,$cdom.':'.$newop); |
} |
} |
$newaccesstext->{$tool} = $oldaccesstext->{$tool}; |
|
if ($changedoms) { |
if ($changedoms) { |
my $newdomstr; |
my $newdomstr; |
if (@new) { |
if (@new) { |
$newdomstr = join(',',@new); |
$newdomstr = join(',',@new); |
} |
} |
Line 2871 sub tool_changes {
|
Line 2893 sub tool_changes {
|
if ($changed->{$tool}) { |
if ($changed->{$tool}) { |
if ($env{'form.'.$context.'_'.$tool}) { |
if ($env{'form.'.$context.'_'.$tool}) { |
if ($env{'form.'.$context.'_'.$tool} eq 'autolimit') { |
if ($env{'form.'.$context.'_'.$tool} eq 'autolimit') { |
if ($env{'form.'.$context.'_'.$tool.'_limit'} =~ /\D/) { |
my $limit = $env{'form.'.$context.'_'.$tool.'_limit'}; |
$newaccesstext->{$tool} = &mt('Yes, processed automatically'); |
$limit =~ s/\D+//g; |
|
if ($limit) { |
|
$newaccesstext->{$tool} = &mt('Yes, up to limit of [quant,_1,request] per user.',$limit); |
} else { |
} else { |
$newaccesstext->{$tool} = &mt('Yes, up to limit of [quant,_1,request] per user).',$env{'form.'.$context.'_'.$tool.'_limit'}); |
$newaccesstext->{$tool} = &mt('Yes, processed automatically'); |
} |
} |
} else { |
} else { |
$newaccesstext->{$tool} = $reqdisplay{$env{'form.'.$context.'_'.$tool}}; |
$newaccesstext->{$tool} = $reqdisplay{$env{'form.'.$context.'_'.$tool}}; |
} |
} |
} else { |
} else { |
Line 2895 sub tool_changes {
|
Line 2919 sub tool_changes {
|
if ($newval eq 'autolimit') { |
if ($newval eq 'autolimit') { |
$newval .= '='.$env{'form.crsreq_'.$tool.'_limit'}; |
$newval .= '='.$env{'form.crsreq_'.$tool.'_limit'}; |
} |
} |
} else { |
} else { |
$newval = $env{'form.'.$context.'_'.$tool}; |
$newval = $env{'form.'.$context.'_'.$tool}; |
} |
} |
if ($userenv->{$context.'.'.$tool} ne '') { |
if ($userenv->{$context.'.'.$tool} ne '') { |
Line 5572 sub build_search_response {
|
Line 5596 sub build_search_response {
|
my $helplink = ' href="javascript:helpMenu('."'display'".')"'; |
my $helplink = ' href="javascript:helpMenu('."'display'".')"'; |
$response .= '<br /><br />'; |
$response .= '<br /><br />'; |
if ($context eq 'requestcrs') { |
if ($context eq 'requestcrs') { |
$response .= &mt("You are not authorized to defined new users in the new course's domain - [_1].",$targetdom); |
$response .= &mt("You are not authorized to define new users in the new course's domain - [_1].",$targetdom); |
} else { |
} else { |
$response .= &mt("You are not authorized to create new users in your current role's domain - [_1].",$targetdom); |
$response .= &mt("You are not authorized to create new users in your current role's domain - [_1].",$targetdom); |
} |
} |