version 1.160.6.33, 2014/01/06 14:08:31
|
version 1.217, 2013/12/24 21:59:36
|
Line 211 sub handler {
|
Line 211 sub handler {
|
'quotas','autoenroll','autoupdate','autocreate', |
'quotas','autoenroll','autoupdate','autocreate', |
'directorysrch','usercreation','usermodification', |
'directorysrch','usercreation','usermodification', |
'contacts','defaults','scantron','coursecategories', |
'contacts','defaults','scantron','coursecategories', |
'serverstatuses','requestcourses','coursedefaults', |
'serverstatuses','requestcourses','helpsettings', |
'usersessions','loadbalancing','requestauthor'],$dom); |
'coursedefaults','usersessions','loadbalancing', |
|
'requestauthor'],$dom); |
my @prefs_order = ('rolecolors','login','defaults','quotas','autoenroll', |
my @prefs_order = ('rolecolors','login','defaults','quotas','autoenroll', |
'autoupdate','autocreate','directorysrch','contacts', |
'autoupdate','autocreate','directorysrch','contacts', |
'usercreation','usermodification','scantron', |
'usercreation','usermodification','scantron', |
'requestcourses','requestauthor','coursecategories', |
'requestcourses','requestauthor','coursecategories', |
'serverstatuses','coursedefaults','usersessions'); |
'serverstatuses','helpsettings', |
|
'coursedefaults','usersessions'); |
my %existing; |
my %existing; |
if (ref($domconfig{'loadbalancing'}) eq 'HASH') { |
if (ref($domconfig{'loadbalancing'}) eq 'HASH') { |
%existing = %{$domconfig{'loadbalancing'}}; |
%existing = %{$domconfig{'loadbalancing'}}; |
Line 356 sub handler {
|
Line 358 sub handler {
|
col3 => 'Specific IPs', |
col3 => 'Specific IPs', |
}], |
}], |
}, |
}, |
'coursedefaults' => |
'helpsettings' => |
|
{text => 'Help page settings', |
|
help => 'Domain_Configuration_Help_Settings', |
|
header => [{col1 => 'Help Settings (logged-in users)', |
|
col2 => 'Value'}], |
|
}, |
|
'coursedefaults' => |
{text => 'Course/Community defaults', |
{text => 'Course/Community defaults', |
help => 'Domain_Configuration_Course_Defaults', |
help => 'Domain_Configuration_Course_Defaults', |
header => [{col1 => 'Defaults which can be overridden for each course by a DC', |
header => [{col1 => 'Defaults which can be overridden in each course by a CC', |
|
col2 => 'Value',}, |
|
{col1 => 'Defaults which can be overridden for each course by a DC', |
col2 => 'Value',},], |
col2 => 'Value',},], |
}, |
}, |
|
'privacy' => |
|
{text => 'User Privacy', |
|
help => 'Domain_Configuration_User_Privacy', |
|
header => [{col1 => 'Setting', |
|
col2 => 'Value',}], |
|
}, |
'usersessions' => |
'usersessions' => |
{text => 'User session hosting/offloading', |
{text => 'User session hosting/offloading', |
help => 'Domain_Configuration_User_Sessions', |
help => 'Domain_Configuration_User_Sessions', |
Line 404 sub handler {
|
Line 420 sub handler {
|
if ($phase eq 'process') { |
if ($phase eq 'process') { |
my $result = &Apache::lonconfigsettings::make_changes($r,$dom,$phase,$context,\@prefs_order, |
my $result = &Apache::lonconfigsettings::make_changes($r,$dom,$phase,$context,\@prefs_order, |
\%prefs,\%domconfig,$confname,\@roles); |
\%prefs,\%domconfig,$confname,\@roles); |
if ((ref($result) eq 'HASH') && (keys(%{$result}))) { |
if (ref($result) eq 'HASH') { |
$r->rflush(); |
$r->rflush(); |
&devalidate_remote_domconfs($dom,$result); |
&devalidate_remote_domconfs($dom,$result); |
} |
} |
Line 538 sub process_changes {
|
Line 554 sub process_changes {
|
$output = &modify_quotas($r,$dom,$action,$lastactref,%domconfig); |
$output = &modify_quotas($r,$dom,$action,$lastactref,%domconfig); |
} elsif ($action eq 'requestauthor') { |
} elsif ($action eq 'requestauthor') { |
$output = &modify_quotas($r,$dom,$action,$lastactref,%domconfig); |
$output = &modify_quotas($r,$dom,$action,$lastactref,%domconfig); |
|
} elsif ($action eq 'helpsettings') { |
|
$output = &modify_helpsettings($r,$dom,$confname,%domconfig); |
} elsif ($action eq 'coursedefaults') { |
} elsif ($action eq 'coursedefaults') { |
$output = &modify_coursedefaults($dom,$lastactref,%domconfig); |
$output = &modify_coursedefaults($dom,$lastactref,%domconfig); |
} elsif ($action eq 'usersessions') { |
} elsif ($action eq 'usersessions') { |
Line 609 sub print_config_box {
|
Line 627 sub print_config_box {
|
$output .= &print_usersessions('top',$dom,$settings,\$rowtotal); |
$output .= &print_usersessions('top',$dom,$settings,\$rowtotal); |
} elsif ($action eq 'rolecolors') { |
} elsif ($action eq 'rolecolors') { |
$output .= &print_rolecolors($phase,'student',$dom,$confname,$settings,\$rowtotal); |
$output .= &print_rolecolors($phase,'student',$dom,$confname,$settings,\$rowtotal); |
|
} elsif ($action eq 'coursedefaults') { |
|
$output .= &print_coursedefaults('top',$dom,$settings,\$rowtotal); |
} |
} |
$output .= ' |
$output .= ' |
</table> |
</table> |
Line 709 sub print_config_box {
|
Line 729 sub print_config_box {
|
<td class="LC_right_item">'.&mt($item->{'header'}->[2]->{'col2'}).'</td> </tr>'. |
<td class="LC_right_item">'.&mt($item->{'header'}->[2]->{'col2'}).'</td> </tr>'. |
&print_usersessions('bottom',$dom,$settings,\$rowtotal); |
&print_usersessions('bottom',$dom,$settings,\$rowtotal); |
$rowtotal ++; |
$rowtotal ++; |
|
} elsif ($action eq 'coursedefaults') { |
|
$output .= &print_coursedefaults('bottom',$dom,$settings,\$rowtotal); |
} elsif ($action eq 'rolecolors') { |
} elsif ($action eq 'rolecolors') { |
$output .= &print_rolecolors($phase,'coordinator',$dom,$confname,$settings,\$rowtotal).' |
$output .= &print_rolecolors($phase,'coordinator',$dom,$confname,$settings,\$rowtotal).' |
</table> |
</table> |
Line 805 sub print_config_box {
|
Line 827 sub print_config_box {
|
$output .= &print_helpsettings($dom,$confname,$settings,\$rowtotal); |
$output .= &print_helpsettings($dom,$confname,$settings,\$rowtotal); |
} elsif ($action eq 'loadbalancing') { |
} elsif ($action eq 'loadbalancing') { |
$output .= &print_loadbalancing($dom,$settings,\$rowtotal); |
$output .= &print_loadbalancing($dom,$settings,\$rowtotal); |
} elsif ($action eq 'coursedefaults') { |
|
$output .= &print_coursedefaults('bottom',$dom,$settings,\$rowtotal); |
|
} |
} |
} |
} |
$output .= ' |
$output .= ' |
Line 2002 sub print_requestmail {
|
Line 2022 sub print_requestmail {
|
sub print_studentcode { |
sub print_studentcode { |
my ($settings,$rowtotal) = @_; |
my ($settings,$rowtotal) = @_; |
my $rownum = 0; |
my $rownum = 0; |
my ($output,%current); |
my %choices; |
my @crstypes = ('official','unofficial','community','textbook'); |
$choices{'uniquecode'} = &mt('Generate unique six character code as course identifier?'); |
if (ref($settings->{'uniquecode'}) eq 'HASH') { |
my @toggles = ('uniquecode'); |
foreach my $type (@crstypes) { |
my %defaultchecked = ('uniquecode' => 'off'); |
$current{$type} = $settings->{'uniquecode'}{$type}; |
(my $reports,$rownum) = &radiobutton_prefs($settings,\@toggles,\%defaultchecked, |
} |
\%choices,$rownum); |
} |
$$rowtotal += $rownum; |
$output .= '<tr>'. |
return $reports; |
'<td class="LC_left_item">'.&mt('Generate unique six character code as course identifier?').'</td>'. |
|
'<td class="LC_left_item">'; |
|
foreach my $type (@crstypes) { |
|
my $check = ' '; |
|
if ($current{$type}) { |
|
$check = ' checked="checked" '; |
|
} |
|
$output .= '<span class="LC_nobreak"><label>'. |
|
'<input type="checkbox" name="uniquecode" value="'.$type.'"'.$check.'/>'. |
|
&mt($type).'</label></span>'.(' 'x2).' '; |
|
} |
|
$output .= '</td></tr>'; |
|
$$rowtotal ++; |
|
return $output; |
|
} |
} |
|
|
sub print_textbookcourses { |
sub print_textbookcourses { |
Line 4526 sub print_serverstatuses {
|
Line 4532 sub print_serverstatuses {
|
sub serverstatus_pages { |
sub serverstatus_pages { |
return ('userstatus','lonstatus','loncron','server-status','codeversions', |
return ('userstatus','lonstatus','loncron','server-status','codeversions', |
'checksums','clusterstatus','metadata_keywords','metadata_harvest', |
'checksums','clusterstatus','metadata_keywords','metadata_harvest', |
'takeoffline','takeonline','showenv','toggledebug','ping','domconf', |
'takeoffline','takeonline','showenv','toggledebug','ping','domconf'); |
'uniquecodes'); |
|
} |
} |
|
|
sub coursecategories_javascript { |
sub coursecategories_javascript { |
Line 6104 sub modify_quotas {
|
Line 6109 sub modify_quotas {
|
my @approvalnotify = &Apache::loncommon::get_env_multiple('form.reqapprovalnotify'); |
my @approvalnotify = &Apache::loncommon::get_env_multiple('form.reqapprovalnotify'); |
@approvalnotify = sort(@approvalnotify); |
@approvalnotify = sort(@approvalnotify); |
$confhash{'notify'}{'approval'} = join(',',@approvalnotify); |
$confhash{'notify'}{'approval'} = join(',',@approvalnotify); |
my @crstypes = ('official','unofficial','community','textbook'); |
if ($env{'form.uniquecode'}) { |
my @hasuniquecode = &Apache::loncommon::get_env_multiple('form.uniquecode'); |
$confhash{'uniquecode'} = 1; |
foreach my $type (@hasuniquecode) { |
} else { |
if (grep(/^\Q$type\E$/,@crstypes)) { |
$confhash{'uniquecode'} = ''; |
$confhash{'uniquecode'}{$type} = 1; |
|
} |
|
} |
} |
my ($newbook,@allpos); |
my ($newbook,@allpos); |
if ($context eq 'requestcourses') { |
if ($context eq 'requestcourses') { |
Line 6144 sub modify_quotas {
|
Line 6147 sub modify_quotas {
|
$changes{'notify'}{'approval'} = 1; |
$changes{'notify'}{'approval'} = 1; |
} |
} |
} |
} |
if (ref($domconfig{$action}{'uniquecode'}) eq 'HASH') { |
if ($domconfig{$action}{'uniquecode'}) { |
if (ref($confhash{'uniquecode'}) eq 'HASH') { |
unless ($confhash{'uniquecode'}) { |
foreach my $crstype (keys(%{$domconfig{$action}{'uniquecode'}})) { |
$changes{'uniquecode'} = 1; |
unless ($confhash{'uniquecode'}{$crstype}) { |
} |
$changes{'uniquecode'} = 1; |
} else { |
} |
if ($confhash{'uniquecode'}) { |
} |
$changes{'uniquecode'} = 1; |
unless ($changes{'uniquecode'}) { |
} |
foreach my $crstype (keys(%{$confhash{'uniquecode'}})) { |
|
unless ($domconfig{$action}{'uniquecode'}{$crstype}) { |
|
$changes{'uniquecode'} = 1; |
|
} |
|
} |
|
} |
|
} else { |
|
$changes{'uniquecode'} = 1; |
|
} |
|
} elsif (ref($confhash{'uniquecode'}) eq 'HASH') { |
|
$changes{'uniquecode'} = 1; |
|
} |
} |
if ($context eq 'requestcourses') { |
if ($context eq 'requestcourses') { |
if (ref($domconfig{$action}{'textbooks'}) eq 'HASH') { |
if (ref($domconfig{$action}{'textbooks'}) eq 'HASH') { |
Line 6224 sub modify_quotas {
|
Line 6216 sub modify_quotas {
|
if ($confhash{'notify'}{'approval'}) { |
if ($confhash{'notify'}{'approval'}) { |
$changes{'notify'}{'approval'} = 1; |
$changes{'notify'}{'approval'} = 1; |
} |
} |
if (ref($confhash{'uniquecode'} eq 'HASH')) { |
if ($confhash{'uniquecode'}) { |
$changes{'uniquecode'} = 1; |
$changes{'uniquecode'} = 1; |
} |
} |
} |
} |
Line 6552 sub modify_quotas {
|
Line 6544 sub modify_quotas {
|
if ($action eq 'requestcourses') { |
if ($action eq 'requestcourses') { |
my @offon = ('off','on'); |
my @offon = ('off','on'); |
if ($changes{'uniquecode'}) { |
if ($changes{'uniquecode'}) { |
if (ref($confhash{'uniquecode'}) eq 'HASH') { |
$resulttext .= '<li>'. |
my $codestr = join(' ',map{ &mt($_); } sort(keys(%{$confhash{'uniquecode'}}))); |
&mt('Generation of six character code as course identifier for distribution to students set to '. |
$resulttext .= '<li>'. |
$offon[$env{'form.uniquecode'}]). |
&mt('Generation of six character code as course identifier for distribution to students set to on for: [_1].','<b>'.$codestr.'</b>'). |
'</li>'; |
'</li>'; |
|
} else { |
|
$resulttext .= '<li>'.&mt('Generation of six character code as course identifier for distribution to students set to off.'). |
|
'</li>'; |
|
} |
|
} |
} |
if (ref($changes{'textbooks'}) eq 'HASH') { |
if (ref($changes{'textbooks'}) eq 'HASH') { |
$resulttext .= '<li>'.&mt('Available textbooks updated').'<ul>'; |
$resulttext .= '<li>'.&mt('Available textbooks updated').'<ul>'; |
Line 9278 sub active_dc_picker {
|
Line 9265 sub active_dc_picker {
|
'<input type="'.$inputtype.'" name="'.$name.'"'. |
'<input type="'.$inputtype.'" name="'.$name.'"'. |
' value="'.$domcoord[$i].'"'.$check.' />'.$user; |
' value="'.$domcoord[$i].'"'.$check.' />'.$user; |
if ($user ne $dcname.':'.$dcdom) { |
if ($user ne $dcname.':'.$dcdom) { |
$table .= ' ('.$dcname.':'.$dcdom.')'; |
$table .= ' ('.$dcname.':'.$dcdom.')'. |
|
'</label></span></td>'; |
} |
} |
$table .= '</label></span></td>'; |
|
} |
} |
$table .= '</tr></table>'; |
$table .= '</tr></table>'; |
} elsif ($numdcs == 1) { |
} elsif ($numdcs == 1) { |
my ($dcname,$dcdom) = split(':',$domcoord[0]); |
|
my $user = &Apache::loncommon::plainname($dcname,$dcdom); |
|
if ($inputtype eq 'radio') { |
if ($inputtype eq 'radio') { |
$table .= '<input type="hidden" name="'.$name.'" value="'.$domcoord[0].'" />'.$user; |
$table .= '<input type="hidden" name="'.$name.'" value="'.$domcoord[0].'" />'; |
if ($user ne $dcname.':'.$dcdom) { |
|
$table .= ' ('.$dcname.':'.$dcdom.')'; |
|
} |
|
} else { |
} else { |
my $check; |
my $check; |
if (exists($currhash{$domcoord[0]})) { |
if (exists($currhash{$domcoord[0]})) { |
$check = ' checked="checked"'; |
$check = ' checked="checked"'; |
} |
} |
$table .= '<span class="LC_nobreak"><label>'. |
$table .= '<input type="checkbox" name="'.$name.'" '. |
'<input type="checkbox" name="'.$name.'" '. |
'value="'.$domcoord[0].'"'.$check.' />'; |
'value="'.$domcoord[0].'"'.$check.' />'.$user; |
|
if ($user ne $dcname.':'.$dcdom) { |
|
$table .= ' ('.$dcname.':'.$dcdom.')'; |
|
} |
|
$table .= '</label></span>'; |
|
$rows ++; |
$rows ++; |
} |
} |
} |
} |