--- loncom/interface/loncoursegroups.pm 2009/02/05 12:32:26 1.92 +++ loncom/interface/loncoursegroups.pm 2010/01/25 22:19:55 1.101.4.1 @@ -1,6 +1,6 @@ # The LearningOnline Network with CAPA # -# $Id: loncoursegroups.pm,v 1.92 2009/02/05 12:32:26 schafran Exp $ +# $Id: loncoursegroups.pm,v 1.101.4.1 2010/01/25 22:19:55 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -77,8 +77,8 @@ sub handler { my %functions = ( email => 'Send Messages', discussion => 'Discussion Boards', - chat => 'Chat', - files => 'File Repository', + chat => 'Chat Room', + files => 'Group Portfolio', roster => 'Membership Roster', homepage => $ucgpterm.' home page', ); @@ -141,7 +141,7 @@ function openGroupRoster(group,status) { rosterbrowser = open(url,title,options,'1'); rosterbrowser.focus(); }\n|; - $r->print(&header('Groups',$jscript,$action,$state)); + $r->print(&header('My Space',$jscript,$action,$state)); if ($env{'form.refpage'} eq 'cusr') { &Apache::lonhtmlcommon::add_breadcrumb ({href=>"/adm/createuser", @@ -785,7 +785,7 @@ sub group_administration { } var maxposs = '.sprintf("%.2f",$maxposs).'; if (newquota > maxposs) { - alert("The file repository quota you entered for this group ("+newquota+" Mb) exceeds the maximum possible ("+maxposs+" Mb). Please enter a smaller number."); + alert("The group portfolio quota you entered for this group ("+newquota+" Mb) exceeds the maximum possible ("+maxposs+" Mb). Please enter a smaller number."); return; } var re_quota = '.$float_check.'; @@ -804,7 +804,7 @@ sub group_administration { } } if (warn_zero == 1) { - alert("You have indicated that the file repository should be enabled, but you have set the respository quota to 0 Mb.\nThis will prevent any upload of files.\nPlease set a value or disable the repository feature."); + alert("You have indicated that the group portfolio should be enabled, but you have set the respository quota to 0 Mb.\nThis will prevent any upload of files.\nPlease set a value or disable the repository feature."); return; } } @@ -916,10 +916,10 @@ function changeSort(caller) { ); my %navbuttons = &Apache::lonlocal::texthash( gtns => 'Next',#'Go to next step', - gtps => 'Previous',#'Go to previous step', + gtps => 'Back',#'Go to previous step', crgr => 'Create '.$gpterm, mose => 'Save',#'Modify settings', - gtpp => 'Previous',#'Go to previous page', + gtpp => 'Back',#'Go to previous page', adme => 'Add members', ); if ((($action eq 'create') || ($action eq 'modify') || ($action eq 'delete') || ($action eq 'reenable')) && @@ -1440,7 +1440,7 @@ sub header { {'add_entries' => $loaditems,}); my $output = <<"END"; $start_page -
+ END if ($action eq 'create' || $action eq 'modify') { @@ -1612,33 +1612,34 @@ sub groupsettings_options { 'lett' => 'Letters, numbers and underscore only', 'doyo' => 'Different subsets of the chosen collaborative tools '. 'for different group members?', + 'gran' => 'Granularity', + 'dquo' => 'Disk quota', ); my ($crsquota,$freespace,$maxposs) = &get_quota_constraints($action,$stored); - $r->print(&Apache::lonhtmlcommon::topic_bar($image,$lt{'gnde'}).' - - - - - - - - - - - -END + $r->print(&Apache::lonhtmlcommon::row_closure()); + + # Group Title + $r->print(&Apache::lonhtmlcommon::row_title($lt{'desc'}) + .'' + .&Apache::lonhtmlcommon::row_closure() + ); + + # Collaborative Tools my $numitems = keys(%{$functions}); my $halfnum = int($numitems/2); my $remnum = $numitems%2; @@ -1646,48 +1647,61 @@ END $halfnum ++; } my @allfunctions = sort(keys (%{$functions})); - for (my $i=0; $i<$halfnum; $i++) { - $r->print(' - '); - } - $r->print(''); - for (my $j=$halfnum; $j<@allfunctions; $j++) { - $r->print(' - '); - } - if ($remnum) { - $r->print(''); + + $r->print(&Apache::lonhtmlcommon::row_title($lt{'func'}) + .'
' + .'' + .' ' + .'
' + .'
'.$lt{'gnam'}.': -'); + $r->print(&Apache::lonhtmlcommon::topic_bar($image,$lt{'gnde'})); + + # Group Name + $r->print(&Apache::lonhtmlcommon::start_pick_box() + .&Apache::lonhtmlcommon::row_title($lt{'gnam'}) + ); if ($action eq 'create') { - $r->print(' ('. - $lt{'lett'}.')'); + $r->print('' + .' (' + .$lt{'lett'}.')' + ); } else { $r->print(''.$env{'form.groupname'}); } - $r->print(<<"END"); -
$lt{'desc'}: -
$lt{'func'}:  '. - '
    
' # FIXME Get rid of inflexible table (-> float) + ); + for (my $i=0; $i<@allfunctions; $i++) { + $r->print('' + ); + if ($i == $halfnum - 1) { + $r->print(''); + } } - $r->print(' - - - - -
- -
'.&mt('Granularity:').''.$lt{'doyo'}.'  '); + $r->print('
' + .&Apache::lonhtmlcommon::row_closure() + ); + + # Granularity + $r->print(&Apache::lonhtmlcommon::row_title($lt{'gran'}) + .$lt{'doyo'}.'
' + .' ' + ); if ($action eq 'modify') { - $r->print('  ('.&mt('Currently set to [_1].' - ,'"'.&mt($$stored{'granularity'}).'"').')'); + $r->print(' (' + .&mt('Currently set to [_1].' + ,'"'.&mt($$stored{'granularity'}).'"') + .')' + ); } - $r->print(' - - - - '.&mt('Disk quota: ').''); + $r->print(&Apache::lonhtmlcommon::row_closure()); + + # Disk Quota + $r->print(&Apache::lonhtmlcommon::row_title($lt{'dquo'})); if ($action eq 'create') { - $r->print(&mt('If you enable the file repository for the '.$gpterm.', allocate a disk quota.')); + $r->print('' + .&mt('If you enable the group portfolio for the '.$gpterm + .', allocate a disk quota.') + .'' + ); } else { - $r->print(&mt('Quota allocated to file repository:')); + $r->print(&mt('Quota allocated to group portfolio:')); } - $r->print(' '.&mt('[_1] Mb','')); + $r->print(' '.&mt('[_1] Mb','')); if ($action eq 'create') { $r->print('
' .&mt('A total of [_1] Mb can be divided amongst all '.$gpterm.'s in the ' @@ -1703,11 +1717,10 @@ END .'by adding all unallocated space for '.$gpterm.'s in the '.lc($crstype).'.' ,sprintf("%.2f",$maxposs))); } - $r->print(' - - - -'); + $r->print(&Apache::lonhtmlcommon::row_closure(1)); + + $r->print(&Apache::lonhtmlcommon::end_pick_box()); + return; } @@ -1875,7 +1888,8 @@ sub choose_members_form { } } &privilege_specificity($r,$action,$specimg,$tools,$stored,$toolprivs, - $fixedprivs,\@available,$formname,$gpterm,$ucgpterm); + $fixedprivs,\@available,$formname,$gpterm,$ucgpterm, + $functions); my $newusers = &pick_new_members($r,$action,$formname,\@available,$idx, $stored,$memimg,$users,$userdata, $granularity,\%origmembers,$gpterm, @@ -1972,42 +1986,25 @@ sub print_current_settings { '.$description.' '); + if (@{$available} > 0) { - $r->print(''.&mt('Available for assignment to members:').''. - ''); - my $rowcell = int(@{$available}/2) + @{$available}%2; + $r->print(''.&mt('Available for assignment to members:').''); + $r->print(''); - } - } - $r->print(''); - } - if ((@{$available} > 3) && (@{$available}%2)) { - $r->print(''); + $r->print('
  • '.&mt($$functions{$$available[$i]}).'
  • '); } - $r->print('
    '.$$functions{$$available[$i]}. - '   

    '); + $r->print(''); } + if (@{$unavailable} > 0) { - $r->print(''.&mt('Unavailable for assignment:').''. - ''); - my $rowcell = int(@{$unavailable}/2) + @{$unavailable}%2; - for (my $j=0; $j<@{$unavailable}; $j++) { - if (@{$unavailable} > 3) { - if ($j==$rowcell) { - $r->print(''); - } - } - $r->print(''); + $r->print(''.&mt('Unavailable for assignment:').''); + $r->print(''); - } - $r->print('
    '.$$functions{$$unavailable[$j]}. - '   
    '); + $r->print(''); } + my $quota_text=&mt('[_1] Mb',$quota); my $granu_text=&mt($granularity); $r->print(<<"END"); @@ -2301,9 +2298,9 @@ sub default_privileges { &Apache::lonhtmlcommon::row_title($lt{'func'},undef, 'LC_groups_functionality')); my @tableHeader; - foreach my $key (sort(keys(%{$functions}))){ - push (@tableHeader,&mt(${$functions}{$key})); - } + if ((ref($functions) eq 'HASH') && (ref($tools) eq 'ARRAY')) { + @tableHeader = map { $functions->{$_}; } @{$tools}; + } $r->print(join('', @tableHeader)); $r->print(&Apache::lonhtmlcommon::row_closure(1)); my $fixed = ''; @@ -2962,9 +2959,8 @@ sub member_privileges_form { foreach my $tool (@{$tools}) { if (@{$showboxes{$tool}} > 0) { $r->print(''); - $r->print(''. - ''); + $r->print('
    '.&mt($tool).''); + $r->print('
    '. - &mt($tool).'
    '); my $privcount = 0; foreach my $priv (@{$showboxes{$tool}}) { $privcount ++; @@ -2999,7 +2995,7 @@ sub member_privileges_form { } } } - $r->print('
     '); + $r->print(' '); } } $r->print(''); @@ -3132,7 +3128,7 @@ sub write_group_data { if ($quota !~ /^\d*\.?\d*$/) { $quota = 0; $r->print('
    ' - .&mt('The value you entered for the quota for the file repository in this '.$gpterm + .&mt('The value you entered for the quota for the group portfolio in this '.$gpterm .' contained invalid characters, so it has been set to 0 Mb. You can change this by' .' modifying the '.$gpterm.' settings.') .'
    '); @@ -3140,7 +3136,7 @@ sub write_group_data { if ($quota > $maxposs) { $quota = $maxposs; $r->print('
    ' - .&mt('The value you entered for the quota for the file repository in this '.$gpterm + .&mt('The value you entered for the quota for the group portfolio in this '.$gpterm .' exceeded the maximum possible value, so it has been set to [_1] Mb ' .'(the maximum possible value).',sprintf("%.2f",$maxposs)) .'
    '); @@ -3763,17 +3759,19 @@ sub date_setting_table { 'startdate',$starttime); my $endform = &Apache::lonhtmlcommon::date_setter($formname, 'enddate',$endtime); - my $perpetual = - ''; - my $table = "\n". - ''. - ''. - ''."\n". - ''. - ''. - ''."\n". - "
    '.&mt('Start:').''.$startform.' 
    '.&mt('End:').''.$endform.''.$perpetual.'
    \n"; + my $perpetual = ' '; + my $table = &Apache::lonhtmlcommon::start_pick_box() + .&Apache::lonhtmlcommon::row_title(&mt('Start Date')) + .$startform + .&Apache::lonhtmlcommon::row_closure() + .&Apache::lonhtmlcommon::row_title(&mt('End Date')) + .$endform + .$perpetual + .&Apache::lonhtmlcommon::row_closure(1) + .&Apache::lonhtmlcommon::end_pick_box(); return $table; }