--- loncom/interface/loncoursegroups.pm 2006/07/07 16:48:21 1.40 +++ loncom/interface/loncoursegroups.pm 2006/07/07 19:17:19 1.42 @@ -1,6 +1,6 @@ # The LearningOnline Network with CAPA # -# $Id: loncoursegroups.pm,v 1.40 2006/07/07 16:48:21 albertel Exp $ +# $Id: loncoursegroups.pm,v 1.42 2006/07/07 19:17:19 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1182,10 +1182,9 @@ sub general_settings_form { $toolprivs,$fixedprivs,$sectioncount,$stored,$states,$navbuttons, $rowColor1,$rowColor2,$gpterm,$ucgpterm,$crstype) = @_; my ($nexttext,$prevtext); - &groupsettings_options($r,$tabcol,$functions,$action,$formname,$stored,1, + &groupsettings_options($r,$functions,$action,$formname,$stored,1, $gpterm,$ucgpterm,$crstype); - &access_date_settings($r,$tabcol,$action,$formname,$stored,2,$gpterm, - $ucgpterm); + &access_date_settings($r,$action,$formname,$stored,2,$gpterm,$ucgpterm); if ($action eq 'create') { &membership_options($r,$action,$formname,$sectioncount,3,$gpterm, $ucgpterm); @@ -1210,7 +1209,7 @@ sub general_settings_form { } sub groupsettings_options { - my ($r,$tabcol,$functions,$action,$formname,$stored,$image,$gpterm, + my ($r,$functions,$action,$formname,$stored,$image,$gpterm, $ucgpterm,$crstype) = @_; my %lt = &Apache::lonlocal::texthash( 'gdat' => "$ucgpterm open and close dates", @@ -1226,12 +1225,9 @@ sub groupsettings_options { my ($crsquota,$freespace,$maxposs) = &get_quota_constraints($action,$stored); &topic_bar($r,$image,$lt{'gnde'}); $r->print(' - -   - - +
- + - + - + END my $numitems = keys(%{$functions}); my $halfnum = int($numitems/2); @@ -1284,7 +1280,7 @@ END - + -
'.$lt{'gnam'}.':'.$lt{'gnam'}.': '); if ($action eq 'create') { @@ -1244,13 +1240,13 @@ sub groupsettings_options {
$lt{'desc'}:$lt{'desc'}:
$lt{'func'}:$lt{'func'}:
'.&mt('Granularity:').''.&mt('Granularity:').' '.$lt{'doyo'}.'  '); if ($action eq 'modify') { $r->print('  ('.&mt('Currently set to "[_1]"', @@ -1294,7 +1290,7 @@ END
'.&mt('Disk quota: ').''); + '.&mt('Disk quota: ').''); if ($action eq 'create') { $r->print(&mt('If you enable the file repository for the [_1], allocate a disk quota.',$gpterm)); } else { @@ -1318,8 +1314,6 @@ END
- - '); return; } @@ -1428,7 +1422,7 @@ sub sections_selection { } sub access_date_settings { - my ($r,$tabcol,$action,$formname,$stored,$image,$gpterm,$ucgpterm) = @_; + my ($r,$action,$formname,$stored,$image,$gpterm,$ucgpterm) = @_; my %lt = &Apache::lonlocal::texthash( 'sten' => "Default start and end dates for $gpterm access", ); @@ -1440,21 +1434,11 @@ sub access_date_settings { $endtime = $$stored{'enddate'}; } } - my ($start_table,$end_table) = &date_setting_table - ($starttime,$endtime,$formname); + my ($table) = &date_setting_table($starttime,$endtime,$formname); &topic_bar($r,$image,$lt{'sten'}); $r->print(' - -   - '.$start_table.' - - -   - - -   - '.$end_table.' - '); + '.$table.' + '); return; } @@ -1472,6 +1456,7 @@ sub choose_members_form { my $earlyout = &validate_groupname($groupname,$action,$cdom,$cnum,$gpterm, $ucgpterm,$crstype); if ($earlyout) { + $r->print($earlyout) &display_navbuttons($r,$formname,$$states{$action}[$page-1], $$navbuttons{'gtps'}); return; @@ -1523,13 +1508,7 @@ sub choose_members_form { sub display_navbuttons { my ($r,$formname,$prev,$prevtext,$next,$nexttext) = @_; - $r->print(' - -   - - -   - '); + $r->print('
'); if ($prev) { $r->print(' '); } - $r->print(' - - -'); + $r->print('
'); } sub check_tools { @@ -1585,7 +1561,7 @@ sub print_current_settings { } if ($action eq 'create') { $r->print(' -
'.$lt{'ygrs'}.' +
'.$lt{'ygrs'}.'
'.$lt{'tfwa'}.'
'); } @@ -1697,9 +1673,6 @@ sub pick_new_members { &topic_bar($r,$img,$lt{'gpme'}); if (keys(%members) > 0) { $r->print(' - -   - '); &check_uncheck_buttons($r,$formname,'member',$lt{'addm'}); @@ -1714,16 +1687,8 @@ sub pick_new_members { '); } $r->print('
- - - -   - - -   - '); - $r->print(&Apache::lonhtmlcommon::start_pick_box()); + $r->print(&Apache::loncommon::start_data_table()); $r->print(' @@ -1806,23 +1771,12 @@ sub pick_new_members { } } $r->print(&Apache::lonhtmlcommon::end_pick_box()); - $r->print(' - - '); } else { - $r->print(' - - - - '); } return $newusers; } @@ -1924,8 +1878,8 @@ sub privilege_specificity { } else { $r->print($lt{'algm'}.'

'); } - &default_privileges($r,$action,$tabcol,$rowColor1,$rowColor2, - $tools,$toolprivs,$fixedprivs,$available); + &default_privileges($r,$action,$tools,$toolprivs,$fixedprivs, + $available); } else { if ($action eq 'create') { $r->print($lt{'asyo'}); @@ -1949,79 +1903,70 @@ sub privilege_specificity { } sub default_privileges { - my ($r,$action,$tabcol,$rowColor1,$rowColor2,$tools,$toolprivs, - $fixedprivs,$available) = @_; + my ($r,$action,$tools,$toolprivs,$fixedprivs,$available) = @_; my %lt = &Apache::lonlocal::texthash( 'addp' => 'Additional privileges', 'fixp' => 'Fixed privileges', 'oppr' => 'Optional privileges', 'func' => 'Function', ); - $r->print(&Apache::lonhtmlcommon::start_pick_box()); - $r->print(' - - '); + $r->print(&Apache::lonhtmlcommon::start_pick_box('LC_group_priv_box'). + &Apache::lonhtmlcommon::row_title($lt{'func'},undef, + 'LC_groups_functionality')); + $r->print(join(''."\n"); - $r->print(&Apache::lonhtmlcommon::end_pick_box()); + $r->print(&Apache::lonhtmlcommon::row_title($lt{'fixp'},undef, + 'LC_groups_fixed'). + $fixed. + &Apache::lonhtmlcommon::row_closure(1)); + $r->print(&Apache::lonhtmlcommon::row_title($lt{'oppr'},undef, + 'LC_groups_optional'). + $dynamic. + &Apache::lonhtmlcommon::end_pick_box()); $r->print('
'); return; + } sub display_defprivs { @@ -3423,23 +3368,18 @@ sub date_setting_table { 'startdate',$starttime); my $endform = &Apache::lonhtmlcommon::date_setter($formname, 'enddate',$endtime); - my $perpetual = ''; - my $start_table = ''; - $start_table .= "
  -'); if ($totalusers > 0) { $r->print($lt{'nnew'}.'

'.$lt{'yoma'}); } else { $r->print($lt{'nome'}); } - $r->print(' -
- - - - - - - - - - -
'.$lt{'func'}.'
'.$lt{'fixp'}.'
'.$lt{'oppr'}.'
-
',@{$tools})); + $r->print(&Apache::lonhtmlcommon::row_closure(1)); + my $fixed = ''; + my $dynamic = ''; foreach my $tool (@{$tools}) { - $r->print(' - - - - - '); my $privcount = 0; - my $fixed = ''; - my $dynamic = ''; + if ($dynamic ne '') { + $dynamic .= ' - '); + $dynamic .= '
'.$tool.'
'; + } + $dynamic .= ''; foreach my $priv (sort(keys(%{$$toolprivs{$tool}}))) { if (exists($$fixedprivs{$tool}{$priv})) { + if ($fixed ne '') { + $fixed .= ' - '."\n"; + '."\n"; } $dynamic .= ''."\n"; } } - if ($dynamic eq '') { - $dynamic = ''."\n"; + if ($privcount == 0) { + $dynamic .= ''."\n"; } if ($privcount < 3) { - $dynamic .= ' - - '."\n"; + $dynamic .= ' + '."\n"; } elsif ($privcount%2) { $dynamic = ''."\n"; } - $r->print(' - - - '."\n".$dynamic.''."\n".'
'; + } $fixed .= ''.$$toolprivs{$tool}{$priv}.' '; if ($action eq 'modify') { - if (grep/^$tool$/,@{$available}) { + if (grep(/^$tool$/,@{$available})) { $fixed .= ''.&mt('(on)').' '; } else { $fixed .= ''.&mt('(off)').' '; } } } else { - $privcount ++; + $privcount++; if ($privcount == 3) { $dynamic .= '
NoneNone
   
'.$fixed.'
'."\n".'
'; } - $r->print('
\n"; - $start_table .= ''. + my $perpetual = + ''; + my $table = "
Default starting date for - member access
\n". + ''. ''. - ''."\n"; - $start_table .= "
'.&mt('Start:').''.$startform.' 
"; - my $end_table = ''; - $end_table .= "\n"; - $end_table .= ''. + ''."\n". + ''. ''. - ''."\n"; - $end_table .= "
Default ending date for - member access 
'.&mt('End:').''.$endform.''.$perpetual.'
\n"; - return ($start_table, $end_table); + ''.$perpetual.''."\n". + "\n"; + return $table; } sub add_group_folder { @@ -3670,8 +3610,8 @@ sub validate_groupname { "existing $gpterm", ); - my $exitmsg = ''.$lt{'igna'}.'

'.$lt{'tgne'}.' "'. - $groupname.'" '; + my $exitmsg = ''.$lt{'igna'}.'

'. + $lt{'tgne'}.' "'.$groupname.'" '; my $dupmsg = $lt{'grna'}; my $earlyout; if (($groupname eq '') || ($groupname =~ /\W/)) {