--- loncom/interface/longroup.pm 2006/07/02 17:08:42 1.8 +++ loncom/interface/longroup.pm 2006/07/28 18:44:27 1.11 @@ -232,6 +232,9 @@ sub group_changes { my $courseid = $cid; $courseid =~ s|^/||; $courseid =~ s|/|_|; + if ($role =~ /^cr/) { + $role =~ s/\//_/g; + } my %crshash=&Apache::lonnet::coursedescription($cid); $cdom = $crshash{'domain'}; $cnum = $crshash{'num'}; @@ -439,8 +442,8 @@ sub get_tool_privs { discussion => { cgb => 'Create boards', pgd => 'Post', - pag => 'Anon. posts', - rgi => 'Get identities', + egp => 'Edit own posts', + dgp => 'Hide/Delete any post', vgb => 'View boards', }, chat => { @@ -454,7 +457,8 @@ sub get_tool_privs { agf => 'Control Access', }, roster => { - vgm => 'View', + vgm => 'Basic Display', + vmd => 'Detailed Display', }, homepage => { vgh => 'View page', @@ -474,9 +478,11 @@ sub group_memberlist { 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,17 +513,17 @@ sub group_memberlist { 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) { + if ((@userprivs > 0) && (ref($fixedprivs) eq 'HASH')) { foreach my $tool (sort(keys(%{$fixedprivs}))) { foreach my $priv (keys(%{$$fixedprivs{$tool}})) { if (grep/^$priv$/,@userprivs) { @@ -528,7 +534,7 @@ sub group_memberlist { } $hastools = 1; } - if (@{$available} > 0) { + if ((ref($available) eq 'ARRAY') && (@{$available} > 0)) { if (@{$current{$user}{currtools}} > 0) { if ("@{$available}" ne "@{$current{$user}{currtools}}") { foreach my $tool (@{$available}) { @@ -563,8 +569,7 @@ sub group_memberlist { } } } - return (\%current,$hastools,$addtools,$num_previous,$num_future, - $num_active); + return (\%current,\%member_nums,$hastools,$addtools); } ############################################### @@ -611,11 +616,8 @@ sub get_bbfolder_url { 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; } @@ -623,7 +625,7 @@ sub get_bbfolder_url { ############################################### sub get_group_bbinfo { - my ($cdom,$cnum,$group) = @_; + my ($cdom,$cnum,$group,$boardurl) = @_; my $navmap = Apache::lonnavmaps::navmap->new(); my @groupboards; my %boardshash; @@ -634,12 +636,23 @@ sub get_group_bbinfo { my @boards = $navmap->retrieveResources($bbfolderres,undef,0,0); foreach my $res (@boards) { my $url = $res->src(); - if ($url =~ m|^/adm/\Q$cdom\E/\Q$cnum\E/\d+/bulletinboard|) { - push(@groupboards,$res->symb()); - $boardshash{$res->symb()} = { - title => $res->title(), - url => $res->src(), - }; + if ($url =~ m|^(/adm/\Q$cdom\E/\Q$cnum\E/\d+/bulletinboard)|) { + if ($boardurl) { + if ($boardurl =~ /^\Q$1\E/) { + push(@groupboards,$res->symb()); + $boardshash{$res->symb()} = { + title => $res->title(), + url => $res->src(), + }; + last; + } + } else { + push(@groupboards,$res->symb()); + $boardshash{$res->symb()} = { + title => $res->title(), + url => $res->src(), + }; + } } } }