--- loncom/interface/loncreateuser.pm 2008/01/06 04:38:57 1.229 +++ loncom/interface/loncreateuser.pm 2008/01/21 01:45:04 1.234 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Create a user # -# $Id: loncreateuser.pm,v 1.229 2008/01/06 04:38:57 raeburn Exp $ +# $Id: loncreateuser.pm,v 1.234 2008/01/21 01:45:04 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -156,21 +156,21 @@ END_SCRIPT $custom_off = ' '; $showquota = $currquota; if ($longinsttype eq '') { - $defaultinfo = &mt('For this user, the default quota would be [_1] - Mb.',$defquota); + $defaultinfo = &mt('For this user, the default quota would be [_1]' + .' Mb.',$defquota); } else { - $defaultinfo = &mt("For this user, the default quota would be [_1] - Mb, as determined by the user's institutional - affiliation ([_2]).",$defquota,$longinsttype); + $defaultinfo = &mt("For this user, the default quota would be [_1]". + " Mb, as determined by the user's institutional". + " affiliation ([_2]).",$defquota,$longinsttype); } } else { if ($longinsttype eq '') { - $defaultinfo = &mt('For this user, the default quota is [_1] - Mb.',$defquota); + $defaultinfo = &mt('For this user, the default quota is [_1]' + .' Mb.',$defquota); } else { - $defaultinfo = &mt("For this user, the default quota of [_1] - Mb, is determined by the user's institutional - affiliation ([_2]).",$defquota,$longinsttype); + $defaultinfo = &mt("For this user, the default quota of [_1]". + " Mb, is determined by the user's institutional". + " affiliation ([_2]).",$defquota,$longinsttype); } } my $output = $quota_javascript. @@ -355,7 +355,7 @@ ENDBLOCK - + @@ -603,9 +603,12 @@ sub print_user_modification_page { my $js = &validation_javascript($context,$ccdomain,$pjump_def, $groupslist,$newuser,$formname,\%loaditem); + my $args = {'add_entries' => \%loaditem}; + if ($env{'form.popup'}) { + $args->{'no_nav_bar'} = 1; + } my $start_page = - &Apache::loncommon::start_page('User Management', - $js,{'add_entries' => \%loaditem,}); + &Apache::loncommon::start_page('User Management',$js,$args); my %breadcrumb_text = &singleuser_breadcrumb(); &Apache::lonhtmlcommon::add_breadcrumb ({href=>"javascript:backPage($form)", @@ -1486,7 +1489,13 @@ sub update_user_data { my $jscript = ''."\n"; my %breadcrumb_text = &singleuser_breadcrumb(); - $r->print(&Apache::loncommon::start_page($title,$jscript)); + my $args; + if ($env{'form.popup'}) { + $args->{'no_nav_bar'} = 1; + } else { + $args = undef; + } + $r->print(&Apache::loncommon::start_page($title,$jscript,$args)); &Apache::lonhtmlcommon::add_breadcrumb ({href=>"javascript:backPage(document.userupdate)", text=>$breadcrumb_text{'search'}, @@ -1636,6 +1645,27 @@ sub update_user_data { $r->print(&mt('Generating user').': '.$result); $uhome = &Apache::lonnet::homeserver($env{'form.ccuname'}, $env{'form.ccdomain'}); + if (($uhome ne 'no_host') && ($env{'form.customquota'} == 1)) { + my (%changeHash,$newportfolioquota); + if ($env{'form.portfolioquota'} eq '') { + $newportfolioquota = 0; + } else { + $newportfolioquota = $env{'form.portfolioquota'}; + $newportfolioquota =~ s/[^\d\.]//g; + } + my $quotachanged = "a_admin($newportfolioquota,\%changeHash); + if ($quotachanged) { + $changeHash{'firstname'} = $env{'form.cfirstname'}; + $changeHash{'middlename'} = $env{'form.cmiddlename'}; + $changeHash{'lastname'} = $env{'form.clastname'}; + $changeHash{'generation'} = $env{'form.cgeneration'}; + $changeHash{'id'} = $env{'form.cid'}; + $changeHash{'permanentemail'} = $env{'form.cpermanentemail'}; + my $quotachgresult = + &Apache::lonnet::put('environment',\%changeHash, + $env{'form.ccdomain'},$env{'form.ccuname'}); + } + } $r->print('
'.&mt('Home server').': '.$uhome.' '. &Apache::lonnet::hostname($uhome)); } elsif (($env{'form.login'} ne 'nochange') && @@ -2033,8 +2063,12 @@ END } } my $userinfo = &Apache::loncommon::plainname($env{'form.ccuname'}, - $env{'form.ccdomain'}); - $r->print('

'.&mt('Modify this user: ([_1])',$userinfo).''.(' 'x5).''.&mt('Create/Modify Another User').'

'); + $env{'form.ccdomain'}); + if ($env{'form.popup'}) { + $r->print('

'.&mt('Close window').'

'); + } else { + $r->print('

'.&mt('Modify this user: ([_1])',$userinfo).''.(' 'x5).''.&mt('Create/Modify Another User').'

'); + } } $r->print(&Apache::loncommon::end_page()); } @@ -2731,7 +2765,8 @@ sub handler { $context = 'domain'; } &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}, - ['action','state','callingform','roletype','showrole','bulkaction']); + ['action','state','callingform','roletype','showrole','bulkaction','popup','phase', + 'username','domain','srchterm','srchdomain','srchin','srchby','srchtype']); &Apache::lonhtmlcommon::clear_breadcrumbs(); if ($env{'form.action'} ne 'dateselect') { &Apache::lonhtmlcommon::add_breadcrumb @@ -3056,6 +3091,10 @@ sub print_main_menu { foreach my $menu_item (@menu) { next if (! $menu_item->{'permission'}); $menu_html.='

'; + if (exists($menu_item->{'help'})) { + $menu_html.= + &Apache::loncommon::help_open_topic($menu_item->{'help'}); + } $menu_html.=''; if (exists($menu_item->{'url'})) { $menu_html.=qq{}; @@ -3064,10 +3103,6 @@ sub print_main_menu { qq{}; } $menu_html.= &mt($menu_item->{'text'}).''; - if (exists($menu_item->{'help'})) { - $menu_html.= - &Apache::loncommon::help_open_topic($menu_item->{'help'}); - } $menu_html.='

'; } return $menu_html;