version 1.18, 2009/01/27 15:59:30
|
version 1.29, 2012/12/18 15:26:03
|
Line 1
|
Line 1
|
# The LearningOnline Network with CAPA |
# The LearningOnline Network with CAPA |
# accessor routines used to provide information about course groups |
# accessor routines used to provide information about course groups |
# |
# |
|
# $Id$ |
|
# |
# Copyright Michigan State University Board of Trustees |
# Copyright Michigan State University Board of Trustees |
# |
# |
# This file is part of the LearningOnline Network with CAPA (LON-CAPA). |
# This file is part of the LearningOnline Network with CAPA (LON-CAPA). |
Line 28 package Apache::longroup;
|
Line 30 package Apache::longroup;
|
|
|
use strict; |
use strict; |
use Apache::lonnet; |
use Apache::lonnet; |
|
use Apache::lonlocal; |
|
use LONCAPA; |
|
|
############################################### |
############################################### |
=pod |
=pod |
Line 214 for the course is included amongst the u
|
Line 218 for the course is included amongst the u
|
and would trigger membership in teh same group(s) |
and would trigger membership in teh same group(s) |
|
|
If role is being added, will add any group memberships specified |
If role is being added, will add any group memberships specified |
for auto-group population, unless use is already a group member. |
for auto-group population, unless user is already a group member. |
Uses default group privileges and default start and end group access |
Uses default group privileges and default start and end group access |
times. |
times. |
|
|
Line 248 sub group_changes {
|
Line 252 sub group_changes {
|
} else { |
} else { |
$cid = $url; |
$cid = $url; |
} |
} |
my $courseid = $cid; |
|
$courseid =~ s|^/||; |
|
$courseid =~ s|/|_|; |
|
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 288 sub group_changes {
|
Line 289 sub group_changes {
|
if (@changegroups > 0) { |
if (@changegroups > 0) { |
my %currpriv; |
my %currpriv; |
my %roleshash = &Apache::lonnet::dump('roles',$udom,$uname,$cid); |
my %roleshash = &Apache::lonnet::dump('roles',$udom,$uname,$cid); |
if (my $tmp = &Apache::lonnet::error(%roleshash)) { |
if (keys(%roleshash) > 0) { |
&Apache::lonnet::logthis('Error retrieving roles: '.$tmp. |
|
' for '.$uname.':'.$udom); |
|
} else { |
|
my $group_privs = ''; |
my $group_privs = ''; |
foreach my $group (@changegroups) { |
foreach my $group (@changegroups) { |
if ($chgtype eq 'add') { |
if ($chgtype eq 'add') { |
Line 437 sub group_changes {
|
Line 435 sub group_changes {
|
|
|
sub get_fixed_privs { |
sub get_fixed_privs { |
my $fixedprivs = { |
my $fixedprivs = { |
email => {sgm => 1}, |
email => {sgm => 1}, |
discussion => {vgb => 1}, |
discussion => {vgb => 1}, |
chat => {pgc => 1}, |
chat => {pgc => 1}, |
files => {rgf => 1}, |
files => {rgf => 1}, |
roster => {vgm => 1}, |
roster => {vgm => 1}, |
homepage => {vgh => 1}, |
homepage => {vgh => 1}, |
}; |
}; |
return $fixedprivs; |
return $fixedprivs; |
} |
} |
Line 452 sub get_fixed_privs {
|
Line 450 sub get_fixed_privs {
|
sub get_tool_privs { |
sub get_tool_privs { |
my ($gpterm) = @_; |
my ($gpterm) = @_; |
my $toolprivs = { |
my $toolprivs = { |
email => { |
email => { |
sgm => 'Send '.$gpterm.' message', |
sgm => 'Send '.$gpterm.' message', |
sgb => 'Broadcast message', |
sgb => 'Broadcast message', |
}, |
}, |
Line 464 sub get_tool_privs {
|
Line 462 sub get_tool_privs {
|
vgb => 'View boards', |
vgb => 'View boards', |
}, |
}, |
chat => { |
chat => { |
pgc => 'Chat', |
pgc => 'Chat Room', |
}, |
}, |
files => { |
files => { |
rgf => 'Retrieve', |
rgf => 'Retrieve', |
Line 683 sub get_group_bbinfo {
|
Line 681 sub get_group_bbinfo {
|
} |
} |
|
|
############################################### |
############################################### |
|
|
|
sub get_group_link { |
|
my ($cdom,$cnum,$group,$navmap) = @_; |
|
if (ref($navmap)) { |
|
my $symb = 'uploaded/'.$cdom.'/'.$cnum.'/group_folder_'.$group.'.sequence___1___adm/'.$cdom.'/'.$cnum.'/'.$group.'/smppg'; |
|
my $res = $navmap->getBySymb($symb); |
|
my $link; |
|
if (ref($res)) { |
|
$link = $res->link(); |
|
$link .= (($link=~/\?/)?'&':'?').'symb='.$res->shown_symb(); |
|
} else { |
|
$link = '/adm/'.$cdom.'/'.$cnum.'/'.$group.'/smppg'; |
|
} |
|
return $link; |
|
} |
|
return; |
|
} |
|
|
|
############################################### |
|
|
1; |
1; |
|
|