--- loncom/interface/loncoursegroups.pm 2006/07/07 17:11:04 1.41 +++ 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.41 2006/07/07 17:11:04 albertel Exp $ +# $Id: loncoursegroups.pm,v 1.42 2006/07/07 19:17:19 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1182,7 +1182,7 @@ 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,$action,$formname,$stored,2,$gpterm,$ucgpterm); if ($action eq 'create') { @@ -1209,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", @@ -1225,9 +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); @@ -1280,7 +1280,7 @@ END - + - - - - - - - - - - - '); + $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 { @@ -3396,11 +3371,11 @@ sub date_setting_table { my $perpetual = ''; - my $table = "
'.$lt{'gnam'}.':'.$lt{'gnam'}.': '); if ($action eq 'create') { @@ -1240,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]"', @@ -1290,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 { @@ -1456,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; @@ -1507,6 +1508,7 @@ sub choose_members_form { sub display_navbuttons { my ($r,$formname,$prev,$prevtext,$next,$nexttext) = @_; + $r->print('
'); if ($prev) { $r->print(' '); } + $r->print('
'); } sub check_tools { @@ -1558,7 +1561,7 @@ sub print_current_settings { } if ($action eq 'create') { $r->print(' -
'.$lt{'ygrs'}.' +
'.$lt{'ygrs'}.'
'.$lt{'tfwa'}.'
'); } @@ -1670,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'}); @@ -1687,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(' @@ -1779,23 +1771,12 @@ sub pick_new_members { } } $r->print(&Apache::lonhtmlcommon::end_pick_box()); - $r->print(' - - '); } else { - $r->print(' - - - - '); } return $newusers; } @@ -1897,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'}); @@ -1922,76 +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::loncommon::start_data_table(). - &Apache::loncommon::start_data_table_header_row()); - $r->print(' - - - - - - - -
  -'); 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". - ''. + my $table = "
'.&mt('Start:').'
\n". + ''. ''. ''."\n". - ''. + ''. ''. ''."\n". "
'.&mt('Start:').''.$startform.' 
'.&mt('End:').'
'.&mt('End:').''.$endform.''.$perpetual.'
\n"; @@ -3635,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/)) {