[LON-CAPA-cvs] cvs: loncom /interface longroup.pm

raeburn lon-capa-cvs@mail.lon-capa.org
Sat, 08 Jul 2006 00:52:47 -0000


raeburn		Fri Jul  7 20:52:47 2006 EDT

  Modified files:              
    /loncom/interface	longroup.pm 
  Log:
  File name of map containing group discussion boards now named group_boards_$group.sequence where $group is groupID.  Also counts of member statuses now accumulated in a hash. 
  
  
Index: loncom/interface/longroup.pm
diff -u loncom/interface/longroup.pm:1.8 loncom/interface/longroup.pm:1.9
--- loncom/interface/longroup.pm:1.8	Sun Jul  2 13:08:42 2006
+++ loncom/interface/longroup.pm	Fri Jul  7 20:52:45 2006
@@ -474,9 +474,11 @@
     my %current = ();
     my $hastools = 0;
     my $addtools = 0;
-    my $num_previous = 0;
-    my $num_future = 0;
-    my $num_active = 0;
+    my %member_nums = (
+                        'previous' => 0,
+                        'future' => 0,
+                        'active' => 0,
+                      );
     my $now = time;
     if (keys(%membership) > 0) {
         my %allnames = ();
@@ -507,15 +509,15 @@
                     if (($end > 0) && ($end < $now)) {
                         $current{$user}{changestate} = 'reenable';
                         $current{$user}{'status'} = 'previous';
-                        $num_previous++;
+                        $member_nums{'previous'} ++;
                     } elsif (($start > $now)) {
                         $current{$user}{changestate} = 'activate';
                         $current{$user}{'status'} = 'future';
-                        $num_future ++;
+                        $member_nums{'future'} ++;
                     } else {
                         $current{$user}{changestate} = 'expire';
                         $current{$user}{'status'} = 'active';
-                        $num_active ++;
+                        $member_nums{'active'} ++;
                     }
                     if (@userprivs > 0) {
                         foreach my $tool (sort(keys(%{$fixedprivs}))) {
@@ -563,8 +565,7 @@
             }
         }
     }
-    return (\%current,$hastools,$addtools,$num_previous,$num_future,
-            $num_active);
+    return (\%current,$hastools,$addtools,\%member_nums);
 }
 
 ###############################################
@@ -611,11 +612,8 @@
     my %curr_groups = &coursegroups($cdom,$cnum,$group);
     my $grpbbmap;
     if (%curr_groups) {
-        my %group_info =  &get_group_settings($curr_groups{$group});
-        my $creation = $group_info{'creation'};
-        my $bbfolder = $creation + 1;
         my $crspath = '/uploaded/'.$cdom.'/'.$cnum.'/';
-        $grpbbmap = $crspath.'default_'.$bbfolder.'.sequence';
+        $grpbbmap = $crspath.'group_boards_'.$group.'.sequence';
     }
     return $grpbbmap;
 }