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