--- loncom/interface/domainprefs.pm 2007/09/26 12:42:32 1.30 +++ loncom/interface/domainprefs.pm 2008/01/04 10:17:13 1.39 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to set domain-wide configuration settings # -# $Id: domainprefs.pm,v 1.30 2007/09/26 12:42:32 raeburn Exp $ +# $Id: domainprefs.pm,v 1.39 2008/01/04 10:17:13 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -68,10 +68,10 @@ sub handler { my %domconfig = &Apache::lonnet::get_dom('configuration',['login','rolecolors', 'quotas','autoenroll','autoupdate','directorysrch', - 'usercreation','contacts'],$dom); + 'usercreation','usermodification','contacts'],$dom); my @prefs_order = ('rolecolors','login','quotas','autoenroll', 'autoupdate','directorysrch','contacts', - 'usercreation'); + 'usercreation','usermodification'); my %prefs = ( 'rolecolors' => { text => 'Default color schemes', @@ -127,11 +127,21 @@ sub handler { 'usercreation' => { text => 'User creation', help => 'Domain_User_Creation', - header => [{col1 => 'Setting', - col2 => 'Value',}, + header => [{col1 => 'Format Rule Type', + col2 => 'Format Rules in force'}, + {col1 => 'User account creation', + col2 => 'Usernames which may be created',}, {col1 => 'Context', col2 => 'Assignable Authentication Types'}], }, + 'usermodification' => + { text => 'User modification', + help => 'Domain_User_Modification', + header => [{col1 => 'Target user has role', + col2 => 'User information updateable in author context'}, + {col1 => 'Target user has role', + col2 => 'User information updateable in course context'}], + }, ); my @roles = ('student','coordinator','author','admin'); my @actions = &Apache::loncommon::get_env_multiple('form.actions'); @@ -271,11 +281,24 @@ sub handler { ' />  '. '

'); + ' />

'); + my ($numitems,$midpoint,$seconddiv,$count); + $numitems = @prefs_order; + $midpoint = int($numitems/2); + if ($numitems%2) { + $midpoint ++; + } + $count = 0; foreach my $item (@prefs_order) { - $r->print('

'); + $r->print('

'); + $count ++; + if ((!$seconddiv) && ($count >= $midpoint)) { + $r->print('
'."\n".'
'."\n"); + $seconddiv = 1; + } } - $r->print('

'.&mt('Display options').'

'."\n". + $r->print('

'. + &mt('Display options').'

'."\n". '

'.&mt('Display using: ')."\n". '  '. @@ -306,6 +329,8 @@ sub process_changes { $output = &modify_directorysrch($dom,%domconfig); } elsif ($action eq 'usercreation') { $output = &modify_usercreation($dom,%domconfig); + } elsif ($action eq 'usermodification') { + $output = &modify_usermodification($dom,%domconfig); } elsif ($action eq 'contacts') { $output = &modify_contacts($dom,%domconfig); } @@ -327,7 +352,7 @@ sub print_config_box { # '); $rowtotal ++; if (($action eq 'autoupdate') || ($action eq 'rolecolors') || - ($action eq 'usercreation')) { + ($action eq 'usercreation') || ($action eq 'usermodification')) { my $colspan = ($action eq 'rolecolors')?' colspan="2"':''; $output .= ' @@ -341,7 +366,9 @@ sub print_config_box { if ($action eq 'autoupdate') { $output .= &print_autoupdate('top',$dom,$settings,\$rowtotal); } elsif ($action eq 'usercreation') { - $output .= &print_usercreation('top',$dom,$settings,\$rowtotal); + $output .= &print_usercreation('top',$dom,$settings,\$rowtotal); + } elsif ($action eq 'usermodification') { + $output .= &print_usermodification('top',$dom,$settings,\$rowtotal); } else { $output .= &print_rolecolors($phase,'student',$dom,$confname,$settings,\$rowtotal); } @@ -360,7 +387,20 @@ sub print_config_box { if ($action eq 'autoupdate') { $output .= &print_autoupdate('bottom',$dom,$settings,\$rowtotal); } elsif ($action eq 'usercreation') { - $output .= &print_usercreation('bottom',$dom,$settings,\$rowtotal); + $output .= &print_usercreation('middle',$dom,$settings,\$rowtotal).' + + + + + + + + + '. + &print_usercreation('bottom',$dom,$settings,\$rowtotal); + $rowtotal ++; + } elsif ($action eq 'usermodification') { + $output .= &print_usermodification('bottom',$dom,$settings,\$rowtotal); } else { $output .= &print_rolecolors($phase,'coordinator',$dom,$confname,$settings,\$rowtotal).'
'.$item->{'header'}->[2]->{'col1'}.''.$item->{'header'}->[2]->{'col2'}.'
@@ -460,18 +500,18 @@ function changePage(formname,newphase) { } elsif ($phase eq 'display') { $js .= &color_pick_js()."\n"; } - $js .= &Apache::lonhtmlcommon::javascript_window_dims().' + $js .= &Apache::loncommon::viewport_size_js().' '; my $additem; if ($phase eq 'pickactions') { my %loaditems = ( - 'onload' => "javascript:;getDimensions(document.$phase.width,document.$phase.height);setDisplayColumns();setFormElements(document.pickactions);", + 'onload' => "javascript:getViewportDims(document.$phase.width,document.$phase.height);setDisplayColumns();setFormElements(document.pickactions);", ); $additem = {'add_entries' => \%loaditems,}; } else { my %loaditems = ( - 'onload' => "javascript:getDimensions(document.$phase.width,document.$phase.height)", + 'onload' => "javascript:getViewportDims(document.$phase.width,document.$phase.height);", ); $additem = {'add_entries' => \%loaditems,}; } @@ -995,6 +1035,10 @@ sub print_autoenroll { } } my $domform = &Apache::loncommon::select_dom_form($defdom,'sender_domain',1); + my $notif_sender; + if (ref($settings) eq 'HASH') { + $notif_sender = $settings->{'sender_uname'}; + } my $datatable=''. ''.&mt('Auto-enrollment active?').''. '