version 1.74, 2008/04/16 23:12:25
|
version 1.78, 2008/08/24 12:54:55
|
Line 406 sub group_administration {
|
Line 406 sub group_administration {
|
my @types = (); |
my @types = (); |
my @roles = (); |
my @roles = (); |
my @sections = (); |
my @sections = (); |
my @buildsections = (); |
|
my %users = (); |
my %users = (); |
my %userdata = (); |
my %userdata = (); |
my @members = (); |
my @members = (); |
Line 566 sub group_administration {
|
Line 565 sub group_administration {
|
} |
} |
if (defined($env{'form.sectionpick'})) { |
if (defined($env{'form.sectionpick'})) { |
@sections=&Apache::loncommon::get_env_multiple('form.sectionpick'); |
@sections=&Apache::loncommon::get_env_multiple('form.sectionpick'); |
if (grep/^all$/,@sections) { |
|
@buildsections = sort {$a cmp $b} keys(%sectioncount); |
|
} else { |
|
@buildsections = @sections; |
|
} |
|
} |
} |
} |
} |
|
|
if (($state eq 'pick_members') || ($state eq 'pick_privs') || ($state eq 'change_privs')) { |
if (($state eq 'pick_members') || ($state eq 'pick_privs') || ($state eq 'change_privs')) { |
&build_members_list($cdom,$cnum,\@types,\@roles,\@buildsections,\%users, |
&build_members_list($cdom,$cnum,\@types,\@roles,\@sections,\%users, |
\%userdata); |
\%userdata); |
} |
} |
if ($state eq 'pick_members') { |
if ($state eq 'pick_members') { |
Line 1169 sub delete_group {
|
Line 1163 sub delete_group {
|
my @deleted; |
my @deleted; |
my @undeleted; |
my @undeleted; |
my %usersettings; |
my %usersettings; |
|
my $context = 'deletegroup'; |
foreach my $key (sort(keys(%membership))) { |
foreach my $key (sort(keys(%membership))) { |
if ($key =~ /^\Q$groupname\E:([^:]+:[^:]+)$/) { |
if ($key =~ /^\Q$groupname\E:([^:]+:[^:]+)$/) { |
my $user = $1; |
my $user = $1; |
Line 1178 sub delete_group {
|
Line 1173 sub delete_group {
|
$usersettings{$groupname.':'.$user} = $now.':-1:'.$userprivs; |
$usersettings{$groupname.':'.$user} = $now.':-1:'.$userprivs; |
if (&Apache::lonnet::modify_group_roles($cdom,$cnum, |
if (&Apache::lonnet::modify_group_roles($cdom,$cnum, |
$groupname,$user, |
$groupname,$user, |
$now,'-1',$userprivs) |
$now,'-1',$userprivs, |
|
'',$context) |
eq 'ok') { |
eq 'ok') { |
$num_ok ++; |
$num_ok ++; |
push(@deleted,$user); |
push(@deleted,$user); |
Line 1338 sub reenable_group {
|
Line 1334 sub reenable_group {
|
my $num_users = 0; |
my $num_users = 0; |
my $num_ok = 0; |
my $num_ok = 0; |
my $num_fail = 0; |
my $num_fail = 0; |
|
my $context = 'reenablegroup'; |
my (%usersettings,@enabled,@unenabled); |
my (%usersettings,@enabled,@unenabled); |
my ($result,$message) = |
my ($result,$message) = |
&Apache::lonnet::toggle_coursegroup_status($cdom,$cnum,$groupname, |
&Apache::lonnet::toggle_coursegroup_status($cdom,$cnum,$groupname, |
Line 1357 sub reenable_group {
|
Line 1354 sub reenable_group {
|
if (&Apache::lonnet::modify_group_roles($cdom,$cnum, |
if (&Apache::lonnet::modify_group_roles($cdom,$cnum, |
$groupname,$user, |
$groupname,$user, |
$defend,$defstart, |
$defend,$defstart, |
$userprivs) eq 'ok') { |
$userprivs,'', |
|
$context) eq 'ok') { |
$num_ok ++; |
$num_ok ++; |
push(@enabled,$user); |
push(@enabled,$user); |
} else { |
} else { |
Line 1576 sub groupsettings_options {
|
Line 1574 sub groupsettings_options {
|
'for different group members?', |
'for different group members?', |
); |
); |
my ($crsquota,$freespace,$maxposs) = &get_quota_constraints($action,$stored); |
my ($crsquota,$freespace,$maxposs) = &get_quota_constraints($action,$stored); |
&topic_bar($r,$image,$lt{'gnde'}); |
$r->print(&Apache::lonhtmlcommon::topic_bar($image,$lt{'gnde'}).' |
$r->print(' |
|
<table class="LC_descriptive_input"> |
<table class="LC_descriptive_input"> |
<tr> |
<tr> |
<td class="LC_description">'.$lt{'gnam'}.':</td> |
<td class="LC_description">'.$lt{'gnam'}.':</td> |
Line 1715 sub membership_options {
|
Line 1712 sub membership_options {
|
|
|
my @sections = keys(%{$sectioncount}); |
my @sections = keys(%{$sectioncount}); |
|
|
&topic_bar($r,$image,$lt{'pipa'}); |
$r->print(&Apache::lonhtmlcommon::topic_bar($image,$lt{'pipa'}).' |
$r->print(' |
|
<b>'.$lt{'gmem'}.'</b><br />'.$lt{'picr'}); |
<b>'.$lt{'gmem'}.'</b><br />'.$lt{'picr'}); |
if ($action eq 'create') { |
if ($action eq 'create') { |
$r->print($lt{'meof'}.'<br />'.$lt{'ifno'}.'<br />'.$lt{'asub'}); |
$r->print($lt{'meof'}.'<br />'.$lt{'ifno'}.'<br />'.$lt{'asub'}); |
Line 1786 sub access_date_settings {
|
Line 1782 sub access_date_settings {
|
} |
} |
} |
} |
my ($table) = &date_setting_table($starttime,$endtime,$formname); |
my ($table) = &date_setting_table($starttime,$endtime,$formname); |
&topic_bar($r,$image,$lt{'sten'}); |
$r->print(&Apache::lonhtmlcommon::topic_bar($image,$lt{'sten'}).' |
$r->print(' |
|
'.$table.' |
'.$table.' |
'); |
'); |
return; |
return; |
Line 2025 sub pick_new_members {
|
Line 2020 sub pick_new_members {
|
$r->print(&check_uncheck_tools($r,$available)); |
$r->print(&check_uncheck_tools($r,$available)); |
} |
} |
} |
} |
&topic_bar($r,$img,$lt{'gpme'}); |
$r->print(&Apache::lonhtmlcommon::topic_bar($img,$lt{'gpme'})); |
if (keys(%members) > 0) { |
if (keys(%members) > 0) { |
$r->print(' |
$r->print(' |
<table> |
<table> |
Line 2174 sub privilege_specificity {
|
Line 2169 sub privilege_specificity {
|
} |
} |
} |
} |
} |
} |
&topic_bar($r,$img,$lt{'uprv'}); |
$r->print(&Apache::lonhtmlcommon::topic_bar($img,$lt{'uprv'})); |
if ((($action eq 'create') && (@{$available} > 0)) || |
if ((($action eq 'create') && (@{$available} > 0)) || |
(($action eq 'modify') && ($formname eq 'change_settings'))) { |
(($action eq 'modify') && ($formname eq 'change_settings'))) { |
my %specific = ( |
my %specific = ( |
Line 2415 sub change_members_form {
|
Line 2410 sub change_members_form {
|
$r->print(' |
$r->print(' |
<br /> |
<br /> |
'); |
'); |
&topic_bar($r,1,$lt{'grse'}); |
$r->print(&Apache::lonhtmlcommon::topic_bar(1,$lt{'grse'})); |
&print_current_settings($r,$action,$functions,$startdate,$enddate, |
&print_current_settings($r,$action,$functions,$startdate,$enddate, |
$groupname,$description,$granularity,$quota, |
$groupname,$description,$granularity,$quota, |
\@available,\@unavailable,$gpterm,$ucgpterm); |
\@available,\@unavailable,$gpterm,$ucgpterm); |
&topic_bar($r,2,$lt{'mogm'}); |
$r->print(&Apache::lonhtmlcommon::topic_bar(2,$lt{'mogm'})); |
my $numcurrent = ¤t_membership($r,$cdom,$cnum,$formname,$groupname, |
my $numcurrent = ¤t_membership($r,$cdom,$cnum,$formname,$groupname, |
\@available,\@unavailable,$fixedprivs, |
\@available,\@unavailable,$fixedprivs, |
$granularity,$specificity); |
$granularity,$specificity); |
Line 2669 sub change_privs_form {
|
Line 2664 sub change_privs_form {
|
} else { |
} else { |
$nexttext = $$navbuttons{'mose'}; |
$nexttext = $$navbuttons{'mose'}; |
} |
} |
&topic_bar($r,3,&mt('Members to delete or expire')); |
$r->print(&Apache::lonhtmlcommon::topic_bar(3,&mt('Members to delete or expire'))); |
my $exp_or_del = 0; |
my $exp_or_del = 0; |
if (ref($$memchg{'deletion'}) eq 'ARRAY') { |
if (ref($$memchg{'deletion'}) eq 'ARRAY') { |
if (@{$$memchg{'deletion'}} > 0) { |
if (@{$$memchg{'deletion'}} > 0) { |
Line 2697 sub change_privs_form {
|
Line 2692 sub change_privs_form {
|
$r->print($lt{'nome'}.'<br />'); |
$r->print($lt{'nome'}.'<br />'); |
} |
} |
|
|
&topic_bar($r,4,&mt('Setting optional privileges for specific group members')); |
$r->print(&Apache::lonhtmlcommon::topic_bar(4,&mt('Setting optional privileges for specific group members'))); |
|
|
my $numchgs = &member_privileges_form($r,$action,$formname,$tools, |
my $numchgs = &member_privileges_form($r,$action,$formname,$tools, |
$toolprivs,$fixedprivs,$userdata, |
$toolprivs,$fixedprivs,$userdata, |
Line 2754 sub choose_privs_form {
|
Line 2749 sub choose_privs_form {
|
$nexttext = $$navbuttons{'adme'}; |
$nexttext = $$navbuttons{'adme'}; |
} |
} |
|
|
&topic_bar($r,6,&mt('Setting optional privileges for specific group members')); |
$r->print(&Apache::lonhtmlcommon::topic_bar(6,&mt('Setting optional privileges for specific group members'))); |
|
|
&member_privileges_form($r,$action,$formname,$tools,$toolprivs, |
&member_privileges_form($r,$action,$formname,$tools,$toolprivs, |
$fixedprivs,$userdata,$usertools,$idx,undef, |
$fixedprivs,$userdata,$usertools,$idx,undef, |
Line 3231 sub process_membership {
|
Line 3226 sub process_membership {
|
my %curr_start = (); |
my %curr_start = (); |
my %curr_end = (); |
my %curr_end = (); |
my %tooltype = (); |
my %tooltype = (); |
|
my $context = 'processgroupmembership'; |
|
|
foreach my $tool (@{$tools}) { |
foreach my $tool (@{$tools}) { |
foreach my $priv (sort(keys(%{$$toolprivs{$tool}}))) { |
foreach my $priv (sort(keys(%{$$toolprivs{$tool}}))) { |
Line 3300 sub process_membership {
|
Line 3296 sub process_membership {
|
$curr_privs{$user}; |
$curr_privs{$user}; |
if (&Apache::lonnet::modify_group_roles($cdom,$cnum,$groupname, |
if (&Apache::lonnet::modify_group_roles($cdom,$cnum,$groupname, |
$user,$now,$savestart, |
$user,$now,$savestart, |
$curr_privs{$user}) eq 'ok') { |
$curr_privs{$user},'',$context) eq 'ok') { |
push(@{$added{'expired'}},$user); |
push(@{$added{'expired'}},$user); |
$num_ok ++; |
$num_ok ++; |
} else { |
} else { |
Line 3311 sub process_membership {
|
Line 3307 sub process_membership {
|
foreach my $user (@deletion) { |
foreach my $user (@deletion) { |
$usersettings{$groupname.':'.$user} = $now.':-1:'; |
$usersettings{$groupname.':'.$user} = $now.':-1:'; |
if (&Apache::lonnet::modify_group_roles($cdom,$cnum,$groupname, |
if (&Apache::lonnet::modify_group_roles($cdom,$cnum,$groupname, |
$user,$now,'-1','') |
$user,$now,'-1','','',$context) |
eq 'ok') { |
eq 'ok') { |
push(@{$added{'deleted'}},$user); |
push(@{$added{'deleted'}},$user); |
$num_ok ++; |
$num_ok ++; |
Line 3365 sub process_membership {
|
Line 3361 sub process_membership {
|
$group_privs{$user}; |
$group_privs{$user}; |
if (&Apache::lonnet::modify_group_roles($cdom,$cnum,$groupname, |
if (&Apache::lonnet::modify_group_roles($cdom,$cnum,$groupname, |
$user,$end,$start, |
$user,$end,$start, |
$group_privs{$user}) eq 'ok') { |
$group_privs{$user},'',$context) eq 'ok') { |
push(@{$added{$type}},$user); |
push(@{$added{$type}},$user); |
$num_ok ++; |
$num_ok ++; |
} else { |
} else { |
Line 3461 sub automapping {
|
Line 3457 sub automapping {
|
if (exists($$stored{'autodrop'})) { |
if (exists($$stored{'autodrop'})) { |
$drop = $$stored{'autodrop'}; |
$drop = $$stored{'autodrop'}; |
} |
} |
&topic_bar($r,$image,$$lt{'endi'}); |
$r->print(&Apache::lonhtmlcommon::topic_bar($image,$$lt{'endi'}).' |
$r->print(' |
|
<b>'.$$lt{'gmma'}.':</b><br />'.$$lt{'adds'}.'<br />'.$$lt{'drops'}.'<br /><br /> |
<b>'.$$lt{'gmma'}.':</b><br />'.$$lt{'adds'}.'<br />'.$$lt{'drops'}.'<br /><br /> |
<nobr>'.$$lt{'auad'}.': |
<nobr>'.$$lt{'auad'}.': |
<label><input type="radio" name="autoadd" value="on" />on </label><label><input type="radio" name="autoadd" value="off" checked="checked" />off</label>'); |
<label><input type="radio" name="autoadd" value="on" />on </label><label><input type="radio" name="autoadd" value="off" checked="checked" />off</label>'); |
Line 3489 sub mapping_settings {
|
Line 3484 sub mapping_settings {
|
} else { |
} else { |
@sections = ('all','none'); |
@sections = ('all','none'); |
} |
} |
&topic_bar($r,$image,$$lt{'pirs'}); |
$r->print(&Apache::lonhtmlcommon::topic_bar($image,$$lt{'pirs'})); |
my @roles = &standard_roles(); |
my @roles = &standard_roles(); |
my %customroles = &Apache::lonhtmlcommon::course_custom_roles($cdom,$cnum); |
my %customroles = &Apache::lonhtmlcommon::course_custom_roles($cdom,$cnum); |
$r->print(&Apache::loncommon::start_data_table(). |
$r->print(&Apache::loncommon::start_data_table(). |
Line 3724 sub add_group_folder {
|
Line 3719 sub add_group_folder {
|
$outcome = &mt('Could not obtain exclusive lock to check status of the folder for all groups. No group folder added.'); |
$outcome = &mt('Could not obtain exclusive lock to check status of the folder for all groups. No group folder added.'); |
return $outcome; |
return $outcome; |
} |
} |
my $grpfolder = &mt('[_1] Folder -',$ucgpterm,).$description; |
my $grpfolder = &mt($ucgpterm.' Folder - [_1]',$description); |
$grppage='/adm/'.$cdom.'/'.$cnum.'/'.$groupname.'/smppg'; |
$grppage='/adm/'.$cdom.'/'.$cnum.'/'.$groupname.'/smppg'; |
my $grptitle = &mt('Group homepage').' - '.$description; |
my $grptitle = &mt('Group homepage - [_1]',$description); |
my ($discussions,$disctitle); |
my ($discussions,$disctitle); |
my $outcome = &map_updater($cdom,$cnum,'group_folder_'.$groupname.'.sequence', |
my $outcome = &map_updater($cdom,$cnum,'group_folder_'.$groupname.'.sequence', |
'grpseq',$grpfolder,$allgrpsmap,$grppage, |
'grpseq',$grpfolder,$allgrpsmap,$grppage, |
Line 3990 sub validate_groupname {
|
Line 3985 sub validate_groupname {
|
return; |
return; |
} |
} |
|
|
sub topic_bar { |
|
my ($r,$imgnum,$title) = @_; |
|
$r->print(' |
|
<div class="LC_topic_bar"> |
|
<img alt="'.&mt('Step [_1]',$imgnum). |
|
'"src="/res/adm/pages/bl_step'.$imgnum.'.gif" /> |
|
<span>'.$title.'</span> |
|
</div> |
|
'); |
|
return; |
|
} |
|
|
|
sub check_changes { |
sub check_changes { |
my ($member_changes,$memchg) = @_; |
my ($member_changes,$memchg) = @_; |
my %exclusions; |
my %exclusions; |